Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916953 - dev-embedded/rpi-eeprom 20.0 version bump
Summary: dev-embedded/rpi-eeprom 20.0 version bump
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: James Le Cuirot
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-06 08:58 UTC by Cănărău Constantin
Modified: 2024-01-14 14:57 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
20.4_p1 ebuild, removed "old" from firmware dir install loop (rpi-eeprom-20.4_p1.ebuild,3.10 KB, text/plain)
2023-12-29 14:33 UTC, Herbert Wantesh
Details
updated ebuild description text aka add pi 5 (rpi-eeprom-20.4_p1.ebuild,3.10 KB, text/plain)
2023-12-29 14:36 UTC, Herbert Wantesh
Details
fix deps (rpi-eeprom-20.4_p1.ebuild,3.02 KB, text/plain)
2024-01-02 17:55 UTC, Herbert Wantesh
Details
add dev-embedded/raspberrypi-utils ebuild (raspberrypi-utils-9999.ebuild,453 bytes, text/plain)
2024-01-02 17:56 UTC, Herbert Wantesh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cănărău Constantin 2023-11-06 08:58:47 UTC
Since ver. 19 rpi-eeprom contains firmware for the new Raspberry Pi 5 (broadcom-2712).
Here is the ebuild. Feel free to make the corrections, improve it, as my ebuild skills are not at a Gentoo developer level. 

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{9..11} )

inherit python-r1 systemd

MY_P="${PN}-$(ver_cut 1-2)"
MY_BASE_URL="https://archive.raspberrypi.org/debian/pool/main/r/${PN}/${PN}_$(ver_cut 1-2)"
DESCRIPTION="Updater for Raspberry Pi 4 bootloader and the VL805 USB controller"
HOMEPAGE="https://github.com/raspberrypi/rpi-eeprom/"
SRC_URI="${MY_BASE_URL}-$(ver_cut 4).debian.tar.xz
	${MY_BASE_URL}.orig.tar.gz"
S="${WORKDIR}"

LICENSE="BSD rpi-eeprom"
SLOT="0"
KEYWORDS="~arm arm64"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
IUSE="pi4 pi5"
REQUIRED_USE="^^ ( pi4 pi5 )"

BDEPEND="sys-apps/help2man"
DEPEND="${PYTHON_DEPS}"
RDEPEND="${PYTHON_DEPS}
	sys-apps/flashrom
	sys-apps/pciutils
	|| (
		>=media-libs/raspberrypi-userland-0_pre20201022
		>=media-libs/raspberrypi-userland-bin-1.20201022
	)"

src_prepare() {
	use pi4 && export BROADCOM=2711
	use pi5 && export BROADCOM=2712
	default
	sed -i \
		-e 's:/etc/default/rpi-eeprom-update:/etc/conf.d/rpi-eeprom-update:' \
		"${MY_P}/rpi-eeprom-update" || die "Failed sed on rpi-eeprom-update"
	sed -i \
		-e 's:/usr/bin/rpi-eeprom-update:/usr/sbin/rpi-eeprom-update:' \
		"debian/rpi-eeprom.rpi-eeprom-update.service" || die "Failed sed on rpi-eeprom.rpi-eeprom-update.service"
}

src_install() {
	pushd "${MY_P}" 1>/dev/null || die "Cannot change into directory ${MY_P}"

	python_scriptinto /usr/sbin
	python_foreach_impl python_newscript rpi-eeprom-config rpi-eeprom-config

	dosbin rpi-eeprom-update rpi-eeprom-digest
	keepdir /var/lib/raspberrypi/bootloader/backup

	for dir in default latest old critical stable beta; do
		insinto /lib/firmware/raspberrypi/bootloader
		doins -r firmware-$BROADCOM/${dir}
	done

	dodoc firmware-$BROADCOM/release-notes.md

	help2man -N \
		--version-string="${PV}" --help-option="-h" \
		--name="Bootloader EEPROM configuration tool for the Raspberry Pi 4B" \
		--output=rpi-eeprom-config.1 ./rpi-eeprom-config || die "Failed to create manpage for rpi-eeprom-config"

	help2man -N \
		--version-string="${PV}" --help-option="-h" \
		--name="Checks whether the Raspberry Pi bootloader EEPROM is \
			up-to-date and updates the EEPROM" \
		 --output=rpi-eeprom-update.1 ./rpi-eeprom-update || die "Failed to create manpage for rpi-eeprom-update"

	doman rpi-eeprom-update.1 rpi-eeprom-config.1

	newconfd rpi-eeprom-update-default rpi-eeprom-update

	popd 1>/dev/null || die

	pushd debian 1>/dev/null || die "Cannot change into directory debian"

	systemd_newunit rpi-eeprom.rpi-eeprom-update.service rpi-eeprom-update.service
	newdoc changelog changelog.Debian

	popd 1>/dev/null || die

	newinitd "${FILESDIR}/init.d_rpi-eeprom-update-1" "rpi-eeprom-update"
}

