This script has been updated 25 September 2007 - if you have a problem with this version, you can try the old page & old script.


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 for the one I use, so it might take a moment to copy! You must use the correct firmware image for your model of T20.

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 in the t20 directory containing this:

Loop devices

NOTE: You need to be root for this section.

Check for the loop module

# lsmod | grep '^loop'
loop                   59596  0

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  devosl-grub.patch  grub-0.97/  grub-0.97.tar.gz  linux24  minirt24.gz  U96CPQ163.bin

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

# chmod +x
# ./ 
(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

    # ./
    === Checking tools ==================================================
    Checking 'mount'                                          
    Checking 'umount'                                         
    Checking 'losetup'                                        
    Checking 'dd'
    Checking 'mkfs.vfat'
    Checking 'strings'
    Check that we can use real echo (/bin/echo).
    Check that echo handles octal escapes.
    Check that the chosen loop device exists.
    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'
    Making image './bootp.bin' accessible by anyone.
    Searching for WinNT Master Boot Record.
    Disk start set to 834236
    Partition start set to 834748
    Checking MBR has expected ID of 0x55 0xAA at end.
    2+0 records in
    2+0 records out
    2 bytes (2 B) copied, 3.8995e-05 seconds, 51.3 kB/s
    MBR 'confirmed' at 834236
    === Tweak partitioning ==============================================
    Setting the partition type as FAT (standard was NTFS).
    1+0 records in
    1+0 records out
    1 byte (1 B) copied, 5.498e-05 seconds, 18.2 kB/s
    === Setup bootloader ================================================
    Setting up loop for partition (start at 834748, length unconstrained).
    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.00016075 seconds, 18.7 kB/s
    Installing grub stage1 (part2).
    450+0 records in
    450+0 records out
    450 bytes (450 B) copied, 0.0010693 seconds, 421 kB/s
    Installing grub stage2.
    148+1 records in
    148+1 records out
    76106 bytes (76 kB) copied, 0.00321247 seconds, 23.7 MB/s
    === Copy files ======================================================
    Mounting image.
    Copying kernel.
    Copying initrd.
    === Close up ========================================================
    Unmounting image
    Detaching loop.
    === Tidying =========================================================
    === Finished! =======================================================
    Done!  You should now flash the T20 with './bootp.bin'