When using Magisk (e.g. with ShiftOS-L), you can use a Magisk boot script.