grub-mkrescue for EFI (untested)
This commit is contained in:
parent
f704cae368
commit
ac0289ba92
9 changed files with 47 additions and 33 deletions
|
@ -632,3 +632,9 @@ pkglib_MODULES += setjmp.mod
|
|||
setjmp_mod_SOURCES = lib/$(target_cpu)/setjmp.S
|
||||
setjmp_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
||||
setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
# For memdisk.mod.
|
||||
pkglib_MODULES += memdisk.mod
|
||||
memdisk_mod_SOURCES = disk/memdisk.c
|
||||
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
|
|
@ -102,7 +102,7 @@ grub_mkrescue_SOURCES = util/grub-mkrescue.in
|
|||
# Modules.
|
||||
pkglib_MODULES = linux.mod multiboot.mod \
|
||||
aout.mod play.mod serial.mod \
|
||||
memdisk.mod pci.mod lspci.mod reboot.mod \
|
||||
pci.mod lspci.mod reboot.mod \
|
||||
halt.mod datetime.mod date.mod datehook.mod \
|
||||
lsmmap.mod mmap.mod
|
||||
|
||||
|
@ -165,11 +165,6 @@ play_mod_SOURCES = commands/i386/pc/play.c
|
|||
play_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
play_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
# For memdisk.mod.
|
||||
memdisk_mod_SOURCES = disk/memdisk.c
|
||||
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
# For pci.mod
|
||||
pci_mod_SOURCES = bus/pci.c
|
||||
pci_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
|
|
|
@ -15,6 +15,9 @@ grub_mkimage_SOURCES = gnulib/progname.c util/i386/efi/grub-mkimage.c \
|
|||
util/misc.c util/resolve.c
|
||||
util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile
|
||||
|
||||
bin_SCRIPTS += grub-mkrescue
|
||||
grub_mkrescue_SOURCES = util/grub-mkrescue.in
|
||||
|
||||
# For grub-setup.
|
||||
#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \
|
||||
# util/misc.c util/getroot.c kern/device.c kern/disk.c \
|
||||
|
|
|
@ -56,7 +56,7 @@ grub_install_SOURCES = util/ieee1275/grub-install.in
|
|||
# Modules.
|
||||
pkglib_MODULES = halt.mod reboot.mod suspend.mod \
|
||||
aout.mod serial.mod linux.mod \
|
||||
nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \
|
||||
nand.mod pci.mod lspci.mod datetime.mod \
|
||||
date.mod datehook.mod lsmmap.mod mmap.mod
|
||||
|
||||
# For boot.mod.
|
||||
|
@ -106,11 +106,6 @@ nand_mod_SOURCES = disk/ieee1275/nand.c
|
|||
nand_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
nand_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
# For memdisk.mod.
|
||||
memdisk_mod_SOURCES = disk/memdisk.c
|
||||
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
# For pci.mod
|
||||
pci_mod_SOURCES = bus/pci.c
|
||||
pci_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
|
|
|
@ -121,7 +121,7 @@ grub_mkfloppy_SOURCES = util/i386/pc/grub-mkfloppy.in
|
|||
pkglib_MODULES = biosdisk.mod chain.mod \
|
||||
multiboot.mod reboot.mod halt.mod \
|
||||
vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \
|
||||
vga.mod memdisk.mod pci.mod lspci.mod \
|
||||
vga.mod pci.mod lspci.mod \
|
||||
aout.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \
|
||||
datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \
|
||||
usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod \
|
||||
|
@ -239,11 +239,6 @@ vga_mod_SOURCES = term/i386/pc/vga.c
|
|||
vga_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
vga_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
# For memdisk.mod.
|
||||
memdisk_mod_SOURCES = disk/memdisk.c
|
||||
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
# For pci.mod
|
||||
pci_mod_SOURCES = bus/pci.c
|
||||
pci_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
|
|
|
@ -62,7 +62,6 @@ pkglib_MODULES = halt.mod \
|
|||
reboot.mod \
|
||||
suspend.mod \
|
||||
multiboot.mod \
|
||||
memdisk.mod \
|
||||
lsmmap.mod
|
||||
|
||||
# For boot.mod.
|
||||
|
@ -98,11 +97,6 @@ multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \
|
|||
multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
# For memdisk.mod.
|
||||
memdisk_mod_SOURCES = disk/memdisk.c
|
||||
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
# For lsmmap.mod
|
||||
lsmmap_mod_SOURCES = commands/lsmmap.c
|
||||
lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
|
|
|
@ -99,7 +99,6 @@ grub_install_SOURCES = util/sparc64/ieee1275/grub-install.in
|
|||
pkglib_MODULES = halt.mod \
|
||||
linux.mod \
|
||||
reboot.mod \
|
||||
memdisk.mod \
|
||||
lsmmap.mod
|
||||
|
||||
# For boot.mod.
|
||||
|
@ -123,11 +122,6 @@ halt_mod_SOURCES = commands/halt.c
|
|||
halt_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
# For memdisk.mod.
|
||||
memdisk_mod_SOURCES = disk/memdisk.c
|
||||
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||
|
||||
# For lsmmap.mod
|
||||
lsmmap_mod_SOURCES = commands/lsmmap.c
|
||||
lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||
|
|
|
@ -14,6 +14,9 @@ bin_UTILITIES = grub-mkimage
|
|||
grub_mkimage_SOURCES = gnulib/progname.c util/i386/efi/grub-mkimage.c \
|
||||
util/misc.c util/resolve.c
|
||||
|
||||
bin_SCRIPTS += grub-mkrescue
|
||||
grub_mkrescue_SOURCES = util/grub-mkrescue.in
|
||||
|
||||
# For grub-setup.
|
||||
#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \
|
||||
# util/misc.c util/getroot.c kern/device.c kern/disk.c \
|
||||
|
|
|
@ -31,6 +31,8 @@ native_platform=@platform@
|
|||
|
||||
coreboot_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/${target_cpu}-coreboot
|
||||
pc_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/${target_cpu}-pc
|
||||
efi32_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-efi
|
||||
efi64_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi
|
||||
|
||||
# Usage: usage
|
||||
# Print the usage.
|
||||
|
@ -109,13 +111,23 @@ if [ "${override_dir}" = "" ] ; then
|
|||
if test -e "${pc_dir}" ; then
|
||||
process_input_dir ${pc_dir} pc
|
||||
fi
|
||||
if test -e "${efi32_dir}" ; then
|
||||
process_input_dir ${efi32_dir} efi32
|
||||
fi
|
||||
if test -e "${efi64_dir}" ; then
|
||||
process_input_dir ${efi64_dir} efi64
|
||||
fi
|
||||
else
|
||||
process_input_dir ${override_dir} ${native_platform}
|
||||
coreboot_dir=
|
||||
pc_dir=
|
||||
case "${native_platform}" in
|
||||
coreboot) coreboot_dir=${override_dir} ;;
|
||||
pc) pc_dir=${override_dir} ;;
|
||||
efi32_dir=
|
||||
efi64_dir=
|
||||
case "${target_cpu}-${native_platform}" in
|
||||
i386-coreboot) coreboot_dir=${override_dir} ;;
|
||||
i386-pc) pc_dir=${override_dir} ;;
|
||||
i386-efi) efi32_dir=${override_dir} ;;
|
||||
x86_64-efi) efi64_dir=${override_dir} ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
@ -168,6 +180,23 @@ if test -e "${pc_dir}" ; then
|
|||
grub_mkisofs_arguments="${grub_mkisofs_arguments} -b boot/grub/i386-pc/eltorito.img -boot-info-table"
|
||||
fi
|
||||
|
||||
# build bootx64.efi
|
||||
if test -e "${efi64_dir}" ; then
|
||||
echo "Generates bootx64.efi"
|
||||
mkdir -p ${iso9660_dir}/efi/boot
|
||||
grub-mkimage -d ${efi64_dir}/ -o ${iso9660_dir}/efi/boot/bootx64.efi --prefix=/boot/grub/x86_64-efi \
|
||||
search iso9660 configfile sh
|
||||
|
||||
modules="$(cat ${efi64_dir}/partmap.lst) ${modules}"
|
||||
(for i in ${modules} ; do
|
||||
if [ "x$i" != xkernel.mod ]; then
|
||||
echo "insmod $i"
|
||||
fi
|
||||
done ; \
|
||||
echo "source /boot/grub/grub.cfg") \
|
||||
> ${iso9660_dir}/boot/grub/x86_64-efi/grub.cfg
|
||||
fi
|
||||
|
||||
# build iso image
|
||||
grub-mkisofs ${grub_mkisofs_arguments} -o ${output_image} -r ${iso9660_dir} ${source}
|
||||
rm -rf ${iso9660_dir}
|
||||
|
|
Loading…
Reference in a new issue