summaryrefslogtreecommitdiff
path: root/libre/uboot-grub/PKGBUILD
diff options
context:
space:
mode:
authorcoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2015-09-29 03:52:18 -0300
committercoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2015-09-29 03:53:05 -0300
commit13ab088b7ed545b16759a4d3facce7a0103fc3ac (patch)
tree77f6539a0b03e8985768cae6ce5fb838afe78bf8 /libre/uboot-grub/PKGBUILD
parent5a745fb65e0396b92232297ce8e02e8c2f832611 (diff)
downloadabslibre-13ab088b7ed545b16759a4d3facce7a0103fc3ac.tar.gz
abslibre-13ab088b7ed545b16759a4d3facce7a0103fc3ac.tar.bz2
abslibre-13ab088b7ed545b16759a4d3facce7a0103fc3ac.zip
libre: add initial U-Boot+GRUB pkg
Diffstat (limited to 'libre/uboot-grub/PKGBUILD')
-rw-r--r--libre/uboot-grub/PKGBUILD73
1 files changed, 73 insertions, 0 deletions
diff --git a/libre/uboot-grub/PKGBUILD b/libre/uboot-grub/PKGBUILD
new file mode 100644
index 000000000..8eb8dffbe
--- /dev/null
+++ b/libre/uboot-grub/PKGBUILD
@@ -0,0 +1,73 @@
+# Maintainer: Márcio Silva <coadde@parabola.nu>
+
+_pkgbase=u-boot
+pkgbase=uboot-grub
+pkgname=('uboot-grub-am335x_evm')
+pkgver=2015.07
+pkgrel=1
+url='http://www.denx.de/wiki/U-Boot/'
+license=('GPL2')
+makedepends=('bc')
+source=("ftp://ftp.denx.de/pub/${_pkgbase}/${_pkgbase}-${pkgver}.tar.bz2"
+ 'uboot-am335x_evm_boot-on-grub.patch'
+ 'config.am335x_evm'
+ 'uEnv-am335x_evm.txt'
+ "${pkgbase}-install-am335x_evm.sh")
+sha512sums=('40878f28c19f077bc83b82687c9f656c64ef2bdbbc3b4caf3f7ec657a7200ce212713cd5adbc0cb23379950fe804767d1efb9108cc8c33b66faa7c7d3a831ffe'
+ 'c292fa1c90c33d4291e5d24d3ff4834949fc14f9835fe71b6a3de29005438910b3ed6ade081e8c78617302b3912edcaf9b7806596506fa1fdc3154d929d9a055'
+ 'ade631646eb5de3a7f0cbd4577cfbf50979d242bce6f1a00e31ab49c15fd44295c61bd4f12a66e521a0c04b394e7a9172a70241281f119cfd3d56394d514e531'
+ 'd8287e898bdcb1a542693c2bf94eead62a640d845145527005ce37e1bbba1e73552ef2728271b7486c7fb059239de7f18fe254af30b03b4293a5993ce1e8b351'
+ '3ed1c1f4e8ad2ffc3ba74b139900ed113e4e6b574fbeb8e7d39ad18393bb941561042df3d778cc7497385ce18df645da4768542db2343a9c6b2d2765a3b815f3')
+
+_prepare_uboot-grub-am335x_evm() {
+ msg 'Copy the U-Boot building source for am335x_evm to run GRUB'
+ cp -r "${srcdir}/${_pkgbase}-${pkgver}/" "${srcdir}/${pkgbase}-am335x_evm-${pkgver}/"
+ cd "${srcdir}/${pkgbase}-am335x_evm-${pkgver}/"
+
+ # patch to boot on grub
+ patch -p1 -i "${srcdir}/uboot-am335x_evm_boot-on-grub.patch"
+
+ cat "${srcdir}/config.am335x_evm" > '.config'
+
+ unset CFLAGS CXXFLAGS LDFLAGS
+
+ msg 'get U-Boot version'
+ make prepare
+
+ msg 'Rewrite configuration'
+ yes '' | make config >/dev/null
+}
+
+prepare() {
+ if [[ "${CARCH}" == "armv7h" ]]; then
+ msg "Prepare U-Boot for am335x_evm to run GRUB"
+ _prepare_uboot-grub-am335x_evm
+ fi
+}
+
+_build_uboot-grub-am335x_evm() {
+ cd "${srcdir}/${pkgbase}-am335x_evm-${pkgver}/"
+
+ unset CFLAGS CXXFLAGS LDFLAGS
+
+ make LOCALVERSION=
+}
+
+build() {
+ if [ "${CARCH}" = 'armv7h' ]; then
+ msg 'Build U-Boot for am335x_evm to run GRUB'
+ _build_uboot-grub-am335x_evm
+ fi
+}
+
+package_uboot-grub-am335x_evm() {
+ install="${pkgname}.install"
+ cd "${srcdir}/${pkgname}-${pkgver}/"
+
+ msg 'Package U-Boot for am335x_evm to run GRUB'
+ install -vDm 0644 'MLO' "${pkgdir}/boot/${pkgname}"
+ install -vDm 0644 'u-boot.img' "${pkgdir}/boot/${pkgname}"
+ install -vDm 0644 "${srcdir}/uEnv-am335x_evm.txt" "${pkgdir}/boot/${pkgname}/uEnv.txt"
+ install -vDm 0644 "${srcdir}/${pkgbase}-install-am335x_evm.sh" "${pkgdir}/boot/${pkgname}/uboot-install.sh"
+ install -vDm 0644 'Licenses/README' "${pkgdir}/usr/share/licenses/${pkgname}"
+}