diff --git a/alarm/uboot-hobbitboard/0001-arch-linux-arm-modifications.patch b/alarm/uboot-hobbitboard/0001-arch-linux-arm-modifications.patch new file mode 100644 index 000000000..8809d9303 --- /dev/null +++ b/alarm/uboot-hobbitboard/0001-arch-linux-arm-modifications.patch @@ -0,0 +1,85 @@ +From 869a40f41d73f96e2d1a0ae349ba67e8148a1151 Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Sat, 2 Jul 2016 17:14:04 -0600 +Subject: [PATCH] arch linux arm modifications + +--- + include/configs/pico-imx6ul.h | 40 +++++++++++++++++++++++++++------------- + 1 file changed, 27 insertions(+), 13 deletions(-) + +diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h +index 1c46ec3..60a4d12 100644 +--- a/include/configs/pico-imx6ul.h ++++ b/include/configs/pico-imx6ul.h +@@ -14,6 +14,8 @@ + #include "mx6_common.h" + #include + ++#define CONFIG_IDENT_STRING " Arch Linux ARM" ++ + #define CONFIG_DISPLAY_CPUINFO + #define CONFIG_DISPLAY_BOARDINFO + +@@ -80,15 +82,29 @@ + "mmcautodetect=yes\0" \ + "dfu_alt_info=boot raw 0x2 0x400 mmcpart 1\0" \ + "mmcargs=setenv bootargs console=${console},${baudrate} " \ +- "root=${mmcroot}\0" \ +- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ +- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ ++ "root=${mmcroot} ${optargs}\0" \ ++ "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${image}\0" \ ++ "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/dtbs/${fdt_file}\0" \ + "mmcboot=echo Booting from mmc ...; " \ +- "run mmcargs; " \ +- "if run loadfdt; then " \ +- "bootz ${loadaddr} - ${fdt_addr}; " \ ++ "if test -e mmc ${mmcdev}:${mmcpart} /boot/uEnv.txt; then " \ ++ "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/uEnv.txt;" \ ++ "env import -t ${loadaddr} ${filesize};" \ ++ "echo Loaded environment from /boot/uEnv.txt;" \ ++ "echo Checking if uenvcmd is set ...;" \ ++ "if test -n ${uenvcmd}; then " \ ++ "echo Running uenvcmd ...;" \ ++ "run uenvcmd;" \ ++ "fi;" \ ++ "fi;" \ ++ "if run loadimage; then " \ ++ "if run loadfdt; then " \ ++ "run mmcargs; " \ ++ "bootz ${loadaddr} - ${fdt_addr}; " \ ++ "else " \ ++ "echo WARN: Cannot load the DT; " \ ++ "fi;" \ + "else " \ +- "echo WARN: Cannot load the DT; " \ ++ "echo WARN: Cannot load zImage; " \ + "fi;\0" \ + "netargs=setenv bootargs console=${console},${baudrate} " \ + "root=/dev/nfs " \ +@@ -117,11 +133,9 @@ + + #define CONFIG_BOOTCOMMAND \ + "if mmc rescan; then " \ +- "if run loadimage; then " \ +- "run mmcboot; " \ +- "else run netboot; " \ +- "fi; " \ +- "else run netboot; fi" ++ "run mmcboot; " \ ++ "fi; " \ ++ "run netboot" + + #define CONFIG_SYS_MEMTEST_START 0x80000000 + #define CONFIG_SYS_MEMTEST_END CONFIG_SYS_MEMTEST_START + SZ_128M +@@ -166,6 +180,6 @@ + + #define CONFIG_SYS_MMC_ENV_DEV 0 + #define CONFIG_SYS_MMC_ENV_PART 0 +-#define CONFIG_MMCROOT "/dev/mmcblk0p2" ++#define CONFIG_MMCROOT "/dev/mmcblk0p1" + + #endif /* __PICO_IMX6UL_CONFIG_H */ +-- +2.10.0 + diff --git a/alarm/uboot-hobbitboard/PKGBUILD b/alarm/uboot-hobbitboard/PKGBUILD new file mode 100644 index 000000000..b64ae9231 --- /dev/null +++ b/alarm/uboot-hobbitboard/PKGBUILD @@ -0,0 +1,39 @@ +# U-Boot: Hobbitboard +# Maintainer: Kevin Mihelich + +buildarch=4 + +pkgname=uboot-hobbitboard +pkgver=2016.09 +pkgrel=1 +pkgdesc="U-Boot for Hobbitboard" +arch=('armv7h') +url="http://git.denx.de/u-boot.git/" +license=('GPL') +makedepends=('git' 'bc') +install=${pkgname}.install +source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver/rc/-rc}.tar.bz2" + '0001-arch-linux-arm-modifications.patch') +md5sums=('2e69dda70eb28f8042d2f9fbeb1feaa1' + '64670947280aafdc26017a79bad368db') + +prepare() { + cd u-boot-${pkgver/rc/-rc} + git apply ../0001-arch-linux-arm-modifications.patch +} + +build() { + cd u-boot-${pkgver/rc/-rc} + + unset LDFLAGS CFLAGS CXXFLAGS + + make distclean + make pico-imx6ul_config + make EXTRAVERSION=-${pkgrel} +} + +package() { + cd u-boot-${pkgver/rc/-rc} + mkdir -p "${pkgdir}"/boot + cp u-boot.imx "${pkgdir}"/boot +} diff --git a/alarm/uboot-hobbitboard/uboot-hobbitboard.install b/alarm/uboot-hobbitboard/uboot-hobbitboard.install new file mode 100644 index 000000000..272ab6f77 --- /dev/null +++ b/alarm/uboot-hobbitboard/uboot-hobbitboard.install @@ -0,0 +1,19 @@ +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/u-boot.imx of=/dev/mmcblk0 bs=1k seek=1 conv=notrunc oflag=dsync + else + echo "You can do this later by running:" + echo "# dd if=/boot/u-boot.imx of=/dev/mmcblk0 bs=1k seek=1 conv=notrunc oflag=dsync" + fi +} + +post_install() { + flash_uboot +} + +post_upgrade() { + flash_uboot +}