view · edit · print · history

KNOPPIX remastering project

Note: You should be fairly comfortable using the commandline environment. Also, root access is required for the majority of these commands. Use the su command.

Project contents

  1. Quick steps
  2. Set up a brewbox
    1. Boot KNOPPIX 3.6
    2. KNOPPIX network configuration
    3. Create partitions
    4. Set up and enable swap space
    5. Create and mount filesystems
    6. Set up development directories
    7. Copy working XF86Config-4 file
    8. Exit the GUI environment
  3. Customize the LiveCD
    1. Chroot to the source directory
    2. Verify network configuration
    3. apt-get update
    4. Set up the knoppix user
    5. Start the GUI environment
    6. Package management and system configuration
    7. Clean up the source
    8. Leave the chroot environment

Set up a brewbox

Boot KNOPPIX 3.6

Insert a KNOPPIX 3.6 CD and boot from the CD-ROM. KNOPPIX 3.6 contains all the tools you need to remaster a custom KNOPPIX kit. We salvaged from a couple spare-parts boxes (also known as Timmy and Donny) for our brewbox, so you don't really need anything special hardware wise. We used the KNOPPIX cheat knoppix desktop=fluxbox at boot to enter the Fluxbox window manager. You will need a copy of a working /etc/X11/XF86Config-4 for your development environment. We let KNOPPIX do all the work at boot. You will need a terminal.

KNOPPIX network configuration

There is no DHCP server on this network so we used netcardconfig to configure IP settings. Also, you can manually use ifconfig, route, and edit /etc/resolve.conf.

Create partitions

Create a large Linux swap partition and a large Linux partition using the command fdisk /dev/hda. Here is what the partition table looked like for us using the p command in fdisk:

 Disk /dev/hda: 20.0 GB, 20020396032 bytes
 255 heads, 63 sectors/track, 2434 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes


    Device Boot     Start       End       Blocks     Id  System
 /dev/hda1              1       125      1004031     82  Linux swap
 /dev/hda2   *        126       748      5004247+    83  Linux

Set up and enable swap space

The mkswap /dev/hda1 command will set up a Linux swap area. This needs to be done after you create the swap partition with fdisk. Once the swap area is created, you can use swapon /dev/hda1 to enable the swap. We verified the swap addition using cat /proc/swaps like:

 Filename                        Type            Size    Used    Priority
 /dev/hda1                       partition      1004020     0    -1

Create and mount filesystems

The mkfs.ext3 /dev/hda2 command will create an ext3 filesystem on the /dev/hda2 partition. We needed to do this after we created the linux partition with fdisk. We then mounted the partition with mount -t ext3 -rw /dev/hda2 /mnt/hda2. You can verify the new mount point by typing mount with no other parameters. You should see something similar to this:

 /dev/hda2 on /mnt/hda2 type ext3 (rw)

Set up development directories

First, mkdir /mnt/hda2/knx to create a base directory for developing your LiveCD. You will have to create two subdirectories for your master and source. Each subdirectory must have a KNOPPIX subdirectory in it. You can use these commands:

  • mkdir -p /mnt/hda2/knx/master/KNOPPIX
  • mkdir -p /mnt/hda2/knx/source/KNOPPIX

