mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-02-06 23:47:10 +00:00
alarm/uboot-usbarmory to 2015.04-1
This commit is contained in:
parent
2f7662d1d0
commit
069fca0d8f
7 changed files with 105 additions and 109 deletions
|
@ -0,0 +1,38 @@
|
|||
From 6b6652055bab1024b85422526c7624b303c7e5a5 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||
Date: Sat, 27 Jun 2015 12:37:40 -0600
|
||||
Subject: [PATCH] arch linux arm modifications
|
||||
|
||||
---
|
||||
include/config_distro_defaults.h | 3 +++
|
||||
include/configs/usbarmory.h | 2 ++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/include/config_distro_defaults.h b/include/config_distro_defaults.h
|
||||
index 8237239..2477edf 100644
|
||||
--- a/include/config_distro_defaults.h
|
||||
+++ b/include/config_distro_defaults.h
|
||||
@@ -59,4 +59,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 f29ab2d..9a947d2 100644
|
||||
--- a/include/configs/usbarmory.h
|
||||
+++ b/include/configs/usbarmory.h
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#include <config_distro_defaults.h>
|
||||
|
||||
+#define CONFIG_IDENT_STRING " Arch Linux ARM"
|
||||
+
|
||||
/* U-Boot commands */
|
||||
#define CONFIG_CMD_MEMTEST
|
||||
#undef CONFIG_CMD_IMLS
|
||||
--
|
||||
2.4.4
|
||||
|
|
@ -1,33 +1,38 @@
|
|||
# U-Boot: Inverse Path USB armory
|
||||
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||
# Maintainer: Jason Plum <jplum@archlinuxarm.org>
|
||||
|
||||
buildarch=4
|
||||
|
||||
pkgname=uboot-usbarmory
|
||||
pkgver=2014.07
|
||||
pkgrel=3
|
||||
pkgver=2015.04
|
||||
pkgrel=1
|
||||
pkgdesc="U-Boot for USB armory"
|
||||
arch=('armv7h')
|
||||
url="https://github.com/inversepath/u-boot-usbarmory.git"
|
||||
url="http://git.denx.de/u-boot.git/"
|
||||
license=('GPL')
|
||||
makedepends=('git' 'bc')
|
||||
source=("u-boot-${pkgver}::git+https://github.com/inversepath/u-boot-usbarmory.git#commit=f31f8430da00f5dde1d7564b059571ca8581dd68"
|
||||
'alarm.patch'
|
||||
'uEnv.txt')
|
||||
md5sums=('SKIP'
|
||||
'06742be0021c4a4123383e3790f21edf'
|
||||
'5e8a8854cc2a154e1a157535f2161913')
|
||||
install=${pkgname}.install
|
||||
backup=(boot/boot.txt boot/boot.scr)
|
||||
source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2"
|
||||
'0001-arch-linux-arm-modifications.patch'
|
||||
'boot.txt'
|
||||
'mkscr')
|
||||
md5sums=('570bdc2c47270c2a98ca60ff6c5c74cd'
|
||||
'145e9053347b729ff1d65b27c1accc9f'
|
||||
'3e9799661eec04d1ce0f3fe20ed21838'
|
||||
'021623a04afd29ac3f368977140cfbfd')
|
||||
|
||||
prepare() {
|
||||
cd u-boot-${pkgver}
|
||||
patch -p1 -i ../alarm.patch
|
||||
|
||||
git apply ../0001-arch-linux-arm-modifications.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
cd u-boot-${pkgver}
|
||||
|
||||
unset CFLAGS
|
||||
unset CXXFLAGS
|
||||
unset CFLAGS CXXFLAGS LDFLAGS
|
||||
|
||||
make distclean
|
||||
make usbarmory_config
|
||||
|
@ -36,6 +41,11 @@ build() {
|
|||
|
||||
package() {
|
||||
cd u-boot-${pkgver}
|
||||
mkdir -p "${pkgdir}"/boot
|
||||
cp u-boot.imx "${srcdir}"/uEnv.txt "${pkgdir}"/boot
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
diff --git a/include/configs/usbarmory.h b/include/configs/usbarmory.h
|
||||
index 66543a6..f6e736a 100644
|
||||
--- a/include/configs/usbarmory.h
|
||||
+++ b/include/configs/usbarmory.h
|
||||
@@ -28,6 +28,8 @@
|
||||
#define CONFIG_CMD_FAT
|
||||
#define CONFIG_CMD_MEMTEST
|
||||
#define CONFIG_CMD_EXT2
|
||||
+#define CONFIG_CMD_EXT4
|
||||
+#define CONFIG_CMD_FS_GENERIC
|
||||
#undef CONFIG_CMD_IMLS
|
||||
|
||||
/* U-Boot environment */
|
||||
@@ -62,6 +64,10 @@
|
||||
#define CONFIG_MMC
|
||||
#define CONFIG_GENERIC_MMC
|
||||
#define CONFIG_DOS_PARTITION
|
||||
+#define CONFIG_CMD_GPT
|
||||
+#define CONFIG_EFI_PARTITION
|
||||
+#define CONFIG_PARTITION_UUIDS
|
||||
+#define CONFIG_CMD_PART
|
||||
|
||||
/* USB */
|
||||
#define CONFIG_CMD_USB
|
||||
@@ -87,11 +93,65 @@
|
||||
#define CONFIG_SYS_TEXT_BASE 0x77800000
|
||||
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
|
||||
#define CONFIG_HOSTNAME usbarmory
|
||||
-#define CONFIG_BOOTARGS \
|
||||
- "console=ttymxc0,115200 root=/dev/mmcblk0p1 rootwait rw"
|
||||
+#define CONFIG_IDENT_STRING " Arch Linux ARM"
|
||||
+#define CONFIG_SUPPORT_RAW_INITRD
|
||||
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
|
||||
+#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
+ "loadaddr=0x70800000\0" \
|
||||
+ "fdtaddr=0x71000000\0" \
|
||||
+ "rdaddr=0x71100000\0" \
|
||||
+ "boot_fdt=try\0" \
|
||||
+ "bootpart=0:1\0" \
|
||||
+ "bootdir=/boot\0" \
|
||||
+ "bootfile=zImage\0" \
|
||||
+ "fdtdir=/boot/dtbs\0" \
|
||||
+ "fdtfile=imx53-usbarmory.dtb\0" \
|
||||
+ "console=ttymxc0,115200n8\0" \
|
||||
+ "partitions=" \
|
||||
+ "uuid_disk=${uuid_gpt_disk};" \
|
||||
+ "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
|
||||
+ "optargs=\0" \
|
||||
+ "bootenv=uEnv.txt\0" \
|
||||
+ "mmcdev=0\0" \
|
||||
+ "mmcroot=/dev/mmcblk0p1\0" \
|
||||
+ "mmcrootextra=rw fixrtc rootwait\0" \
|
||||
+ "mmcargs=setenv bootargs console=${console} " \
|
||||
+ "${optargs} " \
|
||||
+ "root=${mmcroot} ${mmcrootextra}\0" \
|
||||
+ "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile}\0" \
|
||||
+ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
|
||||
+ "loadfdt=load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \
|
||||
+ "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootdir}/${bootenv}\0" \
|
||||
+ "importbootenv=echo Importing environment from mmc ...; "\
|
||||
+ "env import -t $loadaddr $filesize\0" \
|
||||
+ "mmcboot=mmc dev ${mmcdev};" \
|
||||
+ "if mmc rescan; then " \
|
||||
+ "echo SD/MMC found on device ${mmcdev};" \
|
||||
+ "if run loadbootenv; then " \
|
||||
+ "echo Loaded environment from ${bootenv};" \
|
||||
+ "run importbootenv;" \
|
||||
+ "fi;"\
|
||||
+ "if test -n $uenvcmd; then " \
|
||||
+ "echo Running uenvcmd ...;" \
|
||||
+ "run uenvcmd;" \
|
||||
+ "fi;" \
|
||||
+ "if run loadimage; then " \
|
||||
+ "run mmcargs;" \
|
||||
+ "if run loadfdt; then " \
|
||||
+ "if run loadramdisk; then " \
|
||||
+ "bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr};" \
|
||||
+ "else " \
|
||||
+ "bootz ${loadaddr} - ${fdtaddr};" \
|
||||
+ "fi;" \
|
||||
+ "else " \
|
||||
+ "echo Kernel found, but no device tree found;" \
|
||||
+ "fi;" \
|
||||
+ "fi;" \
|
||||
+ "echo Failed to locate Kernel;" \
|
||||
+ "fi;"
|
||||
+
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
- "ext2load mmc 0:1 0x70800000 /boot/uImage; ext2load mmc 0:1 " \
|
||||
- "0x71000000 /boot/imx53-usbarmory.dtb; bootm 0x70800000 - 0x71000000"
|
||||
+ "run mmcboot; "
|
||||
|
||||
/* Physical Memory Map */
|
||||
#define CONFIG_NR_DRAM_BANKS 1
|
12
alarm/uboot-usbarmory/boot.txt
Normal file
12
alarm/uboot-usbarmory/boot.txt
Normal file
|
@ -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/zImage; then
|
||||
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
|
||||
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
|
||||
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
|
||||
else
|
||||
bootz ${kernel_addr_r} - ${fdt_addr_r};
|
||||
fi;
|
||||
fi;
|
||||
fi
|
9
alarm/uboot-usbarmory/mkscr
Executable file
9
alarm/uboot-usbarmory/mkscr
Executable file
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
optargs=console=ttyGS0,115200
|
22
alarm/uboot-usbarmory/uboot-usbarmory.install
Normal file
22
alarm/uboot-usbarmory/uboot-usbarmory.install
Normal file
|
@ -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/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/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
|
||||
}
|
Loading…
Reference in a new issue