ttm: Automatically regenerate initramfs when TTM configuration changes#35
ttm: Automatically regenerate initramfs when TTM configuration changes#35superm1 merged 1 commit intosuperm1:masterfrom
Conversation
| try: | ||
| # Run lsinitramfs and search for "ttm" in the output | ||
| result = subprocess.run( | ||
| ["lsinitramfs", initramfs_path], |
There was a problem hiding this comment.
do you know if this works with initramfs images built with dracut?
There was a problem hiding this comment.
I've just tried it and it works.
There was a problem hiding this comment.
Okay - besides it working is it present in systems that only use dracut? Like on Fedora for example
superm1
left a comment
There was a problem hiding this comment.
Can you add some unit tests that mock some behaviors of the tools?
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #35 +/- ##
==========================================
- Coverage 85.90% 85.61% -0.30%
==========================================
Files 34 34
Lines 7693 7744 +51
Branches 724 731 +7
==========================================
+ Hits 6609 6630 +21
- Misses 871 898 +27
- Partials 213 216 +3 ☔ View full report in Codecov by Sentry. |
When modifying TTM configuration via modprobe, the changes won't take effect until the next reboot. However, if the ttm module is loaded during early boot (e.g., in initramfs), the new configuration won't be applied unless the initramfs is regenerated. This commit adds functionality to: 1. Check if the ttm module is included in existing initramfs images 2. Detect the system's initramfs generation tool (update-initramfs, dracut, or mkinitcpio) 3. Automatically regenerate the initramfs if needed after modifying TTM configuration This ensures that TTM configuration changes are properly applied during the next reboot, even when the module is loaded from initramfs. Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com>
When modifying TTM configuration via modprobe, the changes won't take effect until the next reboot. However, if the ttm module is loaded during early boot (e.g., in initramfs), the new configuration won't be applied unless the initramfs is regenerated.
This commit adds functionality to:
This ensures that TTM configuration changes are properly applied during the next reboot, even when the module is loaded from initramfs.
Please note that this has only been tested on a Debian system.