public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] meta: ext4-img: copy and keep attributes, always copy with sudo
@ 2017-07-18 14:30 Henning Schild
  2017-07-22 22:17 ` Baurzhan Ismagulov
  0 siblings, 1 reply; 5+ messages in thread
From: Henning Schild @ 2017-07-18 14:30 UTC (permalink / raw)
  To: isar-users; +Cc: Henning Schild

Some security enhancing packages can cause our initrd to be not readable
by a normal user. So we need to copy with sudo.
Also regular cp would destroy ownership and other attributes of files,
possibly creating problems in the future.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/ext4-img.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/ext4-img.bbclass b/meta/classes/ext4-img.bbclass
index 5652757..7492f96 100644
--- a/meta/classes/ext4-img.bbclass
+++ b/meta/classes/ext4-img.bbclass
@@ -21,16 +21,16 @@ do_ext4_image() {
 
     mkdir -p ${WORKDIR}/mnt
     sudo mount -o loop ${EXT4_IMAGE_FILE} ${WORKDIR}/mnt
-    sudo cp -r ${S}/* ${WORKDIR}/mnt
+    sudo cp -a ${S}/* ${WORKDIR}/mnt
     sudo umount ${WORKDIR}/mnt
     rm -r ${WORKDIR}/mnt
 
     if [ -n "${KERNEL_IMAGE}" ]; then
-        cp ${S}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
+        sudo cp -a ${S}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
     fi
 
     if [ -n "${INITRD_IMAGE}" ]; then
-        cp ${S}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
+        sudo cp -a ${S}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
     fi
 }
 
-- 
2.13.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-25  9:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-18 14:30 [PATCH] meta: ext4-img: copy and keep attributes, always copy with sudo Henning Schild
2017-07-22 22:17 ` Baurzhan Ismagulov
2017-07-24  7:46   ` Henning Schild
2017-07-24 21:48     ` Baurzhan Ismagulov
2017-07-25  9:23       ` Henning Schild

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox