sys-kernel/raspberrypi-image: sync live ebuild

Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>
This commit is contained in:
Viorel Munteanu
2025-12-15 21:19:18 +02:00
parent f08e5fa5e9
commit fec1fa38a0
2 changed files with 30 additions and 31 deletions

View File

@@ -41,21 +41,23 @@ RDEPEND="sys-boot/raspberrypi-firmware"
src_prepare() {
default
local expected_kernel_version="$(ver_cut 1-3)+"
local found_kernel_version=( "${S}"/modules/$(ver_cut 1).*.*+ )
if [[ ${PV} != 9999 ]]; then
local expected_kernel_version="$(ver_cut 1-3)+"
local found_kernel_version=( "${S}"/modules/$(ver_cut 1).*.*+ )
found_kernel_version=${found_kernel_version[0]}
found_kernel_version=${found_kernel_version##*/}
found_kernel_version=${found_kernel_version[0]}
found_kernel_version=${found_kernel_version##*/}
if [[ ${expected_kernel_version} != ${found_kernel_version} ]] ; then
eerror "Expected kernel version: ${expected_kernel_version}"
eerror "Found kernel version: ${found_kernel_version}"
die "Please fix ebuild version to contain ${found_kernel_version}!"
fi
if [[ ${expected_kernel_version} != ${found_kernel_version} ]] ; then
eerror "Expected kernel version: ${expected_kernel_version}"
eerror "Found kernel version: ${found_kernel_version}"
die "Please fix ebuild version to contain ${found_kernel_version}!"
fi
if [[ ! -d "${S}"/modules/${expected_kernel_version} ]] ; then
eerror "Kernel module directory is missing!"
die "${S}/modules/${expected_kernel_version} not found!"
if [[ ! -d "${S}"/modules/${expected_kernel_version} ]] ; then
eerror "Kernel module directory is missing!"
die "${S}/modules/${expected_kernel_version} not found!"
fi
fi
}

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -27,31 +27,28 @@ LICENSE="GPL-2 raspberrypi-videocore-bin"
SLOT="0"
RESTRICT="binchecks strip"
# Temporary safety measure to prevent ending up with a pair of
# sys-kernel/raspberrypi-image and sys-boot/raspberrypi-firmware
# both of which installed device tree files.
# Restore to simply "sys-boot/raspberrypi-firmware" when the mentioned version
# and all older ones are deleted.
RDEPEND=">sys-boot/raspberrypi-firmware-1.20190709"
RDEPEND="sys-boot/raspberrypi-firmware"
src_prepare() {
default
local expected_kernel_version="$(ver_cut 1-3)+"
local found_kernel_version=( "${S}"/modules/$(ver_cut 1).*.*+ )
if [[ ${PV} != 9999 ]]; then
local expected_kernel_version="$(ver_cut 1-3)+"
local found_kernel_version=( "${S}"/modules/$(ver_cut 1).*.*+ )
found_kernel_version=${found_kernel_version[0]}
found_kernel_version=${found_kernel_version##*/}
found_kernel_version=${found_kernel_version[0]}
found_kernel_version=${found_kernel_version##*/}
if [[ ${expected_kernel_version} != ${found_kernel_version} ]] ; then
eerror "Expected kernel version: ${expected_kernel_version}"
eerror "Found kernel version: ${found_kernel_version}"
die "Please fix ebuild version to contain ${found_kernel_version}!"
fi
if [[ ${expected_kernel_version} != ${found_kernel_version} ]] ; then
eerror "Expected kernel version: ${expected_kernel_version}"
eerror "Found kernel version: ${found_kernel_version}"
die "Please fix ebuild version to contain ${found_kernel_version}!"
fi
if [[ ! -d "${S}"/modules/${expected_kernel_version} ]] ; then
eerror "Kernel module directory is missing!"
die "${S}/modules/${expected_kernel_version} not found!"
if [[ ! -d "${S}"/modules/${expected_kernel_version} ]] ; then
eerror "Kernel module directory is missing!"
die "${S}/modules/${expected_kernel_version} not found!"
fi
fi
}