Advertisement
shadowkat1010

bootloader

Apr 5th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. local proxy = ...
  2. local filesystem = require "filesystem"
  3. local component = require "component"
  4. local term = require "term"
  5.  
  6. local maxResX,maxResY = component.gpu.maxResolution()
  7.  
  8. if maxResX >= 80 and maxResY >= 25 then
  9.  component.gpu.setResolution(80,25)
  10. end
  11.  
  12. term.clear()
  13.  
  14. print("SKS-BOOT\a")
  15. for k,v in component.list() do
  16.  if v == "filesystem" then
  17.   if filesystem.proxy(k).getLabel() ~= nil then
  18.    print(k,filesystem.proxy(k).getLabel())
  19.   else
  20.    print(k)
  21.   end
  22.  end
  23. end
  24. print("\nBoot device:")
  25. local rPartPath = io.read()
  26. local partPath = rPartPath:sub(1,rPartPath:len()-1)
  27.  
  28. filesystem.umount("/")
  29. filesystem.mount(component.proxy(component.get(partPath)),"/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement