xref: /OK3568_Linux_fs/buildroot/fs/cpio/init (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2# devtmpfs does not get automounted for initramfs
3/bin/mount -t devtmpfs devtmpfs /dev
4
5# use the /dev/console device node from devtmpfs if possible to not
6# confuse glibc's ttyname_r().
7# This may fail (E.G. booted with console=), and errors from exec will
8# terminate the shell, so use a subshell for the test
9if (exec 0</dev/console) 2>/dev/null; then
10    exec 0</dev/console
11    exec 1>/dev/console
12    exec 2>/dev/console
13fi
14
15exec /sbin/init "$@"
16