add sys-boot/u-boot
This commit is contained in:
parent
b785a09bb0
commit
1125f78e4b
3 changed files with 152 additions and 0 deletions
64
sys-boot/u-boot/u-boot-2021.04.ebuild
Normal file
64
sys-boot/u-boot/u-boot-2021.04.ebuild
Normal file
|
@ -0,0 +1,64 @@
|
|||
# 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="U-boot 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"
|
||||
|
||||
UBOOT_ALL_DEFCONFIGS=( pinebook-pro-rk3399 )
|
||||
IUSE="${UBOOT_ALL_DEFCONFIGS[@]/#/uboot_defconfigs_}"
|
||||
REQUIRED_USE="^^ ( ${IUSE} )"
|
||||
|
||||
DEPEND="
|
||||
sys-apps/dtc
|
||||
sys-firmware/trusted-firmware-a[tfa_platforms_rk3399]
|
||||
"
|
||||
RDEPEND="${DEPEND}"
|
||||
BDEPEND=""
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
PATCHES=(
|
||||
"${FILESDIR}/0002-Correct-boot-order-to-be-USB-SD-eMMC.patch"
|
||||
"${FILESDIR}/0003-Enable-the-power-LED-during-early-startup.patch"
|
||||
)
|
||||
|
||||
uboot_get_defconfig() {
|
||||
local cfg
|
||||
for cfg in "${UBOOT_ALL_DEFCONFIGS[@]}"; do
|
||||
if use "uboot_defconfigs_${cfg}"; then
|
||||
echo ${cfg}_defconfig
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
die "no uboot_defconfigs_ set"
|
||||
}
|
||||
|
||||
|
||||
src_configure() {
|
||||
emake $(uboot_get_defconfig)
|
||||
}
|
||||
|
||||
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 "if=/usr/share/u-boot/idbloader.img of=/dev/... seek=64 conv=notrunc"
|
||||
elog "if=/usr/share/u-boot/u-boot.itb of=/dev/... seek=16384 conv=notrunc"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue