Easy Live USB for x86 OpenWRT

Update 12/24/2011:  initramfs.img for Backfire 10.03.1 final is now available.

Update 11/16/2011:  If you want to a larger root partition for your installation (The official one is about 50 MB), see Expanding x86 OpenWrt Root Partition

Update 11/15/2011:  initramfs.img for Backfire 10.03.1-rc6 is available for download on SkyDrive.

Update 09/05/2011:  If your OpenWRT PC’s BIOS does not support USB boot, see Booting From USB Without BIOS Support.

In this blog I will cover steps to create an x86 OpenWRT live USB on a Windows 7 PC.  The steps are fairly simple.  Just downloading files, move them around, and type a few commands.  No Linux experience necessary.  They can be easily adapted to Windows Vista or Windows XP if you have an older PC.

With a little more work, the technique discussed here can be adapted to create a bootable-x86-ISO/live-USB combination, for PCs that can’t boot from USB.  That is something in my pipeline.

And of course Live USB can be created on a Linux system, but I don’t plan to write up the instructions.  Leave a comment if you need help with that.

Finally, the theory of operation comes after the instructions.  I think this live USB concept is a big improvement over my livecd idea (see Creating OpenWrt x86 Live CD with USB Support).  I plan to keep up with newer OpenWRT releases.

Background

Occasionally I want to try different OpenWRT configurations while keeping the main installation intact.  Although I can already do that with my custom live CDs , they are still cumbersome and slow when switching back and forth.  An even better method is to boot from USB to a selection of firmware versions or configurations.

To create a bootable live USB using the steps discussed here, you’ll need

  • An x86 PC that can boot from USB or CD.  If you PC can boot from CD but not USB, see Booting From USB Without BIOS Support.
  • A Windows PC for configuring the USB flash drive.
  • A FAT or FAT32 USB flash drive.  Each OpenWRT installation needs about 60 MiB of space.  You do not need a large drive to start.  Installation can be moved from one drive to another.
  • Syslinux for creating bootable USB.  Syslinux is free.  Its website is http://www.syslinux.org.  The download page is http://www.kernel.org/pub/linux/utils/boot/syslinux/. Update 09/16/2011: kernel.org has been down for a while, taking syslinux with it. I searched for a Syslinux mirror and Google returned MuntInternet in the Netherlands.

OpenWRT Files

Three components make up one OpenWRT configuration:  a Linux kernel, an initial rootfs image, and an OpenWRT disk image.  All three are stored as files on the USB drive, and must have the same firmware version.  For example, to boot your PC to OpenWRT Backfire 10.03, you need the 10.03 kernel, 10.03 OpenWRT disk image, and 10.03 initramfs image.

When changes are made to an OpenWRT router, they are stored in the disk image.  The linux kernel and rootfs image are not changed.  Therefore some configurations can use the same Linux kernel and rootfs image, as long as they are of the same version.  Also, the disk images are initially compressed (.gz format).  They are decompressed when used for the first time.

For clarity I gather files of the same version in one folder, and use the version number as folder names.

Official OpenWRT website has the kernels and disk images for many different platforms and versions.  The rootfs images are modified disk images that I created, and are hosted on SkyDrive.  Here are the links to all files.

Firmware version

Official Linux kernel

Offical disk image

rootfs images on SkyDrive

Backfire 10.03

openwrt-x86-vmlinuz

openwrt-x86-ext2.image.gz

OpenWRT Live USB
subfolder 10.03
file initramfs.img

Backfire 10.03.1-rc4

openwrt-x86-generic-vmlinuz

openwrt-x86-generic-combined-ext2.img.gz

OpenWRT Live USB
subfolder 10.03.1-rc4
file initramfs.img

Backfire 10.03.1-rc5

openwrt-x86-generic-vmlinuz

openwrt-x86-generic-combined-ext2.img.gz

OpenWRT Live USB
subfolder 10.03.1-rc5
file initramfs.img

