Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] grub: build for host
@ 2011-08-21 16:51 Darius Augulis
  2011-09-04 12:20 ` Darius Augulis
  2011-09-05  6:57 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Darius Augulis @ 2011-08-21 16:51 UTC (permalink / raw)
  To: buildroot

Build Grub for host system. It provides grub binary,
which is useful for installing bootloader to removable
media when cross-compiling.

Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
---
 boot/grub/grub.mk |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/boot/grub/grub.mk b/boot/grub/grub.mk
index 2ce8eab..c5f4c1d 100644
--- a/boot/grub/grub.mk
+++ b/boot/grub/grub.mk
@@ -8,6 +8,7 @@ GRUB_VERSION = 0.97
 GRUB_SOURCE = grub_$(GRUB_VERSION).orig.tar.gz
 GRUB_PATCH  = grub_$(GRUB_VERSION)-35.diff.gz
 GRUB_SITE   = http://snapshot.debian.org/archive/debian/20080329T000000Z/pool/main/g/grub/
+GRUB_DEPENDENCIES = host-grub
 
 GRUB_CFLAGS=-DSUPPORT_LOOPDEV
 ifeq ($(BR2_LARGEFILE),)
@@ -46,6 +47,7 @@ define GRUB_DEBIAN_PATCHES
 endef
 
 GRUB_POST_PATCH_HOOKS += GRUB_DEBIAN_PATCHES
+HOST_GRUB_POST_PATCH_HOOKS += GRUB_DEBIAN_PATCHES
 
 GRUB_CONF_ENV = \
 	CFLAGS="$(TARGET_CFLAGS) $(GRUB_CFLAGS)"
@@ -54,9 +56,12 @@ GRUB_CONF_OPT = \
 	--disable-auto-linux-mem-opt \
 	$(GRUB_CONFIG-y)
 
-define GRUB_INSTALL_STAGING_CMDS
-	install -m 0755 -D $(@D)/grub/grub $(STAGING_DIR)/sbin/grub
-endef
+HOST_GRUB_CONF_ENV = \
+	CFLAGS="$(GRUB_CFLAGS) -fno-stack-protector" \
+	grub_cv_prog_objcopy_absolute=yes
+
+HOST_GRUB_CONF_OPT = \
+	--disable-auto-linux-mem-opt
 
 ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
 define GRUB_INSTALL_SPLASH
@@ -73,8 +78,12 @@ define GRUB_INSTALL_TARGET_CMDS
 	$(GRUB_INSTALL_SPLASH)
 endef
 
-define GRUB_UNINSTALL_STAGING_CMDS
-	rm -f $(STAGING_DIR)/sbin/grub
+define HOST_GRUB_INSTALL_CMDS
+	install -m 0755 -D $(@D)/grub/grub $(HOST_DIR)/sbin/grub
+endef
+
+define HOST_GRUB_UNINSTALL_CMDS
+	rm -f $(HOST_DIR)/sbin/grub
 endef
 
 define GRUB_UNINSTALL_TARGET_CMDS
@@ -83,3 +92,4 @@ define GRUB_UNINSTALL_TARGET_CMDS
 endef
 
 $(eval $(call AUTOTARGETS,boot,grub))
+$(eval $(call AUTOTARGETS,boot,grub,host))

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/2] grub: build for host
  2011-08-21 16:51 [Buildroot] [PATCH 1/2] grub: build for host Darius Augulis
@ 2011-09-04 12:20 ` Darius Augulis
  2011-09-05  6:57 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Darius Augulis @ 2011-09-04 12:20 UTC (permalink / raw)
  To: buildroot

On 08/21/2011 07:51 PM, Darius Augulis wrote:
> Build Grub for host system. It provides grub binary,
> which is useful for installing bootloader to removable
> media when cross-compiling.

Hi all,

please review this patch and merge if it's ok.
Thanks.

Darius A.

