Difference between revisions of "Debootstrap to LiveCD"
From Knoppix Documentation Wiki
(→Hash Bang) |
(→Getting started) |
||
Line 18: | Line 18: | ||
[[apt-get]] | [[apt-get]] | ||
− | = | + | =GETTING STARTED= |
+ | All dotted boxes below are to be put into a script, or into a shell directly. | ||
==Setup The Environment== | ==Setup The Environment== | ||
=====Hash Bang===== | =====Hash Bang===== |
Revision as of 20:49, 8 April 2007
Contents
PREAMBLE
- This script was done using the Knoppix 5.1 boot cd.
- This has been updated by: SNIa 20:43, 8 Apr 2007 (GMT)
- Knoppix Sources http://debian-knoppix.alioth.debian.org/
- Please note that this howto is not without a few flaws, please revise and suggest as necessary.
CONVENTIONS USED
The following conventions are used, within dotted box:
Commands & paramaters Text within this dotted box can be put directly into a script
Some commands are linked, if you require further explanation of the command or parameter click the link. Example shown below:
apt-get
GETTING STARTED
All dotted boxes below are to be put into a script, or into a shell directly.
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="\ knoppix-dma \ knoppix-setrootpassword \ knoppix-udev-config \ knoppix-workarounds \ libntfs9-knoppix \ modemtool-knoppix \ mount-ntfs-knoppix \ network-setup-knoppix \ ntfsprogs-knoppix \ nxsetup-knoppix \ sndconfig-knoppix \ xorgconfig-knoppix \ cloop-module-2.6.19 \ linux-image-2.6.19 \ loop-aes-modules-2.6.19 \ madwifi-modules-2.6.19 \ ndiswrapper-modules-2.6.19 \ rt2x00-cvs-modules-2.6.19 \ aufs-cvs-modules-2.6.19 \ linux-image-2.6.19 \ linux-kernel-headers \ linux-sound-base loop-aes-utils \ madwifi-tools \ ndiswrapper-utils "
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
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 apt-get install \ gawk \ perl \ libdb4.4 \ perl-modules \ console-tools \ console-data \ console-common \ pciutils \ libpci2 \ udev \ libvolume-id0 \ pump \ dhcp3-common \ binutils \ debhelper \ dpkg-dev \ file \ gettext \ html2text \ intltool-debian \ libmagic1 \ make \ patch \ po-debconf \ ash-knoppix-26 \ automount-knoppix \ ddcxinfo-knoppix \ etcskel-knoppix \ hwdata-knoppix \ knoppix-initscripts \ knoppix-ndiswrapper \ knoppix-remountrw \ knoppix-sounds \ knoppix-splash-utils \ knoppix-terminalserver \ kudzu-knoppix-vesa \ mkdosswapfile-knoppix \ modemlink-knoppix \ netcardconfig-knoppix \ networkconfig-knoppix \ ppp-scripts-knoppix \ rootshell-knoppix \ sambastart-knoppix \ soundcardconfig-knoppix \ sshstart-knoppix \ startsyslog-knoppix \ sudoers-knoppix \ rebuildfstab-knoppix \ restartx-knoppix \ saveconfig-knoppix \ scanpartitions-knoppix \ user-profile-knoppix \ usleep-knoppix \ wlcardconfig-knoppix \ xsession-initscript-knoppix \ xsession-knoppix \ hwsetup
useradd -m knoppix
apt-get update cd /knxfiles && dpkg -i * && cd / && rm -rf /knxfiles apt-get clean rm -rf /etc/fstab rm -rf /etc/mtab 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/.
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} \; cd ${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}