From 7e3c5b74c46bd25f4f3885b9f0a4777239d01a85 Mon Sep 17 00:00:00 2001
From: Li Zhou
Date: Fri, 26 Nov 2021 20:17:45 +0800
Subject: [PATCH 1/5] kernel-rt: Adapt the debian folder for new source
Below are the changes on DEBIAN's kernel release's "debian" folder
for building linux-yocto kernel-rt source 6.6.7, besides the changes
about kernel configs / changelog file / replacing "linux" with
"linux-rt":
-Update debian/config/amd64/none/defines to disable debian cloud image
build, which isn't in use here;
-Update debian/config/defines to disable docs/installer packages'
build to avoid some build errors caused by docs and installer,
which aren't in use here;
-Update debian/lib/python/debian_linux/debian.py to remove an
unimportant format check for changelog because it conflicts with the
new build system;
-Update debian/patches/series to only keep the necessary patches to
support package build system and the lockdown feature, which are from
DEBIAN release.
-Update debian/rules to solve the issue that build paused after
gencontrol;
-Update debian/config/defines to disable rt feature. This linux-rt
isn't built using the rt feature, because linux-yocto rt source
is stored in its own branch and not as a set of patches against std.
Take the linux-rt code as a normal kernel with its special config file;
-Update debian/config/defines to disable unnecessary tool packages;
-Update debian/control to avoid the error:
This is caused by the temp control file in the debian folder
downloaded.
-Update abiname.
Signed-off-by: Li Zhou
[lz: Adapted the patch for upgrading kernel from 5.10 to 6.6]
Signed-off-by: Li Zhou
---
debian/config/amd64/none/defines | 8 --
debian/config/defines | 10 +-
debian/control | 2 +-
debian/lib/python/debian_linux/debian.py | 24 ++--
debian/patches/series | 134 -----------------------
debian/rules | 9 +-
6 files changed, 21 insertions(+), 166 deletions(-)
diff --git a/debian/config/amd64/none/defines b/debian/config/amd64/none/defines
index 1717c99..090dc41 100644
--- a/debian/config/amd64/none/defines
+++ b/debian/config/amd64/none/defines
@@ -1,11 +1,3 @@
[base]
flavours:
amd64
- cloud-amd64
-default-flavour: amd64
-quick-flavour: cloud-amd64
-
-[cloud-amd64_image]
-configs:
- config.cloud
- amd64/config.cloud-amd64
diff --git a/debian/config/defines b/debian/config/defines
index 1b4ee8f..37ee655 100644
--- a/debian/config/defines
+++ b/debian/config/defines
@@ -1,5 +1,5 @@
[abi]
-abiname: 0.deb11.9
+abiname: 1
ignore-changes:
__cpuhp_*
__udp_gso_segment
@@ -145,7 +145,6 @@ arches:
compiler: gcc-10
featuresets:
none
- rt
[build]
# Disable code signing by default; this can be overridden per-architecture
@@ -153,7 +152,7 @@ signed-code: false
trusted-certs: debian/certs/debian-uefi-certs.pem
[featureset-rt_base]
-enabled: true
+enabled: false
[description]
part-long-up: This kernel is not suitable for SMP (multi-processor,
@@ -171,3 +170,8 @@ gcc-10: gcc-10 , gcc-10-@gnu-type-package@ <
# initramfs-generators
initramfs-fallback: linux-initramfs-tool
initramfs-tools: initramfs-tools (>= 0.120+deb8u2)
+
+[packages]
+docs: false
+installer: false
+tools-unversioned: false
diff --git a/debian/control b/debian/control
index 493e8f3..f3e4742 100644
--- a/debian/control
+++ b/debian/control
@@ -1,4 +1,4 @@
-Source: linux
+Source: linux-rt
Section: kernel
Priority: optional
Maintainer: Debian Kernel Team
diff --git a/debian/lib/python/debian_linux/debian.py b/debian/lib/python/debian_linux/debian.py
index 8fca8fb..296c1e2 100644
--- a/debian/lib/python/debian_linux/debian.py
+++ b/debian/lib/python/debian_linux/debian.py
@@ -87,19 +87,17 @@ class Changelog(list):
v = Version(top_match.group('version'))
else:
bottom_match = self._bottom_re.match(line)
- if not bottom_match:
- raise Exception('invalid bottom line %d in changelog' %
- line_no)
-
- self.append(self.Entry(
- distribution=top_match.group('distribution'),
- source=top_match.group('source'),
- version=v,
- urgency=top_match.group('urgency'),
- maintainer=bottom_match.group('maintainer'),
- date=bottom_match.group('date')))
- top_match = bottom_match = None
-
+ # Don't raise exception any more if this bottom format
+ # checking fails because we have adpated the changelog format.
+ if bottom_match:
+ self.append(self.Entry(
+ distribution=top_match.group('distribution'),
+ source=top_match.group('source'),
+ version=v,
+ urgency=top_match.group('urgency'),
+ maintainer=bottom_match.group('maintainer'),
+ date=bottom_match.group('date')))
+ top_match = bottom_match = None
class Version(object):
_epoch_re = re.compile(r'\d+$')
diff --git a/debian/patches/series b/debian/patches/series
index 1f915ac..7326cee 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,146 +1,12 @@
-debian/gitignore.patch
-
-# Disable features broken by exclusion of upstream files
-debian/dfsg/arch-powerpc-platforms-8xx-ucode-disable.patch
-debian/dfsg/drivers-media-dvb-dvb-usb-af9005-disable.patch
-debian/dfsg/vs6624-disable.patch
-debian/dfsg/drivers-net-appletalk-cops.patch
-debian/dfsg/video-remove-nvidiafb-and-rivafb.patch
-debian/dfsg/documentation-fix-broken-link-to-cipso-draft.patch
-
# Changes to support package build system
debian/version.patch
debian/uname-version-timestamp.patch
debian/kernelvariables.patch
-debian/ia64-hardcode-arch-script-output.patch
-debian/mips-disable-werror.patch
-debian/mips-boston-disable-its.patch
-debian/mips-ieee754-relaxed.patch
-debian/arch-sh4-fix-uimage-build.patch
-debian/tools-perf-perf-read-vdso-in-libexec.patch
-debian/tools-perf-install-python-bindings.patch
-debian/wireless-add-debian-wireless-regdb-certificates.patch
-debian/export-symbols-needed-by-android-drivers.patch
-debian/android-enable-building-ashmem-and-binder-as-modules.patch
-debian/documentation-drop-sphinx-version-check.patch
debian/perf-traceevent-support-asciidoctor-for-documentatio.patch
debian/kbuild-look-for-module.lds-under-arch-directory-too.patch
-debian/kbuild-abort-build-if-subdirs-used.patch
-debian/module-avoid-abi-changes-when-debug-info-is-disabled.patch
-debian/makefile-make-compiler-version-comparison-optional.patch
-
-# Fixes/improvements to firmware loading
-features/all/drivers-media-dvb-usb-af9005-request_firmware.patch
-debian/iwlwifi-do-not-request-unreleased-firmware.patch
-bugfix/all/firmware_class-log-every-success-and-failure.patch
-bugfix/all/firmware-remove-redundant-log-messages-from-drivers.patch
-bugfix/all/radeon-amdgpu-firmware-is-required-for-drm-and-kms-on-r600-onward.patch
-debian/firmware_class-refer-to-debian-wiki-firmware-page.patch
-bugfix/all/wifi-mt76-do-not-run-mt76_unregister_device-on-unregistered-hw.patch
-
-# Change some defaults for security reasons
-debian/af_802154-Disable-auto-loading-as-mitigation-against.patch
-debian/rds-Disable-auto-loading-as-mitigation-against-local.patch
-debian/dccp-disable-auto-loading-as-mitigation-against-local-exploits.patch
-debian/hamradio-disable-auto-loading-as-mitigation-against-local-exploits.patch
-debian/fs-enable-link-security-restrictions-by-default.patch
-
-# Set various features runtime-disabled by default
-debian/sched-autogroup-disabled.patch
-debian/yama-disable-by-default.patch
-debian/add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch
-features/all/security-perf-allow-further-restriction-of-perf_event_open.patch
-features/x86/intel-iommu-add-option-to-exclude-integrated-gpu-only.patch
-features/x86/intel-iommu-add-kconfig-option-to-exclude-igpu-by-default.patch
-
-# Disable autoloading/probing of various drivers by default
-debian/cdc_ncm-cdc_mbim-use-ncm-by-default.patch
-debian/snd-pcsp-disable-autoload.patch
-bugfix/x86/viafb-autoload-on-olpc-xo1.5-only.patch
-debian/fjes-disable-autoload.patch
-
-# Taint if dangerous features are used
-debian/fanotify-taint-on-use-of-fanotify_access_permissions.patch
-debian/btrfs-warn-about-raid5-6-being-experimental-at-mount.patch
-
-# Arch bug fixes
-bugfix/arm/arm-dts-kirkwood-fix-sata-pinmux-ing-for-ts419.patch
-bugfix/x86/perf-tools-fix-unwind-build-on-i386.patch
-bugfix/sh/sh-boot-do-not-use-hyphen-in-exported-variable-name.patch
-bugfix/arm/arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch
-bugfix/powerpc/powerpc-boot-fix-missing-crc32poly.h-when-building-with-kernel_xz.patch
-bugfix/arm64/arm64-acpi-Add-fixup-for-HPE-m400-quirks.patch
-bugfix/alpha/alpha-fix-missing-symbol-versions-for-str-n-cat-cpy.patch
-
-# Arch features
-features/arm64/dt-bindings-rockchip-Add-Hardkernel-ODROID-M1-board.patch
-features/arm64/arm64-dts-rockchip-Add-Hardkernel-ODROID-M1-board.patch
-features/arm64/arm64-dts-rockchip-add-thermal-support-to-ODROID-M1.patch
-features/arm64/arm64-dts-rockchip-Add-NOR-flash-to-ODROID-M1.patch
-features/arm64/arm64-dts-rockchip-Add-analog-audio-on-ODROID-M1.patch
-features/arm64/arm64-dts-rockchip-Enable-vop2-and-hdmi-tx-on-ODROID.patch
-features/arm64/arm64-dts-rockchip-Enable-HDMI-audio-on-ODROID-M1.patch
-features/arm64/arm64-dts-rockchip-Enable-the-GPU-on-ODROID-M1.patch
-features/arm64/arm64-dts-rockchip-Enable-the-USB-2.0-ports-on-ODROI.patch
-features/arm64/arm64-dts-rockchip-Enable-the-USB-3.0-ports-on-ODROI.patch
-features/arm64/arm64-dts-rockchip-Add-SATA-support-to-ODROID-M1.patch
-features/arm64/arm64-dts-rockchip-Add-PCIEe-v3-nodes-to-ODROID-M1.patch
-features/arm64/arm64-dts-rockchip-Add-IR-receiver-node-to-ODROID-M1.patch
-features/x86/x86-memtest-WARN-if-bad-RAM-found.patch
-features/x86/x86-make-x32-syscall-support-conditional.patch
-
-# Quartz64 bug fixes/patches
-bugfix/arm64/arm64-dts-rockchip-fix-spdif-fe460000-ordering-on-rk.patch
-features/arm64/quartz64/arm64-dts-rockchip-RK356x-Add-I2S2-device-node.patch
-features/arm64/quartz64/arm64-dts-rockchip-Enable-GPU-on-SOQuartz-CM4.patch
-features/arm64/quartz64/arm64-dts-rockchip-Enable-video-output-and-HDMI-on-S.patch
-features/arm64/quartz64/arm64-dts-rockchip-Enable-HDMI-sound-on-SOQuartz.patch
-features/arm64/quartz64/arm64-dts-rockchip-Enable-PCIe-2-on-SOQuartz-CM4IO.patch
-features/arm64/quartz64/dt-bindings-arm-rockchip-Add-SOQuartz-Blade.patch
-features/arm64/quartz64/arm64-dts-rockchip-Add-SOQuartz-blade-board.patch
-features/arm64/quartz64/dt-bindings-arm-rockchip-Add-SOQuartz-Model-A.patch
-features/arm64/quartz64/arm64-dts-rockchip-Add-SOQuartz-Model-A-baseboard.patch
-
-# Miscellaneous bug fixes
-bugfix/all/disable-some-marvell-phys.patch
-bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch
-bugfix/all/media-cx18-avoid-strlen-call-that-triggers-ice-in-gc.patch
# Miscellaneous features
# Lockdown missing pieces
features/all/lockdown/efi-add-an-efi_secure_boot-flag-to-indicate-secure-b.patch
features/all/lockdown/efi-lock-down-the-kernel-if-booted-in-secure-boot-mo.patch
-features/all/lockdown/mtd-disable-slram-and-phram-when-locked-down.patch
-features/all/lockdown/arm64-add-kernel-config-option-to-lock-down-when.patch
-
-# Improve integrity platform keyring for kernel modules verification
-features/all/db-mok-keyring/0003-MODSIGN-checking-the-blacklisted-hash-before-loading-a-kernel-module.patch
-features/all/db-mok-keyring/KEYS-Make-use-of-platform-keyring-for-module-signature.patch
-features/all/db-mok-keyring/trust-machine-keyring-by-default.patch
-
-# Security fixes
-debian/i386-686-pae-pci-set-pci-nobios-by-default.patch
-debian/ntfs-mark-it-as-broken.patch
-bugfix/all/netfilter-nf_tables-deactivate-anonymous-set-from-pr.patch
-
-# Fix exported symbol versions
-bugfix/all/module-disable-matching-missing-version-crc.patch
-
-# Tools bug fixes
-bugfix/all/usbip-document-tcp-wrappers.patch
-bugfix/all/kbuild-fix-recordmcount-dependency.patch
-bugfix/all/tools-perf-man-date.patch
-bugfix/all/tools-perf-remove-shebangs.patch
-bugfix/x86/revert-perf-build-fix-libunwind-feature-detection-on.patch
-bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch
-bugfix/all/cpupower-bump-soname-version.patch
-bugfix/all/cpupower-fix-checks-for-cpu-existence.patch
-bugfix/all/tools-perf-pmu-events-fix-reproducibility.patch
-bugfix/all/libapi-define-_fortify_source-as-2-not-empty.patch
-bugfix/all/tools-perf-fix-missing-ldflags-for-some-programs.patch
-
-# debian-installer fixes
-bugfix/powerpc/fbdev-offb-Update-expected-device-name.patch
-
-# ABI maintenance
diff --git a/debian/rules b/debian/rules
index b39c230..0234128 100755
--- a/debian/rules
+++ b/debian/rules
@@ -130,12 +130,7 @@ debian/control-real: debian/bin/gencontrol.py $(CONTROL_FILES)
# Hash randomisation makes the pickled config unreproducible
PYTHONHASHSEED=0 $<
md5sum $^ > debian/control.md5sum
- @echo
- @echo This target is made to fail intentionally, to make sure
- @echo that it is NEVER run during the automated build. Please
- @echo ignore the following error, the debian/control file has
- @echo been generated SUCCESSFULLY.
- @echo
- exit 1
+ @echo The debian/control file has been generated SUCCESSFULLY.
+ @echo Proceed to build!
.PHONY: binary binary-% build build-% clean debian/control-real orig setup source
--
2.17.1