aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Luis Duran <jlduran@FreeBSD.org>2026-05-27 00:15:39 +0000
committerJose Luis Duran <jlduran@FreeBSD.org>2026-05-27 00:15:39 +0000
commitf1de49f508714b024ac6f3a60845108f81c7aee7 (patch)
tree591ab1e7bc08112e2119ef9292414ebde2a1f06e
parentdadbbccd804980895a098b01f553b5f7193daa81 (diff)
nanobsd: Offset code partition to a track boundary
Ensure the primary and secondary code partitions start at a proper track boundary by applying a NANO_SECTS offset in bytes. While track-boundary alignment is largely obsolete on modern storage, this change maintains compatibility with current images (legacy). A future commit will transition to 1 MiB alignment boundaries. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D57221
-rw-r--r--tools/tools/nanobsd/legacy.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/tools/nanobsd/legacy.sh b/tools/tools/nanobsd/legacy.sh
index 8e57163c030d..763f65c4dbdc 100644
--- a/tools/tools/nanobsd/legacy.sh
+++ b/tools/tools/nanobsd/legacy.sh
@@ -306,7 +306,7 @@ _create_diskimage() {
echo "Image will not be bootable"
fi
- diskimage="-p freebsd:=${NANO_DISKIMGDIR}/${NANO_IMG1NAME}"
+ diskimage="-p freebsd:=${NANO_DISKIMGDIR}/${NANO_IMG1NAME}:$(( NANO_SECTS * 512 ))"
if [ "$NANO_IMAGES" -gt 1 ] && [ "$NANO_INIT_IMG2" -gt 0 ] ; then
echo "Duplicating to second image..."
@@ -322,13 +322,13 @@ _create_diskimage() {
${bootcode} \
-p freebsd-ufs:="${NANO_OBJ}/_.altroot.part" \
-o "${NANO_OBJ}/_.altroot.image"
- altroot="-p freebsd:=${NANO_OBJ}/_.altroot.image"
+ altroot="-p freebsd:=${NANO_OBJ}/_.altroot.image:+$(( NANO_SECTS * 512 ))"
rm -f "${NANO_OBJ}/_.altroot.part"
else
altroot="-p-"
fi
if [ "${NANO_INIT_IMG2}" -eq 0 ]; then
- altroot="-p freebsd::${CODE_SIZE}b"
+ altroot="-p freebsd::${CODE_SIZE}b:+$(( NANO_SECTS * 512 ))"
fi
# Create Config slice