diff options
| author | Jose Luis Duran <jlduran@FreeBSD.org> | 2026-05-27 00:21:57 +0000 |
|---|---|---|
| committer | Jose Luis Duran <jlduran@FreeBSD.org> | 2026-05-27 00:21:57 +0000 |
| commit | 318a85d4b201b1cb77f25c8a98d2b0687e8259e5 (patch) | |
| tree | 284b3418885c98682afaecec7561032b2e159295 | |
| parent | f1de49f508714b024ac6f3a60845108f81c7aee7 (diff) | |
nanobsd: Explicitly set image size and secsz in mkimg
When building an unprivileged NanoBSD image, explicitly set the desired
image size, by passing --capacity to mkimg in bytes, and the logical
sector size (-S) to 512 bytes.
Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D57222
| -rw-r--r-- | tools/tools/nanobsd/legacy.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/tools/nanobsd/legacy.sh b/tools/tools/nanobsd/legacy.sh index 763f65c4dbdc..1d7a0cef2fed 100644 --- a/tools/tools/nanobsd/legacy.sh +++ b/tools/tools/nanobsd/legacy.sh @@ -178,7 +178,7 @@ _create_code_slice() { nano_makefs "-DxZ ${NANO_MAKEFS} -o minfree=0,optimization=space" \ "${NANO_METALOG}" "$(( CODE_SIZE - METADATA_SECTS ))" \ "${NANO_OBJ}/_.disk.part" "${NANO_WORLDDIR}" - mkimg -s bsd \ + mkimg -s bsd -S 512 --capacity $(( CODE_SIZE * 512 )) \ ${bootcode} \ -p freebsd-ufs:="${NANO_OBJ}/_.disk.part" \ -o "${IMG}" @@ -318,7 +318,7 @@ _create_diskimage() { if [ -f "${NANO_WORLDDIR}/boot/boot" ]; then bootcode="-b ${NANO_WORLDDIR}/boot/boot" fi - mkimg -s bsd \ + mkimg -s bsd -S 512 --capacity $(( CODE_SIZE * 512 )) \ ${bootcode} \ -p freebsd-ufs:="${NANO_OBJ}/_.altroot.part" \ -o "${NANO_OBJ}/_.altroot.image" @@ -350,7 +350,7 @@ _create_diskimage() { fi echo "Writing out ${NANO_IMGNAME}..." - mkimg -s mbr \ + mkimg -s mbr -S 512 --capacity $(( NANO_MEDIASIZE * 512 )) \ ${bootloader} \ ${diskimage} \ ${altroot} \ |
