#!/bin/bash # # Script to remaster Knoppix 3.6; two scripts: # 1) startremaster, to initialize the source so that it can be # modified # 2) finishremaster, to make the iso image of the modified source # # To use: # 1) boot to the Knoppix 3.6 CDROM # 2) boot: knoppix lang=us # 3) copy the files startremaster and finishremaster to the # running Knoppix Live CD # 4) startremaster, to construct the source directory # 5) if things go well, modify the sources # 6) finishremaster, to construct the iso image of the modified # sources # 7) if things go well, burn the CDROM of the iso image of the # modified sources: # cdrecord -v -dev=0,1,0 -data /dev/sda1/knx/knoppix.iso # using whatever device your cd burner is on, (use "cdrecord # -scanbus" to find out) # 8) boot to the remastered Knoppix 3.6 CDROM # 9) boot: knoppix lang=us testcd # # There are two long duration processes: # 1) cp -Rp /KNOPPIX/* /mnt/sda1/knx/source/KNOPPIX, takes about 15 # minutes # 2) mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher \ # "KNOPPIX www.knoppix.net" -hide-rr-moved -cache-inodes \ # -no-bak -pad /mnt/sda1/knx/source/KNOPPIX | nice -5 \ # /usr/bin/create_compressed_fs -b - 65536 > \ # /mnt/sda1/knx/master/KNOPPIX/KNOPPIX, takes about 9 hours, # (about two hours omitting the -b option) # measured on a 466 Mhz. Pentium class machine. # # Acknowledgement: # # The script was made from information available at: # http://www.knoppix.net/wiki/Knoppix_Remastering_Howto # RETVAL="1" echo "cd /" if cd / then echo "mount -rw /dev/sda1 /mnt/sda1" if mount -rw /dev/sda1 /mnt/sda1 then echo "mkdir /mnt/sda1/knx" if mkdir /mnt/sda1/knx then echo "cd /mnt/sda1/knx" if cd /mnt/sda1/knx then echo "dd if=/dev/zero of=swapfile bs=1M count=1000" if dd if=/dev/zero of=swapfile bs=1M count=1000 then echo "mkswap swapfile" if mkswap swapfile then echo "swapon swapfile" if swapon swapfile then echo "mkdir -p /mnt/sda1/knx/master/KNOPPIX" if mkdir -p /mnt/sda1/knx/master/KNOPPIX then echo "mkdir -p /mnt/sda1/knx/source/KNOPPIX" if mkdir -p /mnt/sda1/knx/source/KNOPPIX then echo "cp -Rp /KNOPPIX/* /mnt/sda1/knx/source/KNOPPIX" if cp -Rp /KNOPPIX/* /mnt/sda1/knx/source/KNOPPIX then echo "cp /cdrom/index.html /mnt/sda1/knx/master/" if cp /cdrom/index.html /mnt/sda1/knx/master/ then echo "cd /cdrom" if cd /cdrom then echo "find . -size -10000k -type f -exec cp -p --parents '{}' /mnt/sda1/knx/master/ \;" find . -size -10000k -type f -exec cp -p --parents '{}' /mnt/sda1/knx/master/ \; RETVAL="0" fi fi fi fi if [ "${RETVAL}" != "0" ] # error, brute force shutdown then echo "cd /mnt/sda1/knx" cd /mnt/sda1/knx echo "swapoff swapfile" swapoff swapfile echo "sleep 60" sleep 60 fi fi fi fi fi fi if [ "${RETVAL}" != "0" ] # error, brute force shutdown then echo "umount /mnt/sda1" umount /mnt/sda1 echo "sleep 60" sleep 60 fi fi fi fi if [ "${RETVAL}" = "0" ] # print success or failure then echo "" echo "startremaster finished successfully:" echo " /mnt/sda1 is still mounted" echo " /mnt/sda1/knx/swapfile swap space is still active" echo "" echo "optionally:" echo " chroot /mnt/sda1/knx/source/KNOPPIX" echo " mount -t proc /proc proc" echo "" echo " make changes to /mnt/sda1/knx/source/KNOPPIX" echo "" echo " umount /proc" echo " Ctrl-D" echo "" echo "or make changes to /mnt/sda1/knx/source/KNOPPIX" echo "" echo "always:" echo " finishremaster" echo "" else echo "" echo "startmaster failed:" echo " /mnt/sda1 has been unmounted" echo " /mnt/sda1/knx/swapfile swap space has been deactivated" echo "" fi exit "${RETVAL}" # # A license is hereby granted to reproduce this software for personal, # non-commercial use. # # THIS PROGRAM IS PROVIDED "AS IS". THE AUTHOR PROVIDES NO WARRANTIES # WHATSOEVER, EXPRESSED OR IMPLIED, INCLUDING WARRANTIES OF # MERCHANTABILITY, TITLE, OR FITNESS FOR ANY PARTICULAR PURPOSE. THE # AUTHOR DOES NOT WARRANT THAT USE OF THIS PROGRAM DOES NOT INFRINGE THE # INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY IN ANY COUNTRY. # # So there. # # Copyright (c) 1992-2005, John Conover, , All # Rights Reserved. # # $Revision: 1.0 $ # $Date: 2005/03/08 08:49:02 $ # $Id: startremaster.txt,v 1.0 2005/03/08 08:49:02 conover Exp $ # $Log: startremaster.txt,v $ # Revision 1.0 2005/03/08 08:49:02 conover # Initial revision #