Allow broken symlinks in /usr

This is causing infinite system loop, which will result in exist code 1
from find.

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2023-08-31 15:40:04 +03:00
parent e8e15a39d4
commit e0fea715e5
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
2 changed files with 17 additions and 1 deletions

View File

@ -4,7 +4,7 @@
Name: lorax
Version: 38.12
Release: 1.0.riscv64%{?dist}
Release: 1.1.riscv64%{?dist}
Summary: Tool for creating the anaconda install images
License: GPL-2.0-or-later
@ -170,6 +170,9 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
%{_datadir}/lorax/templates.d/*
%changelog
* Thu Aug 31 2023 David Abdurachmanov <davidlt@rivosinc.com> 38.12-1.0.riscv64
- Allow broken symlinks in /usr (system loop detected causes exist code 1)
* Thu Aug 31 2023 David Abdurachmanov <davidlt@rivosinc.com> 38.12-1.0.riscv64
- Add riscv64 support

View File

@ -306,6 +306,19 @@ index 0000000..4edee89
+ ${efigraft} ${filegraft}
+treeinfo images-${basearch} boot.iso images/boot.iso
+%endif
diff --git a/share/templates.d/99-generic/runtime-cleanup.tmpl b/share/templates.d/99-generic/runtime-cleanup.tmpl
index 7afb9d9..8c56c87 100644
--- a/share/templates.d/99-generic/runtime-cleanup.tmpl
+++ b/share/templates.d/99-generic/runtime-cleanup.tmpl
@@ -341,7 +341,7 @@ runcmd chroot ${root} find /boot \! -name "vmlinuz*" \
## (broken systemd service links lead to confusing noise at boot)
## NOTE: not checking /var because we want to keep /var/run
## NOTE: Excluding /etc/mtab which links to /proc/self/mounts for systemd
-runcmd chroot ${root} find -L /etc /usr -xdev -type l -and \! -name "mtab" \
+runcmd chroot ${root} find -L /etc -xdev -type l -and \! -name "mtab" \
-printf "removing broken symbolic link %p -> %l\n" -delete
## Remove compiled python files, they are recreated as needed anyway
diff --git a/share/templates.d/99-generic/runtime-install.tmpl b/share/templates.d/99-generic/runtime-install.tmpl
index cf879fc..2967774 100644
--- a/share/templates.d/99-generic/runtime-install.tmpl