Debootstrap to LiveCD
From Knoppix Documentation Wiki
Preamble
- This script was done using the Knoppix 5.0.1 boot cd.
- Some packages may be missing.
- Lots of room to still simplify.
- This has been updated by: SNIa 19:43, 7 Jul 2006 (GMT)
- What I have updated should resolve dependency problems.
Script
#!/bin/bash SOURCEDIR=/mnt/hda1/source/KNOPPIX MASTERDIR=/mnt/hda1/master ARCH=i386 DEBIAN_RELEASE=sid DEBIAN_MIRROR=http://http.us.debian.org/debian KNOPPIX_PACKAGES="\ ash-knoppix-26 \ hwsetup \ hwdata-knoppix \ pump \ linux-image-2.6.17 \ loop-aes-module-2.6.17 \ madwifi-modules-2.6.17 \ ndiswrapper-modules-2.6.17 \ ndiswrapper-utils \ rt2x00-modules-2.6.17 \ unionfs-knoppix-modules-2.6.17 \ zr364xx-modules-2.6.17 \ zydas-modules-2.6.17 \ linux-image-2.6.17 \ linux-kernel-headers-knoppix" mkdir -p ${SOURCEDIR} mkdir -p ${SOURCEDIR}/knxfiles debootstrap --arch ${ARCH} ${DEBIAN_RELEASE} ${SOURCEDIR} ${DEBIAN_MIRROR} 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
Once you have chrooted
apt-get install \ gawk \ perl \ libdb4.4 \ perl-modules \ console-tools \ console-data \ console-common \ pciutils \ libpci2 \ udev \ libvolume-id0 \ 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
cd /knxfiles && dpkg -i * cd / && rm -rf /knxfiles apt-get clean exit
Exit Chroot & Finalize
- Lots of cleanup to do here
- Define specifics of which files within /etc, and which packages belong to which files within /lib/modules and /usr/src
cd ${SOURCEDIR}/etc && rm -rf init* rc* passwd* group* shadow* hotplug sysconfig modu* cd /KNOPPIX/etc && cp -ax init* rc* passwd* group* shadow* hotplug sysconfig modu* udev ${SOURCEDIR}/etc/. rm -rf ${SOURCEDIR}/lib/modules/* && cp -Rp /KNOPPIX/lib/modules/* ${SOURCEDIR}/lib/modules/. rm -rf ${SOURCEDIR}/usr/src/* && cp -Rp /KNOPPIX/usr/src/* ${SOURCEDIR}/usr/src/. umount ${SOURCEDIR}/proc
Build The CD
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
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}
Special thanks
- another similar method Long Remove List
If this was of help, feel free to post a message