2008-03-02 06:05:23 +03:00
|
|
|
# This file defines what ends up in the floppy boot image and it executes the
|
|
|
|
# rules building the image.
|
|
|
|
|
|
|
|
local X86_ONLY = ;
|
|
|
|
local PPC_ONLY = ;
|
|
|
|
if $(TARGET_ARCH) = x86 {
|
|
|
|
X86_ONLY = "" ;
|
|
|
|
} else if $(TARGET_ARCH) = ppc {
|
|
|
|
X86_ONLY = ;
|
2009-04-28 00:00:28 +04:00
|
|
|
} else if $(TARGET_ARCH) = m68k {
|
|
|
|
X86_ONLY = ;
|
2008-03-02 06:05:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
local GPL_ONLY = ;
|
|
|
|
if $(INCLUDE_GPL_ADDONS) = 1 {
|
|
|
|
GPL_ONLY = "" ;
|
|
|
|
}
|
|
|
|
|
2009-05-02 14:20:29 +04:00
|
|
|
#HACK: remove when old ide code is removed!
|
|
|
|
local ATA_ONLY = ;
|
|
|
|
local IDE_ONLY = ;
|
|
|
|
if $(HAIKU_ATA_STACK) = 1 {
|
|
|
|
ATA_ONLY = "" ;
|
|
|
|
} else {
|
|
|
|
IDE_ONLY = "" ;
|
|
|
|
}
|
|
|
|
|
2008-03-02 06:23:51 +03:00
|
|
|
local NET_BOOT = 0 ;
|
2009-08-12 18:47:46 +04:00
|
|
|
local USB_BOOT = 1 ;
|
|
|
|
|
|
|
|
local USB_ONLY = ;
|
|
|
|
if $(USB_BOOT) = 1 {
|
|
|
|
USB_ONLY = "" ;
|
|
|
|
}
|
2008-03-02 06:23:51 +03:00
|
|
|
|
|
|
|
local BOOT_ADD_ONS_NET ;
|
|
|
|
if $(NET_BOOT) = 1 {
|
2009-08-12 18:47:46 +04:00
|
|
|
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)
|
|
|
|
;
|
2008-03-02 06:23:51 +03:00
|
|
|
}
|
|
|
|
|
2009-08-12 18:47:46 +04:00
|
|
|
SYSTEM_ADD_ONS_BUS_MANAGERS = $(ATA_ONLY)ata config_manager pci
|
|
|
|
$(IDE_ONLY)ide $(X86_ONLY)isa scsi $(USB_ONLY)usb
|
2008-03-02 06:05:23 +03:00
|
|
|
;
|
2009-04-03 13:42:58 +04:00
|
|
|
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ;
|
2008-03-02 06:05:23 +03:00
|
|
|
|
|
|
|
|
|
|
|
# modules
|
2009-04-03 13:42:58 +04:00
|
|
|
AddFilesToFloppyBootArchive system add-ons kernel bus_managers
|
|
|
|
: $(SYSTEM_ADD_ONS_BUS_MANAGERS) ;
|
|
|
|
AddFilesToFloppyBootArchive system add-ons kernel busses ide
|
2008-11-14 23:34:52 +03:00
|
|
|
: generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata it8211 ;
|
2009-04-03 13:42:58 +04:00
|
|
|
AddFilesToFloppyBootArchive system add-ons kernel busses scsi
|
2008-11-14 23:34:52 +03:00
|
|
|
: ahci ;
|
2009-04-03 13:42:58 +04:00
|
|
|
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
|
2009-05-02 14:20:29 +04:00
|
|
|
: $(ATA_ONLY)ata_adapter $(IDE_ONLY)ide_adapter locked_pool scsi_periph ;
|
2009-04-03 13:42:58 +04:00
|
|
|
AddFilesToFloppyBootArchive system add-ons kernel partitioning_systems
|
2008-03-02 06:05:23 +03:00
|
|
|
: intel session ;
|
2009-04-03 13:42:58 +04:00
|
|
|
AddFilesToFloppyBootArchive system add-ons kernel interrupt_controllers
|
2008-03-02 06:05:23 +03:00
|
|
|
: $(PPC_ONLY)openpic ;
|
2009-08-12 18:47:46 +04:00
|
|
|
|
|
|
|
if $(USB_BOOT) = 1 {
|
|
|
|
AddFilesToFloppyBootArchive system add-ons kernel busses usb
|
|
|
|
: <usb>uhci <usb>ohci <usb>ehci ;
|
|
|
|
}
|
2008-03-02 06:05:23 +03:00
|
|
|
|
|
|
|
if $(TARGET_ARCH) = x86 {
|
2009-04-03 13:42:58 +04:00
|
|
|
AddFilesToFloppyBootArchive system add-ons kernel cpu : generic_x86 ;
|
2008-03-02 06:05:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# drivers
|
2009-08-12 18:47:46 +04:00
|
|
|
AddNewDriversToFloppyBootArchive disk scsi : scsi_cd scsi_disk ;
|
|
|
|
if $(USB_BOOT) = 1 {
|
|
|
|
AddDriversToFloppyBootArchive disk usb : usb_disk ;
|
|
|
|
}
|
2008-03-02 06:23:51 +03:00
|
|
|
if $(NET_BOOT) = 1 {
|
2009-08-12 18:47:46 +04:00
|
|
|
AddDriversToFloppyBootArchive disk virtual : remote_disk ;
|
|
|
|
AddDriversToFloppyBootArchive net : $(SYSTEM_ADD_ONS_DRIVERS_NET) ;
|
2008-03-02 06:23:51 +03:00
|
|
|
}
|
2008-03-02 06:05:23 +03:00
|
|
|
|
|
|
|
# kernel
|
2009-04-03 13:42:58 +04:00
|
|
|
AddFilesToFloppyBootArchive system : <revisioned>kernel_$(TARGET_ARCH) ;
|
2008-03-02 06:05:23 +03:00
|
|
|
|
|
|
|
# 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) ;
|
|
|
|
|
2008-03-02 06:23:51 +03:00
|
|
|
if $(NET_BOOT) = 1 {
|
2009-08-12 18:47:46 +04:00
|
|
|
# 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) ;
|
2008-03-02 06:23:51 +03:00
|
|
|
}
|
2008-03-02 06:05:23 +03:00
|
|
|
|
|
|
|
# boot module links
|
|
|
|
AddBootModuleSymlinksToFloppyBootArchive
|
2009-04-03 13:42:58 +04:00
|
|
|
$(SYSTEM_ADD_ONS_BUS_MANAGERS)
|
2008-03-02 06:05:23 +03:00
|
|
|
$(PPC_ONLY)openpic
|
2009-05-02 14:20:29 +04:00
|
|
|
$(ATA_ONLY)ata_adapter $(IDE_ONLY)ide_adapter locked_pool scsi_periph
|
2008-03-02 06:05:23 +03:00
|
|
|
$(X86_ONLY)generic_x86
|
2009-05-02 14:20:29 +04:00
|
|
|
ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata
|
|
|
|
it8211
|
2009-08-12 18:47:46 +04:00
|
|
|
$(USB_ONLY)<usb>uhci $(USB_ONLY)<usb>ohci $(USB_ONLY)<usb>ehci
|
|
|
|
scsi_cd scsi_disk $(USB_ONLY)usb_disk
|
2008-03-04 04:05:50 +03:00
|
|
|
intel session
|
2009-04-03 13:42:58 +04:00
|
|
|
$(SYSTEM_ADD_ONS_FILE_SYSTEMS)
|
2008-03-02 06:23:51 +03:00
|
|
|
$(BOOT_ADD_ONS_NET)
|
2008-03-02 06:05:23 +03:00
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
: $(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) ;
|
|
|
|
|
2009-04-03 13:42:58 +04:00
|
|
|
BuildFloppyBootImage $(HAIKU_BOOT_FLOPPY) : haiku_loader
|
|
|
|
: $(HAIKU_FLOPPY_BOOT_ARCHIVE) ;
|
2008-03-02 06:05:23 +03:00
|
|
|
|
2009-02-15 16:30:42 +03:00
|
|
|
# remove the archive
|
|
|
|
RmTemps $(HAIKU_BOOT_FLOPPY) : $(HAIKU_FLOPPY_BOOT_ARCHIVE) ;
|
|
|
|
|
2008-03-02 06:05:23 +03:00
|
|
|
NotFile haiku-boot-floppy ;
|
|
|
|
Depends haiku-boot-floppy : $(HAIKU_BOOT_FLOPPY) ;
|
|
|
|
|
|
|
|
|