From 57e9a106c25bcbed4694d9db5ce512beb9693c01 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Fri, 4 Aug 2017 14:14:07 +1000 Subject: [PATCH] added loadlin.lua - for loading PsychOS from OpenOS --- build.cfg | 1 + modules/base/loadlin.lua | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 modules/base/loadlin.lua diff --git a/build.cfg b/build.cfg index 549d14a..d92d703 100755 --- a/build.cfg +++ b/build.cfg @@ -1,3 +1,4 @@ +modules/base/loadlin.lua modules/debug/log.lua modules/base/header.lua modules/base/component.lua diff --git a/modules/base/loadlin.lua b/modules/base/loadlin.lua new file mode 100644 index 0000000..cdd7938 --- /dev/null +++ b/modules/base/loadlin.lua @@ -0,0 +1,9 @@ +if pcall(require,"computer") then + print("OpenOS detected.") + print(os.getenv("_")) + local computer = require "computer" + local process = require "process" + os.execute("cp "..os.getenv("_").." /tmp/init.lua") + computer.setBootAddress(computer.tmpAddress()) + computer.shutdown(true) +end