rtl8821ce should not build when CONFIG_CFG80211 is not enabled for linux-kvm

Bug #2019239 reported by Roxana Nicolescu
26
This bug affects 7 people
Affects Status Importance Assigned to Milestone
rtl8821ce (Ubuntu)
Confirmed
Undecided
Unassigned
Jammy
Fix Committed
Undecided
Roxana Nicolescu

Bug Description

[SRU Justification]

Impact:
jammy:linux-kvm does not have CONFIG_CFG80211 enabled.
Module rtl8821ce-dkms requires it, otherwise, build will fail.
Before last update to 5.5.2.1-0ubuntu11~0.22.04.1, build was not performed before because of this rule:

# Only build on wifi enabled kernels
if ! grep -q '^CONFIG_CFG80211=[ym]$' $kernel_source_dir/.config; then
BUILD_EXCLUSIVE_KERNEL="^$"
fi

But the new version broke it because the rule that was overridden by
BUILD_EXCLUSIVE_KERNEL="^5.15.*"

This lead to new regression in autopkgtest for jammy:linux-kvm-5.15.0-1029.34.

Fix:
Add an if else condition so it will cover 2 cases:
1. package won't build if kernel does not have CONFIG_CFG80211 enabled
2. if 1 is true, package won't build if kernel version is not 5.15.

Test plan:
autopkgtest rtl8821ce fails during build with the error from below

...
ERROR: modpost: "cfg80211_rx_mgmt_khz" [/var/lib/dkms/rtl8821ce/5.5.2.1/build/rtl8821ce.ko] undefined!
ERROR: modpost: "cfg80211_mgmt_tx_status" [/var/lib/dkms/rtl8821ce/5.5.2.1/build/rtl8821ce.ko] undefined!
ERROR: modpost: "wiphy_apply_custom_regulatory" [/var/lib/dkms/rtl8821ce/5.5.2.1/build/rtl8821ce.ko] undefined!
ERROR: modpost: "__cfg80211_alloc_reply_skb" [/var/lib/dkms/rtl8821ce/5.5.2.1/build/rtl8821ce.ko] undefined!
ERROR: modpost: "cfg80211_new_sta" [/var/lib/dkms/rtl8821ce/5.5.2.1/build/rtl8821ce.ko] undefined!
ERROR: modpost: "cfg80211_inform_bss_frame_data" [/var/lib/dkms/rtl8821ce/5.5.2.1/build/rtl8821ce.ko] undefined!
ERROR: modpost: "cfg80211_unlink_bss" [/var/lib/dkms/rtl8821ce/5.5.2.1/build/rtl8821ce.ko] undefined!
ERROR: modpost: "cfg80211_connect_done" [/var/lib/dkms/rtl8821ce/5.5.2.1/build/rtl8821ce.ko] undefined!
ERROR: modpost: "cfg80211_put_bss" [/var/lib/dkms/rtl8821ce/5.5.2.1/build/rtl8821ce.ko] undefined!
ERROR: modpost: "cfg80211_roamed" [/var/lib/dkms/rtl8821ce/5.5.2.1/build/rtl8821ce.ko] undefined!
WARNING: modpost: suppressed 18 unresolved symbol warnings because there were too many)
make[2]: *** [scripts/Makefile.modpost:133: /var/lib/dkms/rtl8821ce/5.5.2.1/build/Module.symvers] Error 1
make[2]: *** Deleting file '/var/lib/dkms/rtl8821ce/5.5.2.1/build/Module.symvers'
make[1]: *** [Makefile:1821: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-1029-kvm'
make: *** [Makefile:2262: modules] Error 2
====================
./rtl8821ce/5.5.2.1/build/make.log
autopkgtest [02:46:16]: test dkms-autopkgtest: -----------------------]
dkms-autopkgtest FAIL non-zero exit status 1
autopkgtest [02:46:17]: test dkms-autopkgtest: - - - - - - - - - - results - - - - - - - - - -
autopkgtest [02:46:17]: @@@@@@@@@@@@@@@@@@@@ summary
dkms-autopkgtest FAIL non-zero exit status 1
Creating nova instance adt-jammy-amd64-rtl8821ce-20230214-023910-lrg-root1 from image adt/ubuntu-jammy-amd64-server-20230213.img (UUID ed711e13-2823-486e-8ade-d9996e82af9a)...

This happens if you run apt install rtl8821ce-dkms.

Once the fix is there:
1. module should skip build on linux-kvm or any kernel that has CONFIG_CFG80211 disabled.
2. module should build on linux-generic (5.15)
3. module should skip build on 5.19 kernels

Tested locally in a VM:

1. linux-kvm: 5.15.0-1033-kvm. Build is skipped:

ubuntu@jammy:~$ sudo dpkg -i rtl8821ce-dkms_5.5.2.1-0ubuntu11~0.22.04.3_all.deb
(Reading database ... 223166 files and directories currently installed.)
Preparing to unpack rtl8821ce-dkms_5.5.2.1-0ubuntu11~0.22.04.3_all.deb ...
Deleting module rtl8821ce-5.5.2.1 completely from the DKMS tree.
Unpacking rtl8821ce-dkms (5.5.2.1-0ubuntu11~0.22.04.3) over (5.5.2.1-0ubuntu11~0.22.04.2) ...
Setting up rtl8821ce-dkms (5.5.2.1-0ubuntu11~0.22.04.3) ...
Loading new rtl8821ce-5.5.2.1 DKMS files...
Building for 5.15.0-1033-kvm
Building initial module for 5.15.0-1033-kvm
Error! The /var/lib/dkms/rtl8821ce/5.5.2.1/5.15.0-1033-kvm/x86_64/dkms.conf for module rtl8821ce includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch.
The /var/lib/dkms/rtl8821ce/5.5.2.1/5.15.0-1033-kvm/x86_64/dkms.conf for module rtl8821ce includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config.
This indicates that it should not be built.
Skipped.

2. 5.15.0-57-generic. Built and installed successfully:
ubuntu@jammy:~/rtl$ sudo dpkg -i rtl8821ce-dkms_5.5.2.1-0ubuntu11~0.22.04.3_all.deb
(Reading database ... 81589 files and directories currently installed.)
Preparing to unpack rtl8821ce-dkms_5.5.2.1-0ubuntu11~0.22.04.3_all.deb ...
Module rtl8821ce-5.5.2.1 for kernel 5.15.0-57-generic (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

rtl8821ce.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.15.0-57-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

/etc/modprobe.d/dkms.conf: removed 'blacklist rtw88_8821ce'
depmod...
Deleting module rtl8821ce-5.5.2.1 completely from the DKMS tree.
Unpacking rtl8821ce-dkms (5.5.2.1-0ubuntu11~0.22.04.3) over (5.5.2.1-0ubuntu11~0.22.04.3) ...
Setting up rtl8821ce-dkms (5.5.2.1-0ubuntu11~0.22.04.3) ...
Loading new rtl8821ce-5.5.2.1 DKMS files...
Building for 5.15.0-57-generic
Building initial module for 5.15.0-57-generic
EFI variables are not supported on this system
/sys/firmware/efi/efivars not found, aborting.
Done.

rtl8821ce.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.15.0-57-generic/updates/dkms/

/etc/modprobe.d/dkms.conf: added 'blacklist rtw88_8821ce'
depmod...

3. 5.19.0-1025-aws: Build is skipped.

ubuntu@jammy:~$ sudo dpkg -i rtl8821ce-dkms_5.5.2.1-0ubuntu11~0.22.04.3_all.deb
Selecting previously unselected package rtl8821ce-dkms.
(Reading database ... 99576 files and directories currently installed.)
Preparing to unpack rtl8821ce-dkms_5.5.2.1-0ubuntu11~0.22.04.3_all.deb ...
Unpacking rtl8821ce-dkms (5.5.2.1-0ubuntu11~0.22.04.3) ...
Setting up rtl8821ce-dkms (5.5.2.1-0ubuntu11~0.22.04.3) ...
Loading new rtl8821ce-5.5.2.1 DKMS files...
Building for 5.19.0-1025-aws
Building initial module for 5.19.0-1025-aws
Error! The /var/lib/dkms/rtl8821ce/5.5.2.1/5.19.0-1025-aws/x86_64/dkms.conf for module rtl8821ce includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch.
This indicates that it should not be built.
Skipped.

Regression potential:
None. Build is skipped so no tests are performed.

Changed in rtl8821ce (Ubuntu Jammy):
assignee: nobody → Roxana Nicolescu (roxanan)
Revision history for this message
Roxana Nicolescu (roxanan) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in rtl8821ce (Ubuntu Jammy):
status: New → Confirmed
Changed in rtl8821ce (Ubuntu):
status: New → Confirmed
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Roxana, or anyone else affected,

Accepted rtl8821ce into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/rtl8821ce/5.5.2.1-0ubuntu11~0.22.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in rtl8821ce (Ubuntu Jammy):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (rtl8821ce/5.5.2.1-0ubuntu11~0.22.04.3)

All autopkgtests for the newly accepted rtl8821ce (5.5.2.1-0ubuntu11~0.22.04.3) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

rtl8821ce/5.5.2.1-0ubuntu11~0.22.04.3 (i386)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#rtl8821ce

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.