public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH 6/7] u-boot-script: Make truly generic
Date: Mon, 26 Nov 2018 10:39:01 +0100	[thread overview]
Message-ID: <d089f76d2884534092da1d0071c2825807013bf8.1543225142.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1543225142.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1543225142.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

Now that rootfs-u-boot can generate the required config, we can remove
any config generation from this package. Makes things much simpler.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/conf/machine/bananapi.conf               |  2 +-
 meta-isar/conf/machine/de0-nano-soc.conf           |  2 +-
 .../recipes-bsp/u-boot-script/u-boot-script_1.0.bb | 81 ----------------------
 .../recipes-bsp/u-boot-script/u-boot-script_1.1.bb | 28 ++++++++
 4 files changed, 30 insertions(+), 83 deletions(-)
 delete mode 100644 meta/recipes-bsp/u-boot-script/u-boot-script_1.0.bb
 create mode 100644 meta/recipes-bsp/u-boot-script/u-boot-script_1.1.bb

diff --git a/meta-isar/conf/machine/bananapi.conf b/meta-isar/conf/machine/bananapi.conf
index 95876f1..7b380c1 100644
--- a/meta-isar/conf/machine/bananapi.conf
+++ b/meta-isar/conf/machine/bananapi.conf
@@ -10,7 +10,7 @@ KERNEL_NAME ?= "armmp"
 DISTRO_APT_SOURCES_append = " conf/distro/debian-stretch-backports.list"
 DISTRO_APT_PREFERENCES += "conf/multiconfig/preferences.bananapi.conf"
 
-IMAGE_INSTALL += "u-boot-script-${KERNEL_NAME}"
+IMAGE_INSTALL += "u-boot-script"
 
 IMAGE_TYPE ?= "wic-img"
 WKS_FILE ?= "bananapi"
diff --git a/meta-isar/conf/machine/de0-nano-soc.conf b/meta-isar/conf/machine/de0-nano-soc.conf
index 184da4a..63b2cfb 100644
--- a/meta-isar/conf/machine/de0-nano-soc.conf
+++ b/meta-isar/conf/machine/de0-nano-soc.conf
@@ -15,4 +15,4 @@ WKS_FILE ?= "de0-nano-soc"
 IMAGER_INSTALL += "u-boot-de0-nano-soc"
 IMAGER_BUILD_DEPS += "u-boot-de0-nano-soc"
 
