Skip to content

Commit

Permalink
EFI-compatible iso creation
Browse files Browse the repository at this point in the history
  • Loading branch information
djphoenix committed Nov 19, 2016
1 parent 6238691 commit d340fa8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
13 changes: 11 additions & 2 deletions makefiles/images.mk
Expand Up @@ -11,7 +11,7 @@ SYSLINUX_DEP_FILELIST := \

SYSLINUX_FILELIST := $(notdir $(SYSLINUX_DEP_FILELIST))

ISOFILES := $(foreach f, $(SYSLINUX_FILELIST) phoenixos isolinux.cfg, $(ISOROOT)/$(f))
ISOFILES := $(foreach f, $(SYSLINUX_FILELIST) phoenixos isolinux.cfg efiboot.img, $(ISOROOT)/$(f))

define SYSLINUX_EXTRACT
$(ISOROOT)/$(1): deps/$(DEP_SYSLINUX_FILE)
Expand All @@ -28,10 +28,19 @@ $(ISOROOT)/phoenixos: $(BIN)

$(ISOROOT)/isolinux.cfg:
@ mkdir -p $(dir $@)
$(Q) echo 'default /mboot.c32 /phoenixos' > $(ISOROOT)/isolinux.cfg
$(Q) echo 'default /mboot.c32 /phoenixos' > $@

$(ISOROOT)/efiboot.img: $(BIN)
@ mkdir -p $(dir $@)
$(Q) truncate -s 4m $@
$(Q) $(MKFAT) -t 1 -h 1 -s 8192 -v EFI -L 32 -i $@
$(Q) $(MMD) -i $@ ::efi
$(Q) $(MMD) -i $@ ::efi/boot
$(Q) $(MCOPY) -i $@ $(BIN) ::efi/boot/bootx64.efi

ISOOPTS := -quiet -U -A $(ISONAME) -V $(ISONAME) -volset $(ISONAME) -J -joliet-long -r
ISOOPTS += -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table
ISOOPTS += -eltorito-alt-boot -e efiboot.img -no-emul-boot

bin/phoenixos.iso: $(ISOFILES)
@ mkdir -p $(dir $@)
Expand Down
21 changes: 19 additions & 2 deletions makefiles/toolchain.mk
Expand Up @@ -40,7 +40,7 @@ QEMU=qemu-system-x86_64
ifneq ($(shell which cpplint),)
LINT=$(shell which cpplint) --quiet
else
LINT=@ sh -c "echo No lint found"
LINT=@ sh -c "echo No lint found"; true
endif

ifneq ($(shell which xorriso),)
Expand All @@ -52,8 +52,25 @@ else
ifneq ($(shell which genisoimage),)
MKISO := $(shell which genisoimage)
else
MKISO=@ sh -c "echo Neither xorriso nor mkisofs nor genisoimage was found"
MKISO=@ sh -c "echo Neither xorriso nor mkisofs nor genisoimage was found"; false
endif
endif
endif

ifneq ($(shell which mformat),)
MKFAT := $(shell which mformat)
else
MKFAT := @ sh -c "echo mformat not found"; false
endif

ifneq ($(shell which mcopy),)
MCOPY := $(shell which mcopy)
else
MCOPY := @ sh -c "echo mcopy not found"; false
endif

ifneq ($(shell which mmd),)
MMD := $(shell which mmd)
else
MMD := @ sh -c "echo mmd not found"; false
endif

0 comments on commit d340fa8

Please sign in to comment.