>
> Signed-off-by: Darius Augulis<augulis.darius@gmail.com>
> ---
>   boot/grub/grub.mk |   20 +++++++++++++++-----
>   1 files changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/boot/grub/grub.mk b/boot/grub/grub.mk
> index 2ce8eab..c5f4c1d 100644
> --- a/boot/grub/grub.mk
> +++ b/boot/grub/grub.mk
> @@ -8,6 +8,7 @@ GRUB_VERSION = 0.97
>   GRUB_SOURCE = grub_$(GRUB_VERSION).orig.tar.gz
>   GRUB_PATCH  = grub_$(GRUB_VERSION)-35.diff.gz
>   GRUB_SITE   = http://snapshot.debian.org/archive/debian/20080329T000000Z/pool/main/g/grub/
> +GRUB_DEPENDENCIES = host-grub
>
>   GRUB_CFLAGS=-DSUPPORT_LOOPDEV
>   ifeq ($(BR2_LARGEFILE),)
> @@ -46,6 +47,7 @@ define GRUB_DEBIAN_PATCHES
>   endef
>
>   GRUB_POST_PATCH_HOOKS += GRUB_DEBIAN_PATCHES
> +HOST_GRUB_POST_PATCH_HOOKS += GRUB_DEBIAN_PATCHES
>
>   GRUB_CONF_ENV = \
>   	CFLAGS="$(TARGET_CFLAGS) $(GRUB_CFLAGS)"
> @@ -54,9 +56,12 @@ GRUB_CONF_OPT = \
>   	--disable-auto-linux-mem-opt \
>   	$(GRUB_CONFIG-y)
>
> -define GRUB_INSTALL_STAGING_CMDS
> -	install -m 0755 -D $(@D)/grub/grub $(STAGING_DIR)/sbin/grub
> -endef
> +HOST_GRUB_CONF_ENV = \
> +	CFLAGS="$(GRUB_CFLAGS) -fno-stack-protector" \
> +	grub_cv_prog_objcopy_absolute=yes
> +
> +HOST_GRUB_CONF_OPT = \
> +	--disable-auto-linux-mem-opt
>
>   ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
>   define GRUB_INSTALL_SPLASH
> @@ -73,8 +78,12 @@ define GRUB_INSTALL_TARGET_CMDS
>   	$(GRUB_INSTALL_SPLASH)
>   endef
>
> -define GRUB_UNINSTALL_STAGING_CMDS
> -	rm -f $(STAGING_DIR)/sbin/grub
> +define HOST_GRUB_INSTALL_CMDS
> +	install -m 0755 -D $(@D)/grub/grub $(HOST_DIR)/sbin/grub
> +endef
> +
> +define HOST_GRUB_UNINSTALL_CMDS
> +	rm -f $(HOST_DIR)/sbin/grub
>   endef
>
>   define GRUB_UNINSTALL_TARGET_CMDS
> @@ -83,3 +92,4 @@ define GRUB_UNINSTALL_TARGET_CMDS
>   endef
>
>   $(eval $(call AUTOTARGETS,boot,grub))
> +$(eval $(call AUTOTARGETS,boot,grub,host))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/2] grub: build for host
  2011-08-21 16:51 [Buildroot] [PATCH 1/2] grub: build for host Darius Augulis
  2011-09-04 12:20 ` Darius Augulis
@ 2011-09-05  6:57 ` Thomas Petazzoni
  2011-09-06 16:16   ` Arnout Vandecappelle
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2011-09-05  6:57 UTC (permalink / raw)
  To: buildroot

Hello,

Le Sun, 21 Aug 2011 19:51:54 +0300,
Darius Augulis <augulis.darius@gmail.com> a ?crit :

> +GRUB_DEPENDENCIES = host-grub 

This raises a question similar to the one I asked for syslinux, but in
the opposite side. I don't think host-grub is a build dependency of the
target grub (i.e the target grub *can* be compiled without host-grub
being compiled), even though host-grub might be useful when grub is
enabled.

What should we do in this case? At least we should have a consistent
decision between syslinux (patches by Arnout) and grub (patches by
Darius).

I think we should create in the documentation a "Package specific
comments" part, in which we could detail some subtleties of various
packages.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/2] grub: build for host
  2011-09-05  6:57 ` Thomas Petazzoni
@ 2011-09-06 16:16   ` Arnout Vandecappelle
  0 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2011-09-06 16:16 UTC (permalink / raw)
  To: buildroot


On Monday 05 September 2011 08:57:31, Thomas Petazzoni wrote:
> Hello,
> 
> Le Sun, 21 Aug 2011 19:51:54 +0300,
> 
> Darius Augulis <augulis.darius@gmail.com> a ?crit :
> > +GRUB_DEPENDENCIES = host-grub
> 
> This raises a question similar to the one I asked for syslinux, but in
> the opposite side. I don't think host-grub is a build dependency of the
> target grub (i.e the target grub *can* be compiled without host-grub
> being compiled), even though host-grub might be useful when grub is
> enabled.

 In the case of grub, the dependency is in fact the inverse: you need staging-
grub to have properly cross-compiled stageXXX files.  (Well, actually, that 
didn't work for me at all so I just installed grub-legacy on my build machine; 
but I hope that is fixed with Darius' patches.)

> 
> What should we do in this case? At least we should have a consistent
> decision between syslinux (patches by Arnout) and grub (patches by
> Darius).

 Actually it's a bit similar to host-gdb: it's not used by buildroot itself, 
it's supposed to be used by the developer.  So it probably should be a 
configuration option to build host-bootloader-installers.

> I think we should create in the documentation a "Package specific
> comments" part, in which we could detail some subtleties of various
> packages.

 Yep.  After the asciidoc conversion :-)


 Regards,
 Arnout


-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  31BB CF53 8660 6F88 345D  54CC A836 5879 20D7 CF43

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-06 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-21 16:51 [Buildroot] [PATCH 1/2] grub: build for host Darius Augulis
2011-09-04 12:20 ` Darius Augulis
2011-09-05  6:57 ` Thomas Petazzoni
2011-09-06 16:16   ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox