site  contact  subhomenews

Shutdown menu has lockdown and debug items

August 03, 2020 — BarryK

A couple of days ago, I posted about new kernel boot parameters to dropout to a shell in the initrd:

https://bkhome.org/news/202008/dropping-out-to-shell-in-initrd.html

And a few days before that, additions to the "Shutdown" menu. For rollback:

https://bkhome.org/news/202007/shutdown-menu-now-has-reboot-with-rollback.html

And for filesystem check:

https://bkhome.org/news/202007/shutdown-menu-now-has-reboot-with-filesystem-check.html

Yesterday and today, I really went to town on the "Shutdown" menu. Here is a snapshot:

img1

Choosing "Reboot, with lockdown in RAM" will bring up this GUI:

img2

Choosing "Reboot to initrd (developers only)" will bring up this GUI:

img3

...well, even if you are not a developer, you can check this out. It will be a once-only thing, and you will find yourself at a command shell inside the initrd, totally in RAM. You can then try out 'mp' and 'nnn'. After playing, type "exit" to continue bootup.

The great thing about these new choices in the "Shutdown" menu, is you no longer have to choose anything, or edit anything, in the boot manager (refind, syslinux or grub). Just make the choice in the "Shutdown" menu, then do a normal bootup.

A few technical details. For lockdown, "qfix=cap2" is deprecated, it is now "qfix=lock2". Also, "qfix=lock1" is for "Copy session to RAM & unmount all partitions". But, as I said, you don't have to mess around with those boot parameters anymore. 

So many great new features! I have to do some testing, expect the next release in a few days. It will be a pre-release of 2.4, as Debian Buster 10.5 is due out soon, and I will build EasyOS with the latest DEBs, and that will be version 2.4. 

Tags: easy

nnn file manager now in initrd

August 02, 2020 — BarryK

I posted yesterday about dropping out to the shell in the initrd, and the new 'mp' console editor:

https://bkhome.org/news/202008/dropping-out-to-shell-in-initrd.html

I have been testing lots of different console file managers, and have settled on 'nnn'. It varied from too crude, non-intuitive, up to too sophisticated and too many dependencies. The initrd is a minimal Linux environment, based on 'bash' and with only statically-linked binaries. Some console file managers expect utilities to be there that aren't, and some link in libraries that bloat the binary beyond what is required.

'nnn' forked from 'noice'. The latter is simple, and would do the job, except that color-highlighting didn't work when compiled with musl, and was unable to invoke external apps such as 'mp'. Probably could have been fixed, but 'nnn' works.

Here is the 'noice' project page:

https://git.2f30.org/noice/

And for 'nnn':

https://github.com/jarun/nnn

Both projects are active, 'nnn' very much so. Photo from the 'nnn' project page:

img1

...at this stage, I have no idea how to use those tabs, nor how to get the dual-pane. This review shows UI snapshots that look like what I am getting:

https://www.ghacks.net/2019/11/01/nnn-is-an-excellent-command-line-based-file-manager-for-linux-macos-and-bsds/

...ah, I see, "?" brings up a list of keyboard actions. Here is a review on YouTube:

https://www.youtube.com/watch?v=KuJHo-aO_FA

...the 'nnn' in the review has all the configure options enabled, like mouse support.  Here are other console file managers that I considered:

https://lecram.github.io/p/rover/
https://github.com/dylanaraps/fff
https://midnight-commander.org/
https://github.com/mananapr/cfiles
https://vifm.info/
https://github.com/FedeDP/ncursesFM
https://www.han.de/~werner/ytree.html
http://www.clex.sk/
https://github.com/mariostg/nffm

'nnn' is now in the initrd, in /bin. There is also /sbin/xdg-open and /etc/nnn/plugins, configured to launch 'mp' for any text file. Threw in /nnn.txt help file, as the app is keyboard-driven, without any keyboard help within the app. However, it is pretty intuitive, navigate with the arrow keys, "q" to quit, "]" for a commandline. There are reminders about those keys when dropout from the 'init' script.

The 'nnn' binary is 437KB. The only libs it linked to were libncursesw and libtinfo. There were some optional, such as libreadline, that I left out. And some other configure options I disabled, not knowing what they do. 

Here are the latest recipes for OpenEmbedded:

http://distro.ibiblio.org/easyos/project/oe/ 

Tags: easy

Dropping out to shell in initrd

August 01, 2020 — BarryK

The bootup sequence is first the kernel 'vmlinuz', then the 'initrd', then layered SFS filesystem with 'easy.sfs' and a switch_root onto the desktop.

The 'initrd' is a file containing a complete tiny Linux OS. It is a file that is loaded into RAM and then the 'init' script inside the 'initrd' is run. This 'init' script does lots of setting up, including put together the layered SFS filesystem and performs the switch_root onto it.

If the 'init' script encounters an error and is unable to continue, it will drop out to a shell in the initrd. That is, you will have a commandline prompt and can do basic CLI operations. For example type "ls" to list files. Users would hold down the power button at this stage, to turn off the PC, however, developers can poke around and try to find out what has caused the problem.

What we have now, to aid developers, is a really great console GUI text editor, as reported:

https://bkhome.org/news/202008/minimum-profit-3317-now-has-utf-8-support.html

Just type "mp <filename>" and there is a beautiful screen with pull-down menus and syntax highlighting.

I have added another feature, kernel boot parameter "qfix=dropout[0-6]", which will cause a deliberate drop out of 'init', at various points. For example, 'init' has this at line 519:

