mbp-fedora-kernel icon indicating copy to clipboard operation
mbp-fedora-kernel copied to clipboard

Remove need for update script.

Open sharpenedblade opened this issue 3 years ago • 3 comments

If you add some post install hooks to the rpm, and build the modules with the kernel, then the update scripts are unnecessary.

sharpenedblade avatar Apr 21 '22 00:04 sharpenedblade

Name: linux-t2
Version: 5.18
Release: 1%{?dist}
Summary: System configuration for linux on t2 macs.

License: MIT
URL: https://t2linux.org
Source0: https://wiki.t2linux.org/tools/rmmod_tb.sh

%description
Configuration files for linux on t2 macs. The linux-t2 kernel is necessary for this to work, and this must be installed to boot. Everything works except for TouchId, eGPU, and audio switching.

%prep
cp %{_sourcedir}/* %{_builddir}

%build
echo -e 'hid-apple\nbcm5974\nsnd-seq\napple_bce' > apple_bce.conf

echo -e 'add_drivers+=" hid_apple snd-seq apple_bce "\nforce_drivers+=" hid_apple snd-seq apple_bce "' > apple_bce_install.conf

%install
mkdir -p %{buildroot}/etc/dracut.conf.d/
mv apple_bce_install.conf %{buildroot}/etc/dracut.conf.d/apple_bce_install.conf

mkdir -p %{buildroot}/etc/modules-load.d/
mv apple_bce.conf %{buildroot}/etc/modules-load.d/apple_bce.conf

mkdir -p %{buildroot}/lib/systemd/system-sleep
mv %{_builddir}/rmmod_tb.sh %{buildroot}/lib/systemd/system-sleep/rmmod_tb.sh
chmod +x %{buildroot}/lib/systemd/system-sleep/rmmod_tb.sh

%post
grubby --remove-args="efi=noruntime pcie_ports=compat" --update-kernel=ALL
grubby --args="efi=noruntime pcie_ports=compat" --update-kernel=ALL
sed -i '/^GRUB_ENABLE_BLSCFG=true/c\GRUB_ENABLE_BLSCFG=false' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg

%files
/etc/modules-load.d/apple_bce.conf
/lib/systemd/system-sleep/rmmod_tb.sh
/etc/dracut.conf.d/apple_bce_install.conf

This package removes the need for an install script. Whenever the suspend script, or grub config needs to change, just update this package, even if the kernel version is the same. To prevent the mainline kernel from being installed, this repo should have cost = 998 and priority = 98 in its *.repo file.

sharpenedblade avatar Jun 28 '22 18:06 sharpenedblade

You can enable BLS in grub, it works using this script, you have to use grubby to change kernel args, not edit the grub config file.

sharpenedblade avatar Jul 04 '22 20:07 sharpenedblade

Will be done in https://github.com/mikeeq/mbp-fedora-kernel/pull/66

mikeeq avatar Jul 30 '22 21:07 mikeeq

Done! Thanks for a suggestion!

mikeeq avatar Nov 04 '22 19:11 mikeeq