Knoppix Remastering Howto Deutsch


From Knoppix Documentation Wiki
Revision as of 22:26, 26 February 2012 by Werner P. Schulz (Talk | contribs)

Jump to: navigation, search

Übersetzung noch nicht fertig.


Dieser Leitfaden ist eine Übersetzung der englischen Version von Knoppix_Remastering_Howto, jedoch ohne den Zusatzteil mit den nicht von mir überprüften weiteren Anleitungen Knoppix_Remastering_Howto#Old_stuff_of_this_HowTo

Dies HowTo beschreibt, wie Knoppix nach der alten "chroot-Methode" remastert werden kann. Die Scripte von "Instructions" bis "Remastering the ISO" wurden mit Knoppix V6.7.1CD getestet. Bitte keine alten Knoppix-Versionen benützen!

Instructions

Vorbereitung zum Remaster

  • Boote mit Knoppix CD
  • Ein Terminal öffnen und "su" eingeben, um root zu werden.
  • Internet-Verbindung einrichten. Wenn DHCP verwendet wird, sollte bereits alles von allein konfiguriert sein (mit ifconfig überprüfen).
  • Lege die Partition fest, mit der du arbeiten willst und ändere die Variable "PFAD" innerhalb der Scripte wie Du sie brauchst. Im Beispiel hier wird /media/sda1 verwendet. Die Partition sollte mindestens einen freien Platz von 5 GB zum remastern einer CD und 20 GB zum remastern einer DVD haben.
  • Das erste Script macht alle notwendigen Vorarbeiten:
 #! /bin/sh
 # Path to partition you will work on
 PFAD="/media/sda1"
 START=$(date +'%s')
 # Disable screensaver
 xscreensaver-command -exit
 # One sub-directory will be used for the Master-CD
 mkdir -p $PFAD/knx/master
 cd $PFAD/knx
 # You will need a swapfile
 dd if=/dev/zero of=swapfile bs=1M count=500
 mkswap swapfile ; swapon swapfile
 free -m
 # Make a sub-directory for the source
 mkdir -p $PFAD/knx/source/KNOPPIX
 echo "Copy the KNOPPIX files to your source directory."
 echo "This will take a long time!"
 cp -rp /KNOPPIX/* $PFAD/knx/source/KNOPPIX
 echo "rsync"
 # Additionally, copy the files to build the ISO later
 rsync -aH --exclude="KNOPPIX/KNOPPIX" /mnt-system/* $PFAD/knx/master
 # gunzip inital RAM-disk
 mkdir -p $PFAD/knx/minirt/minirtdir
 cp $PFAD/knx/master/boot/isolinux/minirt.gz $PFAD/knx/minirt/
 cd $PFAD/knx/minirt/
 gunzip minirt.gz
 cd minirtdir
 cpio -imd --no-absolute-filenames < ../minirt
 # Enable screensaver
 su knoppix -c "xscreensaver -nosplash &"
 echo -e "\nFinished! Used time: $(expr $(expr $(date +'%s') - $START) / 60) min. \
 and $(expr $(expr $(date +'%s') - $START) % 60) sec."

Setup the environment for chroot

  • Benutze dies Script bevor in die chroot-Umgebung gewechselt wird:
 #! /bin/sh
 # Path to partition you will work on
 PFAD="/media/sda1"
 # To use the Internet add your nameserver into the chroot folder
 cp /etc/resolv.conf $PFAD/knx/source/KNOPPIX/etc/resolv.conf
 # Allow X-based programs in chroot
 [ -e $PFAD/knx/source/KNOPPIX/home/knoppix/.Xauthority ] \
   && rm $PFAD/knx/source/KNOPPIX/home/knoppix/.Xauthority
 cp /home/knoppix/.Xauthority $PFAD/knx/source/KNOPPIX/home/knoppix
 chown knoppix:knoppix $PFAD/knx/source/KNOPPIX/home/knoppix/.Xauthority
 # prepare enviroment for chroot
 mount --bind /dev $PFAD/knx/source/KNOPPIX/dev
 mount -t proc proc $PFAD/knx/source/KNOPPIX/proc
 mount -t sysfs sysfs $PFAD/knx/source/KNOPPIX/sys
 mount --bind /dev/pts $PFAD/knx/source/KNOPPIX/dev/pts
 mount --bind /tmp $PFAD/knx/source/KNOPPIX/tmp

Working in the Chroot Environment

  • Jetzt das "chroot" zur Kopie von KNOPPIX:
 chroot /media/sda1/knx/source/KNOPPIX
  • Remember that anything you do or create in the chrooted environment will get burned to the CD.
  • Within the chroot you can also start X-based programs from command line of the terminal.
  • Type "su knoppix" to become user knoppix; use "Strg D" to be root again.
  • Update your package list with: apt-get update
    • Warning: apt-get upgrade is a BAD IDEA. It will, quite probably, render your KNOPPIX remaster unbootable, or broken in some way. A far safer method is to only upgrade packages as necessary.
    • Before you can add stuff, you will probably need to remove some packages.
  • To get a list of packages installed, you can use kn-what to get lists sorted by size etc.

Leaving the Chroot

  • Press CTRL+D to leave being chrooted; then use this schript:
 #! /bin/sh
 # Path to partition you will work on
 PFAD="/media/sda1"
 for i in dev/pts proc sys dev tmp; do
   umount $PFAD/knx/source/KNOPPIX/$i
 done
 sed -i '2,$d' $PFAD/knx/source/KNOPPIX/etc/resolv.conf

Changes outside from chroot enviroment

  • If you want another way to start with Knoppix, make changes in '/media/sda1/knx/master/boot/isolinux/isolinux.cfg':
    • for example replace all 'tz=localtime' with 'tz=America/New_York'
  • You can append in this file cheatcodes, which you need all the time:
    • for example write 'no3d' (without ' ') to each Append line, if you don't like compiz 3d
  • Read knoppix-cheatcodes.txt. You can find the newest version of this file on the Mirrors.
  • In '/media/sda1/knx/source/KNOPPIX/etc/X11/Xsession.d/45knoppix' you can find, which wallpaper Knoppix uses or which startup-sound.
  • In '/media/sda1/knx/source/KNOPPIX/etc/init.d/knoppix-halt' you'll find which sound you hear during shutdown.
  • Create a file '/media/sda1/knx/master/KNOPPIX/knoppix.sh' in order to start additional services.

Remastering the ISO

  • We've finished customizing and ready to burn!
 #! /bin/sh
 Path to partition you will work on
 PFAD="/media/sda1"
 START=$(date +'%s')
 # Disable screensaver
 xscreensaver-command -exit
 # Build new inital RAM-disk
 cd $PFAD/knx/minirt/minirtdir/
 find . | cpio -oH newc | gzip -9 > ../minirt.gz
 cp $PFAD/knx/minirt/minirt.gz $PFAD/knx/master/boot/isolinux/
 # Make the big  compressed filesystem KNOPPIX
 genisoimage -input-charset ISO-8859-15 -R -l -D -V KNOPPIX_FS -quiet \
   -no-split-symlink-components -no-split-symlink-fields \
   -hide-rr-moved -cache-inodes $PFAD/knx/source/KNOPPIX \
   | /usr/sbin/create_compressed_fs -q -B 65536 -t 8 \
   -f $PFAD/knx/isotemp - $PFAD/knx/master/KNOPPIX/KNOPPIX
 # Update the file hashes used by the "testcd" boot option
 cd $PFAD/knx/master ; find -type f -not -name \
   sha1sums -not -name boot.cat -not \
   -name isolinux.bin -exec sha1sum '{}' \; > KNOPPIX/sha1sums
 # Create new Knoppix ISO
 genisoimage -l -r -J -V "KNOPPIX" \
   -b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 \
   -boot-info-table -c boot/isolinux/boot.cat \
   -o $PFAD/knx/remasterd.iso $PFAD/knx/master
 # Enable screensaver
 su knoppix -c "xscreensaver -nosplash &"
 echo -e "\nFinished! Used time: $(expr $(expr $(date +'%s') - $START) / 60) min. \
 and $(expr $(expr $(date +'%s') - $START) % 60) sec. \
 \n\nThe new ISO is stored in '$PFAD/knx/remastered.iso' "
  • End of revised version of this HowTo

See also:


  • Adapted for V6.7.1 and without out-of-date stuff Knoppix Remastering Howto Deutsch