# etc/passwd
echo "Creating /etc/passwd"
echo "root::0:0:root:/:/bin/sh" > tempfs/etc/passwd

# rcStart
echo "Creating /etc/init.d/rcS"
echo "#!/bin/sh" > tempfs/etc/init.d/rcS
echo 'echo "Welcome to Linux!"' >> tempfs/etc/init.d/rcS
chmod +x tempfs/etc/init.d/rcS

The "passwd" file is where it can get interesting. If you want to create a single-purpose boot disk, you can limit what happens at a login by setting up the shell (/bin/sh here) to be whatever program you want. You can even set it up to be the command "poweroff" to give root a rude surprise at login.

The "rcStart" code section creates an "rcS" script that does nothing more than say "Welcome to Linux!". What COULD have been put here is a line that would run any other program you want to happen automatically. But why stop at one line? You could write a full-blown script and invoke any number of programs.