summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2008-04-08 14:15:47 -0400
committerPeter Jones <root@pjones5.install.boston.redhat.com>2008-04-08 14:15:47 -0400
commitdb33f0fa48e3ce70dae068c4290341b8bd9545ec (patch)
treefb499f7b2f72a1cc6f7b0d3df83e75566fc86da9 /scripts
parentcae305c8dc7d5862fa2c5432e1b292d5dc9f456e (diff)
Build efiboot.img on x86_64 and i386 .
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mk-images9
-rwxr-xr-xscripts/mk-images.efi40
-rwxr-xr-xscripts/upd-instroot4
3 files changed, 39 insertions, 14 deletions
diff --git a/scripts/mk-images b/scripts/mk-images
index 002da9ff0..fa1629166 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -122,12 +122,7 @@ INITRDMODS="$USBMODS $FIREWIREMODS $IDEMODS $SCSIMODS $FSMODS $LVMMODS $RAIDMODS
KERNELBASE=$TMPDIR/updboot.kernel.$$
KERNELNAME=vmlinuz
-
- if [ -d /sys/firmware/efi ]; then
- KERNELDIR="/boot/efi/EFI/redhat"
- else
- KERNELDIR="/boot"
- fi
+ KERNELDIR="/boot"
if [ "$BUILDARCH" = "sparc64" ]; then
BASEARCH=sparc
@@ -818,7 +813,7 @@ for KERNELARCH in $arches; do
# make the boot images
makeBootImages
- makeEfiImages
+ makeEfiImages $yumconf
done
done
diff --git a/scripts/mk-images.efi b/scripts/mk-images.efi
index 5b0c86bcc..d104c0282 100755
--- a/scripts/mk-images.efi
+++ b/scripts/mk-images.efi
@@ -23,6 +23,7 @@ makeefibootdisk() {
MBD_FILENAME=""
KERNELFILE=""
INITRDFILE=""
+ grubpkg=""
MBD_TMPIMAGE=${TMPDIR:-/tmp}/makebootdisk.image.$$
MBD_BOOTTREE=${TMPDIR:-/tmp}/makebootdisk.tree.$$
MBD_BOOTTREE_TMP=$MBD_BOOTTREE'_tmp'
@@ -39,6 +40,10 @@ makeefibootdisk() {
MBD_FILENAME=$IMAGEPATH/$2
shift; shift
continue
+ elif [ $1 = "--grubpkg" ]; then
+ grubpkg=$2
+ shift; shift
+ continue
fi
echo "Unknown option passed to makebootdisk"
exit 1
@@ -89,12 +94,12 @@ makeefibootdisk() {
# prepare and build an efiboot.img.
prepareEfiImage() {
- prepareEfiTree
+ prepareEfiTree || return 1
# dynamically calculate the size of the dosfs
BOOTDISKSIZE=$(du -kcs $MBD_BOOTTREE_TMP | tail -n1 | awk '{print $1}')
BOOTDISKSIZE=$(expr $BOOTDISKSIZE + 100)
- echo "The size of the boot.img dosfs is $BOOTDISKSIZE"
+ echo "The size of the efiboot.img dosfs is $BOOTDISKSIZE"
dd if=/dev/zero bs=1k count=$BOOTDISKSIZE of=$MBD_FILENAME 2>/dev/null
mkdosfs -C $MBD_FILENAME $BOOTDISKSIZE >/dev/null
mount -o loop,shortname=winnt,umask=0077 -t vfat $MBD_FILENAME $MBD_BOOTTREE
@@ -113,22 +118,47 @@ prepareEfiTree() {
sed -i "s/@PRODUCT@/$PRODUCT/g" $MBD_BOOTTREE_TMP/EFI/boot/grub.conf
sed -i "s/@VERSION@/$VERSION/g" $MBD_BOOTTREE_TMP/EFI/boot/grub.conf
+ yumdownloader -c $yumconf $grubpkg
+ rpm2cpio $grubpkg.rpm | (cd $KERNELROOT; cpio --quiet -iumd)
+ cp $KERNELROOT/boot/efi/EFI/redhat/grub.efi $MBD_BOOTTREE_TMP/EFI/boot/grub.efi
+
# The first generation Mactel machines get the bootloader name wrong
# as per the spec. Awesome, guys.
- if [ "$efiarch" == "ia32"]; then
+ if [ "$efiarch" == "ia32" ]; then
cp $MBD_BOOTTREE_TMP/EFI/boot/grub.efi $MBD_BOOTTREE_TMP/EFI/boot/boot.efi
cp $MBD_BOOTTREE_TMP/EFI/boot/grub.conf $MBD_BOOTTREE_TMP/EFI/boot/boot.conf
fi
mv $MBD_BOOTTREE_TMP/EFI/boot/grub.efi $MBD_BOOTTREE_TMP/EFI/boot/boot${efiarch}.efi
mv $MBD_BOOTTREE_TMP/EFI/boot/grub.conf $MBD_BOOTTREE_TMP/EFI/boot/boot${efiarch}.conf
+
+ artpkg=$(repoquery --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}" -c $yumconf fedora-logos)
+ yumdownloader -c $yumconf $artpkg
+ rpm2cpio $artpkg.rpm | (cd $KERNELROOT; cpio --quiet -iumd)
+ cp $KERNELROOT/boot/grub/splash.xpm.gz $MBD_BOOTTREE_TMP/EFI/boot/splash.xpm.gz
}
makeEfiImages() {
+ yumconf="$1"
if [ "$kerneltag" != "xen" ]; then
+ local grubarch=${efiarch}
+ case ${efiarch} in
+ ia32) grubarch=i386 ;;
+ x64) grubarch=x86_64 ;;
+ esac
+ grubpkg=$(repoquery --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}" -c $yumconf grub.$grubarch)
+ if [ -z "$grubpkg" ]; then
+ echo "cannot find package grub.$grubarch" >&2
+ return 1
+ fi
+ echo "Building efiboot.img for ${efiarch}/$KERNELARCH at $TOPDESTPATH/images/efiboot.img"
+
makeefibootdisk \
- --imagename $TOPDESTPATH/images/efiboot.img \
+ --imagename efiboot.img \
--kernel $TOPDESTPATH/images/pxeboot/vmlinuz \
- --initrd $TOPDESTPATH/images/pxeboot/initrd.img
+ --initrd $TOPDESTPATH/images/pxeboot/initrd.img \
+ --grubpkg ${grubpkg}
+ return $?
fi
+ return 1
}
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index 62e4e503a..9c5187c6a 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -174,7 +174,7 @@ else
fi
if [ $ARCH = i386 -o $ARCH = x86_64 ]; then
- PACKAGES="$PACKAGES pcmciautils"
+ PACKAGES="$PACKAGES pcmciautils grub"
fi
if [ $ARCH = i386 -o $ARCH = x86_64 -o $ARCH = ia64 ]; then
@@ -267,7 +267,7 @@ if [ $ARCH = sparc ]; then
fi
if [ $ARCH = i386 -o $ARCH = x86_64 ]; then
- PACKAGESGR="$PACKAGESGR syslinux memtest86+"
+ PACKAGESGR="$PACKAGESGR syslinux memtest86+ grub"
fi
if [ $ARCH = alpha ]; then