* x86->x86 GRUB bootable image in OE?
@ 2009-09-28 20:21 Leon Woestenberg
2009-09-28 21:06 ` Peter Chubb
0 siblings, 1 reply; 6+ messages in thread
From: Leon Woestenberg @ 2009-09-28 20:21 UTC (permalink / raw)
To: openembedded-devel
Hello,
on x86 target support, I have some ideas how to create bootable disk
images from OE using GRUB (not using the post image command approach).
However, I suspect this will only work if we have GRUB on the host,
i.e. assume a x86 host, and have grub-native.
grub-native would be step one, but I am having a hard time getting the
staging to work.
In general, for staging host-native tools, do we use the "make
install" approach?
Regards,
Leon.
DESCRIPTION = "GRand Unified Bootloader"
HOMEPAGE = "http://www.gnu.org/software/grub"
SECTION = "bootloaders"
PRIORITY = "optional"
RDEPENDS_${PN}-install = "diffutils"
PR = "r5"
SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz \
file://automake-1.10.patch;patch=1 \
file://menu.lst"
inherit autotools_stage native
CFLAGS += "-fno-stack-protector"
#do_install() {
# oenote do_install
# oenote DESTDIR=${D}
# oe_runmake 'DESTDIR=${D}' install
#}
do_stage() {
oenote do_stage
oenote DESTDIR=${STAGING_DIR_HOST}
oe_runmake 'DESTDIR=${STAGING_DIR_HOST}' install
}
#do_stage() {
# oe_runmake 'DESTDIR=${STAGING_DIR_HOST}' install
# install -m 0644 -D ${WORKDIR}/menu.lst ${}/boot/grub/menu.lst
#
# # Copy stage1/1_5/2 files to /boot/grub
# GRUB_TARGET_ARCH=$(echo ${TARGET_ARCH} | sed -e 's/.86/386/')
# install -m 0744 -d ${STAGING_DIR_HOST}/boot/grub/
# install -m 0644 \
# ${D}/${libdir}/grub/${GRUB_TARGET_ARCH}${TARGET_VENDOR}/* \
# ${STAGING_DIR_HOST}/boot/grub/
#}
PACKAGES =+ "${PN}-install ${PN}-eltorito"
FILES_${PN}-install = " \
${sbindir}/grub-install \
${sbindir}/grub-terminfo \
${sbindir}/grub-md5-crypt \
${bindir}/mbchk \
${libdir}/grub \
"
FILES_${PN}-eltorito = "/boot/grub/stage2_eltorito"
FILES_${PN} += "/boot"
COMPATIBLE_HOST = "i.86.*-linux"
--
Leon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: x86->x86 GRUB bootable image in OE?
2009-09-28 20:21 x86->x86 GRUB bootable image in OE? Leon Woestenberg
@ 2009-09-28 21:06 ` Peter Chubb
2009-09-28 21:49 ` Leon Woestenberg
0 siblings, 1 reply; 6+ messages in thread
From: Peter Chubb @ 2009-09-28 21:06 UTC (permalink / raw)
To: openembedded-devel
>>>>> "Leon" == Leon Woestenberg <leon.woestenberg@gmail.com> writes:
Leon> Hello, on x86 target support, I have some ideas how to create
Leon> bootable disk images from OE using GRUB (not using the post
Leon> image command approach).
Leon> However, I suspect this will only work if we have GRUB on the
Leon> host, i.e. assume a x86 host, and have grub-native.
We tried this for our system. You need to split grub into the
grub-installer part and the grub part, and the way that grub 0.97
works doesn't really fit nicely. Grub 2 may be better.
We ended up switching to syslinux which works nicely cross-platform.
Peter C
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: x86->x86 GRUB bootable image in OE?
2009-09-28 21:06 ` Peter Chubb
@ 2009-09-28 21:49 ` Leon Woestenberg
2009-09-28 22:05 ` Peter Chubb
0 siblings, 1 reply; 6+ messages in thread
From: Leon Woestenberg @ 2009-09-28 21:49 UTC (permalink / raw)
To: openembedded-devel
Hello Peter,
On Mon, Sep 28, 2009 at 11:06 PM, Peter Chubb <peter.chubb@nicta.com.au> wrote:
>>>>>> "Leon" == Leon Woestenberg <leon.woestenberg@gmail.com> writes:
>
> Leon> Hello, on x86 target support, I have some ideas how to create
> Leon> bootable disk images from OE using GRUB (not using the post
> Leon> image command approach).
>
> Leon> However, I suspect this will only work if we have GRUB on the
> Leon> host, i.e. assume a x86 host, and have grub-native.
>
> We tried this for our system. You need to split grub into the
> grub-installer part and the grub part, and the way that grub 0.97
> works doesn't really fit nicely. Grub 2 may be better.
>
> We ended up switching to syslinux which works nicely cross-platform.
>
It's good to know I could always bail out if it isn't going to work.
I think I have got grub working outside OE for this, I just need to
get things into OE.
Do you maybe still have any recipe that at least stages grub for the host?
Regards,
--
Leon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: x86->x86 GRUB bootable image in OE?
2009-09-28 21:49 ` Leon Woestenberg
@ 2009-09-28 22:05 ` Peter Chubb
2009-09-28 22:36 ` Leon Woestenberg
0 siblings, 1 reply; 6+ messages in thread
From: Peter Chubb @ 2009-09-28 22:05 UTC (permalink / raw)
To: openembedded-devel
>>>>> "Leon" == Leon Woestenberg <leon.woestenberg@gmail.com> writes:
Leon> Hello Peter, On Mon, Sep 28, 2009 at 11:06 PM, Peter Chubb
Leon> <peter.chubb@nicta.com.au> wrote:
Leon> Do you maybe still have any recipe that at least stages grub for
Leon> the host?
I have one at work --- I'll send it off when I get there.
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: x86->x86 GRUB bootable image in OE?
2009-09-28 22:05 ` Peter Chubb
@ 2009-09-28 22:36 ` Leon Woestenberg
2009-09-29 0:05 ` Peter Chubb
0 siblings, 1 reply; 6+ messages in thread
From: Leon Woestenberg @ 2009-09-28 22:36 UTC (permalink / raw)
To: openembedded-devel
Hello Peter,
On Tue, Sep 29, 2009 at 12:05 AM, Peter Chubb <peter.chubb@nicta.com.au> wrote:
> Leon> Do you maybe still have any recipe that at least stages grub for
> Leon> the host?
>
> I have one at work --- I'll send it off when I get there.
>
Tops.
I'll buy you a beer when I'm Down Under -- ...It's just, don't wait for that :-)
Regards,
--
Leon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: x86->x86 GRUB bootable image in OE?
2009-09-28 22:36 ` Leon Woestenberg
@ 2009-09-29 0:05 ` Peter Chubb
0 siblings, 0 replies; 6+ messages in thread
From: Peter Chubb @ 2009-09-29 0:05 UTC (permalink / raw)
To: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]
Here's the grub-native recipe.
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
[-- Attachment #2: grub-native_0.97.bb --]
[-- Type: application/octet-stream, Size: 338 bytes --]
DESCRIPTION = "GRand Unified Bootloader"
HOMEPAGE = "http://www.gnu.org/software/grub"
SECTION = "bootloaders"
DEPENDS = "libtool-native"
PR = "r0"
S = "${WORKDIR}/grub-${PV}"
SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz"
inherit autotools native
do_configure() {
oe_runconf CFLAGS="-fno-stack-protector"
}
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-09-29 0:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-28 20:21 x86->x86 GRUB bootable image in OE? Leon Woestenberg
2009-09-28 21:06 ` Peter Chubb
2009-09-28 21:49 ` Leon Woestenberg
2009-09-28 22:05 ` Peter Chubb
2009-09-28 22:36 ` Leon Woestenberg
2009-09-29 0:05 ` Peter Chubb
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.