git: a7e4493778b0 - stable/13 - nanobsd: Use the real path for NANO_PACKAGE_DIR

From: Jose Luis Duran <jlduran_at_FreeBSD.org>
Date: Mon, 16 Dec 2024 15:15:24 UTC
The branch stable/13 has been updated by jlduran:

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

commit a7e4493778b02af51344ab6d217942c2440d3736
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2024-11-12 20:17:14 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2024-12-16 15:13:44 +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
    
    (cherry picked from commit 4223c668e4b9ba71e2c6cfabbd66795729b7ff8b)
---
 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 bb1e96b911e5..69e89958b02b 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