Re: vi vs ed in bsd.rd - proposal

2013-01-14 Thread Kevin Chadwick
> > Did you actually test that ? vi wants /var/tmp rw as well...
> >  
> 
> Nah, just going from memory.  It's been a while.  However, the same 
> logic applies:  Look at what partition /var is on and mount it too.

It will work just fine without /var. I believe it just puts a temporary
recovery file there that you may want to delete in any case. I wouldn't
mind vi and usually need a man page reminder for ed but I would prefer
the space used for something that hasn't an alternative, like vnconfig.

I praise you OpenBSD for having such a good single user and well
managed base and overall userland. Knocks seven shades of #@!% out of 
Linux userland in this regard in any case.

-- 
___

'Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a
universal interface'

(Doug McIlroy)
___



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Alexander Hall

On 01/11/13 22:51, Miod Vallat wrote:

The only editing available tool in bsd.rd, the infamous ed, made me sweat
cold with fear not to correctly spell its syntax or do some logic mistake.
I would have been way more lighthearted if I had vi available.


Actually, vi used to be in the installation media, 15 years ago. Lack of
space caused it to be removed, although for unconstrained installation
media (i.e. bsd.rd or anything which does not need to fit on a floppy)
it might be worth bring it back.


Btw, how many are really using ed everyday, now in 2013?


I am using ed, maybe not every day, but several times a week. And I use
it a lot when in the OpenBSD installer, to do some post-install setup
everytime I have completed an installation (this is because I am too
lazy to setup a siteXX.tgz tarball).


  I believe I'm not
the only one who thinks this. My guess is that vi could be more appreciated
by most of the user base more than ed.


But ed is the standard text editor. This is the only editor noone will
complain about. If we start putting vi back on the installation media,
it won't be long until people complain about the lack of an
emacs-compatible editor.


   This is the raw situation:

/usr/bin/vi = 343320 bytes
/bin/ed = 238864 bytes
delta = 104456 bytes

100K of executable, when compressed, wouldn't be "that" much in terms of
difference,


Except your figures are wrong. What you need to check is the output of
size(1) on both binaries, and after relinking vi as a static binary,
since ed is statically linked while vi is not.

Now on a random system here (admittedly not an x86 one), I get:
textdatabss dec hex
177074  743696252   280762  448ba   /bin/ed
740510  755630772   778838  be256   /usr/bin/vi.static

which is closer to 500KB of delta. A third of floppy52.fs.


I guess this isn't entirely true either, as linked in stuff is "reused" 
in the single instbin embracing all (or most) programs in bsd.rd.


However, the smaller the media, the fewer the programs, the bigger the 
punishment.


Then comes the unpredictability of how things are compressed, etc. Thus 
the only certain way to know the impact is to add it and see if it fits.


/Alexander



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Kenneth R Westerback
On Sat, Jan 12, 2013 at 01:34:44AM -0300, Carlo Borelli wrote:
> 2013/1/12 Nick Holland 
> 
> > On 01/11/13 16:38, Paolo Aglialoro wrote:
> > ...
> > > Btw, how many are really using ed everyday, now in 2013? I believe I'm
> > not
> > > the only one who thinks this. My guess is that vi could be more
> > appreciated
> > > by most of the user base more than ed.
> >
> > If you claim to be a unix administrator, learn ed.
> >
> 
> Sorry, completely wrong. An unix admin use only vi not wordstar or ed.
> 

If you replace 'unix admin' with PFY, perhaps.

 Ken



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Scott McEachern

On 01/12/13 09:19, Paolo Aglialoro wrote:

Sorry for fwd ur mail in list Scott, didn't notice it was in pvt.

As for the tyre comparison, I agree with you Nick. Better getting your
hands dirty than being laughed at. Which is btw what I did in that nasty
event. But I also remember the cold sweat out of it.


I don't think anyone ever forgets their first time being dropped into 
single-user mode.  While it's a bit of a shocker, what really makes the 
blood run cold is when you realize there's no vi(1) to fix a borked 
config.  I think it was after the second time I screwed up my fstab that 
I broke down and learned the basics of ed.


The timing of you bringing this up is funny to me.  I have a build box 
that I've been screwing around with lately and sometimes I'll copy a 
handful of backup files from my old /etc/ directory onto the new 
install.  And of course I always forget to tweak the fstab.


In the last week alone I've found myself in single-user mode at least 
three times, only instead of fear/sweating, I'm kicking myself (while 
using ed(1) to fix my fstab) for forgetting again.



I mean, "plus" instead of "versus", when space is enough, considering that
nowadays vi is a widespread standard too (can't think of a modern unix
distro without it), shouldn't be asking for the impossible :)
(basically not opening a race for "I want this tool too", but reasoning
about an update of survival tools)



FWIW, I couldn't care less if vi(1) is added.  In fact, if it _does_ get 
added, I'll probably forget it's there and continue using ed(1) like 
normal anyway.


PS:  Good analogy Nick.

--
Scott McEachern

https://www.blackstaff.ca



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Paolo Aglialoro
Sorry for fwd ur mail in list Scott, didn't notice it was in pvt.

As for the tyre comparison, I agree with you Nick. Better getting your
hands dirty than being laughed at. Which is btw what I did in that nasty
event. But I also remember the cold sweat out of it.

Actually I drive an old car which still features a spare tyre, while others
being sold nowadays have just repair kits. These latter ones go well for a
puncture, not for a wide cut (like it happened to me many years ago in
France on the highway).

So, my idea is, having understood that the repair kit (ed) is necessary, if
the car trunk (bsd.rd, not floppyxx.fs) allows for space, why not also
having a spare tyre (vi) in it, so that instead of repairing the tyre in
half an hour we can mount the spare tyre in less than 5 minutes?

I mean, "plus" instead of "versus", when space is enough, considering that
nowadays vi is a widespread standard too (can't think of a modern unix
distro without it), shouldn't be asking for the impossible :)
(basically not opening a race for "I want this tool too", but reasoning
about an update of survival tools)



On Sat, Jan 12, 2013 at 2:58 PM, Nick Holland
wrote:

> On 01/12/13 06:22, Paolo Aglialoro wrote:
> > So guys, I perfectly understand (and respect) how much many of you use
> and
> > value ed. As much as others have a repulsion for it, but this is not my
> > point:
>
> no, it's like the scissor jack and lug wrench in my Jeep.
> If I get a flat tire on the side of the road, I'd really wish I had my
> hydraulic floor jack with me, along with a spinner wrench or maybe even
> my impact driver and sockets.
>
> 'cept...my Jeep has very limited storage...and a tire goes flat very
> rarely.
>
> But when it does... I have a few choices...
> 1) sit and cry, "I want my floor jack!"
> 2) wait a few hours for someone else to come and help me.
> 3) grab the lug wrench and scissor jack and be back on the road in 15
> minutes.
>
> ed isn't a contender in the "my favorite editor" contest.  I doubt
> anyone uses it when another option is available for anything other than
> practice.  But sometimes, you have a downed system, you need an editor,
> you don't have a valid or known terminal config in place or enough
> system running to use 'vi'.
>
> I've had to rescue enough systems with invalid/unknown/messed up
> terminal configurations that I'd never support REPLACEMENT of 'ed' with
> a full screen editor.
>
> Some day...you may need to, as well.  Spend 15 minutes, and become
> capable with ed.  You don't need to be fluent...just capable of fixing
> an /etc/fstab file, and other basic things.  Beats having people driving
> by, laughing at you for sitting on the curb crying about the lack of
> your favorite tool.
>
> Nick.



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Nick Holland
On 01/12/13 06:22, Paolo Aglialoro wrote:
> So guys, I perfectly understand (and respect) how much many of you use and
> value ed. As much as others have a repulsion for it, but this is not my
> point:

no, it's like the scissor jack and lug wrench in my Jeep.
If I get a flat tire on the side of the road, I'd really wish I had my
hydraulic floor jack with me, along with a spinner wrench or maybe even
my impact driver and sockets.

