# # $Id: remastering-local.txt,v 1.46 2004/09/22 01:02:34 quozl Exp $ # # Instructions for remastering using two hosts; one always-up Linux # system, and a test system booted occasionally. # # The first system, called the remastering host, should be generously # configured, running Debian GNU/Linux, with at least 3Gb of free disk # space and a CD burner. A chroot shell on this host will be used as # the remastering environment. The host should include a DHCP server, # Apache server, an external internet connection and apt-proxy. # # The second system, called the test host, should be CD bootable and # connected via network to the remastering host. It will be used to # obtain the Knoppix filesystem from the distribution CD, and to test # booting of the remastered Knoppix CD burned by the remastering host. # The hard disk of the test host will not be used; unless a swap # partition is available. # # Last validated on 18th September 2004 against # http://mirror.aarnet.edu.au/pub/knoppix/KNOPPIX_V3.6-2004-08-16-EN.iso # # ========================================================================== # Procedure: # 0. prep the cc03 package repository in a http accessible place. # 1. configure remastering host by freeing 3Gb of space # 2. boot test host using original Knoppix CD # 3. use rsync to copy the filesystems to remastering host # (shutdown test host at this point if no longer required) # 4. make changes to the inner filesystem using chroot # 5. make changes to the outer filesystem # 6. burn the filesystems to CD # 7. boot test host using remastered CD # ========================================================================== # # This file is a manually entered set of shell commands. exit # Use emacs sh-mode for appropriate syntax highlighting # Alt/X sh-mode # ========================================================================== # 1. configure remastering host by freeing 3Gb of space # # The space is required to hold the filesystems during the process # ... once the filesystems are set up, they can be re-used for further # refinements of the remastered CD. If space is available (6Gb) then # a second unchanged copy would be valuable for comparison and # restoration. # ========================================================================== # 2. boot test host using original Knoppix CD # # Insert the Knoppix CD into the test host and boot it from the CD. # If this does not happen without problems, it may be necessary to # find another test host or change the default command line during # remastering. # ========================================================================== # 3. use rsync to copy the filesystems to remastering host # # Rsync appears to be the most efficient copying method, as it does # not use encryption (like ssh), and handles interruption and # restarting intelligently. It also can be used to rapidly restore # the remastering filesystem back to virgin state. Other options are # tar, and recursive cp. # a. on test host text console (e.g. Control/Alt/F2), start ssh and # change root password (ssh is not normally started by Knoppix, su is # an alias for sudo, and the root password is not set. Without the # sshd started and the root password set, an ssh into the host will # not succeed.) sshstart # (you will be prompted for a password to the knoppix account, set it # to whatever you like - it is not used) passwd # (you will be prompted for a password to the root account, set it # to something - it is used by the next step only) # (at this point we have finished with the physical keyboard on the # test host and can return to the remastering host) # b. connect to test host from remastering host # (as root, in order to preserve permissions) . bin/cc03.conf cc03-fetch # (you will be prompted for the root password set above) # f. shutdown test host at this point if no longer required ... it # will next be required when the remastered CD has been created. # ========================================================================== # 4. make changes to the inner filesystem using chroot # a. begin the chroot'd environment . bin/cc03.conf chroot $CC03_PART/knx/source/KNOPPIX # Make it clear to us where we are export PS1="\[\e[1;36m\]\u@cc03[\W]\$\[\e[0;39m\] " # Fix for vim's startup speed. export DISPLAY= # b. mount the proc filesystem (it has to be unmounted later or a # remnant entry is left in /etc/mtab that may confuse future mounts, # allegedly) mount -t proc /proc proc # c. fix and test the name server resolution # (if you're on a network with DNS, that is ... allegedly the # /etc/resolv.conf created here finds its way onto the remastered CD # but is ignored because of the DHCP client query on boot) host www.lan || vi /etc/resolv.conf ping -c 2 www.lan # d. make customisation changes # adjust sources.list # (using HTTP allows access to filesystem outside our root, but # requires configuration of the web server for the paths used in the # sources list) cd /etc/apt if [ ! -f sources.list.knoppix ]; then mv --verbose sources.list sources.list.knoppix fi cat > sources.list.ut04.james < sources.list.ut04.final < /etc/timezone # remove any packages that no longer have dependents while [ -n "`deborphan`" ]; do deborphan echo dpkg --purge `deborphan` done # remove any configuration files saved by dpkg # find / -xdev -name "*.dpkg-old" -exec rm -i {} \; # clean system of any package files downloaded apt-get clean # run updatedb once to recreate index (1.25 minutes) updatedb # clean system of package installation e-mail rm -f /var/spool/mail/root # clean system of root .ssh configuration rm -rf /root/.ssh # clean system of package list files rm -f /var/lib/apt/lists/*_{Packages,Release} rm -f /var/lib/apt/lists/partial/*_{Packages,Release} rm -rf /tmp/* # set sources.list to something USEFUL for campers after camp cd /etc/apt && ln -sf sources.list.ut04.final sources.list export http_proxy=http://proxy.lan:3128/ apt-get update # finished with changes to filesystem # umount /proc # exit chroot exit # ========================================================================== # 5. make changes to the outer filesystem # fix background image for cc03-graphics /bin/cp $CC03_PART/knx/source/KNOPPIX/usr/local/lib/knoppix.jpg \ $CC03_PART/knx/master/KNOPPIX/background.jpg # adopt boot image for cc03-graphics /bin/cp $CC03_PART/knx/source/KNOPPIX/usr/local/lib/logo.16 \ $CC03_PART/knx/master/boot/isolinux/logo.16 # remove the LinuxTag directory (and hence the desktop icon, per 45xsession) /bin/rm -rf $CC03_PART/knx/master/LinuxTag # ========================================================================== # 6. burn the filesystems to CD . bin/cc03.conf cc03-make # ========================================================================== # 7. boot test host using customised CD # optional pad packages apt-get install python2.3-doc doc-linux-html debian-installer-manual diveintopython # bookmarks en.wikipedia.org