From patchwork Wed Nov 20 17:02:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3953 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 20 Nov 2024 18:03:15 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-oo1-f56.google.com (mail-oo1-f56.google.com [209.85.161.56]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AKH3Dmj006929 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 20 Nov 2024 18:03:14 +0100 Received: by mail-oo1-f56.google.com with SMTP id 006d021491bc7-5eb9fe126f8sf1603942eaf.1 for ; Wed, 20 Nov 2024 09:03:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732122186; cv=pass; d=google.com; s=arc-20240605; b=ZQ/2mjcaykF4/25/uDtPiwHCjS84STTwVV/uV+xCmOsq5Zjc9/b57Th1Kjs2bAt71V qEErFRNDMFCezWzlXhoGg+zJD5sc0iqknNoclQdRI37s9P/LU6IaMl+4Z48/lncmTQ7o Arr3G1FsSDBFoGVPJU5P7iVdW7MwVLEsxhP6tnbjljSaVTdgV9iyo7zhRny9xBt3dyeV OWYidPzPtrpAK/3nWORtW3vMpVs19m4Exh9keVKBwCon1iAWHqNp3J2QQmE62lfxFlA7 FSzftMvi9QtclPxXavDQpZYnKRKHJnLSra9/ZHSgvvouh5Hndq9dyydUvXMNdYZJTToy tI1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uWp4hWE4WlKQrVketSi5gc8h/PfYFqjKm+P6AIOf3ZY=; fh=N6HMyzo8v+SUugtsXJraX+3J4r6c9XbvThyjJ39V/H8=; b=BLSvvtoJJa5AfSEDN+nrg9GZ1Ce3oFQW8BlwqXtgHdg0+bH+wjKWQk3ymzsR2XOpMS Pxt9CUFU7HHdyGGVt6jekzY8NhOwHqt4VG0rMcCygF7Cp9jfHXSt/G4iH+kVxzh1kg7I 6f1lW97ef0soIxdC8oay3mi9nU1IQSyTgN0xAxfcJwoJ+IuhxoDokiffmUDYkWvgMV0y /FdM5sviry5BsXGjwI9Xn1+o/Og+CughGfNN5x3diAH/vqRRpOL6nojowDnWyTXcNLHv ru4aWXiy8wE0osSBWD/xxJnqjeov8o0AB4fPc3n2nVA+JCZAqu9X8XehMkjXnIp3Ev3D +3oQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=BxT6fu0U; spf=pass (google.com: domain of fm-294854-20241120170303b12ea24870a93b0bc4-zl3qvy@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-20241120170303b12ea24870a93b0bc4-zL3qVY@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1732122186; x=1732726986; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=uWp4hWE4WlKQrVketSi5gc8h/PfYFqjKm+P6AIOf3ZY=; b=PBHroaTUakTUK4oN9B36hftmEKo5UFWfCRTrvDNUtS3MNkIfIZpr4p7soW/EnnZXU3 HqgC7WQpFvA1NAIftgeFzHO5apBk/x6xx5Rnooo/WI68G+AWmPojlPN5K07OkWcDHOsV hXJQ/u+gPuT3ytXp9EiA0b2D87OHmhlJcZoV3DIg0smfd6nhC8XqrlU76bVaCyiUIYGw 5BPGp2S8KpUYwRbmz3eat06lAS9Y5eR6hRoQdd8XJ5w3GRHZkj215yGT9pCHz3x5gpiW MqRIq4okPC/x5L2Kytx7hjoH0zOF93eb7BMIc0CDoJAgtTHawf1uU3u2upiNSMPbK54m RuKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732122186; x=1732726986; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uWp4hWE4WlKQrVketSi5gc8h/PfYFqjKm+P6AIOf3ZY=; b=volnrC9WTVtnNVmIoqWnSqykwecfIlz008qEkclAZAyFMXkE2D3H/q2GZSOuzHfwo8 vDpiPbFNTZQBvOPkUPxwvq/96s4I3O+xfYvbdcCsKg+OiqeicSDmA4YMovhfDBXxAPKi Q4f+PFfyCmTBHlSA5XbMmIFGFAGekwgjjGu8ak055i6MTDZO2XlbNWEAmEKGSrNhOFap JUCTfiZybPTGqscCtnob8TKmPG2E2GfAy0IZ6ALsWah5zgPF96XekMwoWJ6evuKC6PDP eU5138j+hfsDmM8kAPSBwOodW7lUgV87HXhW+q1tv6po8XzzNa88XtPMBVjQ6J40w5kT j/NQ== X-Forwarded-Encrypted: i=2; AJvYcCUal5Wu+NXoqdDfBk3vF0rrcrJ+Yo5VqSubgfopE8SGevQHbVeNXa5Cp+HyguMrG3nfdKMN3ak=@isar-build.org X-Gm-Message-State: AOJu0YybVXVSEF61/M0Y3InmuV5DOnZpt4KK+uch+k+hW3C3kaVztP7i /wZ5QMgg5jEVCQsz44gSjm6ZrftCo7vyJxTb3zZNP6qCzPVS5jd9 X-Google-Smtp-Source: AGHT+IG6wVCTXk+TUbS5qrG1ftc9Tn/UzPd+E8ki0+XbJQ8IQaJzg4oJf2qWnaqNAWM4e7BW+zWSLw== X-Received: by 2002:a05:6820:4c11:b0:5ee:de1e:980e with SMTP id 006d021491bc7-5eee828fb62mr3475566eaf.7.1732122185917; Wed, 20 Nov 2024 09:03:05 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6820:2205:b0:5eb:6ac9:e863 with SMTP id 006d021491bc7-5ef3c4cb0dals20830eaf.1.-pod-prod-07-us; Wed, 20 Nov 2024 09:03:05 -0800 (PST) X-Received: by 2002:a05:6830:b82:b0:718:c7f:5cbd with SMTP id 46e09a7af769-71ab31c5d70mr4021118a34.28.1732122184969; Wed, 20 Nov 2024 09:03:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732122184; cv=none; d=google.com; s=arc-20240605; b=UHzHrL5b1Iwp3rX4A575fiWnVDfGyunukjuxxt0HTcpV82qsQKMYXO+aJVdljv84+O D/kFIwGihrts0pglhre99/IWlEzukcJjnP3duZ4xiHnUy2w3aRYpScQXW5Zp0gQ7RiU0 RFFXD75+65IitriOlZvxHMm/xjbbPDgFCbFeRtc9mIRSrIuqbPe3dsQHMgdTr0WBHnbc YypGjtBEYkaNaW6YucDov4/kylvu2CpC6/kYJCxSMRujHP2U86imjuJtoaqMObBomuXR M7Orkgp3Hn4pN8D6cV9OP3CU1r6KfCh7sefP5uvHQuaZGZyg2V2ssaiY5Ud6dGTeOQNF C/1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=1SmGJD8sNAT8lI5B4I8KeLxB2HgGvxa/go9kgLfOnLc=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=iKoa1SG1/fFeTdVj7vbKK5tAbzMTUKcKj4Go9xzWfP/9UTNZQYItpmQse8FhMv6ukT /m+BR0k7CCibYRfn4+iipFAYllke9mPZ59trfVj8cT8Wj/JCVnbbJOkxloZKryJg+1/R 5ltTlb9X5LQLkglRNUSImAor1fAtIlKWOZBIWCV6jDRVGnRz+Xh2bytl9oo4z8+KMeue 4tgScec03gwhJ88uyHl+KMgDwEfOOcncyUPtNWME+nQ792+Snbh09zRJWxZSi/r4Gwd5 t3mnSC/wKC1o12DMIgcDCn/qFz048eqJSO6XjIUU+Hu+aTDGEkPJnDFfeULmevXrjykY kmJw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=BxT6fu0U; spf=pass (google.com: domain of fm-294854-20241120170303b12ea24870a93b0bc4-zl3qvy@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-20241120170303b12ea24870a93b0bc4-zL3qVY@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net. [185.136.65.227]) by gmr-mx.google.com with ESMTPS id 46e09a7af769-71a781e7bc0si507505a34.3.2024.11.20.09.03.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2024 09:03:04 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-20241120170303b12ea24870a93b0bc4-zl3qvy@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) client-ip=185.136.65.227; Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20241120170303b12ea24870a93b0bc4 for ; Wed, 20 Nov 2024 18:03:03 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v5 5/7] initramfs-fsck-ext4-hook: Convert to hook.inc and improve Date: Wed, 20 Nov 2024 18:02:59 +0100 Message-ID: <0c4bdba32d59b3e97b2962ffc7edfde9659b6ae0.1732122181.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer X-Original-Sender: jan.kiszka@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=BxT6fu0U; spf=pass (google.com: domain of fm-294854-20241120170303b12ea24870a93b0bc4-zl3qvy@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-294854-20241120170303b12ea24870a93b0bc4-zL3qVY@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Jan Kiszka Reply-To: Jan Kiszka Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Jan Kiszka Use the convention and helping features of the new initramfs hook.inc to simplify this hook. We move it under recipes-initramfs to align with other recipes there. Another change is making fsck.ext4 mandatory, both as dependency and while copying it in via the helper - there is no reason for this recipe to almost silently ignore any unavailability. Signed-off-by: Jan Kiszka --- .../images/isar-initramfs.bb | 2 +- .../files/initramfs-fsck-hook-ext4.triggers | 0 .../initramfs-fsck-ext4-hook_0.3.bb | 14 +++++++ .../files/initramfs.fsck.ext4.hook | 39 ------------------- .../initramfs-fsck-hook-ext4_0.2.bb | 18 --------- 5 files changed, 15 insertions(+), 58 deletions(-) rename meta/{recipes-support => recipes-initramfs}/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers (100%) create mode 100644 meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb delete mode 100644 meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook delete mode 100644 meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb diff --git a/meta-isar/recipes-initramfs/images/isar-initramfs.bb b/meta-isar/recipes-initramfs/images/isar-initramfs.bb index 71dbaa43..d2a946f7 100644 --- a/meta-isar/recipes-initramfs/images/isar-initramfs.bb +++ b/meta-isar/recipes-initramfs/images/isar-initramfs.bb @@ -15,5 +15,5 @@ INITRAMFS_PREINSTALL += " \ # Recipes that should be installed into the initramfs build rootfs. INITRAMFS_INSTALL += " \ initramfs-isar-example-hook \ - initramfs-fsck-hook-ext4 \ + initramfs-fsck-ext4-hook \ " diff --git a/meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers b/meta/recipes-initramfs/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers similarity index 100% rename from meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers rename to meta/recipes-initramfs/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers diff --git a/meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb b/meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb new file mode 100644 index 00000000..c4d10c44 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb @@ -0,0 +1,14 @@ +# This software is a part of ISAR. +# Copyright (C) Siemens AG, 2019-2024 +# +# SPDX-License-Identifier: MIT + +DESCRIPTION = "Recipe to add fsck hook to the initramfs" + +require recipes-initramfs/initramfs-hook/hook.inc + +SRC_URI += "file://initramfs-fsck-hook-ext4.triggers" + +HOOK_COPY_EXECS = "fsck fsck.ext4 logsave" + +DEBIAN_DEPENDS .= ", e2fsprogs, logsave" diff --git a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook deleted file mode 100644 index 259b73b4..00000000 --- a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook +++ /dev/null @@ -1,39 +0,0 @@ -# This software is a part of ISAR. -# Copyright (C) Siemens AG, 2019 -# -# SPDX-License-Identifier: MIT - -#!/bin/sh - -set -e - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /usr/share/initramfs-tools/scripts/functions -. /usr/share/initramfs-tools/hook-functions - -if [ ! -x /sbin/fsck ]; then - echo "Warning: couldn't find /sbin/fsck!" - exit 0 -fi - -copy_exec /sbin/fsck -copy_exec /sbin/logsave - -if prog="$(command -v fsck.ext4)"; then - copy_exec "$prog" -else - echo "Warning: /sbin/fsck.ext4 doesn't exist, can't install to initramfs, ignoring." -fi diff --git a/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb b/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb deleted file mode 100644 index 9860dbc8..00000000 --- a/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb +++ /dev/null @@ -1,18 +0,0 @@ -# This software is a part of ISAR. -# Copyright (C) Siemens AG, 2019 -# -# SPDX-License-Identifier: MIT - - -DESCRIPTION = "Recipe to add fsck hook to the initramfs" - -inherit dpkg-raw -SRC_URI = "file://initramfs-fsck-hook-ext4.triggers \ - file://initramfs.fsck.ext4.hook \ - " - - -do_install() { - install -m 0755 -d ${D}/etc/initramfs-tools/hooks - install -m 0740 ${WORKDIR}/initramfs.fsck.ext4.hook ${D}/etc/initramfs-tools/hooks/fsck.ext4.hook -}