Should we split the charging functionality into a dedicated hook?
I asked about thin in #postmarketos, and @PureTryOut wasn't too keen on this.
However, I would like to receive additional feedback.
Currently, everything that's not related to the actual stuff displayed on the screen is handled here: https://github.com/postmarketOS/pmbootstrap/blob/2824a525746c0a59b5216c73413ac0179faa0e97/aports/main/postmarketos-mkinitfs/init.sh.in#L35-L38 and there: https://github.com/postmarketOS/pmbootstrap/blob/2824a525746c0a59b5216c73413ac0179faa0e97/aports/main/postmarketos-mkinitfs/init_functions.sh#L288-L309
As some logic needs to be added there, as per most issues in this repository, I expect the corresponding function to grow in size. Shouldn't the whole charging functionality be split into a dedicated kernel hook? This is mainly for consistency, and as a way to have the feature self-contained.
As a bonus, charging-sdl would be optional (though included by default), if unwanted (it might crash on some devices, or someone might just dislike it, who knows).
The downside is that we will probably need to duplicate the following calls: https://github.com/postmarketOS/pmbootstrap/blob/2824a525746c0a59b5216c73413ac0179faa0e97/aports/main/postmarketos-mkinitfs/init.sh.in#L27-L36
An alternative to duplicating those would be to have secondary hooks that are used only in the second initramfs after it has loaded, which could be useful for other functionality as well. Although, I must ask if not starting USB network wouldn't help #16 ?
I am interested in addressing the other issues, but would rather get this one out of the way before starting.