#!/bin/sh # Updates an installer initrd with a new loader binary # Usage: upd-initrd # # CAVEATS: Must use absolute paths to files, not relative # # Jeremy Katz # Copyright 2005 Red Hat, Inc. if [ $# -ne 3 ]; then echo "Usage: $0 " 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