summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2011-06-24 14:46:10 -0700
committerBrian C. Lane <bcl@redhat.com>2011-06-27 12:10:19 -0700
commit26f19f416264acc4102db1617354f628f8e1910a (patch)
treeb443faaeaafde4439d8fe049560dfa37d2b09e4b /scripts
parentcf8dcd62ce726dd77f2af04c591fbb4aa804a27b (diff)
downloadanaconda-26f19f416264acc4102db1617354f628f8e1910a.tar.gz
anaconda-26f19f416264acc4102db1617354f628f8e1910a.tar.xz
anaconda-26f19f416264acc4102db1617354f628f8e1910a.zip
Update upd-bootiso for F16
F15+ uses xz to compress initrd.img
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/upd-bootiso64
1 files changed, 45 insertions, 19 deletions
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