Preparing Knoppix


Before you can change Knoppix, you must get all the files on your Linux computer. Insert the Knoppix CD and mount it at /cdrom. Then run a command to create a subdirectory in your home directory that you'll use to store the CD's files:

 $ mkdir /home/scott/knoppixiso 

Now copy all the files from the Knoppix CD except for KNOPPIX/KNOPPIX:

 $ cp -r /cdrom/[a-z]* /home/scott/knoppixiso $ mkdir /home/scott/knoppixiso/KNOPPIX $ cp -r /cdrom/KNOPPIX/*.* /cdrom/KNOPPIX/images /home/scott/image from book    knoppixiso/KNOPPIX/ 

Note 

The author's directories are used in this project; you should substitute your own.

Now for the big boy: the compressed KNOPPIX/KNOPPIX file. As discussed in the preceding chapter, you can use the cloop kernel module if you've installed it. If Libranet, a Debian-based distro, did not come with that particular module, you can use the second method: the cloop command-line utilities. Are they on your machine?

 # whereis extract_compressed_fs 

Nope. If the whereis command can't find them, you need to install them. If you're using a Debian-based system, you can use APT, which makes it easy:

 # apt-get install cloop-utils 

After a minute or so, they're installed and ready to use. Then run the following command to extract the KNOPPIX/KNOPPIX file and get it on your hard drive:

 # extract_compressed_fs /cdrom/KNOPPIX/KNOPPIX > /tmp/knoppix.iso 

Note 

As cloop does its job, you'll see a lot of feedback on your screen, showing you each block as it's extracted. On a Pentium III 1GHz machine, it takes about five minutes to extract 30,728 blocks, which isn't too bad, except that the CPU has to run at nearly 100 percent the whole time, so you couldn't do a whole lot of other intensive work, other than read email. This might be a good time to get up and take a break.

When the extraction is complete, mount the KNOPPIX/KNOPPIX file as if it were a CD:

 # mkdir /tmp/mountdir # mount -t iso9660 /tmp/knoppix.iso /tmp/mountdir -o loop 

The files are available at /tmp/mountdir, so now you can copy them to another subdirectory in your home directory.

 $ mkdir /home/scott/knoppixuncompresssed # cp -a /tmp/mountdir/* /home/scott/knoppixuncompressed/ 
Caution 

You must run that cp command as root, or you will have problems later in this process! Yes, it's annoying to run one command as a normal user and one immediately thereafter as root; that's why you should use a terminal app such as Konsole, which provides tabs, or open two terminals, one as you and one as root, and switch between them with Alt+Tab.

After you've completed copying, clean up your filesystem before you move on to the fun stuff:

 # umount /tmp/mountdir # rm /tmp/knoppix.ixo 



Hacking Knoppix
Hacking Knoppix (ExtremeTech)
ISBN: 0764597841
EAN: 2147483647
Year: 2007
Pages: 118

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net