Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2026 18:12:58 +0000
From:      Jose Luis Duran <jlduran@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 6eccd84bee75 - main - nanobsd: Make tgt_dir2symlink() take a mode
Message-ID:  <696bd12a.3b473.7e0225f3@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by jlduran:

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

commit 6eccd84bee75d2db2bb2ce121ff745c843e94efe
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2026-01-17 18:03:50 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2026-01-17 18:03:50 +0000

    nanobsd: Make tgt_dir2symlink() take a mode
    
    Make tgt_dir2symlink() take an optional third argument that sets the
    mode.  By default, assume an absolute mode of 0777, to maintain
    backward compatibility.
    
    Reviewed by:    imp, emaste
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D48782
---
 tools/tools/nanobsd/defaults.sh | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 8d0c1e068048..2307874fb75c 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -266,22 +266,23 @@ tgt_touch() (
 )
 
 #
-# Convert a directory into a symlink. Takes two arguments, the
-# current directory and what it should become a symlink to. The
-# directory is removed and a symlink is created. If we're doing
+# Convert a directory into a symlink. Takes three arguments, the current
+# directory, what it should become a symlink to, and optionally, the mode.
+# The directory is removed and a symlink is created. If we're doing
 # a nopriv build, then append this fact to the metalog
 #
 tgt_dir2symlink() (
 	local dir=$1
 	local symlink=$2
+	local mode=${3:-0777}
 
 	cd "${NANO_WORLDDIR}"
 	rm -xrf "$dir"
-	ln -s "$symlink" "$dir"
+	ln -sf "$symlink" "$dir"
 	if [ -n "$NANO_METALOG" ]; then
 		echo "./${dir} type=link" \
 		    "uname=${NANO_DEF_UNAME} gname=${NANO_DEF_GNAME}" \
-		    "mode=0777 link=${symlink}" >> ${NANO_METALOG}
+		    "mode=${mode} link=${symlink}" >> ${NANO_METALOG}
 	fi
 )
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?696bd12a.3b473.7e0225f3>