Re: Please put vi in base

2022-03-15 Thread Michael Hekeler
Am 13.03.22 03:38 schrieb i...@tutanota.com:
> (...)
> In my 30 years of doing sysadmin work, I have never - not even once - come 
> across a
> situation where a normal editor like vi or nano or something equally simple 
> didn't
> exist on the install media.

Maybe I am wrong, but I am thinking you like to use Linux based OS's
because you expect something like nano on install media.
If so, why don't simply boot from one of those countless linux live CDs?

You could even end up editing your files with a mouse-mandatory fancy KDE
whatever editor...

Besides that I want to thank the devs for including ed(1).
It was more than once a livesafer to me in MY years of doing sysadmin
work. 
...and I can remember at least one time exactly the same situation
with a broken fstab(5) ;-)



Re: Please put vi in base

2022-03-14 Thread Marc Espie
On Sun, Mar 13, 2022 at 05:54:03PM -0700, Jacqueline Jolicoeur wrote:
> Hi,
> 
> On Mar 12 16:39, i...@tutanota.com wrote:
> > I know I am not going to get any points for this, but I had to fix a broken 
> > OpenBSD box today that could not boot and I didn't have any network for a 
> > couple of hours, which made me stuck with ed from the boot media.
> 
> I encountered a problem just like you did. It would be nice to have vi 
> included in the install media yet the size makes it unrealistic.
> 
> > I spend hours wasting time, banging my head into the wall. Until I finally 
> > got network up on another machine and figured out a way to mount another 
> > OpenBSD disk in order to get access to vi in order to edit the files on the 
> > broken box.
> 
> This made me realize how important taking a few hours to learn and practice 
> basic edits with ed(1) was. Now is a great time to learn it.

Unless the install is badly broken, fsck on /usr, /var, mount them, set
TERM to something decent, and you got vi.



Re: Please put vi in base

2022-03-13 Thread Sean Kamath


> On Mar 12, 2022, at 18:38, i...@tutanota.com wrote:
> 
> In my 30 years of doing sysadmin work, I have never - not even once - come 
> across a
> situation where a normal editor like vi or nano or something equally simple 
> didn't
> exist on the install media.

Lucky you, never ever having to fix something without a “real” editor (and 
never mind that ‘ed’ *is* a real editor, just not a curses based one).

I had to use ed (or maybe it was its predecessor, e) on a Vax 8650 with a 
DECwriter terminal for a console to fix an fstab issue in 1990(ish).  Wouldn’t 
have done me no good to fire up VI (on the VAX, on the paper console, it would 
have basically been ‘ex’, anyway — vi being the visual version of ex).

Sounds like your problem shouldn’t have prevented you booting single user and 
then fixing the problem.

It also sounds like you’re complaining that the install media should be a full 
OS with all the things you’re used to (hay, the first thing I installed on on 
the Suns running 4.1 was emacs — I understand!).

What confuses me is the “hours” it took you to fix this.  I mean, if you can 
type in an editor, you can type in the command line (no echo required):

cat > /tmp/fstab

^D

Don’t want to type?

grep -v ‘badline’ /mnt/etc/fstab > /tmp/fstab
echo “newline” >> /tmp/fstab

You broke something on every line?

sed ’s/mistake/correction/‘ < /mnt/etc/fstab > /tmp/fstab

And if, as you claim, you have 30 years of doing sysadmin work, I can’t imagine 
in 1992 you had vi on any install media (would love to see an example).  Every 
sysadmin I know (and I have been doing this since 1984) wouldn’t balk at using 
variations of the above to fix /etc/fstab, _because we have_.

Sean

PS why put output in /tmp/fstab?  You’re not going to overwrite your fstab, are 
you? ‘mv /mnt/etc/fstab /mnt/etc/fstab.orig; cp /tmp/fstab /mnt/etc/fstab’ once 
you’ve confirmed /tmp/fstab looks like you want it to. :-)



Re: Please put vi in base

2022-03-13 Thread adr

Whow, a book to learn ed... just take a look to the man page. If
you are a vi user you should need only 5 minutes to see what subset
of ex commands its grandpa supports.

Lets change the home partition to another disk, so people reading
this nonsense don't get scared...

$ ed /etc/fstab
518

# print with line numbers all the file

