ref: a4a3f519a6fea74d6bfc3c60a443fe2feb763e21
parent: 29c9eb1c211b7eb9f75488aace487976297499f4
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Wed Nov 9 10:26:26 EST 2011
9boot: add wait word
--- a/sys/man/8/9boot
+++ b/sys/man/8/9boot
@@ -36,6 +36,12 @@
is removed. If the
.IR prefix
argument is omitted, the whole configuration will be reset.
+If the word
+.B wait
+appears in the configuration then
+.IR 9boot
+will return to the console prompt after processing the file.
+
The word
.B boot
will end the console and resume booting the kernel.
--- a/sys/src/boot/pc/mkfile
+++ b/sys/src/boot/pc/mkfile
@@ -55,10 +55,11 @@
rm -fr tmp $target
mkdir tmp
mkdir tmp/386
+ mkdir tmp/cfg
cp 9bootiso tmp/386
cp /386/9pcf tmp/386
- mkdir tmp/cfg
- echo 'bootfile=/386/9pcf' >tmp/cfg/plan9.ini
+ cp /sys/lib/dist/cfg/plan9.ini tmp/cfg/plan9.ini
+ echo wait >>tmp/cfg/plan9.ini
disk/mk9660 -B 386/9bootiso -p /sys/lib/sysconfig/proto/allproto -s tmp $target
rm -fr tmp
--- a/sys/src/boot/pc/sub.c
+++ b/sys/src/boot/pc/sub.c
@@ -189,10 +189,11 @@
configure(void *f, char *path)
{
char line[64], *kern, *s, *p;
- int inblock, n;
+ int inblock, nowait, n;
Clear:
kern = 0;
+ nowait = 1;
inblock = 0;
memset(BOOTLINE, 0, BOOTLINELEN);
@@ -209,8 +210,14 @@
inblock = memcmp("[common]", line, 8);
continue;
}
- if(!memcmp("boot", line, 5))
+ if(!memcmp("boot", line, 5)){
+ nowait=1;
break;
+ }
+ if(!memcmp("wait", line, 5)){
+ nowait=0;
+ continue;
+ }
if(!memcmp("clear", line, 5)){
if(line[5] == 0){
print("ok");
@@ -249,7 +256,7 @@
close(f);
f = 0;
- if(kern && timeout(1000))
+ if(kern && (nowait==0 || timeout(1000)))
goto Loop;
}