aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfsdebugfiles.bbclass
blob: a558871e99facf6c94850f84e33aa61aa50906b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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
}
GPLv2.1+" LICENSE_${PN}-libsmartcols = "LGPLv2.1+" LICENSE_${PN}-libuuid = "BSD-3-Clause" LIC_FILES_CHKSUM = "file://README.licensing;md5=0fd5c050c6187d2bf0a4492b7f4e33da \ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ file://Documentation/licenses/COPYING.GPL-2.0-or-later;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ file://Documentation/licenses/COPYING.LGPL-2.1-or-later;md5=4fbd65380cdd255951079008b364516c \ file://Documentation/licenses/COPYING.BSD-3-Clause;md5=58dcd8452651fc8b07d1f65ce07ca8af \ file://Documentation/licenses/COPYING.BSD-4-Clause-UC;md5=263860f8968d8bafa5392cab74285262 \ file://libuuid/COPYING;md5=6d2cafc999feb2c2de84d4d24b23290c \ file://libmount/COPYING;md5=7c7e39fb7d70ffe5d693a643e29987c2 \ file://libblkid/COPYING;md5=693bcbbe16d3a4a4b37bc906bc01cc04 \ file://libfdisk/COPYING;md5=693bcbbe16d3a4a4b37bc906bc01cc04 \ file://libsmartcols/COPYING;md5=693bcbbe16d3a4a4b37bc906bc01cc04 \ " FILESEXTRAPATHS_prepend := "${THISDIR}/util-linux:" MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}" BPN = "util-linux" SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \ file://configure-sbindir.patch \ file://runuser.pamd \ file://runuser-l.pamd \ file://ptest.patch \ file://run-ptest \ file://display_testname_for_subtest.patch \ file://avoid_parallel_tests.patch \ " SRC_URI[sha256sum] = "f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f"