From 389a477dc780a87b3bed8dc80ba20e1e422da9db Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 17 Jul 2024 17:29:17 +0000 Subject: [PATCH 01/25] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 6b86b9e824ae17da1b745d3a81a36bb87e8534a3 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 22 Aug 2024 19:17:38 +0200 Subject: [PATCH 02/25] Update to 20240822 new package asahi-battery to restore non-persistent EC settings on boot --- asahi-scripts.spec | 19 ++++++++++++++++++- sources | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/asahi-scripts.spec b/asahi-scripts.spec index 8437831..fbb0d53 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -1,5 +1,5 @@ Name: asahi-scripts -Version: 20240429 +Version: 20240822 Release: %autorelease Summary: Miscellaneous admin scripts for Asahi Linux @@ -69,6 +69,18 @@ Requires: uboot-images-armv8 %description -n update-m1n1 Keep m1n1 up to date on Apple Silicon systems. +%package -n asahi-battery +Summary: Asahi Linux battery charge control scripts + +Requires: %{name} = %{version}-%{release} +Requires: systemd +Requires: systemd-udev +Provides: asahi-battery = %{version}-%{release} + +%description -n asahi-battery +Asahi Linux battery charge control scripts restore charge_control_end_threshold +on system start. + %prep %autosetup -p1 @@ -120,5 +132,10 @@ grep -q 'asahi_firmware' && %{_sbindir}/asahi-fwupdate || : %config(noreplace) %{_sysconfdir}/sysconfig/update-m1n1 %{_sbindir}/update-m1n1 +%files -n asahi-battery +%{_unitdir}/macsmc-battery-charge-control-end-threshold.path +%{_unitdir}/macsmc-battery-charge-control-end-threshold.service +%{_udevrulesdir}/93-macsmc-battery-charge-control.rules + %changelog %autochangelog diff --git a/sources b/sources index 9206cb0..f865d3a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (asahi-scripts-20240429.tar.gz) = c722c82b0bf4f41114129d5b88cb269e0a4c9143acae7c7ba23b2b21c86428d8fdbb38bbdd6cd2f81b631e8ca5d0617b2d0ce3efe5d72986d2e9dc01bbe4cb5d +SHA512 (asahi-scripts-20240822.tar.gz) = 6b99abe8df63b928285d6af54ba745bf9ae7a53f3208c77b90158fa076d34feb091275343039b61320fc043b6021170ad63f0e6df933e6a0a3fbfe146f78caf5 From 83bc7c125929c58d22d6986aaf1e6890ff863517 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 22 Aug 2024 19:52:50 +0200 Subject: [PATCH 03/25] Add missed .gitignore update for asahi-scripts-20240822 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f2f9498..ee60eac 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /asahi-scripts-20231219.1.tar.gz /asahi-scripts-20240411.tar.gz /asahi-scripts-20240429.tar.gz +/asahi-scripts-20240822.tar.gz From bc19f28cacc2f35db3edc689710e9963dc88534b Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 22 Aug 2024 20:09:49 +0200 Subject: [PATCH 04/25] Add missing build requirement systemd-rpm-macros for asahi-battery --- asahi-scripts.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/asahi-scripts.spec b/asahi-scripts.spec index fbb0d53..6c3ad83 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -72,6 +72,7 @@ Keep m1n1 up to date on Apple Silicon systems. %package -n asahi-battery Summary: Asahi Linux battery charge control scripts +BuildRequires: systemd-rpm-macros Requires: %{name} = %{version}-%{release} Requires: systemd Requires: systemd-udev From 1f02188ff771dfae63b459f3323a2d60f8b75786 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jan 2025 11:36:38 +0000 Subject: [PATCH 05/25] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 376fa841fb8ff8f4a78fb41649a39ea53661b513 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Fri, 8 Nov 2024 09:31:46 +0100 Subject: [PATCH 06/25] update-m1n1: limit config to DTBs Mx (Pro/Max/Ultra) based devices --- update-m1n1.sysconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/update-m1n1.sysconfig b/update-m1n1.sysconfig index c3cc360..3f06fc8 100644 --- a/update-m1n1.sysconfig +++ b/update-m1n1.sysconfig @@ -1,3 +1,4 @@ M1N1="/usr/lib64/m1n1/m1n1.bin" U_BOOT="/usr/share/uboot/apple_m1/u-boot-nodtb.bin" -DTBS=/boot/dtb/apple/* +# limit DTBS to Mx and Mx Pro/Max/Ultra +DTBS="/boot/dtb/apple/t6*.dtb /boot/dtb/apple/t81*.dtb" From 9d0aa9aa6730b7f566b7e003d6b586872fb4b236 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Tue, 28 Jan 2025 21:06:45 +0900 Subject: [PATCH 07/25] Update to 20250128 --- .gitignore | 1 + asahi-scripts.spec | 2 +- sources | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ee60eac..e86d22c 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /asahi-scripts-20240411.tar.gz /asahi-scripts-20240429.tar.gz /asahi-scripts-20240822.tar.gz +/asahi-scripts-20250128.tar.gz diff --git a/asahi-scripts.spec b/asahi-scripts.spec index 6c3ad83..6e85808 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -1,5 +1,5 @@ Name: asahi-scripts -Version: 20240822 +Version: 20250128 Release: %autorelease Summary: Miscellaneous admin scripts for Asahi Linux diff --git a/sources b/sources index f865d3a..fb245c0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (asahi-scripts-20240822.tar.gz) = 6b99abe8df63b928285d6af54ba745bf9ae7a53f3208c77b90158fa076d34feb091275343039b61320fc043b6021170ad63f0e6df933e6a0a3fbfe146f78caf5 +SHA512 (asahi-scripts-20250128.tar.gz) = cd9f7e7b0b87b340369994efbcb3885f8e5badcf358a08a80f1616e55d90c5468caec5cbdde88cd764c1ab7273df62d7cbcec304ec71e50575efeca71e588c24 From a425a997a2d61781c499be4ad382345bb3b6480f Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Sat, 28 Sep 2024 19:58:42 -0700 Subject: [PATCH 08/25] Drop expired obsoletes --- asahi-scripts.spec | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/asahi-scripts.spec b/asahi-scripts.spec index 6e85808..d1d9bb0 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -12,6 +12,7 @@ BuildArch: noarch BuildRequires: make BuildRequires: sed +BuildRequires: systemd-rpm-macros Requires: bash Requires: coreutils @@ -29,8 +30,6 @@ Summary: Asahi Linux firmware extractor Requires: %{name} = %{version}-%{release} # Not using python3dist(asahi-firmware) because its version is fixed Requires: python3-asahi_firmware >= 0.5.4 -Provides: asahi-fwextract = %{version}-%{release} -Obsoletes: asahi-fwextract < 20230530-2 %description -n asahi-fwupdate Asahi Linux firmware updater. @@ -40,10 +39,6 @@ Summary: Dracut config for Apple Silicon Macs Requires: dracut Requires: linux-firmware-vendor = %{version}-%{release} -Provides: dracut-config-asahi = %{version}-%{release} -Obsoletes: dracut-config-asahi < 20220821-5 -Provides: update-vendor-firmware = %{version}-%{release} -Obsoletes: update-vendor-firmware < 20220918.2-8 %description -n dracut-asahi Dracut config for Apple Silicon Macs. @@ -60,7 +55,6 @@ over properly from the initramfs. Summary: Keep m1n1 up to date Requires: %{name} = %{version}-%{release} - Requires: bash Requires: gzip Requires: m1n1 @@ -72,11 +66,9 @@ Keep m1n1 up to date on Apple Silicon systems. %package -n asahi-battery Summary: Asahi Linux battery charge control scripts -BuildRequires: systemd-rpm-macros Requires: %{name} = %{version}-%{release} Requires: systemd Requires: systemd-udev -Provides: asahi-battery = %{version}-%{release} %description -n asahi-battery Asahi Linux battery charge control scripts restore charge_control_end_threshold From e4e1bf166efb37e03d8277b66058b7e328f71fa0 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Thu, 30 Jan 2025 23:56:40 +0900 Subject: [PATCH 09/25] Update to 20250130 Moves /etc/m1n1.conf from this package to m1n1. --- .gitignore | 1 + asahi-scripts.spec | 5 +++-- sources | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e86d22c..f024f39 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ /asahi-scripts-20240429.tar.gz /asahi-scripts-20240822.tar.gz /asahi-scripts-20250128.tar.gz +/asahi-scripts-20250130.tar.gz diff --git a/asahi-scripts.spec b/asahi-scripts.spec index d1d9bb0..8ac67ea 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -1,5 +1,5 @@ Name: asahi-scripts -Version: 20250128 +Version: 20250130 Release: %autorelease Summary: Miscellaneous admin scripts for Asahi Linux @@ -30,6 +30,8 @@ Summary: Asahi Linux firmware extractor Requires: %{name} = %{version}-%{release} # Not using python3dist(asahi-firmware) because its version is fixed Requires: python3-asahi_firmware >= 0.5.4 +# m1n1.conf moved from this package to m1n1 +Obsoletes: asahi-scripts < 20250130 %description -n asahi-fwupdate Asahi Linux firmware updater. @@ -121,7 +123,6 @@ grep -q 'asahi_firmware' && %{_sbindir}/asahi-fwupdate || : %files -n update-m1n1 %license LICENSE -%config(noreplace) %{_sysconfdir}/m1n1.conf %config(noreplace) %{_sysconfdir}/sysconfig/update-m1n1 %{_sbindir}/update-m1n1 diff --git a/sources b/sources index fb245c0..54e2110 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (asahi-scripts-20250128.tar.gz) = cd9f7e7b0b87b340369994efbcb3885f8e5badcf358a08a80f1616e55d90c5468caec5cbdde88cd764c1ab7273df62d7cbcec304ec71e50575efeca71e588c24 +SHA512 (asahi-scripts-20250130.tar.gz) = 87052bc66c74d616021abe1a62481800e11a6a73889717d02bc581e723915ba8c8ffced4e17b53d35e33d2bf85e91d1c9c1a2dca462ceb62ac88d736fba5d9ee From 98044933e685d1ea407a637be4bf0f200ef1fd26 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Mon, 3 Feb 2025 21:40:40 +0900 Subject: [PATCH 10/25] Fix dependencies --- asahi-scripts.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/asahi-scripts.spec b/asahi-scripts.spec index 8ac67ea..2583264 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -19,6 +19,8 @@ Requires: coreutils Requires: grep Requires: sed Requires: util-linux-core +# m1n1.conf moved from this package to m1n1 +Obsoletes: asahi-scripts < 20250130 %description This package contains miscellaneous admin scripts for the Asahi Linux reference @@ -30,8 +32,6 @@ Summary: Asahi Linux firmware extractor Requires: %{name} = %{version}-%{release} # Not using python3dist(asahi-firmware) because its version is fixed Requires: python3-asahi_firmware >= 0.5.4 -# m1n1.conf moved from this package to m1n1 -Obsoletes: asahi-scripts < 20250130 %description -n asahi-fwupdate Asahi Linux firmware updater. @@ -59,7 +59,7 @@ Summary: Keep m1n1 up to date Requires: %{name} = %{version}-%{release} Requires: bash Requires: gzip -Requires: m1n1 +Requires: m1n1 >= 1.4.21 Requires: uboot-images-armv8 %description -n update-m1n1 From c1ad434f9636b802cc6051afaee689a878729190 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Mon, 3 Feb 2025 21:54:28 +0900 Subject: [PATCH 11/25] Fix dependencies again? Third time's the charm, maybe? --- asahi-scripts.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asahi-scripts.spec b/asahi-scripts.spec index 2583264..937cdc9 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -19,8 +19,6 @@ Requires: coreutils Requires: grep Requires: sed Requires: util-linux-core -# m1n1.conf moved from this package to m1n1 -Obsoletes: asahi-scripts < 20250130 %description This package contains miscellaneous admin scripts for the Asahi Linux reference @@ -61,6 +59,8 @@ Requires: bash Requires: gzip Requires: m1n1 >= 1.4.21 Requires: uboot-images-armv8 +# m1n1.conf moved from this package to m1n1 +Obsoletes: asahi-scripts < 20250130 %description -n update-m1n1 Keep m1n1 up to date on Apple Silicon systems. From 7b9c0fa3a02d15084f8ab931f3267b2c02266353 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Mon, 3 Feb 2025 21:55:18 +0900 Subject: [PATCH 12/25] Argh. --- asahi-scripts.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asahi-scripts.spec b/asahi-scripts.spec index 937cdc9..75083c2 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -60,7 +60,7 @@ Requires: gzip Requires: m1n1 >= 1.4.21 Requires: uboot-images-armv8 # m1n1.conf moved from this package to m1n1 -Obsoletes: asahi-scripts < 20250130 +Obsoletes: update-m1n1 < 20250130 %description -n update-m1n1 Keep m1n1 up to date on Apple Silicon systems. From 9c406f8ce9929452c376aacd46241720b552be0d Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Tue, 4 Feb 2025 04:26:24 +0900 Subject: [PATCH 13/25] Give up on the obsoletes dance This didn't work with dnf. Drop /etc/m1n1.conf entirely, let users copy it from the example file in the m1n1 package if they wish. --- asahi-scripts.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/asahi-scripts.spec b/asahi-scripts.spec index 75083c2..a75a3e4 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -57,10 +57,8 @@ Summary: Keep m1n1 up to date Requires: %{name} = %{version}-%{release} Requires: bash Requires: gzip -Requires: m1n1 >= 1.4.21 +Requires: m1n1 Requires: uboot-images-armv8 -# m1n1.conf moved from this package to m1n1 -Obsoletes: update-m1n1 < 20250130 %description -n update-m1n1 Keep m1n1 up to date on Apple Silicon systems. From aef3d9127c1f1e361e72a538afdabc2bd6a5d176 Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Wed, 16 Apr 2025 14:51:55 -0700 Subject: [PATCH 14/25] Trigger update-m1n1 on config changes --- asahi-scripts.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asahi-scripts.spec b/asahi-scripts.spec index a75a3e4..c6d32bc 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -97,7 +97,7 @@ install -Dpm0644 %SOURCE1 %{buildroot}%{_sysconfdir}/sysconfig/update-m1n1 grep -q 'asahi_firmware' && %{_sbindir}/asahi-fwupdate || : # We can't use _libdir here because it gets incorrectly expanded to /usr/lib -%transfiletriggerin -n update-m1n1 -- /usr/lib/m1n1 /usr/lib64/m1n1 /usr/share/uboot/apple_m1 /boot/dtb- +%transfiletriggerin -n update-m1n1 -- /usr/lib/m1n1 /usr/lib64/m1n1 /usr/share/uboot/apple_m1 /boot/dtb- /etc/m1n1.conf %{_sbindir}/update-m1n1 || : %files From 22d55c43910abfc74e6ed9c84656f333e26b7b1d Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Sat, 26 Apr 2025 15:34:47 -0700 Subject: [PATCH 15/25] Update to 20250426.1; Fixes: RHBZ#2293832 --- .gitignore | 2 ++ asahi-scripts.spec | 4 +++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f024f39..34dff6e 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ /asahi-scripts-20240822.tar.gz /asahi-scripts-20250128.tar.gz /asahi-scripts-20250130.tar.gz +/asahi-scripts-20250426.tar.gz +/asahi-scripts-20250426.1.tar.gz diff --git a/asahi-scripts.spec b/asahi-scripts.spec index c6d32bc..17f48e9 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -1,5 +1,5 @@ Name: asahi-scripts -Version: 20250130 +Version: 20250426.1 Release: %autorelease Summary: Miscellaneous admin scripts for Asahi Linux @@ -18,6 +18,7 @@ Requires: bash Requires: coreutils Requires: grep Requires: sed +Requires: systemd-udev Requires: util-linux-core %description @@ -104,6 +105,7 @@ grep -q 'asahi_firmware' && %{_sbindir}/asahi-fwupdate || : %license LICENSE %{_datadir}/%{name}/ %{_sbindir}/asahi-diagnose +%{_udevhwdbdir}/65-autosuspend-override-asahi-sdhci.hwdb %files -n asahi-fwupdate %license LICENSE diff --git a/sources b/sources index 54e2110..c7e1eea 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (asahi-scripts-20250130.tar.gz) = 87052bc66c74d616021abe1a62481800e11a6a73889717d02bc581e723915ba8c8ffced4e17b53d35e33d2bf85e91d1c9c1a2dca462ceb62ac88d736fba5d9ee +SHA512 (asahi-scripts-20250426.1.tar.gz) = b92ff0b2c90a0fc10206cc1124d191d6b7658050e46c6ecd8475a098b9e2670c421288e32acf2d9e51a44355857b5078ec1f200b132b3e9539ec948254d3f91e From dfca4e0e1aeff7cfa78ae7574800aa6befb40339 Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Fri, 30 May 2025 19:38:56 -0700 Subject: [PATCH 16/25] Own the macsmc-battery config file --- asahi-scripts.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/asahi-scripts.spec b/asahi-scripts.spec index 17f48e9..6256a86 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -130,6 +130,7 @@ grep -q 'asahi_firmware' && %{_sbindir}/asahi-fwupdate || : %{_unitdir}/macsmc-battery-charge-control-end-threshold.path %{_unitdir}/macsmc-battery-charge-control-end-threshold.service %{_udevrulesdir}/93-macsmc-battery-charge-control.rules +%ghost %config(noreplace) %{_sysconfdir}/udev/macsmc-battery.conf %changelog %autochangelog From 5f59936d3cb8d1feecf3dfbb6f3358f1d6eed3ac Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sun, 27 Apr 2025 11:46:31 +0200 Subject: [PATCH 17/25] update-m1n1: Depend on grubby for the /boot/dtb symlink --- asahi-scripts.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/asahi-scripts.spec b/asahi-scripts.spec index 6256a86..058fbbb 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -60,6 +60,9 @@ Requires: bash Requires: gzip Requires: m1n1 Requires: uboot-images-armv8 +# grubby's /usr/lib/kernel/install.d/10-devicetree.install creates the +# /boot/dtb symlink update-m1n1 uses to construct the 2nd stage m1n1 image +Requires: grubby %description -n update-m1n1 Keep m1n1 up to date on Apple Silicon systems. From 6507e7f0a2b3d9ea1b7ae89ac083085656ba256a Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sun, 27 Apr 2025 12:54:47 +0200 Subject: [PATCH 18/25] update-m1n1: Use kernel-install script instead of filetrigger for dtb updates This has various advantages: - a failure can prevent kernel-install to create a boot loader entry which in the worst case won't boot due to a 2nd stage m1n1 dtbs vs. kernel mismatch - It would allow to replicate the logic in grubby's 10-devicetree.install to avoid the dependency and work without /boot/dtb symlink. This would simplify the integration for immutable Fedora-Asahi-Remix variants. - it is easier to discover as /usr/lib/kernel/install.d is the expected place for scripts to trigger during kernel installation/removal. - It ensures update-m1n1 runs after the symlink is updated. The ordering between the filetrigger and kernel-install during package updates is not obviously clear. There is no rollback mechanism if the kernel-install fails but this should not differ from the filetrigger. --- 15-update-m1n1.install | 20 ++++++++++++++++++++ asahi-scripts.spec | 7 ++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 15-update-m1n1.install diff --git a/15-update-m1n1.install b/15-update-m1n1.install new file mode 100644 index 0000000..0af1ead --- /dev/null +++ b/15-update-m1n1.install @@ -0,0 +1,20 @@ +#!/usr/bin/sh +# SPDX-License-Identifier: MIT +# thin wrapper to execute `update-m1n1` on kernel updates + +COMMAND="$1" + +# exit early on non Apple sislicon systems +if ! grep -q "apple,arm-platforms" /proc/device-tree/compatible; then + exit 0 +fi + +case "${COMMAND}" in + # always run update-m1n1 and rely on its no change detection for removals + # of old kernels. + add|remove) + exec /usr/bin/update-m1n1 + ;; +esac + +exit 0 diff --git a/asahi-scripts.spec b/asahi-scripts.spec index 058fbbb..d7c1e28 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -7,6 +7,7 @@ License: MIT URL: https://github.com/AsahiLinux/asahi-scripts Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Source: update-m1n1.sysconfig +Source2: 15-update-m1n1.install BuildArch: noarch @@ -92,6 +93,9 @@ on system start. install -Ddpm0755 %{buildroot}%{_prefix}/lib/firmware/vendor install -Dpm0644 %SOURCE1 %{buildroot}%{_sysconfdir}/sysconfig/update-m1n1 +# Install kernel-install script +install -d -m 0755 %{buildroot}%{_kernel_install_dir} +install -D -m 0755 -t %{buildroot}%{_kernel_install_dir} %{SOURCE2} %transfiletriggerin -n asahi-fwupdate -- %{_sbindir}/asahi-fwupdate %{_bindir}/asahi-fwextract %{_sbindir}/asahi-fwupdate || : @@ -101,7 +105,7 @@ install -Dpm0644 %SOURCE1 %{buildroot}%{_sysconfdir}/sysconfig/update-m1n1 grep -q 'asahi_firmware' && %{_sbindir}/asahi-fwupdate || : # We can't use _libdir here because it gets incorrectly expanded to /usr/lib -%transfiletriggerin -n update-m1n1 -- /usr/lib/m1n1 /usr/lib64/m1n1 /usr/share/uboot/apple_m1 /boot/dtb- /etc/m1n1.conf +%transfiletriggerin -n update-m1n1 -- /usr/lib/m1n1 /usr/lib64/m1n1 /usr/share/uboot/apple_m1 /etc/m1n1.conf %{_sbindir}/update-m1n1 || : %files @@ -127,6 +131,7 @@ grep -q 'asahi_firmware' && %{_sbindir}/asahi-fwupdate || : %files -n update-m1n1 %license LICENSE %config(noreplace) %{_sysconfdir}/sysconfig/update-m1n1 +%{_kernel_install_dir}/15-update-m1n1.install %{_sbindir}/update-m1n1 %files -n asahi-battery From 49e26631ee61a0ea646b9ffc0b663ca75def5274 Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Sun, 13 Jul 2025 19:00:27 -0700 Subject: [PATCH 19/25] Preserve timestamps when installing the kernel-install script --- asahi-scripts.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/asahi-scripts.spec b/asahi-scripts.spec index d7c1e28..21c14b4 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -94,8 +94,7 @@ on system start. install -Ddpm0755 %{buildroot}%{_prefix}/lib/firmware/vendor install -Dpm0644 %SOURCE1 %{buildroot}%{_sysconfdir}/sysconfig/update-m1n1 # Install kernel-install script -install -d -m 0755 %{buildroot}%{_kernel_install_dir} -install -D -m 0755 -t %{buildroot}%{_kernel_install_dir} %{SOURCE2} +install -Dpm0755 -t %{buildroot}%{_kernel_install_dir} %{SOURCE2} %transfiletriggerin -n asahi-fwupdate -- %{_sbindir}/asahi-fwupdate %{_bindir}/asahi-fwextract %{_sbindir}/asahi-fwupdate || : From 65b4ede4992b78b0ee018cdc3bfecdffd3f1d943 Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Sun, 13 Jul 2025 19:00:49 -0700 Subject: [PATCH 20/25] Update to 20250713 --- .gitignore | 1 + asahi-scripts.spec | 2 +- sources | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 34dff6e..6b7eb95 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /asahi-scripts-20250130.tar.gz /asahi-scripts-20250426.tar.gz /asahi-scripts-20250426.1.tar.gz +/asahi-scripts-20250713.tar.gz diff --git a/asahi-scripts.spec b/asahi-scripts.spec index 21c14b4..ab7efa1 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -1,5 +1,5 @@ Name: asahi-scripts -Version: 20250426.1 +Version: 20250713 Release: %autorelease Summary: Miscellaneous admin scripts for Asahi Linux diff --git a/sources b/sources index c7e1eea..46303e9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (asahi-scripts-20250426.1.tar.gz) = b92ff0b2c90a0fc10206cc1124d191d6b7658050e46c6ecd8475a098b9e2670c421288e32acf2d9e51a44355857b5078ec1f200b132b3e9539ec948254d3f91e +SHA512 (asahi-scripts-20250713.tar.gz) = cb94711a556e4b8b4e171540d7026f93ad03afe3a359e8888bc63c09a17d521af1da3299fd3af89ad1fd3c3cb55b0b508ae307b4a9dacb48d45bbdfa50e4f767 From 2f5f6f8562b85af936247c1ed17759ee802dc420 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 17:16:00 +0000 Subject: [PATCH 21/25] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 8e7ac9580a1d4cddf31c21b9b17c66e4e604d1dc Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Mon, 18 Aug 2025 09:10:03 +0200 Subject: [PATCH 22/25] Fix typos in update-m1n1 kernel install script --- 15-update-m1n1.install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/15-update-m1n1.install b/15-update-m1n1.install index 0af1ead..284cb6a 100644 --- a/15-update-m1n1.install +++ b/15-update-m1n1.install @@ -4,8 +4,8 @@ COMMAND="$1" -# exit early on non Apple sislicon systems -if ! grep -q "apple,arm-platforms" /proc/device-tree/compatible; then +# exit early on non Apple silicon systems +if ! grep -q "apple,arm-platform" /proc/device-tree/compatible; then exit 0 fi From eb78052afdd99b9061c33dd40a67d110d99e1886 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Tue, 19 Aug 2025 23:16:25 +0200 Subject: [PATCH 23/25] Fix update-m1n1 invocation from `kernel-install add ...` At the time kernel-install runs 15-update-m1n1.install "/boot/dtb" might be a dangling symlink as /boot/dtb-${KERNEL_VERSION} has not yet been created. Take advantage of the proposed $DTBS directory support [1] and use "/boot/dtb" as DTBS default location. Add an fedora specific patch to detect the dangling symlink and use the dtb directory from the kernel's modules directory in /usr/lib/modules. 1: https://github.com/AsahiLinux/asahi-scripts/pull/67 --- ...1n1-Expand-DTBS-if-it-is-a-directory.patch | 35 ++++++++++++++++++ ...n1-handle-dangling-boot-dtb-symlinks.patch | 36 +++++++++++++++++++ asahi-scripts.spec | 3 ++ update-m1n1.sysconfig | 2 +- 4 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 0001-update-m1n1-Expand-DTBS-if-it-is-a-directory.patch create mode 100644 0002-fedora-update-m1n1-handle-dangling-boot-dtb-symlinks.patch diff --git a/0001-update-m1n1-Expand-DTBS-if-it-is-a-directory.patch b/0001-update-m1n1-Expand-DTBS-if-it-is-a-directory.patch new file mode 100644 index 0000000..e9659e7 --- /dev/null +++ b/0001-update-m1n1-Expand-DTBS-if-it-is-a-directory.patch @@ -0,0 +1,35 @@ +From 5fb7712c7c2692b77c21a6d799db29f6cefb388f Mon Sep 17 00:00:00 2001 +From: Janne Grunau +Date: Tue, 19 Aug 2025 22:55:33 +0200 +Subject: [PATCH 1/2] update-m1n1: Expand $DTBS if it is a directory + +Allows limiting the included devices to Apple silicon macs now that the +kernel has device-trees for iphones, ipads and T2 macs as well. +Avoids having each distribution to modify their default update-m1n1 +configuration for this. + +Signed-off-by: Janne Grunau +--- + update-m1n1 | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/update-m1n1 b/update-m1n1 +index ae274eb..dcd79fa 100755 +--- a/update-m1n1 ++++ b/update-m1n1 +@@ -24,6 +24,12 @@ if [ -z "$DTBS" ]; then + exit 1 + fi + ++# If ${DTBS} is a directory expand it to include dtbs from all Apple silicon ++# macs. ++if [ -d "$DTBS" ]; then ++ DTBS="${DTBS}/apple/t6*.dtb ${DTBS}/apple/t81*.dtb" ++fi ++ + umount=false + + m1n1config=/run/m1n1.conf +-- +2.50.1 + diff --git a/0002-fedora-update-m1n1-handle-dangling-boot-dtb-symlinks.patch b/0002-fedora-update-m1n1-handle-dangling-boot-dtb-symlinks.patch new file mode 100644 index 0000000..9507e81 --- /dev/null +++ b/0002-fedora-update-m1n1-handle-dangling-boot-dtb-symlinks.patch @@ -0,0 +1,36 @@ +From d24ee482717237afbf6cbbbabbd0dd4eea772f8a Mon Sep 17 00:00:00 2001 +From: Janne Grunau +Date: Tue, 19 Aug 2025 23:10:23 +0200 +Subject: [PATCH 2/2] fedora: update-m1n1: handle dangling /boot/dtb symlinks + +At kernel-install time the target of the /boot/dtb symlink might not +exists yet for newly installed targets. Use +"/usr/lib/modules/${KERNEL_VERSION}/dtb" instead. + +Signed-off-by: Janne Grunau +--- + update-m1n1 | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/update-m1n1 b/update-m1n1 +index dcd79fa..87de029 100755 +--- a/update-m1n1 ++++ b/update-m1n1 +@@ -24,6 +24,14 @@ if [ -z "$DTBS" ]; then + exit 1 + fi + ++# Fedora: handle broken /boot/dtb symlinks by reading the link, ++# extracting the kernel version and using the dtb directory from ++# "/usr/lib/modules/${KERNEL_VERSION}/". ++if [ -L "$DTBS" -a ! -d "$DTBS" ]; then ++ KVER=$(readlink "$DTBS" | sed -e 's/^dtb-//') ++ DTBS="/usr/lib/modules/${KVER}/dtb" ++fi ++ + # If ${DTBS} is a directory expand it to include dtbs from all Apple silicon + # macs. + if [ -d "$DTBS" ]; then +-- +2.50.1 + diff --git a/asahi-scripts.spec b/asahi-scripts.spec index ab7efa1..ecd42cb 100644 --- a/asahi-scripts.spec +++ b/asahi-scripts.spec @@ -9,6 +9,9 @@ Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Source: update-m1n1.sysconfig Source2: 15-update-m1n1.install +Patch01: 0001-update-m1n1-Expand-DTBS-if-it-is-a-directory.patch +Patch02: 0002-fedora-update-m1n1-handle-dangling-boot-dtb-symlinks.patch + BuildArch: noarch BuildRequires: make diff --git a/update-m1n1.sysconfig b/update-m1n1.sysconfig index 3f06fc8..68b20fb 100644 --- a/update-m1n1.sysconfig +++ b/update-m1n1.sysconfig @@ -1,4 +1,4 @@ M1N1="/usr/lib64/m1n1/m1n1.bin" U_BOOT="/usr/share/uboot/apple_m1/u-boot-nodtb.bin" # limit DTBS to Mx and Mx Pro/Max/Ultra -DTBS="/boot/dtb/apple/t6*.dtb /boot/dtb/apple/t81*.dtb" +DTBS="/boot/dtb" From b1b17e6f4e36f6fcffb956250e2920af0ed7e67b Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Tue, 19 Aug 2025 23:27:00 +0200 Subject: [PATCH 24/25] Update 15-update-m1n1.install - has to run on generic aarch64 systems for install image generation, should probably always run if the installed kernel is an aarch64 kernel - add a note on the "10-devicetree.install" (grubby) dependency --- 15-update-m1n1.install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/15-update-m1n1.install b/15-update-m1n1.install index 284cb6a..b5ce56f 100644 --- a/15-update-m1n1.install +++ b/15-update-m1n1.install @@ -1,11 +1,13 @@ #!/usr/bin/sh # SPDX-License-Identifier: MIT # thin wrapper to execute `update-m1n1` on kernel updates +# depends on grubby's "10-devicetree.install" COMMAND="$1" -# exit early on non Apple silicon systems -if ! grep -q "apple,arm-platform" /proc/device-tree/compatible; then +# execute only on aarch64, can't check for Apple silicon systems as the install +# images are created on generic aarch64 systems. +if [ "$(uname -m)" != aarch64 ]; then exit 0 fi From a2ad8aace33e10d0d26bd8dd843efdb5ac94bf09 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 16 Jan 2026 03:57:03 +0000 Subject: [PATCH 25/25] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild