File bind-mount.patch of Package transactional-update

Commit ID: cd90624391f7e3a1b5729387f7d757f42fc6fea9
Change ID: zqzppkqpslvrszwzqtxypzslzokuonwy
Author   : Danilo Spinella <danilo.spinella@suse.com> (2025-06-16 12:13:21)
Committer: Danilo Spinella <danilo.spinella@suse.com> (2025-07-02 16:12:10)
Signature: good signature by Danilo Spinella <danilo.spinella@suse.com> 1733BCAC9AF70936

    Do not change the source etc directory when syncing etc state

    Bind mount the source etc directory as read only and without access time
    to avoid changing any content or metadata.

diff --git a/dracut/transactional-update-sync-etc-state.sh b/dracut/transactional-update-sync-etc-state.sh
index 4be17b5af3..dd14158486 100755
--- a/dracut/transactional-update-sync-etc-state.sh
+++ b/dracut/transactional-update-sync-etc-state.sh
@@ -14,4 +14,8 @@
   mount --target-prefix "/sysroot/.snapshots/${parentid}/snapshot" --fstab /tmp/tu-fstab /etc
 fi
 
-/bin/transactional-update-sync-etc-state "/sysroot/.snapshots/${parentid}/snapshot/etc" "/sysroot/etc" "/sysroot/etc/etc.syncpoint"
+mkdir /tmp/etc-sync
+mount --bind "/sysroot/.snapshots/${parentid}/snapshot/etc" /tmp/etc-sync
+mount -o remount,ro,noatime /tmp/etc-sync
+
+/bin/transactional-update-sync-etc-state /tmp/etc-sync "/sysroot/etc" "/sysroot/etc/etc.syncpoint"
openSUSE Build Service is sponsored by