From 04d575278cb736f6d59ffc4a6b7958949b4f861d Mon Sep 17 00:00:00 2001 From: claris Date: Sun, 27 Mar 2022 14:11:23 -0700 Subject: [PATCH] New package: asahi-base-20250103 --- srcpkgs/asahi-base/INSTALL | 3 +++ srcpkgs/asahi-base/files/tinyramfs-hook-asahi | 22 +++++++++++++++++++ .../files/tinyramfs-hook-asahi.init | 20 +++++++++++++++++ .../files/tinyramfs-hook-asahi.init.late | 9 ++++++++ srcpkgs/asahi-base/template | 17 ++++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 srcpkgs/asahi-base/INSTALL create mode 100644 srcpkgs/asahi-base/files/tinyramfs-hook-asahi create mode 100644 srcpkgs/asahi-base/files/tinyramfs-hook-asahi.init create mode 100644 srcpkgs/asahi-base/files/tinyramfs-hook-asahi.init.late create mode 100644 srcpkgs/asahi-base/template diff --git a/srcpkgs/asahi-base/INSTALL b/srcpkgs/asahi-base/INSTALL new file mode 100644 index 00000000000..f6b62ea2741 --- /dev/null +++ b/srcpkgs/asahi-base/INSTALL @@ -0,0 +1,3 @@ +if [ "${ACTION}" = "post" ] && [ "${UPDATE}" = "no" ]; then + ln -s /etc/sv/speakersafetyd /var/service +fi diff --git a/srcpkgs/asahi-base/files/tinyramfs-hook-asahi b/srcpkgs/asahi-base/files/tinyramfs-hook-asahi new file mode 100644 index 00000000000..c6a159bab2e --- /dev/null +++ b/srcpkgs/asahi-base/files/tinyramfs-hook-asahi @@ -0,0 +1,22 @@ +for _mod in \ + apple-mailbox \ + vfat \ + nvme_apple \ + pinctrl-apple-gpio \ + macsmc macsmc-rtkit \ + i2c-apple i2c-pasemi-platform tps6598x apple-dart dwc3 dwc3-of-simple xhci-pci pcie-apple \ + xhci-plat-hcd \ + nvme-apple-efuses phy-apple-atc gpio_macsmc \ + rtc-macsmc simple-mfd-spmi spmi-apple-controller nvmem_spmi_mfd \ + spi-apple spi-hid-apple spi-hid-apple-of \ + apple-dockchannel dockchannel-hid apple-rtkit-helper \ + apple-sio \ + mux-apple-display-crossbar phy-apple-dptx +do + copy_kmod "$_mod" +done + +for _bin in umount cpio cp grep cat sed seq +do + copy_exec "$_bin" +done diff --git a/srcpkgs/asahi-base/files/tinyramfs-hook-asahi.init b/srcpkgs/asahi-base/files/tinyramfs-hook-asahi.init new file mode 100644 index 00000000000..7f77e8d7493 --- /dev/null +++ b/srcpkgs/asahi-base/files/tinyramfs-hook-asahi.init @@ -0,0 +1,20 @@ +modprobe apple-mailbox +modprobe nvme-apple + +for i in $(seq 0 50); do + [ -e /sys/bus/platform/drivers/nvme-apple/*.nvme/nvme/nvme*/nvme*n1/ ] && break + sleep 0.1 +done + +print 'asahi: mounting ESP' +mountpoint=/run/.system-efi +mkdir -p "$mountpoint" +while grep -q "$mountpoint" /proc/mounts; do + umount "$mountpoint" +done +esp_uuid="$(cat /proc/device-tree/chosen/asahi,efi-system-partition 2> /dev/null | sed 's/\x00//')" +mount "PARTUUID=$esp_uuid" "$mountpoint" + +print 'asahi: unpacking vendor firmware into initramfs' +cpio -i < "$mountpoint/vendorfw/firmware.cpio" +umount "$mountpoint" diff --git a/srcpkgs/asahi-base/files/tinyramfs-hook-asahi.init.late b/srcpkgs/asahi-base/files/tinyramfs-hook-asahi.init.late new file mode 100644 index 00000000000..d8619f6d19a --- /dev/null +++ b/srcpkgs/asahi-base/files/tinyramfs-hook-asahi.init.late @@ -0,0 +1,9 @@ +[ -e /vendorfw ] || return 0 +print 'asahi: copying vendor firmware to root filesystem' +loaderdir=/mnt/root/lib/firmware/vendor +mkdir -p "$loaderdir" +mount -t tmpfs -o mode=0755 vendorfw "$loaderdir" + +set +f +cp -pr /vendorfw/* /vendorfw/.vendorfw.manifest "$loaderdir" +set -f diff --git a/srcpkgs/asahi-base/template b/srcpkgs/asahi-base/template new file mode 100644 index 00000000000..f486fa75fbb --- /dev/null +++ b/srcpkgs/asahi-base/template @@ -0,0 +1,17 @@ +# Template file for 'asahi-base' +pkgname=asahi-base +version=20250103 +revision=1 +archs="aarch64*" +build_style=meta +depends="linux-asahi m1n1 asahi-uboot speakersafetyd" +short_desc="Void Linux Apple Silicon support package" +maintainer="Will Springer , dkwo " +license="Public Domain" +homepage="https://asahilinux.org" + +do_install() { + vinstall "${FILESDIR}/tinyramfs-hook-asahi" 644 usr/lib/tinyramfs/hook.d/asahi asahi + vinstall "${FILESDIR}/tinyramfs-hook-asahi.init" 644 usr/lib/tinyramfs/hook.d/asahi asahi.init + vinstall "${FILESDIR}/tinyramfs-hook-asahi.init.late" 644 usr/lib/tinyramfs/hook.d/asahi asahi.init.late +}