Blame SOURCES/rear-bz2119501.patch

d32ec1
diff --git a/usr/share/rear/build/default/490_fix_broken_links.sh b/usr/share/rear/build/default/490_fix_broken_links.sh
d32ec1
index 5bace664..cf960be8 100644
d32ec1
--- a/usr/share/rear/build/default/490_fix_broken_links.sh
d32ec1
+++ b/usr/share/rear/build/default/490_fix_broken_links.sh
d32ec1
@@ -7,6 +7,23 @@
d32ec1
 # see https://github.com/rear/rear/issues/1638
d32ec1
 # and https://github.com/rear/rear/pull/1734
d32ec1
 
d32ec1
+# Some broken symlinks are expected. The 'build' and 'source' symlinks in kernel modules point to kernel sources
d32ec1
+# and are broken untol one installs the kernel-debug-devel or kernel-devel packages (on Fedora) and even then
d32ec1
+# the targets are jot included in the rescue system by default.
d32ec1
+# Do not warn about those, it is just noise.
d32ec1
+local irrelevant_symlinks=( '*/lib/modules/*/build' '*/lib/modules/*/source' )
d32ec1
+function symlink_is_irrelevant () {
d32ec1
+    for i in "${irrelevant_symlinks[@]}"; do
d32ec1
+        # do not quote $i, it is a glob pattern, matching will be performed by [[ ... == ... ]]
d32ec1
+        # quoting inside [[ ]] prevents pattern matching
d32ec1
+        if [[ "$1" == $i ]]; then
d32ec1
+            return 0
d32ec1
+        fi
d32ec1
+    done
d32ec1
+    return 1
d32ec1
+}
d32ec1
+
d32ec1
+
d32ec1
 # FIXME: The following code fails if symlinks or their targets contain characters from IFS (e.g. blanks),
d32ec1
 # cf. the same kind of comments in build/default/990_verify_rootfs.sh
d32ec1
 # and layout/prepare/GNU/Linux/130_include_mount_subvolumes_code.sh
d32ec1
@@ -38,6 +55,10 @@ pushd $ROOTFS_DIR
d32ec1
     local broken_symlink=''
d32ec1
     local link_target=''
d32ec1
     for broken_symlink in $broken_symlinks ; do
d32ec1
+        if symlink_is_irrelevant "$broken_symlink" ; then
d32ec1
+            DebugPrint "Ignoring irrelevant broken symlink $broken_symlink"
d32ec1
+            continue
d32ec1
+        fi
d32ec1
         # For each broken symlink absolute path inside ROOTFS_DIR
d32ec1
         # we call "readlink -e" in the original system to get its link target there.
d32ec1
         # If in the original system there was a chain of symbolic links like