Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Ubuntu 21.10 #11

Merged
merged 3 commits into from
May 1, 2022
Merged

Support for Ubuntu 21.10 #11

merged 3 commits into from
May 1, 2022

Conversation

sdwilsh
Copy link
Contributor

@sdwilsh sdwilsh commented Nov 25, 2021

Context

Ubuntu stores overlays under /boot/firmware/overlays, instead of just /boot/overlays like many other operating systems for the Pi. The location of the folder where overlays can be found is defined in /etc/default/rpi-eeprom-update.

Ubuntu 21.10, which is the suggested version of Ubuntu Server to install for the CM4, uses kernel 5.13. This builds just fine on 5.13 (and probably 5.11 and 5.12 too).

Changes

  • post-install and post-remove scripts check /etc/default/rpi-eeprom-update for BOOTFS variable, and default to /boot if
    not defined there to properly install the overlay on Ubuntu
  • updates BUILD_EXCLUSIVE_KERNEL regex and README.md to support 5.13.y in addition to 5.10.y

Additional Notes

DKMS will build it, and place it under /lib/modules/5.13.0-1010-raspi/updates/dkms/emc2301.ko. At this point, the module can be manually loaded with insmod, and the fan is properly controlled. However, it does not load automatically at boot unless one tells Ubuntu to do so. I did so by adding a file under /etc/modules-load.d/ called cm4fan.conf with a single line in it containing the text emc2301.

Ubuntu stores overlays under `/boot/firmware/overlays`, instead of just
`/boot/overlays` like many other operating systems for the Pi.  The
location of the folder where `overlays` can be found is defined in
`/etc/default/rpi-eeprom-update`.

This change checks that file for `BOOTFS`, and defaults to `/boot` if
not defined there.
This builds just fine on 5.13 (and probably 5.11 and 5.12 too).

Ubuntu 21.10, which is the suggested version of Ubuntu Server to install
for the CM4, runs on 5.13.

This does not, however, seem to properly install.  DKMS will build it,
and place it under
`/lib/modules/5.13.0-1010-raspi/updates/dkms/emc2301.ko`, but not under
`/lib/modules/5.13.0-1010-raspi/kernel/drivers/hwmon/`.  If we manually
load the module with `insmod`, the fan is properly controlled.
@sdwilsh sdwilsh mentioned this pull request Nov 25, 2021
@sdwilsh
Copy link
Contributor Author

sdwilsh commented Nov 27, 2021

I figured out that Ubuntu doesn't auto-load the module, so you have to tell it to load automatically. I have updated the summary to reflect this, as I now have this working correctly under Ubuntu 21.10 with this set of changes.

@sdwilsh sdwilsh changed the title Better Support for Ubuntu Support for Ubuntu 21.10 Nov 27, 2021
@sdwilsh
Copy link
Contributor Author

sdwilsh commented Jan 10, 2022

@neg2led, ping on review of this change since you mentioned elsewhere that your notifications got messed up and you missed some things :)

@neggles
Copy link
Owner

neggles commented Jan 11, 2022

Thanks! I've been going through all of these now I've realized that GitHub failed me on the notification front...

Interesting on the lack of auto-load - did you do an update-initramfs -u, (assuming that works on Ubuntu ARM) so the driver/module is available when it's probed during boot? hwmon should trigger an automatic load of the module when the device tree is enumerated / parsed during early boot.

I used the same module target path that's used in some other DKMS drivers for things on Pis, as I'm told placing DKMS modules directly under kernel/ can make apt/dpkg unhappy when the kernel is upgraded and it tries to remove the old modules directory. That may explain the lack of autoloading, though.

Could I get you to drop the README.md changes & the dkms.conf version compatibility string change, then squash these commits together? This should build and load on any 5.10+ kernel without any trouble, and 2143df6 limits it to only 5.10/5.13 (while what's currently in there should allow any 5.10+ to attempt a build). I'll be updating the README later today (once I'm off work) to say "Tested to work on 5.10.y and [other reported successes]" along with a couple of other things.

Apart from that, happy to merge this 😄

@neggles neggles self-assigned this Jan 11, 2022
@neggles neggles added bug Something isn't working needs changes Requires changes for commit enhancement New feature or request and removed bug Something isn't working labels Jan 11, 2022
@sdwilsh
Copy link
Contributor Author

sdwilsh commented Jan 11, 2022

It probably won't be until this weekend until I can give it a go with my hardware again. It's possible I did not run the update-initramfs -u, but I honestly don't remember :D

@neggles neggles closed this in b9c5881 May 1, 2022
@neggles neggles merged commit 3e266d0 into neggles:master May 1, 2022
@sdwilsh
Copy link
Contributor Author

sdwilsh commented May 2, 2022

Thanks for merging this. The project that I was working with this has been on hold for a bit, so I haven't had the chance to get back to addressing what you asked. Looks like you fixed it up such that it'll work for 22.04 as well, which is much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs changes Requires changes for commit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants