Skip to content

Commit c3a089c

Browse files
saiarcot895yanmarkmanrohinikumarttirupatihemanth
authored
Update to 6.12.41 for Debian Trixie (#488)
Update the kernel to 6.12.41, part of the 6.12 series kernel used in Debian Trixie. Additionally, with this, integrate SONiC-specific configs and patches into the build infra that Debian has set up for doing builds of different flavors and architectures of the kernel. There is room in that infra for downstream distributions to add in their own configs and patches. SONiC will use that portion of the infra to set custom kernel configs and include our patches there. --------- Signed-off-by: Saikrishna Arcot <[email protected]> Signed-off-by: Yan Markman <[email protected]> Co-authored-by: Yan Markman <[email protected]> Co-authored-by: Tharigonda Rohini Kumar <[email protected]> Co-authored-by: Hemanth Kumar Tirupati <[email protected]>
1 parent 255dc52 commit c3a089c

File tree

269 files changed

+16512
-11300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+16512
-11300
lines changed

.azure-pipelines/build-template.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,37 @@ parameters:
1717
type: string
1818
values:
1919
- sonicso1ES-amd64
20-
- sonicbld_8c
2120
- sonicso1ES-arm64
2221
- sonicso1ES-armhf
2322
default: sonicso1ES-amd64
2423

2524
- name: timeout
2625
type: number
27-
default: 600
26+
default: 180
2827

2928
- name: sonic_slave
3029
type: string
3130

31+
- name: old_artifact_name
32+
type: string
33+
34+
- name: old_linux_deb_pattern
35+
type: string
36+
3237
- name: artifact_name
3338
type: string
3439

3540
- name: linux_deb_pattern
3641
type: string
3742

43+
- name: secure_boot
44+
type: boolean
45+
default: false
46+
3847
jobs:
3948
- job:
4049
pool: ${{ parameters.pool }}
41-
displayName: ${{ parameters.platform }}-${{ parameters.arch }}
50+
displayName: ${{ parameters.platform }}-${{ parameters.arch }} (Secure boot ${{ parameters.secure_boot }})
4251
timeoutInMinutes: ${{ parameters.timeout }}
4352

4453
container:
@@ -53,20 +62,27 @@ jobs:
5362
source: specific
5463
project: build
5564
pipelineId: 499053
56-
artifact: ${{ parameters.artifact_name }}
65+
artifact: ${{ parameters.old_artifact_name }}
5766
runVersion: 'specific'
58-
itemPattern: ${{ parameters.linux_deb_pattern }}
67+
itemPattern: ${{ parameters.old_linux_deb_pattern }}
5968
targetPath: $(Agent.TempDirectory)/
6069
displayName: "Download the linux-image artifact from the last build with a different kernel version"
6170
- script: |
62-
git config --global user.email "[email protected]"
63-
git config --global user.name "Guohan Lu"
64-
export kernel_procure_method=build
71+
openssl req -new -noenc -utf8 -sha256 -days 30 -batch -x509 -subj "/CN=Autogenerated pipeline build key" -outform PEM -out build_trusted_key.pem -keyout /dev/null
72+
displayName: "Generate additional secure boot certificate"
73+
condition: ${{ eq(parameters.secure_boot, true) }}
74+
- script: |
75+
set -x
6576
cat /proc/cpuinfo
77+
if [[ ${{ parameters.secure_boot }} = "True" ]]; then
78+
export SECURE_UPGRADE_MODE=dev
79+
export SECURE_UPGRADE_SIGNING_CERT=$(System.DefaultWorkingDirectory)/build_trusted_key.pem
80+
fi
6681
CONFIGURED_ARCH=${{ parameters.arch }} CONFIGURED_PLATFORM=${{ parameters.platform }} make
6782
displayName: "Compile sonic kernel"
6883
- script: |
69-
dpkg-deb -x $(Agent.TempDirectory)/${{ parameters.linux_deb_pattern }} $(Agent.TempDirectory)/old
84+
set -e
85+
dpkg-deb -x $(Agent.TempDirectory)/${{ parameters.old_linux_deb_pattern }} $(Agent.TempDirectory)/old
7086
dpkg-deb -x $(System.DefaultWorkingDirectory)/${{ parameters.linux_deb_pattern }} $(Agent.TempDirectory)/new
7187
pip3 install tabulate
7288
python3 $(System.DefaultWorkingDirectory)/.azure-pipelines/kcfg-diff.py \

Makefile

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
11
.ONESHELL:
22
SHELL = /bin/bash
3-
.SHELLFLAGS += -e
3+
.SHELLFLAGS += -ex
44

5-
KERNEL_ABI_MINOR_VERSION = 2
6-
KVERSION_SHORT ?= 6.1.0-29-$(KERNEL_ABI_MINOR_VERSION)
7-
KVERSION ?= $(KVERSION_SHORT)-amd64
8-
KERNEL_VERSION ?= 6.1.123
5+
KERNEL_VERSION ?= 6.12.41
6+
KERNEL_ABISUFFIX ?= +deb13
97
KERNEL_SUBVERSION ?= 1
8+
KERNEL_FEATURESET ?= sonic
109
CONFIGURED_ARCH ?= amd64
1110
CONFIGURED_PLATFORM ?= vs
11+
CROSS_BUILD_ENVIRON ?= n
12+
SONIC_CONFIG_MAKE_JOBS ?= $(shell nproc)
13+
KVERSION_SHORT := $(KERNEL_VERSION)$(KERNEL_ABISUFFIX)-$(KERNEL_FEATURESET)
14+
ifeq ($(CONFIGURED_ARCH), armhf)
15+
# Override kernel version for ARMHF as it uses arm MP (multi-platform) for short version
16+
KVERSION ?= $(KVERSION_SHORT)-armmp
17+
else
18+
KVERSION ?= $(KVERSION_SHORT)-$(CONFIGURED_ARCH)
19+
endif
1220
SECURE_UPGRADE_MODE ?=
1321
SECURE_UPGRADE_SIGNING_CERT ?=
1422
SECURE_UPGRADE_KERNEL_CAFILE ?= $(SECURE_UPGRADE_SIGNING_CERT)
1523

16-
LINUX_HEADER_COMMON = linux-headers-$(KVERSION_SHORT)-common_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_all.deb
17-
LINUX_HEADER_AMD64 = linux-headers-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_$(CONFIGURED_ARCH).deb
24+
LINUX_HEADER_COMMON = linux-headers-$(KERNEL_VERSION)$(KERNEL_ABISUFFIX)-common-$(KERNEL_FEATURESET)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_all.deb
25+
LINUX_HEADER_ARCH = linux-headers-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_$(CONFIGURED_ARCH).deb
26+
LINUX_KBUILD = linux-kbuild-$(KERNEL_VERSION)$(KERNEL_ABISUFFIX)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_$(CONFIGURED_ARCH).deb
1827
ifeq ($(CONFIGURED_ARCH), armhf)
1928
LINUX_IMAGE = linux-image-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_$(CONFIGURED_ARCH).deb
29+
KERNEL_FLAVOR_ARCH=armmp
2030
else
2131
LINUX_IMAGE = linux-image-$(KVERSION)-unsigned_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_$(CONFIGURED_ARCH).deb
32+
KERNEL_FLAVOR_ARCH=$(CONFIGURED_ARCH)
2233
endif
2334

2435
MAIN_TARGET = $(LINUX_HEADER_COMMON)
25-
DERIVED_TARGETS = $(LINUX_HEADER_AMD64) $(LINUX_IMAGE)
36+
DERIVED_TARGETS = $(LINUX_HEADER_ARCH) $(LINUX_IMAGE) $(LINUX_KBUILD)
2637

2738
DSC_FILE = linux_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION).dsc
2839
DEBIAN_FILE = linux_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION).debian.tar.xz
@@ -71,49 +82,26 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
7182
dpkg-source -x $(DSC_FILE)
7283

