# A place to drop X13s machine configuration utilities, dependency and config scripts Name: x13s Version: 1.0 Release: 4%{?dist} Summary: A place to drop Lenovo X13s machine configuration utilities, dependency and config scripts License: GPLv2+ URL: https://pagure.io/x13s.git ExclusiveArch: aarch64 Source1: override.conf Source2: 72-x13s-touchscreen.rules Source3: 75-x13s.preset Source4: x13s.conf Requires: pd-mapper Requires: bluez Requires: dracut Requires: sed Requires: coreutils %description This package provides a configuration and meta package for the Lenovo X13s arm64 laptop. It pulls in required packages, and applies some simple config tweaking that otherwise requires user interaction. %prep %build %install install -Dm0644 %{SOURCE1} -t %{buildroot}%{_sysconfdir}/systemd/system/bluetooth.service.d/ install -Dm0644 %{SOURCE2} -t %{buildroot}%{_sysconfdir}/udev/rules.d/ install -Dm0644 %{SOURCE3} -t %{buildroot}%{_prefix}/lib/systemd/system-preset/ install -Dm0644 %{SOURCE4} -t %{buildroot}%{_sysconfdir}/dracut.conf.d/ %post # clear out the qcom_q6v5_pas, which will keep the power mgmt from working if [ -f %{_sysconfdir}/modprobe.d/anaconda-denylist.conf ]; then # 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 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 /usr/bin/sed -ie "s/XX/`/usr/bin/printf "%2.2X\n" $((RANDOM%256))`/g" %{_sysconfdir}/systemd/system/bluetooth.service.d/override.conf /usr/bin/sed -ie "s/YY/`/usr/bin/printf "%2.2X\n" $((RANDOM%256))`/g" %{_sysconfdir}/systemd/system/bluetooth.service.d/override.conf /usr/bin/sed -ie "s/ZZ/`/usr/bin/printf "%2.2X\n" $((RANDOM%256))`/g" %{_sysconfdir}/systemd/system/bluetooth.service.d/override.conf %files %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/systemd/system/bluetooth.service.d/override.conf %attr(0644,root,root) %{_sysconfdir}/udev/rules.d/72-x13s-touchscreen.rules %{_prefix}/lib/systemd/system-preset/75-x13s.preset %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/dracut.conf.d/x13s.conf %changelog * Thu Jun 20 2024 Jeremy Linton - 1.0-4 - Add the firmware to the initrd to correct battery monitor issues * 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 * Tue Dec 19 2023 Dennis Gilmore - 1.0-1 - Add preset file to enable pd-mapper, and minor build cleanups * Mon Dec 18 2023 Jeremy Linton - 1.0-0 - X13s sorta meta package for the x13s configuration.