USB booting :: Diffs for booting USB on Dell Latitude D610



Hi,

After a few hours of hacking I got my Dell Latitude D610 to boot from a Sandisk 1GB cruzer USB flash disk. Getting the USB flash disk installed was a challenge in itself as I don't have a USB linux box, so I did most of this from within Windows XP. I don't have ext2 installed in XP, so just did this on the linux side.

It's possible to do this entirely within Windows - the Cygwin package helps, but you would need makebootfat, filedisk, syslinux and one of the ext2 ifs drivers. You only have to initialize the USB disk once to make it bootable. After that, you can edit the syslinux file or update with syslinux.

This is for Windows only: (skip if you've got linux)
Code Sample

filedisk /mount 0 'c:\downloads\bootfloppy-usb.img' /ro e:
filedisk /mount 1 'c:\downloads\dsl-1.4-syslinux.iso' /cd f:
cp e:/minirt24.gz c:/tmp
gunzip c:/tmp/minrt24.gz
filedisk /mount 2 'c:\tmp\minirt24' g:  # this assumes an ext2fs IFS driver is already installed
patch -i g:/linuxrc patchfile
filedisk /umount g:
gzip minirt24
#
# OK skipping steps here, but you need to dump all the files
# from  the ISO into a new directory, get ldlinux.bss from
# syslinux if missing, copy the usb boot floppy files, and
# updated minirt24.gz etc to a new directory.
# makebootfat then creates a bootable USB disk (this wipes all files on the USB disk!)
#
# don't use -c ldlinux.sys if it's already in your source directory! If you see duplicate ldlinux.sys files in the directory, it's a bug with makebootfat.
#
makebootfat -i -o usb -Y -b ldlinux.bss -m mbrfat.bin -F -c ldlinux.sys c:\downloads\dsl.temp


So far all I can do is boot and get into X Windows. My Dell has the Intel graphics adapter. The Broadcom NIC and Intel 802.11a/b/g adapters are not detected.

1. First you need the kernel to boot without panicing. I tried a suggestion to boot with acpi=off. You can patch syslinux.conf so you don't have to keep typing it:
Code Sample

--- syslinux.cfg.orig   2005-09-01 11:51:17.268864600 -0700
+++ syslinux.cfg        2005-09-01 11:50:51.688695800 -0700
@@ -1,5 +1,5 @@
DEFAULT linux24
-APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt24.gz nomce noapic quiet BOOT_IMAGE=knoppix
+APPEND ramdisk_size=100000 init=/etc/init lang=us acpi=off apm=power-off vga=791 initrd=minirt24.gz nomce noapic quiet BOOT_IMAGE=knoppix
TIMEOUT 300

PROMPT 1



2. Next, you have to patch the ramdisk in minirt24.gz.
Copy minirt24.gz off the disk, gunzip, and do:
Code Sample

mount -o loop ~/minirt24  /tmp_mnt/
cd /tmp_mnt
patch -i patchfile.frombelow


The patch to /tmp_mnt/linuxrc is pretty simple. Apply with patch -i linuxrc.patch. I don't know why this patch is required.
It seems that the ehci-hcd module needs to be loaded first, then unloaded for the USB drive to be detected.

The current linuxrc doesn't catch all errors with mounting the USB drive, so it will panic if there's no filesystem. You can uncomment the debug lines to get a shell that may help you mount manually and continue.


Code Sample

--- linuxrc.orig        Thu Sep  1 11:40:27 2005
+++ linuxrc     Thu Sep  1 11:43:49 2005
@@ -244,6 +244,9 @@
done
fi
# All interactively requested modules should be loaded now.
+# kludge:
+rmmod ehci-hcd
+sleep 2

# Check for ide-scsi supported CD-Roms et al.
test -f /proc/scsi/scsi && FOUND_SCSI="yes"
@@ -453,6 +456,8 @@
DO_REMOUNT=""
REAL_TARGET=""

+
+
case "$CMDLINE" in *toram*) DO_REMOUNT="yes"; COPYTO="ram";;; esac
case "$CMDLINE" in *tohd=*) DO_REMOUNT="yes"; COPYTO="hd";;; esac
case "$CMDLINE" in *bootfrom=*) DO_REMOUNT="yes"; BOOTFROM="yes";; esac
@@ -486,6 +491,14 @@
    copy_to $COPYTO && REAL_TARGET="$TARGET"
  fi
fi
+
+##debug
+#PS1="knoppix# "
+#export PS1
+#echo "6" > /proc/sys/kernel/printk
+## Allow signals
+#trap 1 2 3 15
+#/static/ash
 
# Final test if everything succeeded.
if test -n "$FOUND_KNOPPIX"


original here.