Using and Customizing Knoppix
Pages: 1, 2, 3
Part 3. Making a New Bootable CD
After much work, you now have a working image of the Knoppix distribution on the hard drive, the file system has been copied, and you have the scripts and the requisite RAM. Creating a successful, bootable CD is the process of removing and adding packages, followed by fine-tuning services and the user's account configuration files. Let's make it happen!
Step 1: Upgrading and installing packages
The very first thing to do is to make sure that your distribution has the most recent libraries and security patches. You can do this with the network applications available from the live-CD distribution. My own preference is to use my original, native distribution. GNU/Linux, as Debian calls itself, is remarkable in its ease of applying updates and patches. Knoppix is just as easy, by virtue of its lineage. You just need to use the Debian package management utilities to update the OS.
Assuming you are connected to the Internet, on your
normal installation version of Linux, open a console as root and navigate to
the KNOPPIX_remastered directory. Run chroot to get a new root directory:
bash-2.05# /usr/sbin/chroot ./
You may see a race condition consisting of /dev/null permission
denied messages. If that happens, remount the drive with the
nodev option set. Here's a sample configuration that I put in my
own fstab file:
/dev/hdc1 /mnt/linux ext2 (rw,nosuid,nodev) 0 0
You will also need to mount the /proc file system within
the console to allow Internet access and the use of such utilities
as screen:
bash-2.05# mount -t proc /proc proc
At this point, I always invoke the screen application, since I
always move from activity to another and end up running several jobs at the
same time (such as reading documentation while doing an upgrade). Before going
onto the Internet, assuming that you put your primary OS online before
chrooting, make sure the chrooted resolv.conf file has the correct
DNS entries for successful name resolution.
Updating the distribution will resynchronize the package index files from
their sources. Use the apt-get update command. Upgrading will
install the newest versions of all packages currently installed. You are now ready to install a package and all of its dependencies (though you may need to go to the Debian site to figure out the package name). Use the apt-get install <package
name> command.
Step 2: Removing what you don't want
The process of removing packages correctly is critical. Removing too little means you can't install what you want, due to space restrictions on the CD. Removing too much runs the risk of removing those packages that make the live-CD functional. The Knoppix site has a lot of information on the subject of remastering on the Knoppix site. The technique presented here is to remove packages via a kick list.
The kick list is an ordered list of my personal list of unwanted packages.
It is by no means the final word, so be prepared for a bit of experimentation
as you figure out what you do and don't want. Copy the list and place it inside
the chrooted root directory. The order of packages listed has been carefully
researched. Editing the text file is straightforward; packages near the top
do not have any packages dependent upon them. However, they themselves may be
depend on packages listed further down. When you're satisfied with the list of packages to remove, use the command:
bash-2.05# apt-get remove `cat ./mykicklist.txt`
An alternate command uses the purge switch to remove
configuration files specific to that package:
bash-2.05# apt-get purge `cat ./mykicklist.txt`
It is recommended to begin by removing only a small subset of packages; start with a small kick list. Don't worry if you make a mistake — you can use the same list to replace those removed packages:
bash-2.05# apt-get install `cat ./mykicklist`
If you would like to remove packages based on their size, then try this to see where you should start:
bash-2.05# dpkg-query -W --showformat='${Installed-Size} ${Package}\n' |
sort -nr | less
Running apt-get clean will free up disk space after you've
finished removing packages. You can run the scripts to make your compressed
file system once you're satisfied with your changes. The
remastering FAQ has more tips on removing and cleaning your installation.
Remember to unmount /proc when you've completed editing your
packages.
Step 3: Altering the desktop configuration
To tell you the truth, I love the Knoppix desktop and user interface setups, so I didn't change mine very much. But there will be times when you will want to change those defaulted user account settings. You can change user configurations in one of two ways:
Use the command-line options at boot time to tell the OS to read configuration instructions from a device such as a diskette.
Alter the following distribution configuration files that are invoked at boot time:
/etc/init.d/xsession /etc/init.d/knoppix-autoconfig /etc/init.d/knoppix-halt
Step 4: Running the scripts
You've fine-tuned the packages and configuration scripts. Now it's time to
see your creation work. If you haven't already done so, now is the time to
invoke createSwap.sh (if you need the swap) and to run the free
command to make sure you have 1GB of RAM. You will now cycle through the
following steps until you're satisfied with your creation:
Create the hard drive mounted version of the distribution by invoking testDistribution.sh.
Reboot the PC and test the prototyped distribution.
Make changes by rebooting back into your development environment.
I don't recommend making configuration adjustments while in the prototype distribution environment, because it's too easy to get confused between the files you want to change and those that are temporary and in RAM.
Once you are satisfied with your creation, invoke createLiveCD_iso.sh to create the self-booting isoimage,
knoppix.iso, which can then be burned to a CD-R.
Permanently Installing the Live CD Operating System onto the Hard Drive
Do you like what you've created? Would you like to put this on your machine permanently as a real installation? Guess what? You can! There is a utility on the Knoppix live-CD that will create and format a file system and a swap partition, and will mirror the CD's file system to the hard drive. What is especially cool about this process is that it will install a true home directory with the standard session logins that you'd find in any standard installation of Linux.
Running the knoppix-hdinstall command will invoke a script that
asks several questions, including where you want to install the distribution,
the swap partition, and the type of the filesystem (ext2, ext3, reiser, or
xfs). It will ask for user accounts that you may want to install, along with a
password. The script finally copies the entire compressed file system from the
CD onto the hard drive. Take note: there are no questions about configuring
graphics or selecting applications to installed. After all, that's the whole
point to this CD!
Conclusion
This article has just scratched the surface of what the Knoppix live-CD can do. Unfortunately the only published books on this distribution are in German. Although I've referenced Linux as the primary development platform, it is quite reasonable to extend this development environment onto other UNIX and Unix-like environments, such as Solaris and FreeBSD.
References
man Pages
fdisk, the partition table manipulator for Linuxresize2fs, theext2file system resizermke2fs, to create a Linux second extended file systemlosetup, to set up and control loop deviceslilo, to install the bootloaderlilo.conf, theliloconfiguration filemkswap, to set up a Linux swap areadd, to convert and copy a filefree, to display the amount of free and used memory in the systemswapon, to enable devices and files for paging and swappingswapoff, to disable devices and files for paging and swappingmkisofs, to create a hybrid ISO9660 filesystemchroot, to run a command or interactive shell with special root directoryscreen, a screen manager with VT100/ANSI terminal emulationapt-get, the APT package-handling utility
Robert Bernier is the PostgreSQL business intelligence analyst for SRA America, a subsidiary of Software Research America (SRA).
Return to the Linux DevCenter.
-
Customising ClusterKnoppix 3.6
2006-04-18 11:25:17 anie [View]
-
Tomcat
2004-04-28 03:51:55 gianfranco [View]
-
Morphix
2004-01-10 20:14:10 anonymous2 [View]
-
mount: you must specify the filesystem type
2003-12-27 22:04:58 anonymous2 [View]
-
mount: you must specify the filesystem type
2003-12-30 12:10:00 anonymous2 [View]
-
Troubleshooting
2003-12-22 14:32:00 anonymous2 [View]
-
Troubleshooting
2004-02-11 11:27:14 seqb [View]
-
An other better product is PCLinuxOS
2003-12-16 11:08:56 anonymous2 [View]
- Trackback from http://itc.uncc.edu/jason/weblog/archives/2003_12.html#002676
Remastering a Knoppix CD
2003-12-12 05:37:39 [View]
-
article
2003-11-26 20:13:38 anonymous2 [View]
- Trackback from http://blog.jwiz.org/archives/000726.html
Using and Customizing Knoppix
2003-11-22 22:08:53 [View]