linux-hwe-6.5: work to unify linux and linux-hwe helper.

This commit is contained in:
Luis Guzmán 2024-03-29 01:06:04 +00:00
parent ff0ea9c6b0
commit e1d1c6724c
327 changed files with 119 additions and 54 deletions

View file

@ -19,11 +19,20 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
VERSION=27
VERSION=28
HWEKR=6.5
# DI_ENABLED = 1 enables udeb build, 0 or any other value disables them.
DI_ENABLED=0
# HWE_ENABLED = 1 enables HWE stack build, 0 or any other value disables it.
HWE_ENABLED=1
[ $HWE_ENABLED != 1 ] && \
DEBIAN_PATH=debian.master && \
CONTROL_PACKAGE=linux
[ $HWE_ENABLED = 1 ] && \
DEBIAN_PATH=debian.hwe-$HWEKR && \
CONTROL_PACKAGE=linux-hwe-$HWEKR
. ./config
@ -49,7 +58,10 @@ drivers/net/wireless/realtek/rtlwifi/rtl8723be
drivers/net/wireless/realtek/rtlwifi/rtl8821ae
drivers/net/wireless/broadcom/brcm80211
'
#drivers/gpu/drm/r128
# HWEKR - 5.15
[ $HWE_ENABLED != 1 ] && \
PRESERVEDIRS="$PRESERVEDIRS
drivers/gpu/drm/r128"
TMPDIR=$(mktemp -d preserve-XXXX)
PRESERVE=$(grep '^+++' $DATA/silent-accept-firmware.patch | /bin/sed 's/+++ //; s/\t.*//;' | cut -d/ -f2- | sort -u )
@ -79,11 +91,18 @@ done
# Re-enable udebs
enable_udebs() {
cp $DATA/5-udebs.mk debian/rules.d
cp -a $DATA/d-i debian.hwe-$HWEKR
#Apply udeb/d-i related patches.
for PATCH in $DATA/udeb/*.patch ; do
echo $PATCH
patch --no-backup-if-mismatch -p1 < $PATCH
done
cp $DATA/udeb/5-udebs.mk debian/rules.d
cp -a $DATA/udeb/d-i $DEBIAN_PATH
cat << EOF >> debian/control
Package: linux-hwe-$HWEKR-udebs-generic
Package: $CONTROL_PACKAGE-udebs-generic
Build-Profiles: <!stage1> <!noudeb> <!cross> <!autopkgtest>
XC-Package-Type: udeb
Section: debian-installer
@ -93,7 +112,7 @@ Description: Metapackage depending on kernel udebs
This package depends on the all udebs that the kernel build generated,
for easier version and migration tracking.
Package: linux-hwe-$HWEKR-udebs-generic-lpae
Package: $CONTROL_PACKAGE-udebs-generic-lpae
Build-Profiles: <!stage1> <!noudeb> <!cross> <!autopkgtest>
XC-Package-Type: udeb
Section: debian-installer
@ -103,7 +122,7 @@ Description: Metapackage depending on kernel udebs
This package depends on the all udebs that the kernel build generated,
for easier version and migration tracking.
Package: linux-hwe-$HWEKR-udebs-lowlatency
Package: $CONTROL_PACKAGE-udebs-lowlatency
Build-Profiles: <!stage1> <!noudeb> <!cross> <!autopkgtest>
XC-Package-Type: udeb
Section: debian-installer
@ -114,7 +133,7 @@ Description: Metapackage depending on kernel udebs
for easier version and migration tracking.
EOF
cat << EOF >> debian.hwe-$HWEKR/control.d/flavour-control.stub
cat << EOF >> $DEBIAN_PATH/control.d/flavour-control.stub
Package: SRCPKGNAME-udebs-FLAVOUR
Build-Profiles: <!stage1> <!noudeb> <!cross> <!autopkgtest>
XC-Package-Type: udeb
@ -128,16 +147,15 @@ EOF
sed '/include.*2-binary-arch.mk/a\\n# Rules for building the udebs ($(DEBIAN)-installer)\ninclude $(DROOT)/rules.d/5-udebs.mk' -i debian/rules
sed 's/+= binary-debs/+= binary-udebs/' -i debian/rules.d/2-binary-arch.mk
for i in dctrl-tools kernel-wedge
do
sed "/Build-Depends:/a\ $i <\!stage1> <\!noudeb> <\!cross> <\!autopkgtest>," -i debian/control \
debian.hwe-$HWEKR/control.stub.in
$DEBIAN_PATH/control.stub.in
done
}
[ "$DI_ENABLED" = "1" ] && enable_udebs
[ "$DI_ENABLED" != "1" ] && \
patch --no-backup-if-mismatch -R -p1 < $DATA/d-i.patch
# Wipe dkms-versions
# lists zfs / v4l2loopback versions
@ -146,82 +164,105 @@ echo > debian/dkms-versions
# Remove ZFS - adjusting to each release
rm debian/scripts/dkms-build-configure--zfs
grep -lr zfs debian.{master,hwe-$HWEKR}/reconstruct \
debian.{master,hwe-$HWEKR}/abi/*/*.modules \
for i in $(grep -lr zfs $DEBIAN_PATH/reconstruct \
$DEBIAN_PATH/abi/*/*.modules \
debian/rules.d/2-binary-arch.mk \
debian.{master,hwe-$HWEKR}/rules.d/ \
$DEBIAN_PATH/rules.d/ \
debian/rules \
debian.{master,hwe-$HWEKR}/control.d/ | xargs -r sed -i '/zfs/d'
$DEBIAN_PATH/control.d/)
do
sed -i '/zfs/d' $i
done
[ "$DI_ENABLED" = "1" ] && \
grep -lr zfs debian.hwe-$HWEKR/d-i/modules/fs-core-modules | xargs -r sed -i '/zfs/d'
for i in $(grep -lr zfs $DEBIAN_PATH/d-i/modules/fs-core-modules) ; \
do \
sed -i '/zfs/d' $i ; \
done
#/bin/sed 's/spl-dkms, zfs-dkms//' -i debian/control \
# debian.master/control.d/vars.generic \
# debian.master/control.d/vars.*
# $DEBIAN_PATH/control.d/vars.generic \
# $DEBIAN_PATH/control.d/vars.*
#/bin/sed -i '/ifeq ($(do_zfs),false)/,/endif$/d' debian/rules
# Remove VBox
#sed -i '/vbox/s|true|false|' debian.master/rules.d/amd64.mk
#sed -i '/vbox/s|true|false|' $DEBIAN_PATH/rules.d/amd64.mk
# Remove v4l2loopback
grep -lr v4l2loopback debian.{master,hwe-$HWEKR}/reconstruct \
debian.{master,hwe-$HWEKR}/abi/*/*.modules \
for i in $(grep -lr v4l2loopback $DEBIAN_PATH/reconstruct \
$DEBIAN_PATH/abi/*/*.modules \
debian/rules.d/2-binary-arch.mk \
debian.{master,hwe-$HWEKR}/rules.d/ \
$DEBIAN_PATH/rules.d/ \
debian/rules \
debian.{master,hwe-$HWEKR}/control.d/ | xargs -r sed -i '/v4l2loopback/d'
$DEBIAN_PATH/control.d/)
do
sed -i '/v4l2loopback/d' $i
done
[ "$DI_ENABLED" = "1" ] && \
grep -lr v4l2loopback debian.hwe-$HWEKR/d-i/modules/fs-core-modules | \
xargs -r sed -i '/v4l2loopback/d'
for i in $(grep -lr v4l2loopback $DEBIAN_PATH/d-i/modules/fs-core-modules) ; \
do \
sed -i '/v4l2loopback/d' ; \
done
#/bin/sed -i '/ifeq ($(do_v4l2loopback),false)/,/endif$/d' debian/rules
#/bin/sed -i '/do_v4l2loopback/d' debian.master/rules.d/*
# Remove nvidia driver
rm -rf debian/scripts/dkms-build--nvidia-N
grep -l dkms-build--nvidia-N debian.{master,hwe-$HWEKR}/reconstruct|xargs -r sed -i '/dkms-build--nvidia-N/d'
for i in $(grep -l dkms-build--nvidia-N $DEBIAN_PATH/reconstruct)
do
sed -i '/dkms-build--nvidia-N/d' $i
done
# Remove wireguard
grep -lr wireguard debian.{master,hwe-$HWEKR}/reconstruct \
debian.{master,hwe-$HWEKR}/abi/*/*.modules \
for i in $(grep -lr wireguard $DEBIAN_PATH/reconstruct \
$DEBIAN_PATH/abi/*/*.modules \
debian/rules.d/2-binary-arch.mk \
debian.{master,hwe-$HWEKR}/rules.d/ \
debian/rules \
debian.{master,hwe-$HWEKR}/control.d/ | xargs -r sed -i '/wireguard/d'
$DEBIAN_PATH/rules.d/ \
$DEBIAN_PATH/control.d/)
do
sed -i '/wireguard/d' $i
done
[ "$DI_ENABLED" = "1" ] && \
grep -lr wireguard debian.hwe-$HWEKR/d-i/modules/fs-core-modules | \
xargs -r sed -i '/wireguard/d'
for i in $(grep -lr wireguard $DEBIAN_PATH/d-i/modules/fs-core-modules) ; \
do \
sed -i '/wireguard/d' $i ; \
done
#/bin/sed '/ifeq ($(do_dkms_wireguard),false)/,/endif$/d' -i debian/rules
#sed '/do_dkms_wireguard/d' -i debian/rules.d/2-binary-arch.mk
#/bin/sed '/do_dkms_wireguard/d' -i debian.master/rules.d/*
#/bin/sed '/do_dkms_wireguard/d' -i $DEBIAN_PATH/rules.d/*
# Compile with less modules and avoid abi check
echo -e 'skipmodule = true\nskipabi = true' | tee -a debian.{master,hwe-$HWEKR}/rules.d/0-common-vars.mk \
echo -e 'skipmodule = true\nskipabi = true' | tee -a $DEBIAN_PATH/rules.d/0-common-vars.mk \
debian/rules.d/0-common-vars.mk
# Skip the retpoline check as there is no last release to check against
echo 'skipretpoline = true' | tee -a debian.master/rules.d/0-common-vars.mk \
echo 'skipretpoline = true' | tee -a $DEBIAN_PATH/rules.d/0-common-vars.mk \
debian/rules.d/0-common-vars.mk
# Do not label packages as unsigned
sed '/bin_pkg_name_unsigned/s/linux-image-unsigned/linux-image/' -i debian/rules.d/0-common-vars.mk
sed 's/.unsigned//' -i debian/scripts/control-create
sed '/Package:/s/.unsigned//;/This package /s/.unsigned//' -i debian/control
line=$(grep -n ')-Ubuntu' debian/rules.d/0-common-vars.mk|cut -d: -f1)
sed $(expr $line - 1 ),$(expr $line + 1 )d debian/rules.d/0-common-vars.mk -i
#sed s/family=ubuntu/family=trisquel/ -i debian/rules.d/0-common-vars.mk
cat << EOF > debian.master/etc/kernelconfig
for i in $(grep -rl family=ubuntu debian/rules.d/)
do
sed -i s/family=ubuntu/family=trisquel/ $i
done
cat << EOF > $DEBIAN_PATH/etc/kernelconfig
archs="i386 amd64 armhf arm64 ppc64el"
family='trisquel'
EOF
rename s/ubuntu/trisquel/ debian.*/config/config.common.ubuntu
grep -lr config.common.ubuntu debian*/ | xargs -r sed -i 's|config.common.ubuntu|config.common.trisquel|g'
for i in $(grep -lr config.common.ubuntu debian*/)
do
sed -i 's|config.common.ubuntu|config.common.trisquel|g' $i
done
find debian* -type f -name *control* -exec sed 's/ with Ubuntu patches//; s/Linux/Linux-libre/g' -i {} \;
@ -233,29 +274,53 @@ sed '/^firmware/d' ./debian*/abi/fwinfo -i
#echo > ./debian.master/d-i/firmware/scsi-modules
# Disable using udev as a fallback for firmware loading
replace "CONFIG_FW_LOADER_USER_HELPER=y" "CONFIG_FW_LOADER_USER_HELPER=n" debian.master/config
replace "CONFIG_FW_LOADER_USER_HELPER=y" "CONFIG_FW_LOADER_USER_HELPER=n" $DEBIAN_PATH/config
# Disable aaeon & ubuntu odm drivers.
# Disable aaeon & ubuntu odm drivers, remove on both paths to match annotations.
for i in AAEON CONFIG_UBUNTU_ODM_DRIVERS
do
grep -rl "$i" debian.{hwe-$HWEKR,master}/config/annotations | \
grep -rl "$i" debian.*/config/annotations | \
xargs -r sed -i "/$i/d"
done
# Disable ppc64el Werroron amdgpu
grep -rl CONFIG_DRM_AMDGPU_WERROR debian.{hwe-$HWEKR,master}/config/annotations | \
xargs -r sed -i "/CONFIG_DRM_AMDGPU_WERROR/s|'ppc64el': 'y'|'ppc64el': 'n'|"
# Custom changes for linux and linux-hwe.
if [ $HWE_ENABLED != 1 ]; then
## HWEKR - 5.15
## Removal wireguard 5.15 specific.
sed '/ifeq ($(do_dkms_wireguard),false)/,/endif$/d' -i debian/rules
## Fix ports build
sed -i "/CONFIG_FW_LOADER_USER_HELPER/s|'armhf': 'y',|'armhf': 'n',|g" debian.master/config/annotations
sed -i "/CONFIG_FW_LOADER_USER_HELPER/s|'arm64': 'y',|'arm64': 'n',|g" debian.master/config/annotations
sed -i "/CONFIG_FW_LOADER_USER_HELPER/s|'ppc64el': 'y',|'ppc64el': 'n',|g" debian.master/config/annotations
sed -i "/CONFIG_FW_LOADER_USER_HELPER_FALLBACK/s|'armhf': 'n',|'armhf': '-',|g" debian.master/config/annotations
sed -i "/CONFIG_FW_LOADER_USER_HELPER_FALLBACK/s|'arm64': 'n',|'arm64': '-',|g" debian.master/config/annotations
sed -i "/CONFIG_FW_LOADER_USER_HELPER_FALLBACK/s|'ppc64el': 'n',|'ppc64el': '-',|g" debian.master/config/annotations
## Tweak 5.15.0-94.104
sed -i "/CONFIG_GPIO_M058SSAN/s|'amd64': 'm'|'amd64': '-'|" debian.master/config/annotations
sed -i "/CONFIG_RTC_DRV_PCF85263/s|'amd64': 'm'|'amd64': '-'|" debian.master/config/annotations
else
# HWEKR - 6.5+
## Disable ppc64el Werroron amdgpu
for i in $(grep -rl CONFIG_DRM_AMDGPU_WERROR $DEBIAN_PATH/config/annotations)
do
sed -i "/CONFIG_DRM_AMDGPU_WERROR/s|'ppc64el': 'y'|'ppc64el': 'n'|" $i
done
## Remove disabled modules from generic list (starting at 6.2)
for module in gpio-aaeon hwmon-aaeon leds-aaeon mfd-aaeon spl
do
for i in $(grep -rl "^$module$" $DEBIAN_PATH/abi/*/)
do
sed -i "/^$module$/d" $i
done
done
fi
# Remove disabled modules from generic list (starting at 6.2)
for module in gpio-aaeon hwmon-aaeon leds-aaeon mfd-aaeon spl
do
grep -rl "^$module$" debian.hwe-$HWEKR/abi/*/ | xargs -r sed -i "/^$module$/d" \
|| echo "> missing $module module, please check loop for it..."
done
grep -rl '^Vcs-Git:' | \
xargs sed -i "s|^Vcs-Git:.*|Vcs-Git: https://gitlab.trisquel.org/trisquel/package-helpers|"
changelog "Removed non-free bits"
cp debian/changelog debian.master/changelog
cp debian/changelog debian.hwe-$HWEKR/changelog
cp debian/changelog $DEBIAN_PATH/changelog
package