2017-08-01 15:45:57 +10:00
|
|
|
do
|
|
|
|
local C=0
|
|
|
|
for c in component.list("filesystem") do
|
|
|
|
if c == computer.tmpAddress() then
|
|
|
|
fs.mount("tmp",component.proxy(c))
|
|
|
|
print(c:sub(1,8).." mounted as tmp")
|
|
|
|
end
|
|
|
|
if c == computer.getBootAddress() then
|
|
|
|
fs.mount("boot",component.proxy(c))
|
|
|
|
print(c:sub(1,8).." mounted as boot")
|
2017-08-02 00:23:26 +10:00
|
|
|
end
|
2017-08-03 09:10:02 +10:00
|
|
|
if component.invoke(c,"getLabel") ~= "" and component.invoke(c,"getLabel") ~= nil then
|
2017-08-02 00:23:26 +10:00
|
|
|
fs.mount(component.invoke(c,"getLabel"),component.proxy(c))
|
|
|
|
print(c:sub(1,8).." mounted as "..component.invoke(c,"getLabel"))
|
|
|
|
end
|
2017-08-01 15:45:57 +10:00
|
|
|
fs.mount("fs"..string.format("%02d",C),component.proxy(c))
|
|
|
|
print(c:sub(1,8).." mounted as fs"..string.format("%02d",C))
|
|
|
|
C=C+1
|
|
|
|
end
|
2017-09-04 20:43:26 +10:00
|
|
|
if component.type(computer.getBootAddress()) ~= "filesystem" then
|
2017-08-04 14:01:55 +10:00
|
|
|
fs.mount("boot",component.proxy(computer.tmpAddress()))
|
|
|
|
print(computer.tmpAddress():sub(1,8).." mounted as boot")
|
2017-09-04 20:43:26 +10:00
|
|
|
end
|
|
|
|
if component.type(computer.getBootAddress()) == "tape_drive" then
|
2017-08-04 14:01:55 +10:00
|
|
|
if tape then
|
|
|
|
tape.rewind()
|
|
|
|
local pt = tape.records()
|
|
|
|
for k,v in ipairs(pt) do
|
|
|
|
if v[1] == "D" then
|
|
|
|
print(tostring(k).."\t"..v[1].."\t/boot/"..tape.rrecord(k))
|
|
|
|
fs.mkdir("/boot/"..tape.rrecord(k))
|
|
|
|
elseif v[1] == "f" then
|
|
|
|
local fn,fc = tape.parsefile(tape.rrecord(k))
|
|
|
|
print(tostring(k).."\t"..v[1].."\t/boot/"..fn)
|
|
|
|
local f=io.open("/boot/"..fn,"wb")
|
|
|
|
f:write(fc)
|
|
|
|
f:close()
|
|
|
|
end
|
|
|
|
computer.beep()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2017-08-01 15:45:57 +10:00
|
|
|
end
|