OLD VERSION


This script has recently been updated - this is the old page! You probably want the link... try looking in the sitemap link at the bottom of the page


Setup

Copy your standard firmware image (for me it is U96CPQ163.bin) into the t20 directory you made when you were patching/building grub - it's 94Meg, so it might take a moment to copy!

Copy the kernel and initrd from your DSL flash drive into the t20 directory. I did it like this (starting in the t20 directory):

$ mkdir mnt
$ sudo mount /dev/sda1 mnt
Password: *******
$ cp mnt/linux24 mnt/minirt24.gz .
`mnt/linux24' -> `./linux24'
`mnt/minirt24.gz' -> `./minirt24.gz'
$ sudo umount mnt
$ rmdir mnt

Note that your flash drive might not be /dev/sda1 - you'll have to figure this one out yourself.

Get the script

Create a file called build-devosl-old.sh in the t20 directory containing this:

build-devosl-old.sh

Loop devices

NOTE: You need to be root for this section.

Check for the loop module

# lsmod | grep '^loop'
loop                   59596  0
  • note that you'll probably have different numbers displayed, and it might say something about not used, all we really care is that it says loop at the beginning of the line.

If nothing is displayed, try this:

# modprobe loop

and then try the above lsmod/grep command again.

Check for some loop devices

# ls /dev/loop*
/dev/loop0  /dev/loop1  /dev/loop2  /dev/loop3  /dev/loop4  /dev/loop5  /dev/loop6  /dev/loop7

You want some loop devices listed here. You may have something slightly different, including possibly a /dev/loop/ directory - I think that if you have /dev/loop/ listed then it's probably OK. If you managed to load the loop module, but still have no loop devices, you may need to use MAKEDEV or mknod - look it up on the web.

Run the script

At this point, you should have these files/directories in the t20 directory:

$ ls
build-devosl-old.sh  devosl-grub.patch  grub-0.97/  grub-0.97.tar.gz  linux24  minirt24.gz  U96CPQ163.bin
  • Note that your shell may or may not display the / at the end of directory names when you do ls
  • You may or may not have a mnt-DEvoSL directory in there. If you don't already, the script will create it when it needs to.
  • Extra files in the directory won't hurt.

You have to be root to do this; in the t20 directory, do:

# chmod +x build-devosl-old.sh
# ./build-devosl-old.sh 
(lots of stuff displayed, hopefully no errors)

You now have a bootable image (bootp.bin) to install in your T20!

Flash the T20 with this, then plug in your DSL USB-flashdrive, reboot the T20, and rejoice!

Notes and possible problems

  • The first part of the script has a bunch of lines defining locations and names of things - you probably don't need to fiddle with them.

  • This script has only been tested with the U96CPQ163.BIN firmware which comes in the package called SP22462. I've tried to make the script general-purpose, but it is untested. If you want to use a different standard firmware file from what I used, you can just specify the name on the commandline when you run the script - it's not necessary to edit the script just for that change. eg.: ./build-devosl.sh SomeOtherFirmware

  • This script has been tested with DSL v3.3

  • If you are running Debian and the script complains about not being able to find mkfs.vfat, then you may need to install the dosfstools package.

  • If /dev/loop1 is already being used by something else then you need to modify the script to use another loop device.

  • The script doesn't clean up after itself if it fails, so you might need to use umount and losetup.

  • umount mnt would unmount whatever is mounted on mnt (note the lack of an n in the umount command - it's not unmount)
  • losetup -a tells you what loops are setup. This script uses /dev/loop1 by default.
  • losetup -d /dev/loop1 would detach loop1

  • To become root on Ubuntu, you could do sudo su and it would probably be fine. A more "thorough" way to become root is sudo su -, but that will change directory to root's home, and then you need to find your way back to your t20 directory.

  • Zeroing out the partition is not necessary, but it does make the image file much more compressible - useful if you want to bzip it for email. The standard 94M image bzips to 72M, whilst the DEvoSL image bzips to 2M.

  • Normal display from build-devosl-old.sh is something like this:


    # build-devosl-old.sh 
    === Sanity checks =================================================
    Check that we can use losetup.
    Check that the chosen loop device exists.
    Check that we can use dd.
    Check that we can use mkfs.vfat
    Check that we can use the strings command.
    Check/setup mount directory.
    Check source image exists and is readable.
    Check grub stage1 and stage2 exist and are readable.
    Check kernel and initrd exist and are readable.
    === Start working =================================================
    Copying standard firmware "./U96CPQ163.bin" to working file "./bootp.bin"
    Searching for Master Boot Record.
    === Make bootable =================================================
    Setting the partition type as FAT (standard was NTFS).
    1+0 records in
    1+0 records out
    1 byte (1 B) copied, 0.000590184 seconds, 1.7 kB/s
    Setting up loop for partition (start at 834748).
    Cleaning the partition, for tidiness.
    Creating FAT filesystem with large reserved space (for grub).
    mkfs.vfat 2.11 (12 Mar 2005)
    Loop device does not match a floppy size, using default hd params
    Installing grub stage1 (part1).
    3+0 records in
    3+0 records out
    3 bytes (3 B) copied, 0.00623498 seconds, 0.5 kB/s
    Installing grub stage1 (part2).
    450+0 records in
    450+0 records out
    450 bytes (450 B) copied, 0.00323267 seconds, 139 kB/s
    Installing grub stage2.
    148+1 records in
    148+1 records out
    76010 bytes (76 kB) copied, 0.0135971 seconds, 5.6 MB/s
    === Copy files =================================================
    Mounting image.
    Copying kernel.
    Copying initrd.
    === Close up =================================================
    Unmounting image
    Detaching loop.
    Making image "./bootp.bin" accessible by anyone.
    === Finished! =================================================
    Done!  You should now flash the T20 with "./bootp.bin"
  • Thanks to Craig (Gizmomelb) for testing.

  • If you find any errors, try contacting me - Karl Mowatt-Wilson