ref: 84b2922214d8d61e6dfd5b28542bcfdb56bceba2
parent: 699f654ba58d833dc5c69810bff4de2011a52bf3
author: 9ferno <[email protected]>
date: Fri Aug 13 04:37:31 EDT 2021
provide a fallback shell console when /dis/init fails
--- a/os/init/disinit.b
+++ b/os/init/disinit.b
@@ -59,12 +59,13 @@
sh := load Sh "/dis/sh.dis";
(s, nil) := sys->stat("/dis/init");
if(s == 0){
- sys->print("spawn sh -n /dis/init\n");
+ sys->print("spawn sh -x -n /dis/init\n");
spawn sh->init(nil, "sh" :: "-x" :: "-n" :: "/dis/init" :: nil);
- } else {
- sys->fprint(stderr, "init: cannot find /dis/init: %r\n");
- spawn sh->init(nil, "-n" :: nil);
}
+ # fallback console
+ sh1 := load Sh "/dis/sh.dis";
+ sys->print("sh -x -n\n");
+ sh1->init(nil, "sh" :: "-x" :: "-n" :: nil);
}
srv()