site  contact  subhomenews

Minibase, super-tiny static system

February 04, 2019 — BarryK

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

http://murga-linux.com/puppy/viewtopic.php?t=115255

Here is the Minibase project page:

https://github.com/arsv/minibase

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:

https://github.com/arsv/minibase-br/

...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:

https://www.supergrubdisk.org/super-grub2-disk/

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

Initial menu, chose "Detect and show boot methods"
...got 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"
...got blank screen, had to reboot.

Hmmm.  

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:

http://bkhome.org/news/201808/gui-creation-for-the-linux-framebuffer.html

http://bkhome.org/news/201808/considering-ugfx.html

http://bkhome.org/news/201808/littlevgl-evaluation-part-3.html

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

https://puri.sm/posts/the-librem-key-makes-tamper-detection-easy/

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:

https://source.puri.sm/coreboot/fbwhiptail/

The same developer also has it on github:

https://github.com/kakaroto/fbwhiptail

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:

https://github.com/kakaroto/fbwhiptail/issues/1

...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:

http://cesarvr.github.io/post/2018-05-22-create-containers/

https://blog.lizzie.io/linux-containers-in-500-loc.html

https://github.com/p8952/bocker

https://ericchiang.github.io/post/containers-from-scratch/

https://dev.to/napicellatwit/containers-from-scratch-in-18-lines-of-code-3pmn

https://www.brighttalk.com/webcast/15077/253233/containers-from-scratch

https://wvi.cz/diyC/

http://blog.z3bra.org/2016/03/hand-crafted-containers.html

https://github.com/arachsys/containers

http://doger.io/

https://github.com/ghedo/pflask

https://github.com/xemul/libct

https://github.com/subgraph/oz

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:

https://blog.lizzie.io/linux-containers-in-500-loc.html

...as the author states, it did grow a bit beyond 500 lines! Here is the C code:

https://blog.lizzie.io/linux-containers-in-500-loc/contained.c

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:

http://bkhome.org/news/201803/aboriginal-linux-120x-resuscitated.html

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:

https://github.com/pts/pts-tcc/issues/1

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:

https://github.com/pts/pts-tcc/issues/2

...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.

EDIT:
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:

https://github.com/pts/pts-tcc/issues/2

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:

http://bkhome.org/news/201704/alpine-x8664-chrootable-rootfs.html

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:

http://distro.ibiblio.org/quirky/alpine/aarch64/developer/

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:

http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch

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