Remix.run Logo
CupricTea 4 days ago

I got close to this realization after learning barely enough U-Boot to launch my own bare metal program for the JH7110. I could never get into Linux From Scratch because it was more focused on getting an entire system working when I really just wanted to see how it spins up to get going.

Then at some point the other week I realized I could technically have a working Linux "system" with nothing more than a kernel and a dirt simple hello world program in /sbin/init.

I haven't had the time or inclination to scratch that itch but it's nice to see this article confirm it.

checker659 4 days ago | parent [-]

Pass init=/bin/sh or what have you in GRUB cmdline

tosti 4 days ago | parent | next [-]

Traditionally,

    init=/etc/rc
And have that be a shell script which starts whatever you need. You'll probably want fsck in there, mount -a, some syslogd, perhaps dbus, some dhcp client, whatever else you need, and finally the getty which is probably a good idea to respawn after it exits. That's usually the job of init so you could well end your rc with exec /sbin/init
opello 4 days ago | parent | prev [-]

I'm sure it's useful elsewhere, but I have used this for years to debug embedded Linux environments, it's such a handy tool.