summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Hieber <r.hieber@pengutronix.de>2018-06-13 12:35:38 +0200
committerRoland Hieber <r.hieber@pengutronix.de>2018-06-13 16:28:16 +0200
commit4ec61ae785599ae0cbbeac075985cc929729ae12 (patch)
treeb97a8f35853b9126cab86b02070435ff369285fc
parentff6868908d7a82b3cdf563b7af332bd0f86152ac (diff)
downloadbarebox-4ec61ae785599ae0cbbeac075985cc929729ae12.tar.gz
barebox-4ec61ae785599ae0cbbeac075985cc929729ae12.tar.xz
debian: import upstream patch to facilitate building host tools
HOST_EXTRACFLAGS is only needed in the respective make call and has no futher consequences if set on the outside. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>
-rw-r--r--debian/control2
-rw-r--r--debian/patches/0004-scripts-create-a-separate-section-for-host-tools.patch164
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/rules27
4 files changed, 175 insertions, 19 deletions
diff --git a/debian/control b/debian/control
index 0c1e7cb8a3..bef318622f 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: barebox
Section: devel
Priority: optional
Maintainer: Roland Hieber <r.hieber@pengutronix.de>
-Build-Depends: debhelper (>= 11~), gcc-arm-linux-gnueabihf
+Build-Depends: debhelper (>= 11~)
Standards-Version: 4.1.4
Homepage: https://barebox.org
Vcs-Browser: https://git.pengutronix.de/cgit/debian/barebox
diff --git a/debian/patches/0004-scripts-create-a-separate-section-for-host-tools.patch b/debian/patches/0004-scripts-create-a-separate-section-for-host-tools.patch
new file mode 100644
index 0000000000..080a59a6ea
--- /dev/null
+++ b/debian/patches/0004-scripts-create-a-separate-section-for-host-tools.patch
@@ -0,0 +1,164 @@
+From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Sat, 9 Jun 2018 09:27:56 +0200
+Subject: scripts: create a separate section for host tools
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+This allows to enable host tools even if they are not needed for the
+current configuration to improve compile coverage and simplify packaging
+these tools. The conversion doesn't cover all tools available but can be
+extended later.
+
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Origin: https://git.pengutronix.de/cgit/barebox/commit/?h=next&id=526dddf4c3
+Applied-Upstream: commit:526dddf4c3
+---
+ Kconfig | 2 ++
+ arch/arm/Kconfig | 1 -
+ arch/arm/mach-omap/Kconfig | 6 ------
+ scripts/Kconfig | 51 ++++++++++++++++++++++++++++++++++++++++++++++
+ scripts/Makefile | 6 +++---
+ scripts/imx/Kconfig | 4 ++--
+ 6 files changed, 58 insertions(+), 12 deletions(-)
+ create mode 100644 scripts/Kconfig
+
+diff --git a/Kconfig b/Kconfig
+index 53d4f5a..197dd1c 100644
+--- a/Kconfig
++++ b/Kconfig
+@@ -9,3 +9,5 @@ config SRCARCH
+ option env="SRCARCH"
+
+ source "arch/$SRCARCH/Kconfig"
++
++source "scripts/Kconfig"
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 37cde0c..c1a89e1 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -265,7 +265,6 @@ source arch/arm/mach-ep93xx/Kconfig
+ source arch/arm/mach-highbank/Kconfig
+ source arch/arm/mach-imx/Kconfig
+ source arch/arm/mach-mxs/Kconfig
+-source scripts/imx/Kconfig
+ source arch/arm/mach-mvebu/Kconfig
+ source arch/arm/mach-netx/Kconfig
+ source arch/arm/mach-nomadik/Kconfig
+diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
+index e8fc4b8..c451cf0 100644
+--- a/arch/arm/mach-omap/Kconfig
++++ b/arch/arm/mach-omap/Kconfig
+@@ -138,12 +138,6 @@ config OMAP3_USBBOOT
+ which is already initialized by the ROM code. Use the omap3-usb-loader
+ tool selectable below to upload images.
+
+-config OMAP3_USB_LOADER
+- bool "enable omap3 USB loader host tool"
+- depends on ARCH_OMAP3
+- help
+- Say Y here to build the omap3 usb loader tool.
+-
+ config OMAP_SERIALBOOT
+ bool "enable booting from serial"
+ select XYMODEM
+diff --git a/scripts/Kconfig b/scripts/Kconfig
+new file mode 100644
+index 0000000..14a577a
+--- /dev/null
++++ b/scripts/Kconfig
+@@ -0,0 +1,51 @@
++menu "Host Tools"
++
++config COMPILE_HOST_TOOLS
++ bool "Allow to enable unused host tools"
++ help
++ Usually the needed host tools are selected (or selectable) depending
++ on some config options. If you say yes here, the host tools that are
++ not needed can be selected, too.
++
++ This is usefull for compile coverage testing and for packaging the
++ host tools.
++
++source scripts/imx/Kconfig
++
++config MVEBU_HOSTTOOLS
++ bool "mvebu hosttools" if COMPILE_HOST_TOOLS
++ depends on ARCH_MVEBU || COMPILE_HOST_TOOLS
++ default y if ARCH_MVEBU
++ help
++ This enables building the tools kwbimage to create an image suitable
++ for Marvell mvebu machines and kwboot to boot via UART.
++
++config MXS_HOSTTOOLS
++ bool "mxs hosttools" if COMPILE_HOST_TOOLS
++ depends on ARCH_MXS || COMPILE_HOST_TOOLS
++ default y if ARCH_MXS
++ help
++ This builds the tools mxsimage and mxsboot which are needed to
++ create bootable image files for mxs. You need openssl development
++ files to compile this tool.
++
++config OMAP3_USB_LOADER
++ bool "omap3 USB loader"
++ depends on ARCH_OMAP3 || COMPILE_HOST_TOOLS
++ help
++ Say Y here to build the omap3 usb loader tool.
++
++ You need libusb-1.0 to compile this tool.
++
++config OMAP4_HOSTTOOL_USBBOOT
++ bool "omap4 usbboot"
++ depends on (ARCH_OMAP4 && !MMU) || COMPILE_HOST_TOOLS
++ default y if OMAP4_USBBOOT
++ help
++ Say Y here to build the omap4 usb loader tool.
++ Note that you need to enable OMAP4_USBBOOT to create an image
++ suitable to boot using this tool.
++
++ You need libusb-1.0 to compile this tool.
++
++endmenu
+diff --git a/scripts/Makefile b/scripts/Makefile
+index 8eda41e..59d22e1 100644
+--- a/scripts/Makefile
++++ b/scripts/Makefile
+@@ -12,14 +12,14 @@ hostprogs-y += bareboxcrc32
+ hostprogs-y += kernel-install
+ hostprogs-$(CONFIG_IMD) += bareboximd
+ hostprogs-$(CONFIG_KALLSYMS) += kallsyms
+-hostprogs-$(CONFIG_ARCH_MVEBU) += kwbimage kwboot
++hostprogs-$(CONFIG_MVEBU_HOSTTOOLS) += kwbimage kwboot
+ hostprogs-$(CONFIG_ARCH_NETX) += gen_netx_image
+ hostprogs-$(CONFIG_ARCH_OMAP) += omap_signGP mk-omap-image
+ hostprogs-$(CONFIG_ARCH_S5PCxx) += s5p_cksum
+ hostprogs-$(CONFIG_ARCH_DAVINCI) += mkublheader
+ hostprogs-$(CONFIG_ARCH_ZYNQ) += zynq_mkimage
+ hostprogs-$(CONFIG_ARCH_SOCFPGA) += socfpga_mkimage
+-hostprogs-$(CONFIG_ARCH_MXS) += mxsimage mxsboot
++hostprogs-$(CONFIG_MXS_HOSTTOOLS)+= mxsimage mxsboot
+ HOSTCFLAGS += -I$(srctree)/scripts/include/
+ HOSTLOADLIBES_mxsimage = `pkg-config --libs openssl`
+ HOSTCFLAGS_omap3-usb-loader.o = `pkg-config --cflags libusb-1.0`
+@@ -27,7 +27,7 @@ HOSTLOADLIBES_omap3-usb-loader = `pkg-config --libs libusb-1.0`
+ hostprogs-$(CONFIG_OMAP3_USB_LOADER) += omap3-usb-loader
+ HOSTCFLAGS_omap4_usbboot.o = `pkg-config --cflags libusb-1.0`
+ HOSTLOADLIBES_omap4_usbboot = -lpthread `pkg-config --libs libusb-1.0`
+-hostprogs-$(CONFIG_OMAP4_USBBOOT) += omap4_usbboot
++hostprogs-$(CONFIG_OMAP4_HOSTTOOL_USBBOOT) += omap4_usbboot
+
+ subdir-y += mod
+ subdir-y += imx
+diff --git a/scripts/imx/Kconfig b/scripts/imx/Kconfig
+index fda9c63..ef83fa1 100644
+--- a/scripts/imx/Kconfig
++++ b/scripts/imx/Kconfig
+@@ -1,6 +1,6 @@
+ config ARCH_IMX_USBLOADER
+- depends on ARCH_MXS || ARCH_IMX
+- bool "compile imx-usb-loader"
++ depends on ARCH_MXS || ARCH_IMX || COMPILE_HOST_TOOLS
++ bool "imx-usb-loader"
+ help
+ imx-usb-loader is a tool to upload and start imximages to an i.MX SoC
+ in ROM boot mode. It requires libusb, so make sure you have the libusb
diff --git a/debian/patches/series b/debian/patches/series
index 58e7d8d3b3..92a1a3ac3b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
0001-imx-usb-loader-Align-uploaded-file-length.patch
0002-imx-usb-loader-Fix-verify-for-non-word-aligned-lengt.patch
0003-imx-usb-loader-dump-memory-bytewise-on-verification-.patch
+0004-scripts-create-a-separate-section-for-host-tools.patch
diff --git a/debian/rules b/debian/rules
index 4395be3b8f..4a4b3a957b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,22 +6,13 @@ export DH_VERBOSE =1
%:
dh $@
-# not all tools are built in all configs... :-/
-# some files in scripts/ depend on the target compiler
-HOST_EXTRACFLAGS = "-g"
override_dh_auto_build:
- # imx-usb-loader, and the non-arch-dependent tools
- $(MAKE) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- imx_v7_defconfig
- echo CONFIG_ARCH_IMX_USBLOADER=y >> .config
- $(MAKE) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- oldconfig
- $(MAKE) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- HOST_EXTRACFLAGS="-g" -j scripts/
- #
- # omap3-usb-loader
- $(MAKE) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- omap3530_beagle_xload_defconfig
- $(MAKE) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- oldconfig
- $(MAKE) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- HOST_EXTRACFLAGS="-g" -j scripts/
- #
- # omap4_usbboot
- $(MAKE) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- archosg9_defconfig
- $(MAKE) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- oldconfig
- $(MAKE) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- HOST_EXTRACFLAGS="-g" -j scripts/
+ make ARCH=sandbox defconfig
+ echo 'CONFIG_COMPILE_HOST_TOOLS=y' >> .config
+ echo 'CONFIG_ARCH_IMX_USBLOADER=y' >> .config
+ echo '# CONFIG_MVEBU_HOSTTOOLS is not set' >> .config
+ echo '# CONFIG_MXS_HOSTTOOLS is not set' >> .config
+ echo 'CONFIG_OMAP3_USB_LOADER=y' >> .config
+ echo 'CONFIG_OMAP4_HOSTTOOL_USBBOOT=y' >> .config
+ make ARCH=sandbox oldconfig
+ make ARCH=sandbox HOST_EXTRACFLAGS="-g" -j scripts/