Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Add x-loader bootloader
@ 2011-04-13 21:30 Philippe Reynes
  2011-04-19 20:25 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Reynes @ 2011-04-13 21:30 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Philippe Reynes <tremyfr@yahoo.fr>
---
 boot/Config.in            |    1 +
 boot/x-loader/Config.in   |   13 +++++++++++++
 boot/x-loader/x-loader.mk |   37 +++++++++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 0 deletions(-)
 create mode 100644 boot/x-loader/Config.in
 create mode 100644 boot/x-loader/x-loader.mk

diff --git a/boot/Config.in b/boot/Config.in
index 6bcc98a..a7052b4 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -7,6 +7,7 @@ source "boot/syslinux/Config.in"
 source "boot/u-boot/Config.in"
 source "boot/at91bootstrap/Config.in"
 source "boot/at91dataflashboot/Config.in"
+source "boot/x-loader/Config.in"
 
 endmenu
 
diff --git a/boot/x-loader/Config.in b/boot/x-loader/Config.in
new file mode 100644
index 0000000..4c71d03
--- /dev/null
+++ b/boot/x-loader/Config.in
@@ -0,0 +1,13 @@
+menuconfig BR2_TARGET_XLOADER
+	bool "X-loader"
+	help
+	  The x-loader bootloader.
+
+if BR2_TARGET_XLOADER
+config BR2_TARGET_XLOADER_BOARDNAME
+	string "x-loader board name"
+	help
+	  One of x-loader supported boards to be built.
+	  This will be suffixed with _config to meet x-loader 
+	  standard naming.  
+endif
diff --git a/boot/x-loader/x-loader.mk b/boot/x-loader/x-loader.mk
new file mode 100644
index 0000000..37aaf1d
--- /dev/null
+++ b/boot/x-loader/x-loader.mk
@@ -0,0 +1,37 @@
+#############################################################
+#
+# x-loader
+#
+#############################################################
+XLOADER_VERSION:=6f3a26101303051e0f91b6213735b68ce804e94e
+XLOADER_SITE:=git://gitorious.org/x-loader/x-loader.git
+XLOADER_BOARD_NAME:=$(call qstrip,$(BR2_TARGET_XLOADER_BOARDNAME))
+
+define XLOADER_BUILD_CMDS
+	$(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" -C $(@D) $(XLOADER_BOARD_NAME)_config
+	$(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" -C $(@D) all
+	$(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" -C $(@D) ift
+endef
+
+define XLOADER_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/MLO $(BINARIES_DIR)/
+endef
+
+$(eval $(call GENTARGETS,boot,xloader))
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(BR2_TARGET_XLOADER),y)
+TARGETS+=xloader
+
+# we NEED a board name unless we're at make source
+ifeq ($(filter source,$(MAKECMDGOALS)),)
+ifeq ($(XLOADER_BOARD_NAME),)
+$(error NO x-loader board name set. Check your BR2_TARGET_XLOADER_BOARDNAME setting)
+endif
+endif
+
+endif
-- 
1.7.1

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

* [Buildroot] [PATCH] Add x-loader bootloader
  2011-04-13 21:30 [Buildroot] [PATCH] Add x-loader bootloader Philippe Reynes
@ 2011-04-19 20:25 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2011-04-19 20:25 UTC (permalink / raw)
  To: buildroot

Hi Philippe,

Great to see such a patch. I really like the fact that you leveraged
the package infrastructure to add support for x-loader. Actually, I
think we should use the package infrastructure for all bootloaders and
for the kernel as well, so that we can easily benefits from
improvements made at the package infrastructure level.

On Wed, 13 Apr 2011 23:30:08 +0200
Philippe Reynes <tremyfr@yahoo.fr> wrote:

> +define XLOADER_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/MLO $(BINARIES_DIR)/
> +endef

In order to properly support the kernel and bootloaders as packages, we
probably need to implement a <pkg>_INSTALL_IMAGES_CMDS thing, which
gets enabled on a per-package basis via a <pkg>_IMAGES_INSTALL = YES
value.

The kernel could for examples do :

 LINUX_IMAGES_INSTALL = YES

in order to tell that it wants to install the kernel image in
$(BINARIES_DIR), and it could also do :

 LINUX_TARGET_INSTALL = YES

in order to tell that it wants to install its kernel modules to the
target root filesystem. Same thing for U-Boot, which can build the
bootloader image, but also some target utilities like
fw_printenv/fw_setenv.

> +ifeq ($(BR2_TARGET_XLOADER),y)
> +TARGETS+=xloader

That should typically be done by the package infrastructure, but at the
moment, the package infrastructure assumes that the option is named
BR2_PACKAGE_<something>. We need to figure out to make this a little
bit more generic maybe.

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] 2+ messages in thread

end of thread, other threads:[~2011-04-19 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-13 21:30 [Buildroot] [PATCH] Add x-loader bootloader Philippe Reynes
2011-04-19 20:25 ` Thomas Petazzoni

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