Operating system for OpenComputers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
751B

  1. --#includepkglib "diskpart" "lib/diskpart.lua" "diskpart"
  2. --#includepkglib "rtfs" "lib/fs/rtfs/init.lua" "fs.rtfs"
  3. --#includepkglib "rtfs" "lib/fs/rtfs/v1.lua" "fs.rtfs.v1"
  4. do
  5. local a = computer.getBootAddress()
  6. if component.type(a) == "drive" or component.type(a) == "tape_drive" then
  7. local diskpart = require "diskpart"
  8. for k,v in ipairs(diskpart.getPartitions(a)) do
  9. if v[2] == "rtfs" and v[1] == computer.address():sub(1,8) .. "-boot" then
  10. syslog("Partition with suitable name detected, attempting to mount...")
  11. local rtfs = require "fs.rtfs"
  12. fs.makeDirectory("boot")
  13. local m = rtfs.mount(diskpart.proxyPartition(a,k))
  14. m.address = string.format("%s/%i/rtfs",a,k)
  15. fs.mount("boot",m)
  16. break
  17. end
  18. end
  19. end
  20. end