Potential windows case insensitive filesystem issue fix
This commit is contained in:
1 parent
e77a8b3636
commit
62a03bfe6b
26 files changed
+18
-21
No files matched your search
@@ -33,7 +33,6 @@ local host_str = syscall.getHost() or "Unknown"
|
|||||||
local cc_ver = host_str:match("ComputerCraft ([%d%.]+)") or host_str
|
local cc_ver = host_str:match("ComputerCraft ([%d%.]+)") or host_str
|
||||||
|
|
||||||
local info = {
|
local info = {
|
||||||
-- {label, value} label=nil means print value as-is (userhost / separator)
|
|
||||||
{nil, userhost},
|
{nil, userhost},
|
||||||
{nil, string.rep("-", #userhost)},
|
{nil, string.rep("-", #userhost)},
|
||||||
{"OS", syscall.version() or "Unknown"},
|
{"OS", syscall.version() or "Unknown"},
|
||||||
@@ -42,7 +41,7 @@ local info = {
|
|||||||
{"Uptime", formatUptime(syscall.getUptime() or 0)},
|
{"Uptime", formatUptime(syscall.getUptime() or 0)},
|
||||||
{"Tasks", tostring(#(syscall.getTasks() or {}))},
|
{"Tasks", tostring(#(syscall.getTasks() or {}))},
|
||||||
{"Shell", syscall.getEnviron("SHELL") or "Unknown"},
|
{"Shell", syscall.getEnviron("SHELL") or "Unknown"},
|
||||||
{"Terminal", "TTY1"},
|
{"Terminal", "tty1"},
|
||||||
{"UID", tostring(syscall.getuid())},
|
{"UID", tostring(syscall.getuid())},
|
||||||
{"Packages", "n/a (spm)"},
|
{"Packages", "n/a (spm)"},
|
||||||
}
|
}
|
||||||
@@ -71,15 +70,12 @@ local lines = math.max(#logo, #info)
|
|||||||
for i = 1, lines do
|
for i = 1, lines do
|
||||||
local logo_str = logo[i] or string.rep(" ", 36)
|
local logo_str = logo[i] or string.rep(" ", 36)
|
||||||
|
|
||||||
-- print logo segment in cyan
|
|
||||||
c(C_LOGO)
|
c(C_LOGO)
|
||||||
printInline(logo_str)
|
printInline(logo_str)
|
||||||
|
|
||||||
-- print separator pipe
|
|
||||||
c(C_LABEL)
|
c(C_LABEL)
|
||||||
printInline("| ")
|
printInline("| ")
|
||||||
|
|
||||||
-- print info segment
|
|
||||||
local row = info[i]
|
local row = info[i]
|
||||||
if row then
|
if row then
|
||||||
if row[1] == nil and i == 1 then
|
if row[1] == nil and i == 1 then
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--:Minify:--
|
--:Minify:--
|
||||||
syscall.open("/dev/tty/TTY1","r") --stdin (Device 0)
|
syscall.open("/dev/tty/tty1","r") --stdin (Device 0)
|
||||||
syscall.open("/dev/tty/TTY1","w") --stdout (Device 1)
|
syscall.open("/dev/tty/tty1","w") --stdout (Device 1)
|
||||||
syscall.open("/dev/null","w") --stderr (device 2)
|
syscall.open("/dev/null","w") --stderr (device 2)
|
||||||
|
|
||||||
local success, errorMsg = xpcall(function()
|
local success, errorMsg = xpcall(function()
|
||||||
@@ -957,8 +957,8 @@ local function runCommand(command)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local proc = syscall.spawn(function(...)
|
local proc = syscall.spawn(function(...)
|
||||||
syscall.open("/dev/tty/TTY1","r")
|
syscall.open("/dev/tty/tty1","r")
|
||||||
syscall.open("/dev/tty/TTY1","w")
|
syscall.open("/dev/tty/tty1","w")
|
||||||
syscall.open("/dev/null","w")
|
syscall.open("/dev/null","w")
|
||||||
local ok2, msg = pcall(program, ...)
|
local ok2, msg = pcall(program, ...)
|
||||||
if not ok2 then printError(progName, msg) end
|
if not ok2 then printError(progName, msg) end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--:Minify:--
|
--:Minify:--
|
||||||
syscall.open("/dev/tty/TTY1","r")
|
syscall.open("/dev/tty/tty1","r")
|
||||||
syscall.open("/dev/tty/TTY1","w")
|
syscall.open("/dev/tty/tty1","w")
|
||||||
syscall.open("/dev/null","r")
|
syscall.open("/dev/null","r")
|
||||||
syscall.devctl(1,"clear")
|
syscall.devctl(1,"clear")
|
||||||
syscall.devctl(1,"sfgc",1)
|
syscall.devctl(1,"sfgc",1)
|
||||||
@@ -57,8 +57,8 @@ while true do
|
|||||||
printInline("> ")
|
printInline("> ")
|
||||||
end
|
end
|
||||||
proc = syscall.spawn(function(...)
|
proc = syscall.spawn(function(...)
|
||||||
syscall.open("/dev/tty/TTY1","r")
|
syscall.open("/dev/tty/tty1","r")
|
||||||
syscall.open("/dev/tty/TTY1","w")
|
syscall.open("/dev/tty/tty1","w")
|
||||||
syscall.open("/dev/null","w")
|
syscall.open("/dev/null","w")
|
||||||
program(...)
|
program(...)
|
||||||
end, path, nil, {table.unpack(split, 2)})
|
end, path, nil, {table.unpack(split, 2)})
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--:Minify:--
|
--:Minify:--
|
||||||
syscall.open("/dev/tty/TTY1", "r") --stdin (fd 0)
|
syscall.open("/dev/tty/tty1", "r") --stdin (fd 0)
|
||||||
syscall.open("/dev/tty/TTY1", "w") --stdout (fd 1)
|
syscall.open("/dev/tty/tty1", "w") --stdout (fd 1)
|
||||||
syscall.open("/dev/null", "w") --stderr (fd 2)
|
syscall.open("/dev/null", "w") --stderr (fd 2)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File renamed without changes.
+1
@@ -141,6 +141,7 @@ local function normalizePath(path)
|
|||||||
table.remove(stack)
|
table.remove(stack)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
comp = comp:lower()
|
||||||
if not comp:match(SAFE_COMPONENT_PATTERN) then
|
if not comp:match(SAFE_COMPONENT_PATTERN) then
|
||||||
error("EINVAL: illegal characters in path component: " .. comp, 2)
|
error("EINVAL: illegal characters in path component: " .. comp, 2)
|
||||||
end
|
end
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-2
@@ -385,11 +385,11 @@ kernel.processes.cctmond = function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
newtty(apis.term, "TTY1", fifo.pop)
|
newtty(apis.term, "tty1", fifo.pop)
|
||||||
|
|
||||||
|
|
||||||
for i,v in ipairs({peripheral.find("monitor")}) do
|
for i,v in ipairs({peripheral.find("monitor")}) do
|
||||||
v.setTextScale(.5)
|
v.setTextScale(.5)
|
||||||
v.write("Initializing...")
|
v.write("Initializing...")
|
||||||
newtty(v,"TTY"..tostring(i+1),function () end)
|
newtty(v,"tty"..tostring(i+1),function () end)
|
||||||
end
|
end
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-2
@@ -193,10 +193,10 @@ mergeMeta("/lib/sys", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
mergeMeta("/lib/modules", {
|
mergeMeta("/lib/modules", {
|
||||||
{"Hyperion", REG, 0, 0, RWX_RX_RX},
|
{"hyperion", REG, 0, 0, RWX_RX_RX},
|
||||||
})
|
})
|
||||||
|
|
||||||
mergeMeta("/lib/modules/Hyperion", {
|
mergeMeta("/lib/modules/hyperion", {
|
||||||
{"01_stdlib.kmod", REG, 0, 0, RW_R_R},
|
{"01_stdlib.kmod", REG, 0, 0, RW_R_R},
|
||||||
{"10_vfs.kmod", REG, 0, 0, RW_R_R},
|
{"10_vfs.kmod", REG, 0, 0, RW_R_R},
|
||||||
{"11_require.kmod", REG, 0, 0, RW_R_R},
|
{"11_require.kmod", REG, 0, 0, RW_R_R},
|
||||||
File renamed without changes.
@@ -203,7 +203,7 @@ def _make_firstboot_kmod(users):
|
|||||||
|
|
||||||
lines.append("do")
|
lines.append("do")
|
||||||
lines.append(" local ok, err = pcall(function()")
|
lines.append(" local ok, err = pcall(function()")
|
||||||
lines.append(" kernel.vfs.remove('/lib/modules/Hyperion/50_firstboot_users.kmod')")
|
lines.append(" kernel.vfs.remove('/lib/modules/hyperion/50_firstboot_users.kmod')")
|
||||||
lines.append(" end)")
|
lines.append(" end)")
|
||||||
lines.append(" if not ok then")
|
lines.append(" if not ok then")
|
||||||
lines.append(" kernel.log('FIRSTBOOT: could not self-delete: ' .. tostring(err), 'WARN')")
|
lines.append(" kernel.log('FIRSTBOOT: could not self-delete: ' .. tostring(err), 'WARN')")
|
||||||
@@ -215,7 +215,7 @@ def _make_firstboot_kmod(users):
|
|||||||
|
|
||||||
def inject_makeusers(users, arch):
|
def inject_makeusers(users, arch):
|
||||||
base = BUILD_ROOT / "$" if arch else BUILD_ROOT
|
base = BUILD_ROOT / "$" if arch else BUILD_ROOT
|
||||||
kmod_path = base / "lib" / "modules" / "Hyperion" / "50_firstboot_users.kmod"
|
kmod_path = base / "lib" / "modules" / "hyperion" / "50_firstboot_users.kmod"
|
||||||
kmod_path.parent.mkdir(parents=True, exist_ok=True)
|
kmod_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
kmod_path.write_text(_make_firstboot_kmod(users), encoding="utf-8")
|
kmod_path.write_text(_make_firstboot_kmod(users), encoding="utf-8")
|
||||||
print(" Wrote first-boot user setup -> " + str(kmod_path.relative_to(BUILD_ROOT)))
|
print(" Wrote first-boot user setup -> " + str(kmod_path.relative_to(BUILD_ROOT)))
|
||||||
|
|||||||
Reference in new issue
Block a user