From patchwork Sat Nov 16 10:55:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3931 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 16 Nov 2024 11:56:04 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-il1-f184.google.com (mail-il1-f184.google.com [209.85.166.184]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGAu2Aw013474 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 11:56:03 +0100 Received: by mail-il1-f184.google.com with SMTP id e9e14a558f8ab-3a7191aa79csf18282705ab.1 for ; Sat, 16 Nov 2024 02:56:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731754557; cv=pass; d=google.com; s=arc-20240605; b=XqU6jqkCRtCYLrcnqFCH9E3S3ekasiWeh/of+/2p+avY8zcoQc7Vh1hHGc/2oiqYHe QiltsO9BcblHQAhTHiMFLZMAIZ+v+k3fziCu6dhOkrZf8EOa+hAxzBP5Wz4fVdPe+6+u BDpqx3TvMnuAHtSM1UJuXOD3rLP4Fq9EYSPdA40Ap0OOO4fFBWu9Hfh+apT7lAlsqlvd aHIFkjOK4MMlDFTuLWyYHKPLA6VLvgch2wZ1j9yQ3kPALR8IhRHT8ZwkxxN0lhJighab +lUzEckuzqXwMp3s83AOttiZI/D60lidBJbCUSO66EeGD3r3GXbVfrzV+s5rxpgFLWlo iT7A== 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=xRPEKDQHRNxDOFRNG5gYCCigFl9cyaatDiRIQ4Sl1F0=; fh=crhuwspyVH4mwdroeaC1dRu+msmDf4rlkko7MOWTYGY=; b=aYP9QuNit60u/m5h3uMAItB07YQES3ZKqp0sIUG7dKjCRaoXni5HRr82xjx/p5o1GS 30TsZNrRbGVKXh8TuYe3uP0gJzEsf3VX4EpaJHqJ3j76Huyy9SAbwSKsm9UrbdEGPDA8 6CQqI2JjHzGc5R87++UtRYFWs1OMcZisYUXxJSJLngODdeymzsqM3Wx4aTpCBHg1nSZx 3PYVRxLjM02VbnP07tdO3jV/ifkz6SGYIh40s6pXQjSmJDNKuVpNXIg+aGTtAgp2GQTx gKLPPFWUdBi7H7jgne1dV3F4Y/SewDPyO/j/2v/k4MfriqOswhBDWD/vWUJ1paJetTGs Om0A==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=TJyoxYac; spf=pass (google.com: domain of fm-294854-20241116105553d2c4da3917f5cbbe3a-vxkfj4@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-294854-20241116105553d2c4da3917f5cbbe3a-VXkfJ4@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=1731754557; x=1732359357; 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=xRPEKDQHRNxDOFRNG5gYCCigFl9cyaatDiRIQ4Sl1F0=; b=oUPs+Clg9w0AT0STqTVLMGk2laCUtvkNNNXVKJpi6ZlwOhjRP2nKbqoKw4nPQQAuU8 bhPfEpmGp4X0UwxLxsReaxmLVpNRATfK4Nx/k7Hb8WgGPtBUi5dDgqSHGauyf+cjtcws dC9xZZOfeHXE2kDZ6Vs3JcweqLiqJYYF3P6ta7x3YDE+TU5u9tnbmKNRcGNBvQx/slBs 7EZc0rUkLS+O+atkbktDvGtqC+hikCrsQy7gdmO/TdTk/5RF0FMeDk+boVsA+VhG6xsJ DptySz3vPDAtAVnUtvin5NMxeir6RoLFXpcTbuVSvOTfhHRxgs6TOw6i2nCiBM7AxQ74 J9rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731754557; x=1732359357; 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=xRPEKDQHRNxDOFRNG5gYCCigFl9cyaatDiRIQ4Sl1F0=; b=OaYH4R+P0tbKx/nMR43fBcfEJKfIegZFYtmGCi8ru3ZOI395OgwGfJFVEcZ2WI+YEm f4sFOvOK10BFPLJBm+gU271/OphzJN7Dhr9vZe4FHAA4SY42EdmNplnjhRYv/PBoOTJn ucQat2c66U0o9ufA90gzfRAuN4vT59dnB7UANC0dVVYdLndE/lg38r8n/8U+sCGOG5Gu yM0iGw6INwjh3VUwnM237MoYPZQwRMZgtljrCLhL3tHkErFo/1bzRMntfffqKlCFY25G sQjlAmqIW/oajs12MK/gKV/5PyAyF3TzDnA2C36okSDr+ciexk3bPM9wJzUJqwXVVgqb Ix8w== X-Forwarded-Encrypted: i=2; AJvYcCWwpkgJv/ETe7GyXSeepB4TOVhNMAtXDtD4WO7en/RtHwHSpnmAlTQvC4nmod1xhscnllCnlrE=@isar-build.org X-Gm-Message-State: AOJu0Yzr81khDX7guy4L6MvAE5CpnqG4VXu8Q6Orn8zEKJBM4HHOrLr0 tjk6qX2V/OZTyR4tJjqLZIs/3gLwKlN0QhQv4Q05TwdmMdIu+6wE X-Google-Smtp-Source: AGHT+IHPtAhJeXqelpU/Xju80m85hjnJ8Rx6ryFiZBZmNhPa26MYeejygQhDbmHhmbGybsN9YSnRqg== X-Received: by 2002:a05:6e02:1a26:b0:3a7:172f:1299 with SMTP id e9e14a558f8ab-3a74802cb47mr66401465ab.12.1731754557212; Sat, 16 Nov 2024 02:55:57 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a92:c5c5:0:b0:3a7:158d:67d9 with SMTP id e9e14a558f8ab-3a74803791dls7798645ab.1.-pod-prod-03-us; Sat, 16 Nov 2024 02:55:56 -0800 (PST) X-Received: by 2002:a05:6e02:1a8d:b0:3a6:b445:dc9c with SMTP id e9e14a558f8ab-3a747ff7fc7mr79269405ab.3.1731754555973; Sat, 16 Nov 2024 02:55:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731754555; cv=none; d=google.com; s=arc-20240605; b=HLyLPycik8a/KZs0jml3+5t3KpRMTycM8Q60T4gcaKX8o8tDc2qKjlzHUFGcxM++ZO 3Oh3NZZ3X3tN3otUBDNgA7JPNNdAgCPbaqE+SpbTCrmMuZLpl01kV3GrxXtBlCmwd3/X AH+Zv2dnCQXOpw03gSOn+EZiFt842IbsWUKf7QA8yOCEO5ByvQMc+p7izGtMxlQStIzM I5m32+byHie/xPh/0ed4LajRjFE5/8RG9feGC0ffvUoP74LP9kIimA1MFulpAAo6FsPg L7ddEDoUhqDOsuBCjVTqKFJFfA2J7Fuc0SmjcG51V94mAIdBl1tTuYpb7+pvSg7+DBpg GswQ== 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=7EU6YckRabf024yXnVkL6BMsC9wvRooCqyNfekm8K58=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=QdclUkX4JxDbGw0eduMr94IEIkzfeNWStyGUlpXWD58voumpjRkQZWfQSL5itMqKBA fSefBjPC2NWotth+xSmzcGck3GulsFPrRP29qzwiUafnFsZLglIs4XNgwc+AR4tJ7qiH AbM/xGBKsg9jhPMai9SW2HljwuS+t4nXbA+VteGot2OhxBalf5e+G8+tfIbnrRG4OjRN d36QXfanaJ70oP84ehfmRLBrJIQG1rvf6nYS0n6w6kMy1Lo+poqDzh3kS+0bjlI9DaUp Kj6Qs8QrDb8Cmpg3FwotcsPdfqlX0A+XknAlLEghmcNzdlZwotIDa8tC3iDka9AbuMxy 2JUA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=TJyoxYac; spf=pass (google.com: domain of fm-294854-20241116105553d2c4da3917f5cbbe3a-vxkfj4@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-294854-20241116105553d2c4da3917f5cbbe3a-VXkfJ4@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net. [185.136.64.228]) by gmr-mx.google.com with ESMTPS id e9e14a558f8ab-3a747fc3e04si1609295ab.0.2024.11.16.02.55.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 02:55:55 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-20241116105553d2c4da3917f5cbbe3a-vxkfj4@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) client-ip=185.136.64.228; Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20241116105553d2c4da3917f5cbbe3a for ; Sat, 16 Nov 2024 11:55:54 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v3 1/7] initramfs-hook: Add infrastructure to ease writing hooks Date: Sat, 16 Nov 2024 11:55:46 +0100 Message-ID: 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=fm1 header.b=TJyoxYac; spf=pass (google.com: domain of fm-294854-20241116105553d2c4da3917f5cbbe3a-vxkfj4@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-294854-20241116105553d2c4da3917f5cbbe3a-VXkfJ4@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_H2,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 This recipe include shall simplify writing of initramfs hooks. It provides the usual headers for the installation hook as well as the boot scripts, allow to generate that code that installs executables and modules into the image, but also supports expanding the scripts with own snippets. Signed-off-by: Jan Kiszka --- .../initramfs-hook/files/hook-header.tmpl | 39 ++++++++++ .../initramfs-hook/files/script-header.tmpl | 26 +++++++ .../recipes-initramfs/initramfs-hook/hook.inc | 74 +++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl create mode 100644 meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl create mode 100644 meta/recipes-initramfs/initramfs-hook/hook.inc diff --git a/meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl b/meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl new file mode 100644 index 00000000..ee30d691 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Copyright (c) Siemens AG, 2024 +# +# Authors: +# Jan Kiszka +# +# SPDX-License-Identifier: MIT +# + +set -e + +prereqs() +{ + echo "${HOOK_PREREQ}" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions + +for module in ${HOOK_ADD_MODULES}; do + manual_add_modules $module +done + +for executable in ${HOOK_COPY_EXECS}; do + if exec_path=$(command -v $executable 2>/dev/null); then + copy_exec "$exec_path" + else + echo "(ERROR): Unable to copy $executable" >&2 + exit 1 + fi +done + diff --git a/meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl b/meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl new file mode 100644 index 00000000..faa1a644 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Copyright (c) Siemens AG, 2024 +# +# Authors: +# Jan Kiszka +# +# SPDX-License-Identifier: MIT +# + +set -e + +prereqs() +{ + echo "${SCRIPT_PREREQ}" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /scripts/functions + diff --git a/meta/recipes-initramfs/initramfs-hook/hook.inc b/meta/recipes-initramfs/initramfs-hook/hook.inc new file mode 100644 index 00000000..5509c074 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-hook/hook.inc @@ -0,0 +1,74 @@ +# +# Copyright (c) Siemens AG, 2024 +# +# Authors: +# Jan Kiszka +# +# SPDX-License-Identifier: MIT +# + +FILESPATH:append := ":${FILE_DIRNAME}/files" + +inherit dpkg-raw + +SRC_URI = " \ + file://hook-header.tmpl \ + file://script-header.tmpl" + +TEMPLATE_FILES = " \ + hook-header.tmpl \ + script-header.tmpl" + +TEMPLATE_VARS:append = " \ + HOOK_PREREQ \ + HOOK_ADD_MODULES \ + HOOK_COPY_EXECS \ + SCRIPT_PREREQ" + +HOOK_PREREQ ?= "" +HOOK_ADD_MODULES ?= "" +HOOK_COPY_EXECS ?= "" +SCRIPT_PREREQ ?= "" + +DEBIAN_DEPENDS = "initramfs-tools" + +def get_initramfs_hook_name(d): + name = d.getVar('BPN') + if name.startswith("initramfs-"): + name = name[10:] + if name.endswith("-hook"): + name = name[:-5] + return name + +INITRAMFS_HOOK_NAME ?= "${@get_initramfs_hook_name(d)}" + +do_install() { + if [ -f "${WORKDIR}/hook" ] || [ -n "${HOOK_COPY_EXECS}" ] || \ + [ -n "${HOOK_ADD_MODULES}" ]; then + rm -rf "${D}/usr/share/initramfs-tools/hooks" + install -d -m 0755 "${D}/usr/share/initramfs-tools/hooks" + + install -m 0755 "${WORKDIR}/hook-header" \ + "${D}/usr/share/initramfs-tools/hooks/${INITRAMFS_HOOK_NAME}" + if [ -f "${WORKDIR}/hook" ]; then + cat "${WORKDIR}/hook" >> \ + "${D}/usr/share/initramfs-tools/hooks/${INITRAMFS_HOOK_NAME}" + else + echo "exit 0" >> \ + "${D}/usr/share/initramfs-tools/hooks/${INITRAMFS_HOOK_NAME}" + fi + fi + + for script in init-top init-premount local-top nfs-top local-block \ + local-premount nfs-premount local-bottom nfs-bottom \ + init-bottom; do + if [ ! -f "${WORKDIR}/$script" ]; then + continue + fi + + rm -rf "${D}/usr/share/initramfs-tools/scripts/$script" + install -d -m 0755 "${D}/usr/share/initramfs-tools/scripts/$script" + install -m 0755 "${WORKDIR}/$script" \ + "${D}/usr/share/initramfs-tools/scripts/$script/${INITRAMFS_HOOK_NAME}" + done +} From patchwork Sat Nov 16 10:55:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3932 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 16 Nov 2024 11:56:05 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-io1-f57.google.com (mail-io1-f57.google.com [209.85.166.57]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGAu3vJ013484 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 11:56:04 +0100 Received: by mail-io1-f57.google.com with SMTP id ca18e2360f4ac-83e5dd390bfsf253666539f.1 for ; Sat, 16 Nov 2024 02:56:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731754557; cv=pass; d=google.com; s=arc-20240605; b=CVCG7UyitjVXj0kIpSHnh+rbDg8wV7T9At1iYmUSvBKh9j8KzWsXISGpGgLieFrMa8 X+St7l0R7a67eEKn1Y8mgnlk7UA6v9F8r4LVjyqvCVqKxiJZ8sQexwfHqfanBxB4f/ql A7mRbKWrrKrkE8+P7wHqG6kpn0mujKrCUu32agAgetFPE4zI6jR29F1ybJH0ilDL6L+j Q7Q0t8F2Z5BsVdYy/eMpBu/suwa6IPFNOXDOwlxBkJ1EpsGhJ2fuHMqMJoK7UxRfQ97W K3poZTgN3HXmYwUb1u7eA0/9VxNy8iunHu5kouYX5uqCb0a5Vcv+cUQXjdfn6G0sKx9m OHfA== 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=a0ag0roZeWRRd8hCYEfB0G8+QZibGgYozfhpkBebsDc=; fh=1q0Kl9bUSyT2RHSbbmeZjXmfhDBA3XEuMYVuzJRAQt0=; b=Nz9M1iF9nsf0vljGqf/EW42h9F8C3lnnFqOHUd0syi7dbuHQ8VpSfdZvLUP/b//0jg G3hPk15wRdA+c+Cc0BEq03otwDG8MZztOVGZN/TqOFu1j2c4P2vk5jTdhzdhWdZe/f24 5/7zmR2nvaPZ34qC62wxi6sQnnIFFfGVoIGlRREa8+YgFaugYACNNi1t5v4s1QE+OmrU DjvY8sG0E20TbwH13e/SjPpy2etCw2t3dnN5ZYC72ECU2vRBHDbqiYjMWnZh/mRG7+5e eBoib0lRSHyN5/jF0JXLzu1PEXTGy5Zde0o6p+QjEqgBzm3/1gFHvCSEvtxfAY0PeeBn 3laQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Xg4sTEZG; spf=pass (google.com: domain of fm-294854-2024111610555464d807605b75a8e291-fi1x_4@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-2024111610555464d807605b75a8e291-fI1X_4@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=1731754557; x=1732359357; 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=a0ag0roZeWRRd8hCYEfB0G8+QZibGgYozfhpkBebsDc=; b=oiadWCe0KfgXVQfP+oo/2XsQ4wt8NGzDEXpfrMfjLpdCeawMvTh4nM7c6i/Q4qkCvv bqPQ0GThyV52j4dp+huzyUc7hemOT+wnsCse8ryDHGeK35OwFJBXi2O8KOV7JpLLBviN 3g0z5YPzaMJo727eHAfJJbzXdNUin+YmV1FV9aSlbGOJ2QtK1XvCzSLeokhXIhxvkBLy PfzBZFxvUnA0x7mzdiqL4JptH9FwIUQMExU/xdYueVfgPCGC/tW/CKNlNCDg3E4739J8 1z9T0nvVQw3Be+U8Vxr//d/CfulUmBwxqN1/uXfujetWvafpHZTwmLwI/98+UEYKr9nK JKfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731754557; x=1732359357; 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=a0ag0roZeWRRd8hCYEfB0G8+QZibGgYozfhpkBebsDc=; b=EduI7OzFDGkCRXd3T+UZ4+y3nfIKjZzwMq1qnA9T6D5tBkwen0qddnk8l6xVll8vdI stbCrP8zcrArG0/+bbAuBNPYGCgGil/Id0RixJExXb48r145W+bPFVnATBWZ9+KHK7Wa fpHMyacWnUWjIHdXh/+EfgPoRuiKGlpcl2wZx1LnEvEvL8x1wYuVuNk7sW45nSAoM5+X b0ibo/VfrszMLN5CYn92JLwCpXD2BTQHK9rlZWCW1K0V+8We+0/RnuQO+Icp0qvYWv5G kv9lunojGt6dmr/MgRr5EaD5MkizAe4RB/VMgnPj0MSTeJ+LNqkHqOYJAmKu+l8KyiJp W/Eg== X-Forwarded-Encrypted: i=2; AJvYcCXEs/FcCWERJ+pQymV5gAczsqfI8gXx1N2sjHMfGllwRohcXABM0Ky9+CkGkXxcyr8+B2lkSHc=@isar-build.org X-Gm-Message-State: AOJu0Yz9IRUCWCCnjMDTslmxb2mAWY13ABfi3yP5vIQO+CUwRInbkfzw jeOdBIyPoMy9rxSvF8v2J0KI/nXsqTRY0RzHwtN0Klt4TUyvO0Jf X-Google-Smtp-Source: AGHT+IGO3HT3f3PORDkwE1pm0u9ykFqwNhTXV6jUcXVIEP1tbJfAGov16XKExQ+ubri2a0srJ2IypQ== X-Received: by 2002:a05:6e02:1c86:b0:3a7:319c:9351 with SMTP id e9e14a558f8ab-3a746ffdaa7mr62663435ab.9.1731754557486; Sat, 16 Nov 2024 02:55:57 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a92:bf01:0:b0:3a6:b643:82ee with SMTP id e9e14a558f8ab-3a71e48bc84ls14831065ab.2.-pod-prod-00-us; Sat, 16 Nov 2024 02:55:56 -0800 (PST) X-Received: by 2002:a92:d64c:0:b0:3a7:5ced:af04 with SMTP id e9e14a558f8ab-3a75cedb450mr2247805ab.3.1731754556418; Sat, 16 Nov 2024 02:55:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731754556; cv=none; d=google.com; s=arc-20240605; b=UkyqTgKGwMKaNPoZmL9nqnr5nqbBZYDzX0SFRrScnTG+IGcS0JazIThL2shz4Nf9QG iv2W4TloLF2UkatjbgPGQ8/nedObrU4pYly3V3vEsW+KD5QbK/0Uidx2ZUyagF4e38JR ZIx0gi4eWGOfcIwJu0Qj6ohtnmRYh4E8n9qr6+Yilkupons4aN7jslbup8d5CMSVW6KE 9zAtOOfpOfQM2JHmhx/Og8PAde1SS6OSw6PLtonzRobJ+UFetAmQlKSaEe5o8sAUoJOQ J9leuHasgOWU6gYTHif4+fvoFQAS06806W9cYWHsnUbwMGpEBU2IPon6ZfhaIRld2MXn GtxA== 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=MGtnwDmd0nGW5LYz9FhXkLLYF1RdsF2HYPn6RDVj7EA=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=VJQ3b20eS8ftQk1kFFb6oqIk15P6b2ttd7Ikf2wTCvtuJoK+EkPMmlrCCYWFx2aRx3 MdeWVFBJgBjhqzabPSYEmUPnY89GbWS6oVOhBGTKgBgBuOliJvljrYrh3gdiKAUnx344 rjpo7SvXUwUHpkVMJaKCkAVB2uUvAoGVpXDT+Ja3zqSYePRAGD/1oVlpF8aC5D+NCCyC fZrlVdEafIHL4+Q+jwpn83iQ1nhE9HSofJ5YtvW1wD6xkD5lDAt0FpvbdcdsXW4xCW3r TyJujBCaoikPsheonxDGHxDet74FzFfSGhQC08pvQ3po2SFOYWB7e5NkRWu6902LAAAT 3DOQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Xg4sTEZG; spf=pass (google.com: domain of fm-294854-2024111610555464d807605b75a8e291-fi1x_4@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-2024111610555464d807605b75a8e291-fI1X_4@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-228.siemens.flowmailer.net (mta-65-228.siemens.flowmailer.net. [185.136.65.228]) by gmr-mx.google.com with ESMTPS id 8926c6da1cb9f-4e056f37528si125246173.0.2024.11.16.02.55.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 02:55:56 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-2024111610555464d807605b75a8e291-fi1x_4@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) client-ip=185.136.65.228; Received: by mta-65-228.siemens.flowmailer.net with ESMTPSA id 2024111610555464d807605b75a8e291 for ; Sat, 16 Nov 2024 11:55:54 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v3 2/7] doc: Describe initramfs customizations Date: Sat, 16 Nov 2024 11:55:47 +0100 Message-ID: <5dd3ee9388f0c93142d123fc0fde550b8a3cf638.1731754552.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=fm1 header.b=Xg4sTEZG; spf=pass (google.com: domain of fm-294854-2024111610555464d807605b75a8e291-fi1x_4@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-2024111610555464d807605b75a8e291-fI1X_4@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_H2,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 Document to new hook.inc as well as the preexisting initramfs class. Signed-off-by: Jan Kiszka --- doc/user_manual.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/doc/user_manual.md b/doc/user_manual.md index 4b07f903..c20ffd93 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -1602,3 +1602,57 @@ CONTAINER_DELETE_AFTER_LOAD = "1" SRC_URI += "docker://debian;digest=sha256:f528891ab1aa484bf7233dbcc84f3c806c3e427571d75510a9d74bb5ec535b33;tag=bookworm-20240701-slim" ``` + +## Customize the initramfs + +Isar supports the customization of initramfs images by providing an +infrastructure for quickly creating hooks and by allowing to replace the +Debian-generated image with a separately built one. + +### Creating initramfs hooks + +To create an initramfs hook that adds tools or modules to the image and may +also run custom scripts during boot, use the include file +`recipes-initramfs/initramfs-hook/hook.inc`. It is controlled via a number of +variables: + + - `HOOK_PREREQ` defines the prerequisites for running the hook script. + - `HOOK_ADD_MODULES` passes the provided modules names to the + `manual_add_modules` function during initramfs creation. + - `HOOK_COPY_EXECS` identifies the source of the passed executables on the + rootfs that runs mkinitramfs and passes that to `copy_exec`. If an + executable is not found, an error thrown, and the creation fails. + - `SCRIPT_PREREQ` defines the prerequisites for running the boot script. + +If the generated hook script is not sufficient, you can append an own +bottom-half script by providing a `hook` file in `${WORKDIR}`. It will be +appended to the `hook-header` that the helper generates. + +For running a custom script during boot-up, provide a bottom-half file in +`${WORKDIR}`. Its name defines where it is hooked up with the initramfs boot +process: `init-top`, `init-premount`, `local-top`, `nfs-top`, `local-block`, +`local-premount`, `nfs-premount`, `local-bottom`, `nfs-bottom`, `init-bottom` + +See https://manpages.debian.org/stable/initramfs-tools-core/initramfs-tools.7.en.html +for further details. + +The hook recipe should follow the naming convention `initramfs--hook` +so that its scripts will then be called `` in the generated +initramfs. + +See `initramfs-example` for an exemplary hook recipe. + +### Creating an initramfs image aside the rootfs + +To avoid shipping all tools and binaries needed to generate an initramfs, isar +provides the initramfs class. It creates a temporary Debian rootfs with all +those dependencies and generates the initramfs from there, rather than the +target's rootfs. + +This initramfs class should be pulled in by an image recipe. Said recipe +specifies all dependencies of the initramfs via `INITRAMFS_INSTALL` for +self-built packages and `INITRAMFS_PREINSTALL` for prebuilt ones, analogously +to the respective `IMAGE_*` variables. Note that the kernel is automatically +added to `INITRAMFS_INSTALL` if `KERNEL_NAME` is set. + +See `isar-initramfs` for an example recipe. From patchwork Sat Nov 16 10:55:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3934 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 16 Nov 2024 11:56:06 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-pj1-f63.google.com (mail-pj1-f63.google.com [209.85.216.63]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGAu44o013502 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 11:56:05 +0100 Received: by mail-pj1-f63.google.com with SMTP id 98e67ed59e1d1-2ea0c861834sf2412624a91.3 for ; Sat, 16 Nov 2024 02:56:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731754559; cv=pass; d=google.com; s=arc-20240605; b=aKTHCJnbYjX4EaOWLZHBwTkUCq7OV+4EXr8vj3b7KmiUzo1UqBMZ/Q6D6dcct+OZxW cPpobjqVdVX3iLXZXi6vYZOwQjKpf6jZPLFd9G1O7gD4gmAyQV0fIGSyg7x8b+H9bwK0 HqQbtJOR9uucJJBldu+SUg3z9O2Cr27DJNed/hxPGGu+XgpFX6CgziY8X6gF6q/oZU7J vLjjzWdJCgoiS3xXfs2LLyNUKyK+KBm25cMOIor6IIBjpnopHKajed9kVpTB3cOAIJAN mBRB9qiy8YB5ToC0RWZDg16nVaHXvgNpau7oQCHacLTxtwzVzuE9FlSR6HPH2kSzkhse 0EcA== 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=rGm3QpGZh3pKUjkGMuJuXBxWkdjHz928oZkvmKSbu0I=; fh=b4Vhr3Bw9XvAaLltQhXzafRRy/KWAVi1k8F64xOEyvU=; b=gmto9anRzCpo6w5Ab82plmcDibai/WEZag/LsETSHgkdbUa9N+u1+FiQKp86gZ7qmF B5laqksnKvoZwIp1Vu1N6NQjBDEqKXCz7LYlwYVjizH4P2C2cJL8A+18I9nw3IaJ6IgQ 56TRW6EE+pjgYkhAmq4hOx2LRhRO0rK6P3iDZkI376Quxf3lZnY1fJV2M8KYfkyHaq7/ DbMWofTGd0WXl5SNAAXRo9I0NE/7uxSfemAdSQ8b6qI5rjCYwYgD7GzZqGgEcGz07hKT 59kCovq+N8/e7WKgJXWoGwgKDGUE0qLZsHFxjT2A5F3CR1vbeBSWmfe4cKks2JLm4YwO pi0A==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=YQcVPYnw; spf=pass (google.com: domain of fm-294854-20241116105554a14544e5ad7e9769e2-53y5pv@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-20241116105554a14544e5ad7e9769e2-53Y5pv@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=1731754559; x=1732359359; 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=rGm3QpGZh3pKUjkGMuJuXBxWkdjHz928oZkvmKSbu0I=; b=XLm1hO3dHeg+Kr3reuorbeUxM3MArDVT8xKddQxTgICB4f6DHcpGDp+w3hOdU6wvSl uUG2+1jnGnnIykRm3lROCXj031eKeex38yqBIlasHlilx3KyZvTjSu7S4/KAQjKOhR/a O7K6oOwHeUi3Gm7hnG+6eOnamC9V4f54ArqexCn7N05eQ4ojzPIB7PF5pfqI2PDi6b4B 4w/W6jsf6srNpkjZgffdgzSy7HQ0FBpRhNmrr4VIyVEkdMeUvmuLe3XUHHqZtY5+fUd+ AVwicqbU+aKZUroMgr1CUs901ABwzY8sEh6hVqGLU0bcGOOvnaZDDQLvvBU4UBan/ghc j5Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731754559; x=1732359359; 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=rGm3QpGZh3pKUjkGMuJuXBxWkdjHz928oZkvmKSbu0I=; b=J19OOSZ5q7yZKENakKL3+KRXSq2gh2HBDDTIIuHFpdgPjgsQHUBFe1l/loMgjscO96 zmKj58tbMrAjXAnaxPv2jVrdRcTfwBAgSEHZieF3RGOmLvyLO3Jfhl5vIR77IdljH7rW c/chhs7FD5fqhX3q6K3XIDCRURIJZ6hCl7eYERatuMqgVNKgpqclgJGSS42k9cYHn1za PtH8SJpQx2QE1vi+1QUF2RwGgPm8Esz1nD6DnzxkVoi4YSUXhvdMA2He0IAMEMm5ONVL 0g3aegXH7+MBDt3M7xbjU58f/ivpZbrY3EVaoB/cwunZp9cCV0rhIiz106Or9T4X+kAs 0rEw== X-Forwarded-Encrypted: i=2; AJvYcCV65QvuIrsYVHhtH58MujcagoRAjPrXX3gAYhsC5sRw2vEeTabYpKqALW4fQdA2baWLFBeZ6Hg=@isar-build.org X-Gm-Message-State: AOJu0YzWU3fmz/4mmHacYCGFXqTMGtKP5pbD5DW/+KANOyuAwnVmBRYF WEo55nZTvgwTqGWVBck8IC5I96PHdm5tMhjk2ZPOc2fke4Tz0czO X-Google-Smtp-Source: AGHT+IE2xvJfi27yU1TVy4eGAV8hR7RbjW1A805hY6b0fGhMbvrg0M3zMe2zF9qrSpfjmUtTS/6TWA== X-Received: by 2002:a17:90b:1646:b0:2e2:b204:90c5 with SMTP id 98e67ed59e1d1-2ea1559bb13mr7863234a91.33.1731754558594; Sat, 16 Nov 2024 02:55:58 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:90b:3c81:b0:2e9:b244:8c96 with SMTP id 98e67ed59e1d1-2e9fed88177ls2054899a91.1.-pod-prod-07-us; Sat, 16 Nov 2024 02:55:57 -0800 (PST) X-Received: by 2002:a17:90b:3b8b:b0:2ea:49a8:917b with SMTP id 98e67ed59e1d1-2ea49a89216mr351207a91.0.1731754557063; Sat, 16 Nov 2024 02:55:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731754557; cv=none; d=google.com; s=arc-20240605; b=eR8QkRL1BW8v+NK/2gE4odyV/8DKMUJ3fnMsKIVUcQMZCMOLEamzbLjOmRBQVEJTn7 mdkVUsk1m+NHcWkua8tFB1HL4konGreFvJNBbSbytawajvPVIzXdloENMrZ/z5H4WwmJ O/eGj6B44Ggm35dVnqqsEqgsubP8ZF1O46smJ4nVdLbiR1gECNe6VSrVreAjl+j0QBuS r+lpIsmWpySkDSoVoIhRFLoVhgMDKGU/Pmuuqbk6+zSU1KEn0rgLsR7LeNwrEeIJ3Y0W sHmlJk9XFpXzp5O53pQmM4MRYNokFom828xh15z8nRn9l40W4FWr9AKHlCwZoETi6iMX oeKw== 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=hd+Ra0mXFjq5wVHelyhO/fJKkwklcL3HIN/UivOBJwM=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=DcGpKGdLuZkE+BaKI6A1NS0x4iImqAHH4e99Uh94sSILR4qY7gSVveK1eMzlNXyTPD Gu9g5/mrVihObcqp7h71iVcp5PCodKbOyQTwsjX0D7l0O1zVFKkktIYTazoE1Y6XepLX teo8asjXBeatl6m05rmhK0wb1XTNlc+KxJNcRZT9hOvTMGcT/sH8Z6Koa1YMaSR0eeob bH6ZEmDVuw0hmCtV+gMRKsWr7VcOS/2fZTdQcLpjrEZsrXUMSf+G1ilktuSdf0Bd0cyy /ItSGd5Pgl0Wke0a6E8jZJjaOxEaKIKvYulKyOCwOwuWU+iOmsy2SFwoA+CDOAxh+xQw kpPA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=YQcVPYnw; spf=pass (google.com: domain of fm-294854-20241116105554a14544e5ad7e9769e2-53y5pv@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-20241116105554a14544e5ad7e9769e2-53Y5pv@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net. [185.136.64.226]) by gmr-mx.google.com with ESMTPS id 98e67ed59e1d1-2ea08a272c2si280921a91.0.2024.11.16.02.55.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 02:55:56 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-20241116105554a14544e5ad7e9769e2-53y5pv@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) client-ip=185.136.64.226; Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 20241116105554a14544e5ad7e9769e2 for ; Sat, 16 Nov 2024 11:55:54 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v3 3/7] isar-initramfs: Add initramfs-fsck-hook-ext4 Date: Sat, 16 Nov 2024 11:55:48 +0100 Message-ID: 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=fm1 header.b=YQcVPYnw; spf=pass (google.com: domain of fm-294854-20241116105554a14544e5ad7e9769e2-53y5pv@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-20241116105554a14544e5ad7e9769e2-53Y5pv@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_H2,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 Ensure basic CI coverage for this hook recipe. Signed-off-by: Jan Kiszka --- meta-isar/recipes-initramfs/images/isar-initramfs.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-isar/recipes-initramfs/images/isar-initramfs.bb b/meta-isar/recipes-initramfs/images/isar-initramfs.bb index aaa0350a..4df9e0b8 100644 --- a/meta-isar/recipes-initramfs/images/isar-initramfs.bb +++ b/meta-isar/recipes-initramfs/images/isar-initramfs.bb @@ -15,4 +15,5 @@ INITRAMFS_PREINSTALL += " \ # Recipes that should be installed into the initramfs build rootfs. INITRAMFS_INSTALL += " \ initramfs-example \ + initramfs-fsck-hook-ext4 \ " From patchwork Sat Nov 16 10:55:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3937 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 16 Nov 2024 11:56:11 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-ot1-f62.google.com (mail-ot1-f62.google.com [209.85.210.62]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGAuAkY013710 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 11:56:11 +0100 Received: by mail-ot1-f62.google.com with SMTP id 46e09a7af769-71a3da16d58sf2401690a34.3 for ; Sat, 16 Nov 2024 02:56:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731754558; cv=pass; d=google.com; s=arc-20240605; b=kPmt7nNsCSd8MB08A3mt1B70+iZe0yLQBJcM4sMVhzAdNMP2JHZORGfPWd0Nxh3S9u e7ACeZvv3mH/Plyo+0pKrWuykZ/mP65EjDXZnOSvP6aWezSFAQnu+k/nGVahQCfoKmBg jd+iX0X38BNDhSTsSNq/dFjXCjftho/ZjmkRBzXMqxvj4mNh5RBAGV6T78JtgrwWzmuH qHErFi3CBEqPwJsSAp/IouT6NiHFhhaMjh6FlWRlreUEp+EoqHRLEzXOS84vG2wD67fg dcssZvWW8+TrFV6IFXRrg5fWDbI8ZaUmOSC8Lr5K7sDBnMx0rOZOhf719P8mGhobWiI+ k+NA== 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=b1fZ+HZGnGHWDD800wGNVGqqSgWwacmbBAx/BtYzwVQ=; fh=fKsOwWZDlNqnWPJDy7CT9ggL0bvHN6GXXuSxxaDNLAY=; b=GKMXHILu8YV9WmFRIcZzA/5/X7Ru0STZTzbdYWshl2rt2sVoJYSRa+ku7Eu2jTo3nw 7V5eBGHzXj1FYKoHdSS16LlNKzz5rHogB3hn8Er0yWocM9fpftoIDknLy0t7LErOz36B BTg6JzHl7Sae+ZagPtMu8H7g5sBpTN4UepnnxC59KEI2OYkXfC19s0sKMzMMEex2fCcX bQXSbGFGWzXEdVeC6q/kkCnP18YnMvOcYzEJH/0qxPFt5WHyCV1d9CHy7Lp9tcDY4CIn /dE45MqjQbdKqQ0cnY3cYz/PSdg+9zKB9gALkxYsPdsbyTLfVWKm82nT/xfgQT6jBXjA FHKw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=aPfLmOgi; spf=pass (google.com: domain of fm-294854-202411161055541b2c2751a2ad5379c0-m0dy_c@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-202411161055541b2c2751a2ad5379c0-m0Dy_c@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=1731754558; x=1732359358; 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=b1fZ+HZGnGHWDD800wGNVGqqSgWwacmbBAx/BtYzwVQ=; b=ApoKJUrUazZzf/kONIM+jezUjNlNdwGtHOWrYgZ6JQkISmmH34O1JfDTe3hihKx4wy EGHZf/YZsoDdEQEFnMyA/xSl3G9mZUWaAY9Ag141uRTVEdytZTH87IYVaHfHCCoeRwZV sFPV8ZdJzFNGMvjCCW5O88Y2OB/dCnUejC67X+YqCPZiw06gP8NLcGgHM8ExwwvwwRok 0yJ+VB8Kx3fDqmFneyTQNjxOoCYbjvVvWBgWl1Aruuu/aZqPKUc+D6CEj0+IuIzPHEQE SgRSiN6BUtARaJ0kMOlwAEuCa6A7OkQ8Rir4sCBgvP0xFwH75lL0ALM241sJ7TfqUHyd HS5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731754558; x=1732359358; 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=b1fZ+HZGnGHWDD800wGNVGqqSgWwacmbBAx/BtYzwVQ=; b=Ojsa/Q5HwrLM5O5iJ9Yrv49/z9P/tRZ7ZyWnPOa9v6Z6yIxrkg9nJbTmK9+TwpXUCT g7wtXK6bEBKidw6aNJEoDMYD0zINZbzOwRbF4drDK2Mw40lsfzfscDc25Wzqo6EfdlUa gz5LBplzcuEDTdR6WJ4cHKIFOzVeEc3vipz9a+FT4wIXnCC4LnU2U2TtsLL0Q7oG4O2P Mza3i6anoLMTzaa9iXiStv9/n6rvfNKRFJcxgRSaQLYW+Nu5KOPl518gwIaOhR7ocXWs EfSrtUZkPI6Sum/k4MFnXaM4vb5hQQdHk9BM3oSb5siciOvkRmpEX50oYuZPBy72gUTG fhKg== X-Forwarded-Encrypted: i=2; AJvYcCVTyEyHFLM5hcJGJPQlrJaTyA8ZOIrAoPcck57VSFMPJi6IwgQoNSgkIExxDEW0ZFLvnJocOs4=@isar-build.org X-Gm-Message-State: AOJu0YzpbBYmKAT4/KvlxO9OraIwRvmEq4bW0aUrSDvzdgMM5mzi913e rt81hg7kRtLoXUYx0jVPx15u4bfn9nxznUUHOh7/wP4YZV4YRYWH X-Google-Smtp-Source: AGHT+IG8Gv+Kbu0XyGM2Kj6pYY5RRUD/GL11+PPum5pZzpjSWs3QUDfrZAnKZp1qL5e80aBOfFw6Ww== X-Received: by 2002:a05:6830:6006:b0:718:99fa:347 with SMTP id 46e09a7af769-71a77945314mr5975807a34.14.1731754557753; Sat, 16 Nov 2024 02:55:57 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6820:4cc1:b0:5e7:b0e9:85d1 with SMTP id 006d021491bc7-5ee9cdd1ef4ls2207413eaf.2.-pod-prod-08-us; Sat, 16 Nov 2024 02:55:57 -0800 (PST) X-Received: by 2002:a05:6820:1e10:b0:5ba:ec8b:44b5 with SMTP id 006d021491bc7-5eeab419c20mr5340068eaf.3.1731754556885; Sat, 16 Nov 2024 02:55:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731754556; cv=none; d=google.com; s=arc-20240605; b=jWKw/pPqQk/L0JwT8Udc86gLC5+3r669Iq1CqyqyF3ni2fZEkwp6Jlf36Na+fJgwd0 lvgGh/21AC8SLoBWKJEIqMUtG/DaSMwrRSE0u1DqgmA4e7VU4A+Gm9itYnd0u4LLqE2d Ac1SpBE2GWKUa9soECTvvzTvticLghCKP+V+qvxMcx2g4nFpyyiuf8Xxb9jZHuJc7LuD g2kiSeCknaXuanJ9vqBPjqeSDhshVfqH1PYprUsfb8f8x7lTHjZUFu0u5JnXYY2IsQER ORIVIpGh76UZXXcIoE4SxJRyIQzLq9NXG/a7fP9+3Rp+zJDM3KC6uGDVcjLE+QcDjUL/ oMbQ== 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=3NmuJ+CYB4NjLAWvkKRcIcbaRDM33YIGEP1V/+MRMTE=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=dJSdGisq9YNqBEx2X7jgCXfYZ4doFx53le7VbTBqjPx7pSoUYbEENoon6sew2woRPN SQMPlbZSa+Rig48gROT2ZQgfSzkn2kp9y/t0575OindfexCZekEwoBE/Qz1/ZYRku3eP GR9Pzr1kKIdkZ3cZEiYNK6sNQZ7bW0bl8DfvTHdGu7WtCUTPdT9S/c5N/jeuURoHS5Iz gYIwipcOdQgz+ca9LHFhmnkCgo9Ou6A1tfwcfiewqQANvVPj2q6lgrRvzbdMga5ChDvC M9kbw6wU3ZqyxgM4HhEg7W5yGP94CiunstkuJ2a4SFg+td3iSYYfzklez93KZ48lyTJ8 6YZA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=aPfLmOgi; spf=pass (google.com: domain of fm-294854-202411161055541b2c2751a2ad5379c0-m0dy_c@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-202411161055541b2c2751a2ad5379c0-m0Dy_c@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net. [185.136.64.227]) by gmr-mx.google.com with ESMTPS id 006d021491bc7-5eeabd10970si164677eaf.1.2024.11.16.02.55.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 02:55:56 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-202411161055541b2c2751a2ad5379c0-m0dy_c@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) client-ip=185.136.64.227; Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 202411161055541b2c2751a2ad5379c0 for ; Sat, 16 Nov 2024 11:55:54 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v3 4/7] initramfs-isar-example-hook: Convert recipe over to new hook.inc Date: Sat, 16 Nov 2024 11:55:49 +0100 Message-ID: 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=fm1 header.b=aPfLmOgi; spf=pass (google.com: domain of fm-294854-202411161055541b2c2751a2ad5379c0-m0dy_c@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-202411161055541b2c2751a2ad5379c0-m0Dy_c@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 Allows to drop the own hook recipe and makes the local-top boot script effectively a one-liner. Signed-off-by: Jan Kiszka --- .../images/isar-initramfs.bb | 2 +- .../initramfs-example/files/example.hook | 21 ----------------- .../initramfs-example/files/example.script | 23 ------------------- .../initramfs-example/files/local-top | 3 +++ ....bb => initramfs-isar-example-hook_0.1.bb} | 21 ++++++----------- 5 files changed, 11 insertions(+), 59 deletions(-) delete mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/example.hook delete mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/example.script create mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/local-top rename meta-isar/recipes-initramfs/initramfs-example/{initramfs-example.bb => initramfs-isar-example-hook_0.1.bb} (63%) diff --git a/meta-isar/recipes-initramfs/images/isar-initramfs.bb b/meta-isar/recipes-initramfs/images/isar-initramfs.bb index 4df9e0b8..71dbaa43 100644 --- a/meta-isar/recipes-initramfs/images/isar-initramfs.bb +++ b/meta-isar/recipes-initramfs/images/isar-initramfs.bb @@ -14,6 +14,6 @@ INITRAMFS_PREINSTALL += " \ # Recipes that should be installed into the initramfs build rootfs. INITRAMFS_INSTALL += " \ - initramfs-example \ + initramfs-isar-example-hook \ initramfs-fsck-hook-ext4 \ " diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/example.hook b/meta-isar/recipes-initramfs/initramfs-example/files/example.hook deleted file mode 100644 index ba848c92..00000000 --- a/meta-isar/recipes-initramfs/initramfs-example/files/example.hook +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# Example hook script. -# -# See "HOOK SCRIPTS" in initramfs-tools(7) for details. - -set -e - -PREREQ="" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /usr/share/initramfs-tools/hook-functions -# Begin real processing below this line diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/example.script b/meta-isar/recipes-initramfs/initramfs-example/files/example.script deleted file mode 100644 index c55e9ea7..00000000 --- a/meta-isar/recipes-initramfs/initramfs-example/files/example.script +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Example boot script. -# -# See "BOOT SCRIPTS" in initramfs-tools(7) for details. - -set -e - -PREREQ="" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /scripts/functions -# Begin real processing below this line - -log_success_msg "Hello from ISAR!" diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/local-top b/meta-isar/recipes-initramfs/initramfs-example/files/local-top new file mode 100644 index 00000000..66e382b4 --- /dev/null +++ b/meta-isar/recipes-initramfs/initramfs-example/files/local-top @@ -0,0 +1,3 @@ +# Script header is provided by initramfs-hook/hook.inc + +log_success_msg "Hello from ISAR!" diff --git a/meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb b/meta-isar/recipes-initramfs/initramfs-example/initramfs-isar-example-hook_0.1.bb similarity index 63% rename from meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb rename to meta-isar/recipes-initramfs/initramfs-example/initramfs-isar-example-hook_0.1.bb index c336dda9..8c600639 100644 --- a/meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb +++ b/meta-isar/recipes-initramfs/initramfs-example/initramfs-isar-example-hook_0.1.bb @@ -4,37 +4,30 @@ # # This software is a part of ISAR. +require recipes-initramfs/initramfs-hook/hook.inc + DESCRIPTION = "Sample initramfs module for ISAR" MAINTAINER = "Your name here " -DEBIAN_DEPENDS = "initramfs-tools" # If the conf-hook enables BUSYBOX=y, busybox is needed: DEBIAN_DEPENDS .= ", busybox" -SRC_URI = " \ +SRC_URI += " \ file://example.conf-hook \ - file://example.hook \ - file://example.script \ + file://local-top \ " -inherit dpkg-raw - do_install[cleandirs] += " \ ${D}/usr/share/initramfs-tools/conf-hooks.d \ - ${D}/usr/share/initramfs-tools/hooks \ - ${D}/usr/share/initramfs-tools/scripts/local-top \ " -do_install() { +do_install:append() { # See "CONFIGURATION HOOK SCRIPTS" in initramfs-tools(7) for details. install "${WORKDIR}/example.conf-hook" \ "${D}/usr/share/initramfs-tools/conf-hooks.d/isar-example" - # See "HOOK SCRIPTS" in initramfs-tools(7) for details. - install "${WORKDIR}/example.hook" \ - "${D}/usr/share/initramfs-tools/hooks/isar-example" + # See "HOOK SCRIPTS" in initramfs-tools(7) for details on + # hook-header[.tmpl] + hook. # Note that there are other places where a boot script might be deployed to, # apart from local-top. See "BOOT SCRIPTS" in initramfs-tools(7) for details. - install "${WORKDIR}/example.script" \ - "${D}/usr/share/initramfs-tools/scripts/local-top/example.script" } From patchwork Sat Nov 16 10:55:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3933 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 16 Nov 2024 11:56:06 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-pl1-f191.google.com (mail-pl1-f191.google.com [209.85.214.191]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGAu4XO013496 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 11:56:05 +0100 Received: by mail-pl1-f191.google.com with SMTP id d9443c01a7336-21147fea103sf22377755ad.2 for ; Sat, 16 Nov 2024 02:56:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731754558; cv=pass; d=google.com; s=arc-20240605; b=iZhVqabY0S2Bhh54OvW70B3NjJDwmQybfF+tRAwnf7Rx5GyDZ7QUHpHehnQa2lrJXo +0JuOYmPmB/dVWPMp0Cn4MrOJZk2ncJ5GizRzJsY+g3zSsgo7RWPeA3M7VGOXGa2rI5e Tho7H5HWKEMSi8Uxlxf6bJMAvc046Chg3qs8ndPhrOFNKRlgMcpbRDpoOkZjoxNJsY6k RUSqBsrv93NMZZ7bQLg2X01xptEzL+nBIh8nDH6ijCfPQn+DfyChOq006LC+dpJrST3e dUlnEhis2La5VcB7c/9IjfG8cWsOmhsgg1w0OXE+DinesrORJ444nsegZgeVuXViuXgX b00g== 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=kBD5hcpuOQOtpY0H7iGhIU6QrkCDM8a9phvObapTqNo=; fh=IcUsTgsOjhpjOhI9Snq6g45HnPImMdDhIo6M9zszEgg=; b=YWiJD69/j9zVJLrnD3byobZXazUusiAra3hZZzy4SpCoa+mapVlz3bumeKNVcL6V0i Dwgs4hyO/6Zvvrk/geDeFcENJsxJ6JPC9CiCK4mf7POfLmt0mL5J651epnQRgjefDgto uFi9E5iz8LFuPc9/sfPLxwYDtwjA4sZvEglRuRI01EDX8YkkcZ3YBB/GDBC5w0rvxxIh zR+z2XBPEhrj4P1/ecaNreFlIONJsGWY9eOyf15ar8WdiYNzis36xctEYiCeAoQN4dh6 a+AH6IGk7uEq1Y7/PFfkMnnGrfcByJWWPYnf7m7NKosU5FbP480MVbfW89gNrl9sO5ce vXkg==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=FqPR7BsN; spf=pass (google.com: domain of fm-294854-20241116105554839252d082cc6ab7e9-129cpz@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-20241116105554839252d082cc6ab7e9-129cpz@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=1731754558; x=1732359358; 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=kBD5hcpuOQOtpY0H7iGhIU6QrkCDM8a9phvObapTqNo=; b=rdj8EDbiQvfs2mifwr8pi+wiOvF1R5kqgI7VDx1L8k8+FSn4oGemZ/XZbBxqLkY+/D ++RgrBVs3o1q+j1MdcIOVyM62Dmo53VFoLUl5v0v5JvvrNiCoTiQl31ca3787TRdCF80 FX8KkfJcMtJdcj3qxWz7wJcM9UQkwgITnDtTpxzgooG3S/fqEtpWgmV9CsGX3jWeSU4u vQHhChlAc0ClnU0bvR6Bm8/eubMowf6eCBYyMLQbksEXXv+y4wDIDEWrdv3wr3+riDW9 hqMYGlG8o28b3LbrjsGP/OiK+qzPn9uw+y7iOTYdnxSwIRz7toY9MfOpknV/ZrowmwoQ IUUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731754558; x=1732359358; 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=kBD5hcpuOQOtpY0H7iGhIU6QrkCDM8a9phvObapTqNo=; b=oJLs6DUnbhDGESPil+sMI2looo/EmBTJWft9dWv5WB1dvgrvJh/tq/b3HDxiIIBrHt joZJg5/wzKpDQKZ6AvOZYO1nQuHTvDRgm9OjECRUlCCD/WD2emQl8VsLaRC4ZU6r8T8z 2VipqrWbGCcG7AX+BBi+ChyCP1jSaA+xvYScqNF0D1KZVKEfvkdfRiFulXE1uAkNCS09 nr4yMj0S327Pvb31EkqJ2JB0M2Wp02nojd6OUovp51GomWb3GGnxWQ9R9LRuDtdXDJT8 58nPLjL3u51XcpHxN2rl4wO3W6/GDeIvGR/fa04fgDa6/aizmB3oxWGF+vFV1nNbmwl9 H7Kw== X-Forwarded-Encrypted: i=2; AJvYcCU6L1x98B4lQWcV6kki1/+/XdpYgrPw6Eg1tjRV5zyvxkfzHznYciHyLCzYji/xbx1CGxWON08=@isar-build.org X-Gm-Message-State: AOJu0YzXecCJnTx4DwOWYWWl6z0dq4pJT+6+prVZZ92KEM/cwT0i9J5I uuuBRpxLex7oot/70dnFpyGd9a4aXqItlyWpRkK5VDaXUJAr9BrN X-Google-Smtp-Source: AGHT+IG5/wZQFF12iKC7mYTg53qQdYxdTxniRM25XQfTRfRi2XGTYMfNKQPiEs+a4dEG7wctkUB6QA== X-Received: by 2002:a17:902:e745:b0:20c:e6e4:9d9f with SMTP id d9443c01a7336-211d0ebd07cmr90699485ad.40.1731754558470; Sat, 16 Nov 2024 02:55:58 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:902:e843:b0:20c:a04f:9257 with SMTP id d9443c01a7336-211d0f36940ls2348435ad.0.-pod-prod-03-us; Sat, 16 Nov 2024 02:55:57 -0800 (PST) X-Received: by 2002:a17:903:11cd:b0:20c:ecd8:d0af with SMTP id d9443c01a7336-211d0d5eea4mr83149175ad.9.1731754556990; Sat, 16 Nov 2024 02:55:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731754556; cv=none; d=google.com; s=arc-20240605; b=VZ7DD6Fqs2y+nLHrQVRc4PxVf24oEUMkOzr869UQ/AQAofX5NaLOVogtS3OqYIww4R iYQ1NWJDWo3wJKD7iyKi9JgostHe2vdVEaMLlrnJPXTgEGNiaEvNtOtivKR66FNaS60R fOfUQHCuWrd+nZ/TQ1Pz8fEl00oOpzH2u90mReiZGdO+V2DDdqas0H5Rj0Y3n29Lfog7 k/XBR63+41/narQGrfwD66/UbsxJihuLDD1Fd5Jaod61jBA7cG5dBCyuQHUhl3fi2MtZ A/6LuufAeuScehWXNndeTV7KssS4bhXjstHsWy3mJ+9ZY1nKN9kqYF5AHVT10pRubEIP fYGw== 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=bUqhDNdI4cWJE9E5fzERUlTgKvI7Jk7yjpL1U3jOwa94td4d6UUYziKsqxKcnEJ3JB Xi/a1d/gQGZHnNN97h9Ow8y1KXiAwgX09heQ6bUa7dIgK3fHBbzwYzUezz0Qe/BVGj/y XutbmyTtBHqcI3eVBi84Dn2+FfsegCJkx5UYEgXAFWohPkA0S15ggnToK/CcETXIobrz FkWyp/EZg/5R0IVwWF4PsQYc43qEFKkZtK6y7bcATkSzsEwgJyFdtWhQFCjSFTc0Z/E2 gq1/3XtfLR0G2F9/L/DMjA1sGqh/NXQgBY7B0AXd3WXPKAjNiwcWV8gBmJM31cHOrDnz rplA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=FqPR7BsN; spf=pass (google.com: domain of fm-294854-20241116105554839252d082cc6ab7e9-129cpz@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-20241116105554839252d082cc6ab7e9-129cpz@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net. [185.136.65.226]) by gmr-mx.google.com with ESMTPS id d9443c01a7336-211d0d23127si1805575ad.0.2024.11.16.02.55.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 02:55:56 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-20241116105554839252d082cc6ab7e9-129cpz@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) client-ip=185.136.65.226; Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20241116105554839252d082cc6ab7e9 for ; Sat, 16 Nov 2024 11:55:54 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v3 5/7] initramfs-fsck-ext4-hook: Convert to hook.inc and improve Date: Sat, 16 Nov 2024 11:55:50 +0100 Message-ID: <2e8aadf060ee7f3242d6f4a969d2243e18491477.1731754552.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=fm1 header.b=FqPR7BsN; spf=pass (google.com: domain of fm-294854-20241116105554839252d082cc6ab7e9-129cpz@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-20241116105554839252d082cc6ab7e9-129cpz@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_H2,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 -} From patchwork Sat Nov 16 10:55:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3936 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 16 Nov 2024 11:56:06 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-yb1-f191.google.com (mail-yb1-f191.google.com [209.85.219.191]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGAu55p013512 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 11:56:06 +0100 Received: by mail-yb1-f191.google.com with SMTP id 3f1490d57ef6-e38088d99a5sf731925276.2 for ; Sat, 16 Nov 2024 02:56:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731754559; cv=pass; d=google.com; s=arc-20240605; b=exRjLbq7em5amWRHB4XkcsMmqeMpO7nGgmys2/znSMhvduawL8EHrdypcNeThnMPBO SX8Ut2EqXixlT59cVAYv1Wd48tmpjmEp8riPAsjXmVNUq8gfAYbGRdEvnyypEJdBrlNO j1QAHFJl/nNwec3pxY9y0Go9L14dr/kWOGEpwaiywdWjynPTpucCM8FZelTdJkFeUgby BzsxmjDPwZlpyQOMdPxDG3/7tljegURJ8Enw3UTPuRN8inuHkxdiWpFAlDMKoFrStNHB rEuViX0qAXonhDkWeV1fF3Vlves3hKaIVtbVeYSgp7JDEoY2iy9hIe5dZ4kIsml9nRWu wSkA== 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=Kf4knulLOitwJDtQZfBrE2e7KWDMr43czTIPijbJMj8=; fh=SWp0DsSM3P13hdiNxYUTAor4Ic0S6r2u9UJhQgxu0JM=; b=FylzdcqypcywH3vorT1BByyHg32YluCU6E1ystoYOfYSe1rBY/jTDj85OxogVeasEk EDm7LSmsOcprQvGl12VG80EHWUqoftzFsVy2ZVBkDQO+dVvV1VplEvzTKyEpL8XjbMu7 xpuX006zql/nIyRHSzHFgtafC6lVWb1CJyn5dO22yu676ONHSDf5Bk7Bl+MgV/9nZ6H3 gVDaom8ic2JPlDija5lVzHk3mLwNaAsPBNqqRwaRRfQikZ39R3M3uZnpdZjiOhwxZi4W wJxfcXGlJEfvuW/TTAfKSIhauSN9PwuJLaMfIiL2Prm+WhAEJy4xzv0wppFYkC69nsbp 2wlQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=AeZ36fJ6; spf=pass (google.com: domain of fm-294854-202411161055558d9f4b255f0958c8ec-yzkkfy@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-202411161055558d9f4b255f0958c8ec-yZKKFY@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=1731754559; x=1732359359; 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=Kf4knulLOitwJDtQZfBrE2e7KWDMr43czTIPijbJMj8=; b=cOLfATxdp51slm530PsdQM/e/T5szWJe0IjYd1Ni+NeumgJjyq3WAJ+2G70tW437og 5EyX+FDPiDEzor2sN15W4MSjTavLCeBrKgURd9kkXihMQFTTOu40UH9uPDb1aCX0tRJg zgCpr5k2oQf+6h243DjYd1W3MxceW0oIVm39YSye+dzP43om7kEwEg4pl4fsUdDTV6s/ IHRXo59i4Bd8Tb2/GYFUHEU+aWQUYwsQFKA5d3ISWobkO6vKuYj4hlNma4cEXwjxzrln MUDDxM6Ykuhbml+haTmbMpGIGI5TVxE8HCkFtTRbha0PeUKOmpst1ZtM/9+GWYrF29kS 1oUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731754559; x=1732359359; 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=Kf4knulLOitwJDtQZfBrE2e7KWDMr43czTIPijbJMj8=; b=T30GbeKm2hDmv91Q4zlGsAiwHvrCFoiO4x+KEewKeBnKXkjLqQ5ZWOuoa8NWec/aQn gpyp4DIDDESZnb+oIm1kJkjDi3SLVuDo1uV2vxRJNbsU9tZqkT7uRGvurUATdT471e3u 2dHN+Q0/NEc65kpRsVf2jYW0G0/us64i3OM58vgmLOfbDCRf00/cJpeyHHGc77PzYSme MJ7t4SKawDXoAQhWHpvKeO8ybcWC9MsmHPobTIFjLQMhhTAB8AoNglEMFysZIIMAMJwA Ad7sYsRZUe3biXWRv2CKcN534pH8dc5e7/sJpjox3VVHNzJ2eenFjLU/aozx4GhDp9ik tSSg== X-Forwarded-Encrypted: i=2; AJvYcCVPGl+0rn16l3yNL+zmUG1HfAvX6dFbOONc4XCU1zylLx+jrdYeLm8q+O9ZbhlFdb/HZIQm5zM=@isar-build.org X-Gm-Message-State: AOJu0Yxv8Ze4jaVb/nKyrqmIedDHP3onanodgCpuh3N4YKYa4xwfDFXA wzpseofGzfTQlMzwpoT5kLEHfnRimAFEn5NrP45C/IAKQBzifZE6 X-Google-Smtp-Source: AGHT+IGUg/9Pyj5oaljqHD5At2xgbstEA3zLu5hp3D22crQAAq28eG5wABr2KrwaqZZzaOb8TiUWmQ== X-Received: by 2002:a05:6902:18d6:b0:e33:25e2:4b1a with SMTP id 3f1490d57ef6-e38263b8193mr5589039276.40.1731754558671; Sat, 16 Nov 2024 02:55:58 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a25:d886:0:b0:e30:cb77:2e86 with SMTP id 3f1490d57ef6-e387e6a2d14ls636040276.0.-pod-prod-05-us; Sat, 16 Nov 2024 02:55:57 -0800 (PST) X-Received: by 2002:a05:690c:600a:b0:6e5:e6e8:d6b7 with SMTP id 00721157ae682-6ee55bba716mr65464057b3.1.1731754557094; Sat, 16 Nov 2024 02:55:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731754557; cv=none; d=google.com; s=arc-20240605; b=b899kIIEVk1F76x6lDI/zswvrGn4Et5gZVyYL0EVBSe7kNjMEOgCaNg6U8f+ns3u2c OPfbDp+L4I3o4PuC01uIsJCdoUMJA93Voa6lBHfobwAM2W0lkxkHjt4sVD3bkesCMtwC 01l/W/ffpE/UZAVEqJs7fiRmaEjb/J0zllVmNIEXyvACUEY9GmHcnxhVV+7nuHo1HO7S yZcXxtzrBM+G3xPHv1R7ZD+Xpe5UP2a2ROjdWaGRyvNYBTIK3LzWgfUfVzwNFGEcdSaP LrbChpUU/EM7JiUAU3zPDjiIWc613QxhHwXi1r5K/3RO4Bj8aJsdqhcNoM2YKN4V5gWk aa0w== 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=damBkMLDbvyJroW1CNbqTpW5Nz8l3TrrIrRhSEEXQtM=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=jiGeojvRHNmlFc79f5MWKbmm2aQ3f37pFoK/ppr6hVmL/6vhcpYpRe8M7KrCrtaV1N X+m5dDPqK+802HMz7AKVLsyYz5XnenlY0i8JXT61IZUhbu0TfXiIDxn/+1VviOLilYj7 1pTiicx/uQESNkLaCXZrbOlXgakeOY2L/0/3Dvu7QqZ+I0QJ0kUhE05shUkU/iyOo2+e uGprUW+rAYciW4Ji/8cMeIEStPaqGPR/rT/0voGqzpcbAihvNbO3T1KWp7EUACV2/Iid vocJ0Pscm5kYyInk5b0E/Ld2YdNJuhWorVTObOmSnSxtw0KSk4VnL4E3RQ+l9kH+6vAq SZKQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=AeZ36fJ6; spf=pass (google.com: domain of fm-294854-202411161055558d9f4b255f0958c8ec-yzkkfy@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-202411161055558d9f4b255f0958c8ec-yZKKFY@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-228.siemens.flowmailer.net (mta-65-228.siemens.flowmailer.net. [185.136.65.228]) by gmr-mx.google.com with ESMTPS id 00721157ae682-6ee7133c0f3si1025747b3.2.2024.11.16.02.55.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 02:55:57 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-202411161055558d9f4b255f0958c8ec-yzkkfy@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) client-ip=185.136.65.228; Received: by mta-65-228.siemens.flowmailer.net with ESMTPSA id 202411161055558d9f4b255f0958c8ec for ; Sat, 16 Nov 2024 11:55:55 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v3 6/7] initramfs-tee-ftpm-hook: Convert to hook.inc Date: Sat, 16 Nov 2024 11:55:51 +0100 Message-ID: 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=fm1 header.b=AeZ36fJ6; spf=pass (google.com: domain of fm-294854-202411161055558d9f4b255f0958c8ec-yzkkfy@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-294854-202411161055558d9f4b255f0958c8ec-yZKKFY@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_H2,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 Reduces the own bits significantly. Signed-off-by: Jan Kiszka --- .../files/{tee-ftpm.script => local-top} | 18 +----------- .../files/tee-ftpm.hook | 28 ------------------- .../initramfs-tee-ftpm-hook_0.1.bb | 27 ------------------ .../initramfs-tee-ftpm-hook_0.2.bb | 15 ++++++++++ 4 files changed, 16 insertions(+), 72 deletions(-) rename meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/{tee-ftpm.script => local-top} (75%) delete mode 100644 meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook delete mode 100644 meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.1.bb create mode 100644 meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.2.bb diff --git a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/local-top similarity index 75% rename from meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script rename to meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/local-top index 3355a7e0..989bf288 100644 --- a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script +++ b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/local-top @@ -1,4 +1,4 @@ -#!/bin/sh +# # Copyright (c) Siemens AG, 2023 # # Authors: @@ -7,22 +7,6 @@ # SPDX-License-Identifier: MIT # -set -e - -PREREQ="tee-supplicant" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /scripts/functions - FTPM_DEV=/dev/tpmrm0 # The tee-supplicant would take some time to be discovered, 30 seconds should diff --git a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook deleted file mode 100644 index e80f00b4..00000000 --- a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.hook +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# Copyright (c) Siemens AG, 2023 -# -# Authors: -# Su Bao Cheng -# -# SPDX-License-Identifier: MIT -# - -set -e - -PREREQ="tee-supplicant" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /usr/share/initramfs-tools/hook-functions - -# The tpm_ftpm_tee.ko does not exist in any stock debian kernels, it could be -# provided by customized kernel. -manual_add_modules tpm_ftpm_tee diff --git a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.1.bb b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.1.bb deleted file mode 100644 index 82fec1bb..00000000 --- a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.1.bb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) Siemens AG, 2023 -# -# Authors: -# Su Bao Cheng -# -# SPDX-License-Identifier: MIT -# - -inherit dpkg-raw - -SRC_URI += " \ - file://tee-ftpm.hook \ - file://tee-ftpm.script \ - " - -DEBIAN_DEPENDS = "initramfs-tools" - -do_install[cleandirs] += " \ - ${D}/usr/share/initramfs-tools/hooks \ - ${D}/usr/share/initramfs-tools/scripts/local-top" - -do_install() { - install -m 0755 "${WORKDIR}/tee-ftpm.hook" \ - "${D}/usr/share/initramfs-tools/hooks/tee-ftpm" - install -m 0755 "${WORKDIR}/tee-ftpm.script" \ - "${D}/usr/share/initramfs-tools/scripts/local-top/tee-ftpm" -} diff --git a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.2.bb b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.2.bb new file mode 100644 index 00000000..9f77c158 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/initramfs-tee-ftpm-hook_0.2.bb @@ -0,0 +1,15 @@ +# Copyright (c) Siemens AG, 2023-2024 +# +# Authors: +# Su Bao Cheng +# +# SPDX-License-Identifier: MIT +# + +require recipes-initramfs/initramfs-hook/hook.inc + +SRC_URI += "file://local-top" + +HOOK_PREREQ = "tee-supplicant" +HOOK_ADD_MODULES = "tpm_ftpm_tee" +SCRIPT_PREREQ = "tee-supplicant" From patchwork Sat Nov 16 10:55:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3935 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 16 Nov 2024 11:56:06 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-il1-f187.google.com (mail-il1-f187.google.com [209.85.166.187]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGAu5jY013511 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 11:56:06 +0100 Received: by mail-il1-f187.google.com with SMTP id e9e14a558f8ab-3a6b9f3239dsf5551375ab.0 for ; Sat, 16 Nov 2024 02:56:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731754559; cv=pass; d=google.com; s=arc-20240605; b=cpEtJsz+nY6PYUhk3LUW3qWLlWPK8azGnTZT4eGmYJcBARCuao7sE1jB0utzpYRnp+ ufNjoiKOTCuNWprgEVIwCy7FXz5PvbyD+4KqK+ZGX3auefhD+uFbnBBP6+6RRypW6IlD GY0Dxl1S3oa6r1DTGJT+RZTVOPnJbRUmSsZn2tnqENVV27+rzBMDzCL28cXenpQmFbqy m62RQhzETDD8t7dEVCBUCoH8EPcRO0LWmJEApmlo2Ipd7X/P8uMH43BD8SJTv2OCcKR+ CuLhX9+DtT/FKZTfgynF5nP5K+IW2qPHjOddrnM6qBySy1hwe99oYNdnnqzbrj0fDwVD eWRg== 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=uq2hirg4k1aenxaWHeBZ8Hx3DD8IW62o2U/mpyQdTCw=; fh=DzXPbbsG2fONGl3mMQVckTN/mF2uG0IYoonOBLAyH5M=; b=fIEW0d2tir2owfBSqaxFKMXZDRarB3UBo1m35fIflJUF8hI3YDj0QFf1oMlzR06sbD pwUZ/CaEVF99D+lIoDbfgFP4zNProCxJ17rE8u9WoP8bgM+oreZ16vFjoa/KZaEz2aMf pC2ZDoSLNIW+X4ikiHqPbfwErre9B5g7Hdse1K+J3cDhbM614bHI/2axJhktJInadjag RnmFosA6HCbjQbikjV5aqkVFlN8D6GLPpaRlGYsWE0Diubs0mhszZJljd2FTAuCuGAZn bAqAL88wSGTLg9Mt0hcNRXkQdB9mqP3teE6AUvYdP9O0wVK7t2tK158dXyyhIAg4TItd d4AQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="E87/vHhE"; spf=pass (google.com: domain of fm-294854-2024111610555589b946b2eb7d05415b-6kycz_@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-2024111610555589b946b2eb7d05415b-6KyCz_@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=1731754559; x=1732359359; 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=uq2hirg4k1aenxaWHeBZ8Hx3DD8IW62o2U/mpyQdTCw=; b=tTNwXsxeGkwCZuvIeDvtOGM0BNDIHKwjjQl+TWRhmqQKNa0qT6o0Mu2kK4wz5jfchV NwQJfSUP1C4WluKbCIG29JMnxXp8NfSpXPhVHWg/a5gKQ0jn+UuUKF+Oi+Durh0uRxPX RPpfdM9G4vXfhN/CCzxeHtYVB5N2fxL9QlDKqwSZduj9idaV64j/7ZZEEsdZ4kgsDunH L3cgYZFp4N86IMW52jPpfakstb7uh8SChuFLqkwRzW9sa4HqlXA0EydvOCiF1oIkDqCN /DJSQ3cNWE5t0sqUjHqNM0aYk+iVq81vi5T/RQGYQgFn4u31hsUq09jWz2A9s9jBhtoK VxDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731754559; x=1732359359; 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=uq2hirg4k1aenxaWHeBZ8Hx3DD8IW62o2U/mpyQdTCw=; b=Imv6qIMqmM8hLR6XRUOVKiBpdNPxvZbXyl3iAhVf93lwJTlDpIVeJdh18ijvtSAmsH dTGTC1xKifNhfRtWPwyNh3IwvEeTbdscHjUlVgv0OSMcJsupdcjlaY/c8YADOqYe0dUu yku9hjKchq0XqxsKUDcARsB0G6W58+L36up5NRI0V7S3n/oIaR/UcnKL92teLNwhsjSZ 6ZSTKKiuOy5Q6jm97EBVYvM3BPYQWI4Nrfwm1i8JPgdiV7WOkN8DvYc+ORVWkAAMGa7Y rYC84niohJ1nWMzYkbRp60jTiFCMNvueepQI8kCwjfU3htv7lRBpPJVK2Apw8/sahuAW jAtw== X-Forwarded-Encrypted: i=2; AJvYcCWzqytu4HwjifdEeAAErwLBGhBVv3dPk2fjRj+fv6x4j4X6T4/bvJK0PkV6CV8fR5aGezG0/q0=@isar-build.org X-Gm-Message-State: AOJu0YwytimxGSg9F553f7edgYLlKAxlUPCqp1Xw6KMk+R9/bOZQX7kc ZnZrOaycsEgNp5Pb3iZ0jG3ZLP/spkeSXSRXz7rB9V4AE/+Tscmv X-Google-Smtp-Source: AGHT+IFzSH6ceEUGPSNNua0eoQJ7LWyY/5GqSHeTbb2apT7xoPHOXVtToSRW1fYoAfNmBBGLdTsunA== X-Received: by 2002:a05:6e02:17ca:b0:3a7:21c2:a419 with SMTP id e9e14a558f8ab-3a748061791mr44984855ab.14.1731754558820; Sat, 16 Nov 2024 02:55:58 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a92:d78b:0:b0:3a7:5181:e6d5 with SMTP id e9e14a558f8ab-3a75181e786ls2541835ab.0.-pod-prod-06-us; Sat, 16 Nov 2024 02:55:57 -0800 (PST) X-Received: by 2002:a05:6e02:3c08:b0:3a0:a71b:75e5 with SMTP id e9e14a558f8ab-3a748027c23mr56779015ab.7.1731754557336; Sat, 16 Nov 2024 02:55:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731754557; cv=none; d=google.com; s=arc-20240605; b=fWCrDFnNyuhAwlekzwx1imunzNQ4X6BDBg3Z6Mm76Lj2uCDcAJsqGBF561zUCpYrsC GMiCeLUqllBQ9k7RxJd0SqGu9XZH3jjXyyVEOPGvkyMATVFQRRhnyoS0vWF//GwnyZhz E3lGY+T4QdnHDTFTHRxpqAuhW80rJUYi50EFCFJD0Ww6aCgP07/5v51ClxZJn+1vf8Vs wNlGcsgmBFIjZma37qVjBossCX75d5M6KfWpmDkGWnw1oC6D6pfYZMezHJRIdX3lhFZx Hs1/aukN8MxbbFX6ZjludwGPQP596mHC7HmYxRhY5PuMFXKpYDM2XCyhKG4tYZCJjugF XKqA== 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=K/9H8H130CK5JxJctldzaMoS23gMPdsPHcrHTmkexo8=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=biEQuNIe6TwOh0hbqD+Xnj5J4S4mHUhP3SuDN/VAN00aj87RKhHTG/UzV1oocRxtom 5BeESagExwrsiG/TAVPO4NfGeS6zycoHhqGxB5hpRk6RlWvDhumYXEiD3aKshtPJcAOv L4uzwV7d9/Cktcf/8eRv9GYE/TKgQA+wDW1UgsIiM7YwsMy2StUi21IkplfSZK1Zxlq0 V+SW4OheSXQiaJxkMnlbtf14Rid37yTOinzPuqaAOjo2jnpMAbxdpjo8MziIJqw4QpZm EO++NcbxNoZ1E5JvOovDaLZ8qST/DZHJKjCGxQh7ljokt/Jg0wIpXwHjWEkitkeMRZpV AqRw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="E87/vHhE"; spf=pass (google.com: domain of fm-294854-2024111610555589b946b2eb7d05415b-6kycz_@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-2024111610555589b946b2eb7d05415b-6KyCz_@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net. [185.136.64.227]) by gmr-mx.google.com with ESMTPS id 8926c6da1cb9f-4e0756e365dsi160965173.7.2024.11.16.02.55.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 02:55:57 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-2024111610555589b946b2eb7d05415b-6kycz_@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) client-ip=185.136.64.227; Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 2024111610555589b946b2eb7d05415b for ; Sat, 16 Nov 2024 11:55:55 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v3 7/7] initramfs-tee-supplicant-hook: Convert to hook.inc Date: Sat, 16 Nov 2024 11:55:52 +0100 Message-ID: <1681d4daf7fcd5013cd36b32a5aa2bb66dd083ef.1731754552.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=fm1 header.b="E87/vHhE"; spf=pass (google.com: domain of fm-294854-2024111610555589b946b2eb7d05415b-6kycz_@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-294854-2024111610555589b946b2eb7d05415b-6KyCz_@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_H2,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 Reduces the own bits significantly. Signed-off-by: Jan Kiszka --- .../{tee-supplicant.script => local-top} | 18 +--------- .../files/tee-supplicant.hook | 36 ------------------- .../initramfs-tee-supplicant-hook_0.1.bb | 27 -------------- .../initramfs-tee-supplicant-hook_0.2.bb | 16 +++++++++ 4 files changed, 17 insertions(+), 80 deletions(-) rename meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/{tee-supplicant.script => local-top} (68%) delete mode 100644 meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook delete mode 100644 meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.1.bb create mode 100644 meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.2.bb diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.script b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/local-top similarity index 68% rename from meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.script rename to meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/local-top index ac01d7ec..575a742d 100644 --- a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.script +++ b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/local-top @@ -1,4 +1,4 @@ -#!/bin/sh +# # Copyright (c) Siemens AG, 2023 # # Authors: @@ -7,22 +7,6 @@ # SPDX-License-Identifier: MIT # -set -e - -PREREQ="" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /scripts/functions - /usr/sbin/modprobe optee /usr/sbin/tee-supplicant -d diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook deleted file mode 100644 index 3e2f4016..00000000 --- a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.hook +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# Copyright (c) Siemens AG, 2023 -# -# Authors: -# Su Bao Cheng -# -# SPDX-License-Identifier: MIT -# - -set -e - -PREREQ="" -prereqs() -{ - echo "$PREREQ" -} -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /usr/share/initramfs-tools/hook-functions - -hook_error() { - echo "(ERROR): $1" >&2 - exit 1 -} - -# For stock debian bookworm arm64 kernel, these two .ko exist, but not built-in. -manual_add_modules tee -manual_add_modules optee - -copy_exec /usr/sbin/tee-supplicant || hook_error "/usr/sbin/tee-supplicant not found" -copy_exec /usr/bin/pgrep || hook_error "/usr/bin/pgrep not found" diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.1.bb b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.1.bb deleted file mode 100644 index a7a19bee..00000000 --- a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.1.bb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) Siemens AG, 2023 -# -# Authors: -# Su Bao Cheng -# -# SPDX-License-Identifier: MIT -# - -inherit dpkg-raw - -SRC_URI += " \ - file://tee-supplicant.hook \ - file://tee-supplicant.script \ - " - -DEBIAN_DEPENDS = "initramfs-tools, tee-supplicant, procps" - -do_install[cleandirs] += " \ - ${D}/usr/share/initramfs-tools/hooks \ - ${D}/usr/share/initramfs-tools/scripts/local-top" - -do_install() { - install -m 0755 "${WORKDIR}/tee-supplicant.hook" \ - "${D}/usr/share/initramfs-tools/hooks/tee-supplicant" - install -m 0755 "${WORKDIR}/tee-supplicant.script" \ - "${D}/usr/share/initramfs-tools/scripts/local-top/tee-supplicant" -} diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.2.bb b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.2.bb new file mode 100644 index 00000000..b9dedfd3 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/initramfs-tee-supplicant-hook_0.2.bb @@ -0,0 +1,16 @@ +# Copyright (c) Siemens AG, 2023-2024 +# +# Authors: +# Su Bao Cheng +# +# SPDX-License-Identifier: MIT +# + +require recipes-initramfs/initramfs-hook/hook.inc + +SRC_URI += "file://local-top" + +HOOK_ADD_MODULES = "tee optee" +HOOK_COPY_EXECS = "tee-supplicant pgrep" + +DEBIAN_DEPENDS .= ", tee-supplicant, procps"