site  contact  subhomenews

Minibase, super-tiny static system

February 04, 2019 — BarryK

Thanks to sc0ttman on the Puppy Forum who discovered this, see post:

Here is the Minibase project page:

I compiled like this:

# ./configure
# make
# make install

...and it compiled in, well, it seemed like a few seconds!

Installation is into folder 'out'. The utilities are statically-linked ...and wow, they are small!

Minibase is a complete Linux system, and can be used with Buildroot to compile an X desktop. I downloaded a ready-made image from here:

...file 'sys-1-plain.tar.xz' is only 17.7MB, what kind of desktop can that possibly be?

I expanded 'sys-1-plain.tar.gz' and inside is 'whole.img' which I wrote to a USB stick. It actually booted to a desktop, on my HP midi-tower PC, and I couldn't believe how fast -- under 5 seconds.

Nothing much on the desktop, just Fluxbox and urxvt. But hey, this is brilliant.

Xorg, fluxbox, urxvt etc., were compiled in Buildroot, using musl, and it should be possible to add more apps, such as a browser.

I have a particular fascination for minimalist systems like this. Also, I am interested in some of the utilities, for possible use in Easy. 

Tags: linux

Super Grub2 CD not so super

December 01, 2018 — BarryK

This looks interesting, detects the operating systems installed on a PC, creates a boot menu:

Downloaded version 2.02s10 hybrid iso, tried it on my "new" Compaq Presario...

Initial menu, chose "Detect and show boot methods" blank screen, had to reboot.

Initial menu, chose "Enable all native disk drivers *experimental*"
...came back to initial menu, keyboard dead, had to press power button to reboot.

Initial menu, chose "Boot manually...", then "Operating systems" blank screen, had to reboot.


Tags: linux

fbwhiptail, whiptail for the framebuffer

September 26, 2018 — BarryK

I have posted recently about tools to create GUIs that run on the Linux framebuffer:

Today, I was reading the latest blog post at the Purism site (the guys who are developing the Librem 5 phone):

Where they mentioned "fbwhiptail", which is whiptail modified to run on the Linux framebuffer. Whiptail is like 'dialog', a tool to popup GUI windows from shell scripts. They both create "text mode" GUIs, dialog uses 'ncurses' and whiptail uses 'newt'.

Interesting, fbwhiptail compiles to 'fbwhiptail' and 'gtkwhiptail', so will also work with cairo and gtk. Here is the project page:

The same developer also has it on github:

I have tested it... there is a lot of functionality missing, compared with whiptail.  Most of the dialogs are not yet implemented. I tested a simple "--msgbox" and "--yesno". There does not seem to be any automatic text wrap, the <height> and <width> parameters seem to do nothing, text-input only, my mouse did not work. There seems to be a fixed theme.

Conclusion: in it's current state, it probably suits their simple need, however, for me LittlevGL is way ahead -- just need to solve the non-functional evdev keyboard input.

EDIT 20180927:
Oh wow! I posted an "issue" to the fbwhiptail github page, and the developer, Youness, posted a very detailed reply:

...yes, I see that fbwhiptail is tailored to their particular need. The extra info is good too, for anyone who might like to use it.

Tags: linux

Low-level container how-tos

September 25, 2018 — BarryK

I have accumulated some links with information about containers at a low-level. Some are very grass-roots, DIY, tutorials, some are simple implementations. These are in no particular order:

The above are NOT about using Docker, LXC, LXD, or any of the mainstream container implementations! Also, I stayed away from implementions in languages other than C or shell script -- there are some sites with low-level code in Go for example.

Tags: linux

Linux containers in 580 lines of C

September 23, 2018 — BarryK

'contained' is an executable written in C, for chrooting into a filesystem, with maximum security: the author states, it did grow a bit beyond 500 lines! Here is the C code:

Using the 4.14.71 kernel, with cgroups support now enabled, I got 'contained' to work. Was able to "chroot" into a rootfs, and it is very locked down. Too locked down to actually do anything useful.

However, it is very educational to study. It has given me an introduction how cgroups can be used, and the intention is to apply cgroups to EasyContainers.

Tags: linux

Goodbye uClibc-ng

September 09, 2018 — BarryK

I have used uClibc over the years, to created small static executables. It is a competitor to musl, dietlibc and newlib. The offical uClibc project died, and got forked as uClibc-ng. At that time, just about everybody moved to musl -- Landley dropped it from Aboriginal Linux, OpenEmbeded/Yocto dropped it -- Buildroot continue to offer a choice of glibc, uClibc or musl, ditto OpenADK.

I have a fork of Landley Aboriginal, the last that supports uClibc:

Over the last few days, I have been playing with creating a native toolchain based on uClibc-ng. I was checking out various projects, and discovered 'pts-tcc', part of which has a utility that is a wrapper around gcc, enabling to compile with uClibc library, rather then glibc. This works like the 'diet' utility in dietlibc, that is, 'diet' is a wrapper for gcc, to link with the diet libraries.

I used uClibc-ng version 1.0.30, the latest. I posted to the 'pts-tcc' project about a problem:

However, the wrapper utility 'i386-uclibc-gcc' works. I even compiled it for aarch64. Using it, I compiled a static "Hello World", which after stripping was 262KB. Similar size for aarch64. Oh dear, it should be down under 20KB -- that is the main reason for using this library, to create small static executables. So, posted a report:

...oh dear, another person reporting 107K and going up, this is not good!

I might try the most recent version from the original uClibc project, for comparison.

Yes, tested with the original uClibc, plus some patches, got a stripped hello world 254KB. Hmmm, investigated the .config file, found the main reason for the bloat, posted here:

Now down to 86K, still big but a huge improvement. Will study the .config file some more. And will go back to uclibc-ng, test that.

Tags: linux

Alpine aarch64 chrootable rootfs

August 31, 2018 — BarryK

I posted awhile back how easy it is to create an Alpine musl-based chrootable filesystem folder:

At the time, I created i686, x86_64 and armv7 root-filesystems.

Now that I am embracing aarch64, want a rootfs for compiling static executables. Hence:

After expansion of the tarball, instructions are inside. You will of course need to be running a aarch64 host OS, in my case on the new Rock64 board.

I compiled squashfs-tools 4.3, and it needs a patch for musl:

For good measure, I also applied all the patches from Debian. My rootfs does not have zlib-dev, so had to install that:

# apk add zlib-dev

...the rootfs has the Alpine apk package manager in it.

Tags: linux