'cept...my Jeep has very limited storage...and a tire goes flat very
rarely.

But when it does... I have a few choices...
1) sit and cry, "I want my floor jack!"
2) wait a few hours for someone else to come and help me.
3) grab the lug wrench and scissor jack and be back on the road in 15
minutes.

ed isn't a contender in the "my favorite editor" contest.  I doubt
anyone uses it when another option is available for anything other than
practice.  But sometimes, you have a downed system, you need an editor,
you don't have a valid or known terminal config in place or enough
system running to use 'vi'.

I've had to rescue enough systems with invalid/unknown/messed up
terminal configurations that I'd never support REPLACEMENT of 'ed' with
a full screen editor.

Some day...you may need to, as well.  Spend 15 minutes, and become
capable with ed.  You don't need to be fluent...just capable of fixing
an /etc/fstab file, and other basic things.  Beats having people driving
by, laughing at you for sitting on the curb crying about the lack of
your favorite tool.

Nick.



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Scott McEachern

On 01/12/13 08:24, Paolo Aglialoro wrote:

Thank you Scott!

Your tutorial is really nice :)
I'll star it in my gmail.




Uhm, you're welcome.  Just FYI, it's bad form to reply to a private 
email onto a public mailing list.


I'm no ed(1) expert.  Since it's now on the list, maybe more experienced 
ed users can suggest more efficient ways to do things.


And like espie@ noted in a previous email, no I didn't test it out. 
Practise it for yourself to ensure there aren't any gotchas.. Like how I 
forgot that you will also want to mount /var/ since vi stores its 
recovery files in /var/tmp/.  Oops. :)


--
Scott McEachern

https://www.blackstaff.ca



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Paolo Aglialoro
Thank you Scott!

Your tutorial is really nice :)
I'll star it in my gmail.

Nevertheless, even if at the time the problem was a typo in fstab (which I
solved with an s/// sed sequence), I appreciate your honesty when u
implicitly admit that vi would be more adequated for more complex tasks.

Btw, I'm not particularly in love with vi, my editor of choice is ye good
olde nano. It's just that I've always seen vi as default on the few unix I
tried, so not finding it inside bsd.rd has been a bitter surprise,
especially with time running damn fast...

So, to answer Marc, I'd be ready to test bsd.rd with vi on 5.2 on 2/3
arches: i386, sparc64 and, if needed, amd64.

Just before beginning I'd like to know if, not being a dev, it would be
just wasting my time or if the thing would be then considered.

Thanks
Il giorno 12/gen/2013 13:33, "Scott McEachern"  ha
scritto:

> On 01/11/13 16:38, Paolo Aglialoro wrote:
>
>> sparc64 machine, a neglected typo in fstab while changing a disk
>> mountpoint
>> and boom! - no boot :(
>>
>>
>>
> I didn't post this to the list because it would just be noise for most
> people.
>
> Some quick ed(1) tips:
>
> #ed /etc/fstab
>
> (It prints out a number, the size of the file in bytes, and waits for you
> to do something.)
>
> Use ",n" to display the entire file with line numbers.  Useful for short
> files like fstab that won't run off the page.  (Synonymous with "%n" or
> "1,$n", just like vi(1).)
>
> Pretend you just want to comment out a line so you can reboot and get back
> to your beloved vi(1).  Look at the line containing the bad data.  Pretend
> it's on line #5.
>
> Use "5i" to insert text before line five.  Now, if you use ",n" to look
> again, what was line 5 is now line 6 and line 5 is just "#".
>
> Use "5,6j" to join lines 5 and 6, thus making line 5 commented out.
>
> Enter "." to go back to command mode.
> Enter "wq" to write the file and quit.  Reboot.
>
> If you can't live with line 5 being commented out, because you really need
> that mount point mounted, then you have to do a little typing:
>
> Type "5" by itself to view the line again.
> Use "5c" to change the line, and retype what you see, but without the
> error.
> Enter "." to go back to command mode, and "wq" to write and quit. Reboot.
>
> Note that you don't hit  to enter command mode; a period on a line by
> itself does that, like with mail(1).  Note that you don't type ":wq" to
> save and exit like you do with vi(1).
>
> Print this or write it down and throw it in your desk drawer for when a
> faulty fstab drops you into single user mode.
>
> HTH,
>
> --
> Scott McEachern
>
> https://www.blackstaff.ca



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Scott McEachern

On 01/12/13 07:25, Marc Espie wrote:

On Sat, Jan 12, 2013 at 07:17:25AM -0500, Scott McEachern wrote:

On 01/11/13 16:38, Paolo Aglialoro wrote:

sparc64 machine, a neglected typo in fstab while changing a disk mountpoint
and boom! - no boot :(



ed(1) isn't hard to use, but if you haven't used it in a while, as
espie@ said, having another machine handy to hit the man page is
useful.  Go play with ed(1) now when you aren't in "panic mode" to
get a feel for it.

However, if you really feel the need to use vi, then do something like this:

1) use disklabel(8) to see what partition on your HDD contains the
/usr partition.  vi(1) lives in /usr/bin, so I'm assuming you don't
have /usr/bin/ mounted somewhere other than /usr.

Pretend it's on partition 'f' of sd0.  Let's also pretend your root
partition is on 'a'.

2) #mount /dev/sd0a /
#mount /dev/sd0f /usr

If you run vi now, it'll bitch about your terminal type not being set, so:

3) #export TERM=vt220 (or whatever is applicable to you)

4) #vi /etc/fstab (fix your mistake(s))

5) #reboot

Did you actually test that ? vi wants /var/tmp rw as well...



Nah, just going from memory.  It's been a while.  However, the same 
logic applies:  Look at what partition /var is on and mount it too.


But thanks for illustrating my point:  It's just easier to learn a 
little ed(1) when not panicking in single-user mode.  I'm also assuming 
that his _only_ problem is a typo (or whatever) in fstab, otherwise 
things get more complicated. :)


--
Scott McEachern

https://www.blackstaff.ca



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Marc Espie
On Sat, Jan 12, 2013 at 07:17:25AM -0500, Scott McEachern wrote:
> On 01/11/13 16:38, Paolo Aglialoro wrote:
> >sparc64 machine, a neglected typo in fstab while changing a disk mountpoint
> >and boom! - no boot :(
> >
> >
> 
> ed(1) isn't hard to use, but if you haven't used it in a while, as
> espie@ said, having another machine handy to hit the man page is
> useful.  Go play with ed(1) now when you aren't in "panic mode" to
> get a feel for it.
> 
> However, if you really feel the need to use vi, then do something like this:
> 
> 1) use disklabel(8) to see what partition on your HDD contains the
> /usr partition.  vi(1) lives in /usr/bin, so I'm assuming you don't
> have /usr/bin/ mounted somewhere other than /usr.
> 
> Pretend it's on partition 'f' of sd0.  Let's also pretend your root
> partition is on 'a'.
> 
> 2) #mount /dev/sd0a /
> #mount /dev/sd0f /usr
> 
> If you run vi now, it'll bitch about your terminal type not being set, so:
> 
> 3) #export TERM=vt220 (or whatever is applicable to you)
> 
> 4) #vi /etc/fstab (fix your mistake(s))
> 
> 5) #reboot

Did you actually test that ? vi wants /var/tmp rw as well...



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Scott McEachern

On 01/11/13 16:38, Paolo Aglialoro wrote:

sparc64 machine, a neglected typo in fstab while changing a disk mountpoint
and boom! - no boot :(




ed(1) isn't hard to use, but if you haven't used it in a while, as 
espie@ said, having another machine handy to hit the man page is 
useful.  Go play with ed(1) now when you aren't in "panic mode" to get a 
feel for it.


However, if you really feel the need to use vi, then do something like this:

1) use disklabel(8) to see what partition on your HDD contains the /usr 
partition.  vi(1) lives in /usr/bin, so I'm assuming you don't have 
/usr/bin/ mounted somewhere other than /usr.


