public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH 1/6] meta: image: Account for Ubuntu differences in do_copy_boot_files
Date: Mon, 14 Dec 2020 17:39:28 +0100	[thread overview]
Message-ID: <a08069ca-8bd1-c8c0-4ed8-7813fcbb7d9b@siemens.com> (raw)
In-Reply-To: <20201214133637.58f89677@md1za8fc.ad001.siemens.net>

On 14.12.20 13:36, Henning Schild wrote:
> Am Mon, 14 Dec 2020 13:27:30 +0100
> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> 
>> On 14.12.20 13:16, Henning Schild wrote:
>>> Am Mon, 14 Dec 2020 08:11:22 +0100
>>> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
>>>   
>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>>
>>>> Ubuntu places kernel and initrd links under /boot. Furthermore, it
>>>> makes the kernel unreadable for non-root users. Account for the
>>>> latter by cat'ing the kernel under sudo, redirecting the output to
>>>> the deployment artifact so that it is owned by the building user.
>>>>
>>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>>> ---
>>>>  meta/classes/image.bbclass | 9 ++++++---
>>>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/meta/classes/image.bbclass
>>>> b/meta/classes/image.bbclass index 74fc8500..eddc4449 100644
>>>> --- a/meta/classes/image.bbclass
>>>> +++ b/meta/classes/image.bbclass
>>>> @@ -132,15 +132,18 @@ EOF
>>>>  
>>>>  do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}"
>>>>  do_copy_boot_files() {
>>>> -    kernel="$(realpath -q '${IMAGE_ROOTFS}/vmlinuz')"
>>>> +    kernel="$(realpath -q '${IMAGE_ROOTFS}'/vmlinu[xz])"
>>>>      if [ ! -f "$kernel" ]; then
>>>> -        kernel="$(realpath -q '${IMAGE_ROOTFS}/vmlinux')"
>>>> +        kernel="$(realpath -q '${IMAGE_ROOTFS}'/boot/vmlinu[xz])"
>>>>      fi
>>>>      if [ -f "$kernel" ]; then
>>>> -        cp -f "$kernel" '${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}'
>>>> +        sudo cat "$kernel" >
>>>> "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}"  
>>>
>>> Why "cat" instead of "cp"? I think the real trick is the sudo
>>> anyways. 
>>
>> "Furthermore, it
>> makes the kernel unreadable for non-root users. Account for the
>> latter by cat'ing the kernel under sudo, redirecting the output to
>> the deployment artifact so that it is owned by the building user."
> 
> I think i would prefer "--no-preserve=mode" to make that explicit in
> the code ... instead of the commit message. Sorry for my quick shots on
> this series.

--no-preserve=mode and also --no-preserve=ownership do not help. Any
other trick I miss? Would prefer something explicit as well.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

  reply	other threads:[~2020-12-14 16:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14  7:11 [PATCH 0/6] Add support for Ubuntu Jan Kiszka
2020-12-14  7:11 ` [PATCH 1/6] meta: image: Account for Ubuntu differences in do_copy_boot_files Jan Kiszka
2020-12-14 12:16   ` Henning Schild
2020-12-14 12:27     ` Jan Kiszka
2020-12-14 12:36       ` Henning Schild
2020-12-14 16:39         ` Jan Kiszka [this message]
2020-12-14 16:40           ` Henning Schild
2020-12-15  9:22             ` Jan Kiszka
2020-12-14  7:11 ` [PATCH 2/6] meta/isar-bootstrap: allow passing a SCRIPT to debootstrap Jan Kiszka
2020-12-14  7:11 ` [PATCH 3/6] wic: bootimg-efi-isar: Add support for Ubuntu Jan Kiszka
2020-12-14 12:13   ` Henning Schild
2020-12-14 12:28     ` Jan Kiszka
2020-12-14 12:33       ` Henning Schild
2020-12-14  7:11 ` [PATCH 4/6] meta: cache_deb_src: Account for the case that resolv.conf is a non-existent link Jan Kiszka
2020-12-14  7:11 ` [PATCH 5/6] meta-isar: Add new distro ubuntu with suite "focal" Jan Kiszka
2020-12-14  7:11 ` [PATCH 6/6] meta-isar: linux-mainline: Adjust cfg fragment test to arm64 defconfig Jan Kiszka
2020-12-14 12:06 ` [PATCH 0/6] Add support for Ubuntu Henning Schild
2020-12-14 12:26   ` Jan Kiszka
2021-01-18 16:15 ` Anton Mikanovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a08069ca-8bd1-c8c0-4ed8-7813fcbb7d9b@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox