git: 4223c668e4b9 - main - nanobsd: Use the real path for NANO_PACKAGE_DIR

From: Jose Luis Duran <jlduran_at_FreeBSD.org>
Date: Sat, 16 Nov 2024 07:23:48 UTC
The branch main has been updated by jlduran:

URL: https://cgit.FreeBSD.org/src/commit/?id=4223c668e4b9ba71e2c6cfabbd66795729b7ff8b

commit 4223c668e4b9ba71e2c6cfabbd66795729b7ff8b
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2024-11-12 20:17:14 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2024-11-16 07:06:14 +0000

    nanobsd: Use the real path for NANO_PACKAGE_DIR
    
    As users may have the Pkg directory as a symbolic link to the NanoBSD
    "package dump directory".  In commit 9af130ae8c03, cust_pkgng() was
    greatly improved, however as a side effect of using a nullfs mount, the
    directories and files must not be symlinks.
    
    Fix it by using NANO_PACKAGE_DIR realpath().
    
    PR:             269884
    Reviewed by:    imp
    Approved by:    emaste (mentor)
    MFC after:      1 month
    Differential Revision:  https://reviews.freebsd.org/D47532
---
 tools/tools/nanobsd/defaults.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 0161a8ab8fd3..1e38a07337c7 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -788,6 +788,7 @@ cust_pkgng ( ) (
 	fi
 
 	# If the package directory doesn't exist, we're done.
+	NANO_PACKAGE_DIR="$(realpath $NANO_PACKAGE_DIR)"
 	if [ ! -d ${NANO_PACKAGE_DIR} ]; then
 		echo "DONE 0 packages"
 		return 0