[ "$DROPOUT" == "0" ] && exit_to_initrd " Exited from init script early, nothing yet mounted."

Where $DROPOUT variable has the number extracted from that "qfix=dropout[0-6]". That line will cause a dropout to a console in initrd, and it will print the line number in the script where it exited, and the message as shown above.

You can then poke around, try out that nice 'mp'. Typing "exit" will exit from the console, back into the 'init' script, and bootup will continue.

What would be nice is a simple console file manager in the initrd.

Thinking also, might make this another option in the "Shutdown" menu. 

Tags: easy

Minimum Profit 3.3.17 now has UTF-8 support

August 01, 2020 — BarryK

I wrote about MP version 5.x required for UTF-8 support:

https://bkhome.org/news/202007/minimum-profit-text-editor-compiled-statically.html

But I found that linking with "-lncursesw" instead of "-lncurses" fixed it, and UTF-8 characters display. Is it that simple? Surely there must be more to it, to support UTF-8? There is no mention in the 3.3.17 source anywhere about this.

I very much prefer 3.3.17 over the 5.x series, so this is good. I have compiled it statically with musl, for x86_64, i686 and aarch64, in my fork of OpenEmbedded, oe-qky-src. I have uploaded the recipe here:

http://distro.ibiblio.org/easyos/project/oe/mped-static.tar.gz

Note, I did attempt to compile 5.1.14 in OE, but got strange errors. It is so much more complicated, with not much gain in functionality -- I mean relevant functionality, as an easy-to-use (drop-down menus), syntax highlighting, simple file viewer and editor for use in the initrd. I don't need the mpsl scripting language that is in 5.x. 

Tags: easy

Collection of old MP sources

July 31, 2020 — BarryK

I posted about compiling MP (Minimum Profit) console text editor version 3.3.17 statically with musl:

https://bkhome.org/news/202007/minimum-profit-text-editor-compiled-statically.html

I also mentioned that the 5.x series is required for uft8 support. We really do need this. Gone are the days when source code, shell scripts and config files were just ascii characters.

The latest version is 5.41, however I got a compile error. The author of MP does not retain the sources of earlier versions. He erases them all except for the latest, so finding older versions requires a hunt on the Internet, where people might have archived the source.

Version 5.36 is archived by James (jamesbond in the Puppy Forum), in the FatDog source repository on ibiblio.org. That version compiles.

What I found over the years with MP is that different versions behave differently. A later version might actually be broken in some way that an earlier version isn't. Then there are different features -- generally, the older the version, the less features, but simpler operation and smaller binary.

Anyway, these are the sources I found:

mped_3.1.8.orig.tar.gz
mped_3.1.11.orig.tar.gz
mped_3.3.17.orig.tar.gz
mped_5.1.2.orig.tar.gz
mp-3.2.13.tar.bz2
mp-3.3.17.tar.gz
mp-5.1.3.tar.gz
mp-5.1.4.tar.gz
mp-5.2.10.tar.gz
mp-5.2.13.tar.gz
mp-5.36.tar.gz

'mped' is the name that Debian gave to the MP package. It was in the Debian repository a long time ago.

I am particularly interested in the 5.1 series, as it has just enough features that I want and a very small binary. It is a contender for being compiled statically.

I found version 5.1.3 readily enough, but did see some documentation that there was a 5.1.4, but couldn't find it. Finally tracked it down. They are all uploaded here:

http://distro.ibiblio.org/easyos/source/alphabetical/m/ 

Tags: easy

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:

http://ne.di.unimi.it/

Here is the author's page for MP:

https://triptico.com/software/mp.html

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

Test update from 2.3 to 2.3.5

July 30, 2020 — BarryK

I posted yesterday about the new automated version updating:

https://bkhome.org/news/202007/automated-and-efficient-updating-of-easyos.html

The new script is /usr/local/easy_version/easy-update, launched in a terminal window via wrapper script /usr/sbin/easy-update. I fixed a couple of bugs in it, and this morning tested updating EasyOS from version 2.3 to 2.3.5.

I have version 2.3 installed on my baby laptop, and I copied the easy-update script into it, Yesterday I had already uploaded 'easy-2.3.5-amd64.img.gz' to ibiblio, compressed with that "--rsyncable" option.

Actually, there is an elephant in the room, which is 'easy.sfs' -- this is compressed with xz, and is inside the easy*.img.gz file. So I didn't really know what improvement using that "--rsyncable" option would have. Let's find out...

img1

Pressed ENTER, to reconstruct 'easy-2.3-amd64.img.gz'...

img2

Now it is downloading 'easy-2.3.5-amd64.img.gz'. The file is 544MB, so it will be very interesting how much rsync is able to reduce the size of the download...

img3

...right, 121MB. Quite a lot, but far less than 544MB. Possibly a way to get it much lower would be not to compress 'easy.sfs' when it is created, but that introduces usage problems.

Pressing ENTER key...

img4

...success, updated!

Next, I went through the same exercise, updating from 2.3 to 2.3.5, this time without "--rsyncable". That is, the online 'easy-2.3.5-amd64.img.gz' was compressed without that option, and ditto for the reconstructed 'easy-2.3-amd64.img.gz'...

img5

...download is 519MB, 519,588,023 bytes, almost the full size of 545,044,613 bytes. So, we are keeping that "--rsyncable"! 

Tags: easy