Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RockPro64 platform image builder. #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,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

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

# Be absolutely certain the platform is supported before continuing
case "$PLATFORM" in
bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|rpi4|GCP|pinebookpro|pinephone|rock64|*-musl);;
bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|rpi4|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
Expand Down Expand Up @@ -190,7 +190,7 @@ _EOF
# 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
Expand Down Expand Up @@ -318,6 +318,12 @@ _EOF
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you are missing a blurb here. See the Rock64 section above, which should work for the RP64 too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tiemenwerkman I tested this branch and it works on my RockPro64. I noticed @CameronNemo's comments and made the following change locally when I built my image.

Suggested change
cat >"${ROOTFS}/etc/default/extlinux" <<_EOF
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"

Thanks for putting this together. I got 3 RockPro64s a couple days ago and using this PR along with void-linux/void-packages#33556 I got VoidLinux installed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I changed from the Rock64 section above was setting the baud rate to 115200 to match the patch in your uboot patch. I have one of those USB TTL adapters that claim to work at higher speeds but all I see is garbage at 1.5Mbps so I appreciate the switch to 115200.

cleanup_chroot
;;
pinebookpro*)
rk33xx_flash_uboot "${ROOTFS}/usr/lib/pinebookpro-uboot" "$LOOPDEV"
run_cmd_chroot "${ROOTFS}" "xbps-reconfigure -f pinebookpro-kernel"
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, rpi2 (armv7), rpi3 (aarch64), rpi4 (aarch64), ci20,
pinebookpro, pinephone, rock64
pinebookpro, pinephone, rock64, rockpro64

Options
-b <syspkg> Set an alternative base-system package (defaults to base-system)
Expand Down Expand Up @@ -128,6 +128,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

Expand Down