From c6c690b5afca968fb2e87343646f51a13f0c2337 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Tue, 16 Jun 2009 10:41:33 +0100 Subject: [PATCH] Add --nocompress option, version 2.3 --- configure.ac | 2 +- febootstrap-to-initramfs.pod | 7 +++++++ febootstrap-to-initramfs.sh | 24 ++++++++++++++++++------ 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index e6b6df0..a14c88c 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. dnl dnl Written by Richard W.M. Jones -AC_INIT(febootstrap,2.2) +AC_INIT(febootstrap,2.3) AM_INIT_AUTOMAKE AC_CHECK_PROG(PERLDOC,[perldoc],[perldoc],[no]) diff --git a/febootstrap-to-initramfs.pod b/febootstrap-to-initramfs.pod index 951cc10..eedaf0f 100644 --- a/febootstrap-to-initramfs.pod +++ b/febootstrap-to-initramfs.pod @@ -33,6 +33,13 @@ any others are ignored. When the C<--files> option is not given, all files in C are added to the initramfs image. +=item --nocompress + +This prevents the initramfs image from being compressed. + +Linux can boot from uncompressed initramfs images (in fact, faster), +but they take up a lot more space on disk. + =back =head1 /init diff --git a/febootstrap-to-initramfs.sh b/febootstrap-to-initramfs.sh index 83c661c..dc72963 100755 --- a/febootstrap-to-initramfs.sh +++ b/febootstrap-to-initramfs.sh @@ -22,7 +22,7 @@ unset CDPATH TEMP=`getopt \ -o '' \ - --long files:,help \ + --long files:,nocompress,help \ -n febootstrap-to-initramfs -- "$@"` if [ $? != 0 ]; then echo "febootstrap-to-initramfs: problem parsing the command line arguments" @@ -30,11 +30,12 @@ if [ $? != 0 ]; then fi eval set -- "$TEMP" +compress=yes files= usage () { - echo "Usage: febootstrap-to-initramfs [--files=filelist] DIR" + echo "Usage: febootstrap-to-initramfs [--files=filelist] [--nocompress] DIR" echo "Please read febootstrap-to-initramfs(8) man page for more information." } @@ -46,6 +47,9 @@ while true; do --help) usage exit 0;; + --nocompress) + compress=no + shift;; --) shift break;; @@ -69,18 +73,26 @@ fi set -e +( if [ -f fakeroot.log ]; then if [ -z "$files" ]; then fakeroot -i fakeroot.log \ - sh -c 'find -not -name fakeroot.log -a -print0 | cpio -o -0 -H newc | gzip --best' + sh -c 'find -not -name fakeroot.log -a -print0 | cpio --quiet -o -0 -H newc' else fakeroot -i fakeroot.log \ - sh -c 'cpio -o -H newc | gzip --best' < $files + sh -c 'cpio --quiet -o -H newc' < $files fi else if [ -z "$files" ]; then - find -not -name fakeroot.log -a -print0 | cpio -o -0 -H newc | gzip --best + find -not -name fakeroot.log -a -print0 | cpio --quiet -o -0 -H newc else - cpio -o -H newc < $files | gzip --best + cpio --quiet -o -H newc < $files fi fi +) | ( +if [ "$compress" = "yes" ]; then + gzip --best +else + cat +fi +) -- 1.8.3.1