Logo

Tiny Core: Remaster 

Remaster for my standard build

I find myself going through some standard steps every time I format a flash drive with Tiny Core. (e.g. adding kmaps.tcz for my UK keyboard layout). ezremaster is a doddle to use so it makes sense to use it to construct an .ISO that suits me.

Changes

  1. Add add_uuid script to /usr/sbin
  2. Include kmaps.tcz, pciutils.tcz and usbutils.tcz
  3. Include modified isolinux.cfg boot menu
  4. Rename cde directory to tce
add_uuid isn't particularly sophisticated. It gets the Block ID for the specified drive (e.g. sda1) or defaults to sdb1 if no drive/partition is specified. It then whips through syslinux.cfg and inserts tce=UUID="xxxx-xxxx" after any line beginning append.

Remastering

run ezremaster

Select: use ISO image, Path to ISO: /mnt/sdb1/TinyCore-current.iso. Accept default of /tmp/ezremaster for working directory.

Select next

No need to set boot codes as they are embedded in our new isolinux.cfg file

Ignore 'optional mydata.tgz'

select next

Load the following apps as 'outside initrd on boot':

  • kmaps.tcz
  • pci-utils.tcz
  • usbutils.tcz

Select next - ignore SCM extensions Installation

Select next to reach Remaster step #1 screen.

Select next to start the process - it runs and extracts the files from the iso

At the Remaster step #2 screen switch to a terminal window

run the script patch.dwp. This:

  • cds to /tmp/ezremaster/extract
  • copies add_uuid to usr/sbin
  • Navigates to /tmp/ezremaster/image/
  • Renames cde to tce
  • copies new isolinux.dwp file to boot/isolinux/isolinux.cfg.

hit "create ISO"

wait awhile

cp the iso /tmp/ezremaster.iso to /mnt/sdb1/TinyCoreDWP12-0.iso

Files

add_uuid

#!/bin/sh
# Script to add UUID to the boot menu of a flash drive
# Usage add_uuid sda1 | sdb1 ....
# If nothing is set defaults to sdb1
# Warning: adds after "append". Doesn't check/replace any existing entry

if [ -z $1 ] ; then
  BOOT=sdb1
else
  BOOT=$1
fi
CFG_FILE=/mnt/$BOOT/boot/syslinux/syslinux.cfg

MOUNT=$(df | grep -m 1 /dev/$BOOT | sed 's/ .*//')
if [ -z "$MOUNT" ]; then
  echo "$BOOT is not mounted"
  exit
fi

BLKID=$(blkid /dev/$BOOT | sed 's/.* UUID="\([^"]*\)".*/\1/')
echo setting blkid to $BLKID in $CFG_FILE
sed  -Ein "s/append /append tce=UUID=\"$BLKID\" /" $CFG_FILE 

patch.dwp to modify files

#!/bin/sh
#
# Program to patch the tc remaster

EXTRACT="/tmp/ezremaster/extract"
IMAGE="/tmp/ezremaster/image"
SOURCE="/home/tc/remaster"

# Patch/add files to initrd

cd $EXTRACT
sudo cp $SOURCE/add_uuid usr/sbin/
cd $IMAGE
sudo cp -f $SOURCE/isolinux.dwp boot/isolinux/isolinux.cfg
sudo mv cde tce
echo Patching done