From: Felix Fietkau Date: Sat, 3 Feb 2007 12:09:17 +0000 (+0000) Subject: add workaround for problems with the missing /dev/console X-Git-Tag: whiterussian_0.9~2 X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=9930567eea9368981417a4a4c6cb9be608f7de00;p=openwrt%2Fsvn-archive%2Fopenwrt.git add workaround for problems with the missing /dev/console SVN-Revision: 6255 --- diff --git a/openwrt/package/base-files/default/etc/preinit b/openwrt/package/base-files/default/etc/preinit index 3f94442c67..4e21d6605b 100755 --- a/openwrt/package/base-files/default/etc/preinit +++ b/openwrt/package/base-files/default/etc/preinit @@ -4,6 +4,12 @@ . /etc/functions.sh export PATH=/bin:/sbin:/usr/bin:/usr/sbin +# the shell really doesn't like having stdin/out closed +# that's why we use /dev/pty/m0 and m1 as replacement +# for /dev/console if there's no serial console available +dd if=/dev/console of=/dev/null bs=1 count=0 >/dev/null 2>/dev/null || \ + exec /dev/pty/m1 2>&0 + failsafe() { lock /tmp/.failsafe