Add rules to create a boot floppy (use jam haiku-boot-floppy), in preparation for CD booting.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24198 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2008-03-02 03:05:23 +00:00
parent 47b63fed56
commit 22ec1df3f0
4 changed files with 265 additions and 0 deletions

View File

@ -151,6 +151,7 @@ SubDir HAIKU_TOP ;
# specify the Haiku image and network boot archive contents
include [ FDirName $(HAIKU_BUILD_RULES_DIR) HaikuImage ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) NetBootArchive ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) FloppyBootImage ] ;
# Perform deferred SubIncludes.
ExecuteDeferredSubIncludes ;

View File

@ -29,6 +29,15 @@ HAIKU_CONTAINER_GRIST on $(HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME)
HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME)
= HAIKU_NET_BOOT_ARCHIVE_INSTALL_TARGETS ;
# boot floppy
HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME = haiku-boot-floppy-container ;
HAIKU_CONTAINER_GRIST on $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) = FloppyBootImage ;
# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
= HAIKU_FLOPPY_BOOT_IMAGE_INSTALL_TARGETS ;
# boot CD image
#TODO
# analyze an optionally replace jam's target parameters
HAIKU_ORIGINAL_JAM_TARGETS = $(JAM_TARGETS) ;

149
build/jam/FloppyBootImage Normal file
View File

@ -0,0 +1,149 @@
# 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 = ;
}
local GPL_ONLY = ;
if $(INCLUDE_GPL_ADDONS) = 1 {
GPL_ONLY = "" ;
}
BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)isa ide scsi
config_manager agp_gart
;
BEOS_ADD_ONS_FILE_SYSTEMS = bfs ;
#cdda fat googlefs iso9660 nfs ;
# modules
AddFilesToFloppyBootArchive beos system add-ons kernel bus_managers
: $(BEOS_ADD_ONS_BUS_MANAGERS) ;
AddFilesToFloppyBootArchive beos system add-ons kernel busses agp_gart
: $(X86_ONLY)<agp_gart>intel ;
AddFilesToFloppyBootArchive beos system add-ons kernel busses ide
: ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 ;
AddFilesToFloppyBootArchive beos system add-ons kernel console : vga_text ;
AddFilesToFloppyBootArchive beos system add-ons kernel file_systems
: $(BEOS_ADD_ONS_FILE_SYSTEMS) ;
AddFilesToFloppyBootArchive beos system add-ons kernel generic
: block_io fast_log ide_adapter locked_pool scsi_periph ;
AddFilesToFloppyBootArchive beos system add-ons kernel partitioning_systems
: intel session ;
AddFilesToFloppyBootArchive beos system add-ons kernel interrupt_controllers
: $(PPC_ONLY)openpic ;
if $(TARGET_ARCH) = x86 {
AddFilesToFloppyBootArchive beos system add-ons kernel cpu : generic_x86 ;
}
# drivers
AddDriversToFloppyBootArchive disk scsi : scsi_cd scsi_dsk ;
#AddDriversToFloppyBootArchive disk virtual : nbd ;
AddDriversToFloppyBootArchive disk virtual : remote_disk ;
AddDriversToFloppyBootArchive net : $(BEOS_ADD_ONS_DRIVERS_NET) ;
# kernel
AddFilesToFloppyBootArchive beos 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) ;
# add-ons
AddFilesToFloppyBootArchive beos system add-ons kernel network
: stack socket ;
AddFilesToFloppyBootArchive beos system add-ons kernel network devices
: $(BEOS_NETWORK_DEVICES) ;
AddFilesToFloppyBootArchive beos system add-ons kernel network datalink_protocols
: $(BEOS_NETWORK_DATALINK_PROTOCOLS) ;
AddFilesToFloppyBootArchive beos system add-ons kernel network ppp
: $(BEOS_NETWORK_PPP) ;
AddFilesToFloppyBootArchive beos system add-ons kernel network protocols
: $(BEOS_NETWORK_PROTOCOLS) ;
# boot module links
AddBootModuleSymlinksToFloppyBootArchive
$(BEOS_ADD_ONS_BUS_MANAGERS)
ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112
$(BEOS_ADD_ONS_FILE_SYSTEMS)
block_io fast_log ide_adapter locked_pool scsi_periph
intel session
$(PPC_ONLY)openpic
$(X86_ONLY)generic_x86
# nbd
remote_disk
$(BEOS_ADD_ONS_DRIVERS_NET)
stack socket
$(BEOS_NETWORK_DEVICES)
$(BEOS_NETWORK_DATALINK_PROTOCOLS)
$(BEOS_NETWORK_PPP)
$(BEOS_NETWORK_PROTOCOLS)
;
#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) ;
BuildFloppyBootImage $(HAIKU_BOOT_FLOPPY) : zbeos : $(HAIKU_FLOPPY_BOOT_ARCHIVE) ;
NotFile haiku-boot-floppy ;
Depends haiku-boot-floppy : $(HAIKU_BOOT_FLOPPY) ;

