Two HOWTOs are provided which describe how to build a Quantian cdrom, and how to boot it directly from hard disk via the lilo bootloader. This page corresponds to quantian 0.2 and needs to be updated for 0.3; but nothing fundamental has changed.

This is a non-edited copy of the crib sheet I kept. It lists all major steps; in or two instances minor editing is involved which is not fully documented here but clear from the context.

#!/bin/sh

# parts from   http://www.stirnimann.com/mystuff/doc/knoppix.txt
# parts from   Linux Gazette article by Sunil Thomas Thonikuzhivil
#              http://tldp.org/LDP/LG/issue87/sunil.html
# also see     http://www.knoppix.net/docs/index.php/KnoppixRemasteringHowto

cd ~/src/debian/Quantian

## create (monstrously large) swapfile
## -- turns out that that is not needed on our 1gb ram box
#dd if=/dev/zero of=swapfile bs=1024 count=2000000
#mkswap swapfile
#swapon swapfile

## mount the compressed file from inside the iso, or cdrom
mount -t iso9660 -o ro,loop=/dev/loop0 knopper.net/KNOPPIX_V3.2-2003-05-20-EN.iso /cdrom

## copy cdrom image to hard disk
[ ! -d orig-cdrom ] && mkdir orig-cdrom
cp -Rapv /cdrom/* orig-cdrom/
## umount iso image
umount /cdrom

## uses cloop module, compiled for 2.4.20 on homebud, 2.4.21-rc1 on chibud
## seems to create problems on chibud though
insmod cloop file=orig-cdrom/KNOPPIX/KNOPPIX

## after mounting the system is visible in uncompressed/
[ ! -d uncompressed ] && mkdir uncompressed
mount -o ro /dev/cloop uncompressed

## copy out of the uncompressed-on-the-fly knoppix system
[ ! -d source ] && mkdir source
cp -Rapv uncompressed/* source/

## umount compressed image, and release cloop module
umount /dev/cloop
rmmod cloop

## at this point, du -kcs shows
## Knoppix 3.2:  2103356

## chroot into copied and expanded Knoppix
chroot source/
mount -t proc proc /proc
umount /proc/bus/usb

## cleanup
vi /etc/mtab			# to remove what Klaus Knopper had mounted
vi /etc/resolv.conf		# to get a nameserver
vi /etc/apt/apt.conf 		# to use unstable, not testing for Quant stuff

## mount local apt archive over NFS [ my server is at 192.168.1.8 ]
mount 192.168.1.8:/var/cache/apt/archives /var/cache/apt/archives

## make room
# sort by size
grep-status -FStatus -sInstalled-Size,Package -n \
           "install ok installed" | paste -sd "  \n" | sort -n
## openoffice
## -- then down to 1888380
dpkg --purge openoffice-de-en ttf-openoffice
rm -rv /usr/share/fonts/truetype/openoffice
## large internationalization data
## -- down to 1767360
dpkg --purge `grep-status -F Package -s Package -n i18n`
## windows emulator
## -- down to 1739920
dpkg --purge `grep-status -F Package -s Package -n wine`
## games
## -- down to 1670796
dpkg --purge freeciv falconseye-data fb-music-high rocks-n-diamonds \
	frozen-bubble frozen-bubble-data enigma falconseye xboing \
	chromium chromium-data xboard kasteroids freeciv-gtk \
	netris fortune-mod fortunes-min gnuchess kteatime \
	xbattle kbounce ksokoban xskat \
	koules xgalaga gtans libkdegames1 kreversi kbattleship \
	kmahjongg imaze ace-of-penguins \
	freeciv-data freeciv-client-gtk freeciv-server

## gimp, but libgimpprint and lingimp1.2 stay
## -- down to 1646896
dpkg --purge gimp1.2 gimp1.2-nonfree gimp1.2-print
## festival (not in 3.2)
#dpkg --purge `grep-status -F Package -s Package -n fest`
## KEEP foomatic
#dpkg --purge `grep-status -F Package -s Package -n foomatic`
## lyx
## -- now down to 1626908
dpkg --purge `grep-status -F Package -s Package -n lyx`

## abiword
#dpkg --purge `grep-status -F Package -s Package -n abiword`
## isdn, ppp, "comm"
#dpkg --purge `grep-status -F Package -s Package -n isdn`
#dpkg --purge isdnutils-base libcapi20 ipppd pppdcapiplugin ibod ipppd
#dpkg --purge `grep-status -F Package -s Package -n ppp`
#dpkg --purge ppp wvdial pptp-linux xtel
#dpkg --purge `grep-status -F Section -s Package -n comm`
## and some large ones
#dpkg --purge scotty asc freeciv locales libopenh323-1.9.10 umognomemeeting  \
# freeciv-gtk

## a few large packages
## -- now down to 1594212
dpkg --purge qcad selflinux ding trans-de-en

## remove non-free incl. netscape and acrobat (mozilla, xpdf are in)
## -- that brings it to 1578868
dpkg --purge unp
dpkg --purge  `grep-status -s Package -F Section non-free -n `

## remove some extra window managers (keep fluxbox)
## -- now at 1609324
dpkg --purge larswm icewm-common icewm wmaker wmaker-data wmakerconf \
             wmakerconf-data xfce xfce-common

dpkg --purge manpages-de mozilla-locale-de-at user-de squid
dpkg --purge `deborphan`

## NOW we are at  1600372

## put the Quant back into Quantian
## from unstable, pulls in atlas, gcc-3.3, gnome stuff  -- 94.7mb
apt-get install r-base-dev r-mathlib r-recommended ess \
	r-cran-gtkdevice r-gnome r-omegahat-rgtk r-omegahat-ggobi \
	r-cran-rodbc r-cran-tseries r-cran-tkrplot
## 7.3mb
apt-get odbc-postgresql libmyodbc r-cran-coda r-cran-mcmcpack r-noncran-lindsey
## 41.3mb
apt-get install gsl-bin libgsl0-dev \
	quantlib-python libquantlib0-dev quantlib-examples r-cran-rquantlib \
        octave2.1 octave2.1-emacsen octave-ci octave-epstk \
	octave-forge matwrap octave-sp libinline-octave-perl
## 10.6mb
apt-get install gretl libgretl1-dev
## 0.4mb
apt-get install libstatistics-descriptive-perl libmath-numbercruncher-perl
## 87.5mb
apt-get install gperiodic rasmol pdl yorick gnuplot plotutils \
		aribas autoclass euler geg geomview \
		mcl multimix pari-extra pari-doc pari-gp \
		maxima xmaxima maxima-emacs maxima-share \
		pgapack pspp rcalc saml \
		scigraphica gnumeric-gda gnumeric-python
#kmatplot kmplot
# 10.8mb
apt-get install ginac-tools libginac-dev #ginaccint
# 129mb
apt-get install apcalc calc xlispstat yacas yacas-doc \
    		evolver freefem freefem-examples gambit gambit-doc gap \
		gap-core gap-small-groups gap-prim-groups gap-trans-groups\
		glpk lp-solve gmt gmt-doc-pdf gmt-tutorial mayavi
# 13.2
apt-get install texmacs
## back to testing
## 67.8mb
apt-get install dx dx-doc dx-dev dxsamples

# utilities
#apt-get install tramp jed xjed smtm

## Now we have 2057276

rm /etc/skel/Desktop/SelfLinux.desktop
vi /etc/skel/.kde/share/config/kickerrc # edit out OpenOffice entry
			# add /usr/share/applnk/Editors/Emacs_21.desktop

umount -t nfs -a
umount /proc			## Important !!

## trying X11 in the chroot
## - created some problems on server machine, so tar'ed up sources/ dir
##   and transferred to laptop
## - copied /etc/X11/XF86Config-4 from actual env.
## - had to add xfs settings on fontserver
## - shut down kdm on laptop
## - startx   et voila, kde 3.1 / knoppix 3.2


## getting Ready to master
cp source/usr/bin/create_compressed_fs .

##
## remember to undo resolv.conf, apt.conf, XF86-Config-4, ...
## clean out tmp, cache dirs, /etc/skel/, etc pp
##


## master the compressed image (slow, memory intensive)
mkdir release
mkdir release/KNOPPIX
## This take ~17mins and ~500mb ram on the dual Athlon 1800XP/1gb ram box
mkisofs -R -l -V "KNOPPIX iso9660 filesystem" -hide-rr-moved -v source/ \
	| create_compressed_fs - 65536> release/KNOPPIX/KNOPPIX

## master the iso
cp -vax orig-cdrom/KNOPPIX/b* orig-cdrom/KNOPPIX/[ikmrw]* \
        orig-cdrom/KNOPPIX/KNOPPIX-* \
	orig-cdrom/KNOPPIX/README_Security.txt release/KNOPPIX
cp -vax orig-cdrom/{Demos,LinuxTag,Makingof,Talks,auto*,index*,cdrom.ico} release
mkisofs -l -r -J -V "Quantian (KNOPPIX 3.2 20030520)" -hide-rr-moved \
	-v -b KNOPPIX/boot.img -c KNOPPIX/boot.cat -o Quantian.iso release/

## inspect the iso (it doesn't have the top-level autorun.bat stuff)
mount -t iso9660 -o ro,loop=/dev/loop0 Quantian.iso /cdrom

## if it's a cd-rw, blank it first
cdrecord blank=fast

## write
cdrecord -v -data Quantian.iso

echo Done
exit 0

Last modified: Tue Feb 10 12:50:32 CST 2004