Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142484496
D48790.id150333.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48790.id150333.diff
View Options
diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -720,6 +720,50 @@
nano_umount ${mnt}
)
+_populate_part ( ) (
+ local dir fs lbl metalog size type
+ type=$1
+ fs=$2
+ dir=$3
+ lbl=$4
+ size=$5
+ metalog=$6
+
+ echo "Creating ${fs}"
+
+ # Use the directory provided, otherwise create an empty one temporarily.
+ if [ -n "${dir}" ] && [ -d "${dir}" ]; then
+ echo "Populating ${lbl} from ${dir}"
+ else
+ if [ "${type}" = "cfg" ]; then
+ dir=$(mktemp -d -p "${NANO_OBJ}" -t "${type}")
+ trap "rm -f ${dir}" 1 2 15 EXIT
+ fi
+ fi
+
+ if [ -d "${dir}" ]; then
+ # If there is no metalog, create one using the default
+ # NANO_DEF_UNAME and NANO_DEF_GNAME for all entries in the spec.
+ if [ -z "${metalog}" ]; then
+ metalog=$(mktemp -p "${NANO_OBJ}" -t "${type}")
+ trap "rm -f ${metalog}" 1 2 15 EXIT
+ echo "/set type=dir uname=${NANO_DEF_UNAME}" \
+ "gname=${NANO_DEF_GNAME} mode=0755" > "${metalog}"
+ echo ". type=dir uname=${NANO_DEF_UNAME}" \
+ "gname=${NANO_DEF_GNAME} mode=0755" >> "${metalog}"
+ (
+ cd "${dir}"
+ mtree -bc -k flags,gid,gname,link,mode,uid,uname |
+ mtree -C | tail -n +2 |
+ sed 's/uid=[[:digit:]]*/uname=root/g' |
+ sed 's/gid=[[:digit:]]*/gname=wheel/g' >> "${metalog}"
+ )
+ fi
+
+ nano_makefs "-DxZ ${NANO_MAKEFS}" "${metalog}" "${size}" "${fs}" "${dir}"
+ fi
+)
+
populate_cfg_slice ( ) (
populate_slice "$1" "$2" "$3" "$4"
)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 21, 8:18 AM (9 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27797617
Default Alt Text
D48790.id150333.diff (1 KB)
Attached To
Mode
D48790: nanobsd: Add a provisional populate_part function
Attached
Detach File
Event Timeline
Log In to Comment