From patchwork Wed Sep 23 08:20:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Seiler X-Patchwork-Id: 80 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:eb04:0:0:0:0:0 with SMTP id f4csp601339ooj; Wed, 23 Sep 2020 09:21:55 -0700 (PDT) X-Received: by 2002:a5d:53d1:: with SMTP id a17mr462929wrw.98.1600878114868; Wed, 23 Sep 2020 09:21:54 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1600878114; cv=pass; d=google.com; s=arc-20160816; b=TaG6ij0UzSEBFa4uaHYwNtJx+Hcgys6iN5VoUIidAGQ7pURuC8JNQ97FkOqdQuPWf3 C+ZWDMfjltOfMq3TflT4mdXyMj98Jo7WssZP9KXap7dd3AByftiYbGlvSoRgBhAgPxKg t0JNhIHrYYehK8iTmp8JK2FFj6BK5a2KsTaXDl+Ws1L4uP1EoQJqRfxv48nGT6Ol1D/J J8J5C5Tx2Z2lSe8XCBzay+Hz6TtfmNuk8GP6yINrLwemeL6qm8VMlXGUJPJQbTFoTr6O /n8pg4aszIh+IoG85eXupMbXFVsmqpAlP1AbKh8AgB5dbmvaX4iNLgPTLeErzX1fhvck RAvQ== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=McR+DKrrk90q0cO+miMRswXzm39TiGK3WX2SP78V/Bg=; b=iKkyKORMTux0HE/8AhwL+1VTNR263EMehP6s1qSNlJJ0xwJDYucm+8rqwdsdlPD6a4 sk0iyGtARHuUSe3BLpprVwSYxjzrGfJkWMENjU55fJ2xVi1XcVPr/wpgXF/xlnUDKFuc mXNTPBr1T85wwHkWuLjqkPXwUwOH884e3aKpGgKMmL/8cjwLc79zheN1vCdGIJiYohDg ZKQYsF5TRU62wdOHw0UBv+s0Rw7aZ9+h3Yqr6Pogm7hf8ptA8E5YmxrsI+LRzW+S825N Pw0BhOqPQ5mJHY/c/XfRVcTJhlBBolS3E4ALwKPKOPGBJDhZtG+iRFBAINZdva99kKHa Yf0g== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b="BEUk/rKw"; arc=pass (i=2); spf=pass (google.com: domain of isar-users+bncbczlpqw3rykrbihmvx5qkgqegxzi4ba@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCZLPQW3RYKRBIHMVX5QKGQEGXZI4BA@googlegroups.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id a10sor60342wmc.8.2020.09.23.09.21.53 (Google Transport Security); Wed, 23 Sep 2020 09:21:54 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbczlpqw3rykrbihmvx5qkgqegxzi4ba@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b="BEUk/rKw"; arc=pass (i=2); spf=pass (google.com: domain of isar-users+bncbczlpqw3rykrbihmvx5qkgqegxzi4ba@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCZLPQW3RYKRBIHMVX5QKGQEGXZI4BA@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1600878113; cv=pass; d=google.com; s=arc-20160816; b=CYYAkqWF08+TY4czHuS4h8J3Qg/HcbAi51V08FOLWl8Yx7C4RGNW2aykh6DLP2rxIj rT920fVzcaXSVW8ongvD5UM5UiuAWzovp/p7by11S3/mpc5gc0qxKE/3Sc5ejg8g2sqf VWn1NyFY9z+D5pytpDcHKET+LKJmT4aJmAASO0V5sV6yVruIgaPtObohi0CLlxMyrTb3 JOiGhuHemFAAa2nq8NDaLKz4AqxTCOx+7CsJMn/qbdTp5Bly7CG6wJHy0g0PPLmpt4Yg Q4uwtaRnVK9TEywbrKogLP69jGVjXxNglTpHYtvJbzaAgS7wcWv8xMtEf5J1LoKtfpoQ ttaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=McR+DKrrk90q0cO+miMRswXzm39TiGK3WX2SP78V/Bg=; b=dL2U1zXZHzwKIBT+gjrAbW5ggKn6SEoJ0vCQSBv/0RfQLFfUp4x9Fl66IW6AF639ub 2h/jEB/u2UQevtv1GWr4KjhY0LLgemazZyDFgItxAg7RqiJ7zEY3qVKOqIhyxdhPH9AY ytFgZHqalfRC3K8thnbCDccOAlwU+FsGeFzoc8iMpj5FKVYgJaflpM0uIojeUKrexMy2 Go8nJzgI1hAspNf8NRuuG7FEr5Mj261TITOn02kE5wAody+QA5wyBHUfn9Z7XlgtS03G zDXff374EbOG3Dg0fe0VIx+3NIPcgvQnEkG63eGaExie8gX5rCFki+pkoCzXC/lXAuak twOA== ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=McR+DKrrk90q0cO+miMRswXzm39TiGK3WX2SP78V/Bg=; b=BEUk/rKwMzGppLY9Wa3nw1ptZxzBplJOM4170qsmxqKtgvqT4oMlnN8SH2Pw6o9PaW 3WgCbS1NU3lQcgkiYAZpW/WbpArK8uHqfpXcomL0eocx7GEY3kuIh7oFBZJf/x+Jogye B/WBOblF+KzcYos+Q1xC1XxfCxR1AWiz1qQkJ+v3u++qxTuivFP2YUqFLPAEBP6vxey7 CK8TpwtCqFt+/R0toSUdjMYyy+xK7qMBfxbp0e5IWtbBGLI20J0wivEuAnwGwx13e7ic dEw2ShAFdRRtgOw76nozP2E7xmpmO2ir+/qeqyAY4d82FfaQnGSFeuw2ADo5wlTzt+dd PC5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=McR+DKrrk90q0cO+miMRswXzm39TiGK3WX2SP78V/Bg=; b=my525mk19SlyEmBZVu0R+AlEZte2Tj2KeiDFGKK5YRc9SzZl9gveM+MLc0wydQ2xmt l1B0MjIMOgiz2V3KhLyfTVHxiwu2sPRd6SFX4X/e3Bewb0W77Ihm1Wpuzp5V/vDpRokx c01QVsSfVHn6EDTdQkde5PRgPK38qGrVs4WFDan6CTzpGiMsmia0cxjok2gGX4bGA/xq P9KXehMA3N8RCj8YFGLNbeXs8aBVvqLP01MwzymR/f/i/6IFnigPxsHj4+vfK6FSdJmH XTnzvXIUcNBIMFBx7H9Mue7f7b788mykQ+gMKmaM9xy21Vp0Z5QbcGGzpLbpRRv4sQlg wQMg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM532ZkF12ICteP2ABEoZptNr9+XVftJkgXr7ybdab4H2rMcxh/YH1 PkObgJc2KtWPnIimsOqir6Q= X-Google-Smtp-Source: ABdhPJzigTz/QOGhEUcyUgNuRFR8SeIMzSmtB6YGiBdxosnYuTqi63xwNhX3Bla6RYg6PxEqFe+k1w== X-Received: by 2002:a1c:ed01:: with SMTP id l1mr385563wmh.152.1600878113072; 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-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 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; 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 X-Original-Sender: hws@denx.de X-Original-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 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1678642370578699991?= X-GMAIL-MSGID: =?utf-8?q?1678642370578699991?= 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" +}