[isar-cip-core][PATCH v4 3/6] secure-boot: select boot partition in initramfs
Quirin Gylstorff
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
As the usage of a unified kernel image freeze the kernel commmandline during build time the rootfs selection for swupdate can no longer be done with the kernel commandline and must be done later in the boot process. Read the root filesystem /etc/os-release and check if it contains the same uuid as stored in the initramfs . If the uuids are the same boot the root file system. Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> --- classes/image_uuid.bbclass | 33 ++++++++ .../files/initramfs.image_uuid.hook | 33 ++++++++ .../files/initramfs.lsblk.hook | 29 +++++++ .../initramfs-config/files/postinst.ext | 3 + .../initramfs-config/files/postinst.tmpl | 31 ++++++++ .../files/secure-boot-debian-local-patch | 79 +++++++++++++++++++ .../initramfs-abrootfs-secureboot_0.1.bb | 38 +++++++++ 7 files changed, 246 insertions(+) create mode 100644 classes/image_uuid.bbclass create mode 100644 recipes-support/initramfs-config/files/initramfs.image_uuid.hook create mode 100644 recipes-support/initramfs-config/files/initramfs.lsblk.hook create mode 100644 recipes-support/initramfs-config/files/postinst.ext create mode 100644 recipes-support/initramfs-config/files/postinst.tmpl create mode 100644 recipes-support/initramfs-config/files/secure-boot-debian-local-patch create mode 100644 recipes-support/initramfs-config/initramfs-abrootfs-secureboot_0.1.bb diff --git a/classes/image_uuid.bbclass b/classes/image_uuid.bbclass new file mode 100644 index 0000000..d5337b8 --- /dev/null +++ b/classes/image_uuid.bbclass @@ -0,0 +1,33 @@ +# +# CIP Core, generic profile +# +# Copyright (c) Siemens AG, 2020 +# +# Authors: +# Quirin Gylstorff <quirin.gylstorff@siemens.com> +# +# SPDX-License-Identifier: MIT +# + +def generate_image_uuid(d): + import uuid + + base_hash = d.getVar("BB_BASEHASH_task-do_rootfs_install", True) + if base_hash is None: + return None + return str(uuid.UUID(base_hash[:32], version=4)) + +IMAGE_UUID ?= "${@generate_image_uuid(d)}" + +do_generate_image_uuid[vardeps] += "IMAGE_UUID" +do_generate_image_uuid[depends] = "buildchroot-target:do_build" +do_generate_image_uuid() { + sudo sed -i '/^IMAGE_UUID=.*/d' '${IMAGE_ROOTFS}/etc/os-release' + echo "IMAGE_UUID=\"${IMAGE_UUID}\"" | \ + sudo tee -a '${IMAGE_ROOTFS}/etc/os-release' + image_do_mounts + + # update initramfs to add uuid + sudo chroot '${IMAGE_ROOTFS}' update-initramfs -u +} +addtask generate_image_uuid before do_copy_boot_files after do_rootfs_install diff --git a/recipes-support/initramfs-config/files/initramfs.image_uuid.hook b/recipes-support/initramfs-config/files/initramfs.image_uuid.hook new file mode 100644 index 0000000..910ce84 --- /dev/null +++ b/recipes-support/initramfs-config/files/initramfs.image_uuid.hook @@ -0,0 +1,33 @@ +# This software is a part of ISAR. +# Copyright (C) Siemens AG, 2020 +# +# SPDX-License-Identifier: MIT + +#!/bin/sh +set -x +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/scripts/functions +. /usr/share/initramfs-tools/hook-functions + +if [ ! -e /etc/os-release ]; then + echo "Warning: couldn't find /etc/os-release!" + exit 0 +fi + +IMAGE_UUID=$(sed -n 's/^IMAGE_UUID="\(.*\)"/\1/p' /etc/os-release) +echo "${IMAGE_UUID}" > "${DESTDIR}/conf/image_uuid" + +exit 0 \ No newline at end of file diff --git a/recipes-support/initramfs-config/files/initramfs.lsblk.hook b/recipes-support/initramfs-config/files/initramfs.lsblk.hook new file mode 100644 index 0000000..cf32404 --- /dev/null +++ b/recipes-support/initramfs-config/files/initramfs.lsblk.hook @@ -0,0 +1,29 @@ +# This software is a part of ISAR. +# Copyright (C) Siemens AG, 2020 +# +# SPDX-License-Identifier: MIT + +#!/bin/sh +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/scripts/functions +. /usr/share/initramfs-tools/hook-functions + +if [ ! -x /usr/bin/lsblk ]; then + echo "Warning: couldn't find /usr/bin/lsblk!" + exit 0 +fi + +copy_exec /usr/bin/lsblk diff --git a/recipes-support/initramfs-config/files/postinst.ext b/recipes-support/initramfs-config/files/postinst.ext new file mode 100644 index 0000000..cdafa74 --- /dev/null +++ b/recipes-support/initramfs-config/files/postinst.ext @@ -0,0 +1,3 @@ +if [ -d /usr/share/secureboot ]; then + patch -s -p0 /usr/share/initramfs-tools/scripts/local /usr/share/secureboot/secure-boot-debian-local.patch +fi diff --git a/recipes-support/initramfs-config/files/postinst.tmpl b/recipes-support/initramfs-config/files/postinst.tmpl new file mode 100644 index 0000000..008f68d --- /dev/null +++ b/recipes-support/initramfs-config/files/postinst.tmpl @@ -0,0 +1,31 @@ +#!/bin/sh +if [ -d /usr/share/secureboot ]; then + patch -s -p0 /usr/share/initramfs-tools/scripts/local /usr/share/secureboot/secure-boot-debian-local.patch +fi + +INITRAMFS_CONF=/etc/initramfs-tools/initramfs.conf +if [ -f ${INITRAMFS_CONF} ]; then + sed -i -E 's/(^MODULES=).*/\1${INITRAMFS_MODULES}/' ${INITRAMFS_CONF} + sed -i -E 's/(^BUSYBOX=).*/\1${INITRAMFS_BUSYBOX}/' ${INITRAMFS_CONF} + sed -i -E 's/(^COMPRESS=).*/\1${INITRAMFS_COMPRESS}/' ${INITRAMFS_CONF} + sed -i -E 's/(^KEYMAP=).*/\1${INITRAMFS_KEYMAP}/' ${INITRAMFS_CONF} + sed -i -E 's/(^DEVICE=).*/\1${INITRAMFS_NET_DEVICE}/' ${INITRAMFS_CONF} + sed -i -E 's/(^NFSROOT=).*/\1${INITRAMFS_NFSROOT}/' ${INITRAMFS_CONF} + sed -i -E 's/(^RUNSIZE=).*/\1${INITRAMFS_RUNSIZE}/' ${INITRAMFS_CONF} + if grep -Fxq "ROOT=" "${INITRAMFS_CONF}"; then + sed -i -E 's/(^ROOT=).*/\1${INITRAMFS_ROOT}/' ${INITRAMFS_CONF} + else + sed -i -E "\$aROOT=${INITRAMFS_ROOT}" ${INITRAMFS_CONF} + fi +fi + +MODULES_LIST_FILE=/etc/initramfs-tools/modules +if [ -f ${MODULES_LIST_FILE} ]; then + for modname in ${INITRAMFS_MODULE_LIST}; do + if ! grep -Fxq "$modname" "${MODULES_LIST_FILE}"; then + echo "$modname" >> "${MODULES_LIST_FILE}" + fi + done +fi + +update-initramfs -v -u diff --git a/recipes-support/initramfs-config/files/secure-boot-debian-local-patch b/recipes-support/initramfs-config/files/secure-boot-debian-local-patch new file mode 100644 index 0000000..219578c --- /dev/null +++ b/recipes-support/initramfs-config/files/secure-boot-debian-local-patch @@ -0,0 +1,79 @@ +--- local 2020-07-02 14:59:15.461895194 +0200 ++++ ../../../../../../../../../../../recipes-support/initramfs-config/files/local 2020-07-02 14:58:58.405730914 +0200 +@@ -1,5 +1,4 @@ + # Local filesystem mounting -*- shell-script -*- +- + local_top() + { + if [ "${local_top_used}" != "yes" ]; then +@@ -155,34 +154,47 @@ + local_mount_root() + { + local_top +- if [ -z "${ROOT}" ]; then +- panic "No root device specified. Boot arguments must include a root= parameter." +- fi +- local_device_setup "${ROOT}" "root file system" +- ROOT="${DEV}" +- +- # Get the root filesystem type if not set +- if [ -z "${ROOTFSTYPE}" ] || [ "${ROOTFSTYPE}" = auto ]; then +- FSTYPE=$(get_fstype "${ROOT}") +- else +- FSTYPE=${ROOTFSTYPE} ++ if [ ! -e /conf/image_uuid ]; then ++ panic "could not find image_uuid to select correct root file system" + fi ++ local INITRAMFS_IMAGE_UUID=$(cat /conf/image_uuid) ++ local partitions=$(blkid -o device) ++ for part in $partitions; do ++ if [ "$(blkid -p ${part} --match-types novfat -s USAGE -o value)" = "filesystem" ]; then ++ local_device_setup "${part}" "root file system" ++ ROOT="${DEV}" ++ ++ # Get the root filesystem type if not set ++ if [ -z "${ROOTFSTYPE}" ] || [ "${ROOTFSTYPE}" = auto ]; then ++ FSTYPE=$(get_fstype "${ROOT}") ++ else ++ FSTYPE=${ROOTFSTYPE} ++ fi + +- local_premount ++ local_premount + +- if [ "${readonly?}" = "y" ]; then +- roflag=-r +- else +- roflag=-w +- fi ++ if [ "${readonly?}" = "y" ]; then ++ roflag=-r ++ else ++ roflag=-w ++ fi ++ checkfs "${ROOT}" root "${FSTYPE}" + +- checkfs "${ROOT}" root "${FSTYPE}" ++ # Mount root ++ # shellcheck disable=SC2086 ++ if mount ${roflag} ${FSTYPE:+-t "${FSTYPE}"} ${ROOTFLAGS} "${ROOT}" "${rootmnt?}"; then ++ if [ -e "${rootmnt?}"/etc/os-release ]; then ++ image_uuid=$(sed -n 's/^IMAGE_UUID=//p' "${rootmnt?}"/etc/os-release | tr -d '"' ) ++ if [ "${INITRAMFS_IMAGE_UUID}" = "${image_uuid}" ]; then ++ return ++ fi ++ fi ++ umount "${rootmnt?}" ++ fi ++ fi ++ done ++ panic "Could not find ROOTFS with matching UUID $INITRAMFS_IMAGE_UUID" + +- # Mount root +- # shellcheck disable=SC2086 +- if ! mount ${roflag} ${FSTYPE:+-t "${FSTYPE}"} ${ROOTFLAGS} "${ROOT}" "${rootmnt?}"; then +- panic "Failed to mount ${ROOT} as root file system." +- fi + } + + local_mount_fs() diff --git a/recipes-support/initramfs-config/initramfs-abrootfs-secureboot_0.1.bb b/recipes-support/initramfs-config/initramfs-abrootfs-secureboot_0.1.bb new file mode 100644 index 0000000..0be9871 --- /dev/null +++ b/recipes-support/initramfs-config/initramfs-abrootfs-secureboot_0.1.bb @@ -0,0 +1,38 @@ +# +# CIP Core, generic profile +# +# Copyright (c) Siemens AG, 2020 +# +# Authors: +# Quirin Gylstorff <quirin.gylstorff@siemens.com> +# +# SPDX-License-Identifier: MIT + +require recipes-support/initramfs-config/initramfs-config.inc + +FILESPATH =. "${LAYERDIR_isar-siemens}/recipes-support/initramfs-config/files:" + +DEBIAN_DEPENDS += ", busybox, patch" + +SRC_URI += "file://postinst.ext \ + file://initramfs.lsblk.hook \ + file://initramfs.image_uuid.hook \ + file://secure-boot-debian-local-patch" + +INITRAMFS_BUSYBOX = "y" + +do_install() { + # add patch for local to /usr/share/secure boot + TARGET=${D}/usr/share/secureboot + install -m 0755 -d ${TARGET} + install -m 0644 ${WORKDIR}/secure-boot-debian-local-patch ${TARGET}/secure-boot-debian-local.patch + # patch postinst + sed -i -e '/configure)/r ${WORKDIR}/postinst.ext' ${WORKDIR}/postinst + + # add hooks for secure boot + HOOKS=${D}/etc/initramfs-tools/hooks +install -m 0755 -d ${HOOKS} + install -m 0740 ${WORKDIR}/initramfs.lsblk.hook ${HOOKS}/lsblk.hook + install -m 0740 ${WORKDIR}/initramfs.image_uuid.hook ${HOOKS}/image_uuid.hook +} +addtask do_install after do_transform_template -- 2.20.1
|
|
[isar-cip-core][PATCH v4 2/6] isar-patch: Add initramfs-config patch
Quirin Gylstorff
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
Adapt the initramfs generation to set for example the root device in the initramfs Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> --- .../0001-u-boot-add-libubootenv.patch | 161 +++++++------- ...-support-Generate-a-custom-initramfs.patch | 207 ++++++++++++++++++ kas-cip.yml | 3 + 3 files changed, 290 insertions(+), 81 deletions(-) create mode 100644 isar-patches/v7-0001-meta-support-Generate-a-custom-initramfs.patch diff --git a/isar-patches/0001-u-boot-add-libubootenv.patch b/isar-patches/0001-u-boot-add-libubootenv.patch index 10a5b4a..6002cf1 100644 --- a/isar-patches/0001-u-boot-add-libubootenv.patch +++ b/isar-patches/0001-u-boot-add-libubootenv.patch @@ -1,4 +1,4 @@ -From 76897e89977f895495e21e37cb76f90392d55ef9 Mon Sep 17 00:00:00 2001 +From dda00e6addc7c51862b8175d473a1ea42dcd5c9e Mon Sep 17 00:00:00 2001 From: Quirin Gylstorff <quirin.gylstorff@siemens.com> Date: Fri, 19 Jun 2020 17:00:36 +0200 Subject: [PATCH v2] u-boot: add libubootenv @@ -16,20 +16,25 @@ as both try to install fw_printenv and fw_sentenv. This conflict is not part of the control file as it breaks the installation of custom u-boot-tools from the u-boot-sources. +This patch uses dpkg-gdb to build the package from salsa.debian.org and adds +a fix for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967487. + Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> --- + +Changes V2: +- use dpkg-gbd instead dpkg +- use salsa.debian.org as source +- add fix for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967487 + meta-isar/conf/machine/de0-nano-soc.conf | 2 +- - .../libubootenv/files/debian/compat | 1 + - .../libubootenv/files/debian/control.tmpl | 15 +++++++++ - .../libubootenv/files/debian/rules.tmpl | 24 ++++++++++++++ - .../libubootenv/libubootenv_0.2.bb | 32 +++++++++++++++++++ + .../0002-Add-support-GNUInstallDirs.patch | 48 +++++++++++++++++++ + .../libubootenv/libubootenv_0.2.bb | 30 ++++++++++++ .../files/debian/u-boot-tools.conffiles | 1 - - .../u-boot/files/debian/u-boot-tools.install | 2 -- + .../u-boot/files/debian/u-boot-tools.install | 2 - .../u-boot/files/debian/u-boot-tools.links | 1 - - 8 files changed, 73 insertions(+), 5 deletions(-) - create mode 100644 meta/recipes-bsp/libubootenv/files/debian/compat - create mode 100644 meta/recipes-bsp/libubootenv/files/debian/control.tmpl - create mode 100644 meta/recipes-bsp/libubootenv/files/debian/rules.tmpl + 6 files changed, 79 insertions(+), 5 deletions(-) + create mode 100644 meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch create mode 100644 meta/recipes-bsp/libubootenv/libubootenv_0.2.bb delete mode 100644 meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles delete mode 100644 meta/recipes-bsp/u-boot/files/debian/u-boot-tools.links @@ -44,70 +49,66 @@ index 3a2c009..6558d90 100644 -IMAGE_INSTALL += "u-boot-tools u-boot-script" +IMAGE_INSTALL += "u-boot-tools libubootenv u-boot-script" -diff --git a/meta/recipes-bsp/libubootenv/files/debian/compat b/meta/recipes-bsp/libubootenv/files/debian/compat -new file mode 100644 -index 0000000..b4de394 ---- /dev/null -+++ b/meta/recipes-bsp/libubootenv/files/debian/compat -@@ -0,0 +1 @@ -+11 -diff --git a/meta/recipes-bsp/libubootenv/files/debian/control.tmpl b/meta/recipes-bsp/libubootenv/files/debian/control.tmpl +diff --git a/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch b/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch new file mode 100644 -index 0000000..fade69a +index 0000000..f8c3038 --- /dev/null -+++ b/meta/recipes-bsp/libubootenv/files/debian/control.tmpl -@@ -0,0 +1,15 @@ -+Source: libubootenv -+Section: embedded -+Priority: optional -+Maintainer: Stefano Babic <sbabic@denx.de> -+Build-Depends: ${BUILD_DEB_DEPENDS} -+Standards-Version: 4.2.1 -+Homepage: https://sbabic.github.io/libubootenv -+ -+Package: libubootenv -+Architecture: any -+Depends: ${DEBIAN_DEPENDS} -+Description: libubootenv is a library that provides a hardware independent -+ way to access to U-Boot environment. U-Boot has its default environment -+ compiled board-dependently and this means that tools to access the environment -+ are also board specific, too. -diff --git a/meta/recipes-bsp/libubootenv/files/debian/rules.tmpl b/meta/recipes-bsp/libubootenv/files/debian/rules.tmpl -new file mode 100644 -index 0000000..56ccd19 ---- /dev/null -+++ b/meta/recipes-bsp/libubootenv/files/debian/rules.tmpl -@@ -0,0 +1,24 @@ -+#!/usr/bin/make -f -+ -+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) -+export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)- -+export CC=$(DEB_HOST_GNU_TYPE)-gcc -+export LD=$(DEB_HOST_GNU_TYPE)-gcc -+endif -+ -+export DH_VERBOSE = 1 ++++ b/meta/recipes-bsp/libubootenv/files/0002-Add-support-GNUInstallDirs.patch +@@ -0,0 +1,48 @@ ++From b17d194bd8285a19382a902a0bec9e5e042df064 Mon Sep 17 00:00:00 2001 ++From: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> ++Date: Tue, 16 Apr 2019 08:52:01 +0900 ++Subject: [PATCH 2/4] Add support GNUInstallDirs ++ ++This adds the functionality of the module "GNUInstallDirs" to make the ++installation compatible with GNU. ++ ++https://cmake.org/cmake/help/v3.14/module/GNUInstallDirs.html ++ ++Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> ++--- ++ CMakeLists.txt | 2 ++ ++ src/CMakeLists.txt | 8 ++++---- ++ 2 files changed, 6 insertions(+), 4 deletions(-) ++ ++diff --git a/CMakeLists.txt b/CMakeLists.txt ++index 104969e..57477fc 100644 ++--- a/CMakeLists.txt +++++ b/CMakeLists.txt ++@@ -10,6 +10,8 @@ add_definitions(-DVERSION="${VERSION}") ++ ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") ++ +++include("GNUInstallDirs") +++ ++ #set(CMAKE_C_FLAGS_DEBUG "-g") ++ include_directories ("${PROJECT_SOURCE_DIR}/src") ++ add_subdirectory (src) ++diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt ++index ea5979c..d97f221 100644 ++--- a/src/CMakeLists.txt +++++ b/src/CMakeLists.txt ++@@ -19,7 +19,7 @@ add_executable(fw_setenv fw_setenv.c) ++ target_link_libraries(fw_printenv ubootenv z) ++ target_link_libraries(fw_setenv ubootenv z) ++ ++-install (TARGETS ubootenv DESTINATION lib) ++-install (FILES libuboot.h DESTINATION include) ++-install (TARGETS fw_printenv DESTINATION bin) ++-install (TARGETS fw_setenv DESTINATION bin) +++install (TARGETS ubootenv DESTINATION "${CMAKE_INSTALL_LIBDIR}") +++install (FILES libuboot.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +++install (TARGETS fw_printenv DESTINATION "${CMAKE_INSTALL_BINDIR}") +++install (TARGETS fw_setenv DESTINATION "${CMAKE_INSTALL_BINDIR}") ++-- ++2.20.1 + -+export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow -+ -+override_dh_auto_configure: -+ dh_auto_configure -- -+ -+%: -+ echo $@ -+ dh $@ -+ -+override_dh_installchangelogs: -+ true -+ -+override_dh_installdocs: -+ true diff --git a/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb b/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb new file mode 100644 -index 0000000..1be058c +index 0000000..995e581 --- /dev/null +++ b/meta/recipes-bsp/libubootenv/libubootenv_0.2.bb -@@ -0,0 +1,32 @@ +@@ -0,0 +1,30 @@ +# libubootenv +# +# This software is a part of ISAR. @@ -119,26 +120,24 @@ index 0000000..1be058c +HOMEPAGE= "https://github.com/sbabic/swupdate" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" -+SRC_URI = "gitsm://github.com/sbabic/libubootenv.git;branch=master;protocol=https" -+ -+SRCREV = "bf6ff631c0e38cede67268ceb8bf1383b5f8848e" + -+BUILD_DEB_DEPENDS = "cmake, zlib1g-dev" ++inherit dpkg-gbp + -+SRC_URI += "file://debian" -+TEMPLATE_FILES = "debian/control.tmpl debian/rules.tmpl" -+TEMPLATE_VARS += "BUILD_DEB_DEPENDS DEFCONFIG DEBIAN_DEPENDS" -+ -+ -+inherit dpkg ++SRC_URI = "git://salsa.debian.org/debian/libubootenv.git;protocol=https \ ++ file://0002-Add-support-GNUInstallDirs.patch;apply=no " ++SRCREV = "2c7cb6d941d906dcc1d2e447cc17e418485dff12" + +S = "${WORKDIR}/git" + +do_prepare_build() { -+ DEBDIR=${S}/debian -+ install -d ${DEBDIR} -+ cp -R ${WORKDIR}/debian ${S} -+ deb_add_changelog ++ cd ${S} ++ export QUILT_PATCHES=debian/patches ++ quilt import -f ${WORKDIR}/*.patch ++ quilt push -a ++} ++ ++dpkg_runbuild_prepend() { ++ export DEB_BUILD_OPTIONS="nocheck" +} diff --git a/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles b/meta/recipes-bsp/u-boot/files/debian/u-boot-tools.conffiles deleted file mode 100644 diff --git a/isar-patches/v7-0001-meta-support-Generate-a-custom-initramfs.patch b/isar-patches/v7-0001-meta-support-Generate-a-custom-initramfs.patch new file mode 100644 index 0000000..f8fb28e --- /dev/null +++ b/isar-patches/v7-0001-meta-support-Generate-a-custom-initramfs.patch @@ -0,0 +1,207 @@ +From 7c85e2e363fd39e60bf5041d02e14e8bd62c1a68 Mon Sep 17 00:00:00 2001 +From: Quirin Gylstorff <quirin.gylstorff@siemens.com> +Date: Tue, 24 Mar 2020 17:58:08 +0100 +Subject: [PATCH v7 1/3] meta/support: Generate a custom initramfs + +This package sets the Parameters for mkinitramfs/update-intramfs +before it regenerates the initrd.img of debian with a modified version. + +Use cases are the remove unnecessary kernel modules to reduce the +size of the initrd by using the parameters: +``` +INITRAMFS_MODULES = "list" +INITRAMFS_MODULE_LIST += "ext4" +``` + +Set the boot root during the initrd generation by setting `INITRAMFS_ROOT`. + +see also man pages of mkinitramfs and initramfs.conf. + +Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> +--- + .../initramfs-config/initramfs-config_0.1.bb | 6 +++ + .../initramfs-config/files/control.tmpl | 12 +++++ + .../initramfs-config/files/postinst.tmpl | 50 +++++++++++++++++++ + .../initramfs-config/files/postrm.tmpl | 41 +++++++++++++++ + .../initramfs-config/initramfs-config.inc | 32 ++++++++++++ + 5 files changed, 141 insertions(+) + create mode 100644 meta-isar/recipes-support/initramfs-config/initramfs-config_0.1.bb + create mode 100644 meta/recipes-support/initramfs-config/files/control.tmpl + create mode 100644 meta/recipes-support/initramfs-config/files/postinst.tmpl + create mode 100644 meta/recipes-support/initramfs-config/files/postrm.tmpl + create mode 100644 meta/recipes-support/initramfs-config/initramfs-config.inc + +diff --git a/meta-isar/recipes-support/initramfs-config/initramfs-config_0.1.bb b/meta-isar/recipes-support/initramfs-config/initramfs-config_0.1.bb +new file mode 100644 +index 0000000..c951e8a +--- /dev/null ++++ b/meta-isar/recipes-support/initramfs-config/initramfs-config_0.1.bb +@@ -0,0 +1,6 @@ ++# ++# Copyright (C) Siemens AG, 2020 ++# ++# SPDX-License-Identifier: MIT ++ ++require recipes-support/initramfs-config/initramfs-config.inc +diff --git a/meta/recipes-support/initramfs-config/files/control.tmpl b/meta/recipes-support/initramfs-config/files/control.tmpl +new file mode 100644 +index 0000000..66984eb +--- /dev/null ++++ b/meta/recipes-support/initramfs-config/files/control.tmpl +@@ -0,0 +1,12 @@ ++Source: ${PN} ++Section: misc ++Priority: optional ++Standards-Version: 3.9.6 ++Maintainer: isar-users <isar-users@googlegroups.com> ++Build-Depends: debhelper (>= 9) ++ ++ ++Package: ${PN} ++Architecture: any ++Depends: ${shlibs:Depends}, ${misc:Depends}, initramfs-tools-core, ${DEBIAN_DEPENDS} ++Description: Configuration files for a custom initramfs +diff --git a/meta/recipes-support/initramfs-config/files/postinst.tmpl b/meta/recipes-support/initramfs-config/files/postinst.tmpl +new file mode 100644 +index 0000000..e523906 +--- /dev/null ++++ b/meta/recipes-support/initramfs-config/files/postinst.tmpl +@@ -0,0 +1,50 @@ ++#!/bin/sh ++# postinst script for initramfs-config ++# ++# see: dh_installdeb(1) ++ ++set -e ++ ++case "$1" in ++ configure) ++ INITRAMFS_CONF=/etc/initramfs-tools/initramfs.conf ++ if [ -f ${INITRAMFS_CONF} ]; then ++ sed -i -E 's/(^MODULES=).*/\1${INITRAMFS_MODULES}/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^BUSYBOX=).*/\1${INITRAMFS_BUSYBOX}/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^COMPRESS=).*/\1${INITRAMFS_COMPRESS}/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^KEYMAP=).*/\1${INITRAMFS_KEYMAP}/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^DEVICE=).*/\1${INITRAMFS_NET_DEVICE}/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^NFSROOT=).*/\1${INITRAMFS_NFSROOT}/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^RUNSIZE=).*/\1${INITRAMFS_RUNSIZE}/' ${INITRAMFS_CONF} ++ if grep -Fxq "ROOT=" "${INITRAMFS_CONF}"; then ++ sed -i -E 's/(^ROOT=).*/\1${INITRAMFS_ROOT}/' ${INITRAMFS_CONF} ++ else ++ sed -i -E "\$aROOT=${INITRAMFS_ROOT}" ${INITRAMFS_CONF} ++ fi ++ fi ++ ++ MODULES_LIST_FILE=/etc/initramfs-tools/modules ++ if [ -f ${MODULES_LIST_FILE} ]; then ++ for modname in ${INITRAMFS_MODULE_LIST}; do ++ if ! grep -Fxq "$modname" "${MODULES_LIST_FILE}"; then ++ echo "$modname" >> "${MODULES_LIST_FILE}" ++ fi ++ done ++ fi ++ ++ update-initramfs -v -u ++ ++ ;; ++ abort-upgrade|abort-remove|abort-deconfigure) ++ ;; ++ ++ *) ++ echo "postinst called with unknown argument \`$1'" >&2 ++ exit 1 ++ ;; ++esac ++# dh_installdeb will replace this with shell code automatically ++# generated by other debhelper scripts. ++#DEBHELPER# ++ ++exit 0 +diff --git a/meta/recipes-support/initramfs-config/files/postrm.tmpl b/meta/recipes-support/initramfs-config/files/postrm.tmpl +new file mode 100644 +index 0000000..115d9b6 +--- /dev/null ++++ b/meta/recipes-support/initramfs-config/files/postrm.tmpl +@@ -0,0 +1,41 @@ ++#!/bin/sh ++# postrm script for initramfs-config ++# ++# see: dh_installdeb(1) ++ ++set -e ++ ++case "$1" in ++ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ++ # back to the debian defaults ++ INITRAMFS_CONF=/etc/initramfs-tools/initramfs.conf ++ sed -i -E 's/(^MODULES=).*/\1most/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^BUSYBOX=).*/\1auto/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^COMPRESS=).*/\1gzip/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^KEYMAP=).*/\1n/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^DEVICE=).*/\1/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^NFSROOT=).*/\1auto/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^RUNSIZE=).*/\110%/' ${INITRAMFS_CONF} ++ sed -i -E 's/(^ROOT=).*//' ${INITRAMFS_CONF} ++ ++ # remove the added modules ++ MODULES_LIST_FILE=/etc/initramfs-tools/modules ++ for modname in ${INITRAMFS_MODULE_LIST}; do ++ sed -i -E 's/$modname//' ++ done ++ ++ update-initramfs -v -u ++ ;; ++ ++ *) ++ echo "postrm called with unknown argument \`$1'" >&2 ++ exit 1 ++ ;; ++esac ++ ++# dh_installdeb will replace this with shell code automatically ++# generated by other debhelper scripts. ++ ++#DEBHELPER# ++ ++exit 0 +diff --git a/meta/recipes-support/initramfs-config/initramfs-config.inc b/meta/recipes-support/initramfs-config/initramfs-config.inc +new file mode 100644 +index 0000000..16049a9 +--- /dev/null ++++ b/meta/recipes-support/initramfs-config/initramfs-config.inc +@@ -0,0 +1,32 @@ ++# This software is a part of ISAR. ++# Copyright (C) 2020 Siemens AG ++# ++# SPDX-License-Identifier: MIT ++inherit dpkg-raw ++inherit template ++DESCRIPTION = "Recipe to set the initramfs configuration and generate a new ramfs" ++ ++FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/files:" ++ ++SRC_URI = "file://postinst.tmpl \ ++ file://postrm.tmpl \ ++ file://control.tmpl \ ++ " ++ ++INITRAMFS_MODULES ?= "most" ++INITRAMFS_BUSYBOX ?= "auto" ++INITRAMFS_COMPRESS ?= "gzip" ++INITRAMFS_KEYMAP ?= "n" ++INITRAMFS_NET_DEVICE ?= "" ++INITRAMFS_NFSROOT ?= "auto" ++INITRAMFS_RUNSIZE ?= "10%" ++INITRAMFS_ROOT ?= "" ++INITRAMFS_MODULE_LIST ?= "" ++CREATE_NEW_INITRAMFS ?= "n" ++KERNEL_PACKAGE = "${@ ("linux-image-" + d.getVar("KERNEL_NAME", True)) if d.getVar("KERNEL_NAME", True) else ""}" ++DEBIAN_DEPENDS += ", ${KERNEL_PACKAGE}" ++TEMPLATE_FILES = "postinst.tmpl control.tmpl postrm.tmpl" ++TEMPLATE_VARS += "INITRAMFS_MODULES INITRAMFS_BUSYBOX INITRAMFS_COMPRESS \ ++ INITRAMFS_KEYMAP INITRAMFS_NET_DEVICE INITRAMFS_NFSROOT \ ++ INITRAMFS_RUNSIZE INITRAMFS_ROOT INITRAMFS_MODULE_LIST \ ++ CREATE_NEW_INITRAMFS DEBIAN_DEPENDS PN" +-- +2.20.1 + diff --git a/kas-cip.yml b/kas-cip.yml index f4edd0f..66a58f1 100644 --- a/kas-cip.yml +++ b/kas-cip.yml @@ -27,6 +27,9 @@ repos: 01-libubootenv: path: isar-patches/0001-u-boot-add-libubootenv.patch repo: cip-core + 02-initramfs: + path: isar-patches/v7-0001-meta-support-Generate-a-custom-initramfs.patch + repo: cip-core bblayers_conf_header: standard: | -- 2.20.1
|
|
[isar-cip-core][PATCH v4 1/6] linux-cip: Update revision of kernel config
Quirin Gylstorff
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
Update the kernel configuration to the lasted version to avoid a qemu runtime error. Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> --- recipes-kernel/linux/linux-cip-common.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-kernel/linux/linux-cip-common.inc b/recipes-kernel/linux/linux-cip-common.inc index d45a3b0..0c76835 100644 --- a/recipes-kernel/linux/linux-cip-common.inc +++ b/recipes-kernel/linux/linux-cip-common.inc @@ -26,4 +26,4 @@ SRC_URI += " \ SRC_URI_append = " ${@conditional("USE_CIP_KERNEL_CONFIG", "1", \ "git://gitlab.com/cip-project/cip-kernel/cip-kernel-config.git;protocol=https;destsuffix=cip-kernel-config;name=cip-kernel-config", \ "file://${KERNEL_DEFCONFIG}",d)}" -SRCREV_cip-kernel-config ?= "db2085219b5f28ed7c3e0fbdf93b7867947958a8" +SRCREV_cip-kernel-config ?= "ca24d965adf77730caf1cd32bdfcffd69e369502" -- 2.20.1
|
|
[isar-cip-core][PATCH v4 0/6] secureboot with efibootguard
Quirin Gylstorff
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
This patchset adds secureboot with efibootguard to cip-core. The image build signs the efibootguard bootloader (bootx64.efi) and generates a signed [unified kernel image](https://systemd.io/BOOT_LOADER_SPECIFICATION/). A unified kernel image packs the kernel, initramfs and the kernel command-line in one binary object. As the kernel command-line is immutable after the build process, the previous selection of the root file system with a command-line parameter is no longer possible. Therefore the selection of the root file-system occurs now in the initramfs. The image uses an A/B partition layout to update the root file system. The sample implementation to select the root file system generates a uuid and stores the id in /etc/os-release and in the initramfs. During boot the initramfs compares its own uuid with the uuid stored in /etc/os-release of each rootfs. If a match is found the rootfs is used for the boot. Changes V2: - rebase to [1] - removed luahandler patch as it now part of [1] - add handling for sw-description Changes V3: - rewrite the image id creation to ensure a new uuid is generated if a new package is added or another change of the rootfs - add readme section how to execute/test the software update mechnism - adapt to version v3 of [1] - update the patch - add wks file for efibootguard and swupdate [1]: a/b rootfsupdate with software update Changes V4: - rebase onto next 619edb509bd287277749580cbc842e57d5044756 - fix indent of ./start-qemu.sh - whitespace fixes - update libubootenv patch to v2 - update revision of cip-kernel-config to ca24d965adf77730caf1cd32bdfcffd69e369502 to boot secureboot with qemu - swupdate swdescription for non-secure-boot images Quirin Gylstorff (6): linux-cip: Update revision of kernel config isar-patch: Add initramfs-config patch secure-boot: select boot partition in initramfs secure-boot: Add secure boot with unified kernel image secure-boot: Add Debian snakeoil keys for ease-of-use doc: Add README for secureboot classes/image_uuid.bbclass | 33 +++ conf/distro/debian-buster-backports.list | 1 + conf/distro/preferences.ovmf-snakeoil.conf | 3 + doc/README.secureboot.md | 229 ++++++++++++++++++ .../0001-u-boot-add-libubootenv.patch | 161 ++++++------ ...-support-Generate-a-custom-initramfs.patch | 207 ++++++++++++++++ kas-cip.yml | 3 + kas/opt/ebg-secure-boot-base.yml | 18 ++ kas/opt/ebg-secure-boot-snakeoil.yml | 28 +++ kas/opt/ebg-swu.yml | 4 +- recipes-core/images/cip-core-image.bb | 12 +- .../files/secure-boot/sw-description.tmpl | 29 +++ recipes-core/images/files/sw-description.tmpl | 19 +- recipes-core/images/secureboot.inc | 21 ++ recipes-core/images/swupdate.inc | 21 ++ .../ebg-secure-boot-secrets_0.1.bb | 51 ++++ .../ebg-secure-boot-secrets/files/README.md | 1 + .../files/control.tmpl | 12 + .../files/sign_secure_image.sh.tmpl | 22 ++ .../ebg-secure-boot-snakeoil_0.1.bb | 34 +++ .../files/control.tmpl | 12 + .../files/sign_secure_image.sh | 36 +++ .../ovmf-binaries/files/control.tmpl | 11 + .../ovmf-binaries/ovmf-binaries_0.1.bb | 30 +++ recipes-kernel/linux/linux-cip-common.inc | 2 +- .../files/initramfs.image_uuid.hook | 33 +++ .../files/initramfs.lsblk.hook | 29 +++ .../initramfs-config/files/postinst.ext | 3 + .../files/secure-boot-debian-local-patch | 79 ++++++ .../initramfs-abrootfs-secureboot_0.1.bb | 38 +++ ...enerate-sb-db-from-existing-certificate.sh | 16 ++ scripts/generate_secure_boot_keys.sh | 51 ++++ .../wic/plugins/source/efibootguard-boot.py | 87 ++++++- .../wic/plugins/source/efibootguard-efi.py | 40 ++- scripts/start-efishell.sh | 12 + start-qemu.sh | 59 +++-- wic/ebg-signed-bootloader.inc | 2 + wic/qemu-amd64-efibootguard-secureboot.wks | 9 + wic/qemu-amd64-efibootguard.wks | 1 - 39 files changed, 1330 insertions(+), 129 deletions(-) create mode 100644 classes/image_uuid.bbclass create mode 100644 conf/distro/debian-buster-backports.list create mode 100644 conf/distro/preferences.ovmf-snakeoil.conf create mode 100644 doc/README.secureboot.md create mode 100644 isar-patches/v7-0001-meta-support-Generate-a-custom-initramfs.patch create mode 100644 kas/opt/ebg-secure-boot-base.yml create mode 100644 kas/opt/ebg-secure-boot-snakeoil.yml create mode 100644 recipes-core/images/files/secure-boot/sw-description.tmpl create mode 100644 recipes-core/images/secureboot.inc create mode 100644 recipes-core/images/swupdate.inc create mode 100644 recipes-devtools/ebg-secure-boot-secrets/ebg-secure-boot-secrets_0.1.bb create mode 100644 recipes-devtools/ebg-secure-boot-secrets/files/README.md create mode 100644 recipes-devtools/ebg-secure-boot-secrets/files/control.tmpl create mode 100644 recipes-devtools/ebg-secure-boot-secrets/files/sign_secure_image.sh.tmpl create mode 100644 recipes-devtools/ebg-secure-boot-snakeoil/ebg-secure-boot-snakeoil_0.1.bb create mode 100644 recipes-devtools/ebg-secure-boot-snakeoil/files/control.tmpl create mode 100644 recipes-devtools/ebg-secure-boot-snakeoil/files/sign_secure_image.sh create mode 100644 recipes-devtools/ovmf-binaries/files/control.tmpl create mode 100644 recipes-devtools/ovmf-binaries/ovmf-binaries_0.1.bb create mode 100644 recipes-support/initramfs-config/files/initramfs.image_uuid.hook create mode 100644 recipes-support/initramfs-config/files/initramfs.lsblk.hook create mode 100644 recipes-support/initramfs-config/files/postinst.ext create mode 100644 recipes-support/initramfs-config/files/secure-boot-debian-local-patch create mode 100644 recipes-support/initramfs-config/initramfs-abrootfs-secureboot_0.1.bb create mode 100755 scripts/generate-sb-db-from-existing-certificate.sh create mode 100755 scripts/generate_secure_boot_keys.sh create mode 100755 scripts/start-efishell.sh create mode 100644 wic/ebg-signed-bootloader.inc create mode 100644 wic/qemu-amd64-efibootguard-secureboot.wks -- 2.20.1
|
|
Re: [cip-kernel-config ][ RFC 1/1] 4.19.y-cip/cip_bbb_defconfig: Add config switches from isar-cip-core
Quirin Gylstorff
On 8/21/20 1:34 AM, Nobuhiro Iwamatsu wrote:
Hi,This patch is only for 4.19. I can prepare a v2 which includes v4.4. As posted it was intented to show the current difference between the bbb-----Original Message-----Thanks for your patch. config in isar-cip-core and cip-kernel-config. Best regards, Quirin Best regards,-- Quirin Gylstorff Siemens AG Corporate Technology Research in Digitalization and Automation Smart Embedded Systems CT RDA IOT SES-DE Otto-Hahn-Ring 6 81739 Muenchen, Germany Mobile: +49 173 3746683 mailto:quirin.gylstorff@siemens.com www.siemens.com/ingenuityforlife Siemens Aktiengesellschaft: Chairman of the Supervisory Board: Jim Hagemann Snabe; Managing Board: Joe Kaeser, Chairman, President and Chief Executive Officer; Roland Busch, Lisa Davis, Klaus Helmrich, Cedrik Neike, Michael Sen, Ralf P. Thomas; Registered offices: Berlin and Munich, Germany; Commercial registries: Berlin Charlottenburg, HRB 12300, Munich, HRB 6684; WEEE-Reg.-No. DE 23691322 Important notice: This e-mail and any attachment thereof contain corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank you.
|
|
Re: [isar-cip-core][PATCH 2/2] ci: Add support for test image
Jan Kiszka
On 20.08.20 10:24, Nobuhiro Iwamatsu wrote:
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>Thanks, both applied to next. Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
|
|
Re: [cip-kernel-config ][ RFC 1/1] 4.19.y-cip/cip_bbb_defconfig: Add config switches from isar-cip-core
Nobuhiro Iwamatsu
Hi,
toggle quoted messageShow quoted text
-----Original Message-----Thanks for your patch. The cip_bbb_defconfig created by me had minimal functionality enabled. I didn't know that Siemens didn't include the required features. So I think this patch is necessary. However, we think that it is difficult to do it with one defconfig when testing the necessary functions as CIP in the future. Therefore, it may be necessary to prepare defconfig for each required function in the future. By the way, is this only 4.19? Do I need to change RT or 4.4.y? Best regards, Nobuhiro Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
|
|
Re: [cip-kernel-config PATCH] qemu_cip_defconfig: Add EFI_STUB to config
Nobuhiro Iwamatsu
Hi,
toggle quoted messageShow quoted text
-----Original Message-----<snip> Sorry, I just pushed.Hi,Thanks for your check.When i try to generate the sources - all .c and asm files are no longerPlease update cip_qemu.sources too. Kind regards,Best regards, Nobuhiro
|
|
Re: [PATCH 4.19.y-cip 01/12] arm64: dts: renesas: r8a774a1-hihope-rzg2m[-ex/-ex-idk-1110wr]: Rename HiHope RZ/G2M boards
Biju Das <biju.das.jz@...>
Hi Pavel,
Thanks for the feedback. Subject: Re: [PATCH 4.19.y-cip 01/12] arm64: dts: renesas: r8a774a1-hihope-Yes, that is true. But if you agree, We need to use our latest/greatest SoC/board as the main SoC/Board and rest are with explicit revision in dts/dtb . The existing users can read gpio values to differentiate rev2.0/rev4.0 boards and load the appropriate dtb/execute the test script accordingly. This is our thoughts on this. We need to use our latest/greatest SoC/board as the main SoC/Board and rest are with explicit revision in dts/dtb . So this is inline with your suggested comment. Please share your comments, I may be wrong. Cheers, Biju Renesas Electronics Europe GmbH, Geschaeftsfuehrer/President: Carsten Jauch, Sitz der Gesellschaft/Registered office: Duesseldorf, Arcadiastrasse 10, 40472 Duesseldorf, Germany, Handelsregister/Commercial Register: Duesseldorf, HRB 3708 USt-IDNr./Tax identification no.: DE 119353406 WEEE-Reg.-Nr./WEEE reg. no.: DE 14978647
|
|
Re: [PATCH 4.19.y-cip 2/2] drm: atomic helper: fix W=1 warnings
Pavel Machek
Hi!
Sorry for that, should be fixed now.This patch doesn't seem to have been pushed yet.commit bf5d837a0a4ced7cc223befc9e76d4ad30697d27 upstream.Thanks for the fixes. Applied and pushed out. Best regards, Pavel -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
|
|
Re: [PATCH 4.19.y-cip 00/12] Support RZ/G2[MN] rev4 board
Chris Paterson
Hello Pavel,
From: Pavel Machek <pavel@denx.de>Technically yes, it would cause problems. However this seems to be the way of doing things upstream. I guess upstream is a bit different though as users would expect such things when upgrading Kernel versions. For SLTS perhaps users wouldn't expect to see such changes? It may be easier to keep things in sync with upstream though. FYI the "rev4" dts does actually boot on "rev2" boards. It's just that some functionality like WiFi/BT and audio won't work. (and the rev2 dts will boot on rev4 boards) lab-cip-renesas uses rev4 boards, so from a CIP testing point of view there will be no issues. Kind regards, Chris
|
|
Re: [cip-kernel-config PATCH] qemu_cip_defconfig: Add EFI_STUB to config
Quirin Gylstorff
On 8/7/20 11:31 PM, Nobuhiro Iwamatsu wrote:
Hi,Hi,-----Original Message-----Thanks for your check. I didn't find the patch applied to cip-kernel-config. Is something missing? Kind regards, quirin --Thanks,Best regards, Quirin Gylstorff Siemens AG Corporate Technology Research in Digitalization and Automation Smart Embedded Systems CT RDA IOT SES-DE Otto-Hahn-Ring 6 81739 Muenchen, Germany Mobile: +49 173 3746683 mailto:quirin.gylstorff@siemens.com www.siemens.com/ingenuityforlife Siemens Aktiengesellschaft: Chairman of the Supervisory Board: Jim Hagemann Snabe; Managing Board: Joe Kaeser, Chairman, President and Chief Executive Officer; Roland Busch, Lisa Davis, Klaus Helmrich, Cedrik Neike, Michael Sen, Ralf P. Thomas; Registered offices: Berlin and Munich, Germany; Commercial registries: Berlin Charlottenburg, HRB 12300, Munich, HRB 6684; WEEE-Reg.-No. DE 23691322 Important notice: This e-mail and any attachment thereof contain corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank you.
|
|
Re: [isar-cip-core][PATCH v2 3/3] testing: Add test.yml
Nobuhiro Iwamatsu
Hi,
toggle quoted messageShow quoted text
-----Original Message-----<snip> Okay, I send a patch for CI only.No need to resend, the patches are already in next, locally. Just addYes, I planned to do it after it was applied. JanBest regards, Nobuhiro
|
|
[isar-cip-core][PATCH 2/2] ci: Add support for test image
Nobuhiro Iwamatsu
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
--- .gitlab-ci.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e23345f..802dbcd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,3 +68,35 @@ build:qemu-amd64-base: extention: security use_rt: disable targz: disable + +# test +build:simatic-ipc227e-test: + extends: + - .build_base + variables: + target: simatic-ipc227e + extention: test + +build:bbb-test: + extends: + - .build_base + variables: + target: bbb + extention: test + dtb: am335x-boneblack.dtb + +build:iwg20m-test: + extends: + - .build_base + variables: + target: iwg20m + extention: test + dtb: r8a7743-iwg20d-q7-dbcm-ca.dtb + +build:hihope-rzg2m-test: + extends: + - .build_base + variables: + target: rzg2m + extention: test + dtb: renesas/r8a774a1-hihope-rzg2m-ex.dtb -- 2.27.0
|
|
[isar-cip-core][PATCH 1/2] ci: Rewrite using extends
Nobuhiro Iwamatsu
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
--- .gitlab-ci.yml | 70 +++++++++++++++++++++++++++++--------- scripts/deploy-cip-core.sh | 8 +++-- 2 files changed, 60 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3fe7af2..e23345f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,10 +2,17 @@ image: kasproject/kas-isar:1.1 variables: GIT_STRATEGY: clone + release: buster + extention: base + use_rt: enable + targz: enable + dtb: none -all: - stage: build - script: +stages: + - build + +default: + before_script: - export http_proxy=$HTTP_PROXY - export https_proxy=$HTTPS_PROXY - export ftp_proxy=$FTP_PROXY @@ -13,20 +20,51 @@ all: - export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID - export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY - - kas build kas-cip.yml:kas/board/simatic-ipc227e.yml:kas/opt/rt.yml:kas/opt/targz-img.yml - - scripts/deploy-cip-core.sh buster simatic-ipc227e - +.build_base: + stage: build + variables: + base_yaml: "kas-cip.yml:kas/board/${target}.yml" + script: - sudo rm -rf build/tmp - - kas build kas-cip.yml:kas/board/bbb.yml:kas/opt/rt.yml:kas/opt/targz-img.yml - - scripts/deploy-cip-core.sh buster bbb am335x-boneblack.dtb + - if [ "${use_rt}" = "enable" ]; then base_yaml="${base_yaml}:kas/opt/rt.yml"; fi; + - if [ "${extention}" != "base" ]; then base_yaml="${base_yaml}:kas/opt/${extention}.yml"; fi; + - if [ "${targz}" = "enable" ]; then base_yaml="${base_yaml}:kas/opt/targz-img.yml"; fi; + - kas build ${base_yaml} + - scripts/deploy-cip-core.sh ${release} ${target} ${extention} ${dtb} - - sudo rm -rf build/tmp - - kas build kas-cip.yml:kas/board/iwg20m.yml:kas/opt/rt.yml:kas/opt/targz-img.yml - - scripts/deploy-cip-core.sh buster iwg20m r8a7743-iwg20d-q7-dbcm-ca.dtb +# base image +build:simatic-ipc227e-base: + extends: + - .build_base + variables: + target: simatic-ipc227e - - sudo rm -rf build/tmp - - kas build kas-cip.yml:kas/board/rzg2m.yml:kas/opt/rt.yml:kas/opt/targz-img.yml - - scripts/deploy-cip-core.sh buster hihope-rzg2m renesas/r8a774a1-hihope-rzg2m-ex.dtb +build:bbb-base: + extends: + - .build_base + variables: + target: bbb + dtb: am335x-boneblack.dtb - - sudo rm -rf build/tmp - - kas build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/security.yml +build:iwg20m-base: + extends: + - .build_base + variables: + target: iwg20m + dtb: r8a7743-iwg20d-q7-dbcm-ca.dtb + +build:hihope-rzg2m-base: + extends: + - .build_base + variables: + target: rzg2m + dtb: renesas/r8a774a1-hihope-rzg2m-ex.dtb + +build:qemu-amd64-base: + extends: + - .build_base + variables: + target: qemu-amd64 + extention: security + use_rt: disable + targz: disable diff --git a/scripts/deploy-cip-core.sh b/scripts/deploy-cip-core.sh index 4c8d4c9..5b7eab9 100755 --- a/scripts/deploy-cip-core.sh +++ b/scripts/deploy-cip-core.sh @@ -16,9 +16,13 @@ fi RELEASE=$1 TARGET=$2 -DTB=$3 +EXTENSION=$3 +DTB=$4 BASE_PATH=build/tmp/deploy/images/$TARGET/cip-core-image-cip-core-$RELEASE-$TARGET +if [ "${EXTENSION}" != "base" ] ; then + BASE_PATH=build/tmp/deploy/images/$TARGET/cip-core-image-cip-core-$RELEASE-$TARGET-$EXTENSION +fi echo "Compressing cip-core-image-cip-core-$RELEASE-$TARGET.wic.img..." xz -9 -k $BASE_PATH.wic.img @@ -38,6 +42,6 @@ fi aws s3 cp --no-progress $KERNEL_IMAGE s3://download.cip-project.org/cip-core/$TARGET/ aws s3 cp --no-progress $BASE_PATH-initrd.img s3://download.cip-project.org/cip-core/$TARGET/ -if [ -n "$DTB" ]; then +if [ "$DTB" != "none" ]; then aws s3 cp --no-progress build/tmp/work/cip-core-*/linux-cip*/*/linux-cip-*/debian/linux-image-cip*/usr/lib/linux-image-*/$DTB s3://download.cip-project.org/cip-core/$TARGET/ fi -- 2.27.0
|
|
CIP IRC weekly meeting today
masashi.kudo@cybertrust.co.jp <masashi.kudo@...>
Hi all,
Kindly be reminded to attend the weekly meeting through IRC to discuss technical topics with CIP kernel today. *Please note that the IRC meeting was rescheduled to UTC (GMT) 09:00 starting from the first week of Apr. according to TSC meeting* https://www.timeanddate.com/worldclock/meetingdetails.html?year=2020&month=8&day=20&hour=9&min=0&sec=0&p1=224&p2=179&p3=136&p4=37&p5=241&p6=248 USWest USEast UK DE TW JP 02:00 05:00 10:00 11:00 17:00 18:00 Channel: * irc:chat.freenode.net:6667/cip Last meeting minutes: https://irclogs.baserock.org/meetings/cip/2020/08/cip.2020-08-06-09.00.log.html Agenda: * Action item 1. Combine root filesystem with kselftest binary - iwamatsu 2. Post LTP results to KernelCI - patersonc * Kernel maintenance updates * Kernel testing * Software update * CIP Security * AOB The meeting will take 30 min, although it can be extended to an hour if it makes sense and those involved in the topics can stay. Otherwise, the topic will be taken offline or in the next meeting. Best regards, -- M. Kudo Cybertrust Japan Co., Ltd.
|
|
Re: [PATCH 4.19.y-cip 2/2] drm: atomic helper: fix W=1 warnings
Nobuhiro Iwamatsu
Hi Pavel,
toggle quoted messageShow quoted text
-----Original Message-----This patch doesn't seem to have been pushed yet. Could you push me? Best regards, Nobuhiro
|
|
Re: [PATCH 4.19.y-cip 01/12] arm64: dts: renesas: r8a774a1-hihope-rzg2m[-ex/-ex-idk-1110wr]: Rename HiHope RZ/G2M boards
Pavel Machek
Hi!
Ok, so this is anti-social: -dtb-$(CONFIG_ARCH_R8A774A1) += r8a774a1-hihope-rzg2m.dtbThis renames dts away, but at the end of series, new dts is created with the r8a774a1-hihope-rzg2m.dts name, but this time it is for rev4 (not rev2) board. So... people with rev2 boards and existing build script will get rev4 dts.. without any error. Would it be better to always require explicit revision in dts/dtb name? Tests are running at https://gitlab.com/cip-project/cip-kernel/linux-cip/tree/ci/pavel/linux-test . Best regards, Pavel -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
|
|
Re: [PATCH 4.19.y-cip 00/12] Support RZ/G2[MN] rev4 board
Pavel Machek
Hi!
This patch series for supporting RZ/G2[MN] rev4 board to cip-4.19.y arch/arm64/boot/dts/renesas/r8a774a1.dtsi | 11 -----------I'm pretty sure this is not the real diffstat. Let me go through the changes. One concern: you are renaming dts files. New names make a lot of sense, but that will likely break the users, including our test infrastructure, no? Best regards, Pavel -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
|
|
[PATCH 4.19.y-cip 04/12] arm64: dts: renesas: Add HiHope RZ/G2M[N] Rev.3.0/4.0 specific into common file
Biju Das <biju.das.jz@...>
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
commit faf1ce7f1ef65af81bd85fe9c70950571cd70b19 upstream. Rev.3.0 and Rev.4.0 are identical and can be identified by using GP5_19 and GP5_21. Rev GP5_19 GP5_21 ============================== Rev.3.0 0 0 Rev.4.0 0 1 This patch creates hihope-rev4.dtsi file with Rev.3.0/4.0 specific changes for HopeRun HiHope RZ/G2M[N] boards. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com> Link: https://lore.kernel.org/r/1593004330-5039-5-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> --- arch/arm64/boot/dts/renesas/hihope-rev4.dtsi | 124 +++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 arch/arm64/boot/dts/renesas/hihope-rev4.dtsi diff --git a/arch/arm64/boot/dts/renesas/hihope-rev4.dtsi b/arch/arm64/boot/dts/renesas/hihope-rev4.dtsi new file mode 100644 index 000000000000..9f869187aea6 --- /dev/null +++ b/arch/arm64/boot/dts/renesas/hihope-rev4.dtsi @@ -0,0 +1,124 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device Tree Source for the HiHope RZ/G2[MN] Rev.3.0/4.0 main board + * common parts + * + * Copyright (C) 2020 Renesas Electronics Corp. + */ + +#include <dt-bindings/gpio/gpio.h> +#include "hihope-common.dtsi" + +/ { + audio_clkout: audio-clkout { + /* + * This is same as <&rcar_sound 0> + * but needed to avoid cs2000/rcar_sound probe dead-lock + */ + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12288000>; + }; + + wlan_en_reg: regulator-wlan_en { + compatible = "regulator-fixed"; + regulator-name = "wlan-en-regulator"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + startup-delay-us = <70000>; + + gpio = <&gpio4 6 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + x1801_clk: x1801-clock { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24576000>; + }; +}; + +&hscif0 { + bluetooth { + compatible = "ti,wl1837-st"; + enable-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>; + }; +}; + +&i2c2 { + pinctrl-0 = <&i2c2_pins>; + pinctrl-names = "default"; + status = "okay"; + + cs2000: clk_multiplier@4f { + #clock-cells = <0>; + compatible = "cirrus,cs2000-cp"; + reg = <0x4f>; + clocks = <&audio_clkout>, <&x1801_clk>; + clock-names = "clk_in", "ref_clk"; + + assigned-clocks = <&cs2000>; + assigned-clock-rates = <24576000>; /* 1/1 divide */ + }; +}; + +&pfc { + i2c2_pins: i2c2 { + groups = "i2c2_a"; + function = "i2c2"; + }; + + sound_clk_pins: sound_clk { + groups = "audio_clk_a_a", "audio_clk_b_a", "audio_clkout_a"; + function = "audio_clk"; + }; + + sound_pins: sound { + groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data_a"; + function = "ssi"; + }; +}; + +&rcar_sound { + pinctrl-0 = <&sound_pins &sound_clk_pins>; + pinctrl-names = "default"; + status = "okay"; + + /* Single DAI */ + #sound-dai-cells = <0>; + + /* audio_clkout0/1/2/3 */ + #clock-cells = <1>; + clock-frequency = <12288000 11289600>; + + /* update <audio_clk_b> to <cs2000> */ + clocks = <&cpg CPG_MOD 1005>, + <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>, + <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>, + <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>, + <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>, + <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>, + <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>, + <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>, + <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>, + <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>, + <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>, + <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>, + <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>, + <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>, + <&audio_clk_a>, <&cs2000>, + <&audio_clk_c>, + <&cpg CPG_CORE CPG_AUDIO_CLK_I>; + + rsnd_port: port { + rsnd_endpoint: endpoint { + remote-endpoint = <&dw_hdmi0_snd_in>; + + dai-format = "i2s"; + bitclock-master = <&rsnd_endpoint>; + frame-master = <&rsnd_endpoint>; + + playback = <&ssi2>; + }; + }; +}; -- 2.17.1
|
|