summaryrefslogtreecommitdiffstats
path: root/scripts/upd-initrd
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2005-04-12 20:30:33 +0000
committerJeremy Katz <katzj@redhat.com>2005-04-12 20:30:33 +0000
commita0bca11ac57ffcedb17e9a87c6cad05096208704 (patch)
tree4c460dc9ff2e293effa8c8b85b08434a46a0af00 /scripts/upd-initrd
parentc196c69fb7fd175fb7c1d7fb5dce73547d7292f4 (diff)
downloadanaconda-a0bca11ac57ffcedb17e9a87c6cad05096208704.tar.gz
anaconda-a0bca11ac57ffcedb17e9a87c6cad05096208704.tar.xz
anaconda-a0bca11ac57ffcedb17e9a87c6cad05096208704.zip
2005-04-12 Jeremy Katz <katzj@redhat.com>
* scripts/upd-initrd: Add simple stupid script to update the loader in an initrd to make my life easier.
Diffstat (limited to 'scripts/upd-initrd')
-rwxr-xr-xscripts/upd-initrd25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/upd-initrd b/scripts/upd-initrd
new file mode 100755
index 000000000..8c78b2bb4
--- /dev/null
+++ b/scripts/upd-initrd
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Updates an installer initrd with a new loader binary
+# Usage: upd-initrd <initrd> <binary> <outfile>
+#
+# CAVEATS: Must use absolute paths to files, not relative
+#
+# Jeremy Katz <katzj@redhat.com>
+# Copyright 2005 Red Hat, Inc.
+
+if [ $# -ne 3 ]; then
+ echo "Usage: $0 <initrd> <binary> <outfile>"
+ exit 1
+fi
+
+INITRD=$1
+BIN=$2
+OUT=$3
+
+tmpdir=$(mktemp -d)
+pushd $tmpdir
+zcat $INITRD |cpio -id
+strip -s -o sbin/loader $BIN
+(find . |cpio -c -o |gzip -9) > $OUT
+popd
+rm -rf $tmpdir