You are not logged in.

#1 2023-02-08 13:06:46

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,458

[SOLVED] Slow "loading initial ramdisk" due to battery probing.

Hi there, i've got a Thinkbook 15-IIL and i'm installing it.
One thing i'm noticing is that it is relatively slow to boot, it takes about 8 secs to go from "loading initial ramdisk" to the rest of the boot process.
Inspecting the logs show that it takes about 8.5seconds to probe for the battery, exactly like this guy:
https://linux.debian.bugs.dist.narkive. … battery-ko

[ 1.030514] ACPI: Power Button [PWRF]
[ 9.460317] battery: ACPI: Battery Slot [BAT1] (battery present)

Disabling acpi from kernel parameter makes it boot faster, but unfortunately it is not a viable workaround.

I searched for battery.ko in the loaded modules but come up empty, and i'm not able to understand if i can blacklilst something during boot like in the early-mentioned post.
Booting the initramfs with break=postmount and inspecting the loaded modules doesn't seem to show anything related to battery.

Any advice?

Thanks.

Last edited by kokoko3k (2023-02-09 14:27:10)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#2 2023-02-08 15:23:28

frostschutz
Member
Registered: 2013-11-15
Posts: 1,645

Re: [SOLVED] Slow "loading initial ramdisk" due to battery probing.

For ArchLinux kernel, it's actually built-in and not a module ( CONFIG_ACPI_BATTERY=y ) if you want it as a module you'd have to compile a custom kernel.

The message itself here originates from sbs (smart battery system) which is a module ( CONFIG_ACPI_SBS=m ).

But I'm not sure if that is the cause of your problem, or just the unlucky next message after whatever caused the delay.


Edit: I may be wrong about sbs. I tried grepping for that message and sbs came up first.

./sbs.c:547:	pr_info("%s [%s]: Battery Slot [%s] (battery %s)\n",
./battery.c:11:#define pr_fmt(fmt) "ACPI: battery: " fmt
./battery.c:1193:	pr_info("Slot [%s] (battery %s)\n", acpi_device_bid(device),

Last edited by frostschutz (2023-02-08 15:25:47)

Offline

#3 2023-02-09 13:41:56

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,458

Re: [SOLVED] Slow "loading initial ramdisk" due to battery probing.

Thanks, i did as you suggested:
*Compiled and installed a kernel awith a modified config:
https://wiki.archlinux.org/title/Kernel … ild_System

koko@thinkbook# grep CONFIG_ACPI_BATTERY /koko/kernel/linux/config 
CONFIG_ACPI_BATTERY=m

*Blacklisted "battery" module

koko@thinkbook# cat /etc/modprobe.d/blacklist_battery.conf 
blacklist battery

*Modified the mkinitcpio FILES section to prevent the initramfs from loading it:

koko@thinkbook# grep FILES /etc/mkinitcpio.conf
FILES=("/etc/modprobe.d/blacklist_battery.conf")

*made a custom service to load it afterwards:

koko@thinkbook# cat /etc/systemd/system/koko-rc-local.service 
[Unit]
Description=/etc/rc.local Compatibility
[Service]
Type=forking
ExecStart=/etc/rc.local
TimeoutSec=0
#StandardInput=tty
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
koko@thinkbook# cat /etc/rc.local
modprobe battery &

...aand rebooted:

Startup finished in 4.266s (firmware) + 2.247s (loader) + 1.516s (kernel) + 6.559s (userspace) = 14.589s 
graphical.target reached after 6.558s in userspace.

It worked, but now i wonder how i can avoid building a kernel again or how to speedup the process; it toke almost an hour.
By now i enabled ccache.

Last edited by kokoko3k (2023-02-09 14:26:55)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#4 2023-09-19 17:30:44

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,458

Re: [SOLVED] Slow "loading initial ramdisk" due to battery probing.

I was reading about initcall_blacklist that could came handy to disable battery "module" initialization; but before digging into it, is there a way to postpone the initialization?


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

Board footer

Powered by FluxBB