arm-autonomy: Add support for building/installing an alternate kernel
cover arm-autonomy: Add support for building/installing an alternate kernel
This patch series introduces the support for building and installing an alternate kernel image and modules in an image. The alternate kernel inclusion is controlled via the 'alternate-kernel' DISTRO_FEATURE.
The alternate-kernel.bbclass is to be inherited by image recipes and requires the PREFERRED_PROVIDER_alternate/kernel and KERNEL_PACKAGE_NAME_pn-atlkernel-recipe to be set. The class will also install the kernel-modules package for both virtual/kernel and alternate/kernel.
Also, a patch is introduced in linux-linaro-arm-rt recipe to fix xen behavior in kernels with PREEMPT_RT. The preempt-rt-extras.scc KERNEL_FEATURE was added to linux-linaro-arm-rt in order to accomodate extra kernel configs for arm-autonomy based projects.
For N1SDP machine, all the required settings are done to include the alternate-kernel as well as the GRUB config file to boot it.
The last two patches are fixing an erroneous behavior of the modutils.sh initscript where the depmod command fails to run when the '/' is firstly mounted as ro. A proper investigation will be done with oe-core only, and if it is reproduced with a qemu machine, the fix will be sent to the upstream project.
Diego Sueiro (8):
arm-autonomy/linux-linaro-arm-rt: add linux-RT patch for xen dynamic
events
arm-autonomy/linux-linaro-arm-rt: Add preempt-rt-extras.scc
KERNEL_FEATURE
arm-autonomy/classes: Introduce alternate-kernel.bbclass arm-autonomy/arm-autonomy-host-image-minimal: Build/Install alternate
kernel
arm-autonomy/n1sdp: Add support for building/installing alternate
kernel
arm-autonomy/n1sdp: Add GRUB config when including alternate kernel arm-autonomy/init: Change execution order between modutils.sh and
checkroot.sh
arm-autonomy/modutils-initscripts: Fix modules.dep update
.../classes/alternate-kernel.bbclass | 26 ++++++ .../conf/machine/n1sdp-extra-settings.inc | 44 +++++++++- .../arm-autonomy/preempt-rt-extras.cfg | 7 ++ .../arm-autonomy/preempt-rt-extras.scc | 3 + ...asteoi_irq-to-handle-xen-dynamic-eve.patch | 80 +++++++++++++++++++ .../linux/linux-linaro-arm-rt_5.4.bbappend | 7 ++ .../wic/arm-autonomy-n1sdp-rt-grub.cfg | 28 +++++++ .../images/arm-autonomy-host-image-minimal.bb | 4 + .../initscripts/initscripts_1.0.bbappend | 5 ++ .../modutils-initscripts.bbappend | 6 ++ .../fix-modules-dep-creation.patch | 33 ++++++++ 11 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 meta-arm-autonomy/classes/alternate-kernel.bbclass create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/arm-autonomy-kmeta-extra/features/arm-autonomy/preempt-rt-extras.cfg create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/arm-autonomy-kmeta-extra/features/arm-autonomy/preempt-rt-extras.scc create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-rt-5.4/0001-xen-use-handle_fasteoi_irq-to-handle-xen-dynamic-eve.patch create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-rt_5.4.bbappend create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-rt-grub.cfg create mode 100644 meta-arm-autonomy/recipes-core/initscripts/initscripts_1.0.bbappend create mode 100644 meta-arm-autonomy/recipes-kernel/modutils-initscripts/modutils-initscripts.bbappend create mode 100644 meta-arm-autonomy/recipes-kernel/modutils-initscripts/modutils-initscripts/fix-modules-dep-creation.patch
Signature · 1 line
2.17.1
PATCH 1/8 arm-autonomy/linux-linaro-arm-rt: add linux-RT patch for xen dynamic events
This patch contain following fix:
* xen: use handle_fasteoi_irq to handle xen dynamic events
Change-Id: I0b1734247b151d65ca510a074a5de56e8f8f0ada
Issue-Id: SCM-1654
--- ...asteoi_irq-to-handle-xen-dynamic-eve.patch | 80 +++++++++++++++++++ .../linux/linux-linaro-arm-rt_5.4.bbappend | 5 ++ 2 files changed, 85 insertions(+) create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-rt-5.4/0001-xen-use-handle_fasteoi_irq-to-handle-xen-dynamic-eve.patch create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-rt_5.4.bbappend
meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-rt-5.4/0001-xen-use-handle_fasteoi_irq-to-handle-xen-dynamic-eve.patch new file +80 -0
@@ -0,0 +1,80 @@ +From c2971c8a3f076ea8a522ce4fbb367d112d86c13a Mon Sep 17 00:00:00 2001 +From: Stefano Stabellini <[email protected]> +Date: Mon, 27 Apr 2020 16:15:26 -0700 +Subject: [PATCH] xen: use handle_fasteoi_irq to handle xen dynamic events + +When handling Xen events, we need to make sure the following sequence is +followed: + +- mask event +- handle event and clear event (the order does not matter) +- unmask event + +It is not possible to implement this flow with handle_edge_irq, so +switch back to handle_fasteoi_irq. Please note that Xen event irqs are +ONESHOT. Also note that handle_fasteoi_irq was in-use before the +following commit, that is partially reverted by this patch: + +7e186bdd0098 xen: do not clear and mask evtchns in __xen_evtchn_do_upcall + +PIRQ handling is left unchanged. + +This patch fixes a domU hang observed when using LinuxRT as dom0 kernel. + +Link: https://lkml.org/lkml/2020/4/27/1287 +Signed-off-by: Stefano Stabellini <[email protected]> + +Upstream-Status: Inappropriate since the upstream solution diverges from this patch +Signed-off-by: Kamil Dziezyk <[email protected]> +--- + drivers/xen/events/events_base.c | 13 +++---------- + 1 file changed, 3 insertions(+), 10 deletions(-) + +diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c +index 6c8843968a52..1873a19b8b24 100644 +--- a/drivers/xen/events/events_base.c ++++ b/drivers/xen/events/events_base.c +@@ -845,7 +845,7 @@ int bind_evtchn_to_irq(unsigned int evtchn) + goto out; + + irq_set_chip_and_handler_name(irq, &xen_dynamic_chip, +- handle_edge_irq, "event"); ++ handle_fasteoi_irq, "event"); + + ret = xen_irq_info_evtchn_setup(irq, evtchn); + if (ret < 0) { +@@ -978,7 +978,7 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu, bool percpu) + handle_percpu_irq, "virq"); + else + irq_set_chip_and_handler_name(irq, &xen_dynamic_chip, +- handle_edge_irq, "virq"); ++ handle_fasteoi_irq, "virq"); + + bind_virq.virq = virq; + bind_virq.vcpu = xen_vcpu_nr(cpu); +@@ -1387,12 +1387,6 @@ static void ack_dynirq(struct irq_data *data) + clear_evtchn(evtchn); + } + +-static void mask_ack_dynirq(struct irq_data *data) +-{ +- disable_dynirq(data); +- ack_dynirq(data); +-} +- + static int retrigger_dynirq(struct irq_data *data) + { + unsigned int evtchn = evtchn_from_irq(data->irq); +@@ -1595,8 +1589,7 @@ static struct irq_chip xen_dynamic_chip __read_mostly = { + .irq_mask = disable_dynirq, + .irq_unmask = enable_dynirq, + +- .irq_ack = ack_dynirq, +- .irq_mask_ack = mask_ack_dynirq, ++ .irq_eoi = ack_dynirq, + + .irq_set_affinity = set_affinity_irq, + .irq_retrigger = retrigger_dynirq, +-- +2.17.1 +
meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-rt_5.4.bbappend new file +5 -0
@@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-5.4:" + +SRC_URI_append = " \ + file://0001-xen-use-handle_fasteoi_irq-to-handle-xen-dynamic-eve.patch \ + "
Signature · 1 line
2.17.1
PATCH 2/8 arm-autonomy/linux-linaro-arm-rt: Add preempt-rt-extras.scc KERNEL_FEATURE
In reply to Diego SueiroFor now, when building the linux-linaro-arm-rt recipe we want these extra settings:CONFIG_NLS_CODEPAGE_437=yCONFIG_NLS_ISO8859_1=yCONFIG_HZ_1000=y
Change-Id: I23573a2b5be512b7a84c71bc50a1a63b2d95dffb
Issue-Id: SCM-1654
--- .../features/arm-autonomy/preempt-rt-extras.cfg | 7 +++++++ .../features/arm-autonomy/preempt-rt-extras.scc | 3 +++ .../recipes-kernel/linux/linux-linaro-arm-rt_5.4.bbappend | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/arm-autonomy-kmeta-extra/features/arm-autonomy/preempt-rt-extras.cfg create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/arm-autonomy-kmeta-extra/features/arm-autonomy/preempt-rt-extras.scc
meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/arm-autonomy-kmeta-extra/features/arm-autonomy/preempt-rt-extras.cfg new file +7 -0
@@ -0,0 +1,7 @@ +# Yocto kernel-cache sets CONFIG_NLS_CODEPAGE_437=m for LINUX_KERNEL_TYPR=preempt-rt +CONFIG_NLS_CODEPAGE_437=y +# Yocto kernel-cache sets CONFIG_NLS_ISO8859_1=m for LINUX_KERNEL_TYPR=preempt-rt +CONFIG_NLS_ISO8859_1=y + +# Set the timer interrupt run at 1000 Hz to have a fast response +CONFIG_HZ_1000=y
meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/arm-autonomy-kmeta-extra/features/arm-autonomy/preempt-rt-extras.scc new file +3 -0
@@ -0,0 +1,3 @@ +define KFEATURE_DESCRIPTION "Extra kernel configs when building with PREEMPT_RT" + +kconf non-hardware preempt-rt-extras.cfg
meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-rt_5.4.bbappend +2 -0
@@ -3,3 +3,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-5.4:" SRC_URI_append = " \ file://0001-xen-use-handle_fasteoi_irq-to-handle-xen-dynamic-eve.patch \ " + +KERNEL_FEATURES += "features/arm-autonomy/preempt-rt-extras.scc"
Signature · 1 line
2.17.1
PATCH 3/8 arm-autonomy/classes: Introduce alternate-kernel.bbclass
In reply to Diego SueiroThe alternate-kernel.bbclass is to be inherited by image recipes that want to build and install an alternate kernel (set via PREFERRED_PROVIDER_alternate/kernel).
It is mandatory to also set the KERNEL_PACKAGE_NAME for the alternate kernel recipe via KERNEL_PACKAGE_NAME_pn-${PREFERRED_PROVIDER_alternate/kernel} and its value needs to be different from "kernel" since this is the default set for PREFERRED_PROVIDER_virtual/kernel.
When building and installing an alternate kernel, the kernel-modules packages for both virtual/kernel and alternate/kernel will be installed.
Change-Id: I1cd0c425c39206fe449fb5f8761ed6de95cfb442
Issue-Id: SCM-1654
--- .../classes/alternate-kernel.bbclass | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 meta-arm-autonomy/classes/alternate-kernel.bbclass
meta-arm-autonomy/classes/alternate-kernel.bbclass new file +26 -0
@@ -0,0 +1,26 @@ +# This class is to be inherited by image recipes that want to build and install +# an alternate kernel (set via PREFERRED_PROVIDER_alternate/kernel). +# +# It is mandatory to also set the KERNEL_PACKAGE_NAME for the alternate kernel +# recipe via KERNEL_PACKAGE_NAME_pn-${PREFERRED_PROVIDER_alternate/kernel} and +# its value needs to be different from "kernel" since this is the default set +# for PREFERRED_PROVIDER_virtual/kernel. +# +# An example of these settings can be found at meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc +# +# When building and installing an alternate kernel, the kernel-modules packages +# for both virtual/kernel and alternate/kernel will be installed. + +PREFERRED_PROVIDER_alternate/kernel ??= "" + +python () { + alternate_kernel = d.getVar('PREFERRED_PROVIDER_alternate/kernel') + if alternate_kernel: + alternate_kernel_pkg_name = d.getVar('KERNEL_PACKAGE_NAME_pn-%s' % alternate_kernel) + if alternate_kernel_pkg_name: + d.appendVar('EXTRA_IMAGEDEPENDS', ' ' + alternate_kernel) + d.appendVar('IMAGE_INSTALL', ' kernel-modules') + d.appendVar('IMAGE_INSTALL', ' ' + alternate_kernel_pkg_name + '-modules') + else: + raise bb.parse.SkipRecipe("No KERNEL_PACKAGE_NAME_pn-%s set" % alternate_kernel ) +}
Signature · 1 line
2.17.1
PATCH 4/8 arm-autonomy/arm-autonomy-host-image-minimal: Build/Install alternate kernel
In reply to Diego SueiroThis patch introduces the usage of the alternate-kernel DISTRO_FEATURE, and when it is present we will build and install the alternate kernel set via PREFERRED_PROVIDER_alternate/kernel.
Change-Id: I1fe7447a5f903d7ff5584813bfb38fca8979e755
Issue-Id: SCM-1654
--- .../recipes-core/images/arm-autonomy-host-image-minimal.bb | 4 ++++ 1 file changed, 4 insertions(+)
meta-arm-autonomy/recipes-core/images/arm-autonomy-host-image-minimal.bb +4 -0
@@ -2,6 +2,10 @@ DESCRIPTION = "Arm Autonomy stack host minimal image" +# When alternate-kernel DISTRO_FEATURE is present we will build +# and install the alternate kernel +inherit ${@bb.utils.filter('DISTRO_FEATURES', 'alternate-kernel', d)} + inherit core-image LICENSE = "MIT"
Signature · 1 line
2.17.1
PATCH 5/8 arm-autonomy/n1sdp: Add support for building/installing alternate kernel
In reply to Diego SueiroFor N1SDP as arm-autonomy-host, when alternate-kernel DISTRO_FEATURE is present we build the linux-linaro-arm-rt (with PREEMPT_RT support) by setting it as the PREFERRED_PROVIDER_alternate/kernel. As required, we set the KERNEL_PACKAGE_NAME_pn-linux-linaro-arm-rt to kernel-rt.
Also, include the alternate kernel binary as Image-preempt-rt in the boot partition of the generated wic image by setting the IMAGE_EFI_BOOT_FILES variable.
Change-Id: I205caf5ef8b8d6b8a37ec3f4d0981fe8736cae63
Issue-Id: SCM-1654
--- .../conf/machine/n1sdp-extra-settings.inc | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+)
meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc +22 -0
@@ -38,3 +38,25 @@ do_image_wic[depends] += "xen:do_deploy" IMAGE_EFI_BOOT_FILES += "xen-n1sdp.efi;xen.efi" IMAGE_EFI_BOOT_FILES += "${XEN_MOD_DEVICETREE_DTBS}" +# When alternate-kernel DISTRO_FEATURE is present we set the linux-linaro-arm-rt +# by default +PREFERRED_PROVIDER_alternate/kernel ?= "\ +${@bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', \ +'linux-linaro-arm-rt', '', d)}" + +KERNEL_PACKAGE_NAME_alternate/kernel ?= "kernel-rt" +# When alternate-kernel DISTRO_FEATURE is present we set the kernel-rt by +# default +KERNEL_PACKAGE_NAME_pn-linux-linaro-arm-rt = "\ +${@ d.getVar('KERNEL_PACKAGE_NAME_alternate/kernel') \ +if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) \ +else 'kernel' }" + +# Relative path from DEPLOY_DIR_IMAGE of the Kernel PREEMPT_RT deployed Image +KERNEL_RT_IMAGE ?= "kernel-rt/Image-n1sdp.bin;Image-preempt-rt" +# Only include the Kernel PREEMPT_RT Image if we are building with +# alternate-kernel DISTRO_FEATURE +IMAGE_EFI_BOOT_FILES += "\ +${@ d.getVar('KERNEL_RT_IMAGE',d) or '' \ +if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \ +d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}"
Signature · 1 line
2.17.1
PATCH 6/8 arm-autonomy/n1sdp: Add GRUB config when including alternate kernel
In reply to Diego SueiroFor N1SDP as arm-autonomy-host, when alternate-kernel DISTRO_FEATURE is present we set, as GRUB config, the arm-autonomy-n1sdp-rt-grub.cfg which includes additional entries for booting with the PREEMPT_RT kernel.
Change-Id: If40aee159ae5ba0efd3d9a5a16ee1c1167fb0504
Issue-Id: SCM-1654
--- .../conf/machine/n1sdp-extra-settings.inc | 22 ++++++++++++++- .../wic/arm-autonomy-n1sdp-rt-grub.cfg | 28 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-rt-grub.cfg
meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc +21 -1
@@ -15,7 +15,14 @@ GUEST_PART_SIZE ?= "4097" GUEST_PART_SIZE_UNIT ?= "M" # The GRUB_CFG_FILE affects arm-autonomy-n1sdp-efidisk.wks.in file -GRUB_CFG_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg" +# +# When alternate-kernel DISTRO_FEATURE is present we set the +# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has +# additional entries for booting with the PREEMPT_RT kernel. +GRUB_CFG_FILE ?= "${@bb.utils.contains('DISTRO_FEATURES','alternate-kernel', \ + '${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-rt-grub.cfg', \ + '${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg' \ + , d)}" # From arm-autonomy-n1sdp-efidisk.wks.in, the /boot partition is /dev/sda1, and # the "/" partition is /dev/sda2.
@@ -60,3 +67,16 @@ IMAGE_EFI_BOOT_FILES += "\ ${@ d.getVar('KERNEL_RT_IMAGE',d) or '' \ if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \ d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}" + + +EFIDIR ?= "/EFI/BOOT" +GRUB_CFG_EXTRA_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg;.${EFIDIR}}" + +# When alternate-kernel DISTRO_FEATURE is present we set the +# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has +# additional entries for booting with the PREEMPT_RT kernel and also includes +# the main GRUB config file set by GRUB_CFG_EXTRA_FILE. +IMAGE_EFI_BOOT_FILES += "\ +${@ d.getVar('GRUB_CFG_EXTRA_FILE',d) or '' \ +if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \ +d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}"
meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-rt-grub.cfg new file +28 -0
@@ -0,0 +1,28 @@ +set term="vt100" +set default="3" +set timeout="5" + +source $prefix/arm-autonomy-n1sdp-grub.cfg + +menuentry 'N1SDP PREEMPT_RT ACPI Boot' { + linux /Image-preempt-rt $kernel_cmdline acpi=force +} + +menuentry 'N1SDP PREEMPT_RT Single-Chip Boot (Device Tree)' { + devicetree /n1sdp-single-chip.dtb + linux /Image-preempt-rt $kernel_cmdline +} + +menuentry 'N1SDP PREEMPT_RT Multi-Chip Boot (Device Tree)' { + devicetree /n1sdp-multi-chip.dtb + linux /Image-preempt-rt $kernel_cmdline +} + +menuentry 'N1SDP PREEMPT_RT Arm Autonomy (Xen) Single-Chip Boot (Device Tree)' { + # no_argumants under here is a workaround for a bug + # also any kernel or dom0 cmdline arguments has to be passed via dtb + # because any arguments put here will be ignored by xen + xen_hypervisor /xen.efi no_arguments=use_dtb_for_xen_or_kernel_cmdline + xen_module /Image-preempt-rt + devicetree /n1sdp-single-chip-xen.dtb +}
Signature · 1 line
2.17.1
PATCH 7/8 arm-autonomy/init: Change execution order between modutils.sh and checkroot.sh
In reply to Diego SueiroWhen '/' is first mounted as read-only, we want to have the checkroot.sh initscript (which then remounts '/' as rw if allowed) running before the modutils.sh.
This is because modutils.sh initscript might need to run depmod depending on the status of the modules.dep file to update it and the '/' needs to be writable.
Change-Id: Idac9aa19fba6b6bf46532097a667ce0518af515c
Issue-Id: SCM-1654
--- .../recipes-core/initscripts/initscripts_1.0.bbappend | 5 +++++ .../modutils-initscripts/modutils-initscripts.bbappend | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 meta-arm-autonomy/recipes-core/initscripts/initscripts_1.0.bbappend create mode 100644 meta-arm-autonomy/recipes-kernel/modutils-initscripts/modutils-initscripts.bbappend
meta-arm-autonomy/recipes-core/initscripts/initscripts_1.0.bbappend new file +5 -0
@@ -0,0 +1,5 @@ +do_install_append() { + # We want to have checkroot.sh running before modutils.sh (06) + update-rc.d -r ${D} -f checkroot.sh remove + update-rc.d -r ${D} checkroot.sh start 05 S . +}
meta-arm-autonomy/recipes-kernel/modutils-initscripts/modutils-initscripts.bbappend new file +2 -0
@@ -0,0 +1,2 @@ +# We want to have modutils.sh running after checkroot.sh (05) +INITSCRIPT_PARAMS = "start 06 S ."
Signature · 1 line
2.17.1
PATCH 8/8 arm-autonomy/modutils-initscripts: Fix modules.dep update
In reply to Diego SueiroWhen building an image with USE_DEPMOD="0" we expect that on the first boot the modutils.sh initscript will create the modules.dep file if it is empty or not present.
Change-Id: I0048dc47f807587e723c068b0a4ba24718d66f49
Issue-Id: SCM-1654
--- .../modutils-initscripts.bbappend | 4 +++ .../fix-modules-dep-creation.patch | 33 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 meta-arm-autonomy/recipes-kernel/modutils-initscripts/modutils-initscripts/fix-modules-dep-creation.patch
meta-arm-autonomy/recipes-kernel/modutils-initscripts/modutils-initscripts.bbappend +4 -0
@@ -1,2 +1,6 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_append = " file://fix-modules-dep-creation.patch" + # We want to have modutils.sh running after checkroot.sh (05) INITSCRIPT_PARAMS = "start 06 S ."
meta-arm-autonomy/recipes-kernel/modutils-initscripts/modutils-initscripts/fix-modules-dep-creation.patch new file +33 -0
@@ -0,0 +1,33 @@ +When building an image with USE_DEPMOD="0" we expect that on the first boot the +modutils.sh initscript to create the modules.dep file if it is empty or not +present. + +Upstream-Status: Pending +Signed-off-by: Diego Sueiro <[email protected]> + +diff --git a/modutils.sh b/modutils.sh +index a78adf5729..4afd12a9fe 100755 +--- a/modutils.sh ++++ b/modutils.sh +@@ -13,14 +13,17 @@ + + LOAD_MODULE=modprobe + [ -f /proc/modules ] || exit 0 +-[ -f /etc/modules ] || [ -d /etc/modules-load.d ] || exit 0 +-[ -e /sbin/modprobe ] || LOAD_MODULE=insmod + +-if [ ! -f /lib/modules/`uname -r`/modules.dep ]; then ++# Test if modules.dep exists and has a size greater than zero ++if [ ! -s /lib/modules/`uname -r`/modules.dep ]; then + [ "$VERBOSE" != no ] && echo "Calculating module dependencies ..." +- depmod -Ae ++ depmod -ae + fi + ++[ -f /etc/modules ] || [ -d /etc/modules-load.d ] || exit 0 ++[ -e /sbin/modprobe ] || LOAD_MODULE=insmod ++ ++ + loaded_modules=" " + + process_file() {
Signature · 1 line
2.17.1
Quoted 14 lines · Diego Sueiro
This patch series introduces the support for building and installing an alternate kernel image and modules in an image. The alternate kernel inclusion is controlled via the 'alternate-kernel'
DISTRO_FEATURE.The alternate-kernel.bbclass is to be inherited by image recipes and requires the PREFERRED_PROVIDER_alternate/kernel and KERNEL_PACKAGE_NAME_pn-atlkernel-recipe to be set. The class will also install the kernel-modules package for both virtual/kernel and alternate/kernel.
Also, a patch is introduced in linux-linaro-arm-rt recipe to fix xen behavior in kernels with
PREEMPT_RT. The preempt-rt-extras.sccKERNEL_FEATUREwas added to linux-linaro-arm-rt in order to accomodate extra kernel configs for arm-autonomy based projects.
Quoted 9 lines
For N1SDP machine, all the required settings are done to include the alternate-kernel as well as the GRUB config file to boot it.
The last two patches are fixing an erroneous behavior of the
modutils.shinitscript where the depmod command fails to run when the '/' is firstly mounted as ro. A proper investigation will be done with oe-core only, and if it is reproduced with a qemu machine, the fix will be sent to the upstream project.
Series applied to master.
Thanks,
Jon
Quoted 45 lines
Diego Sueiro (8):
arm-autonomy/linux-linaro-arm-rt: add linux-RT patch for xen dynamic
events
arm-autonomy/linux-linaro-arm-rt: Add preempt-rt-extras.scc
KERNEL_FEATURE
arm-autonomy/classes: Introduce alternate-kernel.bbclass arm-autonomy/arm-autonomy-host-image-minimal: Build/Install alternate
kernel
arm-autonomy/n1sdp: Add support for building/installing alternate
kernel
arm-autonomy/n1sdp: Add GRUB config when including alternate kernel arm-autonomy/init: Change execution order betweenmodutils.shand
checkroot.sh
arm-autonomy/modutils-initscripts: Fix modules.dep update.../classes/alternate-kernel.bbclass | 26 ++++++ .../conf/machine/n1sdp-extra-settings.inc | 44 +++++++++- .../arm-autonomy/preempt-rt-extras.cfg | 7 ++ .../arm-autonomy/preempt-rt-extras.scc | 3 + ...asteoi_irq-to-handle-xen-dynamic-eve.patch | 80 +++++++++++++++++++ .../linux/linux-linaro-arm-rt_5.4.bbappend | 7 ++ .../wic/arm-autonomy-n1sdp-rt-grub.cfg | 28 +++++++ .../images/arm-autonomy-host-image-minimal.bb | 4 + .../initscripts/initscripts_1.0.bbappend | 5 ++ .../modutils-initscripts.bbappend | 6 ++ .../fix-modules-dep-creation.patch | 33 ++++++++ 11 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 meta-arm-autonomy/classes/alternate-kernel.bbclass create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/arm-autonomy-kmeta-extra/features/arm-autonomy/preempt-rt-extras.cfg create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/arm-autonomy-kmeta-extra/features/arm-autonomy/preempt-rt-extras.scc create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-rt-5.4/0001-xen-use-handle_fasteoi_irq-to-handle-xen-dynamic-eve.patch create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-rt_5.4.bbappend create mode 100644 meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic/arm-autonomy-n1sdp-rt-grub.cfg create mode 100644 meta-arm-autonomy/recipes-core/initscripts/initscripts_1.0.bbappend create mode 100644 meta-arm-autonomy/recipes-kernel/modutils-initscripts/modutils-initscripts.bbappend create mode 100644 meta-arm-autonomy/recipes-kernel/modutils-initscripts/modutils-initscripts/fix-modules-dep-creation.patchSignature · 1 line
2.17.1