7384
pushd $(BUILD_DIR)
74-
git init
75-
git add -f *
76-
git commit -qm "check in all loose files and diffs"
7785

78-
# patching anything that could affect following configuration generation.
79-
stg init
80-
stg import -s ../patch/preconfig/series
86+
cp -vr ../config.local ../patches-sonic debian/
87+
if [[ -f debian/config.local/$(CONFIGURED_ARCH)/config.sonic-$(CONFIGURED_PLATFORM) ]]; then
88+
cp debian/config.local/$(CONFIGURED_ARCH)/config.sonic-$(CONFIGURED_PLATFORM) debian/config.local/$(CONFIGURED_ARCH)/config.sonic-platform-specific
89+
fi
90+
91+
patch -p1 -i ../patches-debian/disable-secureboot-config-checks.patch
92+
93+
# Enable secure boot configs if needed
94+
../manage-config $(CONFIGURED_ARCH) $(SECURE_UPGRADE_MODE) $(SECURE_UPGRADE_KERNEL_CAFILE)
8195

82-
# re-generate debian/rules.gen, requires kernel-wedge
96+
# re-generate debian packages and rules with SONiC customizations
8397
debian/bin/gencontrol.py
8498

85-
# generate linux build file for amd64_none_amd64
86-
DEB_HOST_ARCH=armhf fakeroot make -f debian/rules.gen setup_armhf_none_armmp
87-
DEB_HOST_ARCH=arm64 fakeroot make -f debian/rules.gen setup_arm64_none_arm64
88-
DEB_HOST_ARCH=amd64 fakeroot make -f debian/rules.gen setup_amd64_none_amd64
89-
90-
# Applying patches and configuration changes
91-
git add debian/build/build_armhf_none_armmp/.config -f
92-
git add debian/build/build_arm64_none_arm64/.config -f
93-
git add debian/build/build_amd64_none_amd64/.config -f
94-
git add debian/config.defines.dump -f
95-
git add debian/control -f
96-
git add debian/rules.gen -f
97-
git add debian/tests/control -f
98-
git add debian/*.maintscript -f
99-
git add debian/*.bug-presubj -f
100-
git commit -m "unmodified debian source"
101-
102-
# Learning new git repo head (above commit) by calling stg repair.
103-
stg repair
104-
stg import -s ../patch/series
105-
106-
# Optionally add/remove kernel options
107-
if [ -f ../manage-config ]; then
108-
../manage-config $(CONFIGURED_ARCH) $(CONFIGURED_PLATFORM) $(SECURE_UPGRADE_MODE) $(SECURE_UPGRADE_KERNEL_CAFILE)
109-
fi
99+
# TODO(trixie): Make a way to verify that our configs are being set
110100

111-
# Building a custom kernel from Debian kernel source
112-
ARCH=$(CONFIGURED_ARCH) DEB_HOST_ARCH=$(CONFIGURED_ARCH) DEB_BUILD_PROFILES=nodoc fakeroot make -f debian/rules -j $(shell nproc) binary-indep
113-
ifeq ($(CONFIGURED_ARCH), armhf)
114-
ARCH=$(CONFIGURED_ARCH) DEB_HOST_ARCH=$(CONFIGURED_ARCH) fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_$(CONFIGURED_ARCH)_none_armmp
101+
ifeq ($(CROSS_BUILD_ENVIRON), y)
102+
dpkg-buildpackage -b -us -uc -a$(CONFIGURED_ARCH) -Pcross,nocheck,nodoc -j$(SONIC_CONFIG_MAKE_JOBS)
115103
else
116-
ARCH=$(CONFIGURED_ARCH) DEB_HOST_ARCH=$(CONFIGURED_ARCH) fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_$(CONFIGURED_ARCH)_none_$(CONFIGURED_ARCH)
104+
dpkg-buildpackage -b -us -uc -Pnodoc -j$(SONIC_CONFIG_MAKE_JOBS)
117105
endif
118106
popd
119107

azure-pipelines.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,52 @@ stages:
1515
- template: .azure-pipelines/build-template.yml
1616
parameters:
1717
arch: amd64
18-
sonic_slave: sonic-slave-bookworm
19-
artifact_name: sonic-linux-kernel
18+
pool: sonicso1ES-amd64
19+
sonic_slave: sonic-slave-trixie
20+
old_artifact_name: sonic-linux-kernel
21+
artifact_name: sonic-linux-kernel.amd64
22+
old_linux_deb_pattern: linux-image-*-unsigned_*deb
2023
linux_deb_pattern: linux-image-*-unsigned_*deb
2124

25+
- template: .azure-pipelines/build-template.yml
26+
parameters:
27+
arch: amd64
28+
pool: sonicso1ES-amd64
29+
sonic_slave: sonic-slave-trixie
30+
old_artifact_name: sonic-linux-kernel
31+
artifact_name: sonic-linux-kernel.amd64.secure
32+
old_linux_deb_pattern: linux-image-*-unsigned_*deb
33+
linux_deb_pattern: linux-image-*-unsigned_*deb
34+
secure_boot: true
35+
2236
- template: .azure-pipelines/build-template.yml
2337
parameters:
2438
arch: arm64
2539
pool: sonicso1ES-arm64
26-
sonic_slave: sonic-slave-bookworm-arm64
40+
sonic_slave: sonic-slave-trixie-arm64
41+
old_artifact_name: sonic-linux-kernel.arm64
2742
artifact_name: sonic-linux-kernel.arm64
43+
old_linux_deb_pattern: linux-image-*-unsigned_*deb
2844
linux_deb_pattern: linux-image-*-unsigned_*deb
2945

3046
- template: .azure-pipelines/build-template.yml
3147
parameters:
3248
arch: armhf
3349
pool: sonicso1ES-armhf
34-
sonic_slave: sonic-slave-bookworm-armhf
50+
sonic_slave: sonic-slave-trixie-armhf
51+
old_artifact_name: sonic-linux-kernel.armhf
3552
artifact_name: sonic-linux-kernel.armhf
36-
linux_deb_pattern: linux-image-*-armmp_*deb
53+
old_linux_deb_pattern: linux-image-*-armmp_*deb
54+
linux_deb_pattern: linux-image-*+deb*-*-armmp_*deb
3755

3856
- template: .azure-pipelines/build-template.yml
3957
parameters:
4058
arch: arm64
4159
platform: pensando
4260
pool: sonicso1ES-arm64
43-
sonic_slave: sonic-slave-bookworm-arm64
61+
sonic_slave: sonic-slave-trixie-arm64
62+
old_artifact_name: sonic-linux-kernel.pensando.arm64
4463
artifact_name: sonic-linux-kernel.pensando.arm64
64+
old_linux_deb_pattern: linux-image-*-unsigned_*deb
4565
linux_deb_pattern: linux-image-*-unsigned_*deb
4666

0 commit comments

Comments
 (0)