mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2025-02-25 18:55:23 -06:00
Add grub-iso target in 64-bit make file for test purposes.
This commit is contained in:
@@ -132,4 +132,57 @@ memtest.iso: memtest.mbr floppy.img esp.img
|
||||
iso: memtest.iso
|
||||
|
||||
clean:
|
||||
rm -rf boot system lib tests app *.img *.iso memtest* iso
|
||||
rm -rf boot system lib tests app *.img *.iso memtest* iso grub-*
|
||||
|
||||
# grub-memtest.iso can be used for testing the various different boot modes,
|
||||
# using GRUB as an intermediate bootloader. Upstream GRUB only supports the
|
||||
# 16-bit and 32-bit boot protocols, via the "linux16" and "linux" commands.
|
||||
# Fedora add support for the EFI handover boot protocols, via the "linuxefi"
|
||||
# command, and, since 2019, remove support for the 32-bit protocol, aliasing
|
||||
# the "linux" command to either "linux16" or "linuxefi", depending on whether
|
||||
# you boot in legacy or EFI mode. Mageia follows Fedora, but restores support
|
||||
# for the 32-bit protocol, via the "linux32" command. Other distributions no
|
||||
# doubt do their own thing. The boot menu on grub-memtest.iso attempts to
|
||||
# support all these options.
|
||||
|
||||
GRUB_FONT_DIR ?= /usr/share/grub
|
||||
|
||||
GRUB_LIB_DIR ?= /usr/lib/grub
|
||||
|
||||
GRUB_MKIMAGE ?= grub2-mkimage
|
||||
|
||||
GRUB_MODULES = iso9660 fat part_msdos all_video font gfxterm gfxmenu \
|
||||
boot chain configfile echo ls
|
||||
|
||||
grub-eltorito.img:
|
||||
$(GRUB_MKIMAGE) --output $@ --prefix /boot/grub --format i386-pc-eltorito biosdisk $(GRUB_MODULES)
|
||||
|
||||
grub-bootx64.efi:
|
||||
$(GRUB_MKIMAGE) --output $@ --prefix /EFI/BOOT/grub --format x86_64-efi $(GRUB_MODULES)
|
||||
|
||||
grub-esp.img: memtest.efi grub-bootx64.efi grub/grub-efi.cfg
|
||||
@mkdir -p grub-iso/EFI/BOOT/grub/x86_64-efi grub-iso/EFI/BOOT/grub/fonts
|
||||
cp memtest.efi grub-iso/EFI/BOOT/pcmemtest
|
||||
cp grub-bootx64.efi grub-iso/EFI/BOOT/bootx64.efi
|
||||
cp grub/grub-efi.cfg grub-iso/EFI/BOOT/grub/grub.cfg
|
||||
cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/EFI/BOOT/grub/fonts/
|
||||
cp $(GRUB_LIB_DIR)/x86_64-efi/*.mod grub-iso/EFI/BOOT/grub/x86_64-efi/
|
||||
@rm -f grub-esp.img
|
||||
/sbin/mkdosfs -n MEMTEST-ESP -F12 -C grub-esp.img 8192
|
||||
mcopy -s -i grub-esp.img grub-iso/EFI ::
|
||||
|
||||
grub-memtest.iso: memtest.bin grub-eltorito.img grub/grub-legacy.cfg grub-esp.img
|
||||
@mkdir -p grub-iso/boot/grub/i386-pc grub-iso/boot/grub/fonts
|
||||
cp memtest.bin grub-iso/boot/pcmemtest
|
||||
cp grub-eltorito.img grub-iso/boot/eltorito.img
|
||||
cp grub/grub-legacy.cfg grub-iso/boot/grub/grub.cfg
|
||||
cp $(GRUB_FONT_DIR)/unicode.pf2 grub-iso/boot/grub/fonts/
|
||||
cp $(GRUB_LIB_DIR)/i386-pc/*.mod grub-iso/boot/grub/i386-pc/
|
||||
xorrisofs -pad -R -J -volid PCMemTest64 -graft-points -hide-rr-moved \
|
||||
--grub2-mbr $(GRUB_LIB_DIR)/i386-pc/boot_hybrid.img \
|
||||
-b /boot/eltorito.img -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \
|
||||
--efi-boot --interval:appended_partition_2:all:: \
|
||||
-part_like_isohybrid -iso_mbr_part_type 0x00 -append_partition 2 0xef ./grub-esp.img \
|
||||
-o ./grub-memtest.iso /boot=./grub-iso/boot /EFI=./grub-iso/EFI
|
||||
|
||||
grub-iso: grub-memtest.iso
|
||||
|
||||
22
build64/grub/grub-efi.cfg
Normal file
22
build64/grub/grub-efi.cfg
Normal file
@@ -0,0 +1,22 @@
|
||||
if loadfont unicode ; then
|
||||
set gfxmode=1024x768,800x600,auto
|
||||
set gfxpayload=800x600,1024x768
|
||||
terminal_output gfxterm
|
||||
fi
|
||||
|
||||
set default=0
|
||||
set timeout=-1
|
||||
|
||||
insmod linux
|
||||
insmod linuxefi
|
||||
insmod linux32
|
||||
|
||||
menuentry "Start PCMemTest using 'linux' command" {
|
||||
linux /EFI/BOOT/pcmemtest
|
||||
}
|
||||
menuentry "Start PCMemTest using 'linuxefi' command" {
|
||||
linuxefi /EFI/BOOT/pcmemtest
|
||||
}
|
||||
menuentry "Start PCMemTest using 'linux32' command" {
|
||||
linux32 /EFI/BOOT/pcmemtest
|
||||
}
|
||||
22
build64/grub/grub-legacy.cfg
Normal file
22
build64/grub/grub-legacy.cfg
Normal file
@@ -0,0 +1,22 @@
|
||||
if loadfont unicode ; then
|
||||
set gfxmode=1024x768,800x600,auto
|
||||
set gfxpayload=800x600,1024x768
|
||||
terminal_output gfxterm
|
||||
fi
|
||||
|
||||
set default=0
|
||||
set timeout=-1
|
||||
|
||||
insmod linux
|
||||
insmod linux16
|
||||
insmod linux32
|
||||
|
||||
menuentry "Start PCMemTest using 'linux' command" {
|
||||
linux /boot/pcmemtest
|
||||
}
|
||||
menuentry "Start PCMemTest using 'linux16' command" {
|
||||
linux16 /boot/pcmemtest
|
||||
}
|
||||
menuentry "Start PCMemTest using 'linux32' command" {
|
||||
linux32 /boot/pcmemtest
|
||||
}
|
||||
Reference in New Issue
Block a user