Posted 19 June 2015 - 08:07 AM
First of all, I don't want any comments saying "This isn't a bootloader, etc, etc"
This is just a *simple* concept of a boot loader, and it would allow people to add their own OS's to it, etc.
How to install:
You don't have to save it and this is the only file, the program is packed in there. Just run it, it reboots and it is installed.
"When I rebooted it just shows the normal CraftOS"
– As expected, by default just CraftOS is the only OS. Scroll down to learn how to add an OS
How to add an OS
1) Open the file: /boot/ibl/ibl.cfg
2) Add:
It should look something like:
How to add an OS if you are an OS:
Then when you reboot the second time, it will show all the available OS's to boot from [type the number 1/2/3, etc] to load into it
Errors / Comments / Suggestions?
Post them below, would love to add on to it.
FAQ:
"File no found when I load an OS"
– It can't find the specified file to load from, please make sure the file is there.
TODO:
- Add recovery mode, basically it will keep a count on how many times the OS crashed, or if the OS did crash and enters recovery mode which allows you to boot into craftos instead of auto booting.
- Rename arguments to flags and make them actually work
- Make default operational
This is just a *simple* concept of a boot loader, and it would allow people to add their own OS's to it, etc.
How to install:
pastebin run BYbC7pvkYou don't have to save it and this is the only file, the program is packed in there. Just run it, it reboots and it is installed.
"When I rebooted it just shows the normal CraftOS"
– As expected, by default just CraftOS is the only OS. Scroll down to learn how to add an OS
How to add an OS
1) Open the file: /boot/ibl/ibl.cfg
2) Add:
[ "OS NAME HERE" ] = {
[ "location" ] = "/myos",
},
It should look something like:
{
CraftOS = {
location = "exit",
},
default = 0,
[ "OS NAME HERE" ] = {
[ "location" ] = "/myos",
},
}
How to add an OS if you are an OS:
if fs.exists("/boot/ibl/ibl.cfg") then -- IBL is installed
local iblConfigR = fs.open("/boot/ibl/ibl.cfg", "r") -- open IBL configuration file
local iblConfig = textutils.unserialize(iblConfigR.readAll()) -- Put IBL configuration file in variable
iblConfigR.close() -- close the fs.open reader
iblConfig["OS NAME HERE"] = { -- replace OS NAME HERE with your OS or file you want to load
[ "location" ] = "/myos", -- replace /myos with the location of the file to run
} -- We need to end it, right?
local iblConfigW = fs.open("/boot/ibl/ibl.cfg", "w") -- prepare to write the IBL configuration file back by opening fs.open
iblConfigW.write(textutils.serialize(iblConfig)) -- serialize it to make it fancy for us HuMaNs
iblConfigW.close() -- close the IBL configuraton writer
end -- FIN
Then when you reboot the second time, it will show all the available OS's to boot from [type the number 1/2/3, etc] to load into it
Errors / Comments / Suggestions?
Post them below, would love to add on to it.
FAQ:
"File no found when I load an OS"
– It can't find the specified file to load from, please make sure the file is there.
TODO:
- Add recovery mode, basically it will keep a count on how many times the OS crashed, or if the OS did crash and enters recovery mode which allows you to boot into craftos instead of auto booting.
- Rename arguments to flags and make them actually work
- Make default operational
Edited on 19 June 2015 - 06:17 AM