livecd, livedvd: cdrom EFI boot support

This commit is contained in:
Silvan Calarco 2015-03-07 19:55:19 +01:00
parent d123cf378f
commit 70e16cd41d
4 changed files with 84 additions and 2 deletions

View File

@ -1,4 +1,4 @@
$(MAKEDIST_TARGET)-livecd: openmamba-release memtest86+ syslinux macbook-tools dracut
$(MAKEDIST_TARGET)-livecd: openmamba-release memtest86+ syslinux macbook-tools dracut grub-efi-x86_64
# Localized targets
$(MAKEDIST_TARGET)-livecd-en:
$(MAKEDIST_TARGET)-livecd-it:

View File

@ -122,6 +122,47 @@ cp $MOUNTDIR/usr/share/syslinux/vesamenu.c32 $MOUNTDIR2/boot/isolinux/
buildinfo="`cat $MOUNTDIR/etc/openmamba-release` [$PRODUCT_NAME build:`date +%c`]"
sed -i "s|%buildinfo%|$buildinfo|" $MOUNTDIR2/boot/isolinux/menu.txt
#
# EFI support section BEGIN
#
# create EFI grub 32 and 64 bit images
mkdir -p $MOUNTDIR2/EFI/BOOT/
grub-mkimage -o $MOUNTDIR2/EFI/BOOT/bootx64.efi -O x86_64-efi -p /EFI/BOOT \
part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot linux echo \
help gfxterm gettext png efi_gop efi_uga search search_label search_fs_uuid \
iso9660 configfile || {
errorAndExit $"Error: unable to create GRUB x86_64-efi image"
}
# basic extlinux.conf -> grub.cfg conversion
echo "search --no-floppy --label --set=root openmamba_live" > $MOUNTDIR2/EFI/BOOT/grub.cfg
while read line; do
case $line in
"MENU LABEL "*) [ "$CURR_BRACKET_OPEN" = "1" ] && echo "}" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
echo "menuentry \"${line/MENU LABEL }\" {" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
CURR_BRACKET_OPEN=1
;;
"kernel "*) CURR_KERNEL="${line/kernel }"
echo "echo \"Loading ${CURR_KERNEL}\"" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
;;
"append "*) set -- ${line/append initrd=}
CURR_INITRD="$1"
CURR_CMDLINE="${line/append initrd=$CURR_INITRD}"
echo "linux ${CURR_KERNEL} ${CURR_CMDLINE}" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
echo "echo \"Loading ${CURR_INITRD}\"" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
echo "initrd ${CURR_INITRD}" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
echo "}" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
CURR_BRACKET_OPEN=0
;;
esac
done < $MOUNTDIR2/boot/isolinux/isolinux.cfg
[ "$CURR_BRACKET_OPEN" = "1" ] && echo "}" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
#
# EFI support section END
#
#echo "Adding binary packages from pkggroups.db..."
#. $LOCALSTATEDIR/.${MEDIA_NAMES[0]}.distinfo
#LANG=${LANGUAGE:0:2} . $MOUNTDIR/usr/share/openmamba/pkggroups.db

View File

@ -1,4 +1,4 @@
$(MAKEDIST_TARGET)-livedvd: openmamba-release memtest86+ syslinux macbook-tools
$(MAKEDIST_TARGET)-livedvd: openmamba-release memtest86+ syslinux macbook-tools dracut grub-efi-x86_64
# Localized targets
$(MAKEDIST_TARGET)-livedvd-en:
$(MAKEDIST_TARGET)-livedvd-it:

View File

@ -150,6 +150,47 @@ cp $MOUNTDIR/usr/share/syslinux/vesamenu.c32 $MOUNTDIR2/boot/isolinux/
buildinfo="`cat $MOUNTDIR/etc/openmamba-release` [$PRODUCT_NAME build:`date +%c`]"
sed -i "s|%buildinfo%|$buildinfo|" $MOUNTDIR2/boot/isolinux/menu.txt
#
# EFI support section BEGIN
#
# create EFI grub 32 and 64 bit images
mkdir -p $MOUNTDIR2/EFI/BOOT/
grub-mkimage -o $MOUNTDIR2/EFI/BOOT/bootx64.efi -O x86_64-efi -p /EFI/BOOT \
part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot linux echo \
help gfxterm gettext png efi_gop efi_uga search search_label search_fs_uuid \
iso9660 configfile || {
errorAndExit $"Error: unable to create GRUB x86_64-efi image"
}
# basic extlinux.conf -> grub.cfg conversion
echo "search --no-floppy --label --set=root openmamba_live" > $MOUNTDIR2/EFI/BOOT/grub.cfg
while read line; do
case $line in
"MENU LABEL "*) [ "$CURR_BRACKET_OPEN" = "1" ] && echo "}" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
echo "menuentry \"${line/MENU LABEL }\" {" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
CURR_BRACKET_OPEN=1
;;
"kernel "*) CURR_KERNEL="${line/kernel }"
echo "echo \"Loading ${CURR_KERNEL}\"" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
;;
"append "*) set -- ${line/append initrd=}
CURR_INITRD="$1"
CURR_CMDLINE="${line/append initrd=$CURR_INITRD}"
echo "linux ${CURR_KERNEL} ${CURR_CMDLINE}" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
echo "echo \"Loading ${CURR_INITRD}\"" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
echo "initrd ${CURR_INITRD}" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
echo "}" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
CURR_BRACKET_OPEN=0
;;
esac
done < $MOUNTDIR2/boot/isolinux/isolinux.cfg
[ "$CURR_BRACKET_OPEN" = "1" ] && echo "}" >> $MOUNTDIR2/EFI/BOOT/grub.cfg
#
# EFI support section END
#
#echo "Adding binary packages from pkggroups.db..."
#. $LOCALSTATEDIR/.${MEDIA_NAMES[0]}.distinfo
#LANG=${LANGUAGE:0:2} . $MOUNTDIR/usr/share/openmamba/pkggroups.db