aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFrançois Chavant <francois@chavant.info>2021-05-07 17:58:11 +0200
committerPaul Spooren <mail@aparcar.org>2021-05-12 13:39:29 +0200
commit5a9608102b3c444d0c963255f9d016a1d5469d5d (patch)
tree4c6908367e3411276e86a3c44ce9e0192e63c2b9 /include
parent3a359398f04f3f4c4a42d1ca274bb1a0f0303e05 (diff)
downloadupstream-5a9608102b3c444d0c963255f9d016a1d5469d5d.tar.gz
upstream-5a9608102b3c444d0c963255f9d016a1d5469d5d.tar.bz2
upstream-5a9608102b3c444d0c963255f9d016a1d5469d5d.zip
build: kernel2minor: work around path length limit
When building for MikroTik devices the kernel2minor tool will sometimes fail with: Can't get lstat from kernel file!: No such file or directory. This is because kernel2minor expects paths no longer than 250 chars. To work around this the include/image-commands.mk has been modified to copy the kernel to a temporary file (/tmp/tmp.XXXXXXXXXX) before calling kernel2minor. Signed-off-by: François Chavant <francois@chavant.info>
Diffstat (limited to 'include')
-rw-r--r--include/image-commands.mk7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 9702d029d7..afb2dde5ba 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -272,8 +272,11 @@ define Build/jffs2
endef
define Build/kernel2minor
- kernel2minor -k $@ -r $@.new $(1)
- mv $@.new $@
+ $(eval temp_file := $(shell mktemp))
+ cp $@ $(temp_file)
+ kernel2minor -k $(temp_file) -r $(temp_file).new $(1)
+ mv $(temp_file).new $@
+ rm -f $(temp_file)
endef
define Build/kernel-bin