| 1 |
YACS - Yet Another CD Script :-)
|
| 2 |
================================
|
| 3 |
(better known as debian-cd)
|
| 4 |
|
| 5 |
Copyright 1999 Raphaël Hertzog <hertzog@debian.org>
|
| 6 |
This set of tools is licensed under the General Public License
|
| 7 |
version 2 or any later version. You can find it in
|
| 8 |
/usr/share/common-licenses/GPL on a Debian GNU system.
|
| 9 |
|
| 10 |
Thanks to Steve McIntyre <stevem@chiark.greenend.org.uk> for his
|
| 11 |
work on slink_cd/debian_cd. Some ideas come from his script.
|
| 12 |
|
| 13 |
Thanks to all the contributors on the debian-cd mailing list.
|
| 14 |
|
| 15 |
What is needed ?
|
| 16 |
================
|
| 17 |
Software :
|
| 18 |
- the apt-get (>= 0.3.11.1) tool
|
| 19 |
- perl (>= 5.004)
|
| 20 |
- bash (or another POSIX shell)
|
| 21 |
- make
|
| 22 |
- mkisofs/mkhybrid (mkisofs also provides the isoinfo binary used by the
|
| 23 |
Pseudo Image Kit)
|
| 24 |
- dpkg-multicd package (for dpkg-scanpackages with -m option)
|
| 25 |
- the perl MD5 module
|
| 26 |
- dpkg-dev (>= 1.4.1.6) (for dpkg-scansources)
|
| 27 |
- lynx (for text version of README.html)
|
| 28 |
Other :
|
| 29 |
- lots of free space on your disks
|
| 30 |
- a Debian mirror (on a partition where you can write, if you can't write
|
| 31 |
on it then you may try to use a symlink farm but it's not the
|
| 32 |
recommended way to build Debian CDs)
|
| 33 |
|
| 34 |
-------------------------------
|
| 35 |
- GENERATING DEBIAN CD IMAGES -
|
| 36 |
-------------------------------
|
| 37 |
|
| 38 |
|
| 39 |
For people that do not have time, here's the quick explanation :
|
| 40 |
================================================================
|
| 41 |
|
| 42 |
Edit the CONF.sh and change the PATHs for the mirror and so on.
|
| 43 |
$ vim CONF.sh
|
| 44 |
$ . CONF.sh
|
| 45 |
$ make distclean
|
| 46 |
$ make status
|
| 47 |
$ make list COMPLETE=1 SIZELIMIT1=555000000 SRCSIZELIMIT=665000000
|
| 48 |
$ make official_images
|
| 49 |
[ or if you want only binary images :
|
| 50 |
$ make bin-official_images ]
|
| 51 |
|
| 52 |
But you really should consider reading further for more information.
|
| 53 |
|
| 54 |
|
| 55 |
How to build a CD set - step by step
|
| 56 |
====================================
|
| 57 |
|
| 58 |
If not yet done, cd to the /usr/share/debian-cd/ directory.
|
| 59 |
|
| 60 |
The process of building a CD is decomposed as follow :
|
| 61 |
|
| 62 |
- first configure what is needed in CONF.sh and source it
|
| 63 |
in your shell
|
| 64 |
$ . CONF.sh
|
| 65 |
The exported environment variables will be used by all the
|
| 66 |
tools involved here (Makefiles, perl scripts, shell scripts).
|
| 67 |
|
| 68 |
If you want to build CD images for more than one arch, you will
|
| 69 |
have to build them one after the other (you may use a shell
|
| 70 |
script for this).
|
| 71 |
|
| 72 |
Note that the temporary dir must be on the same device than the
|
| 73 |
mirror because debian-cd uses hardlinks for generating an image
|
| 74 |
tree. If you can't do this, you'll have to use the symlink farm.
|
| 75 |
The symlink farm is explained at the end of this README.
|
| 76 |
|
| 77 |
- let's clean everything that may still be there from previous runs :
|
| 78 |
$ make distclean
|
| 79 |
|
| 80 |
- now we'll check if your mirror is ok (with good Packages files) :
|
| 81 |
$ make mirrorcheck
|
| 82 |
|
| 83 |
- then you will have to launch this for initializing the
|
| 84 |
temporary directory used for the build :
|
| 85 |
$ make status
|
| 86 |
If this has failed then this will be automatically launched :
|
| 87 |
$ make correctstatus
|
| 88 |
However note that make status should never fail if it is
|
| 89 |
used for building a CD set for the stable release ...
|
| 90 |
|
| 91 |
- now you can decide what you want on your CDs
|
| 92 |
$ make list TASK=tasks/debian-2.2 COMPLETE=1
|
| 93 |
or
|
| 94 |
$ make list TASK=tasks/gnome COMPLETE=0 SIZELIMIT=576716800
|
| 95 |
or
|
| 96 |
$ export NONFREE=1; make list TASK=tasks/kde COMPLETE=1
|
| 97 |
or for something like an official image for the USA (without non-US &
|
| 98 |
non-free) :
|
| 99 |
$ make list COMPLETE=1 SIZELIMIT1=576716800
|
| 100 |
.... take a look at the file tasks/* to see the options you can have :)
|
| 101 |
|
| 102 |
You can change the behaviour of this command with the following
|
| 103 |
variables :
|
| 104 |
- if NONUS is set, then packages from non-US will be allowed (remember
|
| 105 |
that the value of NONUS must be the path to the non-US mirror
|
| 106 |
if you have one)
|
| 107 |
- if FORCENONUSONCD1 is set also, then packages will be
|
| 108 |
rearranged so that non-US packages are all on CD#1. This
|
| 109 |
includes the non-free ones if you specify NONFREE. Then 2 separate
|
| 110 |
copies of CD#1 will be produced, identical in every respect except
|
| 111 |
for the inclusion/lack of non-US packages. The same happens for
|
| 112 |
the source CDs when they are built.
|
| 113 |
- if NONFREE is set, then packages from non-free will be allowed
|
| 114 |
(NONFREE must be exported to all sub-shells)
|
| 115 |
- if EXTRANONFREE is set, then non-free packages will be included
|
| 116 |
on an extra CD (the last CD in fact). Don't use NONFREE and
|
| 117 |
EXTRANONFREE at the same time !
|
| 118 |
(EXTRANONFREE must be exported to all sub-shells)
|
| 119 |
- if COMPLETE is set, all packages that are not listed in the
|
| 120 |
selected task file will be included at the end
|
| 121 |
- if SIZELIMIT is set, it will be used as the maximum size that
|
| 122 |
we can put into each CD
|
| 123 |
- if SIZELIMIT<X> (with <X> beeing a integer) is set, it will be used
|
| 124 |
as the maximum size of the X'th binary CD. SIZELIMIT<X> overrides
|
| 125 |
SIZELIMIT ...
|
| 126 |
- if SRCSIZELIMIT is set, it's used as the maximum size for source CD
|
| 127 |
- if SRCSIZELIMIT<X> (with <X> beeing an integer) is set, it will be
|
| 128 |
used as the maximum size of the X'th source CD
|
| 129 |
|
| 130 |
This target calls the targets "bin-list" and "src-list" that can be used to
|
| 131 |
build only binary CDs or only source CDs.
|
| 132 |
|
| 133 |
- it may be time to add the disks-arch stuff and to make the CDs bootable
|
| 134 |
$ make bootable
|
| 135 |
This does affect only the binary CDs.
|
| 136 |
|
| 137 |
If you want to use boot-floppies built by yourself you can give
|
| 138 |
a parameter BOOTDISKS=<dir> giving the directory where
|
| 139 |
they are (note that $BOOTDISKS/current must be a symlink to the
|
| 140 |
real directory, it must follow the same setup than in the FTP
|
| 141 |
mirror). Your boot-floppies must also be on the same partiton than
|
| 142 |
your mirror & temporary dir (hardlinks are used here too).
|
| 143 |
|
| 144 |
All CD1 of officials images are bootable (CD for ARM are the exception)
|
| 145 |
and the space required for this stuff may not always be taken into
|
| 146 |
account in the size calculation. That's why you may need to adjust
|
| 147 |
manually SIZELIMIT1 following the size of the boot-floppies set that
|
| 148 |
you're using.
|
| 149 |
|
| 150 |
- now, we'll add the binary packages to the temporary tree :
|
| 151 |
$ make packages
|
| 152 |
|
| 153 |
- and we'll add the sources to the temporary tree :
|
| 154 |
$ make sources
|
| 155 |
|
| 156 |
- if you want to install additional files :
|
| 157 |
make bin-extras CD=1 ROOTSRC=/home/ftp/ DIR=goodies/wordperfect
|
| 158 |
make src-extras CD=3 ROOTSRC=/home/ftp/ DIR=goodies/kernel-2.3
|
| 159 |
|
| 160 |
The first will copy /home/ftp/goodies/wordperfect/ on the first binary
|
| 161 |
CD. It will be in <root of the cd>/goodies/wordperfect ... you can call
|
| 162 |
make extras multiple times if you need more. Please note that
|
| 163 |
the files to be copied should be on the same partition than
|
| 164 |
your mirror (unless you use a symlink farm).
|
| 165 |
|
| 166 |
If you want to do customize your CD even more, you can use the hook
|
| 167 |
system. Read below about them.
|
| 168 |
|
| 169 |
- We can add an md5sum.txt file on each CD to enable users to check their
|
| 170 |
files :
|
| 171 |
$ make md5list
|
| 172 |
This does call the targets 'bin-md5list' and 'src-md5list'. You can
|
| 173 |
choose to call only bin-md5list if you're building only binary images.
|
| 174 |
|
| 175 |
- now we can create the images
|
| 176 |
$ make images
|
| 177 |
If you don't have enough space for all images, you can generate
|
| 178 |
only one image (of the second binary CD for example) with :
|
| 179 |
$ make bin-image CD=2
|
| 180 |
Of course if you want to build all binary images you'll use :
|
| 181 |
$ make bin-images
|
| 182 |
And "make src-images" will generate the sources images.
|
| 183 |
|
| 184 |
- if you want to generate a MD5SUMS file with the md5sums of the
|
| 185 |
images you can do it with :
|
| 186 |
$ make imagesums
|
| 187 |
|
| 188 |
|
| 189 |
Local packages
|
| 190 |
==============
|
| 191 |
|
| 192 |
If you provide some custom made packages and you want to put them on
|
| 193 |
Debian CD set you can do it. Simply put your packages in
|
| 194 |
$MIRROR/dists/$CODENAME/local/binary-$ARCH/<section>.
|
| 195 |
The organization of this sub-tree is the same than what you can find
|
| 196 |
in the main, contrib or non-free part. You may use different section
|
| 197 |
names if you want. Be sure to create Packages files (and Sources.gz if you
|
| 198 |
include sources).
|
| 199 |
|
| 200 |
To include local packages, the LOCAL environment variable must be set
|
| 201 |
to "1" while building the CDs.
|
| 202 |
|
| 203 |
You can also set the LOCALDEBS environment variable, and it will be used
|
| 204 |
instead of MIRROR when looking for local packages.
|
| 205 |
|
| 206 |
Additionnal targets
|
| 207 |
===================
|
| 208 |
|
| 209 |
Pseudo Image Kit
|
| 210 |
----------------
|
| 211 |
Those of you, who will make images available to people for download may
|
| 212 |
consider using the Pseudo Image Kit (cf http://cdimage.debian.org for more
|
| 213 |
information). That's why you can launch "make pi-makelist" that will generate
|
| 214 |
the *.list files for the images you've just generated.
|
| 215 |
|
| 216 |
The tools/pi-makelist script needs the isoinfo binary. You can get the
|
| 217 |
sources from http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html
|
| 218 |
|
| 219 |
Alternatively (and certainly simpler for people using Debian system), the
|
| 220 |
isoinfo binary is in the mkisofs package (since Debian potato at least).
|
| 221 |
|
| 222 |
|
| 223 |
About the hook system
|
| 224 |
=====================
|
| 225 |
|
| 226 |
A hook script can be executed at different times. You can specify the
|
| 227 |
script by setting the HOOK variable to the script filename. It will
|
| 228 |
get 2 arguments, the first is the CD number. The second depends on
|
| 229 |
where/when the hook script is called. It can be 'before-scanpackages'
|
| 230 |
or 'before-mkisofs' (their values are explicit ...). When the script
|
| 231 |
is called, the current directory will be the temporary directory used for
|
| 232 |
the build (aka $TDIR/$CODENAME-$ARCH).
|
| 233 |
|
| 234 |
There are hooks only for binary CDs at the present time. If HOOK is not
|
| 235 |
set, it will look for a script $BASEDIR/tools/$CODENAME.hook.
|
| 236 |
|
| 237 |
|
| 238 |
About the symlink farm
|
| 239 |
======================
|
| 240 |
|
| 241 |
If you don't have write access on the disk where you have the mirror
|
| 242 |
or if for another reason hardlink cannot be used, you can try to
|
| 243 |
use a symlink farm. Instead of having real files, your temporary tree
|
| 244 |
will be filled with symlinks that mkhybrid will change into files when
|
| 245 |
it will build the image. You'll need to use a special options. You
|
| 246 |
have 2 lines of options in CONF.sh as examples.
|
| 247 |
|
| 248 |
I've never tested the symlink farm ... it may well generate unusable
|
| 249 |
images. Don't use it for ISO images that will used by many users.
|
| 250 |
|
| 251 |
Note that you will also need a patched mkhybrid that does support the
|
| 252 |
-F option. Have a look here about it :
|
| 253 |
http://www.chiark.greenend.org.uk/~stevem/DebianCD/
|
| 254 |
|
| 255 |
The mkhybrid package in Debian does support this -F option since
|
| 256 |
potato (Debian 2.2).
|