aboutsummaryrefslogtreecommitdiffstats
path: root/bcd.pod
blob: 1eb0a303135e715be2362d494020bf332f276e33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
=head1 NAME

bcd tools - A simple program to generate Mandriva's ISO

=head1 SYNOPSIS

bcd configuration.xml [options]

=cut

=head1 OPTIONS

=over 8

=item B<First arg must be:>

 The XML configuration file

=item B<Second arg must be:>

 stagex: update the stage1/stage2 in builddir
 isolinux: update the isolinux in builddir
 clean: clean the builddir and isodir
 media: create the list of wanted packages, create all media in builddir,
        link/copy packages in builddir/media, create the media.cfg,
	and generate the hdtlist/synthesis
 gendistrib: create the hdlists/synthesis in builddir (depends on the based_on tag)
 list: list all media and list of input/exclude (from the xml conf file)
 mediarepo: list all medias availables in the repositery
 checkrepo: rpmcheck main hdlists in the repositery
 all: run all stage in order to get an ISO
 md5: create MD5 sum of the ISO
 info: parse the configuration file (usefull to check the XML syntax)
 iso: create the final ISO from the builddir

=item B<extra arg:>

 noiso: don't build the iso (md5, isohybrid) in case of 'all' process
 copy: copy rpm instead of link them from the repositery

=back

=head1 EXAMPLES

the folowing example will do all step to create an ISO:

 bcd mdv-20091.xml all

the following example will create the build dir without creating ISO:
 bcd.pl mdv-20091.xml all noiso

same as above but copy packages instead of link them from the repositery:
 bcd.pl mdv-20091.xml all noiso copy

the following will update the isolinux in the build directory:
 bcd.pl mdv-20091.xml isolinux

to check the main hdlist in the repositery with rpmcheck
 bcd.pl mdv-20091.xml checkrepo

clean the builddir and isodir
 bcd.pl mdv-20091.xml clean

=cut

=head1 COPYRIGHT

Copyright (C) 2009 Mandriva <aginies_@_mandriva.com>

=cut

=head1 DESCRIPTION

BCD is used to create Mandriva ISO.
features are:
- configuration file is in XML format
- use of genhdlist2 with file-deps
- support the add of an isolinux entry
- change the theme on all.rdz files
- just need an input and an exclude file for package list
- write media.cfg
- support of custom rpmsrate of compssusers.pl
- support of custom advertising
- support of custom stage2
- extra filter to remove doble packages (keep latest version)
- all sub-media supported (updates, testing...)
- create the iso HEADER
- use of urpmi to calculate deps/conflicts/suggests
- create an md5 file
- create a product.id file
- create a VERSION file
- support of no-suggests option per media
- support extra external media with hdlists

=cut

=head1 USER conf

Your user must have some sudo root right to be able to use chroot, urpmi
rm, mount umount tools. IE: for user plop in /etc/sudoers file

 plop ALL=(root) NOPASSWD:/bin/mount, /bin/umount, \
	/usr/sbin/chroot, \
	/usr/sbin/urpmi, \
	/usr/sbin/urpmi.addmedia, \
	/usr/sbin/urpmi.removemedia, \
	/bin/rm

=cut

=head1 LISTS

input list:
list of rpm needed on the CD. Those list should contains the name
or the provides of a package. You may also use a CAT_XXX from the
rpmsrate file, with the wheigth parameter.

 ie: of lists/input_main
 INSTALL 1
 CAT_X 1
 CAT_GNOME 1
 CAT_AUDIO 1
 aumix
 task-lxde

exclude list:
list of unwanted packages on the CD. Be carreful to do not exclude mandatory packages
or you CD will be unusable. Rpmcheck will report any bug in hdlists at the end of 
the 'media' step process. Packages listed in exclude list will be removed from the 
DVD at the end of the build process.

extra-filter:
list of RPM you want to compare to keep the latest one. Usefull for kernel
and dkms release.

=cut

=head1 ISSUE

 - if you want to build ISO for x86_64 you must used an x86_64 system (due to urpmi)
 - can't build dual arch ISO
 - if hdlist/synthesis are corrupted in your repositery, you can't build ISO

=cut

=head1 conf.xml

Example of a commented conf.xml file. Keep in mind that most of those
parameters are correct, and you don't need to change whole of them.
Examples are available in this package, so please use one of them to 
base your configuration.

