←  Programs

ComputerCraft | Programmable Computers for Minecraft

»

LuaGRUB2 - An OS Bootloader for CC - Versi...

Mr. Bateman's Photo Mr. Bateman 23 Jun 2014

LuaGRUB2 v3.3

Screenshots

Spoiler


Created with the blessing of skwerlman with his original project of LuaGRUB (a GRand Unified Bootloader), which I have massacred carved into a finished masterpiece.

This program is a bootloader, which allows you to run multiple operating systems at once. The twist is that it's currently 100% compatible with all current OSes (They even run in a sandbox!). No need for any relative path voodoo. (Well, they should work, unless they do something I haven't predicted.)

New: You can now disable HTTP and Rednet, if you need to sandbox an OS. You can change these settings in the BIOS SETUP.

How to install an OS with LuaGRUB2

Use the "Install an OS via Pastebin" option for the easiest way to to do this. If you're feeling adventurous, manually copy the entire contents of the OS over to a folder you created inside the "/os" folder.

Note to OS devs: If you would like to integrate your OS with LuaGRUB2, but have no idea how to do it, don't be afraid to ask me because I would be glad to help.

How to install LuaGRUB2

If you have already installed an OS, backup or rename the file at "/startup". I cannot stress this enough. LuaGRUB2 requires this file to be able to let you select an OS, so when LuaGRUB2 installs, it will overwrite this file, possibly locking you out of using that operating system for good, requiring you to re-install it.
I'll also (re)address this issue in a later update.

Use this to run the installer (Desktop and Pocket):
pastebin run N3917AaN

Note for people updating from v1.x to v2.x: Run the installer again. The inbuilt updater has lost backwards compatibility to 1.x, so it won't do anything.

