diff options
author | Ming Liu <peter.x.liu@external.atlascopco.com> | 2017-07-28 16:04:27 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-30 08:46:19 +0100 |
commit | 9b8411d787754826a6760823a61c926972a232aa (patch) | |
tree | 5541c76e5713904a7c01f9f03f4034a950986930 /meta/classes | |
parent | c8a4feacd8531500371b4e7d74b4997676ac5833 (diff) | |
download | poky-9b8411d787754826a6760823a61c926972a232aa.tar.gz |
rootfsdebugfiles.bbclass: add a optional parameter to choose file mode
This is in case that sometimes the copied target files might be
expected to have a desired mode, for instance, the ssh keys should not
be too open, otherwise the users will get a "Permission denied" error.
(From OE-Core rev: 0ae4c1eeb1a70bae324347445895c7d312cf503d)
Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/rootfsdebugfiles.bbclass | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/classes/rootfsdebugfiles.bbclass b/meta/classes/rootfsdebugfiles.bbclass index a558871e99..e2ba4e3647 100644 --- a/meta/classes/rootfsdebugfiles.bbclass +++ b/meta/classes/rootfsdebugfiles.bbclass | |||
@@ -15,6 +15,10 @@ | |||
15 | # ROOTFS_DEBUG_FILES += "${TOPDIR}/conf/dropbear_rsa_host_key ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key ;" | 15 | # ROOTFS_DEBUG_FILES += "${TOPDIR}/conf/dropbear_rsa_host_key ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key ;" |
16 | # 2. Boot the image once, copy the dropbear_rsa_host_key from | 16 | # 2. Boot the image once, copy the dropbear_rsa_host_key from |
17 | # the device into your build conf directory. | 17 | # the device into your build conf directory. |
18 | # 3. A optional parameter can be used to set file mode | ||
19 | # of the copied target, for instance: | ||
20 | # ROOTFS_DEBUG_FILES += "${TOPDIR}/conf/dropbear_rsa_host_key ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key 0600;" | ||
21 | # in case they might be required to have a specific mode. (Shoundn't be too open, for example) | ||
18 | # | 22 | # |
19 | # Do not use for production images! It bypasses several | 23 | # Do not use for production images! It bypasses several |
20 | # core build mechanisms (updating the image when one | 24 | # core build mechanisms (updating the image when one |
@@ -27,10 +31,11 @@ ROOTFS_DEBUG_FILES[doc] = "Lists additional files or directories to be installed | |||
27 | ROOTFS_POSTPROCESS_COMMAND += "rootfs_debug_files ;" | 31 | ROOTFS_POSTPROCESS_COMMAND += "rootfs_debug_files ;" |
28 | rootfs_debug_files () { | 32 | rootfs_debug_files () { |
29 | #!/bin/sh -e | 33 | #!/bin/sh -e |
30 | echo "${ROOTFS_DEBUG_FILES}" | sed -e 's/;/\n/g' | while read source target; do | 34 | echo "${ROOTFS_DEBUG_FILES}" | sed -e 's/;/\n/g' | while read source target mode; do |
31 | if [ -e "$source" ]; then | 35 | if [ -e "$source" ]; then |
32 | mkdir -p $(dirname $target) | 36 | mkdir -p $(dirname $target) |
33 | cp -a $source $target | 37 | cp -a $source $target |
38 | [ -n "$mode" ] && chmod $mode $target | ||
34 | fi | 39 | fi |
35 | done | 40 | done |
36 | } | 41 | } |