diff -r 287d82efe5f2 sys/src/9/boot/bootrc --- a/sys/src/9/boot/bootrc Mon Jan 13 23:22:35 2020 +0000 +++ b/sys/src/9/boot/bootrc Sat Jan 18 17:00:51 2020 +0100 @@ -43,6 +43,21 @@ $* || fatal $"*^': '^$status } +fn wait_timeout { + @{ + echo waiting $1 seconds for $*(2-) + seconds=$1 + shift + while (test $seconds -gt 0) { + if ($*) + exit '' + seconds=`{echo $seconds | awk '{print($1-1)}'} + sleep 1 + } + exit timeout + } +} + fn ask { echo -n $1 echo -n $2 @@ -65,6 +80,11 @@ mt=() fn main{ + echo nobootprompt is $"nobootprompt + waitfor=(300 test -d /dev/sdUc420e/) + if (! ~ $#waitfor 0) { + wait_timeout $waitfor || echo $status + } mp=() while(~ $#mp 0){ if(~ $#nobootprompt 0){ @@ -185,7 +205,7 @@ # add partitions and binds configlocal - +nobootprompt='local!/dev/sdUc420e/fs' while(){ @{main}