%n
1   e32af7a7d8628e71.b none swap sw
2   e32af7a7d8628e71.a / ffs rw 1 1
3   e32af7a7d8628e71.l /home ffs rw,nodev,nosuid,noatime 1 2
4   e32af7a7d8628e71.d /tmp ffs rw,nodev,nosuid 1 2
5   e32af7a7d8628e71.f /usr ffs rw,nodev 1 2
6   e32af7a7d8628e71.g /usr/X11R6 ffs rw,nodev 1 2
7   e32af7a7d8628e71.h /usr/local ffs rw,wxallowed,nodev 1 2
8   e32af7a7d8628e71.k /usr/obj ffs rw,wxallowed,nodev,nosuid 1 2
9   e32af7a7d8628e71.j /usr/src ffs rw,nodev,nosuid 1 2
10  e32af7a7d8628e71.e /var ffs rw,nodev,nosuid 1 2
11  swap /mfs mfs rw,nodev,nosuid,-s=500M 0 0

# ok, we are going to change the 3rd line, lets see our disk's ids.

! sysctl hw.disknames
hw.disknames=sd0:e32af7a7d8628e71,sd1:4b96767efbfab476

# we need to change just the first word, so best use regexp
3s/[^.]*/4b96767efbfab476/

# be sure!

3p
4b96767efbfab476.l /home ffs rw,nodev,nosuid,noatime 1 2

# ok, that's all folks
wq
518


Fiddling around with configuration files with ed is like being tied up with
your hands and feet behind your back being told to eat a pizza from the
floor!
Typing everything out using echo is preferably to using ed


Give me a break...


Theo's answer: "For the same reasons it doesn't contain a web
browser:Not required, \ and besides that far too large."
That is ridicules!
Out of room? What does that even mean? Are you still using floppy disks!?
Oh, what a surprise: https://marc.info/?l=openbsd-misc=135794041929033=2
Double sigh!


What an attitude... I'm really surprise how nice this people have been to you.

But hey, this is not my house so I'll keep walking...



Re: Please put vi in base

2022-03-13 Thread Otto Moerbeek
On Sat, Mar 12, 2022 at 10:37:51PM +0100, i...@tutanota.com wrote:

> > Here's just the book for you:
> > Michael W. Lucas, Ed Mastery
> > https://mwl.io/nonfiction/tools#ed
> 
> I already have that book, which is why I KNOW I will never want to use
> ed :)

It takes less than half an hour to learn basic editing with ed(1).

If you want to admin OpenBSD, you got to learn the tools of the trade.

Refusal to learn and whining about it does not give you any credit
here.

-Otto



Re: Please put vi in base

2022-03-12 Thread David Rinehart
On 3/12/22 08:39, i...@tutanota.com wrote:
> I know I am not going to get any points for this, but I had to fix a broken 
> OpenBSD box today that could not boot and I didn't have any network for a 
> couple of hours, which made me stuck with ed from the boot media.
>
> So I did "man ed", which of course didn't work as there are no man pages on 
> the install media.
>
> I know how to use vi, but ed just draws the line. We're not dealing with 
> printer output any longer.
>
> Could we please get vi into base? Even the most basic version would do.
>
> I spend hours wasting time, banging my head into the wall. Until I finally 
> got network up on another machine and figured out a way to mount another 
> OpenBSD disk in order to get access to vi in order to edit the files on the 
> broken box.
>
> Sigh!
>
The issue should repairable from single-user mode (without a need for
install media):


# Once you're at a single-user prompt (just hit Enter at the "Enter
pathname of shell or RETURN for sh:" prompt), do the following:

# Mount the root filesystem as read-write, then mount the /var and /usr
filesystems (this will allow you to run vi or any other editor of your
choice)

mount -uw /
mount /var
mount /usr

export TERM=vt220

# Once those are mounted, edit /etc/fstab.



Re: Please put vi in base

2022-03-12 Thread Raul Miller
On Sat, Mar 12, 2022 at 9:41 PM  wrote:
> At least I will make sure to always have a custom install media ready.

Make sure you test it before you need to rely on it.

(Also, using echo isn't necessarily a bad idea, though there are
faster approaches. If retyping a line because of a typo is a problem,
you could for example, build a directory to represent the fstab, one
line per file in that directory, names indicating order, and use cat
to assemble the lines.)

((That said, if you spent hours on this, that sounds like learning
curve, or composing emails, not operational time.))

Good luck,

-- 
Raul



Re: Please put vi in base

2022-03-12 Thread Raul Miller
On Sat, Mar 12, 2022 at 4:48 PM  wrote:
> I already have that book, which is why I KNOW I will never want to use
> ed :)
>
> But thank you all for your feedback. I will make a custom install media
> from now on.

I have been trying to figure out what's going on here: you have not
really explained why you find yourself needing to edit files during
that bootstrap stage of installation.

