Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#477 closed defect (fixed)

Mondorestore fails to edit with nano editor

Reported by: Manuel Carreira Silva Owned by: Bruno Cornec
Priority: normal Milestone: 2.2.9.7
Component: mindi Version: 2.2.9.5
Severity: major Keywords: editor nano softlink
Cc:

Description

I tried to use nano editor instead of vi, to edit system configuration files when using mondorestore.
So, I edited /etc/mindi/deplist.d/addon.conf and added /usr/bin/nano to the last line.
This way, nano will be added to the boot disc when using mondoarchive. I think this is the proper way to do it.
Then I tried the restore and I got a surprise :-(

When mondorestore popped up a dialog box telling me "You will now edit fstab, mtab, device.map and menu.lst/grub.cfg", I pressed "enter" and instead having nano editing a file, mondorestore continued without stopping until the next dialog box popped up ("Label/Identify your ext2/ext3/ext4 partitions if necessary")

After some research, I noticed that mondo tries to find one editor: pico, nano, e3em, e3vi and if it doesn't find any one, he selects "vi" by default.
But when I installed nano, mondo had some weird behaviour:

he created a pico softlink to nano!

So, when trying to find the editor, mondo finds pico in the first place, which is a softlink to nano.
Then, when he chroots to /mnt/RESTORING he tries to load pico. But as pico does not exist there, and there is no softlink in the chroot system, the edition does not happen.

There is a block code, from line 898 to 904 in mindi-2.0.7.6/rootfs/sbin/init which is the cause of this issue, and is confusing me. I don't understand why these softlinks are created!

#ctrlaltdel soft
for path in /usr.bin /usr/bin ; do
	fname=$path/nano
	[ -e "$fname" ] && ln -sf $fname /usr/bin/pico
done
res=`which nano 2> /dev/null`
[ "$res" ] && ln -sf /usr/bin/

I commented (#) all these lines, and then mondorestore let me edit all files successfully with the nano editor.

Conclusion:

At least in ArchLinux distro, this code it's not required. Nano is considered a pico editor clone, and there is no pico editor package.

Question:

Is this code needed by other distros?

Or it can be safely deleted?

Change History (2)

comment:1 by Bruno Cornec, 13 years ago

Resolution: fixed
Status: newclosed

You're perfectly right. That code comes from very old times, before I maintained mondo. And indeed it's wrong and now gone :-)

Cf: rev [2765]

Thanks for your report ! Bruno.

comment:2 by Bruno Cornec, 13 years ago

Milestone: 2.2.9.62.2.9.7
Note: See TracTickets for help on using tickets.