Blame SOURCES/rear-bz2119501.patch

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