pkg_postinst() {
	elog 'To have rpi-eeprom-update run at each startup, enable and start either'
	elog '/etc/init.d/rpi-eeprom-update (for openrc users)'
	elog 'or'
	elog 'rpi-eeprom-update.service (for systemd users)'
	elog '/etc/conf.d/rpi-eeprom-update contains the configuration.'
	elog 'FIRMWARE_RELEASE_STATUS="critical|stable|beta" determines'
	elog 'which release track you get. "critical" is recommended and the default.'
}



Reproducible: Always
Comment 1 Herbert Wantesh 2023-12-29 14:33:56 UTC
Created attachment 880962 [details]
20.4_p1 ebuild, removed "old" from firmware dir install loop
Comment 2 Herbert Wantesh 2023-12-29 14:36:33 UTC
Created attachment 880963 [details]
updated ebuild description text aka add pi 5
Comment 3 Roy Bamford gentoo-dev 2024-01-02 15:32:19 UTC
I had a look at this too but it made my eyes glaze over when I got to

	|| (
		>=media-libs/raspberrypi-userland-0_pre20201022
		>=media-libs/raspberrypi-userland-bin-1.20201022
	)"

since judging by the version numbers, those packages are well out of date too.
Indeed, the home page for raspberrypi-userland has the notice ...

This repo is ancient and deprecated.

It largely contains code using proprietary APIs to interface to the VideoCore firmware. We have since move to standard linux APIs.

V4L2, DRM/KMS and Mesa are the APIs you should be using.

The few useful tools from here (dtoverlay, dtmerge, vcmailbox, vcgencmd) have been moved to the raspberrypi/utils repo.

Code from here is no longer installed on latest RPiOS Bookworm images.

If you are using code from here you should rethink your solution.

Consider this repo closed.

Fixing that is well above my 'nibble round the edges' ebuild skill set but I can help with testing.
Comment 4 Herbert Wantesh 2024-01-02 17:55:57 UTC
Created attachment 881334 [details]
fix deps
Comment 5 Herbert Wantesh 2024-01-02 17:56:29 UTC
Created attachment 881335 [details]
add dev-embedded/raspberrypi-utils ebuild
Comment 6 James Le Cuirot gentoo-dev 2024-01-14 13:58:28 UTC
I'll take this, since I've already had the work prepared in a branch for a little while. Mainly been waiting on libcamera, but maybe I could merge this part early. Bear with me.
Comment 7 Larry the Git Cow gentoo-dev 2024-01-14 14:57:07 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be8045ae1229b3713b3e5fac495e8ab10dbb46c8

commit be8045ae1229b3713b3e5fac495e8ab10dbb46c8
Author:     James Le Cuirot <chewi@gentoo.org>
AuthorDate: 2024-01-14 14:48:32 +0000
Commit:     James Le Cuirot <chewi@gentoo.org>
CommitDate: 2024-01-14 14:56:54 +0000

    dev-embedded/rpi-eeprom: Bump to 21.0_p1 with Pi 5 support
    
    Thanks to Herbert Wantesh for the modifications.
    
    Closes: https://bugs.gentoo.org/916953
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>

 dev-embedded/rpi-eeprom/Manifest                    |  2 ++
 dev-embedded/rpi-eeprom/metadata.xml                |  4 ++++
 ...-15.0_p1-r1.ebuild => rpi-eeprom-21.0_p1.ebuild} | 21 +++++++++++++++------
 3 files changed, 21 insertions(+), 6 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3172402ee77d82ed5b9180ebaa5c43b7516aefc

commit c3172402ee77d82ed5b9180ebaa5c43b7516aefc
Author:     James Le Cuirot <chewi@gentoo.org>
AuthorDate: 2024-01-14 14:18:46 +0000
Commit:     James Le Cuirot <chewi@gentoo.org>
CommitDate: 2024-01-14 14:56:47 +0000

    dev-embedded/raspberrypi-utils: New package
    
    This replaces media-libs/raspberrypi-userland(-bin), which is being last-rited.
    The libraries are no longer maintained, but the utilities live on here.
    
    Bug: https://bugs.gentoo.org/916953
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>

 dev-embedded/raspberrypi-utils/Manifest            |  1 +
 dev-embedded/raspberrypi-utils/metadata.xml        | 11 ++++++
 .../raspberrypi-utils-0_p20240112.ebuild           | 39 ++++++++++++++++++++++
 3 files changed, 51 insertions(+)