Friday, May 25, 2007

Setting up for Remastering

  1. Boot from the Knoppix CD
  2. Open a root shell:
    • Menu: Kmenu->Knoppix->Root Shell
    • Note: All commands below are run from this root shell.
  3. Configure your Internet connection (we'll need this later). If you use DHCP, it should already be configured.
    • Note: Run ifconfig to check.
  4. Find the partition you will use to work on. In this example it is called hda1 . The partition should have a minimum of 3 GB free space
  5. Mount the partition:
    • mount -rw /dev/hda1 /mnt/hda1
    • Note: Make sure that it is read/write or you will get errors when you later chroot. To check: run mount
  6. Create a root directory to work in -- if you put all your files here it will be easy to clean up
    • mkdir /mnt/hda1/knx
  7. If you don't have 1 GB RAM (egrep "(MemTotal|SwapTotal)" /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
  8. Make 2 directories, one for your new Master CD, one for the source, on a disk partition. Also, make additional directories under these named KNOPPIX:
    • mkdir -p /mnt/hda1/knx/master/KNOPPIX
      mkdir -p /mnt/hda1/knx/source/KNOPPIX
  9. Now, copy the KNOPPIX files to your source directory :
    • cp -Rp /KNOPPIX/* /mnt/hda1/knx/source/KNOPPIX
    • Note: This will take a long time (you are copying 2GB). Warning: you will be tempted to replace this copy command with a much faster procedure: create an empty directory, then use unionfs to merge the empty directory with /KNOPPIX in order to create the read-write copy. However, as of Knoppix 4.0.2, there is a bug in unionfs that causes this faster procedure to fail. For now, stick with the copy-command shown above.
  10. Additionally, copy the 'boot' folder from your cdrom - you'll need these files to build the ISO later.
    • cp -ar /cdrom/boot /mnt/hda1/knx/master/boot
  11. For Knoppix 5.0.1 you also have to copy the 'modules' folder:
    • cp -ar /cdrom/KNOPPIX/modules /mnt/hda1/knx/master/KNOPPIX/.
  12. Copy the main HTML page for the startup page:
    • cp /cdrom/index.html /mnt/hda1/knx/master/
  13. Copy everything necessary files except the ~700 Mb KNOPPIX file.
    • <>
    • cd /cdrom/KNOPPIX && find . -size -10000k -type f -exec cp -p --parents '{}' /mnt/hda1/knx/master/KNOPPIX/ \;
  14. >= 3.4:
    • cd /cdrom && find . -size -10000k -type f -exec cp -p --parents '{}' /mnt/hda1/knx/master/ \;
  15. for the DVD Version you have to use -size -15000k and copy the KNOPPIX2 folder like this
    • cp /cdrom/KNOPPIX/KNOPPIX2 /mnt/hda1/knx/master/KNOPPIX/
  16. setup the environment for chroot
    • mount --bind /dev /mnt/hda1/knx/source/KNOPPIX/dev
    • mount --bind /proc /mnt/hda1/knx/source/KNOPPIX/proc
  17. Now you can "chroot" into the copied KNOPPIX:
    • chroot /mnt/hda1/knx/source/KNOPPIX
  18. If you see errors regarding /dev/null, see the common problems section

You are now chrooted. "/" is actually "/mnt/hda1/knx/source/KNOPPIX"

No comments: