question about kernel updates and building modules

Message
Author
User avatar
Laurentius
Posts: 102
Joined: Sat Jan 20, 2018 8:44 pm

question about kernel updates and building modules

#1 Post by Laurentius »

Hello.
I just wanted to know why are kernel updates so hard to my pc.
I mean, take a lot of time and cpu resources building modules.

What seems strange to me is that a complete reinstall takes a lot of less time and cpu effort than an update.
I think the reason is that on the .iso images the work of building those modules has been already done. But then, I ask myself Why aren'n updates just like that, pasting a new module over the old ones instead of building them locally? Or does an fresh install do the same, only quieter and smoother?

Is there a way to avoid this behavior?

Just to let you know what I mean, I paste some of the output logs of the upate manager window:

Code: Select all

Building module:
Cleaning build area...
./dkms-make.sh..............................................................................
.................................................................
Signing module /var/lib/dkms/8812au/5.13.6/build/8812au.ko
Cleaning build area...

8812au.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-23-amd64/updates/dkms/
depmod....
Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
make -j2 KERNELRELEASE=6.1.0-23-amd64 KVER=6.1.0-23-amd64.........
Signing module /var/lib/dkms/broadcom-sta/6.30.223.271/build/wl.ko
Cleaning build area...

wl.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-23-amd64/updates/dkms/
depmod...
Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Deprecated feature: MODULES_CONF (/var/lib/dkms/rtl8821ce/5.5.2.1+git20230504/source/dkms.co
nf)

Building module:
Cleaning build area...
'make' -j2 KVER=6.1.0-23-amd64 USER_MODULE_NAME=rtl8821ce CONFIG_RTW_DEBUG=n................
........................................................................................^A..
..............^A.
Progress: [ 69%] [###############################################################################...................................] 
Here's my qsi

Code: Select all

System:
  Kernel: 6.1.0-21-amd64 [6.1.90-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-21-amd64 root=UUID=<filter> ro quiet splash
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 info: xfce4-panel wm: xfwm v: 4.18.0 vt: 7
    dm: LightDM v: 1.26.0 Distro: MX-23.3_x64 Libretto July 31  2023 base: Debian GNU/Linux 12
    (bookworm)
Machine:
  Type: Laptop System: Hewlett-Packard product: Compaq Presario CQ40 Notebook PC v: F.67
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: Hewlett-Packard model: 3607 v: 99.C4 serial: <superuser required> BIOS: Insyde v: F.67
    date: 11/29/2010
Battery:
  ID-1: BAT0 charge: 80.7 Wh (100.0%) condition: 80.7/95.0 Wh (84.9%) volts: 12.4 min: 10.8
    model: Hewlett-Packard Primary type: Li-ion serial: N/A status: full
CPU:
  Info: model: Pentium T4200 bits: 64 type: MCP arch: Penryn level: v1 built: 2008
    process: Intel 45nm family: 6 model-id: 0x17 (23) stepping: 0xA (10) microcode: 0xA0B
  Topology: cpus: 1x cores: 2 smt: <unsupported> cache: L1: 128 KiB desc: d-2x32 KiB; i-2x32 KiB
    L2: 1024 KiB desc: 1x1024 KiB
  Speed (MHz): avg: 1995 min/max: 1200/2000 scaling: driver: acpi-cpufreq governor: ondemand
    cores: 1: 1995 2: 1995 bogomips: 7980
  Flags: ht lm nx pae sse sse2 sse3 ssse3
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: KVM: VMX unsupported
  Type: l1tf mitigation: PTE Inversion
  Type: mds status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT disabled
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Unknown: No mitigations
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass status: Vulnerable
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines; STIBP: disabled; RSB filling; PBRSB-eIBRS: Not
    affected; BHI: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Mobile 4 Series Integrated Graphics vendor: Hewlett-Packard driver: i915
    v: kernel arch: Gen-5 process: Intel 45nm built: 2008 ports: active: LVDS-1 empty: DP-1, DP-2,
    HDMI-A-1, VGA-1 bus-ID: 00:02.0 chip-ID: 8086:2a42 class-ID: 0300
  Device-2: Suyin Webcam-101 type: USB driver: uvcvideo bus-ID: 7-5:2 chip-ID: 064e:c108
    class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.18.0 driver: X: loaded: intel
    dri: crocus gpu: i915 display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1280x800 s-dpi: 96 s-size: 339x212mm (13.35x8.35") s-diag: 400mm (15.74")
  Monitor-1: LVDS-1 mapped: LVDS1 model: Seiko Epson 0x4d42 built: 2008 res: 1280x800 hz: 60
    dpi: 108 gamma: 1.2 size: 300x190mm (11.81x7.48") diag: 358mm (14.1") ratio: 16:10
    modes: 1280x800
  API: OpenGL v: 2.1 Mesa 22.3.6 renderer: Mesa Mobile Intel GM45 Express (CTG)
    direct-render: Yes
Audio:
  Device-1: Intel 82801I HD Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
    bus-ID: 00:1b.0 chip-ID: 8086:293e class-ID: 0403
  API: ALSA v: k6.1.0-21-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel WiFi Link 5100 driver: iwlwifi v: kernel modules: wl pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 bus-ID: 02:00.0 chip-ID: 8086:4232 class-ID: 0280
  IF: wlan0 state: up mac: <filter>
  Device-2: Realtek RTL810xE PCI Express Fast Ethernet vendor: Hewlett-Packard driver: r8169
    v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 03:00.0 chip-ID: 10ec:8136
    class-ID: 0200
  IF: eth0 state: down mac: <filter>
Drives:
  Local Storage: total: 603.58 GiB used: 112.89 GiB (18.7%)
  ID-1: /dev/mmcblk0 maj-min: 179:0 vendor: Kingston model: SS08G size: 7.4 GiB block-size:
    physical: 512 B logical: 512 B type: SSD serial: <filter> scheme: MBR
  SMART Message: Unknown smartctl error. Unable to generate data.
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-2: /dev/sda maj-min: 8:0 vendor: Western Digital model: WDS480G2G0A-00JH30 size: 447.13 GiB
    block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s type: SSD serial: <filter> rev: 0400
    scheme: MBR
  ID-3: /dev/sdb maj-min: 8:16 vendor: Samsung model: HM160HI size: 149.05 GiB block-size:
    physical: 512 B logical: 512 B speed: 1.5 Gb/s type: N/A serial: <filter> rev: 0-15 scheme: MBR
Partition:
  ID-1: / raw-size: 48.83 GiB size: 47.76 GiB (97.81%) used: 13.87 GiB (29.0%) fs: ext4
    dev: /dev/sda7 maj-min: 8:7
  ID-2: /home raw-size: 255.95 GiB size: 250.88 GiB (98.02%) used: 58.82 GiB (23.4%) fs: ext4
    dev: /dev/sda6 maj-min: 8:6
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 4 GiB used: 434.4 MiB (10.6%) priority: -2 dev: /dev/sda5
    maj-min: 8:5
Sensors:
  System Temperatures: cpu: 76.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Repos:
  Packages: 2430 pm: dpkg pkgs: 2425 libs: 1296 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0 pm: flatpak pkgs: 5
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/google-chrome.list
    1: deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/home:manuelschneid3r.list
    1: deb http://download.opensuse.org/repositories/home:/manuelschneid3r/Debian_12/ /
  Active apt repos in: /etc/apt/sources.list.d/megasync.list
    1: deb [signed-by=/usr/share/keyrings/meganz-archive-keyring.gpg] https://mega.nz/linux/repo/Debian_testing/ ./
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://mxrepo.com/mx/repo/ bookworm main non-free
  Active apt repos in: /etc/apt/sources.list.d/spotify.list
    1: deb http://repository.spotify.com stable non-free
  Active apt repos in: /etc/apt/sources.list.d/vivaldi.list
    1: deb [arch=amd64] https://repo.vivaldi.com/stable/deb/ stable main
Info:
  Processes: 254 Uptime: 22d 1h 56m wakeups: 69 Memory: 3.73 GiB used: 2.18 GiB (58.4%)
  Init: SysVinit v: 3.06 runlevel: 5 default: graphical tool: systemctl Compilers: gcc: 12.2.0
  alt: 12 Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: BIOS (legacy, CSM, MBR)

MXRobo
Posts: 1835
Joined: Thu Nov 14, 2019 12:09 pm

Re: question about kernel updates and building modules

#2 Post by MXRobo »

If you're not going to make an ISO with MX-Snaphot and install your OS on other machines, then maybe:
MX-Cleanup > Remove unused wifi drivers.

Also, maybe remove unused dkms packages as they both take a lot of time.

+EDIT- And MX-Locale > Locale Management > Disable all locales except the one in use. Per post#3 fehlix which I'm bookmarking.

I did all on one laptop but:
* remove cryptsetup-initramfs if no encryption is in use
* remove mdadm if no software raid is in use

++EDIT- Shortly after I posted (and after reading fehlix's post) - well I may have made a mistake, confused as maybe "remove DKMS" and "MX-Cleanup > Remove unused wifi drivers" are one and the same. IIRC, I removed DKMS packages before "MX-Cleanup > Remove unused wifi drivers" was added.
Last edited by MXRobo on Thu Jul 18, 2024 12:00 am, edited 4 times in total.

User avatar
fehlix
Developer
Posts: 12823
Joined: Wed Apr 11, 2018 5:09 pm

Re: question about kernel updates and building modules

#3 Post by fehlix »

Laurentius wrote: Tue Jul 16, 2024 5:52 pm Is there a way to avoid this behavior?
Yes:
* MX Cleanup : Remove unused wifi drivers
' MX Cleanup: Remove older not used kernels - better keep one addtional just in case.
More speedy makers ...
* remove cryptsetup-initramfs if no encryption is in use
* remove mdadm if no software raid is in use
* remove not needed locale, to avoid next locale update re-generate about 60 + locales
ttfn

User avatar
Laurentius
Posts: 102
Joined: Sat Jan 20, 2018 8:44 pm

Re: question about kernel updates and building modules

#4 Post by Laurentius »

Thank you fehlix and MXRobo for your replies.

I did remove wifi drivers, one kernel (only 2 installed), mdadm and and unneeded locales.
We'll see next update.
I think it is mostly those dkms modules thing which takes most of the time, every time there is a kernel or linux image/headers update

User avatar
Stevo
Developer
Posts: 14760
Joined: Fri Dec 15, 2006 7:07 pm

Re: question about kernel updates and building modules

#5 Post by Stevo »

Yes, this question has been getting asked and answered pretty often here.
MXPI = MX Package Installer
QSI = Quick System Info from menu
The MX Test repository is mostly backports; not the same as Debian testing

User avatar
shmu26
Posts: 265
Joined: Tue Sep 03, 2019 10:51 am

Re: question about kernel updates and building modules

#6 Post by shmu26 »

I removed unused wifi drivers. Probably, all wifi drivers were removed, because this computer has a wired connection Now I want them back, to create a snapshot that will work on different hardware.
How to get those drivers back?

atomick

Re: question about kernel updates and building modules

#7 Post by atomick »

Ah anyone check the qsi shared. " Topology: cpu: 1x cores: 2 smt: " as in being One CPU 2 thread. barely 2g clock,

Ah yes this will be slow. Least you selected right Per MX-Standard.iso and not the ahs advanced hardware support release.

Yes this will be upon notice of Kernel Updates compile times on that wind up cpu would be consider doing so at bed time or just prior to dropping for the nite and hit Update, check both bottom left check box for smoother response start. Might consider a fair fan to run and blow onto the bottom of your HP LT it will get hot for the work load it will be up against.
Excellent its still running Memory is not on defined post but seeing in Process appears 4gig of system ram. Yes its old and it will be timely to kernel update consider a green thumb and pray every update it completes.
snds like good timex. takes a kicking and keeps on ticking. pls don't kick charm this one and it possibly should keep working for a time. Power supplies usually can be replaced by such an expanse of time per cold and warm recycles. Caps usually break down off complete cold start cycle repeats. if habit pwr dwn nite pwr up day by days inclusive it powers up to D/Top. 2008 electronics usually better quality, worked into laptop platforms. then?

ps killing/stopping some services not used, might help with load eg bluetooth might be a start samba smbd nmbd services being a cmdline junkie one could ox a terminal
cd /etc/init.d
sudo update-rc.d -f bluetooth remove
- would be a start example. substitute bluetooth for other component services will remove from startup process. and free some load. your choice.

Post Reply

Return to “Software / Configuration”