[oe] x86->x86 GRUB bootable image in OE?

Peter Chubb peter.chubb at nicta.com.au
Tue Sep 29 00:05:01 UTC 2009


Here's the grub-native recipe.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: grub-native_0.97.bb
Type: application/octet-stream
Size: 324 bytes
Desc: not available
URL: <http://lists.openembedded.org/pipermail/openembedded-devel/attachments/20090929/dfd6e6d2/attachment-0002.obj>
-------------- next part --------------


We use it something like this, in a different recipe for building the
image:


HOST_ARCH may need tweaking.

GRUB=${STAGING_DIR}/${HOST_ARCH}-linux/usr/lib/grub/${HOST_ARCH}-pc

#Build the image
dd if=/dev/zero of="${IMAGE}" bs=1M count=$SZ

# Set up mtools
echo "drive c: file=\"$IMAGE\" partition=1" > mtoolsrc
export MTOOLSRC=mtoolsrc

# Create filesystem

mpartition -I c:
mpartition -c -t $CYLINDERS -h 16 -s 63 c:
mformat c:
mmd c:/boot
mmd c:/boot/grub

# Install grub
mcopy "${GRUB}/stage1" c:/boot/grub
mcopy "${GRUB}/stage2" c:/boot/grub
mcopy "${GRUB}/fat_stage1_5" c:/boot/grub

echo "(hd0) $IMAGE" > bmap
echo -e "geometry (hd0) $CYLINDERS 16 63\nroot (hd0,0)\nsetup (hd0)" | grub --device-map=bmap --batch



--
Dr Peter Chubb        www.nicta.com.au      peter DOT chubb AT nicta.com.au
http://www.ertos.nicta.com.au           ERTOS within National ICT Australia
From Imagination to Impact                       Imagining the (ICT) Future


More information about the Openembedded-devel mailing list