Backfire 10.03.1-rc6

openwrt-x86-generic-vmlinuz

openwrt-x86-generic-combined-ext2.img.gz

OpenWRT Live USB
subfolder 10.03.1-rc6
file initramfs.img

Backfire 10.03.1 Final

openwrt-x86-generic-vmlinuz

openwrt-x86-generic-combined-ext2.img.gz

OpenWRT Live USB
subfolder 10.03.1
file initramfs.img

Table updated on 12/24/2011

Creating A Three-Configuration Live USB

Here I will cover steps to create a live USB with three configurations:

  1. Config A:  Version 10.03.  It needs three files:  10.03 kernel, 10.03 rootfs image, and 10.03 disk image.
  2. Config B:  Version 10.03.1-rc5.  It also needs three files:  10.03.1-rc5 kernel, 10.03.1-rc5 rootfs image, and 10.03.1-rc5 disk image
  3. Config C:  Also version 10.03.1-rc5.  It needs just one file,  its own 10.03.1-rc5 disk image.  Config B and C will use the same kernel and rootfs image.

These 7 files are stored in two folders:

  • 10.03:  Files of Config A.
    • openwrt-x86-vmlinuz:  Backfire 10.03 Linux kernel
    • openwrt-x86-ext2.image.gz:  Backfire 10.03 disk image
    • initramfs.img:  Backfire 10.03 rootfs image
  • 10.03.1-rc5:  Files of Config B & C
    • openwrt-x86-generic-vmlinuz:  10.03.1-rc5 Linux kernel
    • config-b-openwrt-x86-generic-combined-ext2.img.gz:  10.03.1-rc5 disk image, for Config B.
    • config-c-openwrt-x86-generic-combined-ext2.img.gz:  10.03.1-rc5 disk image, for Config C.
    • initramfs.img:  10.03.1-rc5 rootfs image.

To create the folders and contents:

  1. Insert the USB drive.  For this discussion, I’ll assume the drive letter is “E:”.
  2. Create two folders on “E:”:  “10.03” and “10.03.1-rc5”.
  3. Follow the links given above, and download version 10.03 kernel, disk image, and rootfs image.  Move these files to “E:\10.03”.
  4. Again, follow the links and download kernel, disk image, and rootfs image of version 10.03.1-rc5.  Move these files to “E:\10.03.1-rc5”
  5. Navigate to “E:10.03.1-rc5”.  Make a copy of the disk image.  Name the new copy “config-c-openwrt-x86-generic-combined-ext2.img.gz”.
  6. Rename the original from “openwrt-x86-generic-combined-ext2.img.gz” to “config-b-openwrt-x86-generic-combined-ext2.img.gz”.

When you’re done, the USB drive and folders should look like these snapshots.

image

image

Making The USB Drive Bootable

We’ll use Syslinux as the bootloader.

  1. Download Syslinux.  Follow the link given above and choose the ZIP archive because it is easier to work with on a Windows PC.
  2. Extract the content of the archive to a new folder.  For this discussion, let’s assume that folder is “C:\syslinux-4.04”.
  3. Start a command prompt as administrator.  Press the Windows Logo key and type “command prompt” in the search box.  Right click on “Command Prompt” under “Programs”.  Select “Run as administrator.”  Answer “Yes” in the UAC pop-up window.  An administrator command prompt should now be open.
  4. Go to the executable directory and run Syslinux.  Again, assuming the USB drive’s letter is “E:”, type
    • 64-bit system
      cd c:\syslinux-4.04\win64
      .\syslinux64.exe -m -a E:
    • 32-bit system
      cd c:\syslinux-4.04\win32
      .\syslinux.exe -m -a E:

    “-m”  places Syslinux on the master boot record of “E:” drive.  “-a” marks the partition active.

  5. Label the flash drive.  In the same command prompt, type
    label E: OPENWRT
    This disk label (“OPENWRT” here) will identify the USB drive to Linux kernel.  You can choose a different label, but remember to use it in the Syslinux configuration file discussed later.  Also, remember that Windows uses only uppercase letters in the label but Linux is case sensitive.

image

Configuring Syslinux

The final step is to create a configuration file for Syslinux.  This file is named “syslinux.cfg” and stored at the root level of the USB drive.  That is, “E:\syslinux.cfg”.

In “syslinux.cfg” list all OpenWRT configurations.  There are four lines for each configuration:

  1. “label”: The label of a configuration. Entered at boot prompt to make a selection.
  2. “kernel”: The path to a kernel file on the USB drive.  Use “/” instead “\” and discard the drive letter.  For example, the kernel file of of Config A is
    E:\10.03\openwrt-x86-vmlinuz
    That makes the Syslinux entry
    /10.03/openwrt-x86-vmlinuz
  3. “initrd”: Path to rootfs image.  Again, no drive letter, and “/” instead of “\”
  4. “append”: Kernel command line options.
    • “rootvol”: USB drive label.  Add the prefix “LABEL=”, and remember to use all uppercase letters.  For our USB drive, add the following text to the “append” line:
      rootvol=LABEL=OPENWRT
      “rootvol” is my addition to OpenWRT.
    • “rootimage”: Path to disk image of a configuration.  Discard drive letter and use “/”.  For example, Config B uses the disk image
      E:\10.03.1-rc5\config-b-openwrt-x86-generic-combined-ext2.img.gz
      so add the following text to Config B’s “append” line
      rootimage=/10.03.1-rc5/config-b-openwrt-x86-generic-combined-ext2.img.gz
      “rootimage” is also my addition.
    • “console”: Specify the linux console. If you have a video card and a monitor, use “console=tty0”. If your OpenWRT PC is headless, use “console=ttyS0,38400n8” to enable the serial port.
    • “reboot”: original from OpenWRT

These entries can create a simple user interface for selecting a configuration.

  • “say”: Display a message.
  • “default”: The default choice
  • “prompt”: 1 to turn on boot prompt.
  • “timeout”: time to wait for user’s selection, in 1/10 of a second. (100 = 10 seconds)
  • “ontimeout”: automatically selected choice on timeout.

The following configuration file will display the three choices discussed here.  It will then wait 10 seconds for a user to enter “a”, “b”, or “c”.  If a selection is made, Syslinux boots the chosen configuration.  Otherwise, it boots Config A.


say a) Config A (10.03)

label a
kernel /10.03/openwrt-x86-vmlinuz
initrd /10.03/initramfs.img
append rootvol=LABEL=OPENWRT rootimage=/10.03/openwrt-x86-ext2.image.gz console=tty0 reboot=bios

say b) Config B (10.03.1-rc5)

label b
kernel /10.03.1-rc5/openwrt-x86-generic-vmlinuz
initrd /10.03.1-rc5/initramfs.img
append rootvol=LABEL=OPENWRT rootimage=/10.03.1-rc5/config-b-openwrt-x86-generic-combined-ext2.img.gz console=tty0 reboot=bios

say c) Config C (10.03.1-rc5)

label c
kernel /10.03.1-rc5/openwrt-x86-generic-vmlinuz
initrd /10.03.1-rc5/initramfs.img
append rootvol=LABEL=OPENWRT rootimage=/10.03.1-rc5/config-c-openwrt-x86-generic-combined-ext2.img.gz console=tty0 reboot=bios

say make a selection and press enter
default a
prompt 1
timeout 100
ontimeout a

Live USB Ready

That’s it.  Just eject the drive from Windows and you have a Live USB drive with two OpenWRT configurations.  When booting from this drive, you’ll see a list of 3 choices and have 10 seconds to choose.

Always Shutting Down Gracefully

I noticed that the FAT/FAT32 file systems are quite susceptible to data corruption. During development I lost many files by pressing the reset button on my PC. Always shut down your system gracefully to avoid data loss.

Why Booting from USB Fails

A desktop Linux system typically boots up in these steps:

  1. A bootloader, usually Grub, loads Linux kernel and initial rootfs image into memory and starts kernel execution.
  2. From initial rootfs Kernel starts an initialization program, usually “/init”, to set up essential system components, including root file system.
    • If the necessary drivers are not built in the kernel, they are loaded from kernel modules.
    • These modules are included in the initial rootfs because it is custom built for each system (by “dracut” or “mkinitrd” usually).
  3. Finally, the control is transferred to the “real” initialization program on the root file system.

The official x86 OpenWRT distribution differs from  this flow.  It skips the second step.  The OpenWRT kernel itself initializes the root file system and transfer controls to it.  This isn’t a problem when the root file system resides in an ext2 partition of a IDE or SATA hard disk.  The ext2 and ATA drivers are already in the kernel.  The USB drivers however are not, and this turns booting from USB into a Catch-22:  The kernel can’t access the root file system without the USB modules, but the USB modules aren’t available because they are on the root file system.

Choosing an Alternative

One solution to this problem is to add the USB drivers and re-compile the kernel.  It works but has two problems.  It is opaque because changes in the kernel binary can’t be easily examined.  It also requires the kernel on the official disk image to be replaced.  That task is not simple for a novice.

Another solution is to use a combination of an initial rootfs image (initramfs.img) and Syslinux.  This is a much better solution.  The initial rootfs image can be easily examined.  Setting up Syslinux is much simpler than replacing the kernel.  Additionally, Syslinux works with FAT, which is the default file system on most USB drives, and it can be set up from a Windows PC, thus broadening the user base.

Setting Up USB Root

As mentioned earlier, a critical role of initramfs.img is to set up the root file system.  In this case, the root file system is a image file on a USB drive.  To set up the USB root, kernel runs “/init” of initramfs.img.  “/init” is a shell script.  It sets up the root file system in these steps:

  1. Load all modules in initramfs.img.  They include drives for USB and FAT file system.  (See “Creating initramfs.img” on adding these modules.)
  2. Using a parameter on kernel command line, identify the USB drive that holds the root file system.  Mount that USB drive.
  3. Again using a kernel command line parameter, find the root file system image file.  Decompress the file if necessary.
  4. Check the size of the image file.  Pad it to ensure enough space is allocated for the root partition.
  5. Associate the image file with a loop device, run fsck, and mount it.  Now the root file system is online.
  6. Add a step in OpenWRT’s pre-init flow to link “/dev/root” to the loop device.
  7. Unmount the USB drive.
  8. Call “switch_root” to start using the root file system.
#!/bin/sh
#
# Copyright (C) 2011 William H. Liao  All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License.
#

# Kernel command line arguments:

# rootvol:
#	specify the volume that holds the ext2 root image file.
#	Valid options are
#		/dev/sdxy (e.g. /dev/sda1)
#		UUID=xxxx (as printed by 'blkid', but no quotes)
#		LABLE=yyyy ('yyyy' is case sensitive.  no quotes)
#
# rootimage:
#	File name of ext2 root image file.  Leading "/" optional

# chop off .gz from root image name

rootimage=${rootimage%.gz}

echo "Looking for $rootimage(.gz) on device $rootvol"

# root image file size, and start of root fs in image
# file.  Both are discovered using fsck on OpenWRT ext2
# image

rootimage_size=$((107856*512))
rootimage_offset=$((9135*512))

# Load modules to support USB and FAT

. /etc/functions.sh

