diff --git a/.github/workflows/gen-images.yml b/.github/workflows/gen-images.yml index 0749295077..efc5803ad2 100644 --- a/.github/workflows/gen-images.yml +++ b/.github/workflows/gen-images.yml @@ -14,7 +14,7 @@ on: type: boolean live_archs: description: "Archs to build live ISOs for" - default: "x86_64 x86_64-musl i686 aarch64 aarch64-musl" + default: "x86_64 x86_64-musl i686 aarch64 aarch64-musl asahi asahi-musl" required: false type: string live_flavors: diff --git a/Makefile b/Makefile index 0a547a5f51..0047f7e076 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ DATECODE:=$(shell date -u "+%Y%m%d") SHELL=/bin/bash -T_LIVE_ARCHS=i686 x86_64{,-musl} aarch64{,-musl} +T_LIVE_ARCHS=i686 x86_64{,-musl} aarch64{,-musl} asahi{,-musl} -T_PLATFORMS=rpi-{armv{6,7}l,aarch64}{,-musl} GCP{,-musl} pinebookpro{,-musl} +T_PLATFORMS=rpi-{armv{6,7}l,aarch64}{,-musl} GCP{,-musl} pinebookpro{,-musl} asahi{,-musl} T_ARCHS=i686 x86_64{,-musl} armv{6,7}l{,-musl} aarch64{,-musl} T_SBC_IMGS=rpi-{armv{6,7}l,aarch64}{,-musl} pinebookpro{,-musl} @@ -62,7 +62,9 @@ live-iso-all-print: void-live-%.iso: mkiso.sh @[ -n "${CI}" ] && printf "::group::\x1b[32mBuilding $@...\x1b[0m\n" || true - $(SUDO) ./mkiso.sh -r $(REPOSITORY) -t $* -- -P "$(LIVE_PLATFORMS)" + $(if $(findstring aarch64,$*), \ + $(SUDO) ./mkiso.sh -r $(REPOSITORY) -t $* -- -P $(LIVE_PLATFORMS), \ + $(SUDO) ./mkiso.sh -r $(REPOSITORY) -t $*) @[ -n "${CI}" ] && printf '::endgroup::\n' || true rootfs-all: $(ALL_ROOTFS) diff --git a/README.md b/README.md index 00c29d2ed9..3da7f81b64 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ Wrapper script around mklive.sh for several standard flavors of live images. Adds void-installer and other helpful utilities to the generated images. OPTIONS - -a Set XBPS_ARCH in the image + -a Set architecture (or platform) in the image -b One of base, enlightenment, xfce, mate, cinnamon, gnome, kde, lxde, or lxqt (default: base). May be specified multiple times to build multiple variants @@ -188,7 +188,7 @@ generated by mkrootfs.sh. Supported platforms: i686, x86_64, GCP, rpi-armv6l, rpi-armv7l, rpi-aarch64, - pinebookpro, pinephone, rock64, rockpro64 + pinebookpro, pinephone, rock64, rockpro64, asahi OPTIONS -b Set an alternative base-system package (default: base-system) @@ -218,7 +218,7 @@ OPTIONS -b /boot filesystem type (default: vfat) -B /boot filesystem size (default: 256MiB) -r / filesystem type (default: ext4) - -s Total image size (default: 768MiB) + -s Total image size (default: 900MiB) -o Image filename (default: guessed automatically) -x Number of threads to use for image compression (default: dynamic) -h Show this help and exit diff --git a/lib.sh b/lib.sh index d76495e888..96c3e337e8 100755 --- a/lib.sh +++ b/lib.sh @@ -288,6 +288,7 @@ set_target_arch_from_platform() { pinephone*) XBPS_TARGET_ARCH="aarch64";; rock64*) XBPS_TARGET_ARCH="aarch64";; rockpro64*) XBPS_TARGET_ARCH="aarch64";; + asahi*) XBPS_TARGET_ARCH="aarch64";; *) die "$PROGNAME: Unable to compute target architecture from platform";; esac diff --git a/mkimage.sh b/mkimage.sh index 2ba245d853..eea156da75 100755 --- a/mkimage.sh +++ b/mkimage.sh @@ -116,7 +116,7 @@ PLATFORM="${PLATFORM%-PLATFORMFS*}" # Be absolutely certain the platform is supported before continuing case "$PLATFORM" in - rpi-armv6l|rpi-armv7l|rpi-aarch64|GCP|pinebookpro|pinephone|rock64|rockpro64|*-musl);; + rpi-armv6l|rpi-armv7l|rpi-aarch64|GCP|pinebookpro|pinephone|rock64|rockpro64|asahi|*-musl);; *) die "The $PLATFORM is not supported, exiting..." esac @@ -350,6 +350,12 @@ GCP*) # run_cmd_chroot commands cleanup_chroot ;; +asahi*) + mount_pseudofs + run_cmd_chroot "${ROOTFS}" "grub-install --target=arm64-efi --efi-directory=/boot --removable" + run_cmd_chroot "${ROOTFS}" "xbps-reconfigure -f linux-asahi" + cleanup_chroot + ;; esac # Release all the mounts, deconfigure the loop device, and remove the diff --git a/mkiso.sh b/mkiso.sh index db5bf22c58..d7c9025286 100755 --- a/mkiso.sh +++ b/mkiso.sh @@ -19,7 +19,7 @@ usage() { Adds void-installer and other helpful utilities to the generated images. OPTIONS - -a Set XBPS_ARCH in the image + -a Set architecture (or platform) in the image -b One of base, enlightenment, xfce, mate, cinnamon, gnome, kde, lxde, or lxqt (default: base). May be specified multiple times to build multiple variants @@ -71,6 +71,12 @@ include_installer() { setup_pipewire() { PKGS="$PKGS pipewire alsa-pipewire" + case "$ARCH" in + asahi*) + PKGS="$PKGS asahi-audio" + SERVICES="$SERVICES speakersafetyd" + ;; + esac mkdir -p "$INCLUDEDIR"/etc/xdg/autostart ln -sf /usr/share/applications/pipewire.desktop "$INCLUDEDIR"/etc/xdg/autostart/ mkdir -p "$INCLUDEDIR"/etc/pipewire/pipewire.conf.d @@ -91,13 +97,28 @@ build_variant() { # thus everyone should just do a chroot install anyways WANT_INSTALLER=no 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 A11Y_PKGS="espeakup void-live-audio brltty" 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" LIGHTDM_SESSION='' @@ -171,7 +192,8 @@ EOF setup_pipewire 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 } diff --git a/mklive.sh b/mklive.sh index ab327d311e..f8d56fc450 100755 --- a/mklive.sh +++ b/mklive.sh @@ -626,6 +626,10 @@ case "$LINUX_VERSION" in 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-asahi) + IGNORE_PKGS+=(linux) + PACKAGE_LIST+=(linux-asahi linux-base) + ;; linux) PACKAGE_LIST+=(linux) 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)" KERNELVERSION=$($XBPS_UHELPER_CMD getpkgversion ${_kver}) +if [ "$LINUX_VERSION" = linux-asahi ]; then + KERNELVERSION="${KERNELVERSION%%_*}-asahi_${KERNELVERSION##*_}" +fi + if [ "$?" -ne "0" ]; then die "Failed to find kernel package version" fi diff --git a/mkplatformfs.sh b/mkplatformfs.sh index 6d3ba11df2..d85d870a04 100755 --- a/mkplatformfs.sh +++ b/mkplatformfs.sh @@ -53,8 +53,8 @@ usage() { Supported platforms: i686, x86_64, GCP, rpi-armv6l, rpi-armv7l, rpi-aarch64, - pinebookpro, pinephone, rock64, rockpro64 - + pinebookpro, pinephone, rock64, rockpro64, asahi + OPTIONS -b Set an alternative base-system package (default: base-system) -c Set the XBPS cache directory (default: ./xbps-cachedir-) @@ -128,6 +128,7 @@ case "$PLATFORM" in pinephone*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; rock64*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; rockpro64*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; + asahi*) PKGS="$BASEPKG asahi-base asahi-scripts grub-arm64-efi dracut" ;; *) die "$PROGNAME: invalid platform!";; esac