raspberrypi / usbboot

Raspberry Pi USB booting code, moved from tools repository
Apache License 2.0
878 stars 221 forks source link

rpiboot: Add build date and version #109

Closed timg236 closed 2 years ago

timg236 commented 2 years ago

Update rpiboot to emit the build-date and version in order so that this visible in bug reports.

timg236 commented 2 years ago

@peterharperuk @pelwell @XECDesign @dp111

Add version info, old versions of this package won't work with CM4S so add something to capture the version in bug reports. We should update the APT package after this has merged.

XECDesign commented 2 years ago

Assuming it's built from a git tree can be a problem for apt packages, which don't ship the .git directory in their source archive.

Edit: (or if people download release tarballs from github)

timg236 commented 2 years ago

That's a pain. It means that you can never know the real version number. Not too worried about tarballs though

XECDesign commented 2 years ago

You could fallback to dpkg-parsechangelog -SVersion if git rev-parse fails, which would give a string like 13.3-1.

timg236 commented 2 years ago

Are the APT binaries built from the git repo? I think most people either built from git (non RPiOS) or use the APT binary.

I've added a simple version. dpkg won't work on other distros but I guess we can try git, then dpkg, then plain version

peterharperuk commented 2 years ago

Looks ok

XECDesign commented 2 years ago

Are the APT binaries built from the git repo?

They are, but only by chance.

Normally I'd build just the source package and then kick it off to the build servers to build the .debs for multiple architectures. But the debs for this particular package are built on one machine, from git (at least for now).

I can add some kind of patch to work around the problem on the packaging side for Raspberry Pi OS, but I think other distro maintainers will flag it up too. We've had this problem when libcamera used the same approach.

timg236 commented 2 years ago

Can we capture the version when the source package is generated?

XECDesign commented 2 years ago

Can we capture the version when the source package is generated?

Yup, that would be how I'd work around it - put it in the changelog and patch the Makefile to read it from there instead.

timg236 commented 2 years ago

Right, I've captured the latest version date from changelog which should be good enough to identify an APT release and made the git version an optional extra. That's useful for direct builds or topic branches. If git isn't available you just get the APT release date.