![]() |
![]() |
Permission to use these pages kindly granted by www.knoppix.net. These pages are a static version of those available at www.knoppix.net. Please check there for the latest information. Converted on 9/5/2003. Thanks to the many contributors to www.knoppix.net! |
German Version: KnoppixRemasteringHowtoDeutsch
if you want to add a custom kernel, check out the KnoppixCustomKernelHowto
( notes : commands shown are on one line, so please maximize the window, if you have any comments/suggestions please post below )
You may wish to start from an already customized Knoppix, so you don't have to do so much work ( such as removing programs ), in which case, see KnoppixCustomizations
Boot from Knoppix CD
Configure your internet connection ( we'll need this later )
Open a root shell ( Kmenu->Knoppix->Root Shell ) - all commands below are run from this root shell
Find the partition you will use to work on. In this example it is called hda1 . The partition should minimum have 3 GB free space
Mount the partition: mount -o rw /dev/hda1 /mnt/hda1 (do it like this or you get errors when you later chroot)
Create a root directory to work in: mkdir /mnt/hda1/knx (put all your files here and it easy clean up)
If you don't have 1 GB RAM (cat /proc/meminfo (physical+swap)) then you will need a swapfile. cd /mnt/hda1/knx ; dd if=/dev/zero of=swapfile bs=1M count=750 ; mkswap swapfile ; swapon swapfile
Make 2 directories, one for your new Master CD, one for the source, on a disk partition. mkdir /mnt/hda1/knx/master; mkdir /mnt/hda1/knx/source
mkdir /mnt/hda1/knx/source/KNOPPIX
now, copy the KNOPPIX files to your source directory : cp -Rp /KNOPPIX/* /mnt/hda1/knx/source/KNOPPIX that will take a little while :)
mkdir /mnt/hda1/knx/master/KNOPPIX
cp /cdrom/index.html /mnt/hda1/knx/master/
now, copy everything in /cdrom/KNOPPIX/ to /mnt/hda1/knx/master/KNOPPIX/ except the 700 Mb KNOPPIX file. ( find . -size -100000 -type f -exec cp -p --parents {} /mnt/hda1/knx/master/KNOPPIX/ \; )
Now you can "chroot" into the copied KNOPPIX : chroot /mnt/hda1/knx/source/KNOPPIX
new - I get a whole lot of /dev/null permission denied errors, Update : fixed ! Well, check your mount status if you met the problem: mount /dev/hdaX on /mnt/hdaX type ext3 (rw,nosuid,nodev) (replace X with your partiton number ) where "nodev" means that you are not accessible on mounted filesystem and you can not access /dev/null. And some scripts get output redirect to /dev/null... To solve this you should mount the target partition before you do chroot
then you can carry on and chroot.
to remove some programs to free up space. apt-get remove "program" will remove that program.
When you want to autorun some programs, one can create a script and put it in the directory /etc/rc5.d/ (This only loads items before X loads)
interesting stuff in /etc/init.d/knoppix-autoconfig :
interesting stuff in /etc/init.d/xsession :
Now, onto creating the ISO file :
the "www.knoppix.net" and "Knoppix.net filesystem" can be changed to what you want to call the file. You will get an error that it doesn't conform to ISO standards, you can ignore this.
If you are looking for big installed packages then the command
dpkg-awk "Status: .* installed$" -- Package Installed-Size| awk '{print $2}' | egrep -v '^$' | xargs -n2 echo | perl -pe 's/(\S+)\s(\S+)/$2 $1/' | sort -rg
will list the packages with size in descending order.
If you have trouble with the above sort command, try using KPackage, expanded all the trees and sorted by the size column to find big packages.
Check out the program "deborphan", it will list orphaned packages that you can remove, these packages were used by packages that are now removed.
I have had good results remastering working from the cd as root working from fluxbox.Just say "knoppix 2" at the boot prompt and it will boot you to a root prompt where you can then say "startx /usr/bin/fluxbox".I like to use the xterm unicode shell.
While working chroot doing the remastering I like to use "apt-get remove pkg-name" to remove packages because before it does anything it will stop and show detials on what it is fixing to remove and let you say "yes or no".Then later I clean up my pkg list by saying "dpkg -l |grep ^rc" and to anything that shows up I say dpkg -P pkg-name".
Thats it. This is an updated version of my previous howto. This is not meant for linux beginers, you will need to know your way around linux... to get this to work. I'll update this as corrections/improvemtns/etc come through.
Thanks to aay, charan, Tech2k, and #knoppix for some corrections and tips and ideas feel free to edit or add to this howto.
Note about swap:
You don't realy need 1G swap as there are two new tools to create compressed filesystems. Here are some cadidates for make_compressed_fs:
If my howto is too confusing, or you'd like a second opinion, check out charan's very nice remastering howto : http://gnubox.dyndns.org:8080/~sunil/knoppix.php .
Another Howto is at
http://www.stirnimann.com/mystuff/doc/knoppix.txt
Be sure to check out the Knoppix Customization Forum for ideas and help with remastering.