LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Grub2 boot from .img (http://www.linuxquestions.org/questions/linux-general-1/grub2-boot-from-img-808086/)

bforbes 05-15-2010 10:18 PM

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

http://chromeos.hexxeh.net/

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 03: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:

Code:

  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.
Code:

menuentry ChromeOS' --class chromeOS --class gnu-linux --class gnu --class os {
        recordfail
        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: http://www.lucas-nussbaum.net/blog/?p=485

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

jefro 12-06-2010 05:24 PM

Might have to use grub4dos if it even could work.

See pendrivelinux.com for more ideas.


All times are GMT -5. The time now is 06:24 PM.