Knoppix
From Cheatsheet
This section will primarily be about remastering knoppix, a LiveCD distro based on Debian/KDE which doesn't normally boot off a hard drive, but you can respin it so it does, if for some reason you find yourself wanting to do that. There is a howto on it here, this will be just for me to chronicle the gotcha's while actually doing it.
1. I'm using VMWare because it's a bit simpler
- host is a laptop running duo core AMD 2G 64bit CPU's with 3G RAM, Ubuntu as a host OS
2. I'm creating a knoppix VM and then turning it on, letting it boot, making a hard partition formatted and then "installing" it there after some fancy stuff
gotcha: use the DVD, it's bloated, but it has the qt libs on it.
3. knoppix will see whatever disk you've created and show it on the desktop, but you still have to format it and mount it
fdisk /dev/sda mkfs -t ext3 /dev/sda1 mkdir /mnt/sda1 mount -t ext3 /dev/sda1 /mnt/sda1
4. now you create the directory structure to use as a SOURCE and also a BUILD directory, so you have to copy the Knoppix files to your SOURCE and then select packages and then create the stuff in your BUILD directory, that's what you'll be mastering the CD/USB with. first you have to mount some stuff and then chroot into your environment
mount --bind /proc /mnt/hda1/knx/source/KNOPPIX/proc mount --bind /sys /mnt/hda1/knx/source/KNOPPIX/sys chroot /mnt/hda1/knx/source/KNOPPIX
5. Delete extra packages, you can find out the big packages installed by running
dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | grep -v deinstall | sort -n | awk '{print $1" "$2}'
here's the packages I uninstalled
apt-get remove --purge lazarus crystalspace mysql-server-5.0 evolution evolution-common sun-java5-bin\ openoffice.org-core wine axiom inkscape planetpenguin-racer-extras foomatic-db-gutenprint fp-docs\ wireshark-common eclipse pari-extra openoffice.org-common foomatic-db emacs21-common eclipse-source\ icedove maxima frozen-bubble-data freepats lilypond-doc texlive-fonts-extra valgrind wpolish emacs22\ xemacs21 xemacs21-basesupport doc-linux-html quantlib-refman-html gnome-user-guide stellarium-data\ grass-doc qemu amarok amarok-engine iceape-browser gnome-games-data wordnet-base gimp gimp-data\ gimp-help-common r-cran-mapdata tuxpaint-stamps-default scribus sbcl octave2.9\ apache* mysql* php* gcompris* erlang* koffice* lyx* octave* mono-xsp mono-xsp-base nvu vzrpm*\ sunbird* gnucash* dasher* grass kmymoney* kopete* mysql* nessus* gambit* konversation* pidgin*\ bacula* tora ekiga mplayer* postgresql* sqlite3 squid* audacious* compiz* xaos* texmacs*\ elinks kalarm* kcalc amanda* dvdauthor ksnake kgames rosegarden* ruby-examples libruby1.8\ quantlib-ruby libreadline-ruby1.8 scribus* openhackware* playmidi pmidi kturtle rubber gocr\ clamav* cups-pdf cupsconfig-knoppix cupsys cupsys-bsd cupsys-client cupsys-common unixodbc\ cupsys-driver-gutenprint ldap-utils python-ldap selfhtml dia dia-common dia-gnome dia-libs\ planner planetpenguinracer* atlas2-base atlas3-base atlas3-base-dev atlas3-headers
now remove the unneeded stuff
apt-get autoremove
6. now scp the files you need to load to wherever you want to load them.
7. edit your /etc/dhcpc/resolv.conf file so it matches the one in your host OS, then see if the internet works
vi /etc/dhcpd/resolv.conf ping yahoo.com
8.
- unmounting and making your .iso
umount /proc ctrl+D to leave the chroot
- now remove some spare junk files
rm -rf /mnt/hda1/knx/source/KNOPPIX/.rr_moved
- now you have to compress the iso file system, the wiki has 3 different ways to do it, but the second one is the only one I can get to work so far, #1 give a bad compression error, and I'm not sure about #3. Also, you really need about 6-7G of swap, so don't even try this if you don't, it will fail in wierd ways. You can change the filesystem label and publisher to whatever you want. Best case this could take 30 minutes, or much longer depending on system speed/memory.
mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix.net" \ -hide-rr-moved -cache-inodes -no-bak -pad /mnt/hda1/knx/source/KNOPPIX \ | nice -5 /usr/bin/create_compressed_fs -B \ 65536 -f /mnt/hda1/isotemp - /mnt/hda1/knx/master/KNOPPIX/KNOPPIX
- now you have to make md5sums of stuff
cd /mnt/hda1/knx/master
find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin \
-exec md5sum '{}' \; > KNOPPIX/md5sums
- then make the actual .iso like this
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 /mnt/hda1/knx/knoppix.iso /mnt/hda1/knx/master
which will give you a knoppix.iso here
/mnt/hda1/knx/knoppix.iso
