-   Linux - General (
-   -   Grub2 boot from .img (

bforbes 05-15-2010 11:18 PM

Grub2 boot from .img
I'm trying to add ChromeOS-Flow to my multiboot grub2 USB stick. The site:

gives a .img file and it tells you to use USB-ImageWriter to write it to a USB stick. I'd rather do some loopback trickery, however. Can anyone help me with this?

vaniaspeedy 12-04-2010 04:44 PM

I've delved into GRUB and GRUB2 extensively, and I can tell you that grub2 and IMG files do not work well together.
The problem is that you have to load the img into RAM, and then at the right moment pass control of the boot process to the kernel, however grub2 has timing issues.
What I would personally reccomend is that if you have enough space, just extract the img file onto a USB stick. It will create 2 partitions, a C-STATE and C-ROOT. In C-ROOT/boot you will find the file extlinux.conf. It will have this entry:


  label chromeos-usb
  menu label chromeos-usb
  kernel vmlinuz
  append quiet console=tty2 initrd=initrd.img init=/sbin/init boot=local rootwait root=LABEL=C-ROOT rw noresume noswap i915.modeset=1 loglevel=1

You can then edit your /etc/grub.d/40_custom file to pass control and load the kernel with the same parameters as the ChromeOS loader does.

menuentry ChromeOS' --class chromeOS --class gnu-linux --class gnu --class os {
        insmod ext3
        set root='(hdX,Y)'
        search --no-floppy --fs-uuid --set 4c921566-bae8-49fb-b6fa-92e675353dd6
        linux        /boot/vmlinuz root=UUID=4c921566-bae8-49fb-b6fa-92e675353dd6 quiet console=tty2 init=/sbin/init boot=local rootwait root=LABEL=C-ROOT rw noresume noswap i915.modeset=1 loglevel=1
        initrd        /boot/initrd.img

tips - notice I set the class as ChromeOS, you need to add that class to grub's configuration (google it)
change (hdX,Y) to the partition of C-ROOT
change 4c921566-bae8-49fb-b6fa-92e675353dd6 to the UUID of your partition (C-ROOT, find it through gparted or some other tool)

This might interest you:

Good luck, ask away if you need to, I'll help as much as I can.

jefro 12-06-2010 06:24 PM

Might have to use grub4dos if it even could work.

See for more ideas.

All times are GMT -5. The time now is 11:51 PM.