bye bye sys-donkonit, hello sys-glacier

because apparently that's a dead meme now? Hmph.
This commit is contained in:
20kdc 2018-03-19 01:27:30 +00:00
parent 6474b9356b
commit 4a57c9f175
10 changed files with 54 additions and 30 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
# This is released into the public domain.
# No warranty is provided, implied or otherwise.
# leaving in preSH.tar.gz for anyone who's interested
# in how NOT to do compression
code.tar

View File

@ -5,7 +5,7 @@
-- Terminology:
-- "monitor": Either the Null Virtual Monitor[0] (a safetynet),
-- or an actual GPU/Screen pair managed by donkonit.
-- or an actual GPU/Screen pair managed by Glacier.
-- "surface": Everest system-level drawing primitive
-- "window" : Everest user-level wrapper around a surface providing a reliable window frame, movement, etc.
-- "line" : A Wx1 area across a surface.

View File

@ -48,7 +48,7 @@ local function loadSettings()
pcall(function ()
local fw = require("sys-filewrap")
local se = require("serial")
local st = fw(fs.primary, "data/sys-donkonit/sysconf.lua", false)
local st = fw(fs.primary, "data/sys-glacier/sysconf.lua", false)
local cfg = st.read("*a")
st.close()
st = nil
@ -66,8 +66,8 @@ end
local function saveSettings()
local fw = require("sys-filewrap")
local se = require("serial")
fs.primary.makeDirectory("data/sys-donkonit")
local st = fw(fs.primary, "data/sys-donkonit/sysconf.lua", true)
fs.primary.makeDirectory("data/sys-glacier")
local st = fw(fs.primary, "data/sys-glacier/sysconf.lua", true)
st.write(se.serialize(settings))
st.close()
end

View File

@ -10,7 +10,7 @@ local gpu, screen = nil, nil
local shutdownEmergency = neo.requestAccess("k.computer").shutdown
neo.requestAccess("s.h.key_down")
-- donkonit hasn't started yet - this will be dealt with later
-- glacier hasn't started yet - this will be dealt with later
local function _(tx)
return tx
end
@ -24,9 +24,9 @@ local warnings = {
-- Attempts to call upon nsm for a safe shutdown
local function shutdown(reboot)
local donkonit = neo.requestAccess("x.neo.sys.manage")
if donkonit then
donkonit.shutdown(reboot)
local nsm = neo.requestAccess("x.neo.sys.manage")
if nsm then
nsm.shutdown(reboot)
while true do
coroutine.yield()
end
@ -62,11 +62,11 @@ local function retrieveNssMonitor(nss)
end
-- nss available - this means the monitor pool is now ready.
-- If no monitors are available, shut down now.
-- donkonit monitor pool output is smaller than, but similar to, Everest monitor data:
-- NSS monitor pool output is smaller than, but similar to, Everest monitor data:
-- {gpu, screenAddr}
local pool = nss.getClaimable()
while not pool[1] do
coroutine.yield() -- wait for presumably a donkonit notification
coroutine.yield() -- wait for presumably a NSS notification
pool = nss.getClaimable()
end
subpool = {}
@ -177,7 +177,7 @@ local function finalPrompt()
end, 2, 5, scrW - 2}
if password == "" then
pw = {function ()
return "Log in..."
return _("Log in...")
end, function (key)
if key == 13 then
waiting = false
@ -191,7 +191,7 @@ local function finalPrompt()
end, function (key)
if key == 13 then
basicDraw()
gpu.set(2, 4, "Shutting down...")
gpu.set(2, 4, _("Shutting down..."))
shutdown(false)
end
end, 2, scrH - 1, unicode.len(shButton)},
@ -200,7 +200,7 @@ local function finalPrompt()
end, function (key)
if key == 13 then
basicDraw()
gpu.set(2, 4, "Rebooting...")
gpu.set(2, 4, _("Rebooting..."))
shutdown(true)
end
end, 3 + unicode.len(shButton), scrH - 1, unicode.len(rbButton)},
@ -209,7 +209,7 @@ local function finalPrompt()
end, function (key)
if key == 13 then
basicDraw()
gpu.set(2, 4, "Login to activate Safe Mode.")
gpu.set(2, 4, _("Login to activate Safe Mode."))
sleep(1)
safeModeActive = true
advDraw()
@ -259,10 +259,10 @@ local function postPrompt()
if everests then
local s, e = pcall(everests.startSession)
if not s then
table.insert(warnings, "Everest failed to create a session")
table.insert(warnings, _("Everest failed to create a session"))
table.insert(warnings, tostring(e))
else
warnings = {"Transferring to Everest..."}
warnings = {_("Transferring to Everest...")}
advDraw()
if performDisclaim then
performDisclaim()
@ -272,7 +272,7 @@ local function postPrompt()
return
end
else
table.insert(warnings, "Couldn't communicate with Everest...")
table.insert(warnings, _("Couldn't communicate with Everest..."))
end
advDraw()
sleep(1)
@ -298,7 +298,7 @@ local function initializeSystem()
end
local w = 1
local steps = {
"sys-donkonit", -- (Donkonit : Config, Screen, Power)
"sys-glacier", -- (Glacier : Config, Screen, Power)
-- Let that start, and system GC
"WAIT",
"WAIT",
@ -340,14 +340,14 @@ local function initializeSystem()
end
if steps[w] then
if steps[w] == "INJECT" then
local donkonit = neo.requestAccess("x.neo.sys.manage")
if not donkonit then
table.insert(warnings, "Settings not available for INJECT.")
local nsm = neo.requestAccess("x.neo.sys.manage")
if not nsm then
table.insert(warnings, _("Settings not available for INJECT."))
else
local nextstepsA = {}
local nextstepsB = {}
for _, v in ipairs(neo.listApps()) do
if donkonit.getSetting("run." .. v) == "yes" then
if nsm.getSetting("run." .. v) == "yes" then
if v:sub(1, 4) == "sys-" then
table.insert(nextstepsA, v)
else
@ -396,19 +396,19 @@ end
if finalPrompt() then
-- Safe Mode
basicDraw()
local donkonit = neo.requestAccess("x.neo.sys.manage")
if donkonit then
gpu.set(2, 4, "Rebooting for Safe Mode...")
for _, v in ipairs(donkonit.listSettings()) do
local nsm = neo.requestAccess("x.neo.sys.manage")
if nsm then
gpu.set(2, 4, _("Rebooting for Safe Mode..."))
for _, v in ipairs(nsm.listSettings()) do
if v ~= "password" then
donkonit.delSetting(v)
nsm.delSetting(v)
end
end
else
-- assume sysconf.lua did something very bad
gpu.set(2, 4, "No Donkonit. Wiping configuration completely.")
gpu.set(2, 4, "No NSM. Wiping configuration completely.")
local fs = neo.requestAccess("c.filesystem")
fs.primary.remove("/data/sys-donkonit/sysconf.lua")
fs.primary.remove("/data/sys-glacier/sysconf.lua")
end
-- Do not give anything a chance to alter the new configuration
shutdownEmergency(true)

View File

@ -1,3 +1,6 @@
-- This is released into the public domain.
-- No warranty is provided, implied or otherwise.
-- BDIVIDE
-- format:
-- 0-127 for constants

View File

@ -1,3 +1,5 @@
-- This is released into the public domain. XX
-- No warranty is provided, implied or otherwise. XX
local sector = io.write -- XX
-- BUNDIVIDE reference implementation for integration XX
local Cs,Cbu,Cb,Cw,Cp,Ci,CP,CB,CD={},128,"",128,""

View File

@ -1,4 +1,7 @@
-- PREPROC: preprocess input
-- PREPROC: preprocess input to be 7-bit
-- This is released into the public domain.
-- No warranty is provided, implied or otherwise.
while true do
local c = io.read(1)
if not c then return end

View File

@ -1,3 +1,6 @@
-- This is released into the public domain where possible.
-- No warranty is provided, implied or otherwise.
-- SYSTEM HEROES.
-- Nabbed Sonic Heroes lyrics follow:
-- "What comes up, must come down... "

View File

@ -1,3 +1,6 @@
-- This is released into the public domain.
-- No warranty is provided, implied or otherwise.
os.execute("tar -cf code.tar code")
os.execute("cat insthead.lua > inst.lua")
local f = io.open("inst.lua", "ab")

7
package.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# This is released into the public domain.
# No warranty is provided, implied or otherwise.
rm code.tar
tar -cf code.tar code