From c8147ef9e86b2640b3b524492e8931394c42978e Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Sat, 20 May 2017 18:27:26 -0400 Subject: [PATCH] major directory reorganize --- sys/apis/blocks.lua | 2 +- sys/apis/config.lua | 8 +++---- sys/apis/socket.lua | 2 +- sys/apis/ui.lua | 4 ++-- {apps => sys/apps}/.overview/Appstore | 2 +- {apps => sys/apps}/.overview/Events | 2 +- {apps => sys/apps}/.overview/Files | 2 +- {apps => sys/apps}/.overview/Help | 2 +- {apps => sys/apps}/.overview/Lua | 2 +- {apps => sys/apps}/.overview/Network | 2 +- {apps => sys/apps}/.overview/Peripherals | 2 +- {apps => sys/apps}/.overview/Script | 2 +- {apps => sys/apps}/.overview/System | 2 +- {apps => sys/apps}/.overview/Tabs | 2 +- {apps => sys/apps}/.overview/Turtles | 2 +- {apps => sys/apps}/.overview/adventure | 2 +- {apps => sys/apps}/.overview/builder | 2 +- {apps => sys/apps}/.overview/dj | 0 {apps => sys/apps}/.overview/falling | 2 +- {apps => sys/apps}/.overview/reboot | 2 +- {apps => sys/apps}/.overview/recorder | 2 +- {apps => sys/apps}/.overview/redirection | 2 +- {apps => sys/apps}/.overview/shell | 2 +- {apps => sys/apps}/.overview/shutdown | 0 {apps => sys/apps}/.overview/simpleMiner | 2 +- {apps => sys/apps}/.overview/storageActivity | 2 +- {apps => sys/apps}/.overview/storageManager | 2 +- {apps => sys/apps}/.overview/telnet | 2 +- {apps => sys/apps}/.overview/update | 2 +- {apps => sys/apps}/.overview/vnc | 2 +- {apps => sys/apps}/.overview/worm | 0 {apps => sys/apps}/Appstore.lua | 0 {apps => sys/apps}/Events.lua | 0 {apps => sys/apps}/Files.lua | 0 {apps => sys/apps}/Help.lua | 0 {apps => sys/apps}/Lua.lua | 2 +- {apps => sys/apps}/Network.lua | 0 {apps => sys/apps}/Overview.lua | 14 ++++++------- {apps => sys/apps}/Peripherals.lua | 0 {apps => sys/apps}/Pim.lua | 0 {apps => sys/apps}/Script.lua | 4 ++-- {apps => sys/apps}/System.lua | 0 {apps => sys/apps}/Tabs.lua | 0 {apps => sys/apps}/Turtles.lua | 0 {apps => sys/apps}/base64dl.lua | 0 {apps => sys/apps}/builder.lua | 2 +- {apps => sys/apps}/cat.lua | 0 {apps => sys/apps}/edit.lua | 0 {apps => sys/apps}/itemsDB.lua | 0 {apps => sys/apps}/logMonitor.lua | 0 {apps => sys/apps}/mirror.lua | 0 {apps => sys/apps}/mirrorClient.lua | 0 {apps => sys/apps}/mirrorHost.lua | 0 {apps => sys/apps}/multishell | 11 +++++----- {apps => sys/apps}/password.lua | 0 {apps => sys/apps}/pickup.lua | 0 {apps => sys/apps}/pickupRemote.lua | 0 {apps => sys/apps}/recorder.lua | 0 {apps => sys/apps}/refinedManager.lua | 0 {apps => sys/apps}/scripts/abort | 0 {apps => sys/apps}/scripts/follow | 0 {apps => sys/apps}/scripts/goHome | 0 {apps => sys/apps}/scripts/moveTo | 0 {apps => sys/apps}/scripts/obsidian | 0 {apps => sys/apps}/scripts/reboot | 0 {apps => sys/apps}/scripts/setHome | 0 {apps => sys/apps}/scripts/shutdown | 0 {apps => sys/apps}/scripts/summon | 0 {apps => sys/apps}/scripts/update | 0 {apps => sys/apps}/shell | 2 +- {apps => sys/apps}/simpleMiner.lua | 0 {apps => sys/apps}/storageActivity.lua | 0 {apps => sys/apps}/storageManager.lua | 0 {apps => sys/apps}/supplier.lua | 0 {apps => sys/apps}/t.lua | 0 {apps => sys/apps}/telnet.lua | 0 {apps => sys/apps}/trace.lua | 0 {apps => sys/apps}/trust.lua | 0 {apps => sys/apps}/update.lua | 0 {apps => sys/apps}/vnc.lua | 0 {autorun => sys/autorun}/gps.lua | 0 sys/boot/multishell.boot | 22 +++++++++++++------- {.builder => sys/etc}/blockIds.csv | 0 sys/extensions/vfs.lua | 1 + sys/network/trust.lua | 4 ++-- 85 files changed, 67 insertions(+), 59 deletions(-) rename {apps => sys/apps}/.overview/Appstore (84%) rename {apps => sys/apps}/.overview/Events (85%) rename {apps => sys/apps}/.overview/Files (80%) rename {apps => sys/apps}/.overview/Help (78%) rename {apps => sys/apps}/.overview/Lua (79%) rename {apps => sys/apps}/.overview/Network (85%) rename {apps => sys/apps}/.overview/Peripherals (81%) rename {apps => sys/apps}/.overview/Script (83%) rename {apps => sys/apps}/.overview/System (80%) rename {apps => sys/apps}/.overview/Tabs (81%) rename {apps => sys/apps}/.overview/Turtles (61%) rename {apps => sys/apps}/.overview/adventure (78%) rename {apps => sys/apps}/.overview/builder (83%) rename {apps => sys/apps}/.overview/dj (100%) rename {apps => sys/apps}/.overview/falling (74%) rename {apps => sys/apps}/.overview/reboot (82%) rename {apps => sys/apps}/.overview/recorder (83%) rename {apps => sys/apps}/.overview/redirection (72%) rename {apps => sys/apps}/.overview/shell (84%) rename {apps => sys/apps}/.overview/shutdown (100%) rename {apps => sys/apps}/.overview/simpleMiner (78%) rename {apps => sys/apps}/.overview/storageActivity (80%) rename {apps => sys/apps}/.overview/storageManager (79%) rename {apps => sys/apps}/.overview/telnet (80%) rename {apps => sys/apps}/.overview/update (84%) rename {apps => sys/apps}/.overview/vnc (80%) rename {apps => sys/apps}/.overview/worm (100%) rename {apps => sys/apps}/Appstore.lua (100%) rename {apps => sys/apps}/Events.lua (100%) rename {apps => sys/apps}/Files.lua (100%) rename {apps => sys/apps}/Help.lua (100%) rename {apps => sys/apps}/Lua.lua (99%) rename {apps => sys/apps}/Network.lua (100%) rename {apps => sys/apps}/Overview.lua (97%) rename {apps => sys/apps}/Peripherals.lua (100%) rename {apps => sys/apps}/Pim.lua (100%) rename {apps => sys/apps}/Script.lua (99%) rename {apps => sys/apps}/System.lua (100%) rename {apps => sys/apps}/Tabs.lua (100%) rename {apps => sys/apps}/Turtles.lua (100%) rename {apps => sys/apps}/base64dl.lua (100%) rename {apps => sys/apps}/builder.lua (99%) rename {apps => sys/apps}/cat.lua (100%) rename {apps => sys/apps}/edit.lua (100%) rename {apps => sys/apps}/itemsDB.lua (100%) rename {apps => sys/apps}/logMonitor.lua (100%) rename {apps => sys/apps}/mirror.lua (100%) rename {apps => sys/apps}/mirrorClient.lua (100%) rename {apps => sys/apps}/mirrorHost.lua (100%) rename {apps => sys/apps}/multishell (97%) rename {apps => sys/apps}/password.lua (100%) rename {apps => sys/apps}/pickup.lua (100%) rename {apps => sys/apps}/pickupRemote.lua (100%) rename {apps => sys/apps}/recorder.lua (100%) rename {apps => sys/apps}/refinedManager.lua (100%) rename {apps => sys/apps}/scripts/abort (100%) rename {apps => sys/apps}/scripts/follow (100%) rename {apps => sys/apps}/scripts/goHome (100%) rename {apps => sys/apps}/scripts/moveTo (100%) rename {apps => sys/apps}/scripts/obsidian (100%) rename {apps => sys/apps}/scripts/reboot (100%) rename {apps => sys/apps}/scripts/setHome (100%) rename {apps => sys/apps}/scripts/shutdown (100%) rename {apps => sys/apps}/scripts/summon (100%) rename {apps => sys/apps}/scripts/update (100%) rename {apps => sys/apps}/shell (99%) rename {apps => sys/apps}/simpleMiner.lua (100%) rename {apps => sys/apps}/storageActivity.lua (100%) rename {apps => sys/apps}/storageManager.lua (100%) rename {apps => sys/apps}/supplier.lua (100%) rename {apps => sys/apps}/t.lua (100%) rename {apps => sys/apps}/telnet.lua (100%) rename {apps => sys/apps}/trace.lua (100%) rename {apps => sys/apps}/trust.lua (100%) rename {apps => sys/apps}/update.lua (100%) rename {apps => sys/apps}/vnc.lua (100%) rename {autorun => sys/autorun}/gps.lua (100%) rename {.builder => sys/etc}/blockIds.csv (100%) diff --git a/sys/apis/blocks.lua b/sys/apis/blocks.lua index 1f47309..fa5f8cb 100644 --- a/sys/apis/blocks.lua +++ b/sys/apis/blocks.lua @@ -68,7 +68,7 @@ function blockDB:seedDB(dir) return res end - local f = fs.open(fs.combine(dir, 'blockIds.csv'), "r") + local f = fs.open(fs.combine('sys/etc', 'blockIds.csv'), "r") if not f then error('unable to read blockIds.csv') diff --git a/sys/apis/config.lua b/sys/apis/config.lua index 6aa517c..4ebe0d3 100644 --- a/sys/apis/config.lua +++ b/sys/apis/config.lua @@ -3,10 +3,10 @@ local Util = require('util') local Config = { } Config.load = function(fname, data) - local filename = '/config/' .. fname + local filename = 'usr/config/' .. fname - if not fs.exists('/config') then - fs.makeDir('/config') + if not fs.exists('usr/config') then + fs.makeDir('usr/config') end if not fs.exists(filename) then @@ -17,7 +17,7 @@ Config.load = function(fname, data) end Config.update = function(fname, data) - local filename = '/config/' .. fname + local filename = 'usr/config/' .. fname Util.writeTable(filename, data) end diff --git a/sys/apis/socket.lua b/sys/apis/socket.lua index e8c5238..083e3e4 100644 --- a/sys/apis/socket.lua +++ b/sys/apis/socket.lua @@ -146,7 +146,7 @@ local function trusted(msg, port) return true end - local trustList = Util.readTable('.known_hosts') or { } + local trustList = Util.readTable('usr/.known_hosts') or { } local pubKey = trustList[msg.shost] if pubKey then diff --git a/sys/apis/ui.lua b/sys/apis/ui.lua index 8a80ce5..d47501c 100644 --- a/sys/apis/ui.lua +++ b/sys/apis/ui.lua @@ -202,7 +202,7 @@ function Manager:configure(appName, ...) textScale = { arg = 't', type = 'number', desc = 'Text scale' }, } - local defaults = Util.loadTable('/config/' .. appName) or { } + local defaults = Util.loadTable('usr/config/' .. appName) or { } if not defaults.device then defaults.device = { } end @@ -3321,7 +3321,7 @@ function UI.NftImage:setImage(image) self.image = image end -UI:loadTheme('config/ui.theme') +UI:loadTheme('usr/config/ui.theme') if os.getVersion() >= 1.79 then UI:loadTheme('sys/etc/ext.theme') end diff --git a/apps/.overview/Appstore b/sys/apps/.overview/Appstore similarity index 84% rename from apps/.overview/Appstore rename to sys/apps/.overview/Appstore index 1ecab3a..50a97af 100644 --- a/apps/.overview/Appstore +++ b/sys/apps/.overview/Appstore @@ -4,5 +4,5 @@ \030 \031f \0310o \031f \0310o\031f ", category = "System", title = "AppStore", - run = "/apps/Appstore.lua", + run = "Appstore.lua", } \ No newline at end of file diff --git a/apps/.overview/Events b/sys/apps/.overview/Events similarity index 85% rename from apps/.overview/Events rename to sys/apps/.overview/Events index 031b554..4ed5516 100644 --- a/apps/.overview/Events +++ b/sys/apps/.overview/Events @@ -4,5 +4,5 @@ \030f\031f \0304 \030 \0311e\031f ", title = "Events", category = "System", - run = "apps/Events.lua", + run = "Events.lua", } \ No newline at end of file diff --git a/apps/.overview/Files b/sys/apps/.overview/Files similarity index 80% rename from apps/.overview/Files rename to sys/apps/.overview/Files index a1ee000..1ed1777 100644 --- a/apps/.overview/Files +++ b/sys/apps/.overview/Files @@ -4,5 +4,5 @@ \0300\0317====", title = "Files", category = "Apps", - run = "/apps/Files.lua", + run = "Files.lua", } \ No newline at end of file diff --git a/apps/.overview/Help b/sys/apps/.overview/Help similarity index 78% rename from apps/.overview/Help rename to sys/apps/.overview/Help index 8a6379b..6a779d2 100644 --- a/apps/.overview/Help +++ b/sys/apps/.overview/Help @@ -4,5 +4,5 @@ \031d?", title = "Help", category = "Apps", - run = "/apps/Help.lua", + run = "Help.lua", } \ No newline at end of file diff --git a/apps/.overview/Lua b/sys/apps/.overview/Lua similarity index 79% rename from apps/.overview/Lua rename to sys/apps/.overview/Lua index e3cb689..6edfd2b 100644 --- a/apps/.overview/Lua +++ b/sys/apps/.overview/Lua @@ -4,5 +4,5 @@ \030f ", title = "Lua", category = "Apps", - run = "/apps/Lua.lua", + run = "Lua.lua", } \ No newline at end of file diff --git a/apps/.overview/Network b/sys/apps/.overview/Network similarity index 85% rename from apps/.overview/Network rename to sys/apps/.overview/Network index 38b5bf1..0aeb7d5 100644 --- a/apps/.overview/Network +++ b/sys/apps/.overview/Network @@ -5,5 +5,5 @@ icon = "\0304 \030 \ \030f \0304 \0307 \030 \031 \031f)\ \030f \0304 \0307 \030 \031f)", - run = "/apps/Network.lua", + run = "Network.lua", } \ No newline at end of file diff --git a/apps/.overview/Peripherals b/sys/apps/.overview/Peripherals similarity index 81% rename from apps/.overview/Peripherals rename to sys/apps/.overview/Peripherals index e8a0e20..094ae6f 100644 --- a/apps/.overview/Peripherals +++ b/sys/apps/.overview/Peripherals @@ -4,5 +4,5 @@ \030f \0304 \0307 \030 \031f/", title = "Devices", category = "System", - run = "/apps/Peripherals.lua", + run = "Peripherals.lua", } \ No newline at end of file diff --git a/apps/.overview/Script b/sys/apps/.overview/Script similarity index 83% rename from apps/.overview/Script rename to sys/apps/.overview/Script index 1d9f8e2..cda05e4 100644 --- a/apps/.overview/Script +++ b/sys/apps/.overview/Script @@ -5,5 +5,5 @@ icon = "\0300\0317if\031 \0307 \ \0300\0317turt\ \0300\0317retu", - run = "/apps/Script.lua", + run = "Script.lua", } \ No newline at end of file diff --git a/apps/.overview/System b/sys/apps/.overview/System similarity index 80% rename from apps/.overview/System rename to sys/apps/.overview/System index 27ce0b1..b374e8a 100644 --- a/apps/.overview/System +++ b/sys/apps/.overview/System @@ -4,5 +4,5 @@ \0307\031f| ", title = "System", category = "System", - run = "/apps/System.lua", + run = "System.lua", } \ No newline at end of file diff --git a/apps/.overview/Tabs b/sys/apps/.overview/Tabs similarity index 81% rename from apps/.overview/Tabs rename to sys/apps/.overview/Tabs index 964ccdf..fcba0c7 100644 --- a/apps/.overview/Tabs +++ b/sys/apps/.overview/Tabs @@ -4,5 +4,5 @@ \0303 ", title = "Tabs", category = "System", - run = "/apps/Tabs.lua", + run = "Tabs.lua", } \ No newline at end of file diff --git a/apps/.overview/Turtles b/sys/apps/.overview/Turtles similarity index 61% rename from apps/.overview/Turtles rename to sys/apps/.overview/Turtles index 7316c99..61363a6 100644 --- a/apps/.overview/Turtles +++ b/sys/apps/.overview/Turtles @@ -1,5 +1,5 @@ { category = "Apps", title = "Turtles", - run = "apps/Turtles.lua", + run = "Turtles.lua", } \ No newline at end of file diff --git a/apps/.overview/adventure b/sys/apps/.overview/adventure similarity index 78% rename from apps/.overview/adventure rename to sys/apps/.overview/adventure index 50df60a..f09b1d6 100644 --- a/apps/.overview/adventure +++ b/sys/apps/.overview/adventure @@ -4,5 +4,5 @@ \030f\0314?\031f \031 \030 ", title = "Adventure", category = "Games", - run = "/rom/programs/fun/adventure", + run = "rom/programs/fun/adventure", } \ No newline at end of file diff --git a/apps/.overview/builder b/sys/apps/.overview/builder similarity index 83% rename from apps/.overview/builder rename to sys/apps/.overview/builder index efa1704..60b73d8 100644 --- a/apps/.overview/builder +++ b/sys/apps/.overview/builder @@ -4,5 +4,5 @@ \030e\031c#\0307\031f.\030e\031c###", title = "Builder", category = "Apps", - run = "/apps/builder.lua", + run = "builder.lua", } \ No newline at end of file diff --git a/apps/.overview/dj b/sys/apps/.overview/dj similarity index 100% rename from apps/.overview/dj rename to sys/apps/.overview/dj diff --git a/apps/.overview/falling b/sys/apps/.overview/falling similarity index 74% rename from apps/.overview/falling rename to sys/apps/.overview/falling index c7d4f4b..72524eb 100644 --- a/apps/.overview/falling +++ b/sys/apps/.overview/falling @@ -4,5 +4,5 @@ \030e \0309 \0301 ", title = "Falling", category = "Games", - run = "/rom/programs/pocket/falling", + run = "rom/programs/pocket/falling", } \ No newline at end of file diff --git a/apps/.overview/reboot b/sys/apps/.overview/reboot similarity index 82% rename from apps/.overview/reboot rename to sys/apps/.overview/reboot index fe9213d..4ef508b 100644 --- a/apps/.overview/reboot +++ b/sys/apps/.overview/reboot @@ -4,5 +4,5 @@ \0304\031f - ", title = "Reboot", category = "System", - run = "/rom/programs/reboot", + run = "rom/programs/reboot", } \ No newline at end of file diff --git a/apps/.overview/recorder b/sys/apps/.overview/recorder similarity index 83% rename from apps/.overview/recorder rename to sys/apps/.overview/recorder index eeaf469..d995c52 100644 --- a/apps/.overview/recorder +++ b/sys/apps/.overview/recorder @@ -4,5 +4,5 @@ \030 \031b \030e \030 \031f\\", category = "Apps", title = "Recorder", - run = "/apps/recorder.lua", + run = "recorder.lua", } \ No newline at end of file diff --git a/apps/.overview/redirection b/sys/apps/.overview/redirection similarity index 72% rename from apps/.overview/redirection rename to sys/apps/.overview/redirection index f9b5722..dc30296 100644 --- a/apps/.overview/redirection +++ b/sys/apps/.overview/redirection @@ -4,5 +4,5 @@ \0307 ", title = "Redirection", category = "Games", - run = "/rom/programs/fun/advanced/redirection", + run = "rom/programs/fun/advanced/redirection", } \ No newline at end of file diff --git a/apps/.overview/shell b/sys/apps/.overview/shell similarity index 84% rename from apps/.overview/shell rename to sys/apps/.overview/shell index c88cc2a..fff1b7a 100644 --- a/apps/.overview/shell +++ b/sys/apps/.overview/shell @@ -4,5 +4,5 @@ \0304 \030f \030 ", title = "Shell", category = "Apps", - run = "/apps/shell", + run = "shell", } \ No newline at end of file diff --git a/apps/.overview/shutdown b/sys/apps/.overview/shutdown similarity index 100% rename from apps/.overview/shutdown rename to sys/apps/.overview/shutdown diff --git a/apps/.overview/simpleMiner b/sys/apps/.overview/simpleMiner similarity index 78% rename from apps/.overview/simpleMiner rename to sys/apps/.overview/simpleMiner index f5404c6..0c0282d 100644 --- a/apps/.overview/simpleMiner +++ b/sys/apps/.overview/simpleMiner @@ -4,5 +4,5 @@ \0304 ", title = "Miner", category = "Apps", - run = "/apps/simpleMiner.lua", + run = "simpleMiner.lua", } \ No newline at end of file diff --git a/apps/.overview/storageActivity b/sys/apps/.overview/storageActivity similarity index 80% rename from apps/.overview/storageActivity rename to sys/apps/.overview/storageActivity index 6500b56..f603440 100644 --- a/apps/.overview/storageActivity +++ b/sys/apps/.overview/storageActivity @@ -4,5 +4,5 @@ \0318\\\030f\031 \030 \0318/", title = "Activity", category = "Apps", - run = "/apps/storageActivity.lua", + run = "storageActivity.lua", } \ No newline at end of file diff --git a/apps/.overview/storageManager b/sys/apps/.overview/storageManager similarity index 79% rename from apps/.overview/storageManager rename to sys/apps/.overview/storageManager index 8eb79f4..d58a28e 100644 --- a/apps/.overview/storageManager +++ b/sys/apps/.overview/storageManager @@ -4,5 +4,5 @@ \0307 ", title = "Storage", category = "Apps", - run = "/apps/storageManager.lua", + run = "storageManager.lua", } \ No newline at end of file diff --git a/apps/.overview/telnet b/sys/apps/.overview/telnet similarity index 80% rename from apps/.overview/telnet rename to sys/apps/.overview/telnet index 7db6138..f84dd46 100644 --- a/apps/.overview/telnet +++ b/sys/apps/.overview/telnet @@ -4,5 +4,5 @@ \0314>\0310_\031 ", title = "Telnet", category = "Apps", - run = "/apps/telnet.lua", + run = "telnet.lua", } \ No newline at end of file diff --git a/apps/.overview/update b/sys/apps/.overview/update similarity index 84% rename from apps/.overview/update rename to sys/apps/.overview/update index f31a634..cdd9fab 100644 --- a/apps/.overview/update +++ b/sys/apps/.overview/update @@ -4,5 +4,5 @@ \0301\03170\03180\03171\0307\031f>", title = "Update", category = "System", - run = "/apps/update.lua", + run = "update.lua", } \ No newline at end of file diff --git a/apps/.overview/vnc b/sys/apps/.overview/vnc similarity index 80% rename from apps/.overview/vnc rename to sys/apps/.overview/vnc index c1d74b8..0250402 100644 --- a/apps/.overview/vnc +++ b/sys/apps/.overview/vnc @@ -4,5 +4,5 @@ \031e\\/\031 \0319c", title = "VNC", category = "Apps", - run = "/apps/vnc.lua", + run = "vnc.lua", } \ No newline at end of file diff --git a/apps/.overview/worm b/sys/apps/.overview/worm similarity index 100% rename from apps/.overview/worm rename to sys/apps/.overview/worm diff --git a/apps/Appstore.lua b/sys/apps/Appstore.lua similarity index 100% rename from apps/Appstore.lua rename to sys/apps/Appstore.lua diff --git a/apps/Events.lua b/sys/apps/Events.lua similarity index 100% rename from apps/Events.lua rename to sys/apps/Events.lua diff --git a/apps/Files.lua b/sys/apps/Files.lua similarity index 100% rename from apps/Files.lua rename to sys/apps/Files.lua diff --git a/apps/Help.lua b/sys/apps/Help.lua similarity index 100% rename from apps/Help.lua rename to sys/apps/Help.lua diff --git a/apps/Lua.lua b/sys/apps/Lua.lua similarity index 99% rename from apps/Lua.lua rename to sys/apps/Lua.lua index 246231e..2496dfa 100644 --- a/apps/Lua.lua +++ b/sys/apps/Lua.lua @@ -14,7 +14,7 @@ multishell.setTitle(multishell.getCurrent(), 'Lua') UI:configure('Lua', ...) local command = '' -local history = History.load('.lua_history', 25) +local history = History.load('usr/.lua_history', 25) local page = UI.Page({ menuBar = UI.MenuBar({ diff --git a/apps/Network.lua b/sys/apps/Network.lua similarity index 100% rename from apps/Network.lua rename to sys/apps/Network.lua diff --git a/apps/Overview.lua b/sys/apps/Overview.lua similarity index 97% rename from apps/Overview.lua rename to sys/apps/Overview.lua index 3b79481..a523715 100644 --- a/apps/Overview.lua +++ b/sys/apps/Overview.lua @@ -21,11 +21,11 @@ Config.load('Overview', config) local function loadApplications() Util.clear(applications) - local apps = fs.list('apps/.overview') + local apps = fs.list('sys/apps/.overview') for _,app in pairs(apps) do - local data = Util.readTable('apps/.overview/' .. app) + local data = Util.readTable('sys/apps/.overview/' .. app) if data then - data.filename = 'apps/.overview/' .. app + data.filename = 'sys/apps/.overview/' .. app table.insert(applications, data) end end @@ -275,20 +275,20 @@ function page:eventHandler(event) end Config.update('Overview', config) multishell.openTab({ - path = '/apps/shell', + path = 'sys/apps/shell', args = { event.button.app.run }, focused = true, }) elseif event.type == 'shell' then multishell.openTab({ - path = '/apps/shell', + path = 'sys/apps/shell', focused = true, }) elseif event.type == 'lua' then multishell.openTab({ - path = '/apps/Lua.lua', + path = 'sys/apps/Lua.lua', focused = true, }) @@ -396,7 +396,7 @@ end function editor:updateApplications(app) if not app.filename then - app.filename = 'apps/.overview/' .. app.title + app.filename = 'sys/apps/.overview/' .. app.title end Util.writeTable(app.filename, app) loadApplications() diff --git a/apps/Peripherals.lua b/sys/apps/Peripherals.lua similarity index 100% rename from apps/Peripherals.lua rename to sys/apps/Peripherals.lua diff --git a/apps/Pim.lua b/sys/apps/Pim.lua similarity index 100% rename from apps/Pim.lua rename to sys/apps/Pim.lua diff --git a/apps/Script.lua b/sys/apps/Script.lua similarity index 99% rename from apps/Script.lua rename to sys/apps/Script.lua index 2c534b9..519c8fe 100644 --- a/apps/Script.lua +++ b/sys/apps/Script.lua @@ -4,8 +4,8 @@ local UI = require('ui') local Socket = require('socket') local Config = require('config') -local GROUPS_PATH = '/apps/groups' -local SCRIPTS_PATH = '/apps/scripts' +local GROUPS_PATH = 'usr/groups' +local SCRIPTS_PATH = 'usr/scripts' multishell.setTitle(multishell.getCurrent(), 'Script') UI:configure('script', ...) diff --git a/apps/System.lua b/sys/apps/System.lua similarity index 100% rename from apps/System.lua rename to sys/apps/System.lua diff --git a/apps/Tabs.lua b/sys/apps/Tabs.lua similarity index 100% rename from apps/Tabs.lua rename to sys/apps/Tabs.lua diff --git a/apps/Turtles.lua b/sys/apps/Turtles.lua similarity index 100% rename from apps/Turtles.lua rename to sys/apps/Turtles.lua diff --git a/apps/base64dl.lua b/sys/apps/base64dl.lua similarity index 100% rename from apps/base64dl.lua rename to sys/apps/base64dl.lua diff --git a/apps/builder.lua b/sys/apps/builder.lua similarity index 99% rename from apps/builder.lua rename to sys/apps/builder.lua index bc7d14a..f51a4ab 100644 --- a/apps/builder.lua +++ b/sys/apps/builder.lua @@ -28,7 +28,7 @@ else Logger.setDaemonLogging() end -local BUILDER_DIR = '.builder' +local BUILDER_DIR = 'usr/builder' local schematic = Schematic() local blocks = Blocks({ dir = BUILDER_DIR }) diff --git a/apps/cat.lua b/sys/apps/cat.lua similarity index 100% rename from apps/cat.lua rename to sys/apps/cat.lua diff --git a/apps/edit.lua b/sys/apps/edit.lua similarity index 100% rename from apps/edit.lua rename to sys/apps/edit.lua diff --git a/apps/itemsDB.lua b/sys/apps/itemsDB.lua similarity index 100% rename from apps/itemsDB.lua rename to sys/apps/itemsDB.lua diff --git a/apps/logMonitor.lua b/sys/apps/logMonitor.lua similarity index 100% rename from apps/logMonitor.lua rename to sys/apps/logMonitor.lua diff --git a/apps/mirror.lua b/sys/apps/mirror.lua similarity index 100% rename from apps/mirror.lua rename to sys/apps/mirror.lua diff --git a/apps/mirrorClient.lua b/sys/apps/mirrorClient.lua similarity index 100% rename from apps/mirrorClient.lua rename to sys/apps/mirrorClient.lua diff --git a/apps/mirrorHost.lua b/sys/apps/mirrorHost.lua similarity index 100% rename from apps/mirrorHost.lua rename to sys/apps/mirrorHost.lua diff --git a/apps/multishell b/sys/apps/multishell similarity index 97% rename from apps/multishell rename to sys/apps/multishell index 6fbf5de..6a7bb18 100644 --- a/apps/multishell +++ b/sys/apps/multishell @@ -45,7 +45,7 @@ local config = { tabBarBackgroundColor = colors.brown, }, -- path = '.:/apps:' .. shell.path():sub(3), - path = '/apps:' .. shell.path(), + path = 'usr/apps:sys/apps:' .. shell.path(), } Config.load('multishell', config) @@ -474,18 +474,19 @@ local function startup() end end - runDir('/sys/extensions', '[ ext ] ', shell.run) + runDir('sys/extensions', '[ ext ] ', shell.run) local overviewId = multishell.openTab({ - path = '/apps/Overview.lua', + path = 'sys/apps/Overview.lua', focused = true, hidden = true, isOverview = true, }) overviewTab = tabs[overviewId] - runDir('/sys/services', '[ svc ] ', shell.openHiddenTab) - runDir('/autorun', '[ aut ] ', shell.run) + runDir('sys/services', '[ svc ] ', shell.openHiddenTab) + runDir('sys/autorun', '[ aut ] ', shell.run) + runDir('usr/autorun', '[ aut ] ', shell.run) if hasError then error('An autorun program has errored') diff --git a/apps/password.lua b/sys/apps/password.lua similarity index 100% rename from apps/password.lua rename to sys/apps/password.lua diff --git a/apps/pickup.lua b/sys/apps/pickup.lua similarity index 100% rename from apps/pickup.lua rename to sys/apps/pickup.lua diff --git a/apps/pickupRemote.lua b/sys/apps/pickupRemote.lua similarity index 100% rename from apps/pickupRemote.lua rename to sys/apps/pickupRemote.lua diff --git a/apps/recorder.lua b/sys/apps/recorder.lua similarity index 100% rename from apps/recorder.lua rename to sys/apps/recorder.lua diff --git a/apps/refinedManager.lua b/sys/apps/refinedManager.lua similarity index 100% rename from apps/refinedManager.lua rename to sys/apps/refinedManager.lua diff --git a/apps/scripts/abort b/sys/apps/scripts/abort similarity index 100% rename from apps/scripts/abort rename to sys/apps/scripts/abort diff --git a/apps/scripts/follow b/sys/apps/scripts/follow similarity index 100% rename from apps/scripts/follow rename to sys/apps/scripts/follow diff --git a/apps/scripts/goHome b/sys/apps/scripts/goHome similarity index 100% rename from apps/scripts/goHome rename to sys/apps/scripts/goHome diff --git a/apps/scripts/moveTo b/sys/apps/scripts/moveTo similarity index 100% rename from apps/scripts/moveTo rename to sys/apps/scripts/moveTo diff --git a/apps/scripts/obsidian b/sys/apps/scripts/obsidian similarity index 100% rename from apps/scripts/obsidian rename to sys/apps/scripts/obsidian diff --git a/apps/scripts/reboot b/sys/apps/scripts/reboot similarity index 100% rename from apps/scripts/reboot rename to sys/apps/scripts/reboot diff --git a/apps/scripts/setHome b/sys/apps/scripts/setHome similarity index 100% rename from apps/scripts/setHome rename to sys/apps/scripts/setHome diff --git a/apps/scripts/shutdown b/sys/apps/scripts/shutdown similarity index 100% rename from apps/scripts/shutdown rename to sys/apps/scripts/shutdown diff --git a/apps/scripts/summon b/sys/apps/scripts/summon similarity index 100% rename from apps/scripts/summon rename to sys/apps/scripts/summon diff --git a/apps/scripts/update b/sys/apps/scripts/update similarity index 100% rename from apps/scripts/update rename to sys/apps/scripts/update diff --git a/apps/shell b/sys/apps/shell similarity index 99% rename from apps/shell rename to sys/apps/shell index 13f895e..ac996ba 100644 --- a/apps/shell +++ b/sys/apps/shell @@ -592,7 +592,7 @@ local function shellRead(_tHistory ) return sLine end -local history = History.load('.shell_history', 25) +local history = History.load('usr/.shell_history', 25) while not bExit do if config.displayDirectory then diff --git a/apps/simpleMiner.lua b/sys/apps/simpleMiner.lua similarity index 100% rename from apps/simpleMiner.lua rename to sys/apps/simpleMiner.lua diff --git a/apps/storageActivity.lua b/sys/apps/storageActivity.lua similarity index 100% rename from apps/storageActivity.lua rename to sys/apps/storageActivity.lua diff --git a/apps/storageManager.lua b/sys/apps/storageManager.lua similarity index 100% rename from apps/storageManager.lua rename to sys/apps/storageManager.lua diff --git a/apps/supplier.lua b/sys/apps/supplier.lua similarity index 100% rename from apps/supplier.lua rename to sys/apps/supplier.lua diff --git a/apps/t.lua b/sys/apps/t.lua similarity index 100% rename from apps/t.lua rename to sys/apps/t.lua diff --git a/apps/telnet.lua b/sys/apps/telnet.lua similarity index 100% rename from apps/telnet.lua rename to sys/apps/telnet.lua diff --git a/apps/trace.lua b/sys/apps/trace.lua similarity index 100% rename from apps/trace.lua rename to sys/apps/trace.lua diff --git a/apps/trust.lua b/sys/apps/trust.lua similarity index 100% rename from apps/trust.lua rename to sys/apps/trust.lua diff --git a/apps/update.lua b/sys/apps/update.lua similarity index 100% rename from apps/update.lua rename to sys/apps/update.lua diff --git a/apps/vnc.lua b/sys/apps/vnc.lua similarity index 100% rename from apps/vnc.lua rename to sys/apps/vnc.lua diff --git a/autorun/gps.lua b/sys/autorun/gps.lua similarity index 100% rename from autorun/gps.lua rename to sys/autorun/gps.lua diff --git a/sys/boot/multishell.boot b/sys/boot/multishell.boot index a6660e4..640013a 100644 --- a/sys/boot/multishell.boot +++ b/sys/boot/multishell.boot @@ -2,22 +2,20 @@ print('\nStarting multishell..') LUA_PATH = '/sys/apis' --- math.randomseed(os.clock()) -- totally broken - -_G.Util = dofile('/sys/apis/util.lua') +_G.Util = dofile('sys/apis/util.lua') _G.debug = function(...) Util.print(...) end -_G.requireInjector = dofile('/sys/apis/injector.lua') +_G.requireInjector = dofile('sys/apis/injector.lua') -os.run(Util.shallowCopy(getfenv(1)), '/sys/extensions/device.lua') +os.run(Util.shallowCopy(getfenv(1)), 'sys/extensions/device.lua') -- vfs -local s, m = os.run(Util.shallowCopy(getfenv(1)), '/sys/extensions/vfs.lua') +local s, m = os.run(Util.shallowCopy(getfenv(1)), 'sys/extensions/vfs.lua') if not s then error(m) end -- process fstab -local mounts = Util.readFile('config/fstab') +local mounts = Util.readFile('usr/config/fstab') if mounts then for _,l in ipairs(Util.split(mounts)) do if l:sub(1, 1) ~= '#' then @@ -27,8 +25,16 @@ if mounts then end end +-- user environment +if not fs.exists('usr/apps') then + fs.makeDir('usr/apps') +end +if not fs.exists('usr/autorun') then + fs.makeDir('usr/autorun') +end + local env = Util.shallowCopy(getfenv(1)) env.multishell = { } -local _, m = os.run(env, '/apps/shell', '/apps/multishell') +local _, m = os.run(env, 'sys/apps/shell', 'sys/apps/multishell') printError(m or 'Multishell aborted') diff --git a/.builder/blockIds.csv b/sys/etc/blockIds.csv similarity index 100% rename from .builder/blockIds.csv rename to sys/etc/blockIds.csv diff --git a/sys/extensions/vfs.lua b/sys/extensions/vfs.lua index 339a14d..b9b2d05 100644 --- a/sys/extensions/vfs.lua +++ b/sys/extensions/vfs.lua @@ -41,6 +41,7 @@ function nativefs.list(node, dir, full) end if not files then +print(dir) error('Not a directory') end diff --git a/sys/network/trust.lua b/sys/network/trust.lua index 11eb765..cd8222c 100644 --- a/sys/network/trust.lua +++ b/sys/network/trust.lua @@ -18,9 +18,9 @@ process:newThread('trust_server', function() else data = Crypto.decrypt(data, password) if data and data.pk and data.dh == socket.dhost then - local trustList = Util.readTable('.known_hosts') or { } + local trustList = Util.readTable('usr/.known_hosts') or { } trustList[data.dh] = data.pk - Util.writeTable('.known_hosts', trustList) + Util.writeTable('usr/.known_hosts', trustList) socket:write({ success = true, msg = 'Trust accepted' }) else