Skip to content

Commit

Permalink
add asahi to image builder
Browse files Browse the repository at this point in the history
  • Loading branch information
dkwo committed Dec 1, 2022
1 parent c9dbeed commit e531c89
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ set_target_arch_from_platform() {
pinebookpro*) XBPS_TARGET_ARCH="aarch64";;
pinephone*) XBPS_TARGET_ARCH="aarch64";;
rock64*) XBPS_TARGET_ARCH="aarch64";;
asahi*) XBPS_TARGET_ARCH="aarch64";;
*) die "$PROGNAME: Unable to compute target architecture from platform";;
esac

Expand Down
17 changes: 13 additions & 4 deletions mkimage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ PLATFORM="${PLATFORM%-PLATFORMFS*}"

# Be absolutely certain the platform is supported before continuing
case "$PLATFORM" in
bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi-armv6l|rpi-armv7l|rpi-aarch64|GCP|pinebookpro|pinephone|rock64|*-musl);;
bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi-armv6l|rpi-armv7l|rpi-aarch64|GCP|pinebookpro|pinephone|rock64|asahi|*-musl);;
*) die "The $PLATFORM is not supported, exiting..."
esac

Expand Down Expand Up @@ -226,9 +226,9 @@ _EOF
esac
mkfs.${ROOT_FSTYPE} ${disable_journal:+"$disable_journal"} "${LOOPDEV}p2" >/dev/null 2>&1
mount "${LOOPDEV}p2" "$ROOTFS"
mkdir -p "${ROOTFS}/boot"
mount "${LOOPDEV}p1" "${ROOTFS}/boot"
BOOT_UUID=$(blkid -o value -s UUID "${LOOPDEV}p1")
mkdir -p "${ROOTFS}/boot"
mount "${LOOPDEV}p1" "${ROOTFS}/boot"
BOOT_UUID=$(blkid -o value -s UUID "${LOOPDEV}p1")
ROOT_UUID=$(blkid -o value -s UUID "${LOOPDEV}p2")
ROOT_PARTUUID=$(blkid -o value -s PARTUUID "${LOOPDEV}p2")
;;
Expand Down Expand Up @@ -373,6 +373,15 @@ GCP*)
# run_cmd_chroot commands
cleanup_chroot
;;
asahi*)
# setup GRUB
mount_pseudofs
run_cmd_chroot "${ROOTFS}" "mkdir /boot/m1n1"
run_cmd_chroot "${ROOTFS}" "grub-install --target=arm64-efi --efi-directory=/boot --removable"
run_cmd_chroot "${ROOTFS}" "grub-mkconfig > /boot/grub/grub.cfg"
run_cmd_chroot "${ROOTFS}" "xbps-reconfigure -f linux-asahi"
cleanup_chroot
;;
esac

# Release all the mounts, deconfigure the loop device, and remove the
Expand Down
3 changes: 2 additions & 1 deletion mkplatformfs.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Usage: $PROGNAME [options] <platform> <base-tarball>
Supported platforms: i686, x86_64, GCP, bananapi, beaglebone,
cubieboard2, cubietruck, odroid-c2, odroid-u2,
rpi-armv6l, rpi-armv7l, rpi-aarch64, ci20,
pinebookpro, pinephone, rock64
pinebookpro, pinephone, rock64, asahi
Options
-b <syspkg> Set an alternative base-system package (defaults to base-system)
Expand Down Expand Up @@ -125,6 +125,7 @@ case "$PLATFORM" in
pinebookpro*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;;
pinephone*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;;
rock64*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;;
asahi*) PKGS="$BASEPKG asahi-base grub-arm64-efi dracut asahi-uboot" ;;
*) die "$PROGNAME: invalid platform!";;
esac

Expand Down

0 comments on commit e531c89

Please sign in to comment.