From 9027ab13cdb8f84b36ef446f91da23f1287c563e Mon Sep 17 00:00:00 2001 From: Tim Sandquist Date: Fri, 25 Mar 2022 07:41:32 -0500 Subject: [PATCH] Add rockpro64 to image builder Based on @tiemenwerkman's work on https://github.com/void-linux/void-mklive/pull/221 --- lib.sh | 1 + mkimage.sh | 22 +++++++++++++++++++--- mkplatformfs.sh | 3 ++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/lib.sh b/lib.sh index 756f6eb..43d7329 100755 --- a/lib.sh +++ b/lib.sh @@ -297,6 +297,7 @@ set_target_arch_from_platform() { pinebookpro*) XBPS_TARGET_ARCH="aarch64";; pinephone*) XBPS_TARGET_ARCH="aarch64";; rock64*) XBPS_TARGET_ARCH="aarch64";; + rockpro64*) XBPS_TARGET_ARCH="aarch64";; *) die "$PROGNAME: Unable to compute target architecture from platform";; esac diff --git a/mkimage.sh b/mkimage.sh index 9e27bcd..d678881 100755 --- a/mkimage.sh +++ b/mkimage.sh @@ -116,14 +116,14 @@ 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|*-musl);; + rpi-armv6l|rpi-armv7l|rpi-aarch64|GCP|pinebookpro|pinephone|rock64|rockpro64|*-musl);; *) die "The $PLATFORM is not supported, exiting..." esac # Default for bigger boot partion on rk33xx devices since it needs to # fit at least 2 Kernels + initramfs case "$PLATFORM" in - pinebookpro*|rock64*) + pinebookpro*|rock64*|rockpro64*) : "${BOOT_FSSIZE:=256MiB}" ;; esac @@ -176,7 +176,7 @@ fi # root filesystem. This is the generally preferred disk # layout for new platforms. case "$PLATFORM" in - pinebookpro*|rock64*) + pinebookpro*|rock64*|rockpro64*) # rk33xx devices use GPT and need more space reserved sfdisk "$FILENAME" <<_EOF label: gpt @@ -274,6 +274,22 @@ CMDLINE="panic=10 coherent_pool=1M console=ttyS2,1500000 root=UUID=${ROOT_UUID} USE_DEVICETREEDIR="yes" # relative dtb path supplied to FDT line, as long as above is unset DTBPATH="" +_EOF + mkdir -p "${ROOTFS}/boot/extlinux" + run_cmd_chroot "${ROOTFS}" "/etc/kernel.d/post-install/60-extlinux" + cleanup_chroot + ;; +rockpro64*) + rk33xx_flash_uboot "${ROOTFS}/usr/lib/rockpro64-uboot" "$LOOPDEV" + # populate the extlinux.conf file + cat >"${ROOTFS}/etc/default/extlinux" <<_EOF +TIMEOUT=10 +# Defaults to current kernel cmdline if left empty +CMDLINE="panic=10 coherent_pool=1M console=ttyS2,115200 root=UUID=${ROOT_UUID} rw" +# set this to use a DEVICETREEDIR line in place of an FDT line +USE_DEVICETREEDIR="yes" +# relative dtb path supplied to FDT line, as long as above is unset +DTBPATH="" _EOF mkdir -p "${ROOTFS}/boot/extlinux" run_cmd_chroot "${ROOTFS}" "/etc/kernel.d/post-install/60-extlinux" diff --git a/mkplatformfs.sh b/mkplatformfs.sh index 920960b..6d3ba11 100755 --- a/mkplatformfs.sh +++ b/mkplatformfs.sh @@ -53,7 +53,7 @@ usage() { Supported platforms: i686, x86_64, GCP, rpi-armv6l, rpi-armv7l, rpi-aarch64, - pinebookpro, pinephone, rock64 + pinebookpro, pinephone, rock64, rockpro64 OPTIONS -b Set an alternative base-system package (default: base-system) @@ -127,6 +127,7 @@ case "$PLATFORM" in pinebookpro*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; pinephone*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; rock64*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; + rockpro64*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;; *) die "$PROGNAME: invalid platform!";; esac