diff options
| author | Warner Losh <imp@FreeBSD.org> | 2025-09-24 15:43:42 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2025-09-24 15:43:42 +0000 |
| commit | 2352b89d2f732e3fa33fbd494267f0d4cb917e51 (patch) | |
| tree | 0550cd8d49a1112a03b58bd0a2b0d790126307e7 | |
| parent | 57d5a8feda3fd25a650eaab5998db13633d62d2d (diff) | |
nanobsd: Fix regressions from last cleanup
c99bb5747f5e changed ( ) grouping into { }, but in these cases we chdir
and depended on the subshell not changing it for the caller. Restore the
old behavior. It seems to work w/o this change, true, but the old code
was intentionally like this.
Fixes: c99bb5747f5e
Sponsored by: Netflix
| -rwxr-xr-x | tools/tools/nanobsd/defaults.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 4f0cc2fa99bd..588758154c98 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -253,13 +253,13 @@ nano_global_make_env() { # Create empty files in the target tree, and record the fact. All paths # are relative to NANO_WORLDDIR. # -tgt_touch() { +tgt_touch() ( cd "${NANO_WORLDDIR}" for i; do touch $i echo "./${i} type=file" >> ${NANO_METALOG} done -} +) # # Convert a directory into a symlink. Takes two arguments, the @@ -267,7 +267,7 @@ tgt_touch() { # directory is removed and a symlink is created. If we're doing # a nopriv build, then append this fact to the metalog # -tgt_dir2symlink() { +tgt_dir2symlink() ( local dir=$1 local symlink=$2 @@ -277,7 +277,7 @@ tgt_dir2symlink() { if [ -n "$NANO_METALOG" ]; then echo "./${dir} type=link mode=0777 link=${symlink}" >> ${NANO_METALOG} fi -} +) # run in the world chroot, errors fatal CR() { @@ -766,14 +766,14 @@ cust_allow_ssh_root() { ####################################################################### # Install the stuff under ./Files -cust_install_files() { +cust_install_files() ( cd "${NANO_TOOLS}/Files" find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)/' | cpio ${CPIO_SYMLINK} -Ldumpv ${NANO_WORLDDIR} if [ -n "${NANO_CUST_FILES_MTREE}" -a -f ${NANO_CUST_FILES_MTREE} ]; then CR "mtree -eiU -p /" <${NANO_CUST_FILES_MTREE} fi -} +) ####################################################################### # Install packages from ${NANO_PACKAGE_DIR} |
