summaryrefslogtreecommitdiffstats
path: root/meta-selftest
diff options
context:
space:
mode:
authorPaulo Neves <ptsneves@gmail.com>2022-06-14 17:11:04 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-01 12:37:52 +0100
commiteb997a68010c55d0aeacd6b5f0d026461ae716a2 (patch)
tree348126b70190862ed4729a100ff58319a50ca5c2 /meta-selftest
parent00458ee0f8c0619707b53b7a72450fbd8cbc3e02 (diff)
downloadpoky-eb997a68010c55d0aeacd6b5f0d026461ae716a2.tar.gz
utils: Add cmdline_shebang_wrapper util.
Useful to work around shebang relocation issues, where shebangs are too long or have arguments in them, thus preventing them from using the /usr/bin/env shebang. (From OE-Core rev: 6edc1fffcbe1405d8c309a75643d7d6cd9a92848) Signed-off-by: Paulo Neves <ptsneves@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-selftest')
-rw-r--r--meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb21
-rw-r--r--meta-selftest/recipes-test/wrapper/files/test.awk2
2 files changed, 23 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb b/meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb
new file mode 100644
index 0000000000..c4126a41fc
--- /dev/null
+++ b/meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb
@@ -0,0 +1,21 @@
1SUMMARY = "Check that create_cmdline_shebang works"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4INHIBIT_DEFAULT_DEPS = "1"
5
6SRC_URI += "file://test.awk"
7
8EXCLUDE_FROM_WORLD = "1"
9do_install() {
10 install -d ${D}${bindir}
11 install -m 0755 ${WORKDIR}/test.awk ${D}${bindir}/test
12 sed -i -e 's|@AWK_BIN@|${bindir}/awk|g' ${D}${bindir}/test
13 create_cmdline_shebang_wrapper ${D}${bindir}/test
14 if [ $(${D}${bindir}/test) != "Don't Panic!" ]; then
15 bbfatal "Wrapper is broken"
16 else
17 bbnote "Wrapper is good"
18 fi
19}
20
21BBCLASSEXTEND = "native"
diff --git a/meta-selftest/recipes-test/wrapper/files/test.awk b/meta-selftest/recipes-test/wrapper/files/test.awk
new file mode 100644
index 0000000000..91429197b1
--- /dev/null
+++ b/meta-selftest/recipes-test/wrapper/files/test.awk
@@ -0,0 +1,2 @@
1#! @AWK_BIN@ -f
2BEGIN { print "Don't Panic!" }