# Copyright 2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 MY_PV=$(ver_rs 2 -) MY_P="${PN}-v${MY_PV}" DESCRIPTION="Das U-Boot with patches for the Pinebook Pro." HOMEPAGE="https://www.denx.de/wiki/U-Boot" SRC_URI="https://gitlab.denx.de/${PN}/${PN}/-/archive/v${MY_PV}/${PN}-v${MY_PV}.tar.gz -> ${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="-* arm64" IUSE="" DEPEND=" sys-apps/dtc sys-firmware/trusted-firmware-a[tfa_platforms_rk3399] " RDEPEND="${DEPEND}" BDEPEND="" S="${WORKDIR}/${MY_P}" PATCHES=( "${FILESDIR}/rk3399-all.boot-order-usb-sd-mmc.patch" "${FILESDIR}/rk3399-pinebook-pro.power-led.patch" "${FILESDIR}/rk3399-pinebook-pro.edp-panel-reset.patch" ) src_configure() { emake pinebook-pro-rk3399_defconfig # for some reason rk3399 fails to jump to a kernel if this is on?! sed -i -e '/CONFIG_USB_EHCI_HCD=y/d' -e '/CONFIG_USB_EHCI_GENERIC=y/d' .config } src_compile() { emake BL31=/usr/share/trusted-firmware-a/rk3399/bl31.elf } src_install() { insinto /usr/share/u-boot doins idbloader.img doins u-boot.itb } pkg_postinst() { elog "To install U-boot:" elog "Determine your device, then" elog "dd if=/usr/share/u-boot/idbloader.img of=/dev/... seek=64 conv=notrunc" elog "dd if=/usr/share/u-boot/u-boot.itb of=/dev/... seek=16384 conv=notrunc" }