Pretend it's on partition 'f' of sd0.  Let's also pretend your root 
partition is on 'a'.


2) #mount /dev/sd0a /
#mount /dev/sd0f /usr

If you run vi now, it'll bitch about your terminal type not being set, so:

3) #export TERM=vt220 (or whatever is applicable to you)

4) #vi /etc/fstab (fix your mistake(s))

5) #reboot

and you should be good.

Keep in mind, my "workaround" above won't always be there for you, so 
I'll say it again:  Go play with ed(1) now on a "dummy" file when you 
aren't in "panic mode" to get a feel for it.


--
Scott McEachern

https://www.blackstaff.ca



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Marc Espie
I do use ed occasionnally, when I have about no choice.
Specifically, glass console fucked up, no editing working... and no
vi in bsd.rd.

I don't know it very well, and I usually need another system nearby
to refer to the manpage.

I'm not a sysadmin, though.

I don't see any harm in putting vi in bsd.rd on most platforms.
I don't care enough to do the work.

This does require someone to add vi to the release media for bsd.rd.
Unless someone does that work and test it, it won't happen.

Note that I haven't seen anyone spring up and say "over my dead body" 
yet either.

-- 
Marc



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Paolo Aglialoro
So guys, I perfectly understand (and respect) how much many of you use and
value ed. As much as others have a repulsion for it, but this is not my
point:

I mean, with respect for all viewpoints, I'm far from starting a religion
war on "which is ur fave editor", but just trying to share a view on a
fundamental tool whose presence may make the difference to provide *quick*
answers in a disaster recovery scenario (and all those ones who felt the
"emotions" of such situations know how, under pressure, it's both easy to
make mistakes and hard to concentrate on man pages...).

As it emerged in the 1st answer by Miod, vi would be clearly off-limits for
any floppyXX.fs but not for bsd.rd which is usually loaded through CD or
Netboot.

So, considering that floppy size was the only main concern, why not just
putting it inside bsd.rd?

I am convinced that, after all, also the most skilled sysadmin would
appreciate changing that characters sequence at the 54th row on the fly,
rather than having to make calculations on how to (s)ed it without
compromising similar sequences scattered along the file. After all, while
tradition is always good, when shit hits the fan, higher technology is
definitely better ;)

Thanks



Re: vi vs ed in bsd.rd - proposal

2013-01-12 Thread Eric Furman
Obvious Troll. blah blah blah..

On Sat, Jan 12, 2013, at 12:04 AM, Christopher Vance wrote:
> You would fail any system administration course I teach.
> 
> On 12/01/2013, at 15:34, Carlo Borelli  wrote:
> 
> > 2013/1/12 Nick Holland 
> > 
> >> On 01/11/13 16:38, Paolo Aglialoro wrote:
> >> ...
> >>> Btw, how many are really using ed everyday, now in 2013? I believe I'm
> >> not
> >>> the only one who thinks this. My guess is that vi could be more
> >> appreciated
> >>> by most of the user base more than ed.
> >> 
> >> If you claim to be a unix administrator, learn ed.
> > 
> > Sorry, completely wrong. An unix admin use only vi not wordstar or ed.



Re: vi vs ed in bsd.rd - proposal

2013-01-11 Thread Paul de Weerd
On Sat, Jan 12, 2013 at 08:13:33AM +0100, Otto Moerbeek wrote:
| On Sat, Jan 12, 2013 at 07:39:27AM +0100, Paul de Weerd wrote:
| 
| > On Sat, Jan 12, 2013 at 01:34:44AM -0300, Carlo Borelli wrote:
| > | > If you claim to be a unix administrator, learn ed.
| > | >
| > | 
| > | Sorry, completely wrong. An unix admin use only vi not wordstar or ed.
| > 
| > You know vi but you don't know ed.  Right.  Know your software and its
| > history - vi is ed with visual editing bolted on.  Once you recognize
| > this, you'll have no problems at all dealing with ed.
| 
| slighty wrong. vi is *ex* plus visual editing.

Sure, I skipped a step .. history went ed -> ex -> vi (and that's not
a completely accurate progression either with ed being written by
Thompson and ex (and later vi) by Joy who was an avid ed user), but
the influences are obvious.

The point was that it's easy to learn and use ed if you are already 
familiar with vi.

| But the advice remains. ed is a skil must know to call yourself a unix
| admin. 

Absolutely.

Paul 'WEiRD' de Weerd

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: vi vs ed in bsd.rd - proposal

2013-01-11 Thread Christopher Vance
You would fail any system administration course I teach.

On 12/01/2013, at 15:34, Carlo Borelli  wrote:

> 2013/1/12 Nick Holland 
> 
>> On 01/11/13 16:38, Paolo Aglialoro wrote:
>> ...
>>> Btw, how many are really using ed everyday, now in 2013? I believe I'm
>> not
>>> the only one who thinks this. My guess is that vi could be more
>> appreciated
>>> by most of the user base more than ed.
>> 
>> If you claim to be a unix administrator, learn ed.
> 
> Sorry, completely wrong. An unix admin use only vi not wordstar or ed.



Re: vi vs ed in bsd.rd - proposal

2013-01-11 Thread Otto Moerbeek
On Sat, Jan 12, 2013 at 07:39:27AM +0100, Paul de Weerd wrote:

> On Sat, Jan 12, 2013 at 01:34:44AM -0300, Carlo Borelli wrote:
> | > If you claim to be a unix administrator, learn ed.
> | >
> | 
> | Sorry, completely wrong. An unix admin use only vi not wordstar or ed.
> 
> You know vi but you don't know ed.  Right.  Know your software and its
> history - vi is ed with visual editing bolted on.  Once you recognize
> this, you'll have no problems at all dealing with ed.

slighty wrong. vi is *ex* plus visual editing.

But the advice remains. ed is a skil must know to call yourself a unix
admin. 

-Otto
> 
> I like how you try to put your opinion out as fact when the facts are
> against you.  Pretty funny ;)
> 
> Paul 'WEiRD' de Weerd
> 
> -- 
> >[<++>-]<+++.>+++[<-->-]<.>+++[<+
> +++>-]<.>++[<>-]<+.--.[-]
>  http://www.weirdnet.nl/ 



Re: vi vs ed in bsd.rd - proposal

2013-01-11 Thread Paul de Weerd
On Sat, Jan 12, 2013 at 01:34:44AM -0300, Carlo Borelli wrote:
| > If you claim to be a unix administrator, learn ed.
| >
| 
| Sorry, completely wrong. An unix admin use only vi not wordstar or ed.

You know vi but you don't know ed.  Right.  Know your software and its
history - vi is ed with visual editing bolted on.  Once you recognize
this, you'll have no problems at all dealing with ed.

I like how you try to put your opinion out as fact when the facts are
against you.  Pretty funny ;)

Paul 'WEiRD' de Weerd

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: vi vs ed in bsd.rd - proposal

2013-01-11 Thread Carlo Borelli
2013/1/12 Christopher Vance 

> You would fail any system administration course I teach.
>

I respect your opinion.
Are you a teacher and not teaching the basic ones? Proudly failing any
course you do.
What else?
Btw, Paolo Aglialoro +1

Registered Linux User #249354
"Ad astra per aspera"



Re: vi vs ed in bsd.rd - proposal

2013-01-11 Thread Carlo Borelli
2013/1/12 Nick Holland 

> On 01/11/13 16:38, Paolo Aglialoro wrote:
> ...
> > Btw, how many are really using ed everyday, now in 2013? I believe I'm
> not
> > the only one who thinks this. My guess is that vi could be more
> appreciated
> > by most of the user base more than ed.
>
> If you claim to be a unix administrator, learn ed.
>

Sorry, completely wrong. An unix admin use only vi not wordstar or ed.



Re: vi vs ed in bsd.rd - proposal

2013-01-11 Thread Nick Holland
On 01/11/13 16:38, Paolo Aglialoro wrote:
...
> Btw, how many are really using ed everyday, now in 2013? I believe I'm not
> the only one who thinks this. My guess is that vi could be more appreciated
> by most of the user base more than ed.

If you claim to be a unix administrator, learn ed.

If you have to bring up your OpenBSD or Solaris machine in single user
mode with an unavailable /usr (and thus, no dynamically linked apps),
you will be glad you know it.  It's an "always there" tool...it "just
works", and it ain't so bad if you spend 15 minutes to learn how it
works before you need it.

Nick.



Re: vi vs ed in bsd.rd - proposal

2013-01-11 Thread Miod Vallat
> The only editing available tool in bsd.rd, the infamous ed, made me sweat
> cold with fear not to correctly spell its syntax or do some logic mistake.
> I would have been way more lighthearted if I had vi available.

Actually, vi used to be in the installation media, 15 years ago. Lack of
space caused it to be removed, although for unconstrained installation
media (i.e. bsd.rd or anything which does not need to fit on a floppy)
it might be worth bring it back.

> Btw, how many are really using ed everyday, now in 2013?

I am using ed, maybe not every day, but several times a week. And I use
it a lot when in the OpenBSD installer, to do some post-install setup
everytime I have completed an installation (this is because I am too
lazy to setup a siteXX.tgz tarball).

>  I believe I'm not
> the only one who thinks this. My guess is that vi could be more appreciated
> by most of the user base more than ed.

But ed is the standard text editor. This is the only editor noone will
complain about. If we start putting vi back on the installation media,
it won't be long until people complain about the lack of an
emacs-compatible editor.

>   This is the raw situation:
> 
> /usr/bin/vi = 343320 bytes
> /bin/ed = 238864 bytes
> delta = 104456 bytes
> 
> 100K of executable, when compressed, wouldn't be "that" much in terms of
> difference,

Except your figures are wrong. What you need to check is the output of
size(1) on both binaries, and after relinking vi as a static binary,
since ed is statically linked while vi is not.

Now on a random system here (admittedly not an x86 one), I get:
textdatabss dec hex
177074  743696252   280762  448ba   /bin/ed
740510  755630772   778838  be256   /usr/bin/vi.static

which is closer to 500KB of delta. A third of floppy52.fs.

Miod



vi vs ed in bsd.rd - proposal

2013-01-11 Thread Paolo Aglialoro
Hello misc,

there were recently some comments about customizing bsd.rd contents and
making one of own's choice/taste. This reminded me about an unpleasant
situation in which I found myself kinda 2 years ago:

sparc64 machine, a neglected typo in fstab while changing a disk mountpoint
and boom! - no boot :(

This machine was in a server room (where there was no quick possibility to
setup a rarpd server to netboot bsd.rd, thing which would therefore
especially apply for a customized one) and so the only solution was to use
an install CD and its console.

The only editing available tool in bsd.rd, the infamous ed, made me sweat
cold with fear not to correctly spell its syntax or do some logic mistake.
I would have been way more lighthearted if I had vi available.

Btw, how many are really using ed everyday, now in 2013? I believe I'm not
the only one who thinks this. My guess is that vi could be more appreciated
by most of the user base more than ed.

So, today, for the sake of curiosity I sshd that machine (now updated to
5.2) and examined/usr/src/distrib/sparc64/bsd.rd/list in order to look for
"space" (e.g. some similar commands, but failed to, also more and less are
the same file) to fit vi. This is the raw situation:

/usr/bin/vi = 343320 bytes
/bin/ed = 238864 bytes
delta = 104456 bytes

100K of executable, when compressed, wouldn't be "that" much in terms of
difference, but would have an enormous impact on user-friendlyness and
flexibility of editing (funny, I never thought I would have called vi
user-friendly! Anyway, compared to ed, also old DOS edlin was).

So basically my proposal would be substituting ed with vi.

My alternative proposal would be only adding vi just for sparc64, after
all, how many sparc64 boxes do nowadays boot from a floppy disk? Most of
them don't have one at all, and the ones who do, also feature a CD-ROM
drive.

Thanks for your feedback!