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