2023-08-01 04:02:14 -04:00
|
|
|
--#includepkglib "diskpart" "lib/diskpart.lua" "diskpart"
|
2023-09-30 23:41:01 -04:00
|
|
|
--#includepkglib "rtfs" "lib/fs/rtfs/init.lua" "fs.rtfs"
|
|
|
|
--#includepkglib "rtfs" "lib/fs/rtfs/v1.lua" "fs.rtfs.v1"
|
2023-08-01 04:02:14 -04:00
|
|
|
do
|
|
|
|
local a = computer.getBootAddress()
|
2023-08-04 20:06:05 -04:00
|
|
|
if component.type(a) == "drive" or component.type(a) == "tape_drive" then
|
2023-08-01 04:02:14 -04:00
|
|
|
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...")
|
2023-09-30 23:41:01 -04:00
|
|
|
local rtfs = require "fs.rtfs"
|
2023-08-01 04:02:14 -04:00
|
|
|
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
|