diff options
Diffstat (limited to 'scripts/upd-initrd')
-rwxr-xr-x | scripts/upd-initrd | 25 |
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 |