Live-CD remastering
Knoppix Live-CD remastering
At present time this software is a beta-testing version.
Description
This software for CD remastering is include a lot of DEB-packages (elphel-specific and dependenced), files and scripts. All software is compressed to the .tar.bz2 archive (size approx. 52 Mb).
There are two scripts for remastering.
First script (make.sh) is general and started by user. Source code:
{
- Make a clone from existed knoppix live-cd
echo "Welcome to KNOPPIX-to-ELPHIX remastering program"
part=0
query() {
echo -n "$1 [$2] " >&2 read answer if [ -z $answer ] ; then answer=$2 ; fi
}
if [ part=0 ]
then
query "Please, specify the work partition. For example, hda1" hda1
part=$answer
fi
version=`cat debs/version.txt`
home=/home/knoppix/LiveCD-$version
source0=/dev/$part dest0=/mnt/$part
source=$dest0/kxsource
dest=$dest0/kxmaster
echo "Mounting the work partition..."
mount $source0 $dest0
echo "Done"
echo "Making the work directories..."
mkdir -p $source/KNOPPIX mkdir -p $dest/KNOPPIX
echo "Done"
- Copying the KNOPPIX directory
echo "Copying the KNOPPIX directory. This can take a few minutes. Please, wait..."
cp -Rp /KNOPPIX/* $source/KNOPPIX cd /cdrom; find . -size -10000k -type f -exec cp -p --parents '{}' $dest/ \;
echo "Done"
- Preparing the internet connection
echo "Preparing the internet connection"
mv $source/KNOPPIX/etc/dhcpc/resolv.conf $source/KNOPPIX/etc/dhcpc/resolv.conf.orig cp /etc/dhcpc/resolv.conf $source/KNOPPIX/etc/dhcpc/resolv.conf
echo "Done"
- Removing packages
echo "Removing packages and files. This can take a few minutes. Please, wait..."
mkdir -p $source/KNOPPIX/debs cp -Rp $home/debs/* $source/KNOPPIX/debs mkdir -p $source/KNOPPIX/patches cp -Rp $home/patches/* $source/KNOPPIX/patches cp $home/inst-rem.sh $source/KNOPPIX/inst-rem.sh rm -f $source/KNOPPIX/usr/share/apps/ksplash/Themes/Default/splash_bottom.png rm -f $source/KNOPPIX/usr/share/apps/ksplash/Themes/Default/splash_top.png rm -f $source/KNOPPIX/usr/local/lib/knoppix.jpg cp -Rp $home/images/* $source/KNOPPIX
echo "Done"
- Installing packages
echo "Installing the ELPHIX specific packages and patches. This can take a few minutes. Please, wait..."
chroot $source/KNOPPIX sh inst-rem.sh
rm -rf $source/KNOPPIX/debs rm -rf $source/KNOPPIX/patches rm -rf $source/KNOPPIX/inst-rem.sh
echo "Done"
- Copying the sources and files
echo "Copying the sources and files"
cp -Rp $home/files/* $dest
echo "Done"
- Creating the ISO-file KNOPPIX
echo "Creating the ELPHIX compressed image. This can take a few minutes or hours. You can drink coffee, read the book, sleep etc. In any case, please, wait..."
rm $source/KNOPPIX/etc/dhcpc/resolv.conf mv $source/KNOPPIX/etc/dhcpc/resolv.conf.orig $source/KNOPPIX/etc/dhcpc/resolv.conf rm -rf $source/KNOPPIX/.rr_moved rm -rf $source/KNOPPIX/etc/bacula rm -rf $source/KNOPPIX/var/lib/bacula rm -rf $source/KNOPPIX/etc/brltty rm -rf $source/KNOPPIX/var/games rm -rf $source/KNOPPIX/usr/share/emacs21 rm -rf $source/KNOPPIX/usr/share/games/frozen-bubble rm -rf $source/KNOPPIX/usr/share/fonts/wine
mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "Elphel,Inc. www.elphel.com" -hide-rr-moved -cache-inodes -no-bak -pad $source/KNOPPIX | nice -5 /usr/bin/create_compressed_fs -b - 65536 > $dest/KNOPPIX/KNOPPIX
echo "Done"
- Creating the ISO-image LiveCD Knoppix
echo "Creating the ISO-image LiveCD ELPHIX. This can take a few minutes. Please, wait..."
cd $dest
mkisofs -pad -l -r -J -v -V "ELPHIX-$version" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o $dest0/ELPHIX-$version.iso $dest
echo "Done"
echo "The remastering is finished. ELPHIX-$version is ready for burning. You can find the ISO-image of ELPHIX-$version on the $dest0 partition. Good luck!"
}
The second script (inst-rem.sh) is started by the first script automatically and used for removing/installing DEB-packages. Source code:
- Sub-script for removing and installing packages
ping -c 5 google.com
dpkg -P `cat /debs/remove-debs`
rm -rf /etc/mozilla-firefox/profile/mimeTypes.rdf
dpkg -i --force-overwrite /debs/depend/*.deb
dpkg -i --force-overwrite /debs/*.deb
cd /etc/X11/Xsession.d patch < /patches/45xsession.patch
cd /etc/init.d patch < /patches/knoppix-autoconfig.patch
cd /etc/skel/.kde/share/config patch < /patches/kdesktoprc.patch
exit
System Requirements
You must have:
1. at least 1 GB of FREE RAM+Swap total (e.g. 256M ram, and 750M swap AVAILABLE) (unless you use a different compression program - look in this page for compressloop)
2. 3 GB free on a Linux filesystem (ext2/3, xfs, etc.) formatted disk partition (you must unmount this partition before remastering)
3. Knoppix 4.0.2-2005-09-23 EN
Instruction
1. Download the LiveCD-1.4.3.tar.bz2 archive (placed at the Xeon computer in the /home/elphel/Ilya/Live-CD_remastering directory)
2. Boot from the Knoppix CD
3. Unpack archive to the /home/knoppix directory
4. Open a root shell:
Menu: Kmenu->Knoppix->Root Shell
5. Type the following two commands:
cd /home/knoppix/LiveCD-1.4.3
sh make.sh
6. The remastering script will be started. You must specify the work partition (for example hda1). This partition will be used for remastering Knoppix.
NOTE: This partition MUST be unmounted!
7. Follow the appeared instructions
8. The ELPHIX-1.4.3.ISO image will be placed at the work partition
9. Use the special software (for example, K3B) for writing image to CD