Is it possible to run an application here without root privileges?
Sure it is. Assuming linux has been compiled with MULTIUSER support ;)
The obvious issue being that there is no "users" as this very early point in the boot process.
Well, yeah, if you try to put
sudo on the initramfs, you will need to add a lot of configuration files (
/etc/shadow and so forth). But these complexities are not inherent to Linux. After all, UID is just a number, so it's very easy to make a toy program that can drop root privileges if that is your goal:
int main(int argc, char** argv)
If you compile it as
toysu, it can invoked thus:
toysu 1234 touch /tmp/example
1234 is the UID to use and the rest is the command to run. Note that it won't work unless you are root to begin with, so prefix that command with
sudo to test it from a normal system.