mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-01-17 23:34:07 +00:00
added alarm/uboot-kirkwood
This commit is contained in:
parent
594a6ef46e
commit
27b40e2a03
3 changed files with 137 additions and 0 deletions
51
alarm/uboot-kirkwood/PKGBUILD
Normal file
51
alarm/uboot-kirkwood/PKGBUILD
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
# U-Boot: Marvell Kirkwood platforms
|
||||||
|
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
43
alarm/uboot-kirkwood/uboot-dockstar.install
Normal file
43
alarm/uboot-kirkwood/uboot-dockstar.install
Normal file
|
@ -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
|
||||||
|
}
|
43
alarm/uboot-kirkwood/uboot-goflexhome.install
Normal file
43
alarm/uboot-kirkwood/uboot-goflexhome.install
Normal file
|
@ -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
|
||||||
|
}
|
Loading…
Reference in a new issue