All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: <cip-dev@lists.cip-project.org>
Cc: Quirin Gylstorff <quirin.gylstorff@siemens.com>,
	Christian Storm <christian.storm@siemens.com>
Subject: Re: [isar-cip-core][PATCH v2 2/6] initramfs-abrootfs-hook: Convert to an initramfs-class recipe
Date: Fri, 22 Apr 2022 18:59:48 +0200	[thread overview]
Message-ID: <967ff119-c3cc-6340-c4ce-471d6dd95d9f@siemens.com> (raw)
In-Reply-To: <bec2642fc52c2cb38eade4569b88315dfa5dade6.1650613658.git.jan.kiszka@siemens.com>

On 22.04.22 09:47, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> This unifies the pattern we generate initramfs images for non-secure and
> secure SWUpdate images. Besides cleaning up the related abrootfs
> selection hook, the unification is a precondition for adding another
> initramfs recipe later that will be shared between both image types
> 
> The pattern followed in the new initramfs-abrootfs-hook script is now
> similar to initramfs-verity-hook: a local-top hook is used, rather than
> a patch for Debian's local script. This hook looks for the matching
> rootfs by read-only mounting candidates, comparing the contained UUID
> against the one stored in the initramfs, unmounting again, and then
> setting the ROOT variable on match.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  classes/image_uuid.bbclass                    |  6 +-
>  classes/secure-wic-swu-img.bbclass            |  4 --
>  classes/wic-swu-img.bbclass                   |  6 ++
>  kas/opt/ebg-secure-boot-snakeoil.yml          |  1 +
>  kas/opt/ebg-swu.yml                           |  2 +-
>  .../cip-core-initramfs/cip-core-initramfs.bb  |  4 --
>  .../{initramfs.lsblk.hook => abrootfs.hook}   | 11 +---
>  .../files/abrootfs.script                     | 66 +++++++++++++++++++
>  .../files/initramfs.image_uuid.hook           | 33 ----------
>  .../initramfs-abrootfs-hook/files/postinst    |  6 --
>  .../initramfs-abrootfs-hook_0.1.bb            | 41 +++++++-----
>  11 files changed, 104 insertions(+), 76 deletions(-)
>  rename recipes-initramfs/initramfs-abrootfs-hook/files/{initramfs.lsblk.hook => abrootfs.hook} (62%)
>  create mode 100644 recipes-initramfs/initramfs-abrootfs-hook/files/abrootfs.script
>  delete mode 100644 recipes-initramfs/initramfs-abrootfs-hook/files/initramfs.image_uuid.hook
>  delete mode 100644 recipes-initramfs/initramfs-abrootfs-hook/files/postinst
> 
> diff --git a/classes/image_uuid.bbclass b/classes/image_uuid.bbclass
> index 2813ed9..7294eb3 100644
> --- a/classes/image_uuid.bbclass
> +++ b/classes/image_uuid.bbclass
> @@ -1,10 +1,11 @@
>  #
>  # CIP Core, generic profile
>  #
> -# Copyright (c) Siemens AG, 2020
> +# Copyright (c) Siemens AG, 2020-2022
>  #
>  # Authors:
>  #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
> +#  Jan Kiszka <jan.kiszka@siemens.com>
>  #
>  # SPDX-License-Identifier: MIT
>  #
> @@ -27,7 +28,6 @@ do_generate_image_uuid() {
>          sudo tee -a '${IMAGE_ROOTFS}/etc/os-release'
>      image_do_mounts

This line is obsolete.

>  
> -    # update initramfs to add uuid
> -    sudo chroot '${IMAGE_ROOTFS}' update-initramfs -u
> +    echo "TARGET_IMAGE_UUID=\"${IMAGE_UUID}\"" > "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.uuid.env"
>  }
>  addtask generate_image_uuid before do_copy_boot_files after do_rootfs_install

This one as well, plus it broke when no one else used DEPLOY_DIR_IMAGE
before. v3 will follow, fixing a similar issue in verity-img.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


  reply	other threads:[~2022-04-22 19:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22  7:47 [isar-cip-core][PATCH v2 0/6] Fix read-only rootfs setup /wrt etc overlay - and more Jan Kiszka
2022-04-22  7:47 ` [isar-cip-core][PATCH v2 1/6] wic: Align kernel command line of qemu-amd64-efibootguard* Jan Kiszka
2022-04-22  7:47 ` [isar-cip-core][PATCH v2 2/6] initramfs-abrootfs-hook: Convert to an initramfs-class recipe Jan Kiszka
2022-04-22 16:59   ` Jan Kiszka [this message]
2022-04-22  7:47 ` [isar-cip-core][PATCH v2 3/6] Convert /etc overlay from systemd mount unit to initramfs hook Jan Kiszka
2022-04-22  7:47 ` [isar-cip-core][PATCH v2 4/6] customizations: Relocate /root under /home Jan Kiszka
2022-04-22 12:22   ` Gylstorff Quirin
2022-04-22 12:53     ` Jan Kiszka
2022-04-22  7:47 ` [isar-cip-core][PATCH v2 5/6] initramfs-verify-hook: Optimize probing of partitions Jan Kiszka
2022-04-22  7:47 ` [isar-cip-core][PATCH v2 6/6] secureboot: Prevent getting shell on panic Jan Kiszka

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=967ff119-c3cc-6340-c4ce-471d6dd95d9f@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=christian.storm@siemens.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=quirin.gylstorff@siemens.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.