How to force load alternate text editor mp - Minimum Profit

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
kethd
Posts: 451
Joined: Thu 20 Oct 2005, 12:54
Location: Boston MA USA

How to force load alternate text editor mp - Minimum Profit

#1 Post by kethd »

This shell script can be used to force load the alternate (to vi) text editor mp, Minimum Profit:

Code: Select all

cp /mnt/floppy/mp /bin/
cp /mnt/floppy/libpcre.so /lib/libpcreposix.so.0
mkdir -p /usr/share/terminfo/l
cp /mnt/floppy/l/linux /usr/share/terminfo/l/
The Puppy boot process is described here:
http://www.pupweb.org/puppy/puppy-startup.htm

When your Puppy is not booting properly, you may choose to CTRL-C to a command prompt. rc.sysinit seems to contain most of the startup logic. But it is not smart enough to always work, and not dumb enough to just let you tell it what to do. You can try to study it to understand things, but changing it is a challenge, since it is packed into image.gz.

So, if you want to explore things at the half-booted point, you have only the command line, and also very limited tools, mostly just Busybox.

One option is to try to manually mount the full usr_cram.fs, described here:
http://www.murga.org/%7Epuppy/viewtopic.php?t=4626

But if that does not work, or you just want the simplicity of working directly at the lowest command line level from ram and floppy -- you may still want to avoid having to cope with the quirky standard vi editor (in Busybox).

Puppy includes mp (Minimum Profit 3.3.7 - http://triptico.com/software/mp.html ), which is simple enough to just stumble through (a simple text editor for dummies). But it is not normally available until the whole usr_cram.fs filesystem is successfully mounted.

The above script makes it possible to load the mp editor manually, and use it to explore your failed Pup system. I put the file on the Puppy freeDOS boot floppy (which has a lot of free space) named mp-load. To use it, I just boot to failed Pup, CTRL-C, then:
# mount /dev/fd0 /mnt/floppy
# /mnt/floppy/mp-load

Now that mp is loaded, to use it just:
# mp filename
and you will be in a simple screen editor.

For example, mp is good for making the above script file. In order for it to work, you will also need to have the three files needed to make mp work on the floppy. You will need a full-mounted Puppy to get access to the files. (But the GUI does not have to be running -- it is possible to set this all up from the command line.) You might want to use the find command to locate the files. The three files you will need are:
mp
libpcreposix.so.0
terminfo/l/linux

The whole issue with Linux binaries seems like an awful mess -- there seems to be no universal standard, so we are lucky we already have something in the standard-issue Pup to use. It is too bad Busybox does not include something like vi but more for dummies. Even the minimal mp used here is 160KB, over three times the size of trusty old MSDOS QEdit text-window editor, which works just fine for simple things.

System:
107alpha on 128MB flash-hd msdos partition, set up by 106
128MBram P-233MMX Compaq DP-2000 13dec05

kethd
Posts: 451
Joined: Thu 20 Oct 2005, 12:54
Location: Boston MA USA

#2 Post by kethd »

I discovered that mp does a much better job of viewing html files (like BusyBox.html) compared to piping to <more>.

Post Reply