load_modules /etc/modules.d/*

echo "Waiting 15 seconds for removable devices to stablize"
i=0
while [ $i -lt 15 ]; do
	sleep 1
	echo -n "."
	i=$(($i+1))
done
echo

# findfs is not built in OpenWRT busybox by default, so
# examine blkid output to find out the "rootvol" device.

mount proc /proc -t proc

root_dev=""
case "$rootvol" in
	/dev/*)
		root_dev=$rootvol
		;;
	UUID=*)
		# work in lower case because hexdecimal values
		# are case insensitive

		grep_string=`echo $rootvol | cut -d= -f2 | tr '[A-Z]' '[a-z]'`
		root_dev=`blkid | tr '[A-Z]' '[a-z]' | \
			fgrep uuid=\"$grep_string\" | cut -d: -f1`
		;;
	LABEL=*)
		grep_string=`echo $rootvol | cut -d= -f2`
		root_dev=`blkid | fgrep LABEL=\"$grep_string\" | cut -d: -f1`
		;;
esac

[ -z $root_dev ] && \
	{ echo "Root device not found" ; exit ; }
[ -b $root_dev ] || \
	{ echo "$root_dev not a block device" ; exit ; }

# Mount the "rootvol" and look for "rootimage"

mount $root_dev /mnt > /dev/null 2>&1 || \
	{ echo "Root volume not mounted" ; exit; }

if [ -r /mnt/$rootimage.gz ]; then
	[ -f /mnt/$rootimage ] && rm /mnt/$rootimage
	gunzip -f /mnt/$rootimage.gz || { echo "Can't decompress $rootimage.gz" ; exit ; }
fi

[ -r /mnt/$rootimage ] || { echo "No root image $rootimage on volume" ; umount /mnt ; exit; }

echo "root image found on $root_dev"

# Make sure the image file is at least as big as its partition
# table says.  If it isn't, enlarge it, to make sure enough space
# is allocated.

image_size=`ls -l /mnt/$rootimage | awk '{print $5}'`
if [ $image_size -lt $rootimage_size ]; then
	dd if=/dev/zero of=/mnt/$rootimage bs=1 seek=$image_size \
		count=$(($rootimage_size-$image_size)) ||
			{ echo "Can't pad root image" ; umount /mnt ; exit ; }
	echo "root image padded"
fi

# Now connect "rootimage" to /dev/root (same as /dev/loop0).  Use an
# offset to skip MBR, grub, boot partition, etc.

losetup /dev/loop0 /mnt/$rootimage -o $rootimage_offset ||
	{ echo "Can't set up root image loopback" ; umount /mnt ; exit ; }

# check the root image before mouting it

e2fsck -p /dev/root
case $? in
	0|1)
		: ;;
	2)
		reboot ;;
	*)
		echo "root FS image has errors"
		losetup -d /dev/loop0
		umount /mnt
		exit
		;;
esac

mount /dev/root /root ||
	{ echo "Can't mount root image" ; losetup -d /dev/loop0 ; umount /mnt ; exit ; }

# Add a script to create /dev/root

if [ ! -r /root/lib/preinit/21_add_root_dev ]; then
	cat << EOF > /root/lib/preinit/21_add_root_dev
#!/bin/sh

add_dev_root() {
	mknod /dev/loop0 b 7 0
	ln -s loop0 /dev/root
}

boot_hook_add preinit_essential add_dev_root
EOF
fi

# Finally, ready to switch root

echo "root image mounted, ready to switch"

umount -l /mnt	# lazy umount, since we're still using the usb drive
umount /proc

exec switch_root /root /etc/preinit

# Uh-oh, try cleaning up

umount /root
losetup -d /dev/loop0

Creating initramfs.img

“initramfs.img” is based on the official disk image, with the addition of USB and FAT modules and removal of others.  I will describe just the general steps here because a detail discussion will be too long.

  1. Write the official x86 disk image to the storage of a kernel virtual machine.
  2. Start the KVM and configure its network interface so it can access the internet
  3. Use opkg to add and remove modules.  The final list of module is
    base-files kmod-nls-base kmod-usb2 libuci
    busybox kmod-nls-cp437 libblkid libuuid
    e2fsprogs kmod-nls-iso8859-1 libc losetup
    hotplug2 kmod-usb-core libext2fs opkg
    kernel kmod-usb-ohci libgcc udevtrigger
    kmod-fs-vfat kmod-usb-storage libpthread
    kmod-loop kmod-usb-uhci librt
  4. Turn off the KVM.
  5. Use “kpartx” to make the OpenWRT root partition available on the host system.
  6. Use “scripts/gen_initramfs_list.sh” from a kernel build directory to create a file list.  This list includes basic device nodes, “/init” script shown above, and the root file system of the OpenWRT KVM.
  7. Edit the list to change absolute paths to relative.  Also delete unnecessary files like “.svn” or “.git”.
  8. Use “usr/gen_init_cpio” from a kernel build directory to generate the initial rootfs.  Compress it with gzip.

History

12/24/2011:  Add note about 10.03.1 final.

11/16/2011:  Add note about expanding root.

11/15/2011:  Add note about 10.03.1-rc6.  Strike kernel.org down.

09/16/2011: Note kernel.org is down. Give muntinternet syslinux mirror.
09/07/2011:  Add “Why Booting From USB Fails”, “Choosing An Alternative”, “Setting Up USB Root”, and “Creating initramfs.img”

09/05/2011:  Add note abut Plop Boot Manager.  Change PC requirement.

33 Responses to “Easy Live USB for x86 OpenWRT”

  1. EllisGL Says:

    If both syslinux.org and kernel.org wasn’t down

  2. Sam Says:

    Great guide. Going to try it later on linux. One question though, why don’t you use latest firmware?

    • macbruins Says:

      Thank you. I’m glad you like it. RE: not latest firmware: I don’t quite understand your question since 10.03.1-rc5 is the latest released firmware. Are you asking why I don’t use the snapshot firmware? Being a snapshot, it is unstable and changes too quickly (daily I think). I need some stability, and I just can’t keep up with the changes.

  3. openwrtcn Says:

    Gread guide! Thank you!

    Can you give some hints about howto build such live usb based on ex2 filesys?

    • macbruins Says:

      Sorry, I don’t follow. Do you want to format your USB flash drive with ext2? Or do you want to install the OpenWRT ext2 image on your USB flash drive, treating it as a regular hard drive?

  4. Luis Cruz Says:

    Hi macbruins and thankyou for a great guide…

    I do have one problem, I installed just the 10.03 part on a 256 MB stick
    I then istalled some small packages + samba + transmission all went well.
    Later I wanted to install hdparm to set drive parameters and is telling me that it run out of disk space.
    Being a novice I don’t know what to do to increase the size of the now 48MB root partition since there is plenty more space on the stick.

    Thanks again

    • macbruins Says:

      Hi, Luis, glad you find my write-up useful. Regarding the root partition size, do you have root privilege on a Fedora, Ubuntu, or some other desktop Linux? If you do, I’ll write up the instructions for you.

  5. Luis Cruz Says:

    Hi macbruins , thanks for your quick response to my inquiry actually it was my fault, the /root partition was being filled by the misconfigured transmission package which was downloading into that partition.
    Anyway I did found another problem, I can change the password on the command line, but whenever I go into the web interface it does not ask for password, I try to change it there and it returns the following error.

    “Updating you configuration…

    processing config file httpd.conf
    /usr/lib/webif/apply.sh: line 353: /etc/init.4/httpd: not found”

    Any ideas?

    Other than that it is running great.
    Hope to hear from you soon.
    Luis

    • macbruins Says:

      Luis, glad you solved your problem.
      RE new problem: Is there a type in this line?
      /usr/lib/webif/apply.sh: line 353: /etc/init.4/httpd: not found”
      Are you sure it says “init.4” and not “init.d“? I’m going to guess it’s supposed to be “init.d” because I’ve never seen “init.4” before. Now, missing /etc/init.d/httpd means you should re-install OpenWrt. /etc/init.d/httpd is a script that starts the web server for the OpenWrt GUI. It’s pre-installed in the official disk image. It wouldn’t be missing unless you deleted it or something pretty bad happened. If something bad happened, starting from scratch is safer than trying to repair the installation.

  6. c.cobb Says:

    Hey, great write up… I did get the backfire cross compiler working earlier (x86 and ar7xx) but didn’t didn’t do much with it. Now I’d like to get back to that project, and this will be a nice jump start.

    You mention “And of course Live USB can be created on a Linux system, but I don’t plan to write up the instructions. Leave a comment if you need help with that.”

    Do you use syslinux to create a Live USB on Linux? I thought the ‘-m’ option only works on Windows… do you use a different boot loader for this, or how do you get the MBR updated? Thanks,

    • macbruins Says:

      You’re right. “-m” works only on Windows. On Linux you’ll type syslinux -i /dev/sdb or something similar, where “-i” stands for “install”. Hope that helps. Thanks for the compliment.

  7. euphorbiumEuphorbium Says:

    I have finally managed to boot openwrt from usb using your method, but only 10.03 boots up, 10.03.1-rc6 gives me kernel panic not syncing error. Why do you think this would happen?

    • macbruins Says:

      There are probably mistakes in your syslinux.cfg. kernel panic often happens when the kernel can’t access the disk image. Since you can boot 10.03 but not 10.03.1-rc6, probably there are errors in your 10.03.1-rc6 section. Check all lines carefully. If you used my example as the starting point, make sure you change all “10.03.1-rc5”.

  8. euphorbiumEuphorbium Says:

    Thats not it, I’ve changed all 10.03.1-rc5 to 10.03.1-rc6 automatically using notepad++, and its correct. It must be something else.

    • macbruins Says:

      check file names? Don’t know what else to say. Other possibilities exist but are not as likely. I want to avoid a debug session here. If you set up another location/site/blog, perhaps we can continue there.

  9. Tom Duffy Says:

    Hey great guide, I’ve been using this for a while now.

    I know it just came out, but any chance of getting the initramfs.img compiled for the final 10.03.1 stable release from a couple of days ago? I’ll owe you big time.

  10. jilebi Says:

    Hi,

    I followed the instructions above. However, when I boot the PC with the USB stick, the OS starts loading and within a split second the boot process ends with a kernel panic and halts. Since the screen scrolls so fast, I cannot even see what the error is. Any ideas on what the issue could be? Is the initramfs only for specific hardware? Anybody else have this issue?

    • macbruins Says:

      Sorry for the late reply. Does your PC have a serial port? If you use that as your console, the text will be captured in the terminal program’s scroll buffer. If you’d like to discuss your problem further, please send me email at “macbruins at gmail dot com”.

  11. spacemonkey3 Says:

    How can i automatically mount usb disk (/dev/sda0) to /root when boot is finished?

    • macbruins Says:

      I wouldn’t do that. I tried mounting /dev/sda0 a few times, but often the USB disk or the root disk image became corrupted. I did not find the cause. If you need to access USB storage, either create two partitions on a disk or get two USB disks. Either way, you can modify /etc/config/fstab to mount /dev/sda1 automatically.

      • spacemonkey3 Says:

        I created 2 partitions. right now it works with everything loaded from ramdisk, including usb storage driver… e.g. the root is in ramdisk and i can mount usb stick partition2 to /root so that i can run app from it. That is also not very handy, as I have to rebuild it for every minor change in config files. Any idea how can i install root filesystem to usb stick and mount it?

      • macbruins Says:

        Why not store your apps in the root partition? Why do you need to rebuild when configuration changes? The root file system is stored on the USB drive and writable.

  12. Rafael Sart Says:

    Hello!
    Great Tutorial! I’ve had success by following it.

    Thanks,
    R

  13. Thomas Says:

    PLEASE UPLOAD NEW initramfs.img for attitude_adjustment/12.09-beta/
    !!!!!!!!!!!!!!!!!
    THANKS 🙂


Leave a reply to Rafael Sart Cancel reply