Changeset 83285fd in mainline for boot/Makefile.grub


Ignore:
Timestamp:
2011-11-30T12:05:30Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fb48a0e
Parents:
f4e508f
Message:

add configuration choice to boot the ISO image using GRUB for BIOS (common PC) or GRUB for UEFI
a hybrid BIOS/UEFI boot ISO should be also possible to create, but the current mkisofs does not support this

File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.grub

    rf4e508f r83285fd  
    3131include Makefile.common
    3232
    33 GRUB2 = grub
    34 STAGE2 = $(GRUB2)/i386-pc/eltorito.img
    35 STAGE2_IN = boot/$(STAGE2)
     33GRUB = grub.$(GRUB_ARCH)
     34BOOT = $(DISTROOT)/boot
     35
     36ELTORITO = boot/grub/$(GRUB_ARCH).img
     37IMAGE = $(DISTROOT)/$(ELTORITO)
     38
     39ifeq ($(GRUB_ARCH),pc)
     40        BOOT_CONFIG = $(BOOT)/grub/i386-pc/grub.cfg
     41endif
     42ifeq ($(GRUB_ARCH),efi)
     43        BOOT_CONFIG = $(BOOT)/grub/grub.cfg
     44endif
    3645
    3746all: $(BOOT_OUTPUT)
    3847
    3948$(BOOT_OUTPUT): build_dist
    40         mkisofs -J -r -input-charset utf-8 -b $(STAGE2_IN) -no-emul-boot -boot-load-size 64 -boot-info-table -o $@ $(DISTROOT)/
     49ifeq ($(GRUB_ARCH),pc)
     50        mkisofs -J -r -input-charset utf-8 -V "HelenOS boot ISO" -eltorito-boot $(ELTORITO) -no-emul-boot -boot-load-size 64 -boot-info-table -o $@ $(DISTROOT)/
     51endif
     52ifeq ($(GRUB_ARCH),efi)
     53        mkisofs -J -r -input-charset utf-8 -V "HelenOS boot ISO" -efi-boot $(ELTORITO) -o $@ $(DISTROOT)/
     54endif
    4155
    4256build_dist: clean
    43         mkdir -p $(DISTROOT)/boot
    44         cp -r $(GRUB2) $(DISTROOT)/boot
     57        mkdir -p $(BOOT)
     58        cp -r $(GRUB) $(BOOT)/grub
     59ifeq ($(GRUB_ARCH),efi)
     60        gunzip $(IMAGE)
     61endif
     62       
    4563        for module in $(COMPONENTS) ; do \
    46                 cp "$$module" $(DISTROOT)/boot/ ; \
     64                cp "$$module" $(BOOT)/ ; \
    4765        done
    4866       
    49         echo "set default=0" > $(DISTROOT)/boot/grub/i386-pc/grub.cfg
    50         echo "set timeout=10" >> $(DISTROOT)/boot/grub/i386-pc/grub.cfg
    51         echo "" >> $(DISTROOT)/boot/grub/i386-pc/grub.cfg
     67        echo "set default=0" > $(BOOT_CONFIG)
     68        echo "set timeout=10" >> $(BOOT_CONFIG)
     69        echo "" >> $(BOOT_CONFIG)
    5270       
    53         echo "menuentry 'HelenOS $(RELEASE)' --class helenos --class os {" >> $(DISTROOT)/boot/grub/i386-pc/grub.cfg
    54         echo "  set root='(cd)'" >> $(DISTROOT)/boot/grub/i386-pc/grub.cfg
    55        
     71        echo "menuentry 'HelenOS $(RELEASE)' --class helenos --class os {" >> $(BOOT_CONFIG)
    5672        for module in $(MODULES) ; do \
    57                 echo "" >> $(DISTROOT)/boot/grub/i386-pc/grub.cfg ; \
    58                 echo "  echo 'Loading $$module'" >> $(DISTROOT)/boot/grub/i386-pc/grub.cfg ; \
     73                echo "  echo 'Loading $$module'" >> $(BOOT_CONFIG) ; \
    5974                if [ "$$module" = "kernel.bin" ] ; then \
    60                         echo "  multiboot /boot/$$module" >> $(DISTROOT)/boot/grub/i386-pc/grub.cfg ; \
     75                        echo "  multiboot /boot/$$module" >> $(BOOT_CONFIG) ; \
    6176                else \
    62                         echo "  module /boot/$$module" >> $(DISTROOT)/boot/grub/i386-pc/grub.cfg ; \
     77                        echo "  module /boot/$$module" >> $(BOOT_CONFIG) ; \
    6378                fi \
    6479        done
    65        
    66         echo "}" >> $(DISTROOT)/boot/grub/i386-pc/grub.cfg
     80        echo "}" >> $(BOOT_CONFIG)
    6781
    6882clean:
Note: See TracChangeset for help on using the changeset viewer.