You should only change those one:
{nameid}
{version}
{arch}
{repo}{path}
{media}{list}*
{iso}{header}*

Fully commented file:
---------------------
first it's an xml file:
 <?xml version='1.0'?>

name of the product
 <productname desc="The Linux product">

identification of the product
 <nameid>XtreemOS</nameid>

based_on parameter define on wich version of Mandriva this product will be built.
This parameter define if we need synthesis or hdlists (since 2009.1 only synthesis are needed)
It will be use to get the path of the Mandriva repositery
 <based_on>2009.0</based_on>

Arch parameter is mandatory, it will be also used to get the path of the MDV repositery
 <arch>i586</arch>

path to the repositery
 <repo desc="Where is the repositery of the distribution">
  <path>/mnt/BIG/dis</path>
 </repo>

so the full path of the Mandriva repositery will be in our example
 </mnt/BIG/dis/2009.0/i586>

workdir is where you want to store the result of the build
 <workdir desc="Where is my working dir">
  <path>/home/xtreemos/build_bcd</path>
 </workdir>

basename of log files
 <tocopy_file>tocopy_plop</tocopy_file>

all Isolinux information
 <isolinux desc="isolinux info">
  <defaultpath>isolinux</defaultpath>

if you want to point to a custom isolinux directory
 <fullpath>/home/xtreemos/export_i386/isolinux</fullpath>

if you want to add a entry in your isolinux.cfg
 <!-- add hdt entry in syslinux.cfg -->
  <entry name="hdt" desc="Main media">
   <bin>/usr/lib/syslinux/hdt.c32</bin>
   <label>hdt</label>
   <kernel>hdt.c32</kernel>
   <append>modules=modules.pci</append>
  </entry>

some section are mandatory to keep the array structure of the xml file
  <!-- keep this entry to create an array ref -->
  <entry></entry>

if you want to copy extra files to the isolinux buildir
 <tocopy name="pcimap">
  <file>/lib/modules/2.6.31-server-2mnb/modules.pcimap</file>
 </tocopy>
 <tocopy name="ids">
  <file>/usr/share/pci.ids</file>
 </tocopy>
 <tocopy></tocopy>
 </isolinux>

all information relatives to the installer (stage2)
 <installer desc="path to the Mandriva installer (stage1/stage2)">
  <defaultpath>install</defaultpath>

if you want to use a custom installer
 <fullpath>/home/xtreemos/export_i386</fullpath>

path to custom advertising
 <advertising>
  <defaultpath>advertising</defaultpath>
  <fullpath>/home/xtreemos/Build/pieces/advertising</fullpath>
 </advertising>

full path and name of your patch for stage2 to copy in the buildir/install directory
  <patch>/home/xtreemos/Build/pieces/patch-oem.pl</patch>
 </installer>

theme to use to patch all.rdz file
theme name will be used to install mandriva-release-THEMENAME and avoid
problem of mixing theme on a same product
 <!-- theme must be available to path altx/all.rdz files -->
 <theme name="mandriva-release-Free">
  <bootsplash>Mandriva-Free</bootsplash>
  <bootsplash_path>/usr/share/bootsplash</bootsplash_path>
  <gfxboot_path>/usr/share/gfxboot</gfxboot_path>
 </theme>

media section will defined wich media you want to use and you want to create on the DVD
 <media desc="media to take into account to build the ISO">
 <!-- WARNING this media must be named "Main" because main media is mandatory for all other media-->
 <!-- Morever the "Main" media is always the Name use for an MDV repositery -->
 <!-- futur feature will provide a way to specify another name for the basic repo of an MDV distribution -->
 <!-- use the supp_media option if you needed to use media option of urpmi, usefull for external media
  wich need main and contrib to be installed, use the urpmi syntax of \-\-media (no space, media separated by coma)
 <media_supp>Main,Main Updates,Contrib,Contrib Updates</media_supp>-->
 <list name="Main" desc="Main_media">
  <!-- MANDATORY list of wanted packages on the iso -->
  <input name="base">
   <file>lists/input_main</file>
  </input>
  <input name="lang">
   <file>lists/languages</file>
  </input>
  <!-- to create an array you must keep this even if it is empty -->
  <input name="xos">
   <file>lists/xos_list</file>
  </input>

