system/boot: Add support for multiple bootloaders
This commit is contained in:
committed by
Alexander von Gluck IV
parent
f15270537a
commit
1f96a3cbde
+62
-40
@@ -239,13 +239,15 @@ rule KernelArchitectureSetup architecture
|
||||
|
||||
switch $(cpu) {
|
||||
case ppc :
|
||||
HAIKU_BOOT_PLATFORM ?= openfirmware ;
|
||||
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
|
||||
HAIKU_KERNEL_PLATFORM ?= openfirmware ;
|
||||
HAIKU_BOOT_TARGETS += openfirmware ;
|
||||
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB
|
||||
# offset in floppy image (>= sizeof(haiku_loader))
|
||||
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 384 ; # in kB
|
||||
|
||||
case arm :
|
||||
HAIKU_BOOT_PLATFORM ?= u-boot ;
|
||||
HAIKU_KERNEL_PLATFORM ?= u-boot ;
|
||||
HAIKU_BOOT_TARGETS += u-boot ;
|
||||
|
||||
HAIKU_BOOT_SDIMAGE_SIZE ?= 128 ;
|
||||
# SOC's like allwinner need an offset to skip the hardcoded initial loader
|
||||
@@ -269,7 +271,9 @@ rule KernelArchitectureSetup architecture
|
||||
HAIKU_BOOT_LOADER_BASE ?= 0x1000000 ;
|
||||
|
||||
case x86 :
|
||||
HAIKU_BOOT_PLATFORM ?= bios_ia32 ;
|
||||
HAIKU_KERNEL_PLATFORM ?= bios_ia32 ;
|
||||
HAIKU_BOOT_TARGETS += bios_ia32 pxe_ia32 ;
|
||||
|
||||
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
|
||||
# offset in floppy image (>= sizeof(haiku_loader))
|
||||
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 320 ; # in kB
|
||||
@@ -280,8 +284,10 @@ rule KernelArchitectureSetup architecture
|
||||
}
|
||||
|
||||
case x86_64 :
|
||||
# x86_64 completely shares the x86 bootloader.
|
||||
HAIKU_BOOT_PLATFORM ?= bios_ia32 ;
|
||||
# x86_64 completely shares the x86 bootloader for MBR.
|
||||
HAIKU_KERNEL_PLATFORM ?= bios_ia32 ;
|
||||
HAIKU_BOOT_TARGETS += bios_ia32 efi pxe_ia32 ;
|
||||
|
||||
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
|
||||
# offset in floppy image (>= sizeof(haiku_loader))
|
||||
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 320 ; # in kB
|
||||
@@ -295,8 +301,9 @@ rule KernelArchitectureSetup architecture
|
||||
}
|
||||
|
||||
case m68k :
|
||||
HAIKU_BOOT_PLATFORM ?= atari_m68k ;
|
||||
switch $(HAIKU_BOOT_PLATFORM) {
|
||||
HAIKU_KERNEL_PLATFORM ?= atari_m68k ;
|
||||
HAIKU_BOOT_TARGETS += atari_m68k ;
|
||||
switch $(HAIKU_KERNEL_PLATFORM) {
|
||||
case atari_m68k :
|
||||
{
|
||||
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB
|
||||
@@ -319,7 +326,7 @@ rule KernelArchitectureSetup architecture
|
||||
# private kernel headers to be used when compiling kernel code
|
||||
HAIKU_PRIVATE_KERNEL_HEADERS =
|
||||
[ PrivateHeaders $(DOT) kernel libroot shared
|
||||
kernel/boot/platform/$(HAIKU_BOOT_PLATFORM) ]
|
||||
kernel/boot/platform/$(HAIKU_KERNEL_PLATFORM) ]
|
||||
[ ArchHeaders $(HAIKU_KERNEL_ARCH) ]
|
||||
[ FDirName $(HAIKU_COMMON_DEBUG_OBJECT_DIR_$(architecture)) system
|
||||
kernel ]
|
||||
@@ -379,11 +386,8 @@ rule KernelArchitectureSetup architecture
|
||||
HAIKU_KERNEL_C++FLAGS += -mtune=68020-60 ;
|
||||
|
||||
case x86 :
|
||||
# EFI Bootloader
|
||||
if $(HAIKU_BOOT_PLATFORM) = efi {
|
||||
HAIKU_BOOT_CCFLAGS += -mno-red-zone -maccumulate-outgoing-args ;
|
||||
HAIKU_BOOT_C++FLAGS += -mno-red-zone -maccumulate-outgoing-args ;
|
||||
}
|
||||
HAIKU_KERNEL_CCFLAGS += -march=pentium ;
|
||||
HAIKU_KERNEL_C++FLAGS += -march=pentium ;
|
||||
|
||||
case x86_64 :
|
||||
# Kernel lives in the top 2GB of the address space, use kernel code
|
||||
@@ -398,23 +402,6 @@ rule KernelArchitectureSetup architecture
|
||||
HAIKU_KERNEL_PIC_LINKFLAGS += -z max-page-size=0x1000 ;
|
||||
HAIKU_KERNEL_ADDON_LINKFLAGS += -z max-page-size=0x1000 ;
|
||||
|
||||
# BIOS Bootloader is 32-bit.
|
||||
if $(HAIKU_BOOT_PLATFORM) = bios_ia32 {
|
||||
if $(HAIKU_CC_IS_CLANG_$(architecture)) = 1 {
|
||||
HAIKU_BOOT_LINKFLAGS += -m elf_i386 ;
|
||||
} else {
|
||||
HAIKU_BOOT_LINKFLAGS += -m elf_i386_haiku ;
|
||||
}
|
||||
HAIKU_BOOT_CCFLAGS += -m32 -march=pentium ;
|
||||
HAIKU_BOOT_C++FLAGS += -m32 -march=pentium ;
|
||||
}
|
||||
|
||||
# EFI Bootloader
|
||||
if $(HAIKU_BOOT_PLATFORM) = efi {
|
||||
HAIKU_BOOT_CCFLAGS += -mno-red-zone -maccumulate-outgoing-args ;
|
||||
HAIKU_BOOT_C++FLAGS += -mno-red-zone -maccumulate-outgoing-args ;
|
||||
}
|
||||
|
||||
if x86 in $(HAIKU_ARCHS[2-]) || x86_gcc2 in $(HAIKU_ARCHS[2-]) {
|
||||
Echo "Enable kernel ia32 compatibility" ;
|
||||
HAIKU_KERNEL_DEFINES += _COMPAT_MODE ;
|
||||
@@ -422,15 +409,50 @@ rule KernelArchitectureSetup architecture
|
||||
}
|
||||
}
|
||||
|
||||
if $(HAIKU_BOOT_PLATFORM) = efi {
|
||||
HAIKU_BOOT_CCFLAGS += -fpic -fno-stack-protector -fPIC -fshort-wchar
|
||||
-Wno-error=unused-variable ;
|
||||
HAIKU_BOOT_C++FLAGS += -fpic -fno-stack-protector -fPIC -fshort-wchar
|
||||
-Wno-error=unused-variable ;
|
||||
HAIKU_BOOT_LDFLAGS = -Bstatic -Bsymbolic -shared -nostdlib -znocombreloc -nostartfiles -no-undefined ;
|
||||
} else {
|
||||
HAIKU_BOOT_CCFLAGS += -fno-pic ;
|
||||
HAIKU_BOOT_C++FLAGS += -fno-pic ;
|
||||
local bootTarget ;
|
||||
for bootTarget in $(HAIKU_BOOT_TARGETS) {
|
||||
switch $(bootTarget) {
|
||||
case efi :
|
||||
# efi bootloader is PIC
|
||||
HAIKU_BOOT_$(bootTarget:U)_CCFLAGS += -fpic -fno-stack-protector
|
||||
-fPIC -fshort-wchar -mno-red-zone -maccumulate-outgoing-args
|
||||
-Wno-error=unused-variable -Wno-error=main ;
|
||||
HAIKU_BOOT_$(bootTarget:U)_C++FLAGS += -fpic -fno-stack-protector
|
||||
-fPIC -fshort-wchar -mno-red-zone -maccumulate-outgoing-args
|
||||
-Wno-error=unused-variable -Wno-error=main ;
|
||||
HAIKU_BOOT_$(bootTarget:U)_LDFLAGS = -Bstatic -Bsymbolic
|
||||
-nostdlib -znocombreloc -nostartfiles -no-undefined ;
|
||||
case bios_ia32 :
|
||||
# bios_ia32 is non-PIC
|
||||
HAIKU_BOOT_$(bootTarget:U)_CCFLAGS += -fno-pic -march=pentium ;
|
||||
HAIKU_BOOT_$(bootTarget:U)_C++FLAGS += -fno-pic -march=pentium ;
|
||||
if $(HAIKU_CC_IS_CLANG_$(architecture)) = 1 {
|
||||
HAIKU_BOOT_$(bootTarget:U)_LDFLAGS += -m elf_i386 ;
|
||||
} else {
|
||||
HAIKU_BOOT_$(bootTarget:U)_LDFLAGS += -m elf_i386_haiku ;
|
||||
}
|
||||
if $(gccVersion[1]) >= 3 {
|
||||
HAIKU_BOOT_$(bootTarget:U)_CCFLAGS += -Wno-error=main -m32 ;
|
||||
HAIKU_BOOT_$(bootTarget:U)_C++FLAGS += -Wno-error=main -m32 ;
|
||||
}
|
||||
case pxe_ia32 :
|
||||
# pxe_ia32 is non-PIC
|
||||
HAIKU_BOOT_$(bootTarget:U)_CCFLAGS += -fno-pic -march=pentium ;
|
||||
HAIKU_BOOT_$(bootTarget:U)_C++FLAGS += -fno-pic -march=pentium ;
|
||||
if $(HAIKU_CC_IS_CLANG_$(architecture)) = 1 {
|
||||
HAIKU_BOOT_$(bootTarget:U)_LDFLAGS += -m elf_i386 ;
|
||||
} else {
|
||||
HAIKU_BOOT_$(bootTarget:U)_LDFLAGS += -m elf_i386_haiku ;
|
||||
}
|
||||
if $(gccVersion[1]) >= 3 {
|
||||
HAIKU_BOOT_$(bootTarget:U)_CCFLAGS += -Wno-error=main -m32 ;
|
||||
HAIKU_BOOT_$(bootTarget:U)_C++FLAGS += -Wno-error=main -m32 ;
|
||||
}
|
||||
case * :
|
||||
# all other bootloaders are non-PIC
|
||||
HAIKU_BOOT_$(bootTarget:U)_CCFLAGS += -fno-pic -Wno-error=main ;
|
||||
HAIKU_BOOT_$(bootTarget:U)_C++FLAGS += -fno-pic -Wno-error=main ;
|
||||
}
|
||||
}
|
||||
|
||||
# warning flags
|
||||
|
||||
+86
-15
@@ -1,10 +1,72 @@
|
||||
rule MultiBootSubDirSetup bootTargets
|
||||
{
|
||||
local result ;
|
||||
local bootTarget ;
|
||||
bootTargets ?= $(HAIKU_BOOT_TARGETS) ;
|
||||
for bootTarget in $(bootTargets) {
|
||||
local bootTargetObject = $(bootTarget:G=<boot-target-object>) ;
|
||||
result += $(bootTargetObject) ;
|
||||
|
||||
TARGET_BOOT_PLATFORM on $(bootTargetObject) = $(bootTarget) ;
|
||||
|
||||
SOURCE_GRIST on $(bootTargetObject)
|
||||
= $(SOURCE_GRIST:E=)!$(bootTarget) ;
|
||||
|
||||
HDRGRIST on $(bootTargetObject)
|
||||
= $(HDRGRIST:E=)!$(bootTarget) ;
|
||||
|
||||
local var ;
|
||||
for var in TARGET_ARCH {
|
||||
$(var) on $(architectureObject) = $($(var)_$(architecture)) ;
|
||||
}
|
||||
|
||||
# Clone the current config variable values and the variables SubDir
|
||||
# resets.
|
||||
for var in $(AUTO_SET_UP_CONFIG_VARIABLES) SUBDIR$(SUBDIRRESET) {
|
||||
$(var) on $(architectureObject) = $($(var)) ;
|
||||
}
|
||||
|
||||
local hostTarget = HOST TARGET ;
|
||||
local objectDirVars =
|
||||
COMMON_ARCH COMMON_DEBUG DEBUG_$(HAIKU_DEBUG_LEVELS)
|
||||
;
|
||||
objectDirVars =
|
||||
COMMON_PLATFORM_LOCATE_TARGET
|
||||
$(hostTarget)_$(objectDirVars)_LOCATE_TARGET
|
||||
LOCATE_TARGET
|
||||
LOCATE_SOURCE
|
||||
SEARCH_SOURCE
|
||||
;
|
||||
|
||||
for var in $(objectDirVars) {
|
||||
$(var) on $(bootTargetObject) = ;
|
||||
}
|
||||
|
||||
on $(bootTargetObject) {
|
||||
SetupObjectsDir ;
|
||||
SetupFeatureObjectsDir $(bootTarget) ;
|
||||
|
||||
for var in $(objectDirVars) {
|
||||
$(var) on $(bootTargetObject) = $($(var)) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $(result) ;
|
||||
}
|
||||
|
||||
rule MultiBootGristFiles files
|
||||
{
|
||||
return $(files:G=$(TARGET_BOOT_PLATFORM)) ;
|
||||
}
|
||||
|
||||
rule SetupBoot
|
||||
{
|
||||
# Usage SetupBoot <sources_or_objects> : <extra_cc_flags> : <include_private_headers> ;
|
||||
#
|
||||
# <sources_or_objects> - Ideally sources, otherwise HDRSEARCH can not be
|
||||
# set for the sources and the sources some header
|
||||
# dependencies might be missing.
|
||||
# set for the sources and the sources some header
|
||||
# dependencies might be missing.
|
||||
|
||||
local sources = [ FGristFiles $(1) ] ;
|
||||
local objects = $(sources:S=$(SUFOBJ)) ;
|
||||
@@ -19,20 +81,27 @@ rule SetupBoot
|
||||
$(HAIKU_BOOT_C++_HEADERS_DIR_$(TARGET_PACKAGING_ARCH)) ;
|
||||
}
|
||||
|
||||
# MultiBootSubDirSetup sets the target boot platform on the target object,
|
||||
# so this will be correct here in SetupBoot.
|
||||
# This does mean, however, that MultiBootSubDirSetup needs to be used in
|
||||
# all Jamfiles for things to work correctly.
|
||||
# Also means ArchitectureRules need to use platform specific variables,
|
||||
# rather than the previously generic TARGET_BOOT_CCFLAGS and friends.
|
||||
local platform = $(TARGET_BOOT_PLATFORM:U) ;
|
||||
local object ;
|
||||
for object in $(objects) {
|
||||
# add boot flags for the object
|
||||
ObjectCcFlags $(object) : $(TARGET_BOOT_CCFLAGS) $(2) ;
|
||||
ObjectC++Flags $(object) : $(TARGET_BOOT_C++FLAGS) $(2) ;
|
||||
ObjectCcFlags $(object) : $(HAIKU_BOOT_CCFLAGS) $(HAIKU_BOOT_$(platform)_CCFLAGS) $(2) ;
|
||||
ObjectC++Flags $(object) : $(HAIKU_BOOT_C++FLAGS) $(HAIKU_BOOT_$(platform)_C++FLAGS) $(2) ;
|
||||
ObjectDefines $(object) : $(TARGET_KERNEL_DEFINES) ;
|
||||
ASFLAGS on $(object) = $(TARGET_BOOT_CCFLAGS) ;
|
||||
ASFLAGS on $(object) = $(HAIKU_BOOT_$(platform)_CCFLAGS) ;
|
||||
|
||||
# override warning flags
|
||||
TARGET_WARNING_CCFLAGS_$(TARGET_PACKAGING_ARCH) on $(object)
|
||||
= $(TARGET_KERNEL_WARNING_CCFLAGS) ;
|
||||
TARGET_WARNING_C++FLAGS_$(TARGET_PACKAGING_ARCH) on $(object)
|
||||
= $(TARGET_KERNEL_WARNING_C++FLAGS) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rule BootObjects
|
||||
@@ -47,18 +116,20 @@ rule BootLd
|
||||
|
||||
LINK on $(1) = $(TARGET_LD_$(TARGET_PACKAGING_ARCH)) ;
|
||||
|
||||
LINKFLAGS on $(1) = $(TARGET_BOOT_LINKFLAGS) $(4) ;
|
||||
LINKFLAGS on $(1) = $(HAIKU_BOOT_$(TARGET_BOOT_PLATFORM:U)_LDFLAGS) $(4) ;
|
||||
if $(3) { LINKFLAGS on $(1) += --script=$(3) ; }
|
||||
|
||||
# Remove any preset LINKLIBS, but link against libgcc.a. Linking against
|
||||
# libsupc++ is opt-out.
|
||||
local libs ;
|
||||
if ! [ on $(1) return $(HAIKU_NO_LIBSUPC++) ] {
|
||||
libs += [ TargetBootLibsupc++ true ] ;
|
||||
Depends $(1) : [ TargetBootLibsupc++ ] ;
|
||||
if $(TARGET_BOOT_PLATFORM) != efi {
|
||||
local libs ;
|
||||
if ! [ on $(1) return $(HAIKU_NO_LIBSUPC++) ] {
|
||||
libs += [ TargetBootLibsupc++ true ] ;
|
||||
Depends $(1) : [ TargetBootLibsupc++ ] ;
|
||||
}
|
||||
LINKLIBS on $(1) = $(libs) [ TargetBootLibgcc true ] ;
|
||||
Depends $(1) : [ TargetBootLibgcc ] ;
|
||||
}
|
||||
LINKLIBS on $(1) = $(libs) [ TargetBootLibgcc true ] ;
|
||||
Depends $(1) : [ TargetBootLibgcc ] ;
|
||||
|
||||
# TODO: Do we really want to invoke SetupBoot here? The objects should
|
||||
# have been compiled with BootObjects anyway, so we're doing that twice.
|
||||
@@ -93,13 +164,13 @@ rule BootMergeObject
|
||||
# <sources>: Sources to be compiled. Grist will be added.
|
||||
# <extra CFLAGS>: Additional flags for compilation.
|
||||
# <other objects>: Object files or static libraries to be merged. No grist
|
||||
# will be added.
|
||||
# will be added.
|
||||
#
|
||||
|
||||
SetupBoot $(2) : $(3) ;
|
||||
Objects $(2) ;
|
||||
MergeObjectFromObjects $(1) : $(2:S=$(SUFOBJ)) : $(4) ;
|
||||
LINKFLAGS on $(1) += $(TARGET_BOOT_LINKFLAGS) ;
|
||||
LINKFLAGS on $(1) += $(HAIKU_BOOT_$(TARGET_BOOT_PLATFORM:U)_LDFLAGS) ;
|
||||
}
|
||||
|
||||
rule BootStaticLibrary
|
||||
|
||||
@@ -656,7 +656,7 @@ for var in $(archDependentBuildVars)_$(TARGET_PACKAGING_ARCHS) {
|
||||
TARGET_BOOT_LIBGCC = $(HAIKU_BOOT_LIBGCC_$(TARGET_PACKAGING_ARCH)) ;
|
||||
TARGET_BOOT_LIBSUPC++ = $(HAIKU_BOOT_LIBSUPC++_$(TARGET_PACKAGING_ARCH)) ;
|
||||
|
||||
TARGET_BOOT_PLATFORM ?= $(HAIKU_BOOT_PLATFORM) ;
|
||||
TARGET_KERNEL_PLATFORM ?= $(HAIKU_KERNEL_PLATFORM) ;
|
||||
|
||||
local architecture ;
|
||||
for architecture in $(TARGET_PACKAGING_ARCHS) {
|
||||
|
||||
+26
-6
@@ -1492,12 +1492,12 @@ rule BuildFloppyBootImage image : haikuLoader : archive
|
||||
FLOPPY_IMAGE_SIZE on $(image) = $(HAIKU_BOOT_FLOPPY_IMAGE_SIZE) ;
|
||||
ARCHIVE_IMAGE_OFFSET on $(image) = $(HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET) ;
|
||||
BuildFloppyBootImage1 $(image) : $(haikuLoader) $(archive) ;
|
||||
if $(HAIKU_BOOT_PLATFORM) = atari_m68k {
|
||||
if $(HAIKU_KERNEL_PLATFORM) = atari_m68k {
|
||||
Depends $(image) : <build>fixup_tos_boot_checksum ;
|
||||
BuildFloppyBootImageFixupM68K $(image)
|
||||
: <build>fixup_tos_boot_checksum ;
|
||||
}
|
||||
if $(HAIKU_BOOT_PLATFORM) = amiga_m68k {
|
||||
if $(HAIKU_KERNEL_PLATFORM) = amiga_m68k {
|
||||
Depends $(image) : <build>fixup_amiga_boot_checksum ;
|
||||
BuildFloppyBootImageFixupM68K $(image)
|
||||
: <build>fixup_amiga_boot_checksum ;
|
||||
@@ -1544,20 +1544,21 @@ actions BuildFloppyBootImageFixupM68K
|
||||
|
||||
#pragma mark - CD Boot Image rules
|
||||
|
||||
rule BuildCDBootImage image : bootfloppy : extrafiles
|
||||
rule BuildCDBootImage image : bootfloppy : bootefi : extrafiles
|
||||
{
|
||||
Depends $(image) : $(bootfloppy) ;
|
||||
Depends $(image) : $(bootefi) ;
|
||||
Depends $(image) : $(extrafiles) ;
|
||||
BOOTIMG on $(image) = $(bootfloppy) ;
|
||||
BOOTEFI on $(image) = $(bootefi) ;
|
||||
|
||||
BuildCDBootImage1 $(image) : $(bootfloppy) $(extrafiles) ;
|
||||
BuildCDBootImage1 $(image) : $(bootfloppy) $(bootefi) $(extrafiles) ;
|
||||
}
|
||||
|
||||
actions BuildCDBootImage1
|
||||
{
|
||||
$(RM) $(<)
|
||||
mkisofs -b $(BOOTIMG) -r -J -V bootimg -o $(<) $(>[1]) $(>[2-]) \
|
||||
|| genisoimage -b $(BOOTIMG) -r -J -V bootimg -o $(<) $(>[1]) $(>[2-])
|
||||
mkisofs -b $(BOOTIMG) -eltorito-alt-boot -no-emul-boot -e $(BOOTEFI) -r -J -V bootimg -o $(<) $(>[1]) $(>[2]) $(>[3-])
|
||||
}
|
||||
|
||||
|
||||
@@ -1600,3 +1601,22 @@ actions BuildCDBootPPCImage1 bind MAPS
|
||||
boot/haikuloader.xcf -r -o $(<) $(HAIKU_OUTPUT_DIR)/cd
|
||||
$(RM) -r $(HAIKU_OUTPUT_DIR)/cd
|
||||
}
|
||||
|
||||
#pragma mark - EFI System Partition rules
|
||||
|
||||
rule BuildEfiSystemPartition image : efiLoader
|
||||
{
|
||||
Depends $(image) : $(efiLoader) ;
|
||||
|
||||
BuildEfiSystemPartition1 $(image) : $(efiLoader) ;
|
||||
}
|
||||
|
||||
actions BuildEfiSystemPartition1
|
||||
{
|
||||
$(RM) $(<)
|
||||
dd if=/dev/zero of=$(<) bs=1024 count=2880
|
||||
mformat -i $(<) -n 36 -h 2 -t 80
|
||||
mmd -D s -i $(<) ::/EFI
|
||||
mmd -D s -i $(<) ::/EFI/BOOT
|
||||
mcopy -D o -i $(<) $(>) ::/EFI/BOOT/BOOTX64.EFI
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
HAIKU_BOARD_DESCRIPTION = "ACube Sam460ex" ;
|
||||
|
||||
# must force both since they are set before this file is read.
|
||||
HAIKU_BOOT_PLATFORM = u-boot ;
|
||||
HAIKU_KERNEL_PLATFORM = u-boot ;
|
||||
|
||||
#FIXME!!!!!!!!!!!!!!!
|
||||
#
|
||||
|
||||
@@ -19,13 +19,41 @@ actions BuildAnybootImage1 {
|
||||
$(2[1]) -b $(2[2]) $(2[3]) $(2[4]) $(1)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
local baseMBR = base_mbr.bin ;
|
||||
local mbrSource = [ FDirName $(HAIKU_TOP) src bin writembr mbr.S ] ;
|
||||
BuildMBR $(baseMBR) : $(mbrSource) ;
|
||||
MakeLocate $(baseMBR) : $(HAIKU_OUTPUT_DIR) ;
|
||||
MakeLocate $(HAIKU_ANYBOOT) : $(HAIKU_ANYBOOT_DIR) ;
|
||||
BuildAnybootImage $(HAIKU_ANYBOOT) : $(baseMBR) : $(HAIKU_CD_BOOT_IMAGE)
|
||||
: $(HAIKU_IMAGE_NAME) ;
|
||||
|
||||
if $(HAIKU_ANYBOOT_UEFI) = 1 {
|
||||
Echo "Anyboot is MBR/UEFI hybrid" ;
|
||||
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 {
|
||||
Echo "Anyboot is MBR only" ;
|
||||
BuildAnybootImage $(HAIKU_ANYBOOT) : $(baseMBR) : $(HAIKU_CD_BOOT_IMAGE)
|
||||
: $(HAIKU_IMAGE_NAME) ;
|
||||
}
|
||||
|
||||
# TODO: this one seems to cause the build to fail each other run (caching?)
|
||||
#RmTemps $(HAIKU_ANYBOOT) : $(baseMBR) ;
|
||||
|
||||
@@ -28,9 +28,14 @@ if $(TARGET_ARCH) = ppc {
|
||||
|
||||
BuildCDBootPPCImage $(HAIKU_CD_BOOT_IMAGE) : $(hfsmaps) : $(elfloader) : $(coffloader) : $(chrpscript) : $(extras) ;
|
||||
} else {
|
||||
SEARCH on $(extras) = [ FDirName $(HAIKU_TOP) data boot_cd ] ;
|
||||
local efiLoader = haiku_loader.efi ;
|
||||
local efiPartition = esp.image ;
|
||||
MakeLocate $(efiPartition) : $(HAIKU_OUTPUT_DIR) ;
|
||||
BuildEfiSystemPartition $(efiPartition) : $(efiLoader) ;
|
||||
|
||||
BuildCDBootImage $(HAIKU_CD_BOOT_IMAGE) : $(HAIKU_BOOT_FLOPPY) : $(extras) ;
|
||||
BuildCDBootImage $(HAIKU_CD_BOOT_IMAGE) : $(HAIKU_BOOT_FLOPPY) : $(efiPartition) : $(extras) ;
|
||||
|
||||
SEARCH on $(extras) = [ FDirName $(HAIKU_TOP) data boot_cd ] ;
|
||||
}
|
||||
|
||||
NotFile haiku-boot-cd ;
|
||||
|
||||
@@ -169,7 +169,7 @@ Depends haiku-floppyboot-archive : $(HAIKU_FLOPPY_BOOT_ARCHIVE) ;
|
||||
HAIKU_BOOT_FLOPPY = haiku-boot-floppy.image ;
|
||||
MakeLocate $(HAIKU_BOOT_FLOPPY) : $(HAIKU_OUTPUT_DIR) ;
|
||||
|
||||
BuildFloppyBootImage $(HAIKU_BOOT_FLOPPY) : haiku_loader
|
||||
BuildFloppyBootImage $(HAIKU_BOOT_FLOPPY) : haiku_loader.$(HAIKU_KERNEL_PLATFORM)
|
||||
: $(HAIKU_FLOPPY_BOOT_ARCHIVE) ;
|
||||
|
||||
# remove the archive
|
||||
|
||||
@@ -3,7 +3,7 @@ HaikuPackage $(haikuLoaderPackage) ;
|
||||
|
||||
|
||||
# boot loader
|
||||
AddFilesToPackage : haiku_loader ;
|
||||
AddFilesToPackage : haiku_loader.$(HAIKU_KERNEL_PLATFORM) ;
|
||||
|
||||
|
||||
# Force no compression, so the stage one loader can directly execute the boot
|
||||
|
||||
Reference in New Issue
Block a user