[L14 Battery] Constant discharge + Charge in Qubes

I have Qubes OS 4.2. I have executed the commands for Qubes OS 4.1 described in the solution, but I keep getting a message about charging and the end of charging approximately every 5-15 minutes. At the same time, the actual battery charge does not change and remains at 98%. Perhaps some adjustments need to be made for Qubes OS 4.2?

1 Like

Here is my script to install dkms automatically

  1. First
sudo qubes-dom0-update -y
sudo reboot
  1. The script (works on 4.2)
    Change first the VM variable for your AppVM
#!/bin/bash
VM="personal1"
sudo qubes-dom0-update dkms kernel-devel
qvm-run --pass-io $VM -- curl -O https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms/-/archive/master/librem-ec-acpi-dkms-master.tar.gz
qvm-run --pass-io $VM 'cat /home/user/librem-ec-acpi-dkms-master.tar.gz' > librem-ec-acpi-dkms-master.tar.gz
qvm-run --pass-io $VM -- rm /home/user/librem-ec-acpi-dkms-master.tar.gz
tar xvf librem-ec-acpi-dkms-master.tar.gz
rm librem-ec-acpi-dkms-master.tar.gz
cd librem-ec-acpi-dkms-master
cp debian/librem-ec-acpi-dkms.dkms dkms.conf
tee dkms.conf <<EOF
PACKAGE_NAME="librem_ec_acpi"
PACKAGE_VERSION="1.0"
BUILT_MODULE_NAME[0]="librem_ec_acpi"
DEST_MODULE_LOCATION[0]="/updates/dkms"
AUTOINSTALL="yes"
EOF

sudo dkms add ./
sudo qubes-dom0-update flex bison
sudo cp /boot/config-`uname -r` /usr/src/kernels/`uname -r`/.config
rm librem-ec-acpi-dkms-master
cd /usr/src/kernels/`uname -r`
sudo mkdir Documentation
sudo cp .config Documentation/Kconfig
sudo make oldconfig && sudo make prepare M="$(pwd)"
sudo dkms build librem_ec_acpi/1.0 --force
sudo dkms install librem_ec_acpi/1.0 --force

echo "librem_ec_acpi	       #####  0 ?"
lsmod | grep librem_ec_acpi
#librem_ec_acpi         16384  0

echo "90 ?"
cat /sys/class/power_supply/BAT0/charge_control_start_threshold
#90
echo "95 ?"
cat /sys/class/power_supply/BAT0/charge_control_end_threshold
#95

sudo systemctl enable dkms
cd ~
2 Likes