diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 22:31:25 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 19:43:26 +0300 |
commit | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch) | |
tree | ecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/classes/rootfsdebugfiles.bbclass | |
parent | e18c61205e0234b03697129c20cc69c9b3940efc (diff) | |
download | openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.xz |
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to
hold all of the layers that we import with git-subtree.
Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/classes/rootfsdebugfiles.bbclass')
-rw-r--r-- | import-layers/yocto-poky/meta/classes/rootfsdebugfiles.bbclass | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/classes/rootfsdebugfiles.bbclass b/import-layers/yocto-poky/meta/classes/rootfsdebugfiles.bbclass new file mode 100644 index 000000000..a558871e9 --- /dev/null +++ b/import-layers/yocto-poky/meta/classes/rootfsdebugfiles.bbclass @@ -0,0 +1,36 @@ +# This class installs additional files found on the build host +# directly into the rootfs. +# +# One use case is to install a constant ssh host key in +# an image that gets created for just one machine. This +# solves two issues: +# - host key generation on the device can stall when the +# kernel has not gathered enough entropy yet (seen in practice +# under qemu) +# - ssh complains by default when the host key changes +# +# For dropbear, with the ssh host key store along side the local.conf: +# 1. Extend local.conf: +# INHERIT += "rootfsdebugfiles" +# ROOTFS_DEBUG_FILES += "${TOPDIR}/conf/dropbear_rsa_host_key ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key ;" +# 2. Boot the image once, copy the dropbear_rsa_host_key from +# the device into your build conf directory. +# +# Do not use for production images! It bypasses several +# core build mechanisms (updating the image when one +# of the files changes, license tracking in the image +# manifest, ...). + +ROOTFS_DEBUG_FILES ?= "" +ROOTFS_DEBUG_FILES[doc] = "Lists additional files or directories to be installed with 'cp -a' in the format 'source1 target1;source2 target2;...'" + +ROOTFS_POSTPROCESS_COMMAND += "rootfs_debug_files ;" +rootfs_debug_files () { + #!/bin/sh -e + echo "${ROOTFS_DEBUG_FILES}" | sed -e 's/;/\n/g' | while read source target; do + if [ -e "$source" ]; then + mkdir -p $(dirname $target) + cp -a $source $target + fi + done +} |