diff options
author | phk <phk@FreeBSD.org> | 2007-08-26 14:57:08 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2007-08-26 14:57:08 +0000 |
commit | 64c3de9e17e1278b9e185a47e24a4e63d7a9bb5e (patch) | |
tree | e2a2cac6458aa144bf477141cc5bbf8edd84e882 | |
parent | ed4dab73791ab7bc7147bdc8a84c4a2d297f5102 (diff) | |
download | FreeBSD-src-64c3de9e17e1278b9e185a47e24a4e63d7a9bb5e.zip FreeBSD-src-64c3de9e17e1278b9e185a47e24a4e63d7a9bb5e.tar.gz |
Add option to not fill second code image, this makes the full disk
image compress much better.
Respect pkg_add's internal 200 package limitation.
Approved by: re (bmah)
Spelling fixes by: bmah
-rw-r--r-- | tools/tools/nanobsd/nanobsd.sh | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index 549f4d6..1378861 100644 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -83,6 +83,10 @@ NANO_MEDIASIZE=1000000 # Number of code images on media (1 or 2) NANO_IMAGES=2 +# 0 -> Leave second image all zeroes so it compresses better. +# 1 -> Initialize second image with a copy of the first +NANO_INIT_IMG2=1 + # Size of code file system in 512 bytes sectors # If zero, size will be as large as possible. NANO_CODESIZE=0 @@ -402,7 +406,7 @@ create_i386_diskimage ( ) ( ( cd ${MNT} && du -k ) > ${MAKEOBJDIRPREFIX}/_.du umount ${MNT} - if [ $NANO_IMAGES -gt 1 ] ; then + if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then # Duplicate to second image (if present) dd if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k mount /dev/${MD}s2a ${MNT} @@ -505,8 +509,11 @@ cust_pkg () ( # Record how may we have now have=`ls ${NANO_WORLDDIR}/var/db/pkg | wc -l` - # Attempt to install more - chroot ${NANO_WORLDDIR} sh -c 'pkg_add -F Pkg/*' || true + # Attempt to install more packages + # ...but no more than 200 at a time due to pkg_add's internal + # limitations. + chroot ${NANO_WORLDDIR} sh -c \ + 'ls Pkg/*tbz | xargs -n 200 pkg_add -F' || true # See what that got us now=`ls ${NANO_WORLDDIR}/var/db/pkg | wc -l` |