Developing A Game Engine with Perl : Part  4 - UEFI vs OpenSuSE Installer
Tags: perl, gamedev, linux, devjournal
Published: 2021-12-01 02:34:10

[I'm still learning](https://dev.to/ansigameengine/developing-a-game-engine-with-perl-part-2-mouse-input-43nj) so remember... **I DO NOT KNOW WHAT I AM DOING.**

If you want to start reading from the beginning. Check out the [first article in this series](https://dev.to/ansigameengine/developing-a-game-engine-with-perl-3b8)

Continuing on with the [last article](https://dev.to/ansigameengine/developing-a-game-engine-with-perl-part-3-hardware-failure-server-upgrade-on1) let's talk about old hardware with [UEFI](https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface). It can be difficult (for me) to know how to get [Linux OpenSuSE](https://www.opensuse.org/) installed properly.

- Mouse Input Support
- Hardware Failure
- Server Upgrade
- **UEFI vs OpenSuSE Installer**
- 32bit -> 64bit & Perl's Storable

## A small computer and almost destroying it...

The last server's hard drive died, and I happen to have this old, but better, computer. It was in pieces, sitting in a box for a long time. Putting it back together was not easy. This [Aspire X1470](https://www.acer.com/ac/en/US/content/support-product/3916?b=1&pn=DT.SLQAA.001) is a small form factor design, meaning there is no room to spare. Also meaning if your computer has been sitting around in a box, in pieces for a long time, and its' frame gets bent... well that means it's going to be very difficult to get it back together. I managed to rip off a chip heatsink in the process. I tell ya, my stomach turned right over... but luckily it went back on and seems to be holding and working fine.

## UEFI vs OpenSuSE Installer ##

This is where things get interesting. After finally getting the computer together, I downloaded the OpenSuSE ISO for 64bit. I went with [Tumbleweed](https://get.opensuse.org/tumbleweed) again. It worked well with the last server, so I'll just go with what I know. Tumbleweed is a [rolling release linux](https://en.wikipedia.org/wiki/Rolling_release), which means I shouldn't have to reinstall when a new version is released and I should still stay up to date. I created a [bootable USB from ISO in Ubuntu 20.04](https://askubuntu.com/questions/1335903/make-a-full-bootable-usb-stick-with-gnome-disk-utility) (My Desktop). Booted the new computer, installed OpenSuSE, and was happy... until I tried to reboot.

When I rebooted, I pulled out the USB stick and the BIOS said no boot drives. I knew of UEFI, and started reading. I found that in /boot/efi/ there was no EFI directory. If you don't know anything about UEFI (No worries, neither do I) ..apparently there is supposed to be a Fat32 partition marked as type EFI. The BIOS checks for this location and attempts to load the OS this way as apposed to using the [MBR](https://en.wikipedia.org/wiki/Master_boot_record) for booting like in the old days. 

Here is what it looks like now in the server using [fdisk](https://man7.org/linux/man-pages/man8/fdisk.8.html) to look at the partitions and [tree](https://linux.die.net/man/1/tree) to look at the directory structure:

```
localhost:/ # fdisk -l
Device          Start        End    Sectors  Size Type
/dev/sda1        2048    1050623    1048576  512M EFI System
/dev/sda2     1050624 2893709311 2892658688  1.3T Linux filesystem
/dev/sda3  2893709312 2930277134   36567823 17.4G Linux swap

localhost:/ # tree /boot/efi/
/boot/efi/
└── EFI
    ├── boot
    │   ├── MokManager.efi
    │   ├── bootx64.efi
    │   └── fallback.efi
    └── opensuse
        ├── MokManager.efi
        ├── boot.csv
        ├── grub.cfg
        ├── grub.efi
        ├── grubx64.efi
        └── shim.efi

```
You may need to scroll right to see the partition type EFI.

Well, this is what was **NOT** happening when I installed. I tried several different ways to get it to do an EFI install, but it kept doing it MBR style. The difficult thing is I didn't know what to ask google, and every time I had to try a new install method, it took about an hour to do the install, just to check and find out that it was wrong.

I knew that the installer wasn't loading in EFI mode and was running in legacy mode, but I didn't know how to switch it manually, and why it was choosing legacy in the first place. I checked the BIOS for booting options, and there just wasn't anything that would force it to boot from a HDD's MBR. I also didn't want to do a firmware update, I just wanted to code and get this install done.

Finally.... the answer was the BIOS just sucks. For some reason it prioritizes legacy mode on USB booting and I could only get it to chose an EFI boot from USB by manually loading it in the boot menu with F12. Allowing it to choose the USB for booting always resulted in legacy mode, regardless of the settings specified in the BIOS. Of course OpenSuSE's installer will not allow you to switch to EFI if you are in legacy mode. Also it does not make it obvious for the uninitiated to know that it is in legacy (MBR) mode. 

I managed to find an obscure article that said **`"If you see the options for pressing F keys at the bottom of the install screen, then it's legacy mode"`** That one little piece of information is all I needed to understand what was happening. I saw that every time I booted into the OpenSuSE installer there were F key options at the bottom. That's when I realized that the BIOS wasn't booting from the USB's EFI partition. After realizing this, I used a manual BIOS boot, picked the correct USB boot drive (of course the BIOS displays both EFI and Legacy USB boot drives with the same name) I got the correct install screen, the EFI boot options were all there. The install went really easy at this point and is up and running now for a few days with no issues.

Have you ever worked with small form factor computers? What sort of disaster stories, or success stories have you had? Also what about installing an OS with UEFI vs MBR, what sort of experiences have you had?

If you have any suggestions or comments please share constructively. Also please visit our social media pages for lots of fun videos and pictures showing the game engine in action. 

[ANSI Game Engine on Instagram](https://www.instagram.com/ANSIGameEngine/)
[ANSI Game Engine on Facebook](https://www.facebook.com/ANSIGameEngine)

[Prev << Part 3 - Hardware Failure & Server Upgrade](https://dev.to/ansigameengine/developing-a-game-engine-with-perl-part-3-hardware-failure-server-upgrade-on1)
[Next >> Part 5 - 32bit -> 64bit & Perl's Storable](https://dev.to/ansigameengine/developing-a-game-engine-with-perl-part-5-32bit-64bit-perls-storable-5l8)

Cheers!
Shawn