2010-03-16 02:51:45 +03:00
|
|
|
# Set anyboot file name and directory defaults.
|
|
|
|
HAIKU_ANYBOOT_NAME ?= $(HAIKU_DEFAULT_ANYBOOT_NAME) ;
|
|
|
|
HAIKU_ANYBOOT_DIR ?= $(HAIKU_DEFAULT_ANYBOOT_DIR) ;
|
|
|
|
HAIKU_ANYBOOT = $(HAIKU_ANYBOOT_NAME) ;
|
|
|
|
HAIKU_ANYBOOT_LABEL ?= $(HAIKU_DEFAULT_ANYBOOT_LABEL) ;
|
|
|
|
|
2010-02-28 21:54:16 +03:00
|
|
|
rule BuildAnybootImage anybootImage : mbrPart : isoPart : imageFile {
|
|
|
|
local anyboot = <build>anyboot ;
|
|
|
|
|
|
|
|
Depends $(anybootImage) : $(anyboot) ;
|
|
|
|
Depends $(anybootImage) : $(isoPart) ;
|
|
|
|
Depends $(anybootImage) : $(mbrPart) ;
|
|
|
|
Depends $(anybootImage) : $(imageFile) ;
|
|
|
|
|
2017-05-27 00:13:44 +03:00
|
|
|
BuildAnybootImage1 $(anybootImage) : $(anyboot) $(mbrPart) $(isoPart) $(imageFile) ;
|
2010-02-28 21:54:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
actions BuildAnybootImage1 {
|
2017-05-27 00:13:44 +03:00
|
|
|
$(2[1]) -b $(2[2]) $(2[3]) $(2[4]) $(1)
|
2010-02-28 21:54:16 +03:00
|
|
|
}
|
|
|
|
|
2018-10-09 03:28:00 +03:00
|
|
|
rule BuildAnybootImageEfi anybootImage : mbrPart : efiPart : isoPart : imageFile {
|
|
|
|
local anyboot = <build>anyboot ;
|
|
|
|
|
|
|
|
Depends $(anybootImage) : $(anyboot) ;
|
|
|
|
Depends $(anybootImage) : $(isoPart) ;
|
|
|
|
Depends $(anybootImage) : $(mbrPart) ;
|
|
|
|
Depends $(anybootImage) : $(efiPart) ;
|
|
|
|
Depends $(anybootImage) : $(imageFile) ;
|
|
|
|
|
|
|
|
BuildAnybootImageEfi1 $(anybootImage) : $(anyboot) $(mbrPart) $(efiPart) $(isoPart) $(imageFile) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
actions BuildAnybootImageEfi1 {
|
|
|
|
$(2[1]) -b $(2[2]) -e $(2[3]) $(2[4]) $(2[5]) $(1)
|
|
|
|
}
|
|
|
|
|
2010-03-16 02:51:45 +03:00
|
|
|
local baseMBR = base_mbr.bin ;
|
2015-06-01 14:11:47 +03:00
|
|
|
local mbrSource = [ FDirName $(HAIKU_TOP) src bin writembr mbr.S ] ;
|
|
|
|
BuildMBR $(baseMBR) : $(mbrSource) ;
|
2010-03-16 02:51:45 +03:00
|
|
|
MakeLocate $(baseMBR) : $(HAIKU_OUTPUT_DIR) ;
|
|
|
|
MakeLocate $(HAIKU_ANYBOOT) : $(HAIKU_ANYBOOT_DIR) ;
|
2018-10-09 03:28:00 +03:00
|
|
|
|
2020-03-13 21:28:22 +03:00
|
|
|
# Currently the Anyboot image is available only for EFI+BIOS or BIOS-only
|
|
|
|
# systems. It is not needed for other systems, where usually you can boot
|
|
|
|
# the same way from an USB or CD drive, instead of needing completely
|
|
|
|
# different layouts.
|
|
|
|
for platform in [ MultiBootSubDirSetup ] {
|
|
|
|
on $(platform) {
|
|
|
|
if $(TARGET_BOOT_PLATFORM) = efi {
|
|
|
|
local efiLoader = haiku_loader.efi ;
|
|
|
|
local efiPartition = esp.image ;
|
|
|
|
MakeLocate $(efiPartition) ;
|
|
|
|
BuildEfiSystemPartition $(efiPartition) : $(efiLoader) ;
|
|
|
|
BuildAnybootImageEfi $(HAIKU_ANYBOOT) : $(baseMBR)
|
|
|
|
: $(efiPartition) : $(HAIKU_CD_BOOT_IMAGE)
|
|
|
|
: $(HAIKU_IMAGE_NAME) ;
|
|
|
|
} else if $(HAIKU_ANYBOOT_LEGACY) = 1 {
|
|
|
|
BuildAnybootImage $(HAIKU_ANYBOOT) : $(baseMBR)
|
|
|
|
: $(HAIKU_CD_BOOT_IMAGE) : $(HAIKU_IMAGE_NAME) ;
|
|
|
|
}
|
|
|
|
}
|
2018-10-09 03:28:00 +03:00
|
|
|
}
|
2010-02-28 21:54:16 +03:00
|
|
|
|
|
|
|
# TODO: this one seems to cause the build to fail each other run (caching?)
|
2010-03-16 02:51:45 +03:00
|
|
|
#RmTemps $(HAIKU_ANYBOOT) : $(baseMBR) ;
|
|
|
|
RmTemps $(HAIKU_ANYBOOT) : $(HAIKU_CD_BOOT_IMAGE) ;
|
|
|
|
RmTemps $(HAIKU_ANYBOOT) : $(HAIKU_IMAGE_NAME) ;
|
|
|
|
RmTemps $(HAIKU_ANYBOOT) : $(HAIKU_BOOT_FLOPPY) ;
|
2010-02-28 21:54:16 +03:00
|
|
|
|
|
|
|
NotFile haiku-anyboot-image ;
|
2010-03-16 02:51:45 +03:00
|
|
|
Depends haiku-anyboot-image : $(HAIKU_ANYBOOT) ;
|