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-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8ebab8ebeca03735c31966ea160ffe5265c1f267;p=openwrt%2Fsvn-archive%2Farchive.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