summaryrefslogtreecommitdiff
path: root/libre/uboot-usbarmory
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-03-02 02:55:30 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-03-02 02:55:30 -0300
commitffec767572058f3ad0fb869e59b4df2f64b80f04 (patch)
tree575ba5fb789d4ef4cd982cbe46cb377260637469 /libre/uboot-usbarmory
parent3cc20cbac18f7e65b50643cd3a25be2211a76e9a (diff)
uboot-usbarmory: add new package to [libre]
Diffstat (limited to 'libre/uboot-usbarmory')
-rw-r--r--libre/uboot-usbarmory/0001-parabola-arm-modifications.patch28
-rw-r--r--libre/uboot-usbarmory/PKGBUILD53
-rw-r--r--libre/uboot-usbarmory/boot.txt12
-rwxr-xr-xlibre/uboot-usbarmory/mkscr9
-rw-r--r--libre/uboot-usbarmory/uboot-usbarmory.install22
5 files changed, 124 insertions, 0 deletions
diff --git a/libre/uboot-usbarmory/0001-parabola-arm-modifications.patch b/libre/uboot-usbarmory/0001-parabola-arm-modifications.patch
new file mode 100644
index 000000000..9b14cabec
--- /dev/null
+++ b/libre/uboot-usbarmory/0001-parabola-arm-modifications.patch
@@ -0,0 +1,28 @@
+diff --git a/include/config_distro_defaults.h b/include/config_distro_defaults.h
+index d8165cc..377322b 100644
+--- a/include/config_distro_defaults.h
++++ b/include/config_distro_defaults.h
+@@ -68,4 +68,7 @@
+ #define CONFIG_SUPPORT_RAW_INITRD
+ #define CONFIG_SYS_HUSH_PARSER
+
++#define CONFIG_CMD_PART
++#define CONFIG_PARTITION_UUIDS
++
+ #endif /* _CONFIG_CMD_DISTRO_DEFAULTS_H */
+diff --git a/include/configs/usbarmory.h b/include/configs/usbarmory.h
+index 714e3e2..6be57dc 100644
+--- a/include/configs/usbarmory.h
++++ b/include/configs/usbarmory.h
+@@ -23,6 +23,8 @@
+
+ #include <config_distro_defaults.h>
+
++#define CONFIG_IDENT_STRING " Parabola GNU/Linux-libre"
++
+ /* U-Boot commands */
+ #define CONFIG_CMD_MEMTEST
+
+--
+2.6.1
+
diff --git a/libre/uboot-usbarmory/PKGBUILD b/libre/uboot-usbarmory/PKGBUILD
new file mode 100644
index 000000000..86a8db13e
--- /dev/null
+++ b/libre/uboot-usbarmory/PKGBUILD
@@ -0,0 +1,53 @@
+# U-Boot: Inverse Path USB Armory
+# Maintainer: André Silva <emulatorman@parabola.nu>
+
+buildarch=4
+
+pkgname=uboot-usbarmory
+pkgver=2016.01
+pkgrel=1.parabola1
+pkgdesc="U-Boot for USB Armory"
+arch=('armv7h')
+url="http://git.denx.de/u-boot.git/"
+license=('GPL')
+makedepends=('bc')
+depends=('linux-libre')
+replaces=('uboot-usbarmory-linux-libre')
+conflicts=('uboot4extlinux-usbarmory' 'uboot4grub-usbarmory')
+install=${pkgname}.install
+backup=(boot/boot.txt boot/boot.scr)
+source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2"
+ '0001-parabola-arm-modifications.patch'
+ 'boot.txt'
+ 'mkscr')
+md5sums=('7d4f65fd43d4d706f5c5650e020d899d'
+ '15bacb3ff7c9bfb350e7e43f081bd9b3'
+ 'eb83db44c372a6ff3349e026083f15f9'
+ '021623a04afd29ac3f368977140cfbfd')
+
+prepare() {
+ cd u-boot-${pkgver}
+
+ patch -Np1 -i ../0001-parabola-arm-modifications.patch
+}
+
+build() {
+ cd u-boot-${pkgver}
+
+ unset CFLAGS CXXFLAGS LDFLAGS
+
+ make distclean
+ make usbarmory_config
+ make
+}
+
+package() {
+ cd u-boot-${pkgver}
+
+ install -d "${pkgdir}"/boot
+ install -Dm644 u-boot.imx "${pkgdir}"/boot
+
+ install -Dm644 ../boot.txt "${pkgdir}"/boot/boot.txt
+ tools/mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d ../boot.txt "${pkgdir}"/boot/boot.scr
+ install -Dm755 ../mkscr "${pkgdir}"/boot/mkscr
+}
diff --git a/libre/uboot-usbarmory/boot.txt b/libre/uboot-usbarmory/boot.txt
new file mode 100644
index 000000000..2454291f8
--- /dev/null
+++ b/libre/uboot-usbarmory/boot.txt
@@ -0,0 +1,12 @@
+part uuid ${devtype} ${devnum}:${bootpart} uuid
+setenv bootargs console=ttyGS0,115200 console=${console} root=PARTUUID=${uuid} rw rootwait
+
+if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/vmlinuz-linux-libre; then
+ if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
+ if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux-libre.img; then
+ bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
+ else
+ bootz ${kernel_addr_r} - ${fdt_addr_r};
+ fi;
+ fi;
+fi
diff --git a/libre/uboot-usbarmory/mkscr b/libre/uboot-usbarmory/mkscr
new file mode 100755
index 000000000..272b6a7a5
--- /dev/null
+++ b/libre/uboot-usbarmory/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/libre/uboot-usbarmory/uboot-usbarmory.install b/libre/uboot-usbarmory/uboot-usbarmory.install
new file mode 100644
index 000000000..6c0ddcf9e
--- /dev/null
+++ b/libre/uboot-usbarmory/uboot-usbarmory.install
@@ -0,0 +1,22 @@
+flash_uboot() {
+ echo "A new U-Boot version needs to be flashed onto /dev/mmcblk0."
+ echo "Do this now? [y|N]"
+ read -r shouldwe
+ if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
+ dd if=/boot/uboot-usbarmory-linux-libre/u-boot.imx of=/dev/mmcblk0 bs=512 seek=2 conv=fsync
+ else
+ echo "You can do this later by running:"
+ echo "# dd if=/boot/uboot-usbarmory-linux-libre/u-boot.imx of=/dev/mmcblk0 bs=512 seek=2 conv=fsync"
+ 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
+}