-
Remastering Knoppix with Michael's scripts :-)
Since everyone seems to have a different way to remaster, here's my 2 euro cents. The three scripts below are taken from the ParallelKnoppėx CD. They use Xdialogs. The first copies the CD contents to HD. The second gets a CHROOT environment going, and the third creates the ISO image. I have used cute little devils to mark the beginning and end of each.

#!/bin/bash
# 1-CopySourceForRemaster copy the CD to HD for remastering
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
export PATH
XDIALOG_HIGH_DIALOG_COMPAT=1
export XDIALOG_HIGH_DIALOG_COMPAT
# Get root
[ "`id -u`" != "0" ] && exec sudo "$0" "$@"
TMP="/tmp/saveconfig.tmp$$"
bailout(){
rm -f "$TMP" "$TMP.done" "$TMP.err"
echo ""
echo "Done"
exit 0
}
DIALOG="dialog"
[ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"
trap bailout 1 2 3 15
# LANGUAGE etc.
[ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix
[ -z "$LANG" ] && export LANG
[ -z "$LANGUAGE" ] && export LANGUAGE
[ -z "$CHARSET" ] && export CHARSET
DESKTOPKB="$(du -sk $HOME/Desktop 2>/dev/null | awk '{print $1}')"
TITLE1="ParallelKnoppix: Copy source to HD for remastering"
MESSAGE1="Select a hard disk partition on which the source should be copied.
A directory called parallel_knoppix_remaster will be created at the root level
of that partition. Which partition would you like to use? (about 2GB free space is needed)"
ERROR="That didn't work!"
# Directory selector
PARTITIONS=""
for i in `awk '/^\/dev\/[hs]d[a-z].*\/mnt\/[hs]d[a-z]/{if(!/ntfs/){print $2}}' /etc/fstab`; do
PARTITIONS="$PARTITIONS ${i} [Disk/Partition] off"
done
rm -f "$TMP"
Xdialog --clear --title "$TITLE1" --radiolist "$MESSAGE1" 18 75 9 $PARTITIONS 2>"$TMP" || bailout
ParKnoppixPART="$(<$TMP)"
[ -z "$ParKnoppixPART" -o ! -e "$ParKnoppixPART" ] && bailout
# mount the partition requested
rm -f "$TMP.err"
mount | grep -q "$ParKnoppixPART" || mount -r "$ParKnoppixPART" >"$TMP.err"
[ "$?" != "0" ] && { $DIALOG --title "$TITLE1" --msgbox "$ERROR `cat $TMP.err`" 10 75; bailout; }
mount | grep -q "$ParKnoppixPART.*ntfs" && { $DIALOG --title "$TITLE1" --msgbox "$ERROR NTFS" 10 75; bailout; }
mount -o remount,rw "$ParKnoppixPART"
# create the ParKnoppixPART, etc
mkdir $ParKnoppixPART/parallel_knoppix_remaster
export ParKnoppixDIR=$ParKnoppixPART/parallel_knoppix_remaster
# get rid of old, if it exists
rm -R -f $ParKnoppixDIR
# copy the new
mkdir $ParKnoppixDIR
mkdir $ParKnoppixDIR/source
mkdir $ParKnoppixDIR/source/KNOPPIX
mkdir $ParKnoppixDIR/master
mkdir $ParKnoppixDIR/master/KNOPPIX
mkdir $ParKnoppixDIR/master/boot
mkdir $ParKnoppixDIR/master/boot/isolinux
cp /cdrom/boot/isolinux/* $ParKnoppixDIR/master/boot/isolinux
cp -Rp /KNOPPIX/* $ParKnoppixDIR/source/KNOPPIX
cp /cdrom/index.html $ParKnoppixDIR/master/
# cp /cdrom/parallelknoppix.png $ParKnoppixDIR/master/
cd /cdrom/KNOPPIX/
find . -size -100000 -type f -exec cp -p --parents {} $ParKnoppixDIR/master/KNOPPIX/ \;
cp -a $ParKnoppixDIR/source/KNOPPIX/boot $ParKnoppixDIR/master
echo "Finish configuring desktop, then reboot normal distro"
echo "and proceed to chroot activities"
# final report
SUCCESS="OK, the ParallelKNoppix source is now on the HD, ready for remastering"
$DIALOG --title "$TITLE1" --msgbox "$SUCCESS" 12 65
bailout

#!/bin/bash
# 2-StartCHROOT: Start up a chroot environment in parallel_knoppix_remaster and do some stuff
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
export PATH
XDIALOG_HIGH_DIALOG_COMPAT=1
export XDIALOG_HIGH_DIALOG_COMPAT
# Get root
[ "`id -u`" != "0" ] && exec sudo "$0" "$@"
TMP="/tmp/saveconfig.tmp$$"
bailout(){
rm -f "$TMP" "$TMP.done" "$TMP.err"
echo ""
echo "Done"
exit 0
}
DIALOG="dialog"
[ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"
trap bailout 1 2 3 15
# LANGUAGE etc.
[ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix
[ -z "$LANG" ] && export LANG
[ -z "$LANGUAGE" ] && export LANGUAGE
[ -z "$CHARSET" ] && export CHARSET
DESKTOPKB="$(du -sk $HOME/Desktop 2>/dev/null | awk '{print $1}')"
TITLE1="ParallelKnoppix: Get into CHROOT environment"
MESSAGE1="This asks you where you copied the source, then gets you into a CHROOT
environment"
ERROR="That didn't work!"
# Directory selector
PARTITIONS=""
for i in `awk '/^\/dev\/[hs]d[a-z].*\/mnt\/[hs]d[a-z]/{if(!/ntfs/){print $2}}' /etc/fstab`; do
PARTITIONS="$PARTITIONS ${i} [Disk/Partition] off"
done
rm -f "$TMP"
$DIALOG --clear --title "$TITLE1" --radiolist "$MESSAGE1" 18 75 9 $PARTITIONS 2>"$TMP" || bailout
ParKnoppixPART="$(<$TMP)"
[ -z "$ParKnoppixPART" -o ! -e "$ParKnoppixPART" ] && bailout
# mount the partition requested
rm -f "$TMP.err"
mount | grep -q "$ParKnoppixPART" || mount -r "$ParKnoppixPART" >"$TMP.err"
[ "$?" != "0" ] && { $DIALOG --title "$TITLE1" --msgbox "$ERROR `cat $TMP.err`" 10 75; bailout; }
mount | grep -q "$ParKnoppixPART.*ntfs" && { $DIALOG --title "$TITLE1" --msgbox "$ERROR NTFS" 10 75; bailout; }
umount "$ParKnoppixPART"
mount -rw -nosuid -nodev "$ParKnoppixPART"
SUCCESS="The proper partition has been mounted with the needed options. Now an
xterm will open, chrooted to the KNOPPIX directory. You will need to follow the
directions in Remaster.html in there.
"
$DIALOG --title "$TITLE1" --msgbox "$SUCCESS" 12 70
/usr/X11R6/bin/xterm -e chroot $ParKnoppixPART/parallel_knoppix_remaster/source/KNOPPIX
umount "$ParKnoppixPART"
# final report
SUCCESS="Leaving chroot environment now. Bye."
$DIALOG --title "$TITLE1" --msgbox "$SUCCESS" 12 65
bailout

#!/bin/bash
# 3-MakeISO: make the ISO image of the remastered filesystem
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
export PATH
XDIALOG_HIGH_DIALOG_COMPAT=1
export XDIALOG_HIGH_DIALOG_COMPAT
# Get root
[ "`id -u`" != "0" ] && exec sudo "$0" "$@"
TMP="/tmp/saveconfig.tmp$$"
bailout(){
rm -f "$TMP" "$TMP.done" "$TMP.err"
echo ""
echo "Done"
exit 0
}
DIALOG="dialog"
[ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"
trap bailout 1 2 3 15
# LANGUAGE etc.
[ -f /etc/sysconfig/knoppix ] && . /etc/sysconfig/knoppix
[ -z "$LANG" ] && export LANG
[ -z "$LANGUAGE" ] && export LANGUAGE
[ -z "$CHARSET" ] && export CHARSET
DESKTOPKB="$(du -sk $HOME/Desktop 2>/dev/null | awk '{print $1}')"
TITLE1="ParallelKnoppix: make ISO image"
MESSAGE1="Select the hard disk partition on which your remastered filesystem
resides. An ISO image will be created in the parallel_knoppix_remaster
subdirectory"
ERROR="That didn't work!"
# Directory selector
PARTITIONS=""
for i in `awk '/^\/dev\/[hs]d[a-z].*\/mnt\/[hs]d[a-z]/{if(!/ntfs/){print $2}}' /etc/fstab`; do
PARTITIONS="$PARTITIONS ${i} [Disk/Partition] off"
done
rm -f "$TMP"
$DIALOG --clear --title "$TITLE1" --radiolist "$MESSAGE1" 18 75 9 $PARTITIONS 2>"$TMP" || bailout
ParKnoppixPART="$(<$TMP)"
[ -z "$ParKnoppixPART" -o ! -e "$ParKnoppixPART" ] && bailout
# mount the partition requested
rm -f "$TMP.err"
mount | grep -q "$ParKnoppixPART" || mount -r "$ParKnoppixPART" >"$TMP.err"
[ "$?" != "0" ] && { $DIALOG --title "$TITLE1" --msgbox "$ERROR `cat $TMP.err`" 10 75; bailout; }
mount | grep -q "$ParKnoppixPART.*ntfs" && { $DIALOG --title "$TITLE1" --msgbox "$ERROR NTFS" 10 75; bailout; }
mount -o remount,rw "$ParKnoppixPART"
export PARALLELKNOPPIXDIR=$ParKnoppixPART/parallel_knoppix_remaster
echo "OK, All seems well. Create image? Enter to continue"
echo "Press <ENTER> to continue: "
read nothing #Waiting for Enter
# make sure the tool to create compressed fs is available
cp -f $PARALLELKNOPPIXDIR/source/KNOPPIX/usr/bin/create_compressed_fs /usr/bin/
# get rid of the old, if it exists
rm -f $PARALLELKNOPPIXDIR/master/KNOPPIX/KNOPPIX
# create the new compressed file
mkisofs -R -U -V "ParallelKnoppix" -publisher "pareto.uab.es/mcreel/ParallelKnoppix" -hide-rr-moved -cache-inodes -no-bak -pad $PARALLELKNOPPIXDIR/source/KNOPPIX | nice -5 /usr/bin/create_compressed_fs - 65536 > $PARALLELKNOPPIXDIR/master/KNOPPIX/KNOPPIX
cd $PARALLELKNOPPIXDIR/master/
rm -f KNOPPIX/md5sums; find -type f -not -name md5sums -not -name boot.cat -exec md5sum {} \; >> KNOPPIX/md5sums
mkisofs -pad -l -r -J -v -V "ParallelKnoppix" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o $PARALLELKNOPPIXDIR/parallelknoppix-`date +%F`.iso $PARALLELKNOPPIXDIR/master
echo "Place a blank CD in the burner"
echo "Press <ENTER> to continue: "
read nothing #Waiting for Enter
cdrecord dev=/dev/hdc -dao -driveropts=burnfree speed=8 $PARALLELKNOPPIXDIR/parallelknoppix-`date +%F`.iso
Similar Threads
-
By Fabianx in forum Customising & Remastering
Replies: 12
Last Post: 08-20-2011, 01:09 AM
-
By GutterClown in forum Customising & Remastering
Replies: 3
Last Post: 03-18-2007, 09:39 PM
-
By bart_999 in forum Customising & Remastering
Replies: 1
Last Post: 06-27-2006, 12:59 PM
-
By PrOCesSkIlL in forum Customising & Remastering
Replies: 29
Last Post: 04-02-2004, 01:32 AM
-
By MichielioZ in forum Customising & Remastering
Replies: 11
Last Post: 04-15-2003, 12:13 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Vintage Schlesinger 17" Leather Briefcase Classic Flap Whiskey Brown Attache EUC
$99.99

Vintage HP Hewlett Packard 2112A 21MX 1000 M-Series 16-Bit Minicomputer
$419.99

Vintage Computer - PC Innovation Intel 486DX2 - Dos Ver 6.2 Windows 3.1
$250.00

Vintage Jetway J-620BF Socket 370 Celeron AT Motherboard SiS 620 Brand New
$75.00

Vintage Compaq PS/2 Rack Keyboard 128958-001 Assembly 128710-001 SpaceSaver
$75.99

Timberland Vintage Heavy Duty Brown Leather Messenger Satchel Crossbody Bag
$127.77

Vintage S-100 California Computer Systems cards Z80 cpu + ADS PromBlaster
$895.00

Lot of 12 Vintage 1960's Military Logic Cards PCB Set Germanium Transistors
$299.00

Sanyo DM 5012CM Solid State Data Display Monitor Working Vintage 1980s 80s
$169.99

Vintage Teac FD-505 5.25" 3.5" Combo Drive 19307571-00
$199.99