OpenWrt Forum Archive

Topic: HOWTO: x86 Backfire live USB

The content of this topic has been archived on 1 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I found a way to boot my x86 system into OpenWRT Backfire from a USB drive using Syslinux.  Some highlights:

* Boot from USB without compiling custom kernel
* Store multiple versions or images on the same drive, select one during boot
* Create live USB in Windows, no Linux skill necessary
* Keep USB drive as FAT or FAT32 volume, no need to erase data

For step-by-step explanations, see my blog Easy Live USB for x86 OpenWRT

Is anyone interested in instructions on making live USB in Linux instead of Windows?  If you are, I can write them up and put them in the wiki.

A quick rundown of my method

* A desktop Linux system usually boots in these steps:  BIOS loads Grub, Grub loads kernel and initail rootfs image, rootfs sets up the real root file system and transfers control to it.
* OpenWRT skips the initial rootfs image.  Kernel goes directly to the real root file system.
* The official OpenWRT x86 kernel does not have built-in USB drivers.  These drivers are in loadable kernel modules, stored in the root file system.
* For booting from USB, this becomes a catch-22:  Without the root file system, kernel can't load USB modules.  Without the USB modules, kernel can't access the root file system.
* To work around this problem, I created the initial rootfs image from the real root file system.
* I still needed to load kernel and the new initial rootfs during boot.  For this I used Syslinux.  When booting from USB Syslinux is easier to use than Grub.
* Instead of using an entire USB drive for one firmware image, I chose to store the images as files on the drive.
* When setting up the real root file system, my new rootfs first mounts the USB drive.  It then finds the firmware image and mount that through a loop device.  Finally it transfers control to the root file system.
* When changes are made from within OpenWRT, they are saved to the image files.

Feedback, comments, suggestions are appreciated.


William

(Last edited by MacBruins on 4 Sep 2011, 06:22)

Interesting. I have some old Pentium Celeron and/or AMD Duron computers that are not in used. Perhaps, when I get some free time, I sure will like to give this a try. Thank you for sharing.

The discussion might have continued from here.