Certified OSes
All OSes and installers should be compatible now (Assuming you're using the inbuilt install option), but there's always the chance that it might not. Please report any that don't work.

Credits:
Spoiler
Github: https://github.com/R...r64bit/LuaGRUB2

One final note: I am not liable for anything this program does, such as delete files, set your house on fire etc.

Please, post any suggestions, bug reports or comments!
Edited by Mr. Bateman, 10 November 2014 - 12:52 AM.
Quote

AssossaGPB's Photo AssossaGPB 23 Jun 2014

Nice, I love it! The only feature that would be nice (but impossible as far as I know) is making booting to a disk optional.
I personally don't use oses because they seem restrictive and useless.
Quote

Mr. Bateman's Photo Mr. Bateman 24 Jun 2014

View PostAssossaGPB, on 23 June 2014 - 10:52 PM, said:

Nice, I love it! The only feature that would be nice (but impossible as far as I know) is making booting to a disk optional.
I personally don't use oses because they seem restrictive and useless.
Done, just make sure that instead of putting their script at "/startup" on the disk, rename it to "/grubstartup".
I've also included an update feature in version 1.2.
Quote

AssossaGPB's Photo AssossaGPB 24 Jun 2014

View PostROFLCopter64bit, on 24 June 2014 - 01:26 AM, said:

View PostAssossaGPB, on 23 June 2014 - 10:52 PM, said:

Nice, I love it! The only feature that would be nice (but impossible as far as I know) is making booting to a disk optional.
I personally don't use oses because they seem restrictive and useless.
Done, just make sure that instead of putting their script at "/startup" on the disk, rename it to "/grubstartup".
I've also included an update feature in version 1.2.
Good job! Very cool!
Quote

Mr. Bateman's Photo Mr. Bateman 24 Jun 2014

1.3 now has a compatibility fix for all operating systems and their respective installers. Just use the new option to install an OS, and it should work completely.

But this update breaks the previous updater; to fix, just run the update option twice. It's that simple.
Quote

oeed's Photo oeed 24 Jun 2014

This looks pretty nice. Also nice to see someone using my drawing API :D

One question, many OSs have a /System folder, what happens if I install, for example, OneOS and say this one: https://github.com/FlareHAX0R/deltaOS
Quote

Mr. Bateman's Photo Mr. Bateman 24 Jun 2014

View Postoeed, on 24 June 2014 - 07:58 AM, said:

This looks pretty nice. Also nice to see someone using my drawing API :D

One question, many OSs have a /System folder, what happens if I install, for example, OneOS and say this one: https://github.com/FlareHAX0R/deltaOS

Right now, that would be the biggest issue, as it would clash, but there's a fix in the works. (The first priority of this program was to make each individual operating system compatible, and multiple would be the second priority) I would just have to use the same patching system I made for the OS installation, but trick the operating system that / is the same as /os/OneOS/.
Speaking of which, that would break backwards compatibility, but it won't break or delete much anyway.

I won't put it as first priority for the next update, but it will be patched soon. :)
Quote

Mr. Bateman's Photo Mr. Bateman 24 Jun 2014

Version 2 is well on the way, as I've changed the way things operate. Instead of going straight to the boot menu, it will now default to the BIOS screen, where it will load the default OS with a specified delay which is set in the SETUP screen.This is almost finished, I just need to finish the sandboxing for each OS.

Posted Image
Posted Image
Quote

Mr. Bateman's Photo Mr. Bateman 25 Jun 2014

LuaGRUB2 v2.0 alpha has been released!
Now, instead of going straight to the bulky bootmenu, it will go to a bootscreen which after a specified delay it will automatically boot a specified OS, which is all configurable in the now-implemented BIOS setup screen!

View Postoeed, on 24 June 2014 - 07:58 AM, said:

One question, many OSs have a /System folder, what happens if I install, for example, OneOS and say this one: https://github.com/FlareHAX0R/deltaOS
Sandboxing is now implemented, but some pesky files escape to the real root folder. I've only documented one so far, and it's the '/desktop/.desktop.settings' file (That's what I remember off the top of my head), but everything else behaves nicely. Fixing this is for another update.
Quote

skwerlman's Photo skwerlman 27 Jun 2014

This is much better than anything I had planned originally. Great to see my idea in a finished state! Keep up the good work!

EDIT: And now that I've looked through the a2 code, I wonder exactly how I even got mine to run... It's just so much cleaner now! Great work!
Edited by skwerlman, 27 June 2014 - 12:43 AM.
Quote

Mr. Bateman's Photo Mr. Bateman 27 Jun 2014

View Postskwerlman, on 27 June 2014 - 12:26 AM, said:

This is much better than anything I had planned originally. Great to see my idea in a finished state! Keep up the good work!

I'm not really sure this is a finished state, since i'm sure it can have more features crammed in somewhere (Not to mention some minor bugs). Is there any other features that you would like to see?
Quote

Mr. Bateman's Photo Mr. Bateman 27 Jun 2014

Version 2.0 is now released (this time the full version) with enough bugs fixed that I feel comfortable calling it stable.
Quote

skwerlman's Photo skwerlman 28 Jun 2014

View PostROFLCopter64bit, on 27 June 2014 - 05:25 AM, said:

I'm not really sure this is a finished state, since i'm sure it can have more features crammed in somewhere (Not to mention some minor bugs). Is there any other features that you would like to see?
Perhaps some way to detect and move any OSs already installed on the machine, instead of simply overwriting them... (though that'd be kinda tedious, since each OS is different. Maybe just add a warning and continue prompt if /startup exists to the installer)
Also, maybe add support for downloading OSs from github (i.e. if you want to install a dev version of OneOS)? (The pastebin installer idea is really cool! Wish I'd thought of it, lol)
Quote

alexbuzzbee's Photo alexbuzzbee 04 Aug 2014

Does /disk mount correctly inside the sandbox?
Quote

theeboris's Photo theeboris 04 Aug 2014

You could add a option that overrides the rednet and modem or http api to enable or disable them.
Quote

Mr. Bateman's Photo Mr. Bateman 05 Aug 2014

View Postalexbuzzbee, on 04 August 2014 - 06:54 PM, said:

Does /disk mount correctly inside the sandbox?
I haven't had the chance to properly check it, so I will once I have the chance since one of the updates most likely broke it.

View Posttheeboris, on 04 August 2014 - 09:43 PM, said:

You could add a option that overrides the rednet and modem or http api to enable or disable them.
Seems neat, but I don't really see the use in that. I'll do it anyway, sounds like fun.
Quote

Mc Fow1er's Photo Mc Fow1er 12 Aug 2014

Would you be as kind as to make the OS boot chooser work on pockets? As I use my pocket as my computer when I'm not at the physical terminal.
Quote

!!!!!!!!!!ExclaimationMark's Photo !!!!!!!!!!ExclaimationMark 13 Aug 2014

Quick question: HOW ON EARTH DID YOU SANDBOX?
Quote

theeboris's Photo theeboris 13 Aug 2014

View Post!!!!!!!!!!ExclaimationMark, on 13 August 2014 - 04:09 AM, said:

Quick question: HOW ON EARTH DID YOU SANDBOX?

http://lua-users.org/wiki/SandBoxes

On this site is a nice explanation about sandbox in lua ;)
Look it it! :D
it's interesting ;)
Quote

Mr. Bateman's Photo Mr. Bateman 14 Aug 2014

Thanks guys for all the input, I've updated the program and the OP to include what you've wanted. You can sandbox OSes from HTTP and Rednet now by changing this in the BIOS SETUP (Press 's' when the boot screen displays), and a skeleton version called PocketGRUB is available. More requests for features are more than welcome.

View Post!!!!!!!!!!ExclaimationMark, on 13 August 2014 - 04:09 AM, said:

Quick question: HOW ON EARTH DID YOU SANDBOX?
I have overridden the fs functions with my own that prevent accessing anything outside it's own folder. The only other sandbox is HTTP and Rednet, but that is user-changeable.
Quote