Searched hist:"1 a5454f6" (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/tools/testing/selftests/nolibc/ |
H A D | nolibc-test.c | 1a5454f6 Tue Jul 19 16:44:42 CDT 2022 Willy Tarreau <w@1wt.eu> selftests/nolibc: recreate and populate /dev and /proc if missing
Most of the time the program will be run alone in an initramfs. There is no value in requiring the user to populate /dev and /proc for such tests, we can do it ourselves, and it participates to the tests at the same time.
What's done here is that when called as init (getpid()==1) we check if /dev exists or create it, if /dev/console and /dev/null exists, otherwise we try to mount a devtmpfs there, and if it fails we fall back to mknod. The console is reopened if stdout was closed. Finally /proc is created and mounted if /proc/self cannot be found. This is sufficient for most tests.
Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
|