diff --git a/sys/lib/dist/mkfile b/sys/lib/dist/mkfile index 703602846..045f4560c 100644 --- a/sys/lib/dist/mkfile +++ b/sys/lib/dist/mkfile @@ -92,7 +92,9 @@ cd:V: /tmp/9front.386.iso.gz @{ objtype=arm64 kernel=/n/src9/$objtype/9reform.u - echo 'bootargs=local!/dev/sdM0/fs' > /env/plan9.ini + > /env/plan9.ini { + echo 'console=0' + } fatfiles=(/n/src9/sys/src/boot/reform/boot.scr /env/plan9.ini $kernel) mb=1885 # storage vendors idea of 2GB mk $target.$pid.disk diff --git a/sys/src/9/imx8/main.c b/sys/src/9/imx8/main.c index 3ccd91ee1..901a41c68 100644 --- a/sys/src/9/imx8/main.c +++ b/sys/src/9/imx8/main.c @@ -17,7 +17,7 @@ Conf conf; #define MAXCONF 64 static char *confname[MAXCONF]; static char *confval[MAXCONF]; -static int nconf; +static int nconf = -1; void bootargsinit(void) @@ -28,7 +28,7 @@ bootargsinit(void) /* * parse configuration args from dos file plan9.ini */ - cp = BOOTARGS; /* where b.com leaves its config */ + cp = BOOTARGS; cp[BOOTARGSLEN-1] = 0; /* @@ -47,6 +47,12 @@ bootargsinit(void) *p = 0; n = getfields(cp, line, MAXCONF, 1, "\n"); + if(n <= 0){ + /* empty plan9.ini, no configuration passed */ + return; + } + + nconf = 0; for(i = 0; i < n; i++){ if(*line[i] == '#') continue; @@ -81,6 +87,12 @@ setconfenv(void) { int i; + if(nconf < 0){ + /* use defaults when there was no configuration */ + ksetenv("console", "0", 0); + return; + } + for(i = 0; i < nconf; i++){ if(confname[i][0] != '*') ksetenv(confname[i], confval[i], 0); @@ -138,7 +150,6 @@ init0(void) ksetenv("service", "cpu", 0); else ksetenv("service", "terminal", 0); - ksetenv("console", "0", 0); setconfenv(); poperror(); }