From 011f3f579f4040d297b437c48fcb00c6768c509f Mon Sep 17 00:00:00 2001 From: John Sullivan Date: Tue, 9 Mar 2021 10:55:24 -0800 Subject: [PATCH] Add support for Pinephone (pinephone) Support for creating a pinephone platformfs and live image. Closes: #150 [via git-merge-pr] --- lib.sh.in | 1 + mkimage.sh.in | 9 ++++++++- mkplatformfs.sh.in | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib.sh.in b/lib.sh.in index d219cc03f..eb9dddfbe 100644 --- a/lib.sh.in +++ b/lib.sh.in @@ -295,6 +295,7 @@ set_target_arch_from_platform() { x86_64*) XBPS_TARGET_ARCH="x86_64";; GCP*) XBPS_TARGET_ARCH="x86_64";; pinebookpro*) XBPS_TARGET_ARCH="aarch64";; + pinephone*) XBPS_TARGET_ARCH="aarch64";; *) die "$PROGNAME: Unable to compute target architecture from platform";; esac diff --git a/mkimage.sh.in b/mkimage.sh.in index 1c14d91e2..e3a30feb2 100644 --- a/mkimage.sh.in +++ b/mkimage.sh.in @@ -143,7 +143,7 @@ fi # Be absolutely certain the platform is supported before continuing case "$PLATFORM" in - bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|GCP|pinebookpro|*-musl);; + bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|GCP|pinebookpro|pinephone|*-musl);; *) die "The $PLATFORM is not supported, exiting..." esac @@ -219,6 +219,7 @@ _EOF 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") ;; esac @@ -296,6 +297,12 @@ pinebookpro*) run_cmd_chroot "${ROOTFS}" "xbps-reconfigure -f pinebookpro-kernel" cleanup_chroot ;; +pinephone*) + sed -i "s/CMDLINE=\"\(.*\)\"\$/CMDLINE=\"\1 root=PARTUUID=${ROOT_PARTUUID}\"/" "${ROOTFS}/etc/default/pinephone-uboot-config" + dd if="${ROOTFS}/boot/u-boot-sunxi-with-spl.bin" of="${LOOPDEV}" bs=1024 seek=8 conv=notrunc,fsync >/dev/null 2>&1 + run_cmd_chroot "${ROOTFS}" "xbps-reconfigure -f pinephone-kernel" + cleanup_chroot + ;; GCP*) # Google Cloud Platform image configuration for Google Cloud # Engine. The steps below are built in reference to the diff --git a/mkplatformfs.sh.in b/mkplatformfs.sh.in index 681fb7119..091a96b92 100644 --- a/mkplatformfs.sh.in +++ b/mkplatformfs.sh.in @@ -51,7 +51,7 @@ Usage: $PROGNAME [options] Supported platforms: i686, x86_64, GCP, bananapi, beaglebone, cubieboard2, cubietruck, odroid-c2, odroid-u2, rpi, rpi2 (armv7), rpi3 (aarch64), ci20, - pinebookpro + pinebookpro, pinephone Options -b Set an alternative base-system package (defaults to base-system) @@ -125,6 +125,7 @@ case "$PLATFORM" in x86_64*) PKGS="$BASEPKG" ;; GCP*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; pinebookpro*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; + pinephone*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; *) die "$PROGNAME: invalid platform!";; esac