PiRogueToolSuite / deb-packages

PiRogue Debian packages
https://pts-project.org/
GNU General Public License v3.0
2 stars 2 forks source link

pirogue-hat: prepare for hardware+software auto-detection #14

Closed CyrilBrulebois closed 1 year ago

CyrilBrulebois commented 1 year ago

This is the pirogue-hat side of https://github.com/PiRogueToolSuite/deb-packages/issues/12: we expect the I²C/RTC and fan aspects of the PiRogue hat design not to change over time, and this package could deal with those aspect, while pirogue-screen-* packages handle the SPI configuration.

See details on the other issue about the proposed auto-detection in postinst, enabling the correct things in config.txt (via raspi-firmware on Debian, directly on Raspberry OS) when relevant. These settings could be undone in postrm.

CyrilBrulebois commented 1 year ago

In the Debian case, the DTBO could be named <package>.dtbo so that it's clear where it comes from. We would probably ship it somewhere below /usr and have it copied and enabled in config.txt via postinst.

For this package, that's mean pirogue-hat.dtbo, and the fact it enables/tweaks I2C, RTC, and GPIO fan would just be an implementation detail that doesn't need to appear in the filename.

CyrilBrulebois commented 1 year ago

Since /etc/os-release is unchanged in Raspberry OS (no comment…), detecting raspi-firmware as an installed package is likely to be a very reliable way to tell Debian from Raspberry OS.

CyrilBrulebois commented 1 year ago

The detection is now implemented in a new pirogue-hardware-detection package that creates flag files depending on the detected hardware and software situation:

CyrilBrulebois commented 1 year ago

With @U039b's last changes fixing a syntax error, and the way the raspi-firmware hook is called, I think we're all done here.