[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[Fedora-ia64-list] [PATCH BZ:175632]: ia64: EFI requires boot.img
- From: Prarit Bhargava <prarit redhat com>
- To: anaconda-devel-list redhat com
- Cc: ia64 Fedora Core Development <fedora-ia64-list redhat com>, Jeremy Katz <katzj redhat com>
- Subject: [Fedora-ia64-list] [PATCH BZ:175632]: ia64: EFI requires boot.img
- Date: Tue, 24 Jan 2006 12:37:58 -0500
This patch re-introduces the creation of the boot.img file for use by EFI.
Without this patch, EFI booting is non-functional in recent nightly builds.
P.
--- anaconda-10.91.7/scripts/mk-images.ia64.orig 2005-10-24 15:44:01.000000000 -0400
+++ anaconda-10.91.7/scripts/mk-images.ia64 2006-01-24 11:53:02.000000000 -0500
@@ -1,14 +1,97 @@
+#!/bin/bash
+
+#makebootdisk required for EFI bootloader dosfs image
+makebootdisk() {
+ EXTRAKERNELPATH=""
+ INITRDFLAGS=""
+ MBD_FILENAME=""
+ INITRDFILE=""
+ MBD_TMPIMAGE=/tmp/makebootdisk.image.$$
+ MBD_BOOTTREE=/tmp/makebootdisk.tree.$$
+ MBD_BOOTTREE_TMP=$MBD_BOOTTREE'_tmp'
+ while [ x$(echo $1 | cut -c1-2) = x"--" ]; do
+ if [ $1 = "--kernelto" ]; then
+ EXTRAKERNELPATH=$2
+ shift; shift
+ continue
+ elif [ $1 = "--initrdflags" ]; then
+ INITRDFLAGS=$2
+ shift; shift
+ continue
+ elif [ $1 = "--initrd" ]; then
+ INITRDFILE=$2
+ shift; shift
+ continue
+ elif [ $1 = "--imagename" ]; then
+ MBD_FILENAME=$IMAGEPATH/$2
+ shift; shift
+ continue
+ fi
+ echo "Unknown option passed to makebootdisk"
+ exit 1
+ done
+
+ if [ -z "$MBD_FILENAME" ]; then
+ echo "No imagename passed"
+ exit 1
+ fi
+
+ if [ -n "$INITRDFILE" ]; then
+ MBD_FSIMAGE="$INITRDFILE"
+ elif [ -n "$INITRDFLAGS" ]; then
+ eval makeinitrd --keep $INITRDFLAGS
+ fi
+
+ mkdir -p $MBD_BOOTTREE
+ mkdir -p $MBD_BOOTTREE_TMP
+ rm -rf $MBD_BOOTTREE_TMP
+ mkdir -p $MBD_TMPIMAGE
+
+ # provided by the mk-image.$ARCH file
+ prepareBootImage
+
+ left=$(df $MBD_BOOTTREE | tail +2)
+ left=$(echo $left | awk '{print $4'})
+
+ umount $MBD_BOOTTREE
+
+ if [ -n "$EXTRAKERNELPATH" ]; then
+ mkdir -p `dirname $EXTRAKERNELPATH`
+ cp -f $KERNELROOT/$KERNELDIR/${KERNELNAME}-* $EXTRAKERNELPATH
+ fi
+
+ mkdir -p `dirname $MBD_FILENAME`
+ rm -rf $MBD_TMPIMAGE $MBD_MNTPOINT $MBD_BOOTTREE
+ if [ -z "$INITRDFILE" ]; then
+ rm -f $MBD_FSIMAGE
+ fi
+
+ echo "Wrote $MBD_FILENAME (${left}k free)"
+}
+
prepareBootImage() {
+
+ prepareBootTree
+
+ # dynamically calculate the size of the dosfs
+ BOOTDISKSIZE=$(du -kcs $MBD_BOOTTREE_TMP | tail +2 | awk '{print $1}')
+ BOOTDISKSIZE=$(expr $BOOTDISKSIZE + 100)
+ echo "The size of the boot.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 -t vfat $MBD_FILENAME $MBD_BOOTTREE
- mkdir -p $MBD_BOOTTREE/EFI/boot
- cp $MBD_FSIMAGE $MBD_BOOTTREE/EFI/boot/initrd.img
+ cp -R $MBD_BOOTTREE_TMP/* $MBD_BOOTTREE
+}
+
+prepareBootTree() {
+ mkdir -p $MBD_BOOTTREE_TMP/EFI/boot
+ cp $MBD_FSIMAGE $MBD_BOOTTREE_TMP/EFI/boot/initrd.img
+
+ cp -a $BOOTDISKDIR/* $MBD_BOOTTREE_TMP/EFI/boot/
+ cp $KERNELROOT/boot/efi/EFI/redhat/vmlinuz-* $MBD_BOOTTREE_TMP/EFI/boot/vmlinuz
- cp -a $BOOTDISKDIR/* $MBD_BOOTTREE/EFI/boot/
- cp $KERNELROOT/boot/efi/EFI/redhat/vmlinuz-* $MBD_BOOTTREE/EFI/boot/vmlinuz
- cp $MBD_BOOTTREE/EFI/boot/elilo.efi $MBD_BOOTTREE/EFI/boot/bootia64.efi
- cat > $MBD_BOOTTREE/EFI/boot/elilo.conf << EOF
+ cp $MBD_BOOTTREE_TMP/EFI/boot/elilo.efi $MBD_BOOTTREE_TMP/EFI/boot/bootia64.efi
+ cat > $MBD_BOOTTREE_TMP/EFI/boot/elilo.conf << EOF
prompt
timeout=50
relocatable
@@ -20,10 +103,20 @@ image=vmlinuz
EOF
# make a copy in the root of the image
- cp $MBD_BOOTTREE/EFI/boot/* $MBD_BOOTTREE/
+ cp $MBD_BOOTTREE_TMP/EFI/boot/* $MBD_BOOTTREE_TMP
}
makeBootImages() {
+ # Because ia64 boxes use EFI there needs to be a boot.img dosfs.
+ echo "making boot.img for EFI bootloader"
+ makebootdisk --kernelto $TOPDESTPATH/kernels/vmlinuz \
+ --imagename boot.img \
+ --initrdflags '--initrdto $TOPDESTPATH/images/ramdisk.img \
+ --initrdsize 12288 \
+ --loaderbin loader \
+ --modules "$INITRDMODS sgiioc4" '
+
+
mkdir -p $TOPDESTPATH/images/pxeboot
makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd.img \
--initrdsize 12288 \
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]