Difference between revisions of "Debootstrap to LiveCD"
From Knoppix Documentation Wiki
(→Specific Knoppix Packages) |
(→Setup The Environment) |
||
| Line 19: | Line 19: | ||
=SCRIPT= | =SCRIPT= | ||
==Setup The Environment== | ==Setup The Environment== | ||
| + | =====Hash Bang===== | ||
*As required at the beginning of a script (UNIX), a [http://en.wikipedia.org/wiki/Shebang_(Unix) Hash Bang] | *As required at the beginning of a script (UNIX), a [http://en.wikipedia.org/wiki/Shebang_(Unix) Hash Bang] | ||
#!/bin/bash | #!/bin/bash | ||
| − | + | =====Script Variables===== | |
| + | *More info see: [http://tldp.org/LDP/abs/html/variables.html BASH Variables] | ||
SOURCEDIR=[[`pwd`]]/source/KNOPPIX | SOURCEDIR=[[`pwd`]]/source/KNOPPIX | ||
MASTERDIR=`[[pwd]]`/master | MASTERDIR=`[[pwd]]`/master | ||
Revision as of 22:42, 20 February 2007
Contents
PREAMBLE
- This script was done using the Knoppix 5.1 boot cd.
- This has been updated by: SNIa 22:21, 20 Feb 2007 (GMT)
- Knoppix Sources http://debian-knoppix.alioth.debian.org/
CONVENTIONS USED
The following conventions are used, within dotted box:
Commands & paramaters Text can be directly input into a script.
Some commands are linked, if you require further explanation click the link :)
apt-get
SCRIPT
Setup The Environment
Hash Bang
- As required at the beginning of a script (UNIX), a Hash Bang
#!/bin/bash
Script Variables
- More info see: BASH Variables
SOURCEDIR=`pwd`/source/KNOPPIX MASTERDIR=`pwd`/master ARCH=i386 DEBIAN_RELEASE=sid DEBIAN_MIRROR=http://http.us.debian.org/debian
Specific Knoppix Packages
KNOPPIX_PACKAGES="\ ash-knoppix-26 \ hwsetup \ hwdata-knoppix \ cloop-module-2.6.19 \ linux-image-2.6.19 \ loop-aes-modules-2.6.19 \ loop-aes-utils \ madwifi-modules-2.6.19 \ madwifi-tools \ knoppix-ndiswrapper \ ndiswrapper-modules-2.6.19 \ ndiswrapper-utils \ rt2x00-cvs-modules-2.6.19 \ aufs-cvs-modules-2.6.19 \ linux-image-2.6.19 \ linux-kernel-headers \ knoppix-udev-config \ knoppix-initscripts \ xsession-initscript-knoppix \ automount-knoppix \ knoppix-remountrw \ mount-ntfs-knoppix \ knoppix-setrootpassword \ startsyslog-knoppix \ scanpartitions-knoppix \ rebuildfstab-knoppix \ network-setup-knoppix \ netcardconfig-knoppix \ usleep-knoppix \ kudzu-knoppix-vesa "
Now setup the environment, make directories, run the debootstrap command and then change root:
mkdir -p ${SOURCEDIR}
mkdir -p ${SOURCEDIR}/knxfiles
debootstrap --arch ${ARCH} ${DEBIAN_RELEASE} ${SOURCEDIR} ${DEBIAN_MIRROR}
cd /KNOPPIX/usr/src/ &&
cp -Rp \
* \
${SOURCEDIR}/usr/src/.
cd ${SOURCEDIR}/knxfiles &&
for PACKAGE in ${KNOPPIX_PACKAGES};
{
dpkg-repack ${PACKAGE}
};
chroot ${SOURCEDIR} \
/usr/bin/env -i \
HOME=/root \
TERM=$TERM \
PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/bin/bash --login
Within chroot
- Install Dependencies required for Knoppix
apt-get install \ gawk \ perl \ libdb4.4 \ perl-modules \ console-tools \ console-data \ console-common \ pciutils \ libpci2 \ udev \ libvolume-id0 \ pump \ dhcp3-common \ linux-sound-base \ ndiswrapper-utils \ ndiswrapper-common \ ndiswrapper-utils-1.1 \ binutils \ debhelper \ dpkg-dev \ file \ gettext \ html2text \ intltool-debian \ libmagic1 \ make \ patch \ po-debconf useradd -m knoppix echo 'deb-src http://debian-knoppix.alioth.debian.org ./' >> /etc/apt/sources.list echo 'deb http://debian-knoppix.alioth.debian.org ./' >> /etc/apt/sources.list apt-get update cd /knxfiles && dpkg -i * && cd / && rm -rf /knxfiles apt-get clean exit
Exit Chroot & Finalize
Prep startup rc startup scripts, inittab
cd ${SOURCEDIR}/etc &&
rm -rf rc* &&
cd /KNOPPIX/etc &&
cp -ax inittab rc* ${SOURCEDIR}/etc/.
umount ${SOURCEDIR}/proc
Build The CD
- Make the compressed KNOPPIX CLOOP file
mkisofs \ -R \ -U \ -V "Knoppix" \ -publisher "rjenniss" \ -hide-rr-moved \ -cache-inodes \ -no-bak \ -pad ${SOURCEDIR} | \ nice -5 /usr/bin/create_compressed_fs - 65536 > ${MASTERDIR}/KNOPPIX/KNOPPIX
- Create the knoppix.iso file
mkdir -p ${MASTERDIR}/KNOPPIX
cd /cdrom && find . -size -10000k -type f -exec cp -p --parents '{}' ${MASTERDIR} \;
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 knoppix.iso ${MASTERDIR}