site  contact  subhomenews

Xorg GUI running in initrd

March 04, 2019 — BarryK

I have recently been investigating various ways of running a GUI within the initrd, such as Agar, see this post:

In the Puppy Forum yesterday, we were discussing the possibility of running an actual X server within the initrd, and I thought maybe a "tinyx" server might be OK. See discussion here:

But then it got me wondering... easy.sfs has the full Xorg, and we do have the 'fbdev' and 'xvesa' Xorg drivers. To get it to work in the initrd requires thinking back to the "old school" way of configuring Xorg. I wrote a special 'xorg.conf' that does not use evdev, instead the old 'keyboard' and 'mouse' Xorg drivers. The kernel needs to be configured with the deprecated /dev/psaux, which it is.

And yep, it works. So, I wrote a couple of little GUIs in shell script using gtkdialog, for keyboard/locale and for password entry.

Xorg loads quite fast, within a second. The keyboard/locale GUI takes a couple more seconds, as it does a fair bit of processing, but the password GUI pops up almost instantly. I will probably do some more work on the appearance of these GUIs, but here are first-go snapshots.

At first bootup, locale/keyboard are asked for:


Then the password. As first-time, it displays as-is, so you can see that you got it right:


On subsequent bootups, you will only get a password-entry GUI, as it will have remembered the locale/keyboard selection:


As a precaution, if X fails to start, there is a fallback to the previous text-mode interface.

The main thing that concerns me is whether this will be too slow on older computers. I will test on my Mele mini-PC and Compaq Presario.

Well, even if I decide not to go down this route, it is an interesting exercise. 

Tags: easy