Cross-compilation support improvement
cover Cross-compilation support improvement
Hi all,
This patch series improves cross-compilation support, mostly fixing the scripts to support target root location.
Now, to cross-compile kernel-backports, KLIB_BUILD should still point to the linux kernel build tree and, the new KROOT variable, to the target root location (instead of the target kernel module location, as mentionned at [1]):
---
make \
CROSS_COMPILE=<toolchain prefix> \
ARCH=<target architecture> \
KROOT=<target root directory> \
KLIB_BUILD=<kernel build directory>
---
This should not change anything when compiling backports for the build machine.
If this series breaks anything, please let me know.
The following changes since commit 44554cd57d0016c52aeed2ce4f27081b9d9c915f:
backports: select_queue patch: fix callback kernel version (2014-05-01 18:48:03 -0700)
are available in the git repository at:
git://github.com/tSed/backports.git sma/cross-compilation
for you to fetch changes up to 99add35cab73b890dd6810fa303ec0c0fa06218c:
backports: Makefile: update help text (2014-05-08 19:32:33 +0200)
Yours,
Samuel
[1] https://backports.wiki.kernel.org/index.php/Documentation#Cross_compile_with_Freescale.27s_LTIB
Samuel Martin (10):
backports: Makefile: introduce KROOT and fix INSTALL_MOD_PATH
definition
backports: Makefile: introduce KVERSION and rework KLIB definition
backports: Makefile: export KROOT and KVERSION variables
backports: blacklist.sh: support install root not in /
backports: check_depmod.sh: support install root not in /
backports: Makefile.real: use depmod.sh instead of the depmod program
backports: Makefile.real: disable update-initramfs.sh execution when
cross-compiling
backports: Makefile.real: silent reboot message when cross-compiling
backports: compress_module.sh: gzip silently overrides existing
compressed modules
backports: Makefile: update help text
backport/Makefile | 33 ++++++++++++++++++++++++--------- backport/Makefile.real | 24 ++++++++++++++++-------- backport/scripts/blacklist.sh | 7 ++++--- backport/scripts/check_depmod.sh | 7 ++++--- backport/scripts/compress_modules.sh | 2 +- 5 files changed, 49 insertions(+), 24 deletions(-)
--
1.9.2
PATCH 1/10 backports: Makefile: introduce KROOT and fix INSTALL_MOD_PATH definition
INSTALL_MOD_PATH should point to the root directory of the target rootfs, what is KROOT.
--- backport/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
backport/Makefile +3 -2
@@ -9,10 +9,11 @@ SHELL := /bin/bash BACKPORT_PWD := $(shell pwd) KMODDIR ?= updates -ifneq ($(origin KLIB), undefined) -KMODPATH_ARG := "INSTALL_MOD_PATH=$(KLIB)" +ifneq ($(origin KROOT), undefined) +KMODPATH_ARG := "INSTALL_MOD_PATH=$(KROOT)" else KLIB := /lib/modules/$(shell uname -r)/ +KROOT := / KMODPATH_ARG := endif KLIB_BUILD ?= $(KLIB)/build/
Signature · 1 line
1.9.2
PATCH 2/10 backports: Makefile: introduce KVERSION and rework KLIB definition
In reply to Samuel Martin--- backport/Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
backport/Makefile +9 -1
@@ -12,10 +12,18 @@ KMODDIR ?= updates ifneq ($(origin KROOT), undefined) KMODPATH_ARG := "INSTALL_MOD_PATH=$(KROOT)" else -KLIB := /lib/modules/$(shell uname -r)/ KROOT := / KMODPATH_ARG := endif + +ifneq ($(origin KLIB_BUILD), undefined) +KVERSION := $(shell $(MAKE) -C $(KLIB_BUILD) $(if $(ARCH),ARCH=$(ARCH)) \ + --no-print-directory -s kernelrelease) +else +KVERSION := $(shell uname -r) +endif + +KLIB := $(KROOT)/lib/modules/$(KVERSION) KLIB_BUILD ?= $(KLIB)/build/ KERNEL_CONFIG := $(KLIB_BUILD)/.config KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile
Signature · 1 line
1.9.2
PATCH 3/10 backports: Makefile: export KROOT and KVERSION variables
In reply to Samuel Martin--- backport/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
backport/Makefile +1 -1
@@ -29,7 +29,7 @@ KERNEL_CONFIG := $(KLIB_BUILD)/.config KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile CONFIG_MD5 := $(shell md5sum $(KERNEL_CONFIG) 2>/dev/null | sed 's/\s.*//') -export KLIB KLIB_BUILD BACKPORT_PWD KMODDIR KMODPATH_ARG +export KLIB KLIB_BUILD BACKPORT_PWD KMODDIR KMODPATH_ARG KROOT KVERSION # disable built-in rules for this file .SUFFIXES:
Signature · 1 line
1.9.2
PATCH 4/10 backports: blacklist.sh: support install root not in /
In reply to Samuel Martin--- backport/Makefile.real | 2 +- backport/scripts/blacklist.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-)
backport/Makefile.real +1 -1
@@ -92,7 +92,7 @@ install: modules @$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_PWD) \ INSTALL_MOD_DIR=$(KMODDIR) $(KMODPATH_ARG) \ modules_install - @./scripts/blacklist.sh $(KLIB)/ $(KLIB)/$(KMODDIR) + @./scripts/blacklist.sh $(KLIB)/ $(KLIB)/$(KMODDIR) $(KROOT) @./scripts/compress_modules.sh $(KLIB)/$(KMODDIR) @./scripts/check_depmod.sh @/sbin/depmod -a
backport/scripts/blacklist.sh +4 -3
@@ -1,10 +1,11 @@ #!/bin/bash -BLACKLIST_CONF="/etc/modprobe.d/backports.conf" -BLACKLIST_MAP=".blacklist.map" - MODULE_DIR=$1 MODULE_UPDATES=$2 +KROOT=$3 + +BLACKLIST_CONF="$KROOT/etc/modprobe.d/backports.conf" +BLACKLIST_MAP=".blacklist.map" if [[ ! -d $MODULE_DIR ]]; then exit
Signature · 1 line
1.9.2
PATCH 5/10 backports: check_depmod.sh: support install root not in /
In reply to Samuel Martin--- backport/Makefile.real | 6 ++++-- backport/scripts/check_depmod.sh | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-)
backport/Makefile.real +4 -2
@@ -6,6 +6,8 @@ else export BACKPORTS_GIT_TRACKER_DEF= endif +DEPMOD ?= /sbin/depmod + # disable built-in rules for this file .SUFFIXES:
@@ -94,8 +96,8 @@ install: modules modules_install @./scripts/blacklist.sh $(KLIB)/ $(KLIB)/$(KMODDIR) $(KROOT) @./scripts/compress_modules.sh $(KLIB)/$(KMODDIR) - @./scripts/check_depmod.sh - @/sbin/depmod -a + @./scripts/check_depmod.sh $(DEPMOD) $(KROOT) + @$(DEPMOD) -a @./scripts/update-initramfs.sh $(KLIB) @echo @echo Your backported driver modules should be installed now.
backport/scripts/check_depmod.sh +4 -3
@@ -6,13 +6,14 @@ # Seems Mandriva has an $DEPMOD_DIR but it doesn't have any files, # so lets deal with those distributions. -DEPMOD_CONF="/etc/depmod.conf" +DEPMOD_CMD="${1:-depmod}" +KROOT="${2:-/}" +DEPMOD_CONF="$KROOT/etc/depmod.conf" DEPMOD_CONF_TMP="$DEPMOD_CONF.backports.old" -DEPMOD_DIR="/etc/depmod.d/" +DEPMOD_DIR="$KROOT/etc/depmod.d/" BACKPORT_DEPMOD_FILE="backports.conf" GREP_REGEX_UPDATES="^[[:space:]]*search.*[[:space:]]updates\([[:space:]]\|$\)" GREP_REGEX_SEARCH="^[[:space:]]*search[[:space:]].\+$" -DEPMOD_CMD="depmod" function add_compat_depmod_conf { echo "NOTE: Your distribution lacks an $DEPMOD_DIR directory with "
Signature · 1 line
1.9.2
PATCH 6/10 backports: Makefile.real: use depmod.sh instead of the depmod program
In reply to Samuel MartinCall depmod.sh from the kernel source tree and set all parameter to improve cross-compilation support.
This way, target root location, kernel version and symbol prefix are also handled.
--- backport/Makefile.real | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
backport/Makefile.real +5 -1
@@ -97,7 +97,11 @@ install: modules @./scripts/blacklist.sh $(KLIB)/ $(KLIB)/$(KMODDIR) $(KROOT) @./scripts/compress_modules.sh $(KLIB)/$(KMODDIR) @./scripts/check_depmod.sh $(DEPMOD) $(KROOT) - @$(DEPMOD) -a + @$(KMODPATH_ARGS) $(KLIB_BUILD)/scripts/depmod.sh \ + $(DEPMOD) \ + $(KVERSION) \ + "$(shell sed -n '/^CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX=y/ s//_/p' \ + $(KLIB_BUILD)/.config)" @./scripts/update-initramfs.sh $(KLIB) @echo @echo Your backported driver modules should be installed now.
Signature · 1 line
1.9.2
PATCH 7/10 backports: Makefile.real: disable update-initramfs.sh execution when cross-compiling
In reply to Samuel Martin--- backport/Makefile.real | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
backport/Makefile.real +1 -1
@@ -102,7 +102,7 @@ install: modules $(KVERSION) \ "$(shell sed -n '/^CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX=y/ s//_/p' \ $(KLIB_BUILD)/.config)" - @./scripts/update-initramfs.sh $(KLIB) + @test -n "$(CROSS_COMPILE)" || ./scripts/update-initramfs.sh $(KLIB) @echo @echo Your backported driver modules should be installed now. @echo Reboot.
Signature · 1 line
1.9.2
PATCH 8/10 backports: Makefile.real: silent reboot message when cross-compiling
In reply to Samuel Martin--- backport/Makefile.real | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
backport/Makefile.real +6 -4
@@ -103,10 +103,12 @@ install: modules "$(shell sed -n '/^CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX=y/ s//_/p' \ $(KLIB_BUILD)/.config)" @test -n "$(CROSS_COMPILE)" || ./scripts/update-initramfs.sh $(KLIB) - @echo - @echo Your backported driver modules should be installed now. - @echo Reboot. - @echo + @if test ! -n "$(CROSS_COMPILE)" ; then \ + echo ; \ + echo Your backported driver modules should be installed now. ; \ + echo Reboot. ; \ + echo ; \ + fi .PHONY: modules_install modules_install: install
Signature · 1 line
1.9.2
PATCH 9/10 backports: compress_module.sh: gzip silently overrides existing compressed modules
In reply to Samuel Martin--- backport/scripts/compress_modules.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
backport/scripts/compress_modules.sh +1 -1
@@ -7,6 +7,6 @@ source ./scripts/mod_helpers.sh if test "$(mod_filename mac80211)" = "mac80211.ko.gz" ; then for driver in $(find "$1" -type f -name *.ko); do echo COMPRESS $driver - gzip -9 $driver + gzip -f -9 $driver done fi
Signature · 1 line
1.9.2
PATCH 10/10 backports: Makefile: update help text
In reply to Samuel Martin--- backport/Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
backport/Makefile +11 -5
@@ -62,11 +62,17 @@ mrproper: echo "/--------------" ;\ echo "| Your kernel headers are incomplete/not installed." ;\ echo "| Please install kernel headers, including a .config" ;\ - echo "| file or use the KLIB/KLIB_BUILD make variables to" ;\ - echo "| set the kernel to build against, e.g." ;\ - echo "| make KLIB=/lib/modules/3.1.7/" ;\ - echo "| to compile/install for the installed kernel 3.1.7" ;\ - echo "| (that isn't currently running.)" ;\ + echo "| file or use the KROOT/KLIB_BUILD make variables to" ;\ + echo "| set the kernel to build against, e.g.:" ;\ + echo "| * to compile/install for the installed kernel 3.1.7" ;\ + echo "| (that isn't currently running.):" ;\ + echo "| $$ make KLIB_BUILD=/lib/modules/3.1.7/build" ;\ + echo "| * to cross-compile/install for an arm target in /opt/arm-dev/rootfs:" ;\ + echo "| $$ make \\" ;\ + echo "| ARCH=arm \\" ;\ + echo "| CROSS_COMPILE=/opt/ct-ng/arm-linux/bin/arm-linux- \\" ;\ + echo "| KROOT=/opt/arm-dev/rootfs \\" ;\ + echo "| KLIB_BUILD=/opt/arm-dev/linux" ;\ echo "\\--" ;\ false) @set -e ; if [ "$$(cat .kernel_config_md5 2>/dev/null)" != "$(CONFIG_MD5)" ] ;\
Signature · 1 line
1.9.2
Ping?
Quoted 5 lines · Samuel Martin
Hi all,
This patch series improves cross-compilation support, mostly fixing the scripts to support target root location.
Do you guys plan to look at this series?
Or maybe you'll review it and/or give a try when generating the next backports release?
Best regards,
Signature · 1 line
Samuel
Quoted 66 lines · Samuel Martin
Hi all,
This patch series improves cross-compilation support, mostly fixing the scripts to support target root location.
Now, to cross-compile kernel-backports,
KLIB_BUILDshould still point to the linux kernel build tree and, the new KROOT variable, to the target root location (instead of the target kernel module location, as mentionned at [1]):
---
make \
CROSS_COMPILE=<toolchain prefix> \
ARCH=<target architecture> \
KROOT=<target root directory> \
KLIB_BUILD=<kernel build directory>
---This should not change anything when compiling backports for the build machine.
If this series breaks anything, please let me know.
The following changes since commit
44554cd57d0016c52aeed2ce4f27081b9d9c915f:backports:
select_queuepatch: fix callback kernel version (2014-05-01 18:48:03 -0700)are available in the git repository at:
git://github.com/tSed/backports.gitsma/cross-compilationfor you to fetch changes up to
99add35cab73b890dd6810fa303ec0c0fa06218c:backports:
Makefile: update help text (2014-05-08 19:32:33 +0200)Yours,
Samuel[1] https://backports.wiki.kernel.org/index.php/Documentation#Cross_compile_with_Freescale.27s_LTIB
Samuel Martin (10):
backports:Makefile: introduce KROOT and fixINSTALL_MOD_PATH
definition
backports:Makefile: introduce KVERSION and rework KLIB definition
backports:Makefile: export KROOT and KVERSION variables
backports:blacklist.sh: support install root not in /
backports:check_depmod.sh: support install root not in /
backports: Makefile.real: usedepmod.shinstead of the depmod program
backports: Makefile.real: disableupdate-initramfs.shexecution when
cross-compiling
backports: Makefile.real: silent reboot message when cross-compiling
backports:compress_module.sh: gzip silently overrides existing
compressed modules
backports:Makefile: update help textbackport/Makefile | 33 ++++++++++++++++++++++++--------- backport/Makefile.real | 24 ++++++++++++++++-------- backport/scripts/blacklist.sh | 7 ++++--- backport/scripts/check_depmod.sh | 7 ++++--- backport/scripts/compress_modules.sh | 2 +- 5 files changed, 49 insertions(+), 24 deletions(-)
Quoted 7 lines
--
1.9.2
--
To unsubscribe from this list: send the line "unsubscribe backports" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
I am getting some errors when using a configuration generated with allyesconfig on an ubuntu 14.04 AMD64 system.
Hauke
hauke@hauke-desktop:~/compat-wireless/tmp$ ionice -c 3 nice -n 20 make -j5 /usr/src/linux-headers-3.13.0-27-generic/arch/x86/Makefile:113: CONFIG_X86_X32 enabled but no binutils support scripts/basic/fixdep.c:462:1: fatal error: opening dependency file scripts/basic/.fixdep.d: Permission denied } ^ compilation terminated. make[3]: *** [scripts/basic/fixdep] Error 1 make[2]: *** [scripts_basic] Error 2 /usr/src/linux-headers-3.13.0-27-generic/arch/x86/Makefile:113: CONFIG_X86_X32 enabled but no binutils support scripts/basic/fixdep.c:462:1: fatal error: opening dependency file scripts/basic/.fixdep.d: Permission denied } ^ compilation terminated. make[5]: *** [scripts/basic/fixdep] Error 1 make[4]: *** [scripts_basic] Error 2 make[5]: `conf' is up to date. boolean symbol HWMON tested for 'm'? test forced to 'n' boolean symbol HWMON tested for 'm'? test forced to 'n' # # configuration written to .config # Building backport-include/backport/autoconf.h ... done.
Hi Hauke,
Quoted 1 line · Hauke Mehrtens
On 05/08/2014 10:39 PM, Samuel Martin wrote:
[...]
Quoted 37 lines
Quoted 22 lines
Samuel Martin (10):
backports:Makefile: introduce KROOT and fixINSTALL_MOD_PATH
definition
backports:Makefile: introduce KVERSION and rework KLIB definition
backports:Makefile: export KROOT and KVERSION variables
backports:blacklist.sh: support install root not in /
backports:check_depmod.sh: support install root not in /
backports: Makefile.real: usedepmod.shinstead of the depmod program
backports: Makefile.real: disableupdate-initramfs.shexecution when
cross-compiling
backports: Makefile.real: silent reboot message when cross-compiling
backports:compress_module.sh: gzip silently overrides existing
compressed modules
backports:Makefile: update help textbackport/Makefile | 33 ++++++++++++++++++++++++--------- backport/Makefile.real | 24 ++++++++++++++++-------- backport/scripts/blacklist.sh | 7 ++++--- backport/scripts/check_depmod.sh | 7 ++++--- backport/scripts/compress_modules.sh | 2 +- 5 files changed, 49 insertions(+), 24 deletions(-)Quoted 7 lines
--
1.9.2
--
To unsubscribe from this list: send the line "unsubscribe backports" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlHi,
I am getting some errors when using a configuration generated with allyesconfig on an ubuntu 14.04 AMD64 system.
Hauke
Quoted 15 lines
hauke@hauke-desktop:~/compat-wireless/tmp$ ionice -c 3 nice -n 20 make -j5 /usr/src/linux-headers-3.13.0-27-generic/arch/x86/Makefile:113: CONFIG_X86_X32 enabled but no binutils support scripts/basic/fixdep.c:462:1: fatal error: opening dependency file scripts/basic/.fixdep.d: Permission denied } ^ compilation terminated. make[3]: *** [scripts/basic/fixdep] Error 1 make[2]: *** [scripts_basic] Error 2 /usr/src/linux-headers-3.13.0-27-generic/arch/x86/Makefile:113: CONFIG_X86_X32 enabled but no binutils support scripts/basic/fixdep.c:462:1: fatal error: opening dependency file scripts/basic/.fixdep.d: Permission denied }
I don't really see how this is related to this series.
It seems coming from the kernel sources itself, not the backport ones
Quoted 8 lines
^
compilation terminated.
make[5]: *** [scripts/basic/fixdep] Error 1 make[4]: *** [scripts_basic] Error 2
make[5]: `conf' is up to date.
boolean symbol HWMON tested for 'm'? test forced to 'n' boolean symbol HWMON tested for 'm'? test forced to 'n' #
Quoted 4 lines
# configuration written to .config # Building backport-include/backport/autoconf.h ... done.
Regards,
Signature · 1 line
Samuel
Quoted 58 lines · Samuel Martin
Hi Hauke,
Quoted 1 line · Hauke Mehrtens
On 05/08/2014 10:39 PM, Samuel Martin wrote:
[...]
Quoted 37 lines
Quoted 22 lines
Samuel Martin (10):
backports:Makefile: introduce KROOT and fixINSTALL_MOD_PATH
definition
backports:Makefile: introduce KVERSION and rework KLIB definition
backports:Makefile: export KROOT and KVERSION variables
backports:blacklist.sh: support install root not in /
backports:check_depmod.sh: support install root not in /
backports: Makefile.real: usedepmod.shinstead of the depmod program
backports: Makefile.real: disableupdate-initramfs.shexecution when
cross-compiling
backports: Makefile.real: silent reboot message when cross-compiling
backports:compress_module.sh: gzip silently overrides existing
compressed modules
backports:Makefile: update help textbackport/Makefile | 33 ++++++++++++++++++++++++--------- backport/Makefile.real | 24 ++++++++++++++++-------- backport/scripts/blacklist.sh | 7 ++++--- backport/scripts/check_depmod.sh | 7 ++++--- backport/scripts/compress_modules.sh | 2 +- 5 files changed, 49 insertions(+), 24 deletions(-)Quoted 7 lines
--
1.9.2
--
To unsubscribe from this list: send the line "unsubscribe backports" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlHi,
I am getting some errors when using a configuration generated with allyesconfig on an ubuntu 14.04 AMD64 system.
Hauke
Quoted 15 lines
hauke@hauke-desktop:~/compat-wireless/tmp$ ionice -c 3 nice -n 20 make -j5 /usr/src/linux-headers-3.13.0-27-generic/arch/x86/Makefile:113: CONFIG_X86_X32 enabled but no binutils support scripts/basic/fixdep.c:462:1: fatal error: opening dependency file scripts/basic/.fixdep.d: Permission denied } ^ compilation terminated. make[3]: *** [scripts/basic/fixdep] Error 1 make[2]: *** [scripts_basic] Error 2 /usr/src/linux-headers-3.13.0-27-generic/arch/x86/Makefile:113: CONFIG_X86_X32 enabled but no binutils support scripts/basic/fixdep.c:462:1: fatal error: opening dependency file scripts/basic/.fixdep.d: Permission denied }
Quoted 2 lines
I don't really see how this is related to this series.
It seems coming from the kernel sources itself, not the backport ones
Git bisect showed me that this commit is causing the problem:
backports: Makefile: introduce KVERSION and rework KLIB definition
I ran the following commands to build backports:
make -j4 allyesconfig
make -j4
Hauke