REMASTERING KNOPPIX

C.L.U.E PRESENTATION

by

Dennis A. Dallas

March 8, 2005

WHY REMASTER?

Programs you need are not included

Knoppix is too big

You want to customize KDE

Impress friends and family

Improve Knoppix and 'give back' to the community

SYSTEM REQUIREMENTS

1 GB memory + swap

3 GB free diskspace (better is 5 GB)

CD / DVD read / write drive

Knoppix CD

KNOPPIX CD

APPROACH

Boot Knoppix26

Setup memory and disks

Configure KDE

Copy & modify Knoppix root file system – add & delete programs

Copy & modify Knoppix CD

Test image and burn CD

PREPARTION

Configure KDE desktop to your personal needs

Configue network

Configure samba, etc

Save configuration

Floppy or

Hard drive

PREPERATION CONTINUED

Go to root shell

$ mount -o rw /dev/hdan /mnt/hdan

Check memory

$ free (make sure memory + swap > 1 GB)

To make swap (if needed)

$ dd if=/dev/zero of=/mnt/hdan/swapfile bs=1M count=1000

$ mkswap /mnt/hdan/swapfile

$ swapon /mnt/hdan/swapfile

$ cd /mnt/hdan

PREPARE SOURCE FILE

$ mkdir source

$ mkdir source/KNOPPIX

$ cp -Rp /KNOPPIX/* source/KNOPPIX

Copies compressed file system – 1.9 GB

Can take a 10 minutes or more depending on read speed of cd drive

This is the file system that will be modified by adding / deleting programs

MODIFY SOURCE FILE

Add dynamically created files

$ cp /etc/dhcpc/resolv.conf source/KNOPPIX/etc/dhcpc/resolv.conf

$ chroot source/KNOPPIX

$ mount -t proc /proc proc

This provides access to your network

This make source/KNOPPIX the root file system

REMOVE PROGRAMS

Need to find large programs and remove them

$ dpkg-query -W -–showformat='${Installed-Size} ${Package}\n' | sort -n

This lists installed programs by size

Apt-get –purge remove package name

This removes a package and configurations

REMOVE PGMS CONTINUED

Good candidates

emacs21-common [42 meg]

kde-i18n* [203 m]

removes language support

ethereal-common [20 m]

enigma [10 m]

apache [8 m]

kstars* [20m]

ADD PROGRAMS

Be connected to the Internet

$ apt-get update

$ apt-get install package name

Or use rpm

Rpm -i rpm file name

CLEAN-UP STEPS

Clean cache

$ apt-get clean

Remove orphans

$ deborphan | xargs apt-get -y –purge remove

$ umount /proc

$ <CNTL> d or $ exit

This takes you back to normal mode

PREPARE MASTER CD FILE

This prepares the non-compressed files system

You should be at the root directory of your hard drive

$ mkdir master

$ rsync -a –exclude “KNOPPIX/KNOPPIX” /cdrom/ master/

This takes only a few minutes

ADD KDE CONFIGURATIONS

This needs to be done only if you have modified KDE settings

$ cp knoppix.sh master/KNOPPIX/knoppix.sh

$ cp configs.tbz master/KNOPPIX/configs.tbz

MAKE COMPRESSED FILE SYSTEM

This is the Knoppix root system

$ mkisofs -R -U -V “text” -publisher “text” -hide-rr-moved -cache-inodes -no-bak -pad source/KNOPPIX | nice -5 /usr/bin/create_compressed_fs – 65536 > master/KNOPPIX/KNOPPIX

This takes a long time [1 hr +]

There is a -b (for better option to create_compressed_fs – takes up to 10 times longer

CALCULATE MD5 SUMS

$ cd master

$ rm -f KNOPPIX/md5sums

$ find -type f -not -name md5sums -not -name boot.cat -exec md5sum {} \; >> KNOPPIX/md5sums

$ cd ..

MAKE BOOTABLE CD IMAGE

This creates the image that will be burned onto a cd

$ mkisofs -pad -l -r -J -v -V “KNOPPIX” -no-emul-boot -boot-load-size 4 -boot-info-table	-b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o knoppix.iso master/

TEST

The knoppix.iso file needs to be on an ext2 or Windows file system.

To change an ext3 file system to ext2

Unmount the disk

$ tune2fs -O ^has_journal /dev/hdan

To change an ext2 file system to ext3

Unmount the disk

$ tune2fs -j /dev/hdan

TEST CONTINUED

The basic idea is to boot Knoppix using the iso image file that you will be burning to cd

Use the original Knoppix cd to boot

$boot: knoppix26 bootfrom=/dev/hdan/knoppix.iso

If everything works correctly you can burn the cd

BURN CD

Use k3b program

tools|CD|Burn CD Image

Select iso9660 image type

Or use cdrecord

$ /usr/bin/cdrecord -v gracetime=2 dev=/dev/hdc speed=4 -dao -eject -data /knoppix.iso

RESOURCES

KNOPPIX HACKS – O'Reilly Press

http://www.knoppix.net/wiki/Knoppix_Remastering_Howto

http://www.knoppix.net/wiki/Remaster_From_Hd_Install_HowTo

http://featherlinux.berlios.de/remastering.html

konstantine a. dallas

2005-02-11T08:45:15