Date: Wed, 1 Dec 2004 22:27:52 -0500 From: Parv <parv@pair.com> To: "Kevin D. Kinsey, DaleCo, S.P." <kdk@daleco.biz> Cc: freebsd-questions@freebsd.org Subject: Re: How to edit file in single user mode Message-ID: <20041202032751.GA552@moo.holy.cow> In-Reply-To: <41AE5BB9.1000902@daleco.biz> References: <41AA5AFC.2090902@fastmail.fm> <20041128201638.N66254@cactus.fi.uba.ar> <41AA663F.2030106@fastmail.fm> <41AE5BB9.1000902@daleco.biz>
next in thread | previous in thread | raw e-mail | index | archive | help
in message <41AE5BB9.1000902@daleco.biz>, wrote Kevin D. Kinsey, DaleCo, S.P. thusly... > > >>On Sun, 28 Nov 2004, Trey Sizemore wrote: > >> > >>>I made a typo in rc.conf and now am able to boot only into single user > >>>mode. I thought vi would be available to edit the file, but cannot > >>>execute it (vi not found). > > What if you can't mount /usr ? then you've even more trouble. > You can learn to use ed(1), but that's like going back thirty > years. Key is to learn some ed before the actual need arises. Else, frustration lies the other way. > There was some discussion ... on the idea of building a small > editor binary that you like ... and cp'ing it to /bin in > preparation Remember to link your favourite editor statically before even bother to copy. Currently, ee is linked here (4.10-p4) to ... libncurses.so.5 => /usr/lib/libncurses.so.5 (0x28073000) libc.so.4 => /usr/lib/libc.so.4 (0x280b5000) Whatever happens to the editor, it needs to be self contained/sufficient by being small, statically compiled, and be usable w/o the facility of curses. That reminds me of my old C++ class editor project. My version of the editor -- ed like commands, no regex support, menu driven -- statically compiled w/ GCC 3.4 & stripped takes 403 kB (-O1) or 389 kB (-O2). (It has yet to go through a thorough review though. Anybody care to take a look?) I suppose i could/should save a copy just in case. - Parv --
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041202032751.GA552>