diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2022-01-09 22:17:04 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-25 12:07:01 +0000 |
commit | be6b5a5d0ab7cdcbfdd4563c6e8adf17b3fcf78c (patch) | |
tree | 57366b4c96058585eefd8beca676e51a83aab870 | |
parent | 3314a8f59ec5ae4d4637eefc96bedc7b57a55eb7 (diff) | |
download | poky-be6b5a5d0ab7cdcbfdd4563c6e8adf17b3fcf78c.tar.gz |
populate_sdk_base: remove unneeded dirs such as /dev
We met a problem that core-image-tiny-initramfs's SDK cannot be
installed. The error message is like below.
tar: ./sysroots/core2-64-poky-linux/dev/console: Cannot mknod: Operation not permitted
In fact, the '/dev' direcotry is not needed by SDK. So remove it.
This patches uses a variable, SDK_PRUNE_SYSROOT_DIRS, to hold useless dir entries
so that it could be extended. For example, '/usr/bin' could be added if wanted.
(From OE-Core rev: 9154f71c7267e9731156c1dfd57397103e9e6a2b)
(From OE-Core rev: 0211ccb94ecc13ed0f4d3f351baf4f9a39f2ccea)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/populate_sdk_base.bbclass | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass index 2d33611ddd..76757a3a9d 100644 --- a/meta/classes/populate_sdk_base.bbclass +++ b/meta/classes/populate_sdk_base.bbclass | |||
@@ -90,6 +90,8 @@ SDK_HOST_MANIFEST = "${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.host.manifest" | |||
90 | SDK_EXT_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.target.manifest" | 90 | SDK_EXT_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.target.manifest" |
91 | SDK_EXT_HOST_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.host.manifest" | 91 | SDK_EXT_HOST_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.host.manifest" |
92 | 92 | ||
93 | SDK_PRUNE_SYSROOT_DIRS ?= "/dev" | ||
94 | |||
93 | python write_target_sdk_manifest () { | 95 | python write_target_sdk_manifest () { |
94 | from oe.sdk import sdk_list_installed_packages | 96 | from oe.sdk import sdk_list_installed_packages |
95 | from oe.utils import format_pkg_list | 97 | from oe.utils import format_pkg_list |
@@ -101,6 +103,12 @@ python write_target_sdk_manifest () { | |||
101 | output.write(format_pkg_list(pkgs, 'ver')) | 103 | output.write(format_pkg_list(pkgs, 'ver')) |
102 | } | 104 | } |
103 | 105 | ||
106 | sdk_prune_dirs () { | ||
107 | for d in ${SDK_PRUNE_SYSROOT_DIRS}; do | ||
108 | rm -rf ${SDK_OUTPUT}${SDKTARGETSYSROOT}$d | ||
109 | done | ||
110 | } | ||
111 | |||
104 | python write_sdk_test_data() { | 112 | python write_sdk_test_data() { |
105 | from oe.data import export2json | 113 | from oe.data import export2json |
106 | testdata = "%s/%s.testdata.json" % (d.getVar('SDKDEPLOYDIR'), d.getVar('TOOLCHAIN_OUTPUTNAME')) | 114 | testdata = "%s/%s.testdata.json" % (d.getVar('SDKDEPLOYDIR'), d.getVar('TOOLCHAIN_OUTPUTNAME')) |
@@ -120,8 +128,9 @@ python write_host_sdk_manifest () { | |||
120 | } | 128 | } |
121 | 129 | ||
122 | POPULATE_SDK_POST_TARGET_COMMAND_append = " write_sdk_test_data ; " | 130 | POPULATE_SDK_POST_TARGET_COMMAND_append = " write_sdk_test_data ; " |
123 | POPULATE_SDK_POST_TARGET_COMMAND_append_task-populate-sdk = " write_target_sdk_manifest ; " | 131 | POPULATE_SDK_POST_TARGET_COMMAND_append_task-populate-sdk = " write_target_sdk_manifest; sdk_prune_dirs; " |
124 | POPULATE_SDK_POST_HOST_COMMAND_append_task-populate-sdk = " write_host_sdk_manifest; " | 132 | POPULATE_SDK_POST_HOST_COMMAND_append_task-populate-sdk = " write_host_sdk_manifest; " |
133 | |||
125 | SDK_PACKAGING_COMMAND = "${@'${SDK_PACKAGING_FUNC};' if '${SDK_PACKAGING_FUNC}' else ''}" | 134 | SDK_PACKAGING_COMMAND = "${@'${SDK_PACKAGING_FUNC};' if '${SDK_PACKAGING_FUNC}' else ''}" |
126 | SDK_POSTPROCESS_COMMAND = " create_sdk_files; check_sdk_sysroots; archive_sdk; ${SDK_PACKAGING_COMMAND} " | 135 | SDK_POSTPROCESS_COMMAND = " create_sdk_files; check_sdk_sysroots; archive_sdk; ${SDK_PACKAGING_COMMAND} " |
127 | 136 | ||