View File

@ -763,3 +763,109 @@ actions BuildNetBootArchive1
{
$(2[1]) $(1) $(2[2-])
}
#pragma mark - Floppy Boot Archive rules
rule AddDirectoryToFloppyBootArchive directoryTokens
{
# AddDirectoryToFloppyBootArchive <directoryTokens>
return [ AddDirectoryToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
: $(directoryTokens) ] ;
}
rule AddFilesToFloppyBootArchive directory : targets : destName
{
# AddFilesToFloppyBootArchive <directory> : <targets> [ : dest name ]
AddFilesToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) : $(directory)
: $(targets) : $(destName) ;
}
rule AddSymlinkToFloppyBootArchive directoryTokens : linkTarget : linkName
{
# AddSymlinkToFloppyBootArchive <directory> : <link target> [ : <link name> ] ;
AddSymlinkToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
: $(directoryTokens) : $(linkTarget) : $(linkName) ;
}
rule AddDriversToFloppyBootArchive relativeDirectoryTokens : targets
{
# AddDriversToFloppyBootArchive <relative directory> : <targets> ;
AddDriversToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
: $(relativeDirectoryTokens) : $(targets) ;
}
rule AddDriverRegistrationToFloppyBootArchive relativeDirectoryTokens : target
: links
{
# AddDriverRegistrationToFloppyBootArchive <directory> : <link target>
# : <link names> ] ;
AddDriverRegistrationToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
: $(relativeDirectoryTokens) : $(target) : $(links) ;
}
rule AddBootModuleSymlinksToFloppyBootArchive targets
{
# AddBootModuleSymlinksToFloppyBootArchive <targets> ;
AddBootModuleSymlinksToContainer $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
: $(targets) ;
}
rule CreateFloppyBootArchiveMakeDirectoriesScript script
{
CreateContainerMakeDirectoriesScript
$(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) : $(script) ;
}
rule CreateFloppyBootArchiveCopyFilesScript script
{
CreateContainerCopyFilesScript $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
: $(script) ;
}
rule BuildFloppyBootArchive archive : scripts
{
# BuildHFloppyBootArchive <archive> : <scripts> ;
local mainScript = build_tgz_archive ;
SEARCH on $(mainScript) = [ FDirName $(HAIKU_TOP) build scripts ] ;
Depends $(archive) : $(mainScript) $(scripts) ;
BuildFloppyBootArchive1 $(archive) : $(mainScript) $(scripts) ;
}
actions BuildFloppyBootArchive1
{
$(2[1]) $(1) $(2[2-])
}
# warning: that is quite x86 dependant...
rule BuildFloppyBootImage image : zbeos : archive
{
Depends $(image) : $(zbeos) ;
Depends $(image) : $(archive) ;
#MakeLocateDebug $(image) ;
BuildFloppyBootImage1 $(image) : $(zbeos) $(archive) ;
}
actions BuildFloppyBootImage1
{
rm -f $(<)
# make an empty image
dd if=/dev/zero of=$(<) bs=1k count=1440
# add zbeos
dd if=$(>[1]) of=$(<) conv=notrunc
# add the boot drivers tgz archive
# keep the offset in sync with
# src/system/boot/loader/file_systems/tarfs/tarfs.cpp:kFloppyArchiveOffset
dd if=$(>[2]) of=$(<) bs=192k seek=1 conv=notrunc
}