Debian: Support multi-drivers in initramfs

Remove the network drivers ice, i40e and iavf if multi-drivers-switch
is set in cmdline,  which ensures that ice, i40e and iavf drivers will
not be loaded during initramfs stage.

pxe-network-installer will not be impacted because the parameter
multi-drivers-switch is not set in this stage.

We need do the following steps to switch to the legacy drivers.
1. Add /etc/depmod.d/multi-drivers.conf.
   cat /etc/depmod.d/multi-drivers.conf
   override ice      * extra/ice-1.8.3.1.2
   override i40e     * extra/i40e-2.18.9
   override iavf     * extra/iavf-4.4.2
2. depmod
3. Add cmdline parameter multi-drivers-switch=1
4. reboot

Do the following steps to switch back to the latest drivers.
1. Modify /etc/depmod.d/multi-drivers.conf.
   cat /etc/depmod.d/multi-drivers.conf
   override ice      * updates/ice
   override i40e     * updates/i40e
   override iavf     * updates/iavf
2. depmod
3. reboot

Testing:
- An ISO image can be built out successfully.
- PXE network install success onto a All-in-One Duplex lab with rt
  and std kernel.
- Drivers will not be loaded in initramfs stage.
- Latest driver versions are loaded by default and ddp version correct.
  It is 1.3.30.0.
- It can switch to the legacy drivers manually with
  /etc/depmod.d/multi-driver.conf and cmdline parameter
  multi-drivers-switch=1, ddp version is 1.3.28.0.

Story: 2010326
Task: 46438

Depends-On: https://review.opendev.org/c/starlingx/kernel/+/859519
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
Change-Id: If86e8280011bfef97ec54ad5b47959a6128a4eb5
This commit is contained in:
Jiping Ma 2022-09-26 22:43:36 -07:00
parent 575ba42515
commit 1ac6d8adc9
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,38 @@
From 21919ca120e0693419c3b97fb442edf040f660f2 Mon Sep 17 00:00:00 2001
From: Jiping Ma <jiping.ma2@windriver.com>
Date: Thu, 15 Sep 2022 02:48:39 -0700
Subject: [PATCH] Support multi-drivers in initramfs.
Remove the network drivers ice, i40e and iavf if multi-drivers-switch
is set in cmdline, which ensures that ice, i40e and iavf drivers will
not be loaded during initramfs stage.
pxe-network-installer will not be impacted because the parameter
multi-drivers-switch is not set in this stage.
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
---
init-ostree.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/init-ostree.sh b/init-ostree.sh
index 6017fcf..b0d46a1 100644
--- a/init-ostree.sh
+++ b/init-ostree.sh
@@ -167,6 +167,13 @@ fatal() {
early_setup
+if grep -s -q '\smulti-drivers-switch=' /proc/cmdline ; then
+ rm -r /lib/modules/*/updates/ice
+ rm -r /lib/modules/*/updates/i40e
+ rm -r /lib/modules/*/updates/iavf
+ echo "Removed network drivers ice, i40e and iavf"
+fi
+
read_args
[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
--
2.35.1

View File

@ -5,3 +5,4 @@
0005-Wait-for-devices-to-be-configured-after-boot.patch
0006-init-ostree-install.sh-break-hardlinks-in-var.patch
0007-Add-support-for-StarlingX-partitioning-formatting.patch
0008-Support-multi-drivers-in-initramfs.patch