summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfsdebugfiles.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-10 14:35:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-12 15:27:17 +0100
commitfd1517e2b51a170f2427122c6b95396db251d827 (patch)
treedabfe3e631339c2fc99a9ee7febb0f9c128e325e /meta/classes/rootfsdebugfiles.bbclass
parent10317912ee319ccf7f83605d438b5cbf9663f296 (diff)
downloadpoky-fd1517e2b51a170f2427122c6b95396db251d827.tar.gz
classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. (From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rootfsdebugfiles.bbclass')
-rw-r--r--meta/classes/rootfsdebugfiles.bbclass47
1 files changed, 0 insertions, 47 deletions
diff --git a/meta/classes/rootfsdebugfiles.bbclass b/meta/classes/rootfsdebugfiles.bbclass
deleted file mode 100644
index cbcf876479..0000000000
--- a/meta/classes/rootfsdebugfiles.bbclass
+++ /dev/null
@@ -1,47 +0,0 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7# This class installs additional files found on the build host
8# directly into the rootfs.
9#
10# One use case is to install a constant ssh host key in
11# an image that gets created for just one machine. This
12# solves two issues:
13# - host key generation on the device can stall when the
14# kernel has not gathered enough entropy yet (seen in practice
15# under qemu)
16# - ssh complains by default when the host key changes
17#
18# For dropbear, with the ssh host key store along side the local.conf:
19# 1. Extend local.conf:
20# INHERIT += "rootfsdebugfiles"
21# ROOTFS_DEBUG_FILES += "${TOPDIR}/conf/dropbear_rsa_host_key ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key ;"
22# 2. Boot the image once, copy the dropbear_rsa_host_key from
23# the device into your build conf directory.
24# 3. A optional parameter can be used to set file mode
25# of the copied target, for instance:
26# ROOTFS_DEBUG_FILES += "${TOPDIR}/conf/dropbear_rsa_host_key ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key 0600;"
27# in case they might be required to have a specific mode. (Shoundn't be too open, for example)
28#
29# Do not use for production images! It bypasses several
30# core build mechanisms (updating the image when one
31# of the files changes, license tracking in the image
32# manifest, ...).
33
34ROOTFS_DEBUG_FILES ?= ""
35ROOTFS_DEBUG_FILES[doc] = "Lists additional files or directories to be installed with 'cp -a' in the format 'source1 target1;source2 target2;...'"
36
37ROOTFS_POSTPROCESS_COMMAND += "rootfs_debug_files;"
38rootfs_debug_files () {
39 #!/bin/sh -e
40 echo "${ROOTFS_DEBUG_FILES}" | sed -e 's/;/\n/g' | while read source target mode; do
41 if [ -e "$source" ]; then
42 mkdir -p $(dirname $target)
43 cp -a $source $target
44 [ -n "$mode" ] && chmod $mode $target
45 fi
46 done
47}