Thanks Jonathan. I got my program running automatically at Linux startup.
The inittab file that works for me is follows:
::sysinit:/bin/busybox mount -t proc proc /proc
::sysinit:/bin/busybox mount -t tmpfs tmpfs /tmp
::sysinit:/bin/busybox --install -s
::sysinit:/usr/bin/workload
/dev/console::sysinit:-/bin/ash
Kind regards,
Imran Wali
Postdoctoral Researcher
ARIES Research Center
Nebrija University
________________________________
From: Dr Jonathan Kimmitt <jrrk2(a)cam.ac.uk>
Sent: Thursday, July 19, 2018 12:27:49 PM
To: Imran Wali; lowrisc-dev(a)lists.lowrisc.org
Subject: Re: [lowrisc-dev] Running programs at Linux Startup
I would guess init knows nothing about 'user' so it ignores it. Don't forget
this level
is run by busybox which is a cut down clone of the real init program. It does not handle
all the sophistication that the real init program would have.
Consult
https://git.busybox.net/busybox/tree/examples/inittab for more information
I predict if you remove 'user' from your inittab something will happen.
On 19/07/18 11:15, Imran Wali wrote:
Yes, the program executes normally when launched from the shell.
I am sharing with you a minimal example:
I have the following code in /usr/bin/hello:
#!/bin/ash -e
echo "Hello World"
echo "Hello World" > /test.txt
exit 0
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
/dev/console::sysinit:-/bin/ash
user::sysinit:./usr/bin/hello
But the hello program doesn't execute at startup. Could you please figure out
what's wrong here?
Thanks,
Imran Wali
Postdoctoral Researcher
ARIES Research Center
Nebrija University
________________________________
From: Dr Jonathan Kimmitt <jrrk2@cam.ac.uk><mailto:jrrk2@cam.ac.uk>
Sent: Wednesday, July 18, 2018 6:49:16 PM
To: Imran Wali; lowrisc-dev@lists.lowrisc.org<mailto:lowrisc-dev@lists.lowrisc.org>
Subject: Re: [lowrisc-dev] Running programs at Linux Startup
Does the program work when you launch manually from the shell? If not it
is probably an issue with libraries not being linked in,
or reliance on shared libraries which are not present in the boot
environment
The last line of the inittab is where the shell is launched. You could
put your program there instead of /bin/ash, but it's environment will be
restricted.
If you want a fuller experience, upgrade to the v0.5 release which
allows you to compile on the FPGA and do the usual things (rather slowly).
On 18/07/18 17:37, Imran Wali wrote:
Hi,
I am trying to automatically run a user program after Linux startup on LowRISC v0.3.
To do so, I have changed the make_root.sh script to incorporate my program in /usr/bin in
the root file system. I have tried a few methods to launch the program for e.g. modifying
the "inittab" file, and to use /etc/rc.local etc, but nothing seems to work.
Please share your experiences or ideas how to automatically launch programs at Linux
startup.
Thanks and regards,
Imran Wali
Postdoctoral Researcher
ARIES Research Center
Nebrija University