Settings

Theme

A Grub theme in the style of Minecraft

github.com

395 points by sijmen 2 years ago · 75 comments

Reader

costco 2 years ago

Friendly reminder that grub-mkconfig generates unnecessarily complicated grub.cfg files and that they can be as simple as this (which allows me to boot custom kernel, default kernel with initrd, and Windows):

    default=0
    timeout=3

    menuentry 'Custom Kernel' {
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt6'
        echo    'Loading Linux 5.10.172zeus ...'
        linux   /boot/vmlinuz-5.10.172zeus ro quiet rootfstype=ext4 root=/dev/sda6
    }

    menuentry 'Devuan GNU/Linux, with Linux 5.10.0-21-amd64' {
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt6'
        echo    'Loading Linux 5.10.0-21-amd64 ...'
        linux   /boot/vmlinuz-5.10.0-21-amd64 root=UUID=a788be97-7ba6-4c15-ad6e-e91d38604c39 ro  quiet
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.10.0-21-amd64
    }

    menuentry 'Windows Boot Manager' {
        insmod part_gpt
        insmod fat
        set root='hd0,gpt1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  4828-3FFF
        else
          search --no-floppy --fs-uuid --set=root 4828-3FFF
        fi
        chainloader /efi/Microsoft/Boot/bootmgfw.efi
    }
  • mtlmtlmtlmtl 2 years ago

    Man I miss good old GRUB, which I guess is called GRUB legacy now? Most entries only required 4-5 lines of config and there was no ugly shell syntax, a million options, conditionals etc.

    Probably just because I grew up with it, but MBR and disk/boot management on Linux was so much simpler back then.

    512 bytes of partition table + bootloader(well, the bootstrapping part anyway). Partitions had one simple, 3 character name in /dev. No weird FAT32 partitions full of mysterious files, UEFI stuffed full of unnecessary features, but you can be damn sure a desktop or laptop board is gonna provide all the ones that make your life harder, and none of the actually useful ones.

    I'm sure there are lots of good technical reasons why everything needs a UUID now, and so on and so forth, but none of all this complexity solved any problem I actually had in the before times. It just added the problem of now having to read a buttload of documentation every time I even think about touching this stuff.

    At some point a few years back, I wanted to switch DNS servers on my laptop running some ubuntu derivative at the time. resolv.conf was still there, so I edited it. Nothing happened. Eventually I ended up finding like 4 different files in various places specifying DNS. And only one was the right one to change. Others might do nothing or actually break DNS.

    One of these days I'll probably throw up my hands, put my mobo in legacy mode, and install some bare bones, Systemd free distro. Maybe Crux Linux or Slackware if those even exist still.

    • versteegen 2 years ago

      I'm using Slackware-current with manually maintained [edit: actually, I wrote a python script to generate it, see other comment] grub.cfg (grub 2.06) on a MBR system, and happy I don't have GPT. Recently I tried to convert a Windows installation from MBR to GPT. What a disaster, never doing that again (but if you do need to, use gdisk [1]. It's great, I had unrelated issues). I suppose I'll eventually have to convert my Linux PC to GPT when replacing the motherboard. I haven't ever reinstalled Slackware (I just upgrade), since switching to it in 2007. Honestly there are issues with that.

      Slackware just celebrated its 30 year anniversary two days ago [2] and still going strong without systemd ;) Well actually it now has eudev, which is the small unintrusive part of systemd which a lot of software these days has as a dependency. Everything is still done with rc files. Best of both worlds.

      [1] http://www.rodsbooks.com/gdisk/mbr2gpt.html

      [2] https://www.patreon.com/posts/thirty-years-86196804 (There's nothing on the website or announce mailing list)

    • DropInIn 2 years ago

      At the risk of sounding silly, the move to systemd and the headaches encountered, such as you describe, are the very reason I left my brand new system which could work well for Linux, including the graphics card, as a single boot windows machine.

      It just wasn't worth the headache on top of having to keep windows for work (many programs don't have a Linux option nor do they work properly in wine etc, and vm isn't reasonable for gpu intensive operations like video editing).

      IMHO, systemd really messed up the ecosystem and the "Trust" value that Linux in general had built with me.

  • kelnos 2 years ago

    Aside from the complexity of the autogenerated configuration file, is there any benefit to maintaining it yourself? I recall when I used to have a Windows partition, the 'update-grub' script included with Debian would find all kernels (including custom ones) and other OSes as well.

    I'd much rather have to maintain nothing rather than something.

    • bravetraveler 2 years ago

      Ditto, I'm not really worried about the complexity of my GRUB config - just that it works. It tends to if I don't go poking/looking directly at it.

      Leaving them to manage the config has worked a-okay for me, even with a cmdline that would cause shudders in most. grubby has been a frustrating introduction

      If I were to invest any effort in my bootloader at all, it would be to get closer to the 'metal' through systemd-boot/efibootmgr

      TLDR: looking at the GRUB config invokes a "why am I still doing this" emotion, I'd rather not

    • versteegen 2 years ago

      Well I wish I didn't have to, but I ended up writing a small python script [1] to generate my grub.cfg boot entries (After 8 years I've forgotten many of the reasons for doing so). At least it's clearly inspectable and I can make customisations that won't be erased by regeneration. For example my root partition is a btrfs subvolume, but how does grub know which subvolume I want mounted as the root? The current one I assume, but what about my backup root on my HDD which isn't mounted? Or which alternative kernels in /boot?

      [1] https://gist.github.com/rversteegen/32bb0b2786ee1092762627f0...

    • rodgerd 2 years ago

      > I'd much rather have to maintain nothing rather than something.

      The pain point is that when you can't boot for some reason, grub2 is significantly harder to reason about and fix than classic grub, lilo, systemd-boot, and so on.

    • costco 2 years ago

      There's not really any benefit, I was just surprised that after deleting most of the lines it still worked.

