X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/270869139db617e29a35bb9ded41087bb702f9ac..b1644f824d7f4989a94b8a752aadee26cae25069:/lunaix-os/usr/init/init.c?ds=sidebyside diff --git a/lunaix-os/usr/init/init.c b/lunaix-os/usr/init/init.c index c402a4f..67a73f9 100644 --- a/lunaix-os/usr/init/init.c +++ b/lunaix-os/usr/init/init.c @@ -1,11 +1,13 @@ #include #include -#include -#include +#include +#include #include #include #include +#include + #define must_mount(src, target, fs, opts) \ do { \ int err = 0; \ @@ -39,7 +41,7 @@ init_termios(int fd) { check(tcgetattr(fd, &term)); - term.c_lflag = ICANON | IEXTEN | ISIG | ECHO | ECHOE | ECHONL; + term.c_lflag = ICANON | IEXTEN | ISIG | ECHO | ECHOE; term.c_iflag = ICRNL | IGNBRK; term.c_oflag = ONLCR | OPOST; term.c_cflag = CREAD | CLOCAL | CS8 | CPARENB; @@ -53,21 +55,15 @@ init_termios(int fd) { return 0; } -const char* sh_argv[] = { "/usr/bin/sh", 0 }; +const char* sh_argv[] = { "/bin/sh", 0 }; const char* sh_envp[] = { 0 }; int main(int argc, const char** argv) { - mkdir("/dev"); - mkdir("/sys"); - mkdir("/task"); - mkdir("/mnt/disk"); - must_mount(NULL, "/dev", "devfs", 0); must_mount(NULL, "/sys", "twifs", MNT_RO); must_mount(NULL, "/task", "taskfs", MNT_RO); - maybe_mount("/dev/block/sdb", "/mnt/disk", "ext2", 0); int fd = check(open("/dev/tty", 0)); @@ -75,8 +71,6 @@ main(int argc, const char** argv) check(dup(fd)); - check(symlink("/usr", "/mnt/lunaix-os/usr")); - pid_t pid; int err = 0; if (!(pid = fork())) {