site  contact  subhomenews

Chroot into easy.sfs inside initrd

February 27, 2019 — BarryK

Another little progress report. I posted yesterday about simplification of the 'BOOT_SPECS' file in the initrd:

I also posted about removing some large utilities from the initrd, and the problem of supporting international character sets at the Linux kernel console:

I mentioned 'fbterm', a terminal emulator that works on the Linux framebuffer, but also considered GUI toolkits that will run on the framebuffer, in particular Agar:

Now for the latest news...

The file 'easy.sfs' is the entire EasyOS in a single file, and it can be mounted as a aufs layered filesystem and chrooted-into while still inside the initrd.

What this means, is that we can run utilities that are in easy.sfs. I had taken out the statically-compiled 'resize2fs' and 'e2fsck' from the initrd -- they were big, about 500KB each. Today, I got them working by chrooting onto the 'easy.sfs' layer.

This means that resizing of the working-partition to fill empty space in a USB-stick works, and whenever a filesystem check is required, that works. Without the overhead of that 1MB in the initrd.

More exciting, is the possibility of running a "proper" GUI in the initrd. This is where Agar comes in. File 'easy.sfs' now has the Agar libraries and SDL libraries compiled to run on the framebuffer. By chrooting onto easy.sfs, an Agar binary can be executed.

I already have 'agartest', and tried that. Yes, it works, with a proper graphics-mode mouse pointer, and keyboard input works, TTF fonts display nicely.

The plan is to write an Agar program for selecting keyboard layout and password entry. Should be straightforward, except for one "small detail" -- at this stage I haven't got a clue how to write Agar applications. 

Tags: easy