Difference between revisions of "Debootstrap to LiveCD"


From Knoppix Documentation Wiki
Jump to: navigation, search
(Preamble)
(Script)
Line 90: Line 90:
 
  exit
 
  exit
  
Exit Chroot
+
==Exit Chroot & Finalize==
  
 
  cd ${SOURCEDIR}/etc && rm -rf init* rc* passwd* group* shadow* hotplug sysconfig modu*
 
  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/.
 
  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
  
 
Now build the cd
 
Now build the cd

Revision as of 22:20, 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)
    • 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

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

Now 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

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