From 0aa47add4393de1ca75b4ad26bc4a41402b7f6052053e4bb7ff8db1e32f89ac5 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Thu, 26 Aug 2021 08:56:58 +0000 Subject: [PATCH 1/3] Accepting request 913756 from home:lnussel:usrmove - use %ghost for /bin, /sbin, /lib and /lib64 to avoid file conflict with pre-usrmerge filesystem package (boo#1188847). OBS-URL: https://build.opensuse.org/request/show/913756 OBS-URL: https://build.opensuse.org/package/show/Base:System/filesystem?expand=0&rev=212 --- filesystem.changes | 6 ++++++ filesystem.links | 2 +- filesystem.spec | 17 ++++++++--------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/filesystem.changes b/filesystem.changes index f3db083..9d2174e 100644 --- a/filesystem.changes +++ b/filesystem.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 23 11:49:33 UTC 2021 - Ludwig Nussel + +- use %ghost for /bin, /sbin, /lib and /lib64 to avoid file conflict + with pre-usrmerge filesystem package (boo#1188847). + ------------------------------------------------------------------- Mon Aug 2 07:55:40 UTC 2021 - Ludwig Nussel diff --git a/filesystem.links b/filesystem.links index 4cf1248..fc09b0d 100644 --- a/filesystem.links +++ b/filesystem.links @@ -2,4 +2,4 @@ # Required for FHS 2.1 spool/mail /var/mail # systemd -../run /var/run +../run /var/run %ghost diff --git a/filesystem.spec b/filesystem.spec index 05d83c9..27d15b1 100644 --- a/filesystem.spec +++ b/filesystem.spec @@ -161,11 +161,11 @@ echo "%%defattr(-,root,root)" > filesystem.list cat %{SOURCE64} >> directory.list %endif cat >> filesystem.links << EOF -usr/bin /bin -usr/sbin /sbin -usr/lib /lib +usr/bin /bin %%ghost +usr/sbin /sbin %%ghost +usr/lib /lib %%ghost %ifarch s390x %sparc x86_64 ppc64 ppc aarch64 ppc64le riscv64 -usr/lib64 /lib64 +usr/lib64 /lib64 %%ghost %endif EOF cat >> directory.list <> filesystem.list ;; - *) echo "$DEST" >> filesystem.list ;; + *) echo "$ATTR${ATTR:+ }$DEST" >> filesystem.list ;; esac # for tmpfiles.d case $DEST in From 1868e87b52baad0eda0ce38b8957b2287b6bb6a977167ae10ea15650eda022dd Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Thu, 26 Aug 2021 09:10:49 +0000 Subject: [PATCH 2/3] osc copypac from project:Base:System package:filesystem revision:211 OBS-URL: https://build.opensuse.org/package/show/Base:System/filesystem?expand=0&rev=213 --- filesystem.changes | 6 ------ filesystem.links | 2 +- filesystem.spec | 17 +++++++++-------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/filesystem.changes b/filesystem.changes index 9d2174e..f3db083 100644 --- a/filesystem.changes +++ b/filesystem.changes @@ -1,9 +1,3 @@ -------------------------------------------------------------------- -Mon Aug 23 11:49:33 UTC 2021 - Ludwig Nussel - -- use %ghost for /bin, /sbin, /lib and /lib64 to avoid file conflict - with pre-usrmerge filesystem package (boo#1188847). - ------------------------------------------------------------------- Mon Aug 2 07:55:40 UTC 2021 - Ludwig Nussel diff --git a/filesystem.links b/filesystem.links index fc09b0d..4cf1248 100644 --- a/filesystem.links +++ b/filesystem.links @@ -2,4 +2,4 @@ # Required for FHS 2.1 spool/mail /var/mail # systemd -../run /var/run %ghost +../run /var/run diff --git a/filesystem.spec b/filesystem.spec index 27d15b1..05d83c9 100644 --- a/filesystem.spec +++ b/filesystem.spec @@ -161,11 +161,11 @@ echo "%%defattr(-,root,root)" > filesystem.list cat %{SOURCE64} >> directory.list %endif cat >> filesystem.links << EOF -usr/bin /bin %%ghost -usr/sbin /sbin %%ghost -usr/lib /lib %%ghost +usr/bin /bin +usr/sbin /sbin +usr/lib /lib %ifarch s390x %sparc x86_64 ppc64 ppc aarch64 ppc64le riscv64 -usr/lib64 /lib64 %%ghost +usr/lib64 /lib64 %endif EOF cat >> directory.list <> filesystem.list ;; + /var/run|/var/lock) echo "%ghost $DEST" >> filesystem.list ;; + *) echo "$DEST" >> filesystem.list ;; esac # for tmpfiles.d case $DEST in From ea9b4c2ca9dc16b137b6abbaafb5065ea206bd137e600da5cb0fe2d2202aca02 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Mon, 4 Oct 2021 12:43:27 +0000 Subject: [PATCH 3/3] Accepting request 918730 from home:lnussel:usrmove - don't perform UsrMerge if ZYPP_SINGLE_RPMTRANS is set. Rely on file trigger compat mode in that case and do it posttrans (boo#1189788). - generic %ghost handling instead of hardcoding OBS-URL: https://build.opensuse.org/request/show/918730 OBS-URL: https://build.opensuse.org/package/show/Base:System/filesystem?expand=0&rev=214 --- filesystem.changes | 8 ++++++++ filesystem.links | 2 +- filesystem.spec | 24 +++++++++++++++++++----- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/filesystem.changes b/filesystem.changes index f3db083..11ce9b5 100644 --- a/filesystem.changes +++ b/filesystem.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Aug 27 07:26:40 UTC 2021 - Ludwig Nussel + +- don't perform UsrMerge if ZYPP_SINGLE_RPMTRANS is set. Rely on + file trigger compat mode in that case and do it posttrans + (boo#1189788). +- generic %ghost handling instead of hardcoding + ------------------------------------------------------------------- Mon Aug 2 07:55:40 UTC 2021 - Ludwig Nussel diff --git a/filesystem.links b/filesystem.links index 4cf1248..fc09b0d 100644 --- a/filesystem.links +++ b/filesystem.links @@ -2,4 +2,4 @@ # Required for FHS 2.1 spool/mail /var/mail # systemd -../run /var/run +../run /var/run %ghost diff --git a/filesystem.spec b/filesystem.spec index 05d83c9..e10e7d3 100644 --- a/filesystem.spec +++ b/filesystem.spec @@ -122,7 +122,21 @@ for i in pairs(dirs) do end end if needmigrate then + if posix.getenv("ZYPP_SINGLE_RPMTRANS") == "1" then + print("Warning: UsrMerge executed in single transcation mode") + if not posix.stat("/usr/lib/rpm/lua/usrmerge.lua") then + error("ERROR: compat-usrmerge file triggers not installed.\n!!! This will go horribly wrong. You need a rescue system now !!!") + end + rpm.define("_filesystem_need_posttrans_convertfs 1") + else assert(os.execute("/usr/libexec/convertfs")) + end +end +EOF + +cat > posttrans.lua <<'EOF' +if rpm.expand("%%%%{?_filesystem_need_posttrans_convertfs}") == "1" then + assert(os.execute("/usr/libexec/convertfs")) end EOF @@ -176,9 +190,9 @@ while read MOD OWN GRP NAME ; do create_dir $MOD $OWN $GRP $NAME done < directory.list # ghost files next -cat ghost.list | while read MOD OWN GRP NAME ; do +while read MOD OWN GRP NAME ; do create_dir $MOD $OWN $GRP $NAME "%%ghost " -done +done < ghost.list # arch specific leftovers for march in \ %ifarch %ix86 @@ -216,7 +230,7 @@ done create_dir 0755 root root /emul/ia32-linux %endif # now do the links -while read SRC DEST ; do +while read SRC DEST ATTR ; do case $SRC in "") continue ;; \#*) echo "comment: $SRC $DEST" ;; @@ -229,8 +243,7 @@ case $SRC in esac ln -sf $SRC $RPM_BUILD_ROOT$DEST case $DEST in - /var/run|/var/lock) echo "%ghost $DEST" >> filesystem.list ;; - *) echo "$DEST" >> filesystem.list ;; + *) echo "$ATTR${ATTR:+ }$DEST" >> filesystem.list ;; esac # for tmpfiles.d case $DEST in @@ -305,6 +318,7 @@ install -m 0644 fs-var-tmp.conf $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/fs-var-tmp.c %pretrans -p -f pretrans.lua %pre -p -f pre.lua +%posttrans -p -f posttrans.lua %files -f filesystem.list /usr/lib/tmpfiles.d/fs-tmp.conf