summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-01-26 10:52:56 +0000
committerRichard Jones <rjones@redhat.com>2010-01-26 10:52:56 +0000
commitfe303d0d2176ac5a7aa8b49082ca81e9d544fd61 (patch)
treed8a066b94723117504aa8af7771b49c0b9d40dd9
parent183dc095c5f73ca1ddb7177f82f86c2e9517a781 (diff)
downloadfebootstrap-fe303d0d2176ac5a7aa8b49082ca81e9d544fd61.tar.gz
febootstrap-fe303d0d2176ac5a7aa8b49082ca81e9d544fd61.tar.xz
febootstrap-fe303d0d2176ac5a7aa8b49082ca81e9d544fd61.zip
Backport "supermin: Prevent multilib corruption (RHBZ#558593)" from libguestfs
Make sure the febootstrap-supermin-helper script does not contain any hard-wired references to the current architecture.
-rw-r--r--febootstrap-supermin-helper.pod6
-rwxr-xr-xfebootstrap-supermin-helper.sh12
2 files changed, 11 insertions, 7 deletions
diff --git a/febootstrap-supermin-helper.pod b/febootstrap-supermin-helper.pod
index d39d8bd..9ca7ca8 100644
--- a/febootstrap-supermin-helper.pod
+++ b/febootstrap-supermin-helper.pod
@@ -4,7 +4,7 @@ febootstrap-supermin-helper - Reconstruct initramfs from supermin appliance.
=head1 SYNOPSIS
- febootstrap-supermin-helper supermin.img hostfiles.txt kernel initrd
+ febootstrap-supermin-helper supermin.img hostfiles.txt host_cpu kernel initrd
=head1 DESCRIPTION
@@ -15,12 +15,14 @@ L<febootstrap-to-supermin(8)>.
=head1 PARAMETERS
-Of the four parameters, the first two are I<input> files, and the last
+Of the five parameters, the first two are I<input> files, and the last
two are I<output> files.
C<supermin.img> and C<hostfiles.txt> are the input files which
describe the supermin appliance.
+C<host_cpu> should be the host CPU, eg. C<x86_64> or C<i686>.
+
C<kernel> and C<initrd> are the temporary output files that this
script produces. These output files are meant to be used just for
booting the appliance, and should be deleted straight afterwards.
diff --git a/febootstrap-supermin-helper.sh b/febootstrap-supermin-helper.sh
index f6a54e6..cd5cf19 100755
--- a/febootstrap-supermin-helper.sh
+++ b/febootstrap-supermin-helper.sh
@@ -32,7 +32,7 @@ eval set -- "$TEMP"
usage ()
{
- echo "Usage: febootstrap-supermin-helper supermin.img hostfiles.txt kernel initrd"
+ echo "Usage: febootstrap-supermin-helper supermin.img hostfiles.txt host_cpu kernel initrd"
echo "Please read febootstrap-supermin-helper(8) man page for more information."
}
@@ -55,7 +55,7 @@ while true; do
esac
done
-if [ $# -ne 4 ]; then
+if [ $# -ne 5 ]; then
usage
exit 1
fi
@@ -66,9 +66,11 @@ set -e
supermin="$1"
hostfiles="$2"
+host_cpu=$3
+
# Output files.
-kernel="$3"
-initrd="$4"
+kernel="$4"
+initrd="$5"
rm -f "$kernel" "$initrd"
@@ -80,7 +82,7 @@ rm -f "$kernel" "$initrd"
# RHEL 5 didn't append the arch to the kernel name, so look for kernels
# without arch second.
-arch=$(echo "@host_cpu@" | sed 's/^i.86$/i?86/')
+arch=$(echo $host_cpu | sed 's/^i.86$/i?86/')
kernels=$(
ls -1dvr /boot/vmlinuz-*.$arch* 2>/dev/null | grep -v xen ||: ;
ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen