Remastering DSL

From RedPost/Kit/Documentation

Jump to: navigation, search

Note that we're still having some issues with this...it all works, but then logs you in as a root user instead of the dsl user...but it's close...


If you want to remaster your DSL image, here's how you do it. A lot of this guide is borrowed from the Booth Remastering Guide.

You'll need the following installed on your system for this to work:

  • cloop (cloop-utils)
  • mkisofs

1. On a Linux computer (Debian's probably the best OS to use, as DSL is based on Debian, but Ubuntu also works and most others probably do as well) as root, create the following directories somewhere you'll remember:

mkdir remaster
cd remaster
mkdir image
mkdir -p source/KNOPPIX
mkdir -p master/KNOPPIX

2. Mount your USB flash drive with RedPost/OpenSource installed on it or download the latest version from SourceForge. Uncompress the files (if you've downloaded it) or copy all files from the USB flash drive into the "master" directory

If downloading:

mv redpost_kit.beta_1_1.tar.bz2 master/
tar xvfj master/redpost_kit.beta_1_1.tar.bz2
rm master/redpost_kit.beta_1_1.tar.bz2

If copying from your USB flash drive (note that "sda1" should be wherever your drive mountpoint is):

mount /dev/sda1 image
cp -R image/* master/
umount image

3. Uncompress the KNOPPIX image into the source directory:

extract_compressed_fs master/knoppix/knoppix > tmp.iso
mount -o loop tmp.iso image
cp -Rp image/* source/KNOPPIX
cp -p image/.bash_profile source/KNOPPIX
umount image

4. Remove the old knoppix in the master:

rm -R master/knoppix/*

5. You should now be able to chroot into the filesystem with the command:

chroot source/KNOPPIX
mount -t proc /proc proc

Make any changes you need while chrooted into the extracted filesystem. In order to install packages using dpkg and apt you'll need to run dpkg-restore which will restore apt and dpkg to working order.

The dpkg -l command lists the Debian packages installed. Do an apt-get update, but not an apt-get upgrade. Rather, install and remove packages individually. See the Knoppix remastering guide for more tips.

Note that dsl user files are /etc/skel/. DSL automatically copies them into /home/dsl if backup.tar.gz doesn't exist.

6. Once you've made all the changes you want made (e.g. changing the root password), unmount proc and exit out of the chrooted filesystem. It's really important to unmount proc (check it with the "mount" command), or things really get confusing.

umount /proc
exit

7. Recompress the KNOPPIX image:

rm -rf source/KNOPPIX/.rr_moved
mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix.net" -hide-rr-moved -cache-inodes -no-bak -pad source/KNOPPIX | nice -5 create_compressed_fs - 65536 > master/KNOPPIX/KNOPPIX

8. Remount and copy all master files back to your USB flash drive:

mount /dev/sda1 image
rm -R image/*
cp -a master/* image/
umount image
syslinux -s /dev/sda1

9. All should be well in the happy lands of DSL.

Personal tools