From 17cb75f37adab5656fd9355720fb7544035e2280 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Fri, 22 Nov 2019 15:32:59 -0800 Subject: Initial commit --- PKGBUILD | 37 +++++++++++++++++++++++++++++++++++++ boot.txt | 22 ++++++++++++++++++++++ idbloader.img | Bin 0 -> 163836 bytes mkscr | 9 +++++++++ trust.img | Bin 0 -> 4194304 bytes uboot-pinebookpro.install | 27 +++++++++++++++++++++++++++ uboot.img | Bin 0 -> 4194304 bytes 7 files changed, 95 insertions(+) create mode 100644 PKGBUILD create mode 100644 boot.txt create mode 100644 idbloader.img create mode 100644 mkscr create mode 100644 trust.img create mode 100644 uboot-pinebookpro.install create mode 100644 uboot.img diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..f78e3dd --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: jc_gargma +# Maintainer (Manjaro): Dan Johansen +# Contributor (Manjaro): Spikerguy +# Pre-Built IMG by MrFixit + +# # I maintain this because: +# Not in an official repo and I use it +# Manjaro version fails to build + +pkgname=uboot-pinebookpro +pkgver=1.1 +pkgrel=4 +pkgdesc="U-Boot for Pinebook Pro (prebuilt binaries)" +arch=('aarch64') +url='https://github.com/mrfixit2001/updates_repo/tree/v1.1/pinebook/filesystem' +license=('GPL') +makedepends=('uboot-tools') +#Commented out until we know the parition to be used. +#install=${pkgname}.install +source=('uboot.img' + 'trust.img' + 'idbloader.img' + 'boot.txt' + 'mkscr' + ) +sha256sums=('f9a3d144ab8702ab1ab2f39280f4976bbac621a90fb3eaa1729077f34355ca89' + 'bd62940658c632bf39c883cf3ba1e4054ac893bc31df2ea45e05cb633da49598' + '40a0ecb986818db4c2d984045037fd12414fa9a7553b0edcbb45225dce31d12f' + '0635926d7deda636827b413f78acfe3a286cdc87a26ea379bc2c4985bb901c77' + 'a4fc8b6b92bc364d6542670d294aa618a8501fb8729f415cc0a3eed776ef0c8e') + +package() { + mkdir -p "${pkgdir}"/boot + cp uboot.img trust.img idbloader.img "${pkgdir}"/boot + mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d ${srcdir}/boot.txt "${pkgdir}/boot/boot.scr" + cp ${srcdir}/{boot.txt,mkscr} "${pkgdir}"/boot +} diff --git a/boot.txt b/boot.txt new file mode 100644 index 0000000..7ce8eff --- /dev/null +++ b/boot.txt @@ -0,0 +1,22 @@ +# After modifying, run ./mkscr + +# MAC address (use spaces instead of colons) +setenv macaddr da 19 c8 7a 6d f4 + +part uuid ${devtype} ${devnum}:${bootpart} uuid +setenv bootargs console=ttyS2,1500000n8 root=PARTUUID=${uuid} rw rootwait append video=eDP-1:1920x1080@60 +setenv fdtfile rockchip/rk3399-pinebook-pro.dtb + +if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/Image; then + if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then + fdt addr ${fdt_addr_r} + fdt resize + fdt set /ethernet@fe300000 local-mac-address "[${macaddr}]" + if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then + # This upstream Uboot doesn't support compresses cpio initrd, use kernel option to + # load initramfs + setenv bootargs ${bootargs} initrd=${ramdisk_addr_r},20M ramdisk_size=10M + fi; + booti ${kernel_addr_r} - ${fdt_addr_r}; + fi; +fi diff --git a/idbloader.img b/idbloader.img new file mode 100644 index 0000000..7c161e6 Binary files /dev/null and b/idbloader.img differ diff --git a/mkscr b/mkscr new file mode 100644 index 0000000..272b6a7 --- /dev/null +++ b/mkscr @@ -0,0 +1,9 @@ +#!/bin/bash + +if [[ ! -x /usr/bin/mkimage ]]; then + echo "mkimage not found. Please install uboot-tools:" + echo " pacman -S uboot-tools" + exit 1 +fi + +mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d boot.txt boot.scr diff --git a/trust.img b/trust.img new file mode 100644 index 0000000..510d639 Binary files /dev/null and b/trust.img differ diff --git a/uboot-pinebookpro.install b/uboot-pinebookpro.install new file mode 100644 index 0000000..71e1ff7 --- /dev/null +++ b/uboot-pinebookpro.install @@ -0,0 +1,27 @@ +flash_uboot() { + echo "A new U-Boot version needs to be flashed onto /dev/mmcblk0." + echo "Do you want to do this now? [y|N]" + read -r shouldwe + if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then + dd if=/boot/idbloader.img of=/dev/mmcblk0 seek=64 conv=notrunc + dd if=/boot/uboot.img of=/dev/mmcblk0 seek=16384 conv=notrunc + dd if=/boot/trust.img of=/dev/mmcblk0 seek=24576 conv=notrunc + else + echo "You can do this later by running:" + echo "# dd if=/boot/idbloader.img of=/dev/mmcblk0 seek=64 conv=notrunc" + echo "# dd if=/boot/uboot.img of=/dev/mmcblk0 seek=16384 conv=notrunc" + echo "# dd if=/boot/trust.img of=/dev/mmcblk0 seek=24576 conv=notrunc" + fi +} + +## arg 1: the new package version +post_install() { + flash_uboot +} + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + flash_uboot +} + diff --git a/uboot.img b/uboot.img new file mode 100644 index 0000000..05bb23f Binary files /dev/null and b/uboot.img differ -- cgit v1.2.1