Difference between revisions of "Debootstrap to LiveCD"


From Knoppix Documentation Wiki
Jump to: navigation, search
(Script)
(Script)
Line 14: Line 14:
 
  DEBIAN_RELEASE=sid
 
  DEBIAN_RELEASE=sid
 
  DEBIAN_MIRROR=http://http.us.debian.org/debian
 
  DEBIAN_MIRROR=http://http.us.debian.org/debian
 
 
   
 
   
 
  KNOPPIX_PACKAGES="\
 
  KNOPPIX_PACKAGES="\

Revision as of 21:41, 5 July 2006

Preamble

  • This script was done using the Knoppix 5.02 boot cd.
  • Some packages may be missing.
  • Lots of room to still simplify.
  • For support (I have a day job, so please bare with me see SNIa 05:53, 25 Jun 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 \
  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
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

Let me know if this was of help to you!