From 5cee0ea0f2017ff42d834c39d2b5315a83b432a6 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Tue, 27 May 2014 01:36:33 +0000 Subject: [PATCH] alarm/uboot-kirkwood to 2014.04.R3-1 --- alarm/uboot-kirkwood/PKGBUILD | 23 ++++++++--- alarm/uboot-kirkwood/uboot-pogo_e02.install | 43 +++++++++++++++++++++ 2 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 alarm/uboot-kirkwood/uboot-pogo_e02.install diff --git a/alarm/uboot-kirkwood/PKGBUILD b/alarm/uboot-kirkwood/PKGBUILD index 84de440bc..2d9028547 100644 --- a/alarm/uboot-kirkwood/PKGBUILD +++ b/alarm/uboot-kirkwood/PKGBUILD @@ -4,8 +4,8 @@ buildarch=2 pkgbase=uboot-kirkwood -pkgname=('uboot-dockstar' 'uboot-goflexhome' 'uboot-goflexnet') -pkgver=2014.04.R2 +pkgname=('uboot-dockstar' 'uboot-goflexhome' 'uboot-goflexnet' 'uboot-pogo_e02') +pkgver=2014.04.R3 pkgrel=1 arch=('arm') url="https://github.com/archlinuxarm/u-boot" @@ -14,11 +14,13 @@ depends=('uboot-env' 'mtd-utils') source=("https://github.com/archlinuxarm/u-boot/archive/${pkgver##*.}.tar.gz" 'http://archlinuxarm.org/os/armv5te/boot/dockstar/uboot-dockstar.env' 'http://archlinuxarm.org/os/armv5te/boot/goflexhome/uboot-goflexhome.env' - 'http://archlinuxarm.org/os/armv5te/boot/goflexnet/uboot-goflexnet.env') -md5sums=('d9c20346e94f8e05d168b43fdc935bea' + 'http://archlinuxarm.org/os/armv5te/boot/goflexhome/uboot-goflexnet.env' + 'http://archlinuxarm.org/os/armv5te/boot/goflexhome/uboot-pogo_e02.env') +md5sums=('6981030b38375877ff348925bafa60c1' '483bb63ff84c05d96e43ec4c85b8d7c2' 'b9c1acb44e25a45767f31da1f9fd0261' - '88197b33fee74a31d4914ca4f14007ec') + '88197b33fee74a31d4914ca4f14007ec' + 'e707982899cebacd64878a87208fa750') build() { cd u-boot-${pkgver##*.} @@ -26,7 +28,7 @@ build() { unset CFLAGS CXXFLAGS LDFLAGS mkdir bins - for i in dockstar goflexhome goflexnet; do + for i in dockstar goflexhome goflexnet pogo_e02; do make distclean make ${i}_config make u-boot.kwb EXTRAVERSION=.${pkgver##*.}-${pkgrel} @@ -60,3 +62,12 @@ package_uboot-goflexnet() { cp u-boot-${pkgver##*.}/bins/uboot-goflexnet.kwb "${pkgdir}"/boot cp "${srcdir}"/uboot-goflexnet.env "${pkgdir}"/boot } + +package_uboot-pogo_e02() { + pkgdesc="U-Boot for the Pogoplug V2 (E02)" + install="$pkgname.install" + + mkdir -p "${pkgdir}"/boot + cp u-boot-${pkgver##*.}/bins/uboot-pogo_e02.kwb "${pkgdir}"/boot + cp "${srcdir}"/uboot-pogo_e02.env "${pkgdir}"/boot +} diff --git a/alarm/uboot-kirkwood/uboot-pogo_e02.install b/alarm/uboot-kirkwood/uboot-pogo_e02.install new file mode 100644 index 000000000..ffa9f46d6 --- /dev/null +++ b/alarm/uboot-kirkwood/uboot-pogo_e02.install @@ -0,0 +1,43 @@ +flash_uboot() { + if [[ ! -e /dev/mtd0 ]]; then + echo '>> Error: /dev/mtd0 does not exist.' + return + fi + # set up config for fw_printenv/setenv + echo '/dev/mtd0 0xc0000 0x20000 0x20000' > /etc/fw_env.config + # save MAC address + mac=$(fw_printenv | grep ethaddr | cut -d= -f2) + if [[ $mac == '' ]]; then + echo '>> Error: Could not find MAC address from current U-Boot.' + return + fi + # flash U-Boot + flash_erase /dev/mtd0 0 4 + flash_erase /dev/mtd0 0xc0000 1 + nandwrite /dev/mtd0 /boot/uboot-pogo_e02.kwb + nandwrite -s 0xc0000 /dev/mtd0 /boot/uboot-pogo_e02.env + # set MAC address + fw_setenv ethaddr ${mac} +} + +ask_uboot() { + echo "A new U-Boot version needs to be flashed to NAND." + echo "Do you want to do this now? [y|N]" + read -r shouldwe + if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then + flash_uboot + else + echo "You can do this later by re-installing uboot-pogo_e02." + fi +} + +## arg 1: the new package version +post_install() { + ask_uboot +} + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + ask_uboot +}