From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6628101527721476096 X-Received: by 2002:a1c:55c8:: with SMTP id j191mr1148024wmb.13.1543225144605; Mon, 26 Nov 2018 01:39:04 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:8405:: with SMTP id g5ls2600674wmd.5.gmail; Mon, 26 Nov 2018 01:39:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/VjaKP/CrHLOMllvF9Pn+BcSpzpkp0yuq+YeqSdLFd1lFSKcgiygAG/zTs+rmjmCqY0WIre X-Received: by 2002:a1c:3ad3:: with SMTP id h202mr2109724wma.25.1543225144095; Mon, 26 Nov 2018 01:39:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543225144; cv=none; d=google.com; s=arc-20160816; b=KASubpS+uPA/3g0xBO2PebcbuXmLZ7LjZsZc+56kVXIjPwFbSFSgMa5fNgATeOrVg8 m142de8lHoq5/kO9tOcq45a8R6AKEjIbkHXmkuaasUoSJoHSnsGzW0V8AQ/r9TDhZqfC MAs/NP+bqFg0gZj8RLz860S5l3klqYADta7ScjwcCsKEaavXGK3zW+zoRlgJogrNSq3J TFG7qEImy4Tlzfxk7NzsnvLs1R9QG+OlNGJSAaIF3B0/TnR/hPiTqkNpNRa6427Vj571 7/tmLUl55dtF63V7vuaHxSJbVn2L+P/NIciSJBiMXRyY4+v6IvgIDURxiCzwvT7Wn4Pj EfkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:cc:to:from; bh=3Wz1YQ/TcMWsY5Fpkptx1xiUp+RlIU9RbcW5b1G3SN0=; b=JPs495txNNA8X1fUJDoSNKjuPP9bL3z9MXXJqsaJlbrOk5ZoldWjNrH667VZGdIP/y 4fVlu+1ihjyNyLgVS17QnQ4lmDAOlzw7jUTjhpsWYpZWt4psjBdKGUqDKKIsqK6uZpOX qkM4NPkkQs/lfLT/7rYRsTATYZz7Ah31zO/b1FStsI1YetiF8SUIQm6Ecv8Z2Mh+Tvpl Q6bIpo60LW9xHifz509U5E+MG8jw0BFajxcyDx4V2BKn5b0u/JBG/dwB8nTLqlw1qZj6 FvAZc/NmNv+BMB+1IE0hbQIIzuqZqT52V3jlzlomhO140xtlXQJpMudRrrUG/RuflKzg D3DQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id j20si370228wme.1.2018.11.26.01.39.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Nov 2018 01:39:04 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id wAQ9d3Kn015420 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 26 Nov 2018 10:39:03 +0100 Received: from md1f2u6c.ad001.siemens.net ([139.23.79.230]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id wAQ9d2v0012310; Mon, 26 Nov 2018 10:39:03 +0100 From: Jan Kiszka To: isar-users Cc: Henning Schild Subject: [PATCH 6/7] u-boot-script: Make truly generic Date: Mon, 26 Nov 2018 10:39:01 +0100 Message-Id: X-Mailer: git-send-email 2.16.4 In-Reply-To: References: In-Reply-To: References: X-TUID: f2kzqGMwGXPY From: Jan Kiszka 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 --- 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