1
1
mirror of https://git.shadowkat.net/izaya/OC-PsychOS2.git synced 2024-11-14 17:00:27 -05:00
OC-PsychOS2/module/rtfsboot.lua
2023-08-03 12:15:03 +10:00

21 lines
702 B
Lua

--#includepkglib "diskpart" "lib/part/mtpt.lua" "part/mtpt"
--#includepkglib "diskpart" "lib/diskpart.lua" "diskpart"
--#includepkglib "rtfs" "lib/rtfs.lua" "rtfs"
do
local a = computer.getBootAddress()
if component.type(a) == "drive" then
local diskpart = require "diskpart"
for k,v in ipairs(diskpart.getPartitions(a)) do
if v[2] == "rtfs" and v[1] == computer.address():sub(1,8) .. "-boot" then
syslog("Partition with suitable name detected, attempting to mount...")
local rtfs = require "rtfs"
fs.makeDirectory("boot")
local m = rtfs.mount(diskpart.proxyPartition(a,k))
m.address = string.format("%s/%i/rtfs",a,k)
fs.mount("boot",m)
break
end
end
end
end