1# This file adds content common to all images, it needs to be included after 2# all the other definitions. 3 4# create directories that may remain empty 5AddDirectoryToHaikuImage home : home.rdef ; 6AddDirectoryToHaikuImage home Desktop : home-desktop.rdef ; 7AddDirectoryToHaikuImage home mail ; 8AddDirectoryToHaikuImage home config : home-config.rdef ; 9AddDirectoryToHaikuImage home config cache ; 10AddDirectoryToHaikuImage home config packages ; 11AddDirectoryToHaikuImage home config settings ; 12AddDirectoryToHaikuImage home config var ; 13AddDirectoryToHaikuImage home config non-packaged bin ; 14AddDirectoryToHaikuImage home config non-packaged data fonts ; 15AddDirectoryToHaikuImage home config non-packaged lib ; 16AddDirectoryToHaikuImage home config non-packaged add-ons control_look ; 17AddDirectoryToHaikuImage home config non-packaged add-ons decorators ; 18AddDirectoryToHaikuImage home config non-packaged add-ons opengl ; 19AddDirectoryToHaikuImage home config non-packaged add-ons kernel drivers bin ; 20AddDirectoryToHaikuImage home config non-packaged add-ons kernel drivers dev ; 21AddDirectoryToHaikuImage home config non-packaged add-ons input_server devices ; 22AddDirectoryToHaikuImage home config non-packaged add-ons input_server filters ; 23AddDirectoryToHaikuImage home config non-packaged add-ons input_server methods ; 24AddDirectoryToHaikuImage home config non-packaged add-ons media plugins ; 25AddDirectoryToHaikuImage home config non-packaged add-ons Tracker ; 26AddDirectoryToHaikuImage home config non-packaged add-ons Print ; 27AddDirectoryToHaikuImage home config non-packaged add-ons Screen\ Savers ; 28AddDirectoryToHaikuImage home config non-packaged add-ons Translators ; 29AddDirectoryToHaikuImage system : system.rdef ; 30AddDirectoryToHaikuImage system cache tmp ; 31AddDirectoryToHaikuImage system non-packaged bin ; 32AddDirectoryToHaikuImage system non-packaged data fonts ; 33AddDirectoryToHaikuImage system non-packaged lib ; 34AddDirectoryToHaikuImage system non-packaged add-ons control_look ; 35AddDirectoryToHaikuImage system non-packaged add-ons decorators ; 36AddDirectoryToHaikuImage system non-packaged add-ons opengl ; 37AddDirectoryToHaikuImage system non-packaged add-ons kernel drivers bin ; 38AddDirectoryToHaikuImage system non-packaged add-ons kernel drivers dev ; 39AddDirectoryToHaikuImage system non-packaged add-ons input_server devices ; 40AddDirectoryToHaikuImage system non-packaged add-ons input_server filters ; 41AddDirectoryToHaikuImage system non-packaged add-ons input_server methods ; 42AddDirectoryToHaikuImage system non-packaged add-ons media plugins ; 43AddDirectoryToHaikuImage system non-packaged add-ons Tracker ; 44AddDirectoryToHaikuImage system non-packaged add-ons Print ; 45AddDirectoryToHaikuImage system non-packaged add-ons Screen\ Savers ; 46AddDirectoryToHaikuImage system non-packaged add-ons Translators ; 47AddDirectoryToHaikuImage system var empty ; 48AddDirectoryToHaikuImage system var log ; 49AddDirectoryToHaikuImage trash : trash.rdef ; 50 51 52#pragma mark - Optional Packages 53 54 55include [ FDirName $(HAIKU_BUILD_RULES_DIR) OptionalPackages ] ; 56 57 58#pragma mark - User/Group Setup 59 60 61# add the root user and the root and users groups 62AddUserToHaikuImage $(HAIKU_ROOT_USER_NAME:E=baron) : 0 : 0 : /boot/home 63 : /bin/bash : $(HAIKU_ROOT_USER_REAL_NAME:E="Root User") ; 64AddGroupToHaikuImage root : 0 : ; 65AddGroupToHaikuImage users : 100 : ; 66 67 68#pragma mark - Host Name 69 70 71if $(HAIKU_IMAGE_HOST_NAME) { 72 actions BuildHaikuImageHostnameFile 73 { 74 echo "$(HAIKU_IMAGE_HOST_NAME)" > $(1) 75 } 76 77 local file = <haiku-image>hostname ; 78 Always $(file) ; 79 MakeLocate $(file) : $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) ; 80 BuildHaikuImageHostnameFile $(file) ; 81 AddFilesToHaikuImage system settings network : $(file) ; 82} 83 84 85#pragma mark - Build The Image 86 87 88# Execute pre-image user config rules. 89UserBuildConfigRulePreImage ; 90 91# Set image name and directory defaults and locate the image. 92HAIKU_IMAGE_NAME ?= $(HAIKU_DEFAULT_IMAGE_NAME) ; 93HAIKU_IMAGE_DIR ?= $(HAIKU_DEFAULT_IMAGE_DIR) ; 94HAIKU_IMAGE = $(HAIKU_IMAGE_NAME) ; 95HAIKU_IMAGE_SIZE ?= $(HAIKU_DEFAULT_IMAGE_SIZE) ; # 300 MB 96HAIKU_IMAGE_LABEL ?= $(HAIKU_DEFAULT_IMAGE_LABEL) ; 97MakeLocate $(HAIKU_IMAGE) : $(HAIKU_IMAGE_DIR) ; 98 99# Set the default installation directory. 100HAIKU_INSTALL_DIR ?= $(HAIKU_DEFAULT_INSTALL_DIR) ; 101 102# the pseudo target all image contents is attached to 103NotFile $(HAIKU_IMAGE_CONTAINER_NAME) ; 104 105# prepare the script that initializes the shell variables 106HAIKU_IMAGE_INIT_VARIABLES_SCRIPT = <HaikuImage>haiku.image-init-vars ; 107local script = $(HAIKU_IMAGE_INIT_VARIABLES_SCRIPT) ; 108MakeLocate $(script) : $(HAIKU_OUTPUT_DIR) ; 109Always $(script) ; 110 111AddVariableToScript $(script) : sourceDir : $(HAIKU_TOP) ; 112AddVariableToScript $(script) : outputDir : $(HAIKU_OUTPUT_DIR) ; 113AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ; 114AddVariableToScript $(script) : installDir : $(HAIKU_INSTALL_DIR) ; 115#AddVariableToScript $(script) : isImage : 1 ; 116AddVariableToScript $(script) : imageSize : $(HAIKU_IMAGE_SIZE) ; 117AddVariableToScript $(script) : imageLabel : $(HAIKU_IMAGE_LABEL) ; 118AddVariableToScript $(script) : addBuildCompatibilityLibDir 119 : "export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)" ; 120AddVariableToScript $(script) : dontClearImage : $(HAIKU_DONT_CLEAR_IMAGE) ; 121AddVariableToScript $(script) : updateOnly : [ IsUpdateHaikuImageOnly ] ; 122AddTargetVariableToScript $(script) : <build>addattr ; 123AddTargetVariableToScript $(script) : <build>bfs_shell : bfsShell ; 124AddTargetVariableToScript $(script) : <build>fs_shell_command : fsShellCommand ; 125AddTargetVariableToScript $(script) : <build>copyattr ; 126AddTargetVariableToScript $(script) : <build>create_image : createImage ; 127AddTargetVariableToScript $(script) : <build>makebootable ; 128AddTargetVariableToScript $(script) : <build>rc ; 129AddTargetVariableToScript $(script) : <build>resattr ; 130AddTargetVariableToScript $(script) : <build>unzip ; 131AddTargetVariableToScript $(script) : <build>vmdkimage ; 132if $(HOST_RM_ATTRS_TARGET) { 133 AddTargetVariableToScript $(script) : $(HOST_RM_ATTRS_TARGET) : rmAttrs ; 134} else { 135 AddVariableToScript $(script) : rmAttrs : rm ; 136} 137 138AddPackagesAndRepositoryVariablesToContainerScript $(script) 139 : $(HAIKU_IMAGE_CONTAINER_NAME) ; 140 141# create the other scripts 142HAIKU_IMAGE_MAKE_DIRS_SCRIPT = <HaikuImage>haiku.image-make-dirs ; 143HAIKU_IMAGE_COPY_FILES_SCRIPT = <HaikuImage>haiku.image-copy-files ; 144HAIKU_IMAGE_EXTRACT_FILES_SCRIPT = <HaikuImage>haiku.image-extract-files ; 145MakeLocate $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) $(HAIKU_IMAGE_COPY_FILES_SCRIPT) 146 $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) : $(HAIKU_OUTPUT_DIR) ; 147 148CreateHaikuImageMakeDirectoriesScript $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) ; 149CreateHaikuImageCopyFilesScript $(HAIKU_IMAGE_COPY_FILES_SCRIPT) ; 150CreateHaikuImageExtractFilesScript $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) ; 151 152# Convenience wrapper rule around BuildHaikuImage. 153rule _BuildHaikuImage image : isImage : isVMwareImage 154{ 155 # _BuildHaikuImage <image target> : <isImage> : <isVMwareImage> ; 156 # 157 158 # build the image 159 # HAIKU_IMAGE_EARLY_USER_SCRIPTS, HAIKU_IMAGE_LATE_USER_SCRIPTS can be 160 # specified by the user. 161 BuildHaikuImage $(image) : 162 $(HAIKU_IMAGE_INIT_VARIABLES_SCRIPT) 163 $(HAIKU_IMAGE_EARLY_USER_SCRIPTS) 164 $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) 165 $(HAIKU_IMAGE_COPY_FILES_SCRIPT) 166 $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) 167 $(HAIKU_IMAGE_LATE_USER_SCRIPTS) 168 : $(isImage) 169 : $(isVMwareImage) 170 ; 171 172 # remove the scripts we have generated 173 RmTemps $(image) : 174 $(HAIKU_IMAGE_INIT_VARIABLES_SCRIPT) 175 $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) 176 $(HAIKU_IMAGE_COPY_FILES_SCRIPT) 177 $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) 178 ; 179} 180 181# build the image 182_BuildHaikuImage $(HAIKU_IMAGE) : true ; 183NotFile haiku-image ; 184Depends haiku-image : $(HAIKU_IMAGE) ; 185 186 187# install Haiku into a directory 188NotFile install-haiku ; 189_BuildHaikuImage install-haiku : 0 ; 190 191 192# build the VMware image 193HAIKU_VMWARE_IMAGE_NAME ?= $(HAIKU_DEFAULT_VMWARE_IMAGE_NAME) ; 194HAIKU_VMWARE_IMAGE = $(HAIKU_VMWARE_IMAGE_NAME) ; 195MakeLocate $(HAIKU_VMWARE_IMAGE) : $(HAIKU_IMAGE_DIR) ; 196 197_BuildHaikuImage $(HAIKU_VMWARE_IMAGE) : true : true ; 198NotFile haiku-vmware-image ; 199Depends haiku-vmware-image : $(HAIKU_VMWARE_IMAGE) ; 200 201 202# create a package list 203BuildHaikuImagePackageList $(HAIKU_IMAGE_LIST_PACKAGES_TARGET) ; 204 205 206# Execute post-image user config rules. 207UserBuildConfigRulePostImage ; 208