From ca4706257fbd0cef6d90add78263b30d5d92168a Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 24 May 2020 01:15:10 -0400 Subject: [PATCH] velx loader --- extras/velxboot/init.lua | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/extras/velxboot/init.lua b/extras/velxboot/init.lua index ef5f898..925129d 100644 --- a/extras/velxboot/init.lua +++ b/extras/velxboot/init.lua @@ -1,3 +1,22 @@ -for d in component.list("drive") do +local function boot_velx(addr, path) +end + +local eeprom = component.proxy(component.list("eeprom")()) +local config = eeprom.getData() +local addr, path = config:match("^(.+);(.+)$") +if not addr then + addr = config + path = "boot.velx" +else + return boot_velx(addr, path) +end + +if not component.invoke(addr, "exists", path) then + for d in component.list("filesystem") do + if (component.invoke(d, "exists", "boot.velx")) then + eeprom.setData(d..";boot.velx") + boot_velx(d, "boot.velx") + end + end end \ No newline at end of file