(When I install openbsd from a usb iso image, I have vi available to
me before I need to edit any files. Apparently this does not match
your experience?)

I mean... it sounds like you have found your solution, so maybe this
conversation is over. But, if not, maybe I could still learn something
here.

Thanks,

-- 
Raul



Re: Please put vi in base

2022-03-12 Thread Paolo Aglialoro
Well, I think you should accept that this community features its own
dogmas, like no zfs/hammerfs/ext4/xfs, bsd.rd smallest possible, no
bluetooth, a prehistoric wm in base, and so on. Either you understand it or
quit, because they won't change their minds :(

I also asked for vi years ago and wasn't the first. With vax recently dead,
hppa64 dead and maybe hppa following as well as alpha, i386 which cannot
run a decent modern web browser anymore on most supported hw, the distro is
slowly retiring from retrocomputing hardware, so the need to compress
bsd.rd till death is becoming day by day less relevant.

Nevertheless they have all rights to have their tastes as this is their
playground, so make your platform choice wisely before it comes to disaster
recovery scenarios.

Using openbsd means choosing security and some cutting edge products (e.g.
pf, openssh, etc.), but at the same time coping with the mindset of the
devs, syntaxes changing over time, scarce support from 3rd parts (e.g.
backup software when running as VM) and need to throw lotsa your time in
the thing without specific guarantees that you'll be able to get what you
need.

Personally, having to do many things during the week - and needing products
that "just work" - I am almost not using it in production anymore, but
keeping it as a hobby on some hardware of mine because, after all, it's
still a great piece of software.

If you think ed should be buried down under 10m, like I do, make your own
decisions and stop trying to convince people who don't want to be convinced.

Regards

Il sab 12 mar 2022, 20:14  ha scritto:

>
> Mar 12, 2022, 17:21 by i...@darwinsys.com:
>
> >> Could we please get vi into base? Even the most basic version would do.
> >>
> >
> > um, vi has been in base for years.
> >
> > It has not been in the install media, which are chronically short out of
> room.
> > I would not advise you to hold your breath for vi to appear there in the
> next week or so.
> >
> > It doesn't take that long to learn ed from the "bottom line" of vi,
> > and the man pages are online if you have another computer (or even a
> phone) with
> > internet access. Learn it in the good times, for use in the bad.
> >
> I am sorry, I meant on the install media.
>
> I search the list for other discussions about this and found the answer by
> Theo:
>
> https://marc.info/?l=openbsd-misc=157319297226209=2
>
> > Why does the ramdisk not include /usr/bin/vi by default? To date,
> > it is the only UNIX-like environment I have ever seen without some
> > form of vi.
>
> Theo's answer: "For the same reasons it doesn't contain a web browser:Not
> required, and besides that far too large."
>
> That is ridicules!
>
> ed is for teleprinters, a monitor based editor is very much required.
> Fiddling around with configuration files with ed is like being tied up with
> your hands and feet behind your back being told to eat a pizza from the
> floor!
>
> Out of room? What does that even mean? Are you still using floppy disks!?
>
> install70.img is 664M and the install70.iso is 529M, I believe vi takes up
> 359K, surely
> there is room.
>
> Double sigh!
>
>


Re: Please put vi in base

2022-03-12 Thread Christian Weisgerber
Ian Darwin:

> It doesn't take that long to learn ed from the "bottom line" of vi,

ed(1) is much like an interactive version of sed(1).  Which is no
coincidence.  If you know the basics of sed(1), ed(1) is straightforward.

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: Please put vi in base

2022-03-12 Thread Christian Weisgerber
i...@tutanota.com:

> I know how to use vi, but ed just draws the line.

Here's just the book for you:
Michael W. Lucas, Ed Mastery
https://mwl.io/nonfiction/tools#ed

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: Please put vi in base

2022-03-12 Thread Stuart Henderson
On 2022-03-12, Sven F.  wrote:
>> > Out of room? What does that even mean? Are you still using floppy disks!?

Some of the install images *are* still using these, of course.

The install images are there to run the installer.

If you need a more complete system for repair purposes, boot from media
which has a more complete system installed onto it.

For example you could install to a USB drive and boot from that.

> On Sat, Mar 12, 2022 at 2:25 PM Sebastien Marie  wrote:
>> you should look at bsd.rd size instead. it is the install media, and
>> it is far smaller (4.4M here). so 359K is about 8% in size.

Plus libcurses, some kind of termcap file, quite likely more of libc
than is already compiled into the crunchgen'd binary.

As the filesystem for this is included in the install kernel, systems
need to be able to boot that larger kernel. That is likely to cause
problems with some machines/archs.

