Date: Wed, 27 May 2026 00:37:05 +0000 From: Jose Luis Duran <jlduran@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 87150a2ed140 - main - nanobsd: Refactor secondary code partition logic Message-ID: <6a163cb1.3fb23.3680830c@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=87150a2ed140d5a3c1272ce9cfe815f19282840b commit 87150a2ed140d5a3c1272ce9cfe815f19282840b Author: Jose Luis Duran <jlduran@FreeBSD.org> AuthorDate: 2026-05-27 00:22:39 +0000 Commit: Jose Luis Duran <jlduran@FreeBSD.org> CommitDate: 2026-05-27 00:22:39 +0000 nanobsd: Refactor secondary code partition logic Rearrange the conditional logic for building the secondary code slice (altroot). Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D57223 --- tools/tools/nanobsd/legacy.sh | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/tools/tools/nanobsd/legacy.sh b/tools/tools/nanobsd/legacy.sh index 1d7a0cef2fed..52d60b4fda8c 100644 --- a/tools/tools/nanobsd/legacy.sh +++ b/tools/tools/nanobsd/legacy.sh @@ -308,28 +308,29 @@ _create_diskimage() { 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..." - tgt_switch_root_fstab "${NANO_SLICE_ROOT}" "${NANO_SLICE_ALTROOT}" - nano_makefs "-DxZ ${NANO_MAKEFS} -o minfree=0,optimization=space" \ - "${NANO_METALOG}" "$(( CODE_SIZE - METADATA_SECTS ))" \ - "${NANO_OBJ}/_.altroot.part" "${NANO_WORLDDIR}" - tgt_switch_root_fstab "${NANO_SLICE_ALTROOT}" "${NANO_SLICE_ROOT}" - if [ -f "${NANO_WORLDDIR}/boot/boot" ]; then - bootcode="-b ${NANO_WORLDDIR}/boot/boot" + if [ "$NANO_IMAGES" -gt 1 ] ; then + if [ "$NANO_INIT_IMG2" -gt 0 ] ; then + echo "Duplicating to second image..." + tgt_switch_root_fstab "${NANO_SLICE_ROOT}" "${NANO_SLICE_ALTROOT}" + nano_makefs "-DxZ ${NANO_MAKEFS} -o minfree=0,optimization=space" \ + "${NANO_METALOG}" "$(( CODE_SIZE - METADATA_SECTS ))" \ + "${NANO_OBJ}/_.altroot.part" "${NANO_WORLDDIR}" + tgt_switch_root_fstab "${NANO_SLICE_ALTROOT}" "${NANO_SLICE_ROOT}" + if [ -f "${NANO_WORLDDIR}/boot/boot" ]; then + bootcode="-b ${NANO_WORLDDIR}/boot/boot" + fi + mkimg -s bsd -S 512 --capacity $(( CODE_SIZE * 512 )) \ + ${bootcode} \ + -p freebsd-ufs:="${NANO_OBJ}/_.altroot.part" \ + -o "${NANO_OBJ}/_.altroot.image" + altroot="-p freebsd:=${NANO_OBJ}/_.altroot.image:+$(( NANO_SECTS * 512 ))" + rm -f "${NANO_OBJ}/_.altroot.part" + else + altroot="-p freebsd::${CODE_SIZE}b:+$(( NANO_SECTS * 512 ))" fi - mkimg -s bsd -S 512 --capacity $(( CODE_SIZE * 512 )) \ - ${bootcode} \ - -p freebsd-ufs:="${NANO_OBJ}/_.altroot.part" \ - -o "${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:+$(( NANO_SECTS * 512 ))" - fi # Create Config slice _populate_cfg_part "${NANO_OBJ}/_.cfg.part" "${NANO_CFGDIR}" \home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a163cb1.3fb23.3680830c>
