Create local cd-images
- You may want to create cd-images local if you what to test things or just because you can. In order to get an working environment for the cd build process you have to take some steps. First of all you need some disc-space on your hard disk. Thins howto assumes you keep all data on one partition, if you don't you may get problems because of hardlinks that can't get created. This howto is based on an fresh cdebootstraped etch i386 but should work with other arches too.
Known problems
- The md5sums of the Packages.gz files in the Release file don't match (installer complains but install after confirmation).
On the first run you need to make the get_popcon in src/build/CD-administrator of your workingcopy of the svn repository.
Workingcopy of debian-edu subversion repository
- If you don't already have an workingcopy of the subversion repository you can create on with:
svn co svn://svn.debian.org/svn/debian-edu/trunk debian-edu-trunk
This requires the subversion package to be installed. Even if you still have a workingcopy (for example because you are a developer) you may which to create an separate one, because the build process modifies some files and even tries to commit the changes if you are not careful and deactivate the functionality in the Makefile.
Directory layout
Most of the data lays under /skolelinux but some scripts try to access data under /var/www/ftp.skolelinux.org and the final images will be moved there too. First thing to do is to create the directory for the Debian etch mirror.
mkdir -p /skolelinux/administrator/debmirror/debian/debian/
The skolelinux mirror is normally expected to be under /var/www but if you have created an own partition/volume for /skolelinux you may want to replace /var/www/ with /skolelinux and bind mount it under /var/www/ later.
mkdir -p /var/www/ftp.skolelinux.org/
The actual images are created below of/skolelinux/administrator/temp_storage. A hardlink farm is later created in the builder subdir so you may create them altogether:
mkdir -p /skolelinux/administrator/temp_storage/builder
Create the mirrors
- There are many ways to create local mirrors of Debian repositorys the simplest way is to use debmirror. But debmirror has also the drawback of not creating a complete mirror as the cd build requires. As the parts which debmirror does not mirror are easy to get with rsync we will use it anyway.
Debian etch mirror
- First create an mirror of Debian etch for the architectures you want to created images for. In order to enable debmirror to check the signatures of the Release files you need to import the archive gpg keys first. If you
don't use gpg it's as simple as cp /etc/apt/trusted.gpg ~/.gnupg/pubring.gpg (¡¡¡¡Attention: this will overwrite existing publickey rings without further request!!!). If you use gpg import them the way you normally import gpg-keys. After the keys are in Place you can start debmirror. Here's an example for creating an amd64 and i386 mirror using rsync as backing protocol: {{{debmirror -v -a amd64,i386 --nosource -d etch \
-s main,contrib,non-free,main/debian-installer \ /skolelinux/administrator/debmirror/debian/debian/ --progress -e rsync \ -r :debian -h ftp.de.debian.org}}}
- Now you have all the required packages, but the installer images as well as some other stuff required to create an installer cd are missing. We will fetch them now by using rsync directly: {{{rsync -av ftp.de.debian.org::debian/dists/etch/main/installer-i386 \
/skolelinux/administrator/debmirror/debian/debian/dists/etch/main/
rsync -av ftp.de.debian.org::debian/dists/etch/main/installer-amd64 \ /skolelinux/administrator/debmirror/debian/debian/dists/etch/main/
rsync -lpgv ftp.de.debian.org::debian/* \ /skolelinux/administrator/debmirror/debian/debian/
rsync -av ftp.de.debian.org::debian/doc \ /skolelinux/administrator/debmirror/debian/debian/
rsync -av ftp.de.debian.org::debian/indices \ /skolelinux/administrator/debmirror/debian/debian/
rsync -av ftp.de.debian.org::debian/tools \ /skolelinux/administrator/debmirror/debian/debian/}}}
Skolelinux etch mirror
- From the Skolelinux archive you only need the packages so a normal debmirror
is sufficient here. After importing the archive key (for example with: gpg --keyserver blackhole.pca.dfn.de --recv A26FF456) you can start the mirror as following (amd64 and i386): {{{debmirror -v -a i386,amd64 --nosource -d etch,etch-test \
-s local,local/debian-installer /var/www/ftp.skolelinux.org/skolelinux/ \ --progress -e rsync -r :skolelinux-dist -h ftp.skolelinux.org}}}
- After successfully finishing the mirror you need to create the hardlink farm. If the mirror and
/skolelinux/administrator/temp_storage/builder/mirror-link resits on the same filesystem you can do that using cp this way: {{{cp -lr /var/www/ftp.skolelinux.org/skolelinux/ \
/skolelinux/administrator/temp_storage/builder/mirror-link}}}
- As a last step you should add the Skolelinux archive key to the apt keyring to make the cd build happy (which would complain otherwise):
gpg -a --export A26FF456 | apt-key add -
Backports repo
Use the command given below to mirror the backports repo (only needed if you plan to use packages from backports)
debmirror -v -a i386 --nosource -d lenny-backports -s main /skolelinux/administrator/debmirror/debian/debian-backports --progress -method http -r debian -h www.backports.org
Using a local repo
A local repo can be used to include packages that are not present in the official debian repo. If you are planning to use a local repo copy your repository in /skolelinux/administrator/debmirror/debian/debian/dists/lenny/local
Also set LOCALCODE to your local release codename in CONF-* (under src/build/CD-administrator).
Install required software for the build process
- In order to make the build process succeed you need to install some packages if they are not yet installed on your system. Not all packages are required by all images (and maybe there are some missing for ppc which I did not test). Some packages are only required for the reports which are created after the .iso files are created. To make the build process run through you need the following packages:
- patch
- make
- mailx
- cpp
- lynx
- tofrodos
- netpbm
- syslinux
- mkisofs
- libtext-format-perl
- debootstrap
- python-minimal
- python2.4
- dpkg-dev
- gcc
Some last modifications on the build scripts
- Normally the build runs unattended and commits the resulting logs to the svn (and also sends mails). To avoid the commit to fail (if you have not the required permissions) or to confuse other people with your builds you should
modify to files. In your workingcopy in the src/build/CD-administrator dir change:
build.sh - Set the mailto variable to some reasonable value
Makefile - Modify the commit and newcommit targets to not do commits (remove the -q commit lines).
- comment out the line export SECURITY="$TOPDIR"/debmirror/debian/debian-security in the CONF* (or mirror the security repo)
Building the images
The build process utilize a modified version of debian-cd which is also used to create the official Debian relase images. To get the modified version you have to run the patch-debian-cd script in the src/build/CD-administrator directory of your workingcopy.
For every suite you build you need to create a target directory where the images are copied to at the end. To create the target directory for etch-test-amd64 do:
mkdir -p /var/www/ftp.skolelinux.org/cd-etch-test-amd64
Go to src/debian-edu and run dpkg-checkbuilddeps and install any build dependencies.To build the images you only need to run make inside the src/build/CD-administrator dir of your workingcopy. Normally make will build (or at least try to) all images which are named under suites at the head of the Makefile. If you don't want to build all images take care to only name the one you need (for example using suite variable).