Browse Source

mkiso, mklive: add asahi support

classabbyamp 4 months ago
parent
commit
82ab401e4e
2 changed files with 35 additions and 5 deletions
  1. 27 5
      mkiso.sh
  2. 8 0
      mklive.sh

+ 27 - 5
mkiso.sh

@@ -19,7 +19,7 @@ usage() {
 	Adds void-installer and other helpful utilities to the generated images.
 	Adds void-installer and other helpful utilities to the generated images.
 
 
 	OPTIONS
 	OPTIONS
-	 -a <arch>     Set XBPS_ARCH in the image
+	 -a <arch>     Set architecture (or platform) in the image
 	 -b <variant>  One of base, enlightenment, xfce, mate, cinnamon, gnome, kde,
 	 -b <variant>  One of base, enlightenment, xfce, mate, cinnamon, gnome, kde,
 	               lxde, or lxqt (default: base). May be specified multiple times
 	               lxde, or lxqt (default: base). May be specified multiple times
 	               to build multiple variants
 	               to build multiple variants
@@ -71,6 +71,12 @@ include_installer() {
 
 
 setup_pipewire() {
 setup_pipewire() {
     PKGS="$PKGS pipewire alsa-pipewire"
     PKGS="$PKGS pipewire alsa-pipewire"
+    case "$ARCH" in
+        asahi*)
+            PKGS="$PKGS asahi-audio"
+            SERVICES="$SERVICES speakersafetyd"
+            ;;
+    esac
     mkdir -p "$INCLUDEDIR"/etc/xdg/autostart
     mkdir -p "$INCLUDEDIR"/etc/xdg/autostart
     ln -sf /usr/share/applications/pipewire.desktop "$INCLUDEDIR"/etc/xdg/autostart/
     ln -sf /usr/share/applications/pipewire.desktop "$INCLUDEDIR"/etc/xdg/autostart/
     mkdir -p "$INCLUDEDIR"/etc/pipewire/pipewire.conf.d
     mkdir -p "$INCLUDEDIR"/etc/pipewire/pipewire.conf.d
@@ -91,13 +97,28 @@ build_variant() {
     # thus everyone should just do a chroot install anyways
     # thus everyone should just do a chroot install anyways
     WANT_INSTALLER=no
     WANT_INSTALLER=no
     case "$ARCH" in
     case "$ARCH" in
-        x86_64*|i686*) GRUB_PKGS="grub-i386-efi grub-x86_64-efi"; WANT_INSTALLER=yes ;;
-        aarch64*) GRUB_PKGS="grub-arm64-efi" ;;
+        x86_64*|i686*)
+            GRUB_PKGS="grub-i386-efi grub-x86_64-efi"
+            GFX_PKGS="xorg-video-drivers"
+            WANT_INSTALLER=yes
+            TARGET_ARCH="$ARCH"
+            ;;
+        aarch64*)
+            GRUB_PKGS="grub-arm64-efi"
+            GFX_PKGS="xorg-video-drivers"
+            TARGET_ARCH="$ARCH"
+            ;;
+        asahi*)
+            GRUB_PKGS="asahi-base asahi-scripts grub-arm64-efi"
+            GFX_PKGS="mesa-asahi-dri"
+            KERNEL_PKG="linux-asahi"
+            TARGET_ARCH="aarch64${ARCH#asahi}"
+            ;;
     esac
     esac
 
 
     A11Y_PKGS="espeakup void-live-audio brltty"
     A11Y_PKGS="espeakup void-live-audio brltty"
     PKGS="dialog cryptsetup lvm2 mdadm void-docs-browse xtools-minimal xmirror chrony tmux $A11Y_PKGS $GRUB_PKGS"
     PKGS="dialog cryptsetup lvm2 mdadm void-docs-browse xtools-minimal xmirror chrony tmux $A11Y_PKGS $GRUB_PKGS"
-    XORG_PKGS="xorg-minimal xorg-input-drivers xorg-video-drivers setxkbmap xauth font-misc-misc terminus-font dejavu-fonts-ttf orca"
+    XORG_PKGS="$GFX_PKGS xorg-minimal xorg-input-drivers setxkbmap xauth font-misc-misc terminus-font dejavu-fonts-ttf orca"
     SERVICES="sshd chronyd"
     SERVICES="sshd chronyd"
 
 
     LIGHTDM_SESSION=''
     LIGHTDM_SESSION=''
@@ -171,7 +192,8 @@ EOF
         setup_pipewire
         setup_pipewire
     fi
     fi
 
 
-    ./mklive.sh -a "$ARCH" -o "$IMG" -p "$PKGS" -S "$SERVICES" -I "$INCLUDEDIR" ${REPO} "$@"
+    ./mklive.sh -a "$TARGET_ARCH" -o "$IMG" -p "$PKGS" -S "$SERVICES" -I "$INCLUDEDIR" \
+        ${KERNEL_PKG:+-v $KERNEL_PKG} ${REPO} "$@"
 
 
 	cleanup
 	cleanup
 }
 }

+ 8 - 0
mklive.sh

@@ -626,6 +626,10 @@ case "$LINUX_VERSION" in
         PACKAGE_LIST+=("$LINUX_VERSION")
         PACKAGE_LIST+=("$LINUX_VERSION")
         LINUX_VERSION="$(XBPS_ARCH=$TARGET_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -x "$LINUX_VERSION" | grep 'linux[0-9._]\+')"
         LINUX_VERSION="$(XBPS_ARCH=$TARGET_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -x "$LINUX_VERSION" | grep 'linux[0-9._]\+')"
         ;;
         ;;
+    linux-asahi)
+        IGNORE_PKGS+=(linux)
+        PACKAGE_LIST+=(linux-asahi linux-base)
+        ;;
     linux)
     linux)
         PACKAGE_LIST+=(linux)
         PACKAGE_LIST+=(linux)
         LINUX_VERSION="$(XBPS_ARCH=$TARGET_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -x linux | grep 'linux[0-9._]\+')"
         LINUX_VERSION="$(XBPS_ARCH=$TARGET_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -x linux | grep 'linux[0-9._]\+')"
@@ -639,6 +643,10 @@ shopt -u extglob
 _kver="$(XBPS_ARCH=$TARGET_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -p pkgver $LINUX_VERSION)"
 _kver="$(XBPS_ARCH=$TARGET_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -p pkgver $LINUX_VERSION)"
 KERNELVERSION=$($XBPS_UHELPER_CMD getpkgversion ${_kver})
 KERNELVERSION=$($XBPS_UHELPER_CMD getpkgversion ${_kver})
 
 
+if [ "$LINUX_VERSION" = linux-asahi ]; then
+    KERNELVERSION="${KERNELVERSION%%_*}-asahi_${KERNELVERSION##*_}"
+fi
+
 if [ "$?" -ne "0" ]; then
 if [ "$?" -ne "0" ]; then
     die "Failed to find kernel package version"
     die "Failed to find kernel package version"
 fi
 fi