2001-12-22 02:17:09 +01:00
|
|
|
# /etc/inittab
|
|
|
|
#
|
|
|
|
# Copyright (C) 2001 Erik Andersen <andersen@codepoet.org>
|
|
|
|
#
|
|
|
|
# Note: BusyBox init doesn't support runlevels. The runlevels field is
|
|
|
|
# completely ignored by BusyBox init. If you want runlevels, use
|
|
|
|
# sysvinit.
|
|
|
|
#
|
|
|
|
# Format for each entry: <id>:<runlevels>:<action>:<process>
|
|
|
|
#
|
|
|
|
# id == tty to run on, or empty for /dev/console
|
|
|
|
# runlevels == ignored
|
|
|
|
# action == one of sysinit, respawn, askfirst, wait, and once
|
|
|
|
# process == program to run
|
|
|
|
|
2002-12-06 05:30:19 +01:00
|
|
|
# Startup the system
|
2015-09-21 18:29:43 +02:00
|
|
|
::sysinit:/bin/mount -t proc proc /proc
|
|
|
|
::sysinit:/bin/mount -o remount,rw /
|
|
|
|
::sysinit:/bin/mkdir -p /dev/pts
|
|
|
|
::sysinit:/bin/mkdir -p /dev/shm
|
|
|
|
::sysinit:/bin/mount -a
|
busybox: add /dev/std{in, out, err} symlinks to inittab
Some applications, e.g. bashs process subsitution feature, rely on the
convention of `/dev/fd` being a symbolic link to `/proc/self/fd`.
This symbolic link and his companions `/dev/std*` are created by (e)udev [1],
but not by mdev, resulting in the following error when using the following
expression:
```
bash: /dev/fd/62: No such file or directory
```
For the sake of simplicity, lets fix this by creating the symlinks in inittab.
It is only really needed if eudev isn't used, but it doesn't really hurt to
create them even if eudev will recreate them afterwards.
Note, that we do not create the symlink `/dev/core` as `/proc/kcore` is
not available on all platforms, e.g. ARM, and the feature is not much
appreciated [2].
[1] https://github.com/gentoo/eudev/blob/8943501993322c59a6eb5be456b0d716aafff21e/src/shared/dev-setup.c#L35-L40
[2] https://lwn.net/Articles/45315/
[Peter: redirect output (errors) to /dev/null for ro rootfs]
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-04-04 20:09:34 +02:00
|
|
|
null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
|
|
|
|
null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
|
|
|
|
null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
|
|
|
|
null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
|
2015-09-21 18:29:43 +02:00
|
|
|
::sysinit:/bin/hostname -F /etc/hostname
|
2002-12-06 05:30:19 +01:00
|
|
|
# now run any rc scripts
|
2001-12-22 02:17:09 +01:00
|
|
|
::sysinit:/etc/init.d/rcS
|
|
|
|
|
2002-04-26 13:45:55 +02:00
|
|
|
# Put a getty on the serial port
|
2009-03-20 22:59:43 +01:00
|
|
|
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL
|
2001-12-22 02:17:09 +01:00
|
|
|
|
|
|
|
# Stuff to do for the 3-finger salute
|
2016-01-03 23:00:33 +01:00
|
|
|
#::ctrlaltdel:/sbin/reboot
|
2001-12-22 02:17:09 +01:00
|
|
|
|
|
|
|
# Stuff to do before rebooting
|
2014-11-20 18:01:49 +01:00
|
|
|
::shutdown:/etc/init.d/rcK
|
|
|
|
::shutdown:/sbin/swapoff -a
|
|
|
|
::shutdown:/bin/umount -a -r
|