summaryrefslogtreecommitdiffstats
path: root/scripts/upd-bootimage
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-04-05 16:24:50 +0000
committerErik Troan <ewt@redhat.com>2000-04-05 16:24:50 +0000
commit06cd7f50b11b9d730ae9894e285d7ae11bf9d3b8 (patch)
treea1e016358731e1878318bf1d455ac03b54bc3485 /scripts/upd-bootimage
parent663b88ea473d30670e9337d71758c9b000c3c421 (diff)
downloadanaconda-06cd7f50b11b9d730ae9894e285d7ae11bf9d3b8.tar.gz
anaconda-06cd7f50b11b9d730ae9894e285d7ae11bf9d3b8.tar.xz
anaconda-06cd7f50b11b9d730ae9894e285d7ae11bf9d3b8.zip
*** empty log message ***
Diffstat (limited to 'scripts/upd-bootimage')
-rwxr-xr-xscripts/upd-bootimage30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/upd-bootimage b/scripts/upd-bootimage
new file mode 100755
index 000000000..424be2ccd
--- /dev/null
+++ b/scripts/upd-bootimage
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+if [ ! -f $1 ]; then
+ echo "$1 doesn't exist"
+ exit 1
+fi
+
+MNTPOINT=/tmp/updboottree.$$
+INITRD=/tmp/updboottree.$$.initrd
+LOOPMNT=/tmp/updboottree.$$.initrdmnt
+
+rm -rf $MNTPOINT $LOOPMNT
+mkdir $MNTPOINT $LOOPMNT
+mount -o loop $1 $MNTPOINT
+
+gunzip < $MNTPOINT/initrd.img > $INITRD
+
+mount -o loop $INITRD $LOOPMNT
+
+if [ ! -x $LOOPMNT/sbin/$2 ]; then
+ echo "$LOOPMNT/sbin/$2 doesn't exist"
+else
+ install -s $2 $LOOPMNT/sbin/$2
+fi
+
+umount $LOOPMNT
+gzip -9 < $INITRD > $MNTPOINT/initrd.img
+umount $MNTPOINT
+
+rm -rf $MNTPOINT $LOOPMNT $INITRD