summaryrefslogtreecommitdiff
path: root/sys-boot/uboot-bbb/uboot-bbb-2016.11.ebuild
blob: 06ec9173bde17fe92077f8fb869e513bab76c2bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

inherit eutils git-r3

DESCRIPTION="Simple serial terminal"
HOMEPAGE="http://www.denx.de/wiki/U-Boot"

EGIT_REPO_URI="git://git.denx.de/u-boot.git"
EGIT_COMMIT="v${PV}"

LICENSE="GPL-3.0+"
SLOT="0"
KEYWORDS="-* arm"
IUSE=""

DEPEND=""
RDEPEND="${DEPEND}"

src_configure() {
	emake am335x_boneblack_config
}

src_install() {
	dodir /boot
	insinto /boot
	doins MLO
	doins u-boot.img
	doins "${FILESDIR}"/uEnv.txt
}

pkg_postinst() {
	ROOT="$(mount | awk '/ on \/ / { print $1; }')"
	if [[ $ROOT =~ ^/dev/mmcblk.*$ ]]; then
		ROOT=${ROOT:0:12}
		elog "Flashing the new U-Boot to boot device."
		dd if=/boot/MLO of=$ROOT count=1 seek=1 conv=notrunc bs=128k
		dd if=/boot/u-boot.img of=$ROOT count=2 seek=1 conv=notrunc bs=384k
	else
		ewarn "Root not detected. Please flash new U-Boot version by hand."
	fi
}