mkdir with -p will make directories as needed. Next, the KNOPPIX files are copied into the source/KNOPPIX directory using cp -Rp /KNOPPIX/* /mnt/hda2/knx/source/KNOPPIX. -R will cause cp to copy recursively, and -p will preserve file attributes. This will take a minute or twenty.

Create the file index.html use touch /mnt/hda2/knx/master/index.html. Next, cp -Rp autorun.bat autorun.inf autorun.pif boot/ cdrom.ico /mnt/hda2/knx/master/.

Copy working XF86Config-4 file

cp /etc/X11/XF86Config-4 /mnt/hda2/knx/source/KNOPPIX/etc/X11/ so that startx will work in the development environment.

Exit the GUI environment

Next, we switched from the GUI environment or run-level 5 to the console using init 2.

Customize the LiveCD

Chroot to the source directory

chroot /mnt/hda2/knx/source/KNOPPIX/ will start a new shell using /mnt/hda2/knx/source/KNOPPIX/ as the root directory. Next, mount -t proc /proc proc. /proc is a filesystem that contains special files which represent the current state of the kernel.

Verify network configuration

We started the SSH server using sshstart. Verify that /etc/resolve.conf has the correct nameserver setting. Remember /etc/resolve.conf is actually /mnt/hda2/knx/source/KNOPPIX/etc/resolve.conf outside the chroot environment. Our resolve.conf looks like this:

 # Insert nameservers here
 # nameserver 127.0.0.1
 nameserver 192.168.0.1

We test our network connection with ping google.com and/or lynx http://www.google.com.

apt-get update

apt-get update resynchronizes package indexes from the Internet. /etc/apt/sources.list contains a list of sources for packages. We had some failures with apt-get update until we removed some java related sources in /etc/apt/sources.list.

Set up the knoppix user

The knoppix user will need a home directory. cp -R /etc/skel /home/knoppix will copy the skeleton directory to the knoppix's home directory. /etc/skel is typically copied into a user's home directory when the user account is created. chown -R knoppix:knoppix /home/knoppix/ will give the knoppix user and group ownership of the /home/knoppix/ directory. Now, you can su knoppix into a knoppix user shell.

Start the GUI environment

The WINDOWMANAGER shell environment variable tells startx which window manager program to use. export WINDOWMANAGER="/usr/bin/fluxbox" is what we used. Now you can run startx.

Package management and system configuration

dpkg-query -l will list all the packages installed on the system. However, you may want to order the package list by size using dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -n. You can use apt-get remove <nameofpackage> to remove a package from the system. You can add packages to a kicklist and run apt-get commands using the list. Each package name goes on a seperate line in the file. Examples of these commands are:

  • apt-get install tinc
  • apt-get install `cat install_list.txt`
  • apt-get remove kde-i18n-de
  • apt-get remove `cat remove_list.txt`

Note: `cat remove_list.txt` uses the backtick and not a single quote.

Now you can change almost any of the configurations. Most of our changes are to the GUI environment and virtual private networking configurations. This is the area where you will need to be most familiar with installing, configuring, and removing software.

Clean up the source

We got out of Flubox using CTRL-ALT-BACKSPACE. Use exit to leave the su knoppix shell. We moved the /home/knoppix/ directory into /etc/skel using mv -R /home/knoppix/ /etc/skel/. These files should be owned by root. Use chown root:root /etc/skel/.

Leave the chroot environment

First, you need to unmount /proc. Leaving this mounted can cause problems. The command is umount /proc. To exit the chroot environment, press CTRL-D.

Tips

  • 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)
  • The X background file is /cdrom/KNOPPIX/background.gif (in knoppix 3.4: background.jpg)

Quick steps

  • Boot KNOPPIX 3.6 using the knoppix desktop=fluxbox cheat.
  • Configure and verify network settings using DHCP, netcardconfig, ping, and lynx.
  • mount -t ext3 -rw /dev/hda2 /mnt/hda2.
  • cp /etc/X11/XF86Config-4 /mnt/hda2/knx/source/KNOPPIX/etc/X11/
  • init 2
  • chroot /mnt/hda2/knx/source/KNOPPIX/.
  • mount -t proc /proc proc. /proc.
  • Verify /etc/resolve.conf and network settings.
  • sshstart
  • apt-get update
  • cp -R /etc/skel /home/knoppix
  • chown -R knoppix:knoppix /home/knoppix/
  • su knoppix
  • export WINDOWMANAGER="/usr/bin/fluxbox"
  • startx
  • Manage packages and configure settings
  • CTRL-ALT-BACKSPACE
  • exit
  • mv -R /home/knoppix/ /etc/skel/
  • chown root:root /etc/skel/
  • umount /proc
  • CTRL+D

Project members

References

Nixes changes · ALL changes
Page last modified on February 08, 2005, at 10:03 PM