From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6874889650574458880 X-Received: by 2002:adf:91a4:: with SMTP id 33mr519128wri.170.1600878113119; Wed, 23 Sep 2020 09:21:53 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:e3c3:: with SMTP id k3ls467068wrm.1.gmail; Wed, 23 Sep 2020 09:21:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUKopse+2sTuYmsPJVnaA8iB6VxT/HoYhWdiFqOLifipusaYgH/mvXmC1DKUKcLT5d19wA X-Received: by 2002:a5d:660d:: with SMTP id n13mr487559wru.308.1600878112186; Wed, 23 Sep 2020 09:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600878112; cv=none; d=google.com; s=arc-20160816; b=R98o0Xu8IgPIEmGggkCAALZLkC5L9sRMZPFwJqJ5VgYyYysojlZYDWMfGSNSoJO0uE 8pqnvxLuWSx8M22ZB8Hy+55VfQbXnEhrmzzz3eqvr7YPOZTHszTPtB0t7nn0aYEUkUGG aql+TBcylP2KYpiAzIKCfG1g2c9pRGuCMfTeZt7S3gPjX1Yx77W5VZn+AGZKmYyvGjZr uvOpi6uWHyN3nbZEiBac/Yrc4s7yeQAJbK/7TtYruH482g97Aloes7ROcQFfstQUJVeh Ait5v7CfGPPKH9DWm6O4qoynC4oyz7CYzAMdvdhay53sQProK/n0jlcivQDYwCMZ/ENE sk7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=0nNs6VM37Z7hl3o+GXDeASyC2TnJwXoQyiFXBgZT+No=; b=EG4y9o+rEXonqHT+LOYnipMYqQ5LbcI1G9/1y7JFYF9fNrAoWRUGAkyLPB9lB3eaiF 2LBvG0bluzuKQlwEMYspdECUNYmDXoBx2LkQiAj4qZtb0Pz+x+t+hoFtrsARKU9NOiU9 90c/etCCeC57JWwSdD8SPH3DjDIyyLnTslyblzQ+LrKNXLY1dG3wS1Lk3W//xNSb6bgz c22Udpz5WfTvIafZjzQk9D29aQNYpcrYuAXCioPB+bhStYqYoRDnJYoxfRztmwZYoNaY /kdDmWUzmhUFJSbMWfJBiEQNS2QHH71CnQfSh5XBYGYCnL+uFywCDcgTfv3Ja0e40fiS YD7w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.10]) by gmr-mx.google.com with ESMTPS id w2si9912wrr.5.2020.09.23.09.21.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Sep 2020 09:21:52 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of hws@denx.de) client-ip=212.18.0.10; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4BxNjW6ffzz1rvyK; Wed, 23 Sep 2020 18:21:51 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4BxNjW6Vdhz1qwT6; Wed, 23 Sep 2020 18:21:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id EUSt1hkRTzFY; Wed, 23 Sep 2020 18:21:51 +0200 (CEST) X-Auth-Info: a+7FALZBH1UViOz/Vnh/Z6VP1ifprQFz37IOBU61E2w= Received: from maia.denx.de (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 23 Sep 2020 18:21:50 +0200 (CEST) From: Harald Seiler To: isar-users@googlegroups.com Cc: Harald Seiler Subject: [PATCH v2 2/3] Add example initramfs module recipe Date: Wed, 23 Sep 2020 18:20:45 +0200 Message-Id: <20200923162046.206888-2-hws@denx.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200921104212.1387227-1-hws@denx.de> References: <20200921104212.1387227-1-hws@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: mTO52HyCR1D3 Add the initramfs-example recipe/package which demonstrates how to write initramfs modules. It demonstrates how to add hook scripts, boot scripts, and conf-hooks. Signed-off-by: Harald Seiler --- .../initramfs-example/files/example.conf-hook | 7 ++++ .../initramfs-example/files/example.hook | 19 +++++++++ .../initramfs-example/files/example.script | 21 ++++++++++ .../initramfs-example/initramfs-example.bb | 40 +++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/example.conf-hook create mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/example.hook create mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/example.script create mode 100644 meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/example.conf-hook b/meta-isar/recipes-initramfs/initramfs-example/files/example.conf-hook new file mode 100644 index 000000000000..2a3cf7a84040 --- /dev/null +++ b/meta-isar/recipes-initramfs/initramfs-example/files/example.conf-hook @@ -0,0 +1,7 @@ +# Example conf-hook. +# +# See "CONFIGURATION HOOK SCRIPTS" in initramfs-tools(7) for details. + +# Example: Use busybox instead of klibc-utils. The package must also add +# `busybox` as a dependency when this is set. +BUSYBOX=y diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/example.hook b/meta-isar/recipes-initramfs/initramfs-example/files/example.hook new file mode 100644 index 000000000000..0d84e7a97efd --- /dev/null +++ b/meta-isar/recipes-initramfs/initramfs-example/files/example.hook @@ -0,0 +1,19 @@ +#!/bin/sh +# Example hook script. +# +# See "HOOK SCRIPTS" in initramfs-tools(7) for details. + +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 new file mode 100644 index 000000000000..784fad9c99bb --- /dev/null +++ b/meta-isar/recipes-initramfs/initramfs-example/files/example.script @@ -0,0 +1,21 @@ +#!/bin/sh +# Example boot script. +# +# See "BOOT SCRIPTS" in initramfs-tools(7) for details. + +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/initramfs-example.bb b/meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb new file mode 100644 index 000000000000..c336dda92b5d --- /dev/null +++ b/meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb @@ -0,0 +1,40 @@ +# Example of a recipe containing an initramfs module. Packages like this can be +# used with initramfs.bbclass or installed directly into a rootfs, depending on +# the usecase. +# +# This software is a part of ISAR. + +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 = " \ + file://example.conf-hook \ + file://example.hook \ + file://example.script \ + " + +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() { + # 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" + + # 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" +} -- 2.26.2