README
1 This tool can be used to create a Live CD/DVD or a Live USB image from a
2 given list of packages.
3
4 The script retrieves the list of packages from the specified IPS repository
5 server, prepares the X86 microroot, does additional processing for
6 creating a bootable live CD, and then creates an ISO that can be
7 burned into a CD/DVD. The script can also convert
8 the ISO into a USB image that is suitable for writing to a USB drive.
9
10 The following is a high-level description of the steps the Distribution
11 Constructor completes in order to create a bootable live CD.
12
13 The Constructor...
14
15 1) Loads your configuration file.
16
17 2) Populates the proto area with the list of packages specified.
18
19 3) Populates the microroot from the proto area
20
21 4) Completes special setup for the Live CD. This setup is done in the
22 livemedia_processing() function in src/build_dist.lib.
23
24 The preparations includes running all the postinstall scripts
25 to setup GNOME; setting up the font cache; preloading the SMF repository;
26 creating symlinks between the microroot and the proto area;
27 and finally creating a boot archive with all the files installed into
28 the microroot.
29
30 5) Invoke mkisofs to build a bootable iso image containing the
31 entire contents of our proto directory. Grub's eltorito stage2 bootloader
32 is used, that enables booting directly off a CD/DVD. We violate the ISO9660
33 specs somewhat to accomodate file properties essential for a proper Unix
34 file/directory layout.
35
36
37 Pre-requisites to using the Distribution Constructor:
38 ------------------------------------------------------
39 - To use this kit, you need to have root access to the system on which the
40 resulting image are to be created.
41
42 - The system on which you are using the kit must be a x86 system running
43 Solaris Nevada build 71 or above. Sparc is not supported at this time.
44
45 - You need to have access to an IPS repository server.
46
47 Usage:
48 ------
49
50 To create a Live CD/DVD or USB image, invoke the "build_dist.bash"
51 script with your configuration file as an argument. For example:
52 # ./build_dist.bash test1.conf
53
54
55 Configuration file:
56 -------------------
57
58 The configuration file is used to specify different parameters used
59 for creating the image. The "dist.conf" file is a skeleton file
60 containing all the parameters. You can make a copy of this file,
61 and fill in your values.
62
63 To view a sample file, see test_data/test1.conf.
64
65 The following parameters are required:
66
67 DIST_PKG_LIST:
68 Full path to a file containing list of packages to be
69 included in distribution. The list of package names
70 should be one per line in the file. test_data/pkg.txt
71 is the file used for creating the Slim CD prototype.
72
73 DIST_PKG_SERVER:
74 Name of the IPS server containing the packages. Note:
75 in this prototype release, we only support specifying
76 one IPS server.
77
78 DIST_PROTO:
79 The proto directory where the filesystem hierarchy for
80 the distribution is created. If this directory does not
81 currently exist, it will be created. If this directory
82 exists, and there's content in it, all contents will be removed.
83
84 DIST_ISO:
85 The full path to the ISO file to be created. If this file
86 already exists, it will be overwritten with the new file.
87
88 DIST_ID:
89 Name of this image.
90
91 DIST_ISO_SORT:
92 Sort list for the /usr file system on the CD. This is used
93 for optimizing the run time of the CD. test_data/iso.sort
94 is the file used for the Slim CD prototype release.
95
96 COMPRESSION_TYPE:
97 Specifies the compression type to use when compressing solaris.zlib
98 and solarismisc.zlib.
99 You must specify a compression type that is allowed by lofiadm.
100
101 The following parameters are optional:
102
103 DIST_USB:
104 The full path to the USB file for the USB image
105 If this value is not specified, the USB image will not be
106 created. If the USB file exists, it will be overwritten
107 with the new file.
108
109 QUIT_ON_PKG_FAILURES:
110 Acceptible values are yes or no. Yes means that if the
111 package adds fail, the entire build is aborted. No means that if
112 the package adds fail, continue on. The default value is yes.
113
114 DIST_ADDITIONAL_MOD:
115 If additional changes need to be made to the image before the image
116 is created, these changes can be passed into the Distro Constructor
117 code as an archive.
118
119 The archive must contain at least one script with the
120 name "post-process". If no script with the name
121 "post-process" is found in the root of the
122 archive, the archive will be ignored.
123
124 --------------------------------------------------------
125 Brief Overview of the structure of the source code:
126 --------------------------------------------------------
127
128 The source code for the Distribution Constructor toolkit for the preview
129 release is a collection of scripts. This is based on work that's
130 previously done in the Live Media Project.
131 See http://opensolaris.org/os/project/livemedia/
132
133 src:
134 ----
135
136 The src directory contains all the code used to create the ISO image.
137
138 build_dist.bash:
139 Main script
140 build_dist.lib:
141 Supporting functions for the main script.
142 pkg_retrieve.lib:
143 Functions for installing packages from the IPS repository.
144 dist.conf:
145 Skeleton configuration file. Make a copy of this file and fill it
146 out to specify your own configuration.
147 mkrepo:
148 Pre-registers SMF services for the Live CD.
149 generic_live.xml:
150 Used by "mkrepo" script above.
151 usr_microroot_files:
152 List of files for the /usr directory for the microroot. This file
153 is a "hack" for the prototype. In order to reduce the size of the
154 microroot, only files that are critical for the Live CD during boot
155 are included.
156 var_microroot_files:
157 List of files for the /var directory for the microroot. Only files that
158 are needed for the Live CD to boot are included.
159 postrun_scripts:
160 This directory contains some SVR4 postinstall scripts that do
161 postrun. Since IPS doesn't support postinstall scripts, and the
162 postrun command depends on some SVR4 information, this setup is
163 a "hack". This "hack" is necessary to run all
164 the postinstall scripts needed to setup GNOME.
165
166 test_data/
167 -----------
168
169 pkgs.txt:
170 List of packages used for creating the Slim CD prototype. Note:
171 slim_install is a cluster of packages defined in the IPS server.
172 So, name of individual packages doesn't need to be specified.
173 test1.conf:
174 sample configuration file.
175 iso.sort:
176 This is used for optimizing the run time of the CD for the
177 Slim CD prototype.
178
179 tools/
180 ------
181 usbgen:
182 Generates a USB file that is suitable for USB drives based on an ISO.
183
184 usbcopy:
185 Copies the file generated by usbgen to your USB drive.
186
187 proc_slist.pl:
188 proc_tracedata:
189 Used for generating the iso.sort file.
190
191 listusb:
192 A binary used by usbgen.
193
194 extract_postrun:
195 A convenience script that extracts all the postinstall scripts
196 from SVR4 packages that contain postrun calls.
197