diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-05-18 16:15:07 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-20 21:41:04 +0100 |
commit | fbfc06a969200e582a059c9943e6fd17aca70e30 (patch) | |
tree | 1862fb721f550d42f10e8867224712754a865d34 /meta-selftest | |
parent | c63adf5c5b4b5984c315e914a7d3cb4b51040602 (diff) | |
download | openembedded-core-contrib-fbfc06a969200e582a059c9943e6fd17aca70e30.tar.gz |
recipetool: add appendfile subcommand
Locating which recipe provides a file in an image that you want to
modify and then figuring out how to bbappend the recipe in order to
replace it can be a tedious process. Thus, add a new appendfile
subcommand to recipetool, providing the ability to create a bbappend
file to add/replace any file in the target system. Without the -r
option, it will search for the recipe packaging the specified file
(using pkgdata from previously built recipes). The bbappend will be
created at the appropriate path within the specified layer directory
(which may or may not be in your bblayers.conf) or if one already exists
it will be updated appropriately.
Fairly extensive oe-selftest tests are also provided.
Implements [YOCTO #6447].
(From OE-Core rev: dd2aa93b3c13d2c6464ef0fda59620c7dba450bb)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-selftest')
11 files changed, 62 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/recipetool/files/add-file.patch b/meta-selftest/recipes-test/recipetool/files/add-file.patch new file mode 100644 index 00000000000..bdc99c94f0b --- /dev/null +++ b/meta-selftest/recipes-test/recipetool/files/add-file.patch @@ -0,0 +1,8 @@ +diff --git a/file2 b/file2 +new file mode 100644 +index 0000000..049b42e +--- /dev/null ++++ b/file2 +@@ -0,0 +1,2 @@ ++Test file 2 ++456 diff --git a/meta-selftest/recipes-test/recipetool/files/file1 b/meta-selftest/recipes-test/recipetool/files/file1 new file mode 100644 index 00000000000..7571aa7a88b --- /dev/null +++ b/meta-selftest/recipes-test/recipetool/files/file1 @@ -0,0 +1,2 @@ +First test file +123 diff --git a/meta-selftest/recipes-test/recipetool/files/installscript.sh b/meta-selftest/recipes-test/recipetool/files/installscript.sh new file mode 100644 index 00000000000..9de30d69ca5 --- /dev/null +++ b/meta-selftest/recipes-test/recipetool/files/installscript.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo "Third file" > $1/selftest-replaceme-scripted + diff --git a/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-func b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-func new file mode 100644 index 00000000000..2802bb348be --- /dev/null +++ b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-func @@ -0,0 +1 @@ +A file installed by a function called by do_install diff --git a/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-globfile b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-globfile new file mode 100644 index 00000000000..996298bf1f8 --- /dev/null +++ b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-globfile @@ -0,0 +1 @@ +A file matched by a glob in do_install diff --git a/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-todir-globfile b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-todir-globfile new file mode 100644 index 00000000000..585ae3e9b0e --- /dev/null +++ b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-todir-globfile @@ -0,0 +1 @@ +A file matched by a glob in do_install to a directory diff --git a/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-orig b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-orig new file mode 100644 index 00000000000..593d6a0bb43 --- /dev/null +++ b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-orig @@ -0,0 +1 @@ +Straight through with same nam diff --git a/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile new file mode 100644 index 00000000000..1e20a2b03eb --- /dev/null +++ b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile @@ -0,0 +1 @@ +A file matched by a glob in SRC_URI diff --git a/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-todir b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-todir new file mode 100644 index 00000000000..85bd5eba46b --- /dev/null +++ b/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-todir @@ -0,0 +1 @@ +File in SRC_URI installed just to directory path diff --git a/meta-selftest/recipes-test/recipetool/files/subdir/fileinsubdir b/meta-selftest/recipes-test/recipetool/files/subdir/fileinsubdir new file mode 100644 index 00000000000..d516b4951bc --- /dev/null +++ b/meta-selftest/recipes-test/recipetool/files/subdir/fileinsubdir @@ -0,0 +1 @@ +A file in a subdirectory diff --git a/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb b/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb new file mode 100644 index 00000000000..7d0a040beb4 --- /dev/null +++ b/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb @@ -0,0 +1,42 @@ +SUMMARY = "Test recipe for recipetool appendfile" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "file://installscript.sh \ + file://selftest-replaceme-orig \ + file://selftest-replaceme-todir \ + file://file1 \ + file://add-file.patch \ + file://subdir \ + file://selftest-replaceme-src-glob* \ + file://selftest-replaceme-inst-globfile \ + file://selftest-replaceme-inst-todir-globfile \ + file://selftest-replaceme-inst-func" + +install_extrafunc() { + install -m 0644 ${WORKDIR}/selftest-replaceme-inst-func ${D}${datadir}/selftest-replaceme-inst-func +} + +do_install() { + install -d ${D}${datadir}/ + install -m 0644 ${WORKDIR}/selftest-replaceme-orig ${D}${datadir}/selftest-replaceme-orig + install -m 0644 ${WORKDIR}/selftest-replaceme-todir ${D}${datadir} + install -m 0644 ${WORKDIR}/file1 ${D}${datadir}/selftest-replaceme-renamed + install -m 0644 ${WORKDIR}/subdir/fileinsubdir ${D}${datadir}/selftest-replaceme-subdir + install -m 0644 ${WORKDIR}/selftest-replaceme-src-globfile ${D}${datadir}/selftest-replaceme-src-globfile + cp ${WORKDIR}/selftest-replaceme-inst-glob* ${D}${datadir}/selftest-replaceme-inst-globfile + cp ${WORKDIR}/selftest-replaceme-inst-todir-glob* ${D}${datadir} + install -d ${D}${sysconfdir} + install -m 0644 ${S}/file2 ${D}${sysconfdir}/selftest-replaceme-patched + sh ${WORKDIR}/installscript.sh ${D}${datadir} + install_extrafunc +} + +pkg_postinst_${PN} () { + echo "Test file installed by postinst" > $D${datadir}/selftest-replaceme-postinst +} + +FILES_${PN} += "${datadir}" + |