>> if you need vi to repair your system (depending the exact problem),
>> you could mount your partitions from the bsd.rd image, using something
>> like (untested):
>>
>> # cd /dev && sh ./MAKEDEV sd0   # create sd0 nodes
>> # mount -r /dev/sd0a /mnt   # mount root partition (readonly)
>> # chroot /mnt   # chroot to /mnt
>> (chroot)# mount -a  # mount all partition
>>
> vt220 or maybe xterm  if lucky or better
> (chroot)# TERM=something vi

or pccon




Re: Please put vi in base

2022-03-12 Thread Sven F.
On Sat, Mar 12, 2022 at 2:25 PM Sebastien Marie  wrote:

> On Sat, Mar 12, 2022 at 08:00:10PM +0100, i...@tutanota.com wrote:
> >
> >
> > > Why does the ramdisk not include /usr/bin/vi by default? To date,
> > > it is the only UNIX-like environment I have ever seen without some
> > > form of vi.
> >
> > Theo's answer: "For the same reasons it doesn't contain a web
> browser:Not required, and besides that far too large."
> >
> > That is ridicules!
> >
> > ed is for teleprinters, a monitor based editor is very much required.
> Fiddling around with configuration files with ed is like being tied up with
> your hands and feet behind your back being told to eat a pizza from the
> floor!
> >
> > Out of room? What does that even mean? Are you still using floppy disks!?
> >
> > install70.img is 664M and the install70.iso is 529M, I believe vi takes
> up 359K, surely
> > there is room.
>
> you should look at bsd.rd size instead. it is the install media, and
> it is far smaller (4.4M here). so 359K is about 8% in size.
>
> if you need vi to repair your system (depending the exact problem),
> you could mount your partitions from the bsd.rd image, using something
> like (untested):
>
> # cd /dev && sh ./MAKEDEV sd0   # create sd0 nodes
> # mount -r /dev/sd0a /mnt   # mount root partition (readonly)
> # chroot /mnt   # chroot to /mnt
> (chroot)# mount -a  # mount all partition
>
vt220 or maybe xterm  if lucky or better
(chroot)# TERM=something vi

> (chroot)# vi# you could run vi
>
> you could also use another system to build a static binary, and copy
> it on bsd.rd (via download or via usb drive).
>
> you could also put your hard disk in another machine to mount and
> repair it.
>
> --
> Sebastien Marie
>
>

-- 
--
-
Knowing is not enough; we must apply. Willing is not enough; we must do


Re: Please put vi in base

2022-03-12 Thread Sebastien Marie
On Sat, Mar 12, 2022 at 08:00:10PM +0100, i...@tutanota.com wrote:
> 
> 
> > Why does the ramdisk not include /usr/bin/vi by default? To date,
> > it is the only UNIX-like environment I have ever seen without some
> > form of vi.
> 
> Theo's answer: "For the same reasons it doesn't contain a web browser:Not 
> required, and besides that far too large."
> 
> That is ridicules!
> 
> ed is for teleprinters, a monitor based editor is very much required. 
> Fiddling around with configuration files with ed is like being tied up with 
> your hands and feet behind your back being told to eat a pizza from the floor!
> 
> Out of room? What does that even mean? Are you still using floppy disks!?
> 
> install70.img is 664M and the install70.iso is 529M, I believe vi takes up 
> 359K, surely
> there is room.

you should look at bsd.rd size instead. it is the install media, and
it is far smaller (4.4M here). so 359K is about 8% in size.

if you need vi to repair your system (depending the exact problem),
you could mount your partitions from the bsd.rd image, using something
like (untested):

# cd /dev && sh ./MAKEDEV sd0   # create sd0 nodes
# mount -r /dev/sd0a /mnt   # mount root partition (readonly)
# chroot /mnt   # chroot to /mnt
(chroot)# mount -a  # mount all partition
(chroot)# vi# you could run vi

you could also use another system to build a static binary, and copy
it on bsd.rd (via download or via usb drive).

you could also put your hard disk in another machine to mount and
repair it.

-- 
Sebastien Marie



Re: Please put vi in base

2022-03-12 Thread Ian Darwin
> Could we please get vi into base? Even the most basic version would do.

um, vi has been in base for years.

It has not been in the install media, which are chronically short out of room.
I would not advise you to hold your breath for vi to appear there in the next 
week or so.

It doesn't take that long to learn ed from the "bottom line" of vi,
and the man pages are online if you have another computer (or even a phone) with
internet access. Learn it in the good times, for use in the bad.