builder: copy files to avoid making etc read-only

This caused lines like this to appear in the logs:

.../sed: couldn't open temporary file .../etc/sed6fJsn9: Permission denied

These errors caused some changes to /etc/group to be missed.
This commit is contained in:
Thomas Nixon 2022-06-06 00:59:49 +01:00
parent f682ef9c0f
commit 051b9df050
1 changed files with 5 additions and 1 deletions

View File

@ -73,11 +73,15 @@ stdenv.mkDerivation {
# Hack around broken check for gcc
touch staging_dir/host/.prereq-build
''}
${lib.optionalString (files != null)
# copy files to avoid making etc read-only
"cp -r --no-preserve=all ${files} files"
}
make image SHELL=${runtimeShell} \
PROFILE="${profile}" \
PACKAGES="${lib.concatStringsSep " " packages}" \
${lib.optionalString (files != null)
''FILES="${files}"''
''FILES=./files''
} \
DISABLED_SERVICES="${lib.concatStringsSep " " disabledServices}" \
EXTRA_IMAGE_NAME="${extraImageName}"