Skip to content

Commit 97de4d9

Browse files
authored
Merge pull request #503 from andre4ik3/fix-chmod
Don't create/chmod `/mnt/tmp` unless necessary
2 parents 5e5a6df + 0c70c69 commit 97de4d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/nixos-anywhere.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,9 +722,12 @@ set -eu ${enableDebug}
722722
# when running not in nixos we might miss this directory, but it's needed in the nixos chroot during installation
723723
export PATH="\$PATH:/run/current-system/sw/bin"
724724
725-
# needed for installation if initrd-secrets are used
726-
mkdir -p /mnt/tmp
727-
chmod 777 /mnt/tmp
725+
if [ ! -d "/mnt/tmp" ]; then
726+
# needed for installation if initrd-secrets are used
727+
mkdir -p /mnt/tmp
728+
chmod 777 /mnt/tmp
729+
fi
730+
728731
if [ ${copyHostKeys-n} = "y" ]; then
729732
# NB we copy host keys that are in turn copied by kexec installer.
730733
mkdir -m 755 -p /mnt/etc/ssh

0 commit comments

Comments
 (0)