-IMAGE_INSTALL += "u-boot-tools u-boot-script-${KERNEL_NAME}"
+IMAGE_INSTALL += "u-boot-tools u-boot-script"
diff --git a/meta/recipes-bsp/u-boot-script/u-boot-script_1.0.bb b/meta/recipes-bsp/u-boot-script/u-boot-script_1.0.bb
deleted file mode 100644
index a827c35..0000000
--- a/meta/recipes-bsp/u-boot-script/u-boot-script_1.0.bb
+++ /dev/null
@@ -1,81 +0,0 @@
-# Boot script generator for U-Boot
-#
-# This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2018
-#
-# SPDX-License-Identifier: MIT
-
-inherit dpkg-raw
-inherit wks-file
-
-WKS_FULL_PATH = "${@get_wks_full_path(d)}"
-
-DESCRIPTION = "Boot script generator for U-Boot"
-
-PN .= "-${KERNEL_NAME}"
-
-SRC_URI = " \
-    file://update-u-boot-script \
-    file://u-boot-script \
-    file://zz-u-boot-script"
-
-DEBIAN_DEPENDS = "u-boot-tools, linux-image-${KERNEL_NAME}"
-
-# Extract the following information from the wks file and add it to the
-# packaged /etc/default/u-boot-script:
-#  - --append parameters from a bootloader entry
-#  - root partition number
-#  - disk name the root partition is located on
-
-init_config_from_wks() {
-	# Filter out the bootloader line, then grap the argument of --append.
-	# The argument may be quoted, respect that but remove the quotes prior
-	# to assigning the target variable. Will be re-added later.
-	KERNEL_ARGS=$(grep "^bootloader " $1 | \
-		      sed -e 's/.* --append[= ]\(".*"\|[^ $]*\).*/\1/' \
-			  -e 's/\"\(.*\)\"/\1/')
-
-	COUNT=0
-	while read COMMAND MNT OPTIONS; do
-		if [ "${COMMAND}" != part ] ||
-		   echo "${OPTIONS}" | grep -q "\--no-table"; then
-			continue
-		fi
-		COUNT=$(expr ${COUNT} + 1)
-		if [ "${MNT}" = "/" ]; then
-			ROOT_PARTITION=${COUNT}
-			break
-		fi
-	done < $1
-	if [ -n "${ROOT_PARTITION}" ]; then
-		# filter out parameter of --ondisk or --ondrive
-		ROOT=$(echo ${OPTIONS} | \
-		       sed 's/.*--on\(disk\|drive\)[ ]\+\([^ ]\+\) .*/\2/')
-		# anything found?
-		if [ "${ROOT}" != "${OPTIONS}" ]; then
-			# special case: append 'p' to mmcblkN
-			ROOT=$(echo ${ROOT} | sed 's/^\(mmcblk[0-9]\+\)/\1p/')
-
-			KERNEL_ARGS="\"root=/dev/${ROOT}${ROOT_PARTITION} ${KERNEL_ARGS}\""
-		fi
-	fi
-
-	sed -i -e 's|\(^ROOT_PARTITION=\).*|\1\"'"${ROOT_PARTITION}"'\"|' \
-	       -e 's|\(^KERNEL_ARGS=\).*|\1'"${KERNEL_ARGS}"'|' \
-		${WORKDIR}/u-boot-script
-}
-
-do_install() {
-	[ -n ${WKS_FULL_PATH} ] && init_config_from_wks "${WKS_FULL_PATH}"
-
-	sudo rm -rf ${D}/etc ${D}/usr
-
-	install -v -d ${D}/usr/sbin
-	install -v -m 755 ${WORKDIR}/update-u-boot-script ${D}/usr/sbin/
-
-	install -v -d ${D}/etc/default
-	install -v -m 644 ${WORKDIR}/u-boot-script ${D}/etc/default/
-
-	install -v -d ${D}/etc/kernel/postinst.d
-	install -v -m 755 ${WORKDIR}/zz-u-boot-script ${D}/etc/kernel/postinst.d
-}
diff --git a/meta/recipes-bsp/u-boot-script/u-boot-script_1.1.bb b/meta/recipes-bsp/u-boot-script/u-boot-script_1.1.bb
new file mode 100644
index 0000000..e07deee
--- /dev/null
+++ b/meta/recipes-bsp/u-boot-script/u-boot-script_1.1.bb
@@ -0,0 +1,28 @@
+# Boot script generator for U-Boot
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018
+#
+# SPDX-License-Identifier: MIT
+
+inherit dpkg-raw
+
+DESCRIPTION = "Boot script generator for U-Boot"
+
+SRC_URI = " \
+    file://update-u-boot-script \
+    file://u-boot-script \
+    file://zz-u-boot-script"
+
+DEBIAN_DEPENDS = "u-boot-tools, linux-image-${KERNEL_NAME}"
+
+do_install() {
+	install -v -d ${D}/usr/sbin
+	install -v -m 755 ${WORKDIR}/update-u-boot-script ${D}/usr/sbin/
+
+	install -v -d ${D}/etc/default
+	install -v -m 644 ${WORKDIR}/u-boot-script ${D}/etc/default/
+
+	install -v -d ${D}/etc/kernel/postinst.d
+	install -v -m 755 ${WORKDIR}/zz-u-boot-script ${D}/etc/kernel/postinst.d
+}
-- 
2.16.4


  parent reply	other threads:[~2018-11-26  9:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26  9:38 [PATCH 0/7] u-boot-script rework, the Final One (tm) Jan Kiszka
2018-11-26  9:38 ` [PATCH 1/7] wic: Move isar plugins out of example layer to core Jan Kiszka
2018-11-26  9:38 ` [PATCH 2/7] wic: Remove obsolete reference to msger logger Jan Kiszka
2018-11-26  9:45   ` Henning Schild
2018-11-26  9:50     ` Jan Kiszka
2018-11-26 10:07       ` Henning Schild
2018-11-26 11:02         ` Jan Kiszka
2018-11-26  9:38 ` [PATCH 3/7] meta-isar: Factor out bananapi machine config Jan Kiszka
2018-11-26  9:38 ` [PATCH 4/7] wic: Add rootfs-u-boot Jan Kiszka
2018-11-26  9:39 ` [PATCH 5/7] meta-isar: Switch bananapi and de0-nano-soc to rootfs-u-boot Jan Kiszka
2018-11-26  9:39 ` Jan Kiszka [this message]
2018-11-26  9:39 ` [PATCH 7/7] meta: Fold wks-file class into wic-img Jan Kiszka
2018-11-29 12:15 ` [PATCH 0/7] u-boot-script rework, the Final One (tm) Maxim Yu. Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d089f76d2884534092da1d0071c2825807013bf8.1543225142.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox