diff options
author | Willy Tarreau <w@1wt.eu> | 2022-07-19 23:44:42 +0200 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2022-08-31 05:17:44 -0700 |
commit | 1a5454f625997049d886d8c3dae8e8de2a553125 (patch) | |
tree | 260712f95b848f5151a9995d8342b5f2bbfe963d /scripts/bpf_doc.py | |
parent | aa73a86cda26705c7f0af1afe9bb255a52accf87 (diff) |
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>
Diffstat (limited to 'scripts/bpf_doc.py')
0 files changed, 0 insertions, 0 deletions