Skip to content

Commit 82ab401

Browse files
committed
mkiso, mklive: add asahi support
1 parent 7f9a50e commit 82ab401

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

mkiso.sh

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ usage() {
1919
Adds void-installer and other helpful utilities to the generated images.
2020
2121
OPTIONS
22-
-a <arch> Set XBPS_ARCH in the image
22+
-a <arch> Set architecture (or platform) in the image
2323
-b <variant> One of base, enlightenment, xfce, mate, cinnamon, gnome, kde,
2424
lxde, or lxqt (default: base). May be specified multiple times
2525
to build multiple variants
@@ -71,6 +71,12 @@ include_installer() {
7171

7272
setup_pipewire() {
7373
PKGS="$PKGS pipewire alsa-pipewire"
74+
case "$ARCH" in
75+
asahi*)
76+
PKGS="$PKGS asahi-audio"
77+
SERVICES="$SERVICES speakersafetyd"
78+
;;
79+
esac
7480
mkdir -p "$INCLUDEDIR"/etc/xdg/autostart
7581
ln -sf /usr/share/applications/pipewire.desktop "$INCLUDEDIR"/etc/xdg/autostart/
7682
mkdir -p "$INCLUDEDIR"/etc/pipewire/pipewire.conf.d
@@ -91,13 +97,28 @@ build_variant() {
9197
# thus everyone should just do a chroot install anyways
9298
WANT_INSTALLER=no
9399
case "$ARCH" in
94-
x86_64*|i686*) GRUB_PKGS="grub-i386-efi grub-x86_64-efi"; WANT_INSTALLER=yes ;;
95-
aarch64*) GRUB_PKGS="grub-arm64-efi" ;;
100+
x86_64*|i686*)
101+
GRUB_PKGS="grub-i386-efi grub-x86_64-efi"
102+
GFX_PKGS="xorg-video-drivers"
103+
WANT_INSTALLER=yes
104+
TARGET_ARCH="$ARCH"
105+
;;
106+
aarch64*)
107+
GRUB_PKGS="grub-arm64-efi"
108+
GFX_PKGS="xorg-video-drivers"
109+
TARGET_ARCH="$ARCH"
110+
;;
111+
asahi*)
112+
GRUB_PKGS="asahi-base asahi-scripts grub-arm64-efi"
113+
GFX_PKGS="mesa-asahi-dri"
114+
KERNEL_PKG="linux-asahi"
115+
TARGET_ARCH="aarch64${ARCH#asahi}"
116+
;;
96117
esac
97118

98119
A11Y_PKGS="espeakup void-live-audio brltty"
99120
PKGS="dialog cryptsetup lvm2 mdadm void-docs-browse xtools-minimal xmirror chrony tmux $A11Y_PKGS $GRUB_PKGS"
100-
XORG_PKGS="xorg-minimal xorg-input-drivers xorg-video-drivers setxkbmap xauth font-misc-misc terminus-font dejavu-fonts-ttf orca"
121+
XORG_PKGS="$GFX_PKGS xorg-minimal xorg-input-drivers setxkbmap xauth font-misc-misc terminus-font dejavu-fonts-ttf orca"
101122
SERVICES="sshd chronyd"
102123

103124
LIGHTDM_SESSION=''
@@ -171,7 +192,8 @@ EOF
171192
setup_pipewire
172193
fi
173194

174-
./mklive.sh -a "$ARCH" -o "$IMG" -p "$PKGS" -S "$SERVICES" -I "$INCLUDEDIR" ${REPO} "$@"
195+
./mklive.sh -a "$TARGET_ARCH" -o "$IMG" -p "$PKGS" -S "$SERVICES" -I "$INCLUDEDIR" \
196+
${KERNEL_PKG:+-v $KERNEL_PKG} ${REPO} "$@"
175197

176198
cleanup
177199
}

mklive.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,10 @@ case "$LINUX_VERSION" in
626626
PACKAGE_LIST+=("$LINUX_VERSION")
627627
LINUX_VERSION="$(XBPS_ARCH=$TARGET_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -x "$LINUX_VERSION" | grep 'linux[0-9._]\+')"
628628
;;
629+
linux-asahi)
630+
IGNORE_PKGS+=(linux)
631+
PACKAGE_LIST+=(linux-asahi linux-base)
632+
;;
629633
linux)
630634
PACKAGE_LIST+=(linux)
631635
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
639643
_kver="$(XBPS_ARCH=$TARGET_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -p pkgver $LINUX_VERSION)"
640644
KERNELVERSION=$($XBPS_UHELPER_CMD getpkgversion ${_kver})
641645

646+
if [ "$LINUX_VERSION" = linux-asahi ]; then
647+
KERNELVERSION="${KERNELVERSION%%_*}-asahi_${KERNELVERSION##*_}"
648+
fi
649+
642650
if [ "$?" -ne "0" ]; then
643651
die "Failed to find kernel package version"
644652
fi

0 commit comments

Comments
 (0)