From c2bbd7d2cad5c89a36a8abeb2f2c4feac68601c7 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Thu, 3 Aug 2023 12:15:03 +1000 Subject: [PATCH] update to match latest diskpart --- README.md | 7 ++++--- cfg/rc.cfg | 2 +- module/rtfsboot.lua | 1 + module/syslog.lua | 1 + preproc.lua | 22 ++-------------------- 5 files changed, 9 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index cc17c97..b199c96 100644 --- a/README.md +++ b/README.md @@ -6,19 +6,19 @@ A lightweight, multi-user operating system for OpenComputers ### The kernel -The kernel is composed of a number of modules, found in the *module/* directory. Which modules are included can be customised by changing the include statements in *module/init.lua*; copying it and customizing that is recommended, so you can *git pull* later without having to stash or reset your changes. +The kernel is composed of a number of modules, found in the *module/* directory, as specified by a file in the *kcfg* directory, `base` by default. Which modules are included can be customised by changing the include statements in the kernel configuration file; copying it and customizing that is recommended, so you can *git pull* later without having to stash or reset your changes. #### Unix-like systems The kernel can be built using the preproc library and provided scripts: - lua build.lua module/init.lua kernel.lua + lua build.lua kcfg/base.cfg kernel.lua #### PsychOS The kernel can be built from inside PsychOS using the preproc library, assuming you have the kernel source available: - preproc("module/init.lua","kernel.lua") + preproc("kcfg/base.cfg","kernel.lua") ### The boot filesystem @@ -27,6 +27,7 @@ A boot filesystem contains several things: - The kernel, as init.lua - The lib/ directory, containing libraries - The service/ directory, containing system services + - The exec/ directory, containing single-shot executable files This has been automated in the form of build.sh, pending a real makefile. diff --git a/cfg/rc.cfg b/cfg/rc.cfg index 32b46b0..66d4b67 100644 --- a/cfg/rc.cfg +++ b/cfg/rc.cfg @@ -1 +1 @@ -{enabled={"getty","minitel"}} +{enabled={"getty","minitel","fsmanager"}} diff --git a/module/rtfsboot.lua b/module/rtfsboot.lua index 10aee16..1e9de76 100644 --- a/module/rtfsboot.lua +++ b/module/rtfsboot.lua @@ -1,3 +1,4 @@ +--#includepkglib "diskpart" "lib/part/mtpt.lua" "part/mtpt" --#includepkglib "diskpart" "lib/diskpart.lua" "diskpart" --#includepkglib "rtfs" "lib/rtfs.lua" "rtfs" do diff --git a/module/syslog.lua b/module/syslog.lua index f28e7ec..e80549d 100644 --- a/module/syslog.lua +++ b/module/syslog.lua @@ -1,3 +1,4 @@ +--#include "module/ocelot-debug.lua" do syslog = {} syslog.emergency = 0 diff --git a/preproc.lua b/preproc.lua index 82d77ce..ba3bce7 100644 --- a/preproc.lua +++ b/preproc.lua @@ -60,7 +60,7 @@ end preproc.directives.include = preproc.preproc function preproc.directives.includelib(file, name) -- string string -- string -- Returns a preprocessed inlined library - return string.format("package.loaded.%s = (function()\n%s\nend)()", name, preproc.preproc(file)) + return string.format("package.loaded['%s'] = (function()\n%s\nend)()", name, preproc.preproc(file)) end function preproc.directives.includepkgfile(package, file) @@ -79,27 +79,9 @@ function preproc.directives.includepkgfile(package, file) end function preproc.directives.includepkglib(package, file, name) -- string string -- string -- Returns a preprocessed inlined library - return string.format("package.loaded.%s = (function()\n%s\nend)()", name, preproc.directives.includepkgfile(package, file)) + return string.format("package.loaded['%s'] = (function()\n%s\nend)()", name, preproc.directives.includepkgfile(package, file)) end ---[[ -function preproc.directives.includepkglib(package, file, name) - if (_OSVERSION or ""):sub(1,7) == "PsychOS" then - return preproc.directives.includelib(string.format("/pkg/%s", file), name) - else - for path in (os.getenv("PSYCHOSPACKAGES") or "../PsychOSPackages"):gmatch("[^:]+") do - print(string.format("%s/%s/%s", path, package, file)) - local f = io.open(string.format("%s/%s/%s", path, package, file), "r") - if f then - f:close() - return preproc.directives.includelib(string.format("%s/%s/%s", path, package, file), name) - end - end - end - error(string.format("unable to locate library %s from package %s", name, package)) -end -]] - return setmetatable(preproc,{__call=function(_,...) local tA = {...} local out = table.remove(tA,#tA)