1# This file defines what ends up in the floppy boot image and it executes the 2# rules building the image. 3 4 5#HACK: remove when old ide code is removed! 6 7local NET_BOOT = 0 ; 8local USB_BOOT = 1 ; 9 10local USB_ONLY = ; 11if $(USB_BOOT) = 1 { 12 USB_ONLY = "" ; 13} 14 15local BOOT_ADD_ONS_NET ; 16if $(NET_BOOT) = 1 { 17 BOOT_ADD_ONS_NET = 18 remote_disk 19 $(SYSTEM_ADD_ONS_DRIVERS_NET) 20 stack socket 21 $(SYSTEM_NETWORK_DEVICES) 22 $(SYSTEM_NETWORK_DATALINK_PROTOCOLS) 23 $(SYSTEM_NETWORK_PPP) 24 $(SYSTEM_NETWORK_PROTOCOLS) 25 ; 26} 27 28SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures 29 acpi@x86,x86_64 ata dpc pci 30 isa@x86,x86_64 <pci>x86@x86,x86_64 scsi $(USB_ONLY)usb fdt@arm 31] ; 32SYSTEM_ADD_ONS_FILE_SYSTEMS = 33 attribute_overlay@!m68k bfs iso9660@!m68k packagefs write_overlay@!m68k 34 ; 35 36# modules 37AddFilesToFloppyBootArchive system add-ons kernel bus_managers 38 : $(SYSTEM_ADD_ONS_BUS_MANAGERS) ; 39 40AddFilesToFloppyBootArchive system add-ons kernel busses ata 41 : generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata 42 it8211 ; 43 44AddFilesToFloppyBootArchive system add-ons kernel busses scsi 45 : ahci ; 46AddFilesToFloppyBootArchive system add-ons kernel console : vga_text ; 47AddFilesToFloppyBootArchive system add-ons kernel file_systems 48 : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ; 49AddFilesToFloppyBootArchive system add-ons kernel generic 50 : ata_adapter locked_pool scsi_periph ; 51AddFilesToFloppyBootArchive system add-ons kernel partitioning_systems 52 : intel session ; 53AddFilesToFloppyBootArchive system add-ons kernel interrupt_controllers 54 : openpic@ppc ; 55 56if $(USB_BOOT) = 1 { 57 AddFilesToFloppyBootArchive system add-ons kernel busses usb 58 : <usb>uhci <usb>ohci <usb>ehci ; 59} 60 61if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 { 62 AddFilesToFloppyBootArchive system add-ons kernel cpu : generic_x86 ; 63} 64 65# drivers 66AddNewDriversToFloppyBootArchive disk scsi : scsi_cd scsi_disk ; 67AddNewDriversToFloppyBootArchive disk : norflash@arm ; 68if $(USB_BOOT) = 1 { 69 AddDriversToFloppyBootArchive disk usb : usb_disk ; 70} 71if $(NET_BOOT) = 1 { 72 AddDriversToFloppyBootArchive disk virtual : remote_disk ; 73 AddDriversToFloppyBootArchive net : $(SYSTEM_ADD_ONS_DRIVERS_NET) ; 74} 75 76# kernel 77AddFilesToFloppyBootArchive system 78 : <revisioned>kernel_$(TARGET_ARCH) ; 79 80# scripts and data files 81 82local driverSettingsFiles = <driver-settings>kernel ; 83SEARCH on $(driverSettingsFiles) 84 = [ FDirName $(HAIKU_TOP) data settings kernel drivers ] ; 85AddFilesToFloppyBootArchive home config settings kernel drivers 86 : $(driverSettingsFiles) ; 87 88if $(NET_BOOT) = 1 { 89 # add-ons 90 AddFilesToFloppyBootArchive system add-ons kernel network 91 : stack socket ; 92 AddFilesToFloppyBootArchive 93 system add-ons kernel network devices 94 : $(SYSTEM_NETWORK_DEVICES) ; 95 AddFilesToFloppyBootArchive 96 system add-ons kernel network datalink_protocols 97 : $(SYSTEM_NETWORK_DATALINK_PROTOCOLS) ; 98 AddFilesToFloppyBootArchive 99 system add-ons kernel network ppp 100 : $(SYSTEM_NETWORK_PPP) ; 101 AddFilesToFloppyBootArchive 102 system add-ons kernel network protocols 103 : $(SYSTEM_NETWORK_PROTOCOLS) ; 104} 105 106# boot module links 107AddBootModuleSymlinksToFloppyBootArchive [ FFilterByBuildFeatures 108 $(SYSTEM_ADD_ONS_BUS_MANAGERS) 109 openpic@ppc 110 ata_adapter locked_pool scsi_periph 111 generic_x86@x86 112 ahci generic_ide_pci ide_isa@x86 silicon_image_3112 legacy_sata 113 it8211 114 $(USB_ONLY)<usb>uhci $(USB_ONLY)<usb>ohci $(USB_ONLY)<usb>ehci 115 scsi_cd scsi_disk $(USB_ONLY)usb_disk norflash@arm 116 intel session 117 $(SYSTEM_ADD_ONS_FILE_SYSTEMS) 118 $(BOOT_ADD_ONS_NET) 119] ; 120 121 122#pragma mark - Build The Archive 123 124# archive target 125HAIKU_FLOPPY_BOOT_ARCHIVE = haiku-floppyboot.tgz ; 126MakeLocate $(HAIKU_FLOPPY_BOOT_ARCHIVE) : $(HAIKU_OUTPUT_DIR) ; 127 128# the pseudo target all archive contents is attached to 129NotFile $(HAIKU_BOOT_FLOPPY_CONTAINER_NAME) ; 130 131# prepare the script that initializes the shell variables 132local initVarsScript = <FloppyBootArchive>haiku-floppyboot-init-vars ; 133local script = $(initVarsScript) ; 134MakeLocate $(script) : $(HAIKU_OUTPUT_DIR) ; 135Always $(script) ; 136 137AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ; 138AddVariableToScript $(script) : addBuildCompatibilityLibDir 139 : "export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)" ; 140AddTargetVariableToScript $(script) : <build>copyattr ; 141 142# create the other scripts 143local makeDirsScript = <FloppyBootArchive>haiku-floppyboot-make-dirs ; 144local copyFilesScript = <FloppyBootArchive>haiku-floppyboot-copy-files ; 145MakeLocate $(makeDirsScript) $(copyFilesScript) : $(HAIKU_OUTPUT_DIR) ; 146 147CreateFloppyBootArchiveMakeDirectoriesScript $(makeDirsScript) ; 148CreateFloppyBootArchiveCopyFilesScript $(copyFilesScript) ; 149 150# build the archive 151 152BuildFloppyBootArchive $(HAIKU_FLOPPY_BOOT_ARCHIVE) : 153 $(initVarsScript) 154 $(makeDirsScript) 155 $(copyFilesScript) 156; 157 158# remove the scripts we have generated 159RmTemps $(HAIKU_FLOPPY_BOOT_ARCHIVE) : 160 $(initVarsScript) 161 $(makeDirsScript) 162 $(copyFilesScript) 163; 164 165NotFile haiku-floppyboot-archive ; 166Depends haiku-floppyboot-archive : $(HAIKU_FLOPPY_BOOT_ARCHIVE) ; 167 168# floppy image target 169HAIKU_BOOT_FLOPPY = haiku-boot-floppy.image ; 170MakeLocate $(HAIKU_BOOT_FLOPPY) : $(HAIKU_OUTPUT_DIR) ; 171 172BuildFloppyBootImage $(HAIKU_BOOT_FLOPPY) : haiku_loader.$(HAIKU_KERNEL_PLATFORM) 173 : $(HAIKU_FLOPPY_BOOT_ARCHIVE) ; 174 175# remove the archive 176RmTemps $(HAIKU_BOOT_FLOPPY) : $(HAIKU_FLOPPY_BOOT_ARCHIVE) ; 177 178NotFile haiku-boot-floppy ; 179Depends haiku-boot-floppy : $(HAIKU_BOOT_FLOPPY) ; 180