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
This commit is contained in:
@@ -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} \
|
||||
|
||||
Reference in New Issue
Block a user