diff --git a/Src/Hyperion-bash/bin/micro b/Src/Hyperion-bash/bin/micro index c73d68c..63b49ff 100644 --- a/Src/Hyperion-bash/bin/micro +++ b/Src/Hyperion-bash/bin/micro @@ -413,8 +413,6 @@ while running do redraw() dirty = false end - - sleep(0.05) end tclear(); tfg(1); tbg(16); tpos(1,1) diff --git a/Src/Hyperion-core/sbin/init b/Src/Hyperion-core/sbin/init new file mode 100644 index 0000000..5071168 --- /dev/null +++ b/Src/Hyperion-core/sbin/init @@ -0,0 +1,4 @@ +local args={...} +syscall.remove("/sbin/init") +syscall.symlink("/usr/lib/sysinit/sysinit", "/sbin/init") +syscall.exec("/sbin/init", args) \ No newline at end of file diff --git a/Src/Hyperion-core/sbin/init.lua b/Src/Hyperion-core/usr/lib/sysinit/sysinit similarity index 100% rename from Src/Hyperion-core/sbin/init.lua rename to Src/Hyperion-core/usr/lib/sysinit/sysinit diff --git a/Src/Hyperion-kernel/boot/kernel.lua b/Src/Hyperion-kernel/boot/kernel.lua index 19a380d..3a70aba 100644 --- a/Src/Hyperion-kernel/boot/kernel.lua +++ b/Src/Hyperion-kernel/boot/kernel.lua @@ -113,13 +113,14 @@ local split = function(str, delim, maxResultCountOrNil) end if not ifs.isFile("/boot/boot.cfg") then - kernel.log("boot.cfg missing or corrupted!, Attempting to write recovery boot.cfg", "ERROR", 2) + kernel.log("First boot detected writing boot.cfg", "INFO", 3) ifs.writeAllText("/boot/boot.cfg",ifs.readAllText("/boot/safeboot.cfg")) + kernel.firstBoot=true end local initCfgFunc, err = load(ifs.readAllText("/boot/boot.cfg"), "@boot.cfg") if not initCfgFunc then - kernel.PANIC("Failed to load /boot/boot.cfg: "..tostring(err)) + kernel.LOG_Text("Failed to load /boot/boot.cfg: "..tostring(err)) end ---@diagnostic disable-next-line: param-type-mismatch @@ -149,10 +150,6 @@ function kernel.saveLog() ifs.writeAllText("/var/log/syslog.log", kernel.LOG_Text) end -function loadcstr(string) - -end - function kernel.newFifo() local fifo = {} fifo.push=function(data) diff --git a/Src/Hyperion-kernel/boot/safeboot.cfg b/Src/Hyperion-kernel/boot/safeboot.cfg index 78bea9d..8005543 100644 --- a/Src/Hyperion-kernel/boot/safeboot.cfg +++ b/Src/Hyperion-kernel/boot/safeboot.cfg @@ -4,7 +4,7 @@ -- This file is auto-generated during the build process. -- DEFAULT BOOT CONFIGURATION FILE return { - initPath = "/sbin/init.lua", + initPath = "/sbin/init", maxOpenFiles = 128, maxFilesPerTask = 16, preempt=true diff --git a/Src/Hyperion-kernel/lib/modules/hyperion/92_permissions.kmod b/Src/Hyperion-kernel/lib/modules/hyperion/92_setup.kmod similarity index 71% rename from Src/Hyperion-kernel/lib/modules/hyperion/92_permissions.kmod rename to Src/Hyperion-kernel/lib/modules/hyperion/92_setup.kmod index 17f59da..367f9d8 100644 --- a/Src/Hyperion-kernel/lib/modules/hyperion/92_permissions.kmod +++ b/Src/Hyperion-kernel/lib/modules/hyperion/92_setup.kmod @@ -82,36 +82,38 @@ local function mergeMeta(dir, entries) end end -kernel.log("Seeding filesystem permissions...", "INFO") +if kernel.firstBoot then + kernel.log("Seeding filesystem permissions...") -mergeMeta("/", { - {"bin", REG, 0, 0, RWX_RX_RX}, - {"boot", REG, 0, 0, RWX_RX_RX}, - {"dev", REG, 0, 0, RWXRWXRWX}, - {"etc", REG, 0, 0, RWX_RX_RX}, - {"home", REG, 0, 0, RWX_RX_RX}, - {"lib", REG, 0, 0, RWX_RX_RX}, - {"root", REG, 0, 0, RW____ }, - {"sbin", REG, 0, 0, RWX_RX_RX}, - {"tmp", REG, 0, 0, RWXRWXRWX}, - {"usr", REG, 0, 0, RWX_RX_RX}, - {"var", REG, 0, 0, RWX_RX_RX}, -}) + mergeMeta("/", { + {"bin", REG, 0, 0, RWX_RX_RX}, + {"boot", REG, 0, 0, RWX_RX_RX}, + {"dev", REG, 0, 0, RWXRWXRWX}, + {"etc", REG, 0, 0, RWX_RX_RX}, + {"home", REG, 0, 0, RWX_RX_RX}, + {"lib", REG, 0, 0, RWX_RX_RX}, + {"root", REG, 0, 0, RW____ }, + {"sbin", REG, 0, 0, RWX_RX_RX}, + {"tmp", REG, 0, 0, RWXRWXRWX}, + {"usr", REG, 0, 0, RWX_RX_RX}, + {"var", REG, 0, 0, RWX_RX_RX}, + }) -mergeMeta("/bin", { - {"login", REG, 0, 0, SUID_755 }, - {"su", REG, 0, 0, SUID_755 }, - {"sudo", REG, 0, 0, SUID_755 }, -}) + mergeMeta("/bin", { + {"login", REG, 0, 0, SUID_755 }, + {"su", REG, 0, 0, SUID_755 }, + {"sudo", REG, 0, 0, SUID_755 }, + }) -mergeMeta("/etc", { - {"passwd", REG, 0, 0, RW_R_R }, - {"shadow", REG, 0, 0, RW____ }, - {"pam.d", REG, 0, 0, RWX_RX_RX}, -}) + mergeMeta("/etc", { + {"passwd", REG, 0, 0, RW_R_R }, + {"shadow", REG, 0, 0, RW____ }, + {"pam.d", REG, 0, 0, RW____ }, + }) -mergeMeta("/etc/pam.d", { - {"secret", REG, 0, 0, RW____}, -}) + mergeMeta("/etc/pam.d", { + {"secret", REG, 0, 0, RW____}, + }) -kernel.log("Filesystem permissions seeded.", "INFO") + kernel.log("Filesystem permissions seeded.") +end diff --git a/Src/Hyperion-kernel/lib/modules/hyperion/99_final.kmod b/Src/Hyperion-kernel/lib/modules/hyperion/99_final.kmod index 5aba7bd..d592766 100644 --- a/Src/Hyperion-kernel/lib/modules/hyperion/99_final.kmod +++ b/Src/Hyperion-kernel/lib/modules/hyperion/99_final.kmod @@ -1,3 +1,3 @@ --:Minify:-- local kernel = ... -kernel.allowGlobalOverwrites = false \ No newline at end of file +kernel.allowGlobalOverwrites = false diff --git a/syscallautofill.lua b/syscallautofill.lua index abca076..29c9649 100644 --- a/syscallautofill.lua +++ b/syscallautofill.lua @@ -1,7 +1,7 @@ syscall={} --- Sets home directory of User with corosponding uid to homedir ---- @param uid number +--- @param uid integer --- @param homedir string --- @return true|nil, nil|string syscall.sethomedir=function(uid, homedir) end @@ -87,7 +87,7 @@ syscall.newuser=function(username, password, gid, homedir, shell) end syscall.spawn=function(func, name, envars, args, tgid) end syscall.collect=function(pid) end syscall.setshell=function(uid, shell) end -syscall.devctl=function(fd, funcname) end +syscall.devctl=function(fd, funcname, ...) end syscall.listusers=function() end syscall.unlockuser=function(uid) end syscall.mount=function(target, diskOrId) end