Operating system for OpenComputers
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

20 řádky
642B

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