init 462 B

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