From f254317f01c66e97f1a9951f348cde7ee489b598 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Jan 10 2024 23:19:10 +0000 Subject: [PATCH 1/2] only do things with the denylist file when necessary Only cleanup the modprobe denylist and run dracut if the module is listed load the qcom_q6v5_pas module if it was denylisted Signed-off-by: Dennis Gilmore --- diff --git a/x13s.spec b/x13s.spec index 58efc47..1d72de4 100644 --- a/x13s.spec +++ b/x13s.spec @@ -2,7 +2,7 @@ Name: x13s Version: 1.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A place to drop Lenovo X13s machine configuration utilities, dependency and config scripts License: GPLv2+ URL: https://pagure.io/x13s.git @@ -35,11 +35,17 @@ install -Dm0644 %{SOURCE3} -t %{buildroot}%{_prefix}/lib/systemd/system-preset/ %post # clear out the qcom_q6v5_pas, which will keep the power mgmt from working if [ -f %{_sysconfdir}/modprobe.d/anaconda-denylist.conf ]; then - /usr/bin/sed -ie "s/qcom_q6v5_pas//g" %{_sysconfdir}/modprobe.d/anaconda-denylist.conf - # now if the line is blank remove it too - /usr/bin/sed -ie "s/^blacklist[[:space:]]*$//g" %{_sysconfdir}/modprobe.d/anaconda-denylist.conf + # Only clear out module blocking and run dracut if it is blocked, this prevents dracut running if not necessary + if [ $(/usr/bin/grep qcom_q6v5_pas %{_sysconfdir}/modprobe.d/anaconda-denylist.conf| /usr/bin/wc -l) != 0 ]; then + /usr/bin/sed -ie "s/qcom_q6v5_pas//g" %{_sysconfdir}/modprobe.d/anaconda-denylist.conf + # now if the line is blank remove it too + /usr/bin/sed -ie "s/^blacklist[[:space:]]*$//g" %{_sysconfdir}/modprobe.d/anaconda-denylist.conf + # as the file is in the initrd rebuild the initrd + /usr/bin/dracut -f + # Load qcom_q6v5_pas as it was not loaded due to denylist blocking it + /usr/sbin/modprobe qcom_q6v5_pas + fi fi -/usr/bin/dracut -f # enable qrtr/pd-mapper, should be done by `systemctl preset pd-mapper.service` but that doesn't start it immediately systemctl enable --now pd-mapper.service # persist a random BT addr @@ -55,6 +61,10 @@ systemctl enable --now pd-mapper.service %changelog +* Sat Dec 23 2023 Dennis Gilmore - 1.0-3 +- Only cleanup the modprobe denylist and run dracut if the module is listed +- load the qcom_q6v5_pas module if it was denylisted + * Wed Dec 20 2023 Jeremy Linton - 1.0-2 - Fix anaconda deny list sed expression to actually remove the qcom driver From e6a76755bc6b4538003b20c3837f9ee43bd25df7 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Jan 11 2024 15:35:04 +0000 Subject: [PATCH 2/2] drop modprobe incase of running from usb Signed-off-by: Dennis Gilmore --- diff --git a/x13s.spec b/x13s.spec index 1d72de4..f5c1a0f 100644 --- a/x13s.spec +++ b/x13s.spec @@ -42,8 +42,6 @@ if [ -f %{_sysconfdir}/modprobe.d/anaconda-denylist.conf ]; then /usr/bin/sed -ie "s/^blacklist[[:space:]]*$//g" %{_sysconfdir}/modprobe.d/anaconda-denylist.conf # as the file is in the initrd rebuild the initrd /usr/bin/dracut -f - # Load qcom_q6v5_pas as it was not loaded due to denylist blocking it - /usr/sbin/modprobe qcom_q6v5_pas fi fi # enable qrtr/pd-mapper, should be done by `systemctl preset pd-mapper.service` but that doesn't start it immediately