diff options
author | imp <imp@FreeBSD.org> | 2014-03-14 19:46:32 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2014-03-14 19:46:32 +0000 |
commit | 18ea525336b8ca59cb3d227dbd0f0ec3808f045f (patch) | |
tree | d6492a21c45579ff118cf28add2db2e92aaf1ea6 /tools | |
parent | 74473d60f7173bdc9aa7b5db734cc94a3ca6c9ad (diff) | |
download | FreeBSD-src-18ea525336b8ca59cb3d227dbd0f0ec3808f045f.zip FreeBSD-src-18ea525336b8ca59cb3d227dbd0f0ec3808f045f.tar.gz |
When NANO_IMAGE_MBRONLY is set, and we're backing via swap, only copy
the MBR.
PR: 136889
Submitted by: Aragon Gouveia
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tools/nanobsd/nanobsd.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index ed68f05..422d17b 100644 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -136,6 +136,9 @@ NANO_BOOT2CFG="-h" # Can be "file" or "swap" NANO_MD_BACKING="file" +# for swap type md(4) backing, write out the mbr only +NANO_IMAGE_MBRONLY=true + # Progress Print level PPLEVEL=3 @@ -573,6 +576,14 @@ create_i386_diskimage ( ) ( fi if [ "${NANO_MD_BACKING}" = "swap" ] ; then + if [ ${NANO_IMAGE_MBRONLY} ]; then + echo "Writing out _.disk.mbr..." + dd if=/dev/${MD} of=${NANO_DISKIMGDIR}/_.disk.mbr bs=512 count=1 + else + echo "Writing out ${NANO_IMGNAME}..." + dd if=/dev/${MD} of=${IMG} bs=64k + fi + echo "Writing out ${NANO_IMGNAME}..." dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k fi |