From 27b40e2a03a4f6d140235cf76a5635e65b082341 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Thu, 15 May 2014 00:58:50 +0000 Subject: [PATCH] added alarm/uboot-kirkwood --- alarm/uboot-kirkwood/PKGBUILD | 51 +++++++++++++++++++ alarm/uboot-kirkwood/uboot-dockstar.install | 43 ++++++++++++++++ alarm/uboot-kirkwood/uboot-goflexhome.install | 43 ++++++++++++++++ 3 files changed, 137 insertions(+) create mode 100644 alarm/uboot-kirkwood/PKGBUILD create mode 100644 alarm/uboot-kirkwood/uboot-dockstar.install create mode 100644 alarm/uboot-kirkwood/uboot-goflexhome.install diff --git a/alarm/uboot-kirkwood/PKGBUILD b/alarm/uboot-kirkwood/PKGBUILD new file mode 100644 index 000000000..7fc21fb2a --- /dev/null +++ b/alarm/uboot-kirkwood/PKGBUILD @@ -0,0 +1,51 @@ +# U-Boot: Marvell Kirkwood platforms +# Maintainer: Kevin Mihelich + +buildarch=2 + +pkgbase=uboot-kirkwood +pkgname=('uboot-dockstar' 'uboot-goflexhome') +pkgver=2014.04.R1 +pkgrel=1 +arch=('arm') +url="https://github.com/archlinuxarm/u-boot" +license=('GPL') +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') +md5sums=('b94af10e66bee284aea93cfc2b919dc5' + '483bb63ff84c05d96e43ec4c85b8d7c2' + 'b9c1acb44e25a45767f31da1f9fd0261') + +build() { + cd u-boot-${pkgver##*.} + + unset CFLAGS CXXFLAGS LDFLAGS + + mkdir bins + for i in dockstar goflexhome; do + make distclean + make ${i}_config + make u-boot.kwb EXTRAVERSION=.${pkgver##*.}-${pkgrel} + dd if=u-boot.kwb of=bins/uboot-${i}.kwb bs=512k conv=sync + done; +} + +package_uboot-dockstar() { + pkgdesc="U-Boot for the Seagate FreeAgent DockStar" + install="$pkgname.install" + + mkdir -p "${pkgdir}"/boot + cp u-boot-${pkgver##*.}/bins/uboot-dockstar.kwb "${pkgdir}"/boot + cp "${srcdir}"/uboot-dockstar.env "${pkgdir}"/boot +} + +package_uboot-goflexhome() { + pkgdesc="U-Boot for the Seagate GoFlex Home" + install="$pkgname.install" + + mkdir -p "${pkgdir}"/boot + cp u-boot-${pkgver##*.}/bins/uboot-goflexhome.kwb "${pkgdir}"/boot + cp "${srcdir}"/uboot-goflexhome.env "${pkgdir}"/boot +} diff --git a/alarm/uboot-kirkwood/uboot-dockstar.install b/alarm/uboot-kirkwood/uboot-dockstar.install new file mode 100644 index 000000000..f61702b88 --- /dev/null +++ b/alarm/uboot-kirkwood/uboot-dockstar.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-dockstar.kwb + nandwrite -s 0xc0000 /dev/mtd0 /boot/uboot-dockstar.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-dockstar." + 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 +} diff --git a/alarm/uboot-kirkwood/uboot-goflexhome.install b/alarm/uboot-kirkwood/uboot-goflexhome.install new file mode 100644 index 000000000..b96581cb4 --- /dev/null +++ b/alarm/uboot-kirkwood/uboot-goflexhome.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-goflexhome.kwb + nandwrite -s 0xc0000 /dev/mtd0 /boot/uboot-goflexhome.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-goflexhome." + 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 +}