From 26f19f416264acc4102db1617354f628f8e1910a Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Fri, 24 Jun 2011 14:46:10 -0700 Subject: Update upd-bootiso for F16 F15+ uses xz to compress initrd.img --- scripts/upd-bootiso | 64 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 19 deletions(-) (limited to 'scripts') diff --git a/scripts/upd-bootiso b/scripts/upd-bootiso index 450511b03..d59fecf05 100755 --- a/scripts/upd-bootiso +++ b/scripts/upd-bootiso @@ -70,6 +70,19 @@ unpackRPMs() { done } +uncompressInitrd() { + echo "Extracting the initrd.img to ./newinitrd" + mkdir ./newinitrd + pushd ./newinitrd + if [ $1 -gt 14 ]; then + unxz < ../newiso/isolinux/initrd.img | cpio -idu + else + gunzip < ../newiso/isolinux/initrd.img | cpio -idu + fi + popd +} + + usage() { if [ $1 -ne 0 ]; then >&2 @@ -85,6 +98,9 @@ usage() { [ "$1" == "--help" ] && usage 0 DEST="/tmp/" +RUNSHELL=0 +SKIPISO=0 +LEAVETMP=0 while [ $# -gt 0 ]; do case $1 in --shell) @@ -149,22 +165,17 @@ mkdir ./newiso rsync -a ./origiso/ ./newiso/ umount ./origiso -echo "Extracting the initrd.img to ./newinitrd" -mkdir ./newinitrd -pushd ./newinitrd -gunzip < ../newiso/isolinux/initrd.img | cpio -idu -popd - - # Before f12 images/stage2.img held most of anaconda's files # but using squashfs 3.0 which v4.0 cannot read # From f12 to f14 it was images/install.img # After f14 it is all in isolinux/initrd.img -if [ $VER -gt 14 ]; then - echo "Detected anaconda release 15+" - # Do f15 and later operations on ./newinitrd +uncompressInitrd $VER + +if [ $VER -gt 15 ]; then + echo "Detected anaconda release 16+" pushd ./newinitrd + # Do f16 and later operations on ./newinitrd unpackRPMs cp ./usr/share/anaconda/raidstart-stub ./usr/bin/raidstart @@ -174,12 +185,23 @@ if [ $VER -gt 14 ]; then cp ./usr/$LIBDIR/python?.?/site-packages/pyanaconda/sitecustomize.py ./usr/$LIBDIR/python?.?/site-packages # Copy loader to the initrd - cp ./usr/$LIBDIR/anaconda/loader ../newinitrd/sbin/ - cp ./usr/share/anaconda/loader.tr ../newinitrd/etc/ - cp ./usr/$LIBDIR/anaconda/init ../newinitrd/sbin/ + cp ./usr/$LIBDIR/anaconda/loader ./sbin/ + cp ./usr/share/anaconda/loader.tr ./etc/ +elif [ $VER -gt 14 ]; then + echo "Detected anaconda release 15" + pushd ./newinitrd + unpackRPMs - # non-standard, used for debugging stage1 problems - cp ./usr/bin/{ls,cat,less} ../newinitrd/sbin/ + cp ./usr/share/anaconda/raidstart-stub ./usr/bin/raidstart + cp ./usr/share/anaconda/raidstop-stub ./usr/bin/raidstop + cp ./usr/share/anaconda/list-harddrives-stub ./usr/bin/list-harddrives + cp ./usr/share/anaconda/loadkeys-stub ./usr/bin/loadkeys + cp ./usr/$LIBDIR/python?.?/site-packages/pyanaconda/sitecustomize.py ./usr/$LIBDIR/python?.?/site-packages + + # Copy loader to the initrd + cp ./usr/$LIBDIR/anaconda/loader ./sbin/ + cp ./usr/share/anaconda/loader.tr ./etc/ + cp ./usr/$LIBDIR/anaconda/init ./sbin/ elif [ $VER -gt 11 ]; then echo "Extracting ./newiso/images/install.img to ./newinstall/" mkdir ./install @@ -241,7 +263,7 @@ else fi popd -if [ -n $RUNSHELL ]; then +if [ $RUNSHELL -eq 1 ]; then echo "Make changes inside ./newinitrd and ./newinstall, then exit to finish" /bin/sh echo "Finishing build of new.iso" @@ -249,7 +271,11 @@ fi # Create the new initrd.img pushd ./newinitrd -find . |cpio --quiet -c -o | gzip -9 > ../initrd.img +if [ $VER -gt 15 ]; then + find . |cpio --quiet -c -o | xz -9 --check=crc32 > ../initrd.img +else + find . |cpio --quiet -c -o | gzip -9 > ../initrd.img +fi popd # Stuff new initrd.img into the newiso tree @@ -262,7 +288,7 @@ if [ $VER -gt 11 -a $VER -lt 15 ]; then find ./newiso/ -iname install.img -exec cp install.img {} \; fi -if [ -z $SKIPISO ]; then +if [ $SKIPISO -eq 0 ]; then # Make a new .iso image BOOTISO="./new.iso" TOPDESTPATH="./newiso" @@ -282,7 +308,7 @@ fi # Exit $TMPDIR popd -if [ -z $LEAVETMP ]; then +if [ $LEAVETMP -eq 0 ]; then rm -rf $TMPDIR fi -- cgit