site  contact  subhomenews

Minimum Profit text editor compiled statically

July 31, 2020 — BarryK

I want a console editor in the initrd. Busybox does have a small vi-like editor, but I would like something a bit more user-friendly.

I have always like MP (Minimum Profit), which is in EasyOS, however, I have never compiled it statically, which is required for use in the initrd. Until today.

Firstly though, I compiled NE (Nice Editor) statically with musl. This has nice drop-down menus and syntax highlighting, like MP. Compiled normally with libc, it works fine, but with musl there is no syntax highlighting. it is simple to compile:

# make LIBS="-static -ltinfo" CC=gcc PREFIX=/usr

Here is the project page:

Here is the author's page for MP:

...however, EasyOS uses an older version, 3.3.17. There are reasons for staying with that old version, that I don't recall right now, but the downside is prior to the 5.x series, there is no support for utf-8.

NE compiled statically is 580KB and the syntax files are separate. MP is 430KB and requires no external files -- syntax handling is all internal.

I compiled MP with musl, in my port of OpenEmbedded. This has a github repo, but I haven't uploaded for ages. I need to post how I compiled MP in OE, but not now, it is now 1.30am.

I have put the 'mp' binary into the initrd, so it can be used if ever drop out to the console inside the initrd -- which is useful for debugging.

If you want to see MP in action, it is in the menu "Document --> MP console text editor". Running it without X, it will be full-screen, which looks nice. 

Tags: easy