From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 10 Feb 2023 20:36:24 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pQZC6-003QMT-3g for lore@lore.pengutronix.de; Fri, 10 Feb 2023 20:36:24 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pQZC2-0006FV-BA; Fri, 10 Feb 2023 20:36:22 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQZBx-00062x-0q for distrokit@pengutronix.de; Fri, 10 Feb 2023 20:36:17 +0100 Received: from [2a0a:edc0:0:1101:1d::28] (helo=dude02.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pQZBv-0043ez-2q for distrokit@pengutronix.de; Fri, 10 Feb 2023 20:36:16 +0100 Received: from mfe by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pQZBu-008zkn-Ie for distrokit@pengutronix.de; Fri, 10 Feb 2023 20:36:14 +0100 From: Marco Felsch To: distrokit@pengutronix.de Date: Fri, 10 Feb 2023 20:36:07 +0100 Message-Id: <20230210193612.2143905-10-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230210193612.2143905-1-m.felsch@pengutronix.de> References: <20230210193612.2143905-1-m.felsch@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [DistroKit] [PATCH 09/14] blspec-entry: import from upstream ptxdist-2022.12.0 X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Import all required files from upstream ptxdist-2022.12.0 for further adaptions. No functional changes done. Signed-off-by: Marco Felsch --- platforms/blspec-entry.in | 19 ++++++++ projectroot/loader/entries/default.conf | 5 ++ rules/blspec-entry.make | 65 +++++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 platforms/blspec-entry.in create mode 100644 projectroot/loader/entries/default.conf create mode 100644 rules/blspec-entry.make diff --git a/platforms/blspec-entry.in b/platforms/blspec-entry.in new file mode 100644 index 0000000..aed65d4 --- /dev/null +++ b/platforms/blspec-entry.in @@ -0,0 +1,19 @@ +## SECTION=blspec + +menuconfig BLSPEC_ENTRY + tristate + select KERNEL + select KERNEL_INSTALL if !KERNEL_FIT + prompt "default bootloader spec entry " + +if BLSPEC_ENTRY + +config BLSPEC_ENTRY_DEVICETREE + bool + default KERNEL_DTB && !KERNEL_FIT + +config BLSPEC_ENTRY_CMDLINE + string + prompt "kernel command-line" + +endif diff --git a/projectroot/loader/entries/default.conf b/projectroot/loader/entries/default.conf new file mode 100644 index 0000000..5650907 --- /dev/null +++ b/projectroot/loader/entries/default.conf @@ -0,0 +1,5 @@ +title @TITLE@ +version @VERSION@ +options @CMDLINE@ +linux @KERNEL@ +@DEVICETREE@ diff --git a/rules/blspec-entry.make b/rules/blspec-entry.make new file mode 100644 index 0000000..f393b1b --- /dev/null +++ b/rules/blspec-entry.make @@ -0,0 +1,65 @@ +# -*-makefile-*- +# +# Copyright (C) 2014 by Michael Olbrich +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_BLSPEC_ENTRY) += blspec-entry + +BLSPEC_ENTRY_VERSION := $(KERNEL_VERSION) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +BLSPEC_ENTRY_TITLE := PTXdist - $(call remove_quotes,$(PTXCONF_PROJECT_VENDOR)-$(PTXCONF_PROJECT)) +ifdef PTXCONF_BLSPEC_ENTRY_DEVICETREE +BLSPEC_ENTRY_NAMES = $(basename $(notdir $(KERNEL_DTS))) +blspec/title = $(BLSPEC_ENTRY_TITLE) $(strip $(1)) +blspec/devicetree = devicetree\t/boot/$(strip $(1)).dtb +else +BLSPEC_ENTRY_NAMES = default +blspec/title = $(BLSPEC_ENTRY_TITLE) +blspec/devicetree = +endif +BLSPEC_ENTRY_LICENSE = ignore + +ifdef PTXCONF_KERNEL_FIT +BLSPEC_KERNEL_IMAGE = /boot/linux.fit +else +BLSPEC_KERNEL_IMAGE = $(KERNEL_IMAGE) +endif + +$(STATEDIR)/blspec-entry.targetinstall: + @$(call targetinfo) + + @$(call install_init, blspec-entry) + @$(call install_fixup,blspec-entry,PRIORITY,optional) + @$(call install_fixup,blspec-entry,SECTION,base) + @$(call install_fixup,blspec-entry,AUTHOR,"Michael Olbrich ") + @$(call install_fixup,blspec-entry,DESCRIPTION,missing) + + @$(foreach name, $(BLSPEC_ENTRY_NAMES), \ + $(call install_alternative, blspec-entry, 0, 0, 0644, \ + /loader/entries/default.conf,n,/loader/entries/$(name).conf)$(ptx/nl) \ + $(call install_replace, blspec-entry, /loader/entries/$(name).conf, \ + @TITLE@,'$(call blspec/title,$(name))')$(ptx/nl) \ + $(call install_replace, blspec-entry, /loader/entries/$(name).conf, \ + @VERSION@,'$(BLSPEC_ENTRY_VERSION)')$(ptx/nl) \ + $(call install_replace, blspec-entry, /loader/entries/$(name).conf, \ + @CMDLINE@,$(PTXCONF_BLSPEC_ENTRY_CMDLINE))$(ptx/nl) \ + $(call install_replace, blspec-entry, /loader/entries/$(name).conf, \ + @KERNEL@,'/boot/$(BLSPEC_KERNEL_IMAGE)')$(ptx/nl) \ + $(call install_replace, blspec-entry, /loader/entries/$(name).conf, \ + @DEVICETREE@,'$(call blspec/devicetree,$(name))')$(ptx/nl)) + + @$(call install_finish,blspec-entry) + + @$(call touch) + +# vim: syntax=make -- 2.30.2