Difference between revisions of "Debootstrap to LiveCD"


From Knoppix Documentation Wiki
Jump to: navigation, search
(Preamble)
(Preamble)
Line 4: Line 4:
 
*Some packages may be missing.
 
*Some packages may be missing.
 
*Lots of room to still simplify.
 
*Lots of room to still simplify.
*For support (I have a day job, so please bare with me see [[User:SNIa|SNIa]] 19:43, 7 Jul 2006 (GMT)
+
*This has been updated by: [[User:SNIa|SNIa]] 19:43, 7 Jul 2006 (GMT)
  
 
==Script==
 
==Script==

Revision as of 19:44, 7 July 2006

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)

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 \
  udev \
  pump \
  modutils \
  module-init-tools \
  linux-image-2.6.17 \
  loop-aes-module-2.6.17 \
  madwifi-modules-2.6.17 \
  ndiswrapper-modules-2.6.17 \
  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 \
  linux-sound-base \
  gawk \
  dhcp3-common \
  console-tools \
  console-data \
  console-common \
  pciutils"

mkdir -p ${SOURCEDIR}
mkdir -p ${SOURCEDIR}/knxfiles
mkdir -p ${MASTERDIR}/KNOPPIX

cd /cdrom && find . -size -10000k -type f -exec cp -p --parents '{}' ${MASTERDIR} \;

debootstrap --arch ${ARCH} ${DEBIAN_RELEASE} ${SOURCEDIR} ${DEBIAN_MIRROR}

cd ${SOURCEDIR}/knxfiles &&
for PACKAGE in ${KNOPPIX_PACKAGES};
{
  dpkg-repack ${PACKAGE}
};

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/.

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

cd /knxfiles &&
dpkg -i *
cd / && rm -rf /knxfiles
apt-get clean
exit

Exit Chroot and 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
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

If this was of help, feel free to post a message