you can use an external media, but this media must have a media_info directory
you must use external media if this media is not available in the repositery.
IE: restricted32 packages on a PowerPack 64bits product
 <!-- external media repositery with hdlists -->
  <external name="xos">
   <fullpath_mediadir>/home/xtreemos/repo_xos/2009.0/i586/media/xtreemos/release</fullpath_mediadir>
  </external>

Packages unwated on the DVD, they will be removed at the end of the installation process
 <!-- MANDATORY list of unwanted packages on the iso -->
  <exclude name="exclude">
   <file>lists/exclude_main</file>
  </exclude>
  <!-- to create an array you must keep this even if it is empty -->
  <exclude>
  </exclude>

switch nosuggest options to yes if you don't want to use RPMS's suggests
 <!-- nosuggests options should be yes or no -->
 <nosuggests>no</nosuggests>

I will use the media name "mediadir" and put it in the directory media/'destmedia' on the DVD
 <!-- will be taken in {repo}{version}{arch}/media -->
  <mediadir>main</mediadir>
  <destmedia>main</destmedia>

where to find the pubkey in the repositery (the path will be media/'mediadir'/'pubkey')
 <pubkey>release/media_info/pubkey</pubkey>

if you want to use backports, testing or updates sub-media, set option to yes, note: release media should be mandatory
  <release>yes</release>
  <updates>yes</updates>
  <backport>no</backport>
  <testing>no</testing>
 </list>
 <!-- keep this entry to create an array ref -->
  <list></list>
 </media>

all media_info informations are in this section
 <mediainfo desc="All files relatives to media_info dir">

version will be used to generate a good media.cfg files (we don't use hdlits.cz since 2009.1 release)
 <version>2009.0</version>

use 'fullpath' parameter to use custom files
 <!-- set fullpath if you want to use an files in a non MDV repositery -->
 <fullpath>/home/xtreemos/Build/pieces</fullpath>
 <mediainfo_dir>media/media_info</mediainfo_dir>
 <rpmsrate>rpmsrate</rpmsrate>
 <compssusers>compssUsers.pl</compssusers>
 <filedeps>file-deps</filedeps>

if you want to add an urpmi options to install packages
 <urpmi_option>-a</urpmi_option>

if you want to do some extra filter to keep latest release of a packages on the DVD 
 <filter>lists/extra-filter</filter>

media.cfg options
 <askmedia desc="add for other media ?">
  <todo>yes</todo>
 </askmedia>
 <suppl desc="add an external media ?">
  <todo>yes</todo>
 </suppl>
  <xmlinfo>
 <todo>no</todo>
  </xmlinfo>
 </mediainfo>
	
ISO section
 <iso>

tag name and some extra parameters
 <tag>rc1</tag>
 <minor>0</minor>
 <subversion>1</subversion>
 <product>Download</product>
 <branch>Devel</branch>
 <type>basic</type>
 <!-- dual arch not yet supported -->
 <dualarch>no</dualarch>
 <!-- SIZE is not YET USED !!! -->
 <size>700</size>
 <!-- media.cfg will be stored on genisoimage->{builddir}/{nameid}/{arch} -->
 <mediacfg>media/media_info/media.cfg</mediacfg>
 <hdlist>yes</hdlist>
 <synthesis>yes</synthesis>

info used by the genisoimage tool
 <header desc="Iso header info">
  <systemid>XtreemOS Linux</systemid>
  <volumeid>XOS-2.0-i586</volumeid>
  <volumesetid>XtreemOS Linux - 2.0 - i586 DVD </volumesetid>
  <publisherid>XtreemOS</publisherid>
  <datapreparer>XtreemOS-Linux</datapreparer>
  <applicationid>XtreemOS Linux - 2.0</applicationid>
  <copyrightid>XtreemOS Linux</copyrightid>
 </header>

genisoimage paramater
 <genisoimage desc="iso generation tool">
  <options>-f -r -J -hide-rr-moved -nobak -cache-inodes -no-emul-boot -boot-load-size 4 </options>
  <bootcat>isolinux/boot.cat</bootcat>
  <!-- builddir and destdir will always use the workdir -->
  <builddir>build</builddir>
  <isodir>iso</isodir>
 </genisoimage>
 </iso>
 </productname>

=cut