# Reference: <https://postmarketos.org/devicepkg>
maintainer="Henrik Grimler <henrik@grimler.se>"
pkgname=device-odroid-u2
pkgdesc="ODROID U2/U3"
pkgver=9
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
	 postmarketos-base>=25-r1
	 u-boot-odroid>=2023.04-r1
	 firmware-odroid-u2
"
makedepends="devicepkg-dev"
subpackages="
	$pkgname-kernel-lts:kernel_lts
	$pkgname-kernel-exynos4:kernel_exynos4
"
source="
	deviceinfo
	kernel-cmdline.conf
	led-heartbeat.conf
	modules-initfs.exynos4
	modules-initfs.lts
"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname

	install -Dm644 led-heartbeat.conf -t "$pkgdir"/usr/lib/modules-load.d
}

kernel_lts() {
	pkgdesc="Use Alpine's long-term support kernel"
	depends="linux-lts"
	devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}

kernel_exynos4() {
	pkgdesc="Use linux-postmarketos-exynos4"
	depends="linux-postmarketos-exynos4"
	devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}

sha512sums="
460f9979c3db34322dc419f30c9f51dc44dff0804bbaa46b2762069eacd5c3a45339487b8b74d4b3655db5d889e1f942808d8f69cee8689c804804870b02e5a9  deviceinfo
27420701ba9335b0a575300aa8591bb23f4c9d4c9479a16053ae5dad0a22a86d30ad51b6bb187dccc28753d652a2f8bb34d33ad13bc7c41dbcc60b2e1af05143  kernel-cmdline.conf
91ea48bb6f82b8083042643f199789355ad2e8b673100ea73e656a95d10405300f6edd59e9786791c0684f842a40aedc922afdc64b6b571b5d52143fcd95addf  led-heartbeat.conf
bc0c4f7eb77cc3393ac83114fe982b7d2d74725a7a390074ce29bb67b235895487018a407b8ce3593c1fa7e9dbd526199515f7932938c6169a440549eb73dfd3  modules-initfs.exynos4
ba1229a573d863e783a0f945eb825fb77cfd10662d2eacf74c2e20d1e4d118a4fa68200305cd10e1606b489fc8c86e4da7f3305ac6973d3787420eec2bed91b2  modules-initfs.lts
"
