Files
Linux_Drivers/ramdisk/initramfs/glibc_riscv64/init
sam.xiang 1cf39ecdd5 [ramdisk] add cvitek pre-built ramdisk
Change-Id: Ic7d2046a23358129eaf621b5558984a64fa7361d
2023-03-10 20:35:40 +08:00

16 lines
462 B
Bash
Executable File

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