Can I use init in cmdline.txt?

Can I use init in cmdline.txt to run something at boot?

:man_shrugging:

BUT if you want to run something at boot, why not use one of these options:

Personally, if available, I’d use systemd. For more info:

https://wiki.archlinux.org/title/Systemd#Writing_unit_files

And replace systemd? Sure, you can run anything you want. :stuck_out_tongue:

Because I want to do stuff with the storage devices, ie expand the file system.

Right now I am using systemd oneshot to call a script, that does a bunch of stuff.

But I have learned it is possible to call that script before systemd (if I understand it correctly) by init=/pathtoscript.sh in cmdline.txt never using a systemd unit at all.
I do this on raspberry pi os, hence the question.

edit
rc.local is an option I looked into, but the method above would only demand a few lines of code in the script I would call compared to that, since I would only want to do this ONCE, then remove everything.