Remastering

Finnix, the LiveCD for system administrators

(Redirected from Remastering Finnix)

Quick remaster guide

1. Boot the Finnix CD.

2. Mount a disk to work within. For this guide, the mount point /mnt/hda1 is assumed.

# mkdir -p /mnt/hda1
# mount /dev/hda1 /mnt/hda1

If your disk is in a location other than /dev/hda1, it is recommended that you mount to /mnt/hda1 anyways. Otherwise, you will have to adjust several examples in this guide, and the stage1 and stage2 scripts could blow up in an unfortunate fashion.

# mkdir -p /mnt/hda1
# mount /dev/hdb3 /mnt/hda1

The disk's file system should be ext2 (if it's not, you could use mkfs.ext2 command).

3. Install squashfs-tools, if you are running Finnix 86.1 or older. It is already installed in 86.2.

# apt-get update
# apt-get install squashfs-tools

4. Create the necessary filesystem layout for this guide.

# mkdir -p /mnt/hda1/knx/master
# mkdir -p /mnt/hda1/knx/source/FINNIX

("knx" is a throwback from Finnix 85.0, which was a remastered Knoppix disc.)

5. Copy the contents of /cdrom to /mnt/hda1/knx/master.

# cp -a /cdrom/* /mnt/hda1/knx/master/

6. Copy the contents of /FINNIX (which is a mounted squashfs filesystem) to /mnt/hda1/knx/source/FINNIX.

# cp -a /FINNIX/* /mnt/hda1/knx/source/FINNIX/

7. (Optional) If you plan on upgrading the kernel, you must extract the initrd.

# mkdir -p /mnt/hda1/knx/initrd
# cd /mnt/hda1/knx/initrd
# gunzip -c /cdrom/isolinux/minirt | cpio -idm
(for finnix-ppc, use 'gunzip -c /cdrom/boot/minirt | cpio -idm')

8. Chroot into the extracted Finnix filesystem and mount /proc and /sys.

# chroot /mnt/hda1/knx/source/FINNIX /bin/bash
# mount /proc
# mount /sys

Note: if 'mount /proc' or 'mount /sys' doesn't work, use

# mount -t proc none /proc
# mount -t sysfs none /sys

9. Now that you are chrooted, you can make your desired modifications. What you do now is up to you. For ideas, please see Modification Ideas below.

10. When you are finished, unmount /proc and /sys, and exit the chroot.

# umount /proc
# umount /sys
# exit

11. Creating the squashfs filesystem and ISO are very easy, with the assistance of two helper scripts, stage1 and stage2. Download them and make them executable.

# cd /mnt/hda1/knx
# wget http://www.finnix.org/files/scripts/stage1
# wget http://www.finnix.org/files/scripts/stage2
# chmod 755 stage1 stage2

11.5. (PPC only) If you are building the PPC image, you will need a map file that is not included with the CD. The file will be placed in /mnt/hda1/knx/stuff and be called maps. The stage2 script will know what to do with this.

# mkdir -p /mnt/hda1/knx/stuff
# cat > /mnt/hda1/knx/stuff/maps << EOM
.b              Raw     'UNIX'    'tbxi'   "bootstrap"
yaboot          Raw     'UNIX'    'boot'   "bootstrap"
linux           Raw     'UNIX'    'boot'   "kernel"
linux64         Raw     'UNIX'    'boot'   "kernel"
.conf           Raw     'UNIX'    'conf'   "bootstrap"
minirt          Raw     'UNIX'    'root'   "root_image"
*               Raw     'UNIX     'UNIX'   "unix"
EOM

12. Please review these downloaded scripts. These scripts are same used to create the main Finnix distribution, and have a couple extra features, such as updating the boot menu with the build tag. However, you do not need to worry about this, as they are only used by the scripts if necessary files are present. Likewise, the initrd will be re-created only if you extracted it in step 7. Your config files are going to be erased, than if you don't want that to happend review the scripts and make nessesary changes. Beware: If you chose a mount point other than /mnt/hda1, you will have to modify both of these files. Once you have reviewed the scripts, execute them.

# ./stage1 && ./stage2

If all goes well, you should have a file named /mnt/hda1/knx/finnix.iso (or /mnt/hda1/knx/finnix-ppc.iso). Burn it, test it and enjoy!

Modification ideas

  • Add proprietary software that can't be included in free download, such as compression tools like rar. (Obviously, if you do this, you will not be able to release your modified copy to the public.)
  • Add software that is not included due to size reasons or because it is not needed often enough.
  • Update clamav's database for AV scans of systems with no internet connection.
  • Personalize your Finnix -- add boot messages and such to show that it is your personalized copy.
Personal tools