summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2012-09-06 12:55:47 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-09-06 18:13:48 +0200
commit7631c658857420a0c968f9e26715e137635e2b31 (patch)
treef2cd29407e602ff69cd0d750f1d619234499fefc
parent2bf34e753f15d5c6c0c5894f5797e065fdd8d4c1 (diff)
downloadptxdist-2012.09.0.tar.gz
ptxdist-2012.09.0.tar.xz
newpackage: add possibility to create extra barebox packagesptxdist-2012.09.0
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/templates/template-barebox-in7
-rw-r--r--rules/templates/template-barebox-make89
-rw-r--r--scripts/lib/ptxd_lib_template.sh11
3 files changed, 107 insertions, 0 deletions
diff --git a/rules/templates/template-barebox-in b/rules/templates/template-barebox-in
new file mode 100644
index 000000000..44d920f4f
--- /dev/null
+++ b/rules/templates/template-barebox-in
@@ -0,0 +1,7 @@
+## SECTION=bootloader
+
+config BAREBOX_@PACKAGE@
+ tristate
+ prompt "Barebox (@package@)"
+ help
+ FIXME
diff --git a/rules/templates/template-barebox-make b/rules/templates/template-barebox-make
new file mode 100644
index 000000000..23f00a6f9
--- /dev/null
+++ b/rules/templates/template-barebox-make
@@ -0,0 +1,89 @@
+# -*-makefile-*-
+#
+# Copyright (C) @YEAR@ by @AUTHOR@
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_BAREBOX_@PACKAGE@) += barebox-@package@
+
+#
+# Paths and names
+#
+BAREBOX_@PACKAGE@_VERSION := @VERSION@
+BAREBOX_@PACKAGE@_MD5 :=
+BAREBOX_@PACKAGE@ := barebox-$(BAREBOX_@PACKAGE@_VERSION)
+BAREBOX_@PACKAGE@_SUFFIX := tar.bz2
+BAREBOX_@PACKAGE@_DIR := $(BUILDDIR)/barebox-@package@-$(BAREBOX_@PACKAGE@_VERSION)
+BAREBOX_@PACKAGE@_CONFIG := $(PTXDIST_PLATFORMCONFIGDIR)/barebox-@package@.config.$(BAREBOX_@PACKAGE@_VERSION)
+BAREBOX_@PACKAGE@_LICENSE := GPLv2
+BAREBOX_@PACKAGE@_URL := $(call barebox-url, BAREBOX_@PACKAGE@)
+BAREBOX_@PACKAGE@_SOURCE := $(SRCDIR)/$(BAREBOX_@PACKAGE@).$(BAREBOX_@PACKAGE@_SUFFIX)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+BAREBOX_@PACKAGE@_CONF_ENV := KCONFIG_NOTIMESTAMP=1 HOST_EXTRACFLAGS="$(HOST_CPPFLAGS)"
+BAREBOX_@PACKAGE@_CONF_OPT := $(call barebox-opts, BAREBOX_@PACKAGE@)
+
+BAREBOX_@PACKAGE@_MAKE_ENV := $(BAREBOX_@PACKAGE@_CONF_ENV)
+BAREBOX_@PACKAGE@_MAKE_OPT := $(BAREBOX_@PACKAGE@_CONF_OPT)
+
+BAREBOX_@PACKAGE@_IMAGES := @image@
+BAREBOX_@PACKAGE@_IMAGES := $(addprefix $(BAREBOX_@PACKAGE@_DIR)/,$(BAREBOX_@PACKAGE@_IMAGES))
+
+ifdef PTXCONF_BAREBOX_@PACKAGE@
+$(BAREBOX_@PACKAGE@_CONFIG):
+ @echo
+ @echo "****************************************************************************"
+ @echo " Please generate a bareboxconfig with 'ptxdist menuconfig barebox-@package@'"
+ @echo "****************************************************************************"
+ @echo
+ @echo
+ @exit 1
+endif
+
+$(STATEDIR)/barebox-@package@.prepare: $(BAREBOX_@PACKAGE@_CONFIG)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+BAREBOX_@PACKAGE@_INSTALL_OPT := \
+ $(call barebox-opts, BAREBOX_@PACKAGE@)
+
+$(STATEDIR)/barebox-@package@.install:
+ @$(call targetinfo)
+# @mkdir -p $(BAREBOX_@PACKAGE@_PKGDIR)/usr/lib/$(BAREBOX_@PACKAGE@)
+# install -m 644 $(image)
+# $(BAREBOX_@PACKAGE@_PKGDIR)/usr/lib/$(BAREBOX_@PACKAGE@)/$(notdir $(image));
+ @$(foreach image, $(BAREBOX_@PACKAGE@_IMAGES), \
+ install -m 644 \
+ $(image) $(IMAGEDIR)/$(notdir $(image))-@package@;)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox-@package@.clean:
+ @$(call targetinfo)
+ @$(call clean_pkg, BAREBOX_@PACKAGE@)
+ @$(foreach image, $(BAREBOX_@PACKAGE@_IMAGES), \
+ rm -fv $(IMAGEDIR)/$(notdir $(image))-@package@;)
+
+# ----------------------------------------------------------------------------
+# oldconfig / menuconfig
+# ----------------------------------------------------------------------------
+
+barebox-@package@_oldconfig barebox-@package@_menuconfig barebox-@package@_nconfig: $(STATEDIR)/barebox-@package@.extract
+ @$(call world/kconfig, BAREBOX_@PACKAGE@, $(subst barebox-@package@_,,$@))
+
+# vim: syntax=make
diff --git a/scripts/lib/ptxd_lib_template.sh b/scripts/lib/ptxd_lib_template.sh
index ceccc5359..b4d8ff0d8 100644
--- a/scripts/lib/ptxd_lib_template.sh
+++ b/scripts/lib/ptxd_lib_template.sh
@@ -382,6 +382,17 @@ export -f ptxd_template_new_kernel
ptxd_template_help_list[${#ptxd_template_help_list[@]}]="kernel"
ptxd_template_help_list[${#ptxd_template_help_list[@]}]="create package for an extra kernel"
+ptxd_template_new_barebox() {
+ export class="barebox-"
+ ptxd_template_read_basic &&
+ ptxd_template_read "enter barebox image" image "barebox.bin"
+ ptxd_template_read_author &&
+ ptxd_template_write_platform_rules
+}
+export -f ptxd_template_new_barebox
+ptxd_template_help_list[${#ptxd_template_help_list[@]}]="barebox"
+ptxd_template_help_list[${#ptxd_template_help_list[@]}]="create package for an extra barebox"
+
ptxd_template_new_image_tgz() {
export class="image-"
ptxd_template_read_name &&