Difference between revisions of "Trivial remaster 3.8.2"


From Knoppix Documentation Wiki
Jump to: navigation, search
(nodev Mounting the files with unionfs)
(removed nodev chroot into the source folder)
Line 192: Line 192:
 
== chroot into the source folder ==
 
== chroot into the source folder ==
 
<pre><nowiki>
 
<pre><nowiki>
# make sure $knx/source is mounted without "nodev" (or with "dev")
 
mount -o remount,dev $(df -P $knx/source | tail -1 | cut -d" " -f 1)
 
 
 
# create /etc/fstab and /etc/resolv.conf in $knx/source
 
# create /etc/fstab and /etc/resolv.conf in $knx/source
 
echo >> $knx/source/etc/fstab
 
echo >> $knx/source/etc/fstab

Revision as of 20:50, 24 August 2005


This remaster script will extract the files from the existing CD and rebuild a new ISO. No changes or only minimal changes are made to the files used to build the ISO.

Based on the Knoppix Remastering Howto

This remastering assumes the following:

  • you are running Knoppix 3.8.2
  • you have a linux filesystem with at least 6 GB of free space

Summary

Remastering is the process of creating a new ISO image to burn on a CD. In it's simplest form, remastering requires only two steps:

  1. build a compressed filesystem from all the operating system and application files
  2. build an ISO image from all the CD files, which includes the compressed filesystem

In fact, if you use the existing compressed filesystem from the CD, you only need to do the second step, which is what some of the versions on this page do.

In practice, remastering takes more than two steps because you usually need to create the environment (e.g. swapspace, diskspace, etc.) in which to build the compressed filesystem and the ISO. Also, since the purpose of remastering is to make a Knoppix CD that differs from the stock Knoppix, you will probably want to alter the contents of the compressed file system, the contents of the CD files, or both before you build your new ISO.

Setting up for remastering

The setup will be the same for all the various version of remastering.


# boot from the Knoppix CD
boot: knoppix 3

# point to the partition, mountpoint, and working directory for the Knoppix build
knx_dev=/dev/hda3 ; knx_mnt=/mnt/hda3 ; knx=$knx_mnt/knx

# Mount the partition
mount -o rw,dev $knx_dev $knx_mnt
mount
df -H $knx_mnt

# make a 1 GB swapfile
dd if=/dev/zero of=$knx_mnt/swapfile bs=1M count=1000
mkswap $knx_mnt/swapfile
swapon $knx_mnt/swapfile
swapon -s

# create a working directory
mkdir $knx
cd $knx
pwd

# make two target folders: one for the source and one for the final master CD
mkdir -p $knx/{master,source}
ls -la $knx

# finished setup

A "test build" version

Ideal if you just want to test the build process. This version uses the files right off the CD to make a new ISO. No changes.

Setting up for remastering

See the above instructions for booting, creating enough disk space, and a setting up a swap file.

Copying the files


# copy the cdrom files to your master directory
( cd /cdrom && cp -av . $knx/master/ )
ls -la $knx/master/

# finished copying the files

Making the image

# make the ISO
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 $knx/knoppix.iso $knx/master 2> $knx/knoppix.iso.log
ls -la $knx/knoppix.iso

# finished imaging the ISO

A "modified boot files" version

Ideal if you just want to change the boot configuation (e.g. add your own cheatcodes or kernel label) but keep everything else the same.

Setting up for remastering

See the above instructions for booting, creating enough disk space, and a setting up a swap file.

Mounting a union filesystem

Instead of copying all the files, we'll use a unionfs.

mount -t unionfs -o dirs=$knx/master=rw:/cdrom=ro none $knx/master
ls -la $knx/master/

# at this point you can modify any of the files in $knx/master/
# for example, a different boot splash image
jpegtopnm /KNOPPIX/usr/share/wallpapers/Circuit.jpg |
  pnmtile 640 480 > $knx/logo.ppm
pnmquant 16 $knx/logo.ppm |
  ppmtolss16 > $knx/master/boot/isolinux/logo.16 

# finished copying the files

Making the image


# make the ISO
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 $knx/knoppix.iso $knx/master 2> $knx/knoppix.iso.log
ls -la $knx/knoppix.iso

# finished imaging the ISO

Unmounting the union filesystem

umount $knx/master
find $knx/master -ls

# finished umounting

A "rebuilt compressed fs" version

Setting up for remastering

See the above instructions for booting, creating enough disk space, and a setting up a swap file.

Copying the files


# copy the cdrom files to your master directory
( cd /cdrom &&
find . -size -10000k -type f |
xargs cp -a --parents --target-directory=$knx/master/ )
ls -la $knx/master/

# copy the KNOPPIX files to your source directory
cp -a /KNOPPIX/* $knx/source/
ls -la $knx/source/

# finished copying the files

Making the image


# make the compressed image
{ mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix.net" \
  -hide-rr-moved -cache-inodes -no-bak -pad $knx/source |
nice -5 /usr/bin/create_compressed_fs - 65536 \
> $knx/master/KNOPPIX/KNOPPIX ; } 2> $knx/KNOPPIX.cloop.log
ls -la $knx/master/KNOPPIX/KNOPPIX

# make the ISO
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 $knx/knoppix.iso $knx/master 2> $knx/knoppix.iso.log
ls -la $knx/knoppix.iso

# finished imaging the ISO

A "chroot" version

Setting up for remastering

See the above instructions for booting, creating enough disk space, and a setting up a swap file.

Mounting the files with unionfs


# mount the master
mount -t unionfs -o dirs=$knx/master=rw:/cdrom=ro none $knx/master
ls -la $knx/master/
rm -rf $knx/master/KNOPPIX/KNOPPIX

# make sure $knx/source is mounted without "nodev" (or with "dev")
mount -o remount,dev $(df -P $knx/source | tail -1 | cut -d" " -f 1)

# mount the source
mount -t unionfs -o dirs=$knx/source=rw:/KNOPPIX=ro none $knx/source
ls -la $knx/source/
rm -rf $knx/source/.rr_moved

# finished copying the files

chroot into the source folder

# create /etc/fstab and /etc/resolv.conf in $knx/source
echo >> $knx/source/etc/fstab
cat /etc/resolv.conf > $knx/source/etc/dhcpc/resolv.conf

# chroot, ls, and exit
chroot $knx/source
ls
exit

# finished chrooting

Making the image


# make the compressed image
{ mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix.net" \
  -hide-rr-moved -cache-inodes -no-bak -pad $knx/source |
nice -5 /usr/bin/create_compressed_fs - 65536 \
> $knx/master/KNOPPIX/KNOPPIX ; } 2> $knx/KNOPPIX.cloop.log
ls -la $knx/master/KNOPPIX/KNOPPIX

# make the ISO
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 $knx/knoppix.iso $knx/master 2> $knx/knoppix.iso.log
ls -la $knx/knoppix.iso

# finished imaging the ISO

Burning the ISO

k3b doesn't work on 3.8.2, but cdrecord does


# burn the ISO
cdrecord -v dev=ATAPI:0,0,0 $knx/knoppix.iso

# finished burning