[haiku-commits] Change in haiku[master]: Fix build for non-EFI architectures.

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 13 Mar 2020 18:36:34 +0000

From Adrien Destugues <pulkomandy@xxxxxxxxx>:

Adrien Destugues has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2343 ;)


Change subject: Fix build for non-EFI architectures.
......................................................................

Fix build for non-EFI architectures.
---
M build/jam/images/AnybootImage
M build/jam/images/CDBootImage
2 files changed, 41 insertions(+), 23 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/43/2343/1

diff --git a/build/jam/images/AnybootImage b/build/jam/images/AnybootImage
index 6994bcb..e3d1e66 100644
--- a/build/jam/images/AnybootImage
+++ b/build/jam/images/AnybootImage
@@ -41,16 +41,25 @@
 MakeLocate $(baseMBR) : $(HAIKU_OUTPUT_DIR) ;
 MakeLocate $(HAIKU_ANYBOOT) : $(HAIKU_ANYBOOT_DIR) ;

-if $(HAIKU_ANYBOOT_LEGACY) = 1 {
-       BuildAnybootImage $(HAIKU_ANYBOOT) : $(baseMBR) : $(HAIKU_CD_BOOT_IMAGE)
-               : $(HAIKU_IMAGE_NAME) ;
-} else {
-       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) ;
+# 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) ;
+               }
+       }
 }

 # TODO: this one seems to cause the build to fail each other run (caching?)
diff --git a/build/jam/images/CDBootImage b/build/jam/images/CDBootImage
index c956f32..0823bcd 100644
--- a/build/jam/images/CDBootImage
+++ b/build/jam/images/CDBootImage
@@ -13,6 +13,7 @@

 # common extra files to put on the boot iso
 local extras = README.html ;
+SEARCH on $(extras) = [ FDirName $(HAIKU_TOP) data boot_cd ] ;

 if $(TARGET_ARCH) = ppc {
        local elfloader = boot_loader_openfirmware ;
@@ -24,23 +25,31 @@
        # HFS creator and application type mapping for mkisofs
        local hfsmaps = hfs.map ;

-       SEARCH on $(chrpscript) $(hfsmaps) $(extras) = [ FDirName $(HAIKU_TOP) 
data boot_cd ] ;
+       SEARCH on $(chrpscript) $(hfsmaps) $(extras)
+               = [ FDirName $(HAIKU_TOP) data boot_cd ] ;

-       BuildCDBootPPCImage $(HAIKU_CD_BOOT_IMAGE) : $(hfsmaps) : $(elfloader) 
: $(coffloader) : $(chrpscript) : $(extras) ;
-} else if $(HAIKU_ANYBOOT_LEGACY) = 1 {
-       BuildCDBootImage $(HAIKU_CD_BOOT_IMAGE) : $(HAIKU_BOOT_FLOPPY) : : 
$(extras) ;
-
-       SEARCH on $(extras) = [ FDirName $(HAIKU_TOP) data boot_cd ] ;
+       BuildCDBootPPCImage $(HAIKU_CD_BOOT_IMAGE) : $(hfsmaps)
+               : $(elfloader) : $(coffloader) : $(chrpscript) : $(extras) ;
 } else {
-       local efiLoader = haiku_loader.efi ;
-       local efiPartition = esp.image ;
-       MakeLocate $(efiPartition) : $(HAIKU_OUTPUT_DIR) ;
-       BuildEfiSystemPartition $(efiPartition) : $(efiLoader) ;
+       # For other platforms, we have to check which bootloader is used. There
+       # can be multiple ones, making this a bit confusing.
+       for platform in [ MultiBootSubDirSetup ] {
+               on $(platform) {
+                       if $(TARGET_BOOT_PLATFORM) = efi {
+                               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)
-               : $(efiPartition) : $(extras) ;
+                               BuildCDBootImage $(HAIKU_CD_BOOT_IMAGE) : 
$(HAIKU_BOOT_FLOPPY)
+                                       : $(efiPartition) : $(extras) ;

-       SEARCH on $(extras) = [ FDirName $(HAIKU_TOP) data boot_cd ] ;
+                       } else if $(HAIKU_ANYBOOT_LEGACY) = 1 {
+                               BuildCDBootImage $(HAIKU_CD_BOOT_IMAGE) : 
$(HAIKU_BOOT_FLOPPY) :
+                                       : $(extras) ;
+                       }
+               }
+       }
 }

 NotFile haiku-boot-cd ;

--
To view, visit https://review.haiku-os.org/c/haiku/+/2343
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: Ic2c8a9a64e63f4b844e964eb1066291d2edda7b3
Gerrit-Change-Number: 2343
Gerrit-PatchSet: 1
Gerrit-Owner: Adrien Destugues <pulkomandy@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: Fix build for non-EFI architectures. - Gerrit