Imran Wali wrote:
I have the following code in /usr/bin/hello:
> #!/bin/ash -e
> echo "Hello World"
> echo "Hello World" > /test.txt
> exit 0
exit 0 is redundant with -e, but not a showstopper.
Make sure that this script is executable; chmod +x /usr/bin/hello
and the inittab file contains:
> ::sysinit:/bin/busybox mount -t proc proc /proc
> ::sysinit:/bin/busybox mount -t tmpfs tmpfs /tmp
> ::sysinit:/bin/busybox --install -s
Why is there a . before the filename? Did you insert it for a purpose?
I would not expect it to be there.
A . in filenames usually refers to the current working directory of
the process. A leading . in a filename is a very explicit way to
express such a relative filename.
As opposed to DOS/Windows, Linux/UNIX systems usually do not search
the current working directory for commands entered in the shell, so
many only encounter the . directory component when diving into Linux.
As Jonathan points out, there are various caveats with the busybox init
implementation, it is limited compared to others, but it should be
sufficient. It also has some special properties, and it is very
possible that a . in the beginning of the command has a special
meaning for busybox init - I don't know that.
But the hello program doesn't execute at startup.
Could you please figure out what's wrong here?
If you are new to Linux I can recommend to spend time with Linux/UNIX
system development on a standard PC to gain system level experience.
If you want to dive in, I recommend working through the Linux From Scratch
project at least once on a spare PC or possibly in a VM. But be aware that
it's a long-ish learning curve. Plan for many full weekends.