haiku/build/jam/images/FloppyBootImage

180 lines
5.2 KiB
Plaintext
Raw Normal View History

# This file defines what ends up in the floppy boot image and it executes the
# rules building the image.
#HACK: remove when old ide code is removed!
local NET_BOOT = 0 ;
local USB_BOOT = 1 ;
local USB_ONLY = ;
if $(USB_BOOT) = 1 {
USB_ONLY = "" ;
}
local BOOT_ADD_ONS_NET ;
if $(NET_BOOT) = 1 {
BOOT_ADD_ONS_NET =
remote_disk
$(SYSTEM_ADD_ONS_DRIVERS_NET)
stack socket
$(SYSTEM_NETWORK_DEVICES)
$(SYSTEM_NETWORK_DATALINK_PROTOCOLS)
$(SYSTEM_NETWORK_PPP)
$(SYSTEM_NETWORK_PROTOCOLS)
;
}
SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
acpi@x86,x86_64 ata config_manager dpc pci
isa@x86,x86_64 scsi $(USB_ONLY)usb fdt@arm
] ;
2013-09-13 01:27:51 +04:00
SYSTEM_ADD_ONS_FILE_SYSTEMS =
attribute_overlay@!m68k bfs iso9660@!m68k packagefs write_overlay@!m68k
2013-09-13 01:27:51 +04:00
;
# modules
AddFilesToFloppyBootArchive system add-ons kernel bus_managers
: $(SYSTEM_ADD_ONS_BUS_MANAGERS) ;
AddFilesToFloppyBootArchive system add-ons kernel busses ata
: generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata
it8211 ;
AddFilesToFloppyBootArchive system add-ons kernel busses scsi
: ahci ;
AddFilesToFloppyBootArchive system add-ons kernel console : vga_text ;
AddFilesToFloppyBootArchive system add-ons kernel file_systems
: $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
AddFilesToFloppyBootArchive system add-ons kernel generic
: ata_adapter locked_pool scsi_periph ;
AddFilesToFloppyBootArchive system add-ons kernel partitioning_systems
: intel session ;
AddFilesToFloppyBootArchive system add-ons kernel interrupt_controllers
: openpic@ppc ;
if $(USB_BOOT) = 1 {
AddFilesToFloppyBootArchive system add-ons kernel busses usb
: <usb>uhci <usb>ohci <usb>ehci ;
}
if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
AddFilesToFloppyBootArchive system add-ons kernel cpu : generic_x86 ;
}
# drivers
AddNewDriversToFloppyBootArchive disk scsi : scsi_cd scsi_disk ;
AddNewDriversToFloppyBootArchive disk : norflash@arm ;
if $(USB_BOOT) = 1 {
AddDriversToFloppyBootArchive disk usb : usb_disk ;
}
if $(NET_BOOT) = 1 {
AddDriversToFloppyBootArchive disk virtual : remote_disk ;
AddDriversToFloppyBootArchive net : $(SYSTEM_ADD_ONS_DRIVERS_NET) ;
}
# kernel
AddFilesToFloppyBootArchive system
: <revisioned>kernel_$(TARGET_ARCH) ;
# scripts and data files
local driverSettingsFiles = <driver-settings>kernel ;
SEARCH on $(driverSettingsFiles)
= [ FDirName $(HAIKU_TOP) data settings kernel drivers ] ;
AddFilesToFloppyBootArchive home config settings kernel drivers
: $(driverSettingsFiles) ;
if $(NET_BOOT) = 1 {
# add-ons
AddFilesToFloppyBootArchive system add-ons kernel network
: stack socket ;
AddFilesToFloppyBootArchive
system add-ons kernel network devices
: $(SYSTEM_NETWORK_DEVICES) ;
AddFilesToFloppyBootArchive
system add-ons kernel network datalink_protocols
: $(SYSTEM_NETWORK_DATALINK_PROTOCOLS) ;
AddFilesToFloppyBootArchive
system add-ons kernel network ppp
: $(SYSTEM_NETWORK_PPP) ;
AddFilesToFloppyBootArchive
system add-ons kernel network protocols
: $(SYSTEM_NETWORK_PROTOCOLS) ;
}
# boot module links
AddBootModuleSymlinksToFloppyBootArchive [ FFilterByBuildFeatures
$(SYSTEM_ADD_ONS_BUS_MANAGERS)
openpic@ppc
ata_adapter locked_pool scsi_periph
generic_x86@x86
ahci generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata
it8211
$(USB_ONLY)<usb>uhci $(USB_ONLY)<usb>ohci $(USB_ONLY)<usb>ehci
scsi_cd scsi_disk $(USB_ONLY)usb_disk norflash@arm
intel session
$(SYSTEM_ADD_ONS_FILE_SYSTEMS)
$(BOOT_ADD_ONS_NET)
] ;
#pragma mark - Build The Archive
# archive target
HAIKU_FLOPPY_BOOT_ARCHIVE = haiku-floppyboot.tgz ;
MakeLocate $(HAIKU_FLOPPY_BOOT_ARCHIVE) : $(HAIKU_OUTPUT_DIR) ;
# the pseudo target all archive contents is attached to
NotFile $(HAIKU_BOOT_FLOPPY_CONTAINER_NAME) ;
# prepare the script that initializes the shell variables
local initVarsScript = <FloppyBootArchive>haiku-floppyboot-init-vars ;
local script = $(initVarsScript) ;
MakeLocate $(script) : $(HAIKU_OUTPUT_DIR) ;
Always $(script) ;
AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ;
AddVariableToScript $(script) : addBuildCompatibilityLibDir
: "export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)" ;
AddTargetVariableToScript $(script) : <build>copyattr ;
# create the other scripts
local makeDirsScript = <FloppyBootArchive>haiku-floppyboot-make-dirs ;
local copyFilesScript = <FloppyBootArchive>haiku-floppyboot-copy-files ;
MakeLocate $(makeDirsScript) $(copyFilesScript) : $(HAIKU_OUTPUT_DIR) ;
CreateFloppyBootArchiveMakeDirectoriesScript $(makeDirsScript) ;
CreateFloppyBootArchiveCopyFilesScript $(copyFilesScript) ;
# build the archive
BuildFloppyBootArchive $(HAIKU_FLOPPY_BOOT_ARCHIVE) :
$(initVarsScript)
$(makeDirsScript)
$(copyFilesScript)
;
# remove the scripts we have generated
RmTemps $(HAIKU_FLOPPY_BOOT_ARCHIVE) :
$(initVarsScript)
$(makeDirsScript)
$(copyFilesScript)
;
NotFile haiku-floppyboot-archive ;
Depends haiku-floppyboot-archive : $(HAIKU_FLOPPY_BOOT_ARCHIVE) ;
# floppy image target
HAIKU_BOOT_FLOPPY = haiku-boot-floppy.image ;
MakeLocate $(HAIKU_BOOT_FLOPPY) : $(HAIKU_OUTPUT_DIR) ;
BuildFloppyBootImage $(HAIKU_BOOT_FLOPPY) : haiku_loader.$(HAIKU_KERNEL_PLATFORM)
: $(HAIKU_FLOPPY_BOOT_ARCHIVE) ;
# remove the archive
RmTemps $(HAIKU_BOOT_FLOPPY) : $(HAIKU_FLOPPY_BOOT_ARCHIVE) ;
NotFile haiku-boot-floppy ;
Depends haiku-boot-floppy : $(HAIKU_BOOT_FLOPPY) ;