jamesfmilne 2 years ago

On Rocky Linux 8, I had to change GRUB_TERMINAL_OUTPUT to "gfxterm", then it would pickup the GRUB_THEME value.

My kid uses Grub all the time to reboot into Windows to play Minecraft Bedrock Edition, this will boggle his mind.

  • dm319 2 years ago

    My kids use the Linux bedrock launcher (unofficial). It's often a bit behind the latest release, but it runs much smoother than on Windows IMO.

    https://github.com/minecraft-linux/appimage-builder/releases...

    • kQq9oHeAz6wLLS 2 years ago

      The only thing I don't like is your render distance is drastically limited. Under Linux I can only set it to 12 (I believe), whereas in Windows I can go all the way out to 51 if I so choose (which is useful when looking for end cities).

      • lacksconfidence 2 years ago

        Minecraft has made this a bit confusing, but there are two completely independent implementations of minecraft, the java edition and the bedrock edition. The poster above you was referring to the bedrock edition for linux.

        * The java edition has always had a fairly limited render distance, although recently they split render distance and simulation distance into separate options which allows for higher render distance than in the past. (There are also mods like bobby, but it wouldn't help you find end cities: https://www.curseforge.com/minecraft/mc-mods/bobby)

        * Bedrock edition, designed to be capable to run on mobiles, has the ability to run very high render distances on pc.

  • weberer 2 years ago

    >reboot into Windows to play Minecraft Bedrock Edition

    And thus the "Extinguish" step is complete.

    • ghqst 2 years ago

      There are launchers on Flathub and Lutris for playing Bedrock Edition on Linux, but at the end of the day it was originally called Minecraft Windows 10 Edition.

    • doublepg23 2 years ago

      Noted open source application…Minecraft?

mrrsm 2 years ago

I like the fact there are multiple splash tags even though "I use Arch BTW" is a great one.

j1elo 2 years ago

Naturally, the project couldn't miss having a "bug" report which asks to move the code to a different Git host.

https://github.com/Lxtharia/minegrub-theme/issues/18

I get the ideals are on point, but it doesn't look like the place to campaign about it.

Hopefully the author doesn't have any anxiety or issue about politely saying "The issue description doesn't look to me like a bug in my code." and closing it.

Cieric 2 years ago

Figured it was worth mentioning that this guy also has a doom theme. https://github.com/Lxtharia/doomgrub-theme

deutschepost 2 years ago

Maybe a bit off topic, but does anyone know about themes or GUIs for LUKS password entry? The command line version has pretty unintuitive behaviour for family members which are used to modern GUIs.

andrewstuart2 2 years ago

I misread this as "Microsoft Grub Theme" and was definitely interested in the irony. This is super fun, though, and impressive. I didn't know you could do all this in a grub theme.

the_gipsy 2 years ago

Now someone needs to write a renderer so that the world-background camera also spins around!

  • cyber_kinetist 2 years ago

    It would be a pretty fun project to write a CPU software rasterizer that works in UEFI… (Obviously GPUs are out of the question, but it might be possible to use multiple CPU cores)

    • circuit10 2 years ago

      Just scrolling a panorama along would probably look good enough

      I think the real game uses a cubemap so the camera is inside a cube with six textured faces which I guess should be easy enough to render if you wanted to do it properly

    • PlutoIsAPlanet 2 years ago

      systemd-ueficpuzd

      • bravetraveler 2 years ago

        .bootasset, can't forget the unit type :)

        I kid, I'm generally fond of systemd - but there's so much

  • XzAeRosho 2 years ago

    Is that even possible in Grub? Last time I checked there was a tool called "Burg" that would animate backgrounds like a gif, but otherwise it was very clunky and not a great experience.

MegaDeKay 2 years ago

This is really nice but I think I'll stick to this Fallout theme.

https://github.com/shvchk/fallout-grub-theme/tree/master

What is your favorite?

jessep 2 years ago

Ummmm ... what is grub? Didn't see any links to it from the three random grub2 repos I looked at.

  • i80and 2 years ago

    GRUB is a common bootloader for Linux systems: it gives you a menu of boot options when you turn on your machine, and boots whichever installed operating system you choose.

    So with this theme, that menu for choosing which OS to boot looks like the Minecraft menu!

marginalia_nu 2 years ago

I somehow read the title as a grub-themed minecraft and man was I ever confused.

nyanpasu64 2 years ago

I wonder if it would be possible to center the text in the buttons like actual Minecraft, or if Grub can only print left-aligned text.

lukeocodes 2 years ago

How do you know someone is ~vegan~ on ARCH? Don't worry, they'll tell you.

/s

654wak654 2 years ago

This is pretty cool! Already downloaded & installed it.

dirkc 2 years ago

It's been so long since I've battled grub configs that my first thought was that this is a minecraft theme making things look like food (grub).

coffeebeanHH 2 years ago

Looks awesome!

I'll go get that later for my machine

okibry 2 years ago

Super cool !

jaimehrubiks 2 years ago

Love it!

cwillu 2 years ago

The original title from the document less ambiguously describes the content: “A Grub Theme in the style of Minecraft!”

  • dang 2 years ago

    Ah yes - we eventually changed this. (Just saw your comment now.) Thanks!

hanniabu 2 years ago

I'll never understand projects like this that don't include screenshots

  • electroly 2 years ago

    This one does have a screenshot, though, in the usual spot in the readme.

    • mucle6 2 years ago

      As someone unfamiliar with grub, the screenshot leaves me with more questions than answers

      • _aaed 2 years ago

        GRUB is a bootloader. A bootloader takes care of getting the operating system started up. It is also responsible for allowing the user to select between multiple operating systems at boot.

  • KMnO4 2 years ago

    Are you sure you clicked on the right link? The screenshot is at the very top of the readme.

  • mrrsm 2 years ago

    The top of the README is a screenshot

  • ramilefu 2 years ago

    There is a screenshot in the README…

  • dom96 2 years ago

    It does include a screenshot though?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection