#!/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 "rm -rf /mnt/sda1/knx/source/KNOPPIX/.rr_moved" if rm -rf /mnt/sda1/knx/source/KNOPPIX/.rr_moved then echo "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" if 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 then echo "cd /mnt/sda1/knx/master" if cd /mnt/sda1/knx/master then echo "rm -f KNOPPIX/md5sums" if rm -f KNOPPIX/md5sums then echo "find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin -exec md5sum '{}' \; >> KNOPPIX/md5sums" find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin -exec md5sum '{}' \; >> KNOPPIX/md5sums echo "mkisofs -pad -l -r -J -v -V \"KNOPPIX\" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o /mnt/sda1/knx/knoppix.iso /mnt/sda1/knx/master" if mkisofs -pad -l -r -J -v -V "KNOPPIX" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o /mnt/sda1/knx/knoppix.iso /mnt/sda1/knx/master then RETVAL="0" fi fi fi fi fi fi if [ "{RETVAL}" = "0" ] # no errors, formal shutdown then RETVAL="1" echo "cd /mnt/sda1/knx" if cd /mnt/sda1/knx then echo "swapoff swapfile" if swapoff swapfile then echo "sleep 60" sleep 60 echo "umount /mnt/sda1" if umount /mnt/sda1 then echo "sleep 60" sleep 60 RETVAL="0" fi fi fi else # errors, brute force shutdown echo "cd /mnt/sda1/knx" cd /mnt/sda1/knx echo "swapoff swapfile" swapoff swapfile echo "sleep 60" sleep 60 echo "umount /mnt/sda1" umount /mnt/sda1 echo "sleep 60" sleep 60 fi if [ "{RETVAL}" = "0" ] # print success or failure then echo "" echo "finishremaster finished successfully:" echo " /mnt/sda1 has been unmounted" echo " /mnt/sda1/knx/swapfile swap space has been deactivated" echo "" echo "the remastered iso image is:" echo " /dev/sda1/knx/knoppix.iso" echo "" else echo "" echo "finishremaster 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: finishremaster.txt,v 1.0 2005/03/08 08:49:02 conover Exp $ # $Log: finishremaster.txt,v $ # Revision 1.0 2005/03/08 08:49:02 conover # Initial revision #