This directory is used to build a USB key containing a Kubuntu 8.04 LiveCD
with persistent OS files and persistent /home files.
+Note, the sqfs.tar.gz is the whole squashfs unsquashed.
+The kernel image (vmlinuz) is a copy of the most recent kernel i.e.
+ sqfs/boot/vmlinuz-2.6.24-22-generic
+and initrd.gz is a copy of the most recent initrd.img i.e
+
+ sqfs/boot/initrd.img-2.6.24-22-generic
+
+they are renamed and put in the kubuntu8 partition in:
+
+ casper/vmlinuz
+and
+ casper/initrd.gz
+
+respectively.
+
+Note, initrd.gz is made after fixing the bug in
+/usr/share/initramfs-tools/scripts/casper
+see note 2. in bugs with Kubuntu boot process below.
+
+When updating the USB root partition (changing something), I
+strongly recommend that you work with the disk image then
+repack it (pack_disk_image) and then run load_disk_image.
Packages needed:
1. The initrd.gz image must be opened, fixed and the repacked.
2. The fix involves removing the ,mode=755 from the mount line for
the persistent OS partition (casper-rw) or /cow
+3. I have removed /etc/rc0.d/S89casper and /etc/rc6.d/S89casper
+ because they are related to a CDROM boot and create false
+ errors when booting from a USB key.
--- /dev/null
+#
+# You must define certain environment variables in this file
+# so that the scripts know where to find things.
+#
+
+CWD=`pwd`
+
+#
+# The device name of your USB device (e.g. /dev/sda)
+# You can find it by plugging it in then doing
+#
+# fdisk -l
+#
+# If you are unsure remove the USB device and rerun the fdisk -l
+# If you get this wrong, your harddisk could be wiped out.
+#
+USB_DEV=/dev/sda
+
+#
+# When your USB key is mounted, what is the mount directory?
+#
+MOUNT_POINT=/media
+
+#
+# This is where you downloaded the USB boot image
+#
+BOOT_IMAGE=${CWD}/kubuntu8.tar.gz
+
+#
+# Disk image of boot partition of USB key -- this is where you
+# unpacked the kubuntu8.tar.bz2 image. Unpacking the image
+# is not necessary unless you want to change it.
+#
+DISK_IMAGE=${CWD}/kubuntu8
+
+#
+# If you are remastering a Ubuntu or Kubunto ISO (not normally done)
+# Point to the ISO image
+ISO_IMAGE=
+
--- /dev/null
+#!/bin/sh
+#
+# tar the disk image
+#
+. ./config
+
+umount ${USB_DEV}1
+mkfs.vfat -F 16 -n kubuntu8 ${USB_DEV}1
+mount ${MOUNT_POINT}/kubuntu8
+if [ $? -ne 0 ] ; then
+ echo "Mount of USB boot partition failed."
+ exit 1
+fi
+cd ${MOUNT_POINT}/kubuntu8
+if [ $? -ne 0 ] ; then
+ echo "Could not cd to USB boot partition"
+ exit 1
+fi
+tar xfz ${BOOT_IMAGE} .
--- /dev/null
+#!/bin/sh
+#
+# Load squashfs onto the USB key
+#
+
+key=/media/kubuntu8
+
+if [ ! -d $key/casper ] ; then
+ echo "Cannot find $key/casper directory -- possibly not mounted"
+ exit 1
+fi
+
+echo "Removing old squashfs"
+rm -f $key/casper/filesystem.squashfs $key/casper/filesystem.manifest
+rm -f $key/casper/filesystem.manifest-desktop
+
+echo "Copying new squashfs"
+cp filesystem.manifest $key/casper/
+cp filesystem.manifest $key/casper/filesystem.manifest-desktop
+cp filesystem.squashfs $key/casper/
+sync
#!/bin/sh
#
-
-if [ "x$1" != "x" ] ; then
-ISOIMAGE=$1
-elif [ "x$ISOIMAGE" = "x" ] ; then
- echo "Please specify the ISO on the command line or set the enviornment variable ISOIMAGE to point to your ISO"
- exit 1
-fi
+. ./config
mkdir -p cdrom
-mount -o loop -t iso9660 $ISOIMAGE cdrom
+mount -o loop -t iso9660 $ISO_IMAGE cdrom
--- /dev/null
+#!/bin/sh
+#
+# tar the disk image
+#
+. ./config
+
+rm -f kubuntu8.tar.gz
+cd $DISK_IMAGE
+# Update checksum
+find . -type f -print0 | xargs -0 md5sum >md5sum.txt
+tar cfz $CWD/kubuntu8.tar.gz .
+cd $CWD
+ls -l kubuntu8.tar.gz
#!/bin/sh
#
+rm -f filesystem.squashfs
mksquashfs sqfs filesystem.squashfs
#
# First delete all existing partitions
#
+. ./config
if [ ! `whoami` = "root" ] ; then
echo ""
echo ""
exit 1
fi
-if [ "x$USB_DEVICE" = "x" ] ; then
+if [ "x$USB_DEV" = "x" ] ; then
if [ "x$1" = "x" ] ; then
- echo "You must supply the USB device name on the command line or in USB_DEVICE"
+ echo "You must supply the USB device name on the command line or in USB_DEV"
exit 1
else
- dev=$1
+ USB_DEV=$1
fi
-else
- dev=$USB_DEVICE
fi
echo "This script will distroy everything on $dev"
-fdisk -l $dev
+fdisk -l $USB_DEV
echo " "
echo "Answer yes to continue "
read a
if [ "$a" != "yes" ] ; then
- echo "Device $dev unchanged"
+ echo "Device $USB_DEV unchanged"
exit 1
fi
-fdisk $dev <<EOF
+fdisk $USB_DEV <<EOF
d
4
d
p
1
-+900M
++750M
t
1
6
p
w
EOF
-umount ${dev}1
-mkfs.vfat -F 16 -n kubuntu8 ${dev}1
-umount ${dev}2
-mkfs.ext2 -j -b 4096 -L casper-rw ${dev}2
-umount ${dev}3
-mkfs.ext2 -j -b 4096 -L home-rw ${dev}3
-syslinux -sf ${dev}1
-install-mbr -p1 ${dev}
+umount ${USB_DEV}1
+mkfs.vfat -F 16 -n kubuntu8 ${USB_DEV}1
+umount ${USB_DEV}2
+mkfs.ext2 -j -b 4096 -L casper-rw ${USB_DEV}2
+umount ${USB_DEV}3
+mkfs.ext2 -j -b 4096 -L home-rw ${USB_DEV}3
+syslinux -sf ${USB_DEV}1
+install-mbr -p1 ${USB_DEV}
sync
--- /dev/null
+#!/bin/sh
+#
+# Update the disk image with a new squashfs
+#
+. ./config
+
+rm -f $DISK_IMAGE/casper/filesystem.squashfs
+rm -f $DISK_IMAGE/casper/filesystem.mainfest
+rm -f $DISK_IMAGE/casper/filesystem.mainfest-desktop
+cp filesystem.squashfs $DISK_IMAGE/casper/filesystem.squashfs
+cp filesystem.mainfest $DISK_IMAGE/casper/filesystem.mainfest
+cp filesystem.mainfest $DISK_IMAGE/casper/filesystem.mainfest-desktop
#!/bin/sh
#
-# Update squashfs
+# Update squashfs -- assumes you start with a Hardy 8.04.1 desktop,
+# but it should work even if you have already updated it.
#
chroot sqfs /bin/sh
mount -t proc none /proc/
mount -t sysfs non /sys/
export HOME=/root
+
+# remove packages
apt-get remove --purge `dpkg-query -W --showformat '${Package}\n' | grep language-pack | egrep -v '\-en'`
apt-get remove --purge `dpkg-query -W --showformat '${Package}\n' | grep openoffice\.org-`
+apt-get remove --purge amarok dictionaries-common
cat >/etc/apt/sources.list <<EOF
deb http://archive.ubuntu.com/ubuntu/ hardy main restricted
# Add new packages
apt-get install openssh-server subversion kdetoys kicker-applets kgpg gftp \
- firefox sg3-utils
+ firefox sg3-utils
+apt-get install flashplugin-nonfree aircrack-ng g++ nvidia-glx-new gfxboot \
+ syslinux mtools
+
+# Add heldback packages
+apt-get install bind9-host dnsutils libbind9-30 libisccc30 libisccfg30 \
+ linux-generic linux-headers-generic linux-image-generic \
+ linux-restricted-modules-generic ssl-cert
+
+# Remove old kernel
+apt-get remove linux-headers-2.6.24-19 linux-headers-2.6.24-19-generic \
+ linux-image-2.6.24-19-generic linux-restricted-modules-2.6.24-19-generic \
+ linux-restricted-modules-2.6.24-22-generic linux-ubuntu-modules-2.6.24-19-generic
cd /
dpkg-query -W --showformat='${Package} ${Version}\n' >filesystem.manifest