logo

bootstrap-initrd

Linux initrd to bootstrap from a small binary seed git clone https://hacktivis.me/git/bootstrap-initrd.git
commit: b133d7abd9512cc8e38a352a6395afde4e554f02
parent b01949466c1f7ac17f711ecdaa5a868f0d29164f
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sun,  5 May 2024 19:25:09 +0200

init.c: export PS1

Diffstat:

Minit.c4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/init.c b/init.c @@ -74,6 +74,10 @@ main(int argc, char *argv[]) if(mount("devtmpfs", "/dev", "devtmpfs", MS_NOSUID|MS_NOEXEC, NULL) < 0) fprintf(stderr, "Failed to mount /proc: %s\n", strerror(errno)); + // PS1 shouldn't be exported but '\h\$ ' is an *awful* default + // and oksh also doesn't sources ksh-specific files by default + setenv("PS1", "$? $PWD # ", 1); + fprintf(stderr, "Launching: /bin/loksh /init.sh\n"); if(execl("/bin/loksh", "/bin/loksh", "/init.sh", NULL) < 0)