git: 60f8d36f7eed - main - nanobsd: embedded: Fix more regressions from last cleanup

From: Jose Luis Duran <jlduran_at_FreeBSD.org>
Date: Thu, 19 Mar 2026 17:15:28 UTC
The branch main has been updated by jlduran:

URL: https://cgit.FreeBSD.org/src/commit/?id=60f8d36f7eedf397a8ec21ce58cb33a26f1aa4fc

commit 60f8d36f7eedf397a8ec21ce58cb33a26f1aa4fc
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2026-03-19 17:13:59 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2026-03-19 17:13:59 +0000

    nanobsd: embedded: Fix more regressions from last cleanup
    
    Commit c99bb5747f5e changed "()" grouping into "{}", but in these cases
    we chdir and depended on the subshell not changing the directory for the
    caller.  Restore the old behavior.  While things appear to work without
    this change, the previous code was intentionally structured this way.
    
    Reviewed by:    imp
    Fixes:          c99bb5747f5e ("nanobsd: minor formatting cleanup")
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D54978
---
 tools/tools/nanobsd/embedded/common | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/tools/nanobsd/embedded/common b/tools/tools/nanobsd/embedded/common
index 69a7eb8bf848..bb3a2d707967 100644
--- a/tools/tools/nanobsd/embedded/common
+++ b/tools/tools/nanobsd/embedded/common
@@ -116,11 +116,11 @@ add_etc_make_conf() {
 }
 customize_cmd add_etc_make_conf
 
-cust_install_machine_files() {
+cust_install_machine_files() (
 	echo "cd ${NANO_CFG_BASE}/Files"
 	cd ${NANO_CFG_BASE}/Files
 	find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv ${NANO_WORLDDIR}
-}
+)
 customize_cmd cust_install_files
 customize_cmd cust_install_machine_files
 
@@ -431,7 +431,7 @@ typical_embedded() {
 }
 customize_cmd typical_embedded
 
-fix_pkg() {
+fix_pkg() (
 	chdir ${NANO_WORLDDIR}
 	mkdir -p pkg
 	mkdir -p pkg/db
@@ -450,7 +450,7 @@ fix_pkg() {
 	echo "./pkg/db type=dir uname=root gname=wheel mode=0755"
 	echo "./pkg/tmp type=dir uname=root gname=wheel mode=0755"
 	) >> ${NANO_METALOG}
-}
+)
 customize_cmd fix_pkg
 
 save_build() {
@@ -476,7 +476,7 @@ customize_cmd shrink_md_fbsize
 
 customize_cmd cust_comconsole
 
-dos_boot_part() {
+dos_boot_part() (
 	local d=/usr/local/share/u-boot/${NANO_BOOT_PKG}
 	local f=${NANO_FAT_DIR}
 
@@ -493,7 +493,7 @@ dos_boot_part() {
 
 	# Now we need to copy over dtb files from the build.
 	cp ${NANO_WORLDDIR}/boot/dtb/*.dtb .
-}
+)
 
 if [ -n "$NANO_BOOT_PKG" ]; then
 	d=/usr/local/share/u-boot/${NANO_BOOT_PKG}