3 include $(SRCDIR)/config/aros.cfg
5 #MM- arch-common-grub2-host : grub2-host-quick grub2-efi-host-quick
6 #MM grub2-iso-setup : grub2-host-quick grub2-efi-host-quick grub2-aros-quick
7 #MM- bootloader-grub2 : arch-common-grub2
8 #MM- bootloader-grub2-isosetup : arch-common-grub2 grub2-iso-setup
9 #MM grub2-host : grub2-aros-fetch
10 #MM- grub2-host-quick : grub2-aros-fetch
11 #MM grub2-efi-host : grub2-aros-fetch
12 #MM- grub2-efi-host-quick : grub2-aros-fetch
14 BOOT_GRUB := $(AROSARCHDIR)/grub
15 BOOT_EFI := $(AROSDIR)/EFI/BOOT/grub
16 GRUBSRCDIR := $(PORTSDIR)/grub/grub-$(GRUB2_VERSION)
37 bootloader-grub2gfx-common: $(BOOT_GRUB)/splash.png $(BOOT_GRUB)/fonts/_unicode.pf2 $(BOOT_EFI)/splash.png $(BOOT_EFI)/fonts/_unicode.pf2
39 $(BOOT_GRUB)/splash.png: splash.png $(BOOT_GRUB)
42 $(BOOT_GRUB)/fonts/_unicode.pf2: unicode.pf2 $(BOOT_GRUB)/fonts
43 $(CP) $< $(BOOT_GRUB)/fonts/_unicode.pf2
45 $(BOOT_EFI)/splash.png: splash.png $(BOOT_EFI)
48 $(BOOT_EFI)/fonts/_unicode.pf2: unicode.pf2 $(BOOT_EFI)/fonts
49 $(CP) $< $(BOOT_EFI)/fonts/_unicode.pf2
52 bootloader-grub2gfx-common-livecd: $(BOOT_GRUB)/fonts/unicode.pf2 $(BOOT_EFI)/fonts/unicode.pf2
54 $(BOOT_GRUB)/fonts/unicode.pf2: unicode.pf2 $(BOOT_GRUB)/fonts
57 $(BOOT_EFI)/fonts/unicode.pf2: unicode.pf2 $(BOOT_EFI)/fonts
60 # avoid the make.tmpl s_flag in order to disable stripping of binaries
62 # remove all flags, just in case
64 export KERNEL_CFLAGS :=
65 export CONFIG_LDFLAGS :=
67 DESTDIR := $(HOSTGENDIR)/$(CURDIR)/host_binaries
68 CONFIG_OPTS := --build=$(AROS_HOST_CPU)-$(AROS_HOST_ARCH) \
69 --host=$(AROS_HOST_CPU)-$(AROS_HOST_ARCH) \
70 --target=$(AROS_TARGET_CPU) \
71 --datarootdir=$(DESTDIR)/share \
72 --sysconfdir=$(DESTDIR)/etc \
73 --disable-grub-mkfont \
77 grub2-host-touchfileflag := $(GENDIR)/arch/all-pc/boot/.grub2-files-touched
78 grub2-efi-host-touchfileflag := $(GENDIR)/arch/all-pc/boot/.grub2-files-touched
80 %build_with_configure mmake=grub2-host compiler=host nix=yes \
81 prefix="$(DESTDIR)" srcdir=$(GRUBSRCDIR) \
82 package=pc extraoptions="$(CONFIG_OPTS) --with-platform=pc" \
83 install_target= kernelisaflags= targetisaflags=
85 %build_with_configure mmake=grub2-efi-host compiler=host nix=yes \
86 prefix="$(DESTDIR)" srcdir=$(GRUBSRCDIR) \
87 package=efi extraoptions="$(CONFIG_OPTS) --with-platform=efi" \
88 install_target= kernelisaflags= targetisaflags=
92 GRUB2_MODS := fshelp part_msdos part_amiga part_gpt \
93 fat ntfs ntfscomp affs sfs ext2 hfsplus iso9660 \
95 LST_FILES := command fs moddep
96 MKIMG_OPTS := -O i386-pc -p /$(AROS_DIR_ARCH)/grub
97 MKIMG_EFI := -O $(AROS_TARGET_CPU)-efi -p /EFI/BOOT/grub
100 EFI_GRUB_IMG := BOOTX64.EFI
102 EFI_GRUB_IMG := BOOTIA32.EFI
106 grub2-iso-setup: grub2-pc-iso-setup grub2-efi-iso-setup
109 grub2-pc-iso-setup: $(BOOT_GRUB)/i386-pc
110 @$(ECHO) Creating $(BOOT_GRUB)...
111 @cd $(HOSTGENDIR)/$(CURDIR)/pc/grub-core && \
112 ../grub-mkimage $(MKIMG_OPTS) -d . -o core.img $(PC_MODS) $(GRUB2_MODS) && \
113 $(CP) *.img $(BOOT_GRUB)/i386-pc && \
114 $(CP) *.mod $(BOOT_GRUB)/i386-pc && \
115 $(CP) $(addsuffix .lst,$(LST_FILES)) $(BOOT_GRUB)/i386-pc && \
116 $(CAT) cdboot.img core.img > $(BOOT_GRUB)/i386-pc/grub2_eltorito
119 grub2-efi-iso-setup: $(BOOT_EFI)/i386-efi
120 @$(ECHO) Creating $(BOOT_EFI)...
121 @cd $(HOSTGENDIR)/$(CURDIR)/efi/grub-core && \
122 ../grub-mkimage $(MKIMG_EFI) -d . -o grub.efi $(EFI_MODS) $(GRUB2_MODS) && \
123 $(CP) grub.efi $(AROSDIR)/EFI/BOOT/$(EFI_GRUB_IMG) && \
124 $(CP) *.mod $(BOOT_EFI)/i386-efi && \
125 $(CP) $(addsuffix .lst,$(LST_FILES)) $(BOOT_EFI)/i386-efi