site  contact  subhomenews

Complete separation between boot-manager and EasyOS

June 22, 2022 — BarryK

I already posted thoughts about this a couple of days ago:

https://bkhome.org/news/202206/limine-bootloader-for-easyos.html

The separation means that it looks exactly like a frugal install in the image file. This makes it conceptually very simple for someone to see how to do a frugal install into an internal drive.

EasyOS no longer knows anything about the boot manager or bootloader that caused it to boot. The boot-partition variables BOOT_UUID, BOOT_DEV and BOOT_DIR are no longer in EasyOS. All that Easy knows about is where it is installed, in the working-partition, variables WKG_UUID, WKG_DEV and WKG_DIR.

I built Easy with this new separation, and using Limine bootloader. The image file now has this layout:

1MiB
gap
7MiB
fat12
816MiB ext4

The fat12 partition is much bigger than it needs to be, but I wanted the ext4 partition to start on a 8MiB boundary -- this is supposed to be a good thing for flash drives. It has the "boot" and "esp" flags set.

The Limine installation is incredibly simple, just three files:

img1

img2

File 'limine.sys' is for legacy-BIOS booting, 'BOOTX64.EFI' is for UEFI booting. This is the content of 'limine.cfg':

QUIET=yes
TIMEOUT=0
GRAPHICS=no
DEFAULT_ENTRY=1
EDITOR_ENABLED=no
INTERFACE_BRANDING=Limine EasyOS Boot Manager

:EasyOS dunfell
COMMENT=EasyOS Dunfell bootup
PROTOCOL=linux
TEXTMODE=yes
KERNEL_PATH=boot://2/easyos/vmlinuz
MODULE_PATH=boot://2/easyos/initrd
KERNEL_CMDLINE=initrd=initrd rw wkg_uuid=9e8b372c-f1f6-11ec-b056-287fcfeb4376 wkg_dir=easyos/

The variable "TIMEOUT=0" means to wait zero seconds, so the menu won't display. This is because I don't want to offer choices here. Instead, I am planning to offer boot choices in the initrd.

Notice also the "wkg_uuid" and "wkg_dir" parameters. I am planning to remove 'BOOT_SPECS' file from the initrd, and only require these two kernel parameters.

This could be any boot manager, rEFInd, GRUB1, GRUB2, whatever. It will just need an entry like this, informing where to find 'vmlinuz' and 'initrd', and pass those two kernel parameters.

The installation of EasyOS, that we describe as a "frugal" install -- Puppy Linux parlance -- can be in any Linux partition, preferably ext4, in any folder or sub-folder. It has been a secret, but a save-file in an ntfs partition is also supported.

For the image file, I chose the folder name "easyos". In a frugal install to internal drive, you might want to name it differently, say "dunfell" for the Dunfell-series. Or in a sub-folder, "easyos/dunfell". In the image file, here is the ext4 partition:

img3

img4

After booting from a flash-stick, the working-partition gets populated with some folders, and 'easy.sfs' has been moved into the 'sfs' folder:

img5

Note: in the case of the image file written to flash-stick, the ext4 partition gets expanded to fill the drive. This expansion is restricted, and won't happen in a frugal install to internal drive. The initrd detects the special case of this being first bootup of the image, with ext4 being 816MiB and starting at a specific offset from the start of the drive (8MiB) -- if and only if those requirements are met, and free space is detected beyond the ext4 partition, then it expands to fill that space.

When the time comes to do a version update, manually, you just drag-and-drop the new 'vmlinuz', 'initrd' and 'easy.sfs' into the "easyos" folder, and reboot. That's it, no need to open up 'initrd' anymore.

A lot of simplification has happened here, it really is nice.

A note about this latest Dunfell build: took out LibreOffice, replaced with FreeOffice. I managed to create a FreeOffice PET only 56MB (gzipped), a tiny fraction of the size of LibreOffice. Brought back Gimp.   

Tags: easy