Page MenuHomeFreeBSD

D58969.id184541.diff
No OneTemporary

D58969.id184541.diff

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
@@ -112,8 +112,11 @@
#
NANO_SECTOR_SIZE=512
-# Target media size in 512 bytes sectors
-NANO_MEDIASIZE=4000000
+#
+# Target media size in bytes.
+# Commercial storage capacities are specified using SI decimal units
+#
+NANO_MEDIASIZE="2G"
# Number of code images on media (1 or 2)
NANO_IMAGES=2
@@ -125,32 +128,37 @@
NANO_INIT_IMG2=1
#
-# Size of code file system in 512 bytes sectors
+# Size of code file system in bytes
# If zero, size will be as large as possible.
#
NANO_CODESIZE=0
-# Size of configuration file system in 512 bytes sectors
+#
+# Size of configuration file system in bytes
# Cannot be zero.
-NANO_CONFSIZE=2048
+#
+NANO_CONFSIZE="1Mi"
-# Size of data file system in 512 bytes sectors
+# Size of data file system in bytes
# If zero: no partition configured.
# If negative: max size possible
NANO_DATASIZE=0
-# Size of the /etc ramdisk in 512 bytes sectors
-NANO_RAM_ETCSIZE=10240
+# Size of the /etc ramdisk in bytes
+NANO_RAM_ETCSIZE="5Mi"
-# Size of the /tmp+/var ramdisk in 512 bytes sectors
-NANO_RAM_TMPVARSIZE=81920
+# Size of the /tmp+/var ramdisk in bytes
+NANO_RAM_TMPVARSIZE="40Mi"
-# Size of swap partition in 512 bytes sectors
+# Size of swap partition in bytes
NANO_SWAP_SIZE=0
# Swap partition encryption
NANO_SWAP_ENCRYPTION=
+# EFI System Partition size in bytes
+NANO_EFI_BOOTPART_SIZE="260Mi"
+
# Progress Print level
PPLEVEL=3
@@ -1293,8 +1301,9 @@
rm -f "${NANO_METALOG}.conf"
fi
- echo "$NANO_RAM_ETCSIZE" > conf/base/etc/md_size
- echo "$NANO_RAM_TMPVARSIZE" > conf/base/var/md_size
+ # Size of the memory disk in 512-byte sectors, per diskless(8)
+ echo "$(( NANO_RAM_ETCSIZE / 512 ))" > conf/base/etc/md_size
+ echo "$(( NANO_RAM_TMPVARSIZE / 512 ))" > conf/base/var/md_size
tgt_touch conf/base/etc/md_size
tgt_touch conf/base/var/md_size
@@ -1443,7 +1452,7 @@
#
# Run makefs to create a UFS filesystem image from a source directory
# using a metalog spec and timestamp
-# Input: $1 = options, $2 = metalog path, $3 = size in sectors,
+# Input: $1 = options, $2 = metalog path, $3 = size in bytes,
# $4 = output image path, $5 = source dir
#
nano_makefs() {
@@ -1456,10 +1465,10 @@
if [ -n "$metalog" ] && [ -f "$metalog" ]; then
makefs -t ffs -DxZ ${options} -F "$metalog" -N "${NANO_WORLDDIR}/etc" \
- -R "${size}b" -T "$NANO_TIMESTAMP" "$image" "$dir"
+ -R "$size" -T "$NANO_TIMESTAMP" "$image" "$dir"
else
makefs -t ffs -Z ${options} -N "${NANO_WORLDDIR}/etc" \
- -R "${size}b" -T "$NANO_TIMESTAMP" "$image" "$dir"
+ -R "$size" -T "$NANO_TIMESTAMP" "$image" "$dir"
fi
}
@@ -1474,7 +1483,7 @@
#
# Create a UFS filesystem image from a directory
# Input: $1 = type (cfg/data), $2 = output image path, $3 = source dir,
-# $4 = label, $5 = size in sectors, $6 = metalog
+# $4 = label, $5 = size in bytes, $6 = metalog
#
populate_part() {
local dir fs lbl metalog size type
@@ -1515,15 +1524,14 @@
)
fi
- nano_makefs "${NANO_MAKEFS}" "${metalog}" "${size}" "${fs}" "${dir}"
+ nano_makefs "$NANO_MAKEFS" "$metalog" "$size" "$fs" "$dir"
fi
}
#
# Thin wrapper around populate_part for creating
# the configuration partition image file
-# Input: $1 = image path, $2 = source dir, $3 = slice number,
-# $4 = size in sectors, $5 = metalog
+# Input: $1 = image path, $2 = source dir, $3 = label, $4 = size, $5 = metalog
#
populate_cfg_part() {
populate_part "cfg" "$1" "$2" "$3" "$4" "$5"
@@ -1562,33 +1570,59 @@
}
#
-# Convert a human-readable size string with a suffix (b/k/m/g/t/w) into bytes.
-# Also accepts "x"-delimited products followed by a suffix (e.g., "2x1024k")
-# makefs(8)-size compatible. See NetBSD's strsuftoll(3)
-# Input: $1 = size string (e.g., "512m", "2x1024x1024k")
+# Convert a human-readable size string with a suffix into bytes.
+# Inspired by NetBSD's strsuftoll(3), humanize_number(3), and
+# newfs_msdos(8) argtooff().
+#
+# Supported suffixes:
+# k,m,g,t,p,e SI units (1000^n)
+# ki,mi,gi,ti,pi,ei IEC units (1024^n)
+# s NANO_SECTOR_SIZE-byte blocks (Default: 512 bytes)
+# w sizeof(int) (4 bytes)
+#
+# Also accepts "x"-delimited products followed by a suffix
+# (e.g., "2x1024k", "4x512ki").
+#
# Output: byte count
#
-strsuftoll() {
- local num result unit
+strtobytes() {
+ local input num result suffix
- num=${1%?}
- unit=${1#"${num}"}
+ case "$1" in
+ *[0-9a-zA-Z][Bb]) input=${1%?} ;;
+ *) input=$1 ;;
+ esac
- case "$unit" in
- [bB]) result="${num}x${NANO_SECTOR_SIZE}" ;;
- [kK]) result="${num}x1024" ;;
- [mM]) result="${num}x1024x1024" ;;
- [gG]) result="${num}x1024x1024x1024" ;;
- [tT]) result="${num}x1024x1024x1024x1024" ;;
- [wW]) result="${num}x4" ;; # sizeof(int)
- [0-9]) result="$1" ;;
- *)
- printf "%s\n" "'$1': illegal number"
- exit 1
- ;;
+ case "$input" in
+ *[Kk][Ii]) num=${input%??}; suffix=ki ;;
+ *[Mm][Ii]) num=${input%??}; suffix=mi ;;
+ *[Gg][Ii]) num=${input%??}; suffix=gi ;;
+ *[Tt][Ii]) num=${input%??}; suffix=ti ;;
+ *[Pp][Ii]) num=${input%??}; suffix=pi ;;
+ *[Ee][Ii]) num=${input%??}; suffix=ei ;;
+ *) num=${input%?}; suffix=${input#"${num}"} ;;
esac
- printf "%s" "$(echo "scale=0; $result" | tr 'x' '*' | bc)"
+ case "$suffix" in
+ [kK]) result="${num}x1000^1" ;;
+ [mM]) result="${num}x1000^2" ;;
+ [gG]) result="${num}x1000^3" ;;
+ [tT]) result="${num}x1000^4" ;;
+ [pP]) result="${num}x1000^5" ;;
+ [eE]) result="${num}x1000^6" ;;
+ ki) result="${num}x1024^1" ;;
+ mi) result="${num}x1024^2" ;;
+ gi) result="${num}x1024^3" ;;
+ ti) result="${num}x1024^4" ;;
+ pi) result="${num}x1024^5" ;;
+ ei) result="${num}x1024^6" ;;
+ [sS]) result="${num}x${NANO_SECTOR_SIZE:-512}" ;;
+ [wW]) result="${num}x4" ;; # sizeof(int)
+ [0-9]) result="$input" ;;
+ *) err "'$1': illegal number" ;;
+ esac
+
+ printf "%s" "$(printf 'scale=0; %s\n' "$result" | tr 'x' '*' | bc)"
}
#######################################################################
@@ -1717,46 +1751,83 @@
NANO_METALOG=${NANO_OBJ}/_.metalog
fi
+ #
+ # Keep legacy sizes in 512-byte sectors, except for variables
+ # in this file, which require sizes in bytes
+ #
+ if [ "$NANO_PLAN" = "legacy" ]; then
+ NANO_RAM_ETCSIZE=$(strtobytes "${NANO_RAM_ETCSIZE:-0}s")
+ NANO_RAM_TMPVARSIZE=$(strtobytes "${NANO_RAM_TMPVARSIZE:-0}s")
+ NANO_SWAP_SIZE=0
+ else
+ NANO_MEDIASIZE=$(strtobytes "${NANO_MEDIASIZE:-0}")
+ NANO_CODESIZE=$(strtobytes "${NANO_CODESIZE:-0}")
+ NANO_CONFSIZE=$(strtobytes "${NANO_CONFSIZE:-1Mi}")
+ NANO_DATASIZE=$(strtobytes "${NANO_DATASIZE:-0}")
+ NANO_RAM_ETCSIZE=$(strtobytes "${NANO_RAM_ETCSIZE:-0}")
+ NANO_RAM_TMPVARSIZE=$(strtobytes "${NANO_RAM_TMPVARSIZE:-0}")
+ NANO_SWAP_SIZE=$(strtobytes "${NANO_SWAP_SIZE:-0}")
+ NANO_EFI_BOOTPART_SIZE=$(strtobytes "${NANO_EFI_BOOTPART_SIZE:-0}")
+ fi
+
NANO_STARTTIME=$(date +%s)
- : ${NANO_TIMESTAMP:=${NANO_STARTTIME}}
+ : "${NANO_TIMESTAMP:=${NANO_STARTTIME}}"
+
+ if [ "$NANO_PLAN" = "legacy" ]; then
+ pprint 3 "Exporting Legacy NanoBSD variables"
+ export_var NANO_BOOT0CFG
+ export_var NANO_HEADS
+ export_var NANO_NEWFS
+ export_var NANO_SECTS
+ fi
+
pprint 3 "Exporting NanoBSD variables"
export_var MAKEOBJDIRPREFIX
export_var NANO_ARCH
+ export_var NANO_BOOTLOADER
export_var NANO_CODESIZE
export_var NANO_CONFSIZE
export_var NANO_CUSTOMIZE
export_var NANO_DATASIZE
export_var NANO_DISKIMGDIR
export_var NANO_DRIVE
- export_var NANO_HEADS
+ export_var NANO_EFI_BOOTPART_SIZE
export_var NANO_IMAGES
- export_var NANO_IMGNAME
export_var NANO_IMG1NAME
+ export_var NANO_IMGNAME
+ export_var NANO_LABEL
+ export_var NANO_LOG
export_var NANO_MAKE
export_var NANO_MAKEFS
export_var NANO_MAKE_CONF_BUILD
export_var NANO_MAKE_CONF_INSTALL
export_var NANO_MEDIASIZE
+ export_var NANO_METALOG
+ export_var NANO_MODULES
export_var NANO_NAME
export_var NANO_NCPU
- export_var NANO_NEWFS
+ export_var NANO_NOPKGBASE
+ export_var NANO_NOPRIV_BUILD
export_var NANO_OBJ
+ export_var NANO_PLAN
export_var NANO_PMAKE
- export_var NANO_SECTS
+ export_var NANO_RAM_ETCSIZE
export_var NANO_SRC
export_var NANO_SWAP_ENCRYPTION
export_var NANO_SWAP_SIZE
export_var NANO_TIMESTAMP
+ export_var NANO_RAM_TMPVARSIZE
export_var NANO_TOOLS
export_var NANO_WORLDDIR
- export_var NANO_BOOT0CFG
- export_var NANO_BOOTLOADER
- export_var NANO_LABEL
- export_var NANO_MODULES
- export_var NANO_NOPRIV_BUILD
- export_var NANO_METALOG
- export_var NANO_NOPKGBASE
- export_var NANO_LOG
export_var SRCCONF
export_var SRC_ENV_CONF
+
+ if [ -n "$NANO_CUSTOMIZE" ]; then
+ pprint 3 "Exporting NanoBSD customization variables"
+ export_var NANO_BOOT2CFG
+ export_var NANO_CUST_FILESDIR
+ export_var NANO_CUST_FILES_MTREE
+ export_var NANO_PACKAGE_LIST
+ export_var NANO_PKG_META_BASE
+ fi
}
diff --git a/tools/tools/nanobsd/embedded/common b/tools/tools/nanobsd/embedded/common
--- a/tools/tools/nanobsd/embedded/common
+++ b/tools/tools/nanobsd/embedded/common
@@ -69,7 +69,10 @@
echo "NANO_NAME not defined. Use foo.cfg instead."
fi
-NANO_SLICE_FAT_SIZE=32m
+# We define our own imaging plan, so instruct nanobsd not to define its own.
+NANO_PLAN=embedded
+
+NANO_SLICE_FAT_SIZE=32mi
NANO_SLICE_CFG_SIZE=32m
NANO_BOOT2CFG="-h -S115200"
@@ -208,7 +211,7 @@
FAT16MIN=2150400
FAT32MIN=34091008
- fat_size=$(strsuftoll "$NANO_SLICE_FAT_SIZE")
+ fat_size=$(strtobytes "$NANO_SLICE_FAT_SIZE")
if [ "$fat_size" -ge "$FAT32MIN" ]; then
fat_type=32
fat_scheme=fat32lba
diff --git a/tools/tools/nanobsd/gpt.sh b/tools/tools/nanobsd/gpt.sh
--- a/tools/tools/nanobsd/gpt.sh
+++ b/tools/tools/nanobsd/gpt.sh
@@ -35,9 +35,6 @@
#
NANO_BOOT_TYPE="BIOS UEFI"
-# EFI System Partition size in 512 bytes sectors
-NANO_EFI_BOOTPART_SIZE=532480
-
# Set NANO_LABEL to non-blank to form the basis for using /dev/gpt/code
# in preference to /dev/${NANO_DRIVE}
# Root partition will be /dev/gpt/${NANO_ROOT, NANO_ALTROOT}
@@ -62,7 +59,7 @@
NANO_BOOTLOADER="boot/gptboot"
-NANO_ALIGN="${NANO_ALIGN:-2048}"
+NANO_ALIGN="${NANO_ALIGN:-1MiB}"
NANO_CUST_FILESDIR="${NANO_TOOLS}/gpt/Files"
NANO_CUST_FILES_MTREE="${NANO_TOOLS}/gpt/Files.mtree"
@@ -166,7 +163,7 @@
FAT32MIN=34091008
esp_sects=$(awk -v label="$name" '$5 == label {print $4}' "${NANO_LOG}/_.partitioning")
- fat_size=$(strsuftoll "${esp_sects:-0}b")
+ fat_size=$(strtobytes "${esp_sects:-0}s")
if [ "$fat_size" -ge "$FAT32MIN" ]; then
fat_type=32
elif [ "$fat_size" -ge "$FAT16MIN" ]; then
@@ -212,28 +209,30 @@
#
# Calculate partition sizes aligned at NANO_ALIGN boundaries.
-# All sizes are in sectors.
+# All sizes are in bytes.
# The output is compatible with gpart restore
#
calculate_partitioning() {
- local boot_sects boot_size boot_type esp_sects
+ local align boot_sects boot_size boot_type esp_sects
+ align=$(strtobytes "$NANO_ALIGN")
boot_sects=0
+ boot_size=0
boot_type=0
esp_sects=0
if is_boot_type BIOS; then
boot_type=1
# Boot partition is exactly 512 KiB
- boot_size=$(strsuftoll 512k)
+ boot_size=$(strtobytes 512KiB)
boot_sects=$(( boot_size / NANO_SECTOR_SIZE ))
fi
- is_boot_type UEFI && esp_sects="$NANO_EFI_BOOTPART_SIZE"
+ is_boot_type UEFI && esp_sects=$(( NANO_EFI_BOOTPART_SIZE / NANO_SECTOR_SIZE ))
echo "$NANO_MEDIASIZE" "$NANO_IMAGES" "$NANO_SECTOR_SIZE" \
"$NANO_CODESIZE" "$NANO_CONFSIZE" "$NANO_DATASIZE" "$boot_type" \
"$boot_sects" "$esp_sects" "$NANO_SWAP_SIZE" "$NANO_ROOT" \
"$NANO_ALTROOT" "$NANO_PARTITION_CFG" "$NANO_PARTITION_DATA" \
- "$NANO_ALIGN" |
+ "$align" |
awk '
function roundup(sects) {
return int((sects + align - 1) / align) * align
@@ -241,7 +240,7 @@
function print_line(type, sects, label, windex, wtype, wblocks) {
windex = 3
wtype = ($7 == 1 || swap_sects > 0) ? length("freebsd-swap") : length("freebsd-ufs")
- wblocks = length($1)
+ wblocks = length(media_sects)
printf "%-*s %*s %*s %*s %s\n",
windex, i,
@@ -258,12 +257,15 @@
# Sector size
ssize = $3
+ # Media size in sectors
+ media_sects = int($1 / ssize)
+
# Align to a NANO_ALIGN boundary in sectors
- align = $15
+ align = int($15 / ssize)
# GPT backup metadata at the end of the disk in sectors
# (128 entries x 128 bytes + 1 header sector)
- gpt_end_sects = int(16384 / ssize) + 1
+ gpt_end_sects = int((128 * 128) / ssize) + 1
# Boot size in sectors (already rounded up)
boot_sects = ($8 > 0) ? $8 : 0
@@ -275,7 +277,7 @@
swap_sects = ($10 > 0) ? roundup($10) : 0
# Configuration partition size in sectors (rounded up)
- cfg_sects = roundup($5)
+ cfg_sects = roundup($5 / ssize)
# Data partition size in sectors (rounded up)
data_sects = ($6 > 0) ? roundup($6) : $6
@@ -284,7 +286,7 @@
sstart = 40
# Available sectors
- avail_sects = $1 - sstart - gpt_end_sects
+ avail_sects = media_sects - sstart - gpt_end_sects
# Print header (scheme and number of entries)
print "GPT 128"
@@ -311,7 +313,7 @@
}
# Code partition size in sectors
- code_sects = $4
+ code_sects = int($4 / ssize)
if (code_sects == 0) {
# (rounded down)
total_code_sects = avail_sects - cfg_sects - \
@@ -356,14 +358,15 @@
pprint 3 "log: ${NANO_OBJ}/_.cp"
(
- local IMG code_sects
+ local IMG code_sects code_size
IMG=${NANO_DISKIMGDIR}/${NANO_IMG1NAME}
code_sects=$(awk -v label="$NANO_ROOT" '$5 == label {print $4}' "${NANO_LOG}/_.partitioning")
+ code_size=$(( code_sects * NANO_SECTOR_SIZE ))
echo "Writing code image..."
nano_makefs "${NANO_MAKEFS} -o minfree=0,optimization=space" \
- "$NANO_METALOG" "$code_sects" "$IMG" "$NANO_WORLDDIR"
+ "$NANO_METALOG" "$code_size" "$IMG" "$NANO_WORLDDIR"
) > "${NANO_OBJ}/_.cp" 2>&1
}
@@ -377,13 +380,17 @@
pprint 3 "log: ${NANO_OBJ}/_.di"
(
- local IMG code_sects code_size
+ local IMG code_sects code_size cfg_sects cfg_size data_sects data_size
local bootcode cfg data efiboot0 gptboot0 swap0
local code1 "${NANO_ROOT}" code2 "${NANO_ALTROOT}" # XXXJL NANO_ALTROOT
IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME}
code_sects=$(awk -v label="$NANO_ROOT" '$5 == label {print $4}' "${NANO_LOG}/_.partitioning")
code_size=$(( code_sects * NANO_SECTOR_SIZE ))
+ cfg_sects=$(awk '$5 == "cfg" {print $4}' "${NANO_LOG}/_.partitioning")
+ cfg_size=$(( cfg_sects * NANO_SECTOR_SIZE ))
+ data_sects=$(awk '$5 == "data" {print $4}' "${NANO_LOG}/_.partitioning")
+ data_size=$(( data_sects * NANO_SECTOR_SIZE ))
# Build mkimg partition entries
if [ -f "${NANO_WORLDDIR}/boot/pmbr" ]; then
@@ -436,7 +443,7 @@
echo "Duplicating to second image..."
tgt_switch_root_fstab 1 2
nano_makefs "${NANO_MAKEFS} -o minfree=0,optimization=space" \
- "${NANO_METALOG}" "$code_sects" \
+ "${NANO_METALOG}" "$code_size" \
"${NANO_OBJ}/_.${NANO_ALTROOT}.image" "${NANO_WORLDDIR}"
tgt_switch_root_fstab 2 1
else
@@ -447,19 +454,19 @@
# Create cfg partition
populate_cfg_part "${NANO_OBJ}/_.cfg.image" \
- "$NANO_CFGDIR" "$NANO_PARTITION_CFG" "$NANO_CONFSIZE" \
+ "$NANO_CFGDIR" "$NANO_PARTITION_CFG" "$cfg_size" \
"$NANO_METALOG_CFG"
# Create data partition (if any)
if [ "${NANO_DATASIZE}" -ne 0 ]; then
populate_data_part "${NANO_OBJ}/_.data.image" \
- "$NANO_DATADIR" "$NANO_PARTITION_DATA" "$DATA_SIZE" \
+ "$NANO_DATADIR" "$NANO_PARTITION_DATA" "$data_size" \
"$NANO_METALOG_DATA"
fi
echo "Writing out ${NANO_IMGNAME}..."
mkimg -s gpt -S ${NANO_SECTOR_SIZE} \
- --capacity $(( NANO_MEDIASIZE * NANO_SECTOR_SIZE )) \
+ --capacity ${NANO_MEDIASIZE} \
${bootcode} \
${gptboot0} \
${efiboot0} \
diff --git a/tools/tools/nanobsd/legacy.sh b/tools/tools/nanobsd/legacy.sh
--- a/tools/tools/nanobsd/legacy.sh
+++ b/tools/tools/nanobsd/legacy.sh
@@ -33,6 +33,38 @@
[ -n "$NANO_SECTS" ] || NANO_SECTS=63
[ -n "$NANO_HEADS" ] || NANO_HEADS=16
+#
+# Sector size in bytes.
+# Accepts suffixes and products (4k, 1M, 4x1024)
+#
+NANO_SECTOR_SIZE=512
+
+# Target media size in 512 bytes sectors
+NANO_MEDIASIZE=4000000
+
+#
+# Size of code file system in 512 bytes sectors.
+# If zero, size will be as large as possible
+#
+NANO_CODESIZE=0
+
+#
+# Size of configuration file system in 512 bytes sectors.
+# Cannot be zero
+#
+NANO_CONFSIZE=2048
+
+# Size of data file system in 512 bytes sectors.
+# If zero: no partition configured.
+# If negative: max size possible
+NANO_DATASIZE=0
+
+# Size of the /etc ramdisk in 512 bytes sectors
+NANO_RAM_ETCSIZE=10240
+
+# Size of the /tmp+/var ramdisk in 512 bytes sectors
+NANO_RAM_TMPVARSIZE=81920
+
#
# The first partition should start at offset 16,
# because the first 16 sectors are reserved for metadata
@@ -351,7 +383,8 @@
echo "Partition will not be bootable"
fi
nano_makefs "${NANO_MAKEFS} -o minfree=0,optimization=space" \
- "${NANO_METALOG}" "$(( CODE_SIZE - METADATA_SECTS ))" \
+ "${NANO_METALOG}" \
+ "$(( (CODE_SIZE - METADATA_SECTS) * NANO_SECTOR_SIZE ))" \
"${NANO_OBJ}/_.disk.part" "${NANO_WORLDDIR}"
mkimg -s bsd -S 512 --capacity $(( CODE_SIZE * 512 )) \
${bootcode} \
@@ -497,7 +530,8 @@
echo "Duplicating to second image..."
tgt_switch_root_fstab "${NANO_SLICE_ROOT}" "${NANO_SLICE_ALTROOT}"
nano_makefs "${NANO_MAKEFS} -o minfree=0,optimization=space" \
- "${NANO_METALOG}" "$(( CODE_SIZE - METADATA_SECTS ))" \
+ "${NANO_METALOG}" \
+ "$(( (CODE_SIZE - METADATA_SECTS) * NANO_SECTOR_SIZE ))" \
"${NANO_OBJ}/_.altroot.part" "${NANO_WORLDDIR}"
tgt_switch_root_fstab "${NANO_SLICE_ALTROOT}" "${NANO_SLICE_ROOT}"
if [ -f "${NANO_WORLDDIR}/boot/boot" ]; then
diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh
--- a/tools/tools/nanobsd/nanobsd.sh
+++ b/tools/tools/nanobsd/nanobsd.sh
@@ -34,6 +34,7 @@
. "${topdir}/customizations.sh"
. "${topdir}/_xxx_includes.subr" # XXX ideally, this file should not exist
+# XXXJL remove this function?
is_defined() {
case $(type $1 2>/dev/null) in
*function) return 0 ;;
@@ -42,13 +43,19 @@
}
legacy() {
- # Pull in legacy stuff on demand
- . "${topdir}/legacy.sh"
+ # Pull in legacy stuff on demand
+ . "${topdir}/legacy.sh"
+ NANO_PLAN="legacy"
}
default() {
- # Pull in default stuff on demand
- . "${topdir}/gpt.sh"
+ # Pull in default stuff on demand
+ if [ "$NANO_PARTITION_SCHEME" = "MBR" ]; then
+ . "${topdir}/mbr.sh"
+ else
+ . "${topdir}/gpt.sh"
+ fi
+ NANO_PLAN="${NANO_PLAN:-default}"
}
#######################################################################

File Metadata

Mime Type
text/plain
Expires
Sun, Aug 23, 6:50 AM (21 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37080033
Default Alt Text
D58969.id184541.diff (18 KB)

Event Timeline