summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Johansen <strit@manjaro.org>2020-03-06 20:26:32 +0100
committerDan Johansen <strit@manjaro.org>2020-03-06 20:26:32 +0100
commitafc63120509619422b86df3d61536be7245e28f8 (patch)
tree7dffbe41af9410516b6e33db344ad1b4fd262818
downloaduboot-pinebook-afc63120509619422b86df3d61536be7245e28f8.tar.gz
uboot-pinebook-afc63120509619422b86df3d61536be7245e28f8.tar.bz2
uboot-pinebook-afc63120509619422b86df3d61536be7245e28f8.zip
initial commit
-rw-r--r--0001-ATF-set-fno-stack-protector.patch26
-rw-r--r--PKGBUILD59
-rw-r--r--extlinux.conf4
-rw-r--r--uboot-pinebook.install17
4 files changed, 106 insertions, 0 deletions
diff --git a/0001-ATF-set-fno-stack-protector.patch b/0001-ATF-set-fno-stack-protector.patch
new file mode 100644
index 0000000..47721b4
--- /dev/null
+++ b/0001-ATF-set-fno-stack-protector.patch
@@ -0,0 +1,26 @@
+From 45018dbfb301759c9debff598a509832e35854a9 Mon Sep 17 00:00:00 2001
+From: Kevin Mihelich <kevin@archlinuxarm.org>
+Date: Sat, 19 Aug 2017 15:28:38 -0600
+Subject: [PATCH] ATF: set -fno-stack-protector
+
+---
+ Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 74d51804..0af9b350 100644
+--- a/Makefile
++++ b/Makefile
+@@ -202,7 +202,8 @@ ASFLAGS += $(CPPFLAGS) $(ASFLAGS_$(ARCH)) \
+ -Wa,--fatal-warnings
+ TF_CFLAGS += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) \
+ -ffreestanding -fno-builtin -Wall -std=gnu99 \
+- -Os -ffunction-sections -fdata-sections
++ -Os -ffunction-sections -fdata-sections \
++ -fno-stack-protector
+
+ GCC_V_OUTPUT := $(shell $(CC) -v 2>&1)
+
+--
+2.19.1
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 0000000..36f5493
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,59 @@
+# U-Boot: Pine64
+# Maintainer: Dan Johansen <strit@manjaro.org>
+# Contributor: Kevin Mihelich <kevin@archlinuxarm.org>
+
+pkgname=uboot-pinebook
+pkgver=v2019.01.rc3.r35.g64abfc9b6b
+pkgrel=1
+pkgdesc="U-Boot for Pine64"
+arch=('aarch64')
+url='http://www.denx.de/wiki/U-Boot/WebHome'
+license=('GPL')
+makedepends=('bc' 'git' 'python' 'swig' 'dtc')
+install=${pkgname}.install
+source=('git+https://github.com/u-boot/u-boot.git#commit=64abfc9b6bb3'
+ 'git+https://github.com/ARM-software/arm-trusted-firmware.git#commit=63b9b5425f15'
+ '0001-ATF-set-fno-stack-protector.patch'
+ 'extlinux.conf')
+md5sums=('SKIP'
+ 'SKIP'
+ '3213c96ce0713249719dc73d58395620'
+ '9641cbc5984727d43f76350a7c0e124e')
+
+pkgver() {
+ cd u-boot
+ git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd u-boot
+
+ cd ../arm-trusted-firmware
+ git apply ../0001-ATF-set-fno-stack-protector.patch
+}
+
+build() {
+ unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+
+ cd arm-trusted-firmware
+
+ make PLAT=sun50i_a64 DEBUG=1 bl31
+ cp build/sun50i_a64/debug/bl31.bin ../u-boot
+
+ cd ../u-boot
+
+ make distclean
+ make pinebook_defconfig
+ echo 'CONFIG_IDENT_STRING=" Manjaro ARM"' >> .config
+ make EXTRAVERSION=-${pkgrel}
+ cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl-pinebook.bin
+}
+
+package() {
+ cd u-boot
+
+ mkdir -p "${pkgdir}"/boot/extlinux
+
+ cp u-boot-sunxi-with-spl-pinebook.bin "${pkgdir}"/boot
+ cp "${srcdir}"/extlinux.conf "${pkgdir}"/boot/extlinux/
+}
diff --git a/extlinux.conf b/extlinux.conf
new file mode 100644
index 0000000..32757f4
--- /dev/null
+++ b/extlinux.conf
@@ -0,0 +1,4 @@
+LABEL Manjaro ARM
+KERNEL ../Image
+FDT ../dtbs/allwinner/sun50i-a64-pinebook.dtb
+APPEND initrd=../initramfs-linux.img console=tty1 root=LABEL=ROOT rw rootwait bootsplash.bootfile=bootsplash-themes/manjaro/bootsplash
diff --git a/uboot-pinebook.install b/uboot-pinebook.install
new file mode 100644
index 0000000..801363d
--- /dev/null
+++ b/uboot-pinebook.install
@@ -0,0 +1,17 @@
+flash_uboot() {
+ echo "Install new bootloader by running:"
+ echo "# dd if=/boot/u-boot-sunxi-with-spl-pinebook.bin of=/dev/mmcblk0 bs=8k seek=1 for Pinebook SD"
+ echo "# dd if=/boot/u-boot-sunxi-with-spl-pinebook.bin of=/dev/mmcblk2 bs=8k seek=1 for Pinebook eMMC"
+}
+
+## arg 1: the new package version
+post_install() {
+ flash_uboot
+ sed -i s/"LABEL=ROOT"/"LABEL=ROOT_MNJRO"/g /boot/extlinux/extlinux.conf
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+post_upgrade() {
+ flash_uboot
+}