etc: rename the temporary dirs so that they are recognisable

This makes it a lot easier to understand which dir is which
This commit is contained in:
r-vdp 2024-09-05 15:26:54 +02:00
parent 7715240587
commit a2d4cea96e
No known key found for this signature in database

View File

@ -231,13 +231,13 @@ in
if [[ ! $IN_NIXOS_SYSTEMD_STAGE1 ]] && [[ "${config.system.build.etc}/etc" != "$(readlink -f /run/current-system/etc)" ]]; then if [[ ! $IN_NIXOS_SYSTEMD_STAGE1 ]] && [[ "${config.system.build.etc}/etc" != "$(readlink -f /run/current-system/etc)" ]]; then
echo "remounting /etc..." echo "remounting /etc..."
tmpMetadataMount=$(mktemp --directory) tmpMetadataMount=$(mktemp --directory -t nixos-etc-metadata.XXXXXXXXXX)
mount --type erofs ${config.system.build.etcMetadataImage} $tmpMetadataMount mount --type erofs ${config.system.build.etcMetadataImage} $tmpMetadataMount
# Mount the new /etc overlay to a temporary private mount. # Mount the new /etc overlay to a temporary private mount.
# This needs the indirection via a private bind mount because you # This needs the indirection via a private bind mount because you
# cannot move shared mounts. # cannot move shared mounts.
tmpEtcMount=$(mktemp --directory) tmpEtcMount=$(mktemp --directory -t nixos-etc.XXXXXXXXXX)
mount --bind --make-private $tmpEtcMount $tmpEtcMount mount --bind --make-private $tmpEtcMount $tmpEtcMount
mount --type overlay overlay \ mount --type overlay overlay \
--options lowerdir=$tmpMetadataMount::${config.system.build.etcBasedir},${etcOverlayOptions} \ --options lowerdir=$tmpMetadataMount::${config.system.build.etcBasedir},${etcOverlayOptions} \