Re: A vi for /bin?

2003-01-26 Thread Dirk-Willem van Gulik


On Sat, 25 Jan 2003, Paul Hoffman wrote:

> - As pointed out off-line, you also need to get it the termcap library. Doing
> cp /usr/share/misc/termcap.db /root/.termcap.db

You propably want to strip that bugger down to its bones; they weight in
at around 2Mb including the un-db-ed version.

So for floppy/flashcard systems I do:

cat > /root/.termcap <\E[?1;3;4;5l\E[?7;8h\E[1;24r\E[24;1H:\
:if=/usr/share/tabset/vt100:nw=2\EE:ho=\E[H:\
:as=2\E(0:ae=2\E(B:\
:ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||:\
:rs=\E>\E[?1;3;4;5l\E[?7;8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\
:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=\177:\
:k0=\EOy:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\EOt:\
:k6=\EOu:k7=\EOv:k8=\EOl:k9=\EOw:k;=\EOx:@8=\EOM:\
:K1=\EOq:K2=\EOr:K3=\EOs:K4=\EOp:K5=\EOn:pt:sr=2*\EM:xn:\
:sc=2\E7:rc=2\E8:cs=5\E[%i%d;%dr:UP=2\E[%dA:DO=2\E[%dB:RI=2\E[%dC:\
:LE=2\E[%dD:ct=2\E[3g:st=2\EH:ta=^I:ms:bl=^G:cr=^M:eo:it#8:\
:RA=\E[?7l:SA=\E[?7h:
EOM
(See /usr/src/share/termcap/termcap.src for the source).

cap_mkdb /root/.termcap

Dw


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



RE: A vi for /bin?

2003-01-26 Thread Dirk-Willem van Gulik


> Assuming you have the object files from a buildworld hanging around, then
> cd /usr/obj/usr/src/usr.bin/vi
> cc -O -pipe -o vi *.o -lncurses -static && strip vi && mv vi /bin/
> should probably supply you with what you want.

When using VI in such a situation I usually also use rc.diskless2 to
create myself an environment with thing like /tmp|/var in mfs for tmp,
cuuu0 lock files and the lot.

Dw.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: A vi for /bin?

2003-01-25 Thread Giorgos Keramidas
On 2003-01-25 19:22, Paul Hoffman <[EMAIL PROTECTED]> wrote:
> At 1:36 AM + 1/26/03, Petersen wrote:
> >Assuming you have the object files from a buildworld hanging around, then
> >cd /usr/obj/usr/src/usr.bin/vi
> >cc -O -pipe -o vi *.o -lncurses -static && strip vi && mv vi /bin/
> >should probably supply you with what you want.
>
> Two modifications made this work fine:
> - I hadn't done a buildworld, but doing the following got the same result:
>cd /usr/src/usr.bin/vi
>make && cc -O -pipe -o vi *.o -lncurses -static && strip vi && mv vi /bin

A quicker way to do the same could be:

# make NOSHARED=yes all
# install -m 0755 -o root -g wheel vi /bin

I like NOSHARED too much to resist following up :)


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: A vi for /bin?

2003-01-25 Thread Dan Nelson
In the last episode (Jan 25), Paul Hoffman said:
> Nice! e3 built from the ports collection linked statically
> automatically. e3 didn't work correctly on my console (it didn't
> recognize the Alt key), but e3vi worked fine and felt just like vi.

Alt key support requires you to modify yur syscons keymappings to send
ALT-keypresses as ESC + key.  If you don't want to do that, just hit
ESC before your alt-key.

-- 
Dan Nelson
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: A vi for /bin?

2003-01-25 Thread Paul Hoffman
At 1:36 AM + 1/26/03, Petersen wrote:

Assuming you have the object files from a buildworld hanging around, then
cd /usr/obj/usr/src/usr.bin/vi
cc -O -pipe -o vi *.o -lncurses -static && strip vi && mv vi /bin/
should probably supply you with what you want.


Two modifications made this work fine:
- I hadn't done a buildworld, but doing the following got the same result:
   cd /usr/src/usr.bin/vi
   make && cc -O -pipe -o vi *.o -lncurses -static && strip vi && mv vi /bin/
- As pointed out off-line, you also need to get it the termcap library. Doing
   cp /usr/share/misc/termcap.db /root/.termcap.db
fixes that.

At 8:30 PM -0600 1/25/03, Dan Nelson wrote:

You
might want to install e3, which is only 13k statically linked and uses
generic ANSI escape codes so it doesn't need a termcap file.  If run as
e3vi, it acceptes vi keystrokes.


Nice! e3 built from the ports collection linked statically 
automatically. e3 didn't work correctly on my console (it didn't 
recognize the Alt key), but e3vi worked fine and felt just like vi.

Thanks! I now feel better about emergencies.

--Paul Hoffman

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message


Re: A vi for /bin?

2003-01-25 Thread Dan Nelson
In the last episode (Jan 25), Paul Hoffman said:
> At 1:36 AM + 1/26/03, Petersen wrote:
> >Paul Hoffman wrote:
> >> I'm kinda surprised this isn't in the FAQ (or at least not in a
> >> place that I could find it). It is really impossible to build a vi
> >> with no external dependencies that can be installed in /bin?
> >
> >What made you think it was impossible?
> 
> The book "FreeBSD" by Anderson (which was highly recommended by some) 
> says so on page 371. I'm glad to hear that's wrong.

One major problem is that without /usr, you have no termcap file.  You
might want to install e3, which is only 13k statically linked and uses
generic ANSI escape codes so it doesn't need a termcap file.  If run as
e3vi, it acceptes vi keystrokes.

-- 
Dan Nelson
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



RE: A vi for /bin?

2003-01-25 Thread Paul Hoffman
At 1:36 AM + 1/26/03, Petersen wrote:

Paul Hoffman wrote:


 I'm kinda surprised this isn't in the FAQ (or at least not in a place
 that I could find it). It is really impossible to build a vi with no
 external dependencies that can be installed in /bin?


What made you think it was impossible?


The book "FreeBSD" by Anderson (which was highly recommended by some) 
says so on page 371. I'm glad to hear that's wrong.

Assuming you have the object files from a buildworld hanging around, then
cd /usr/obj/usr/src/usr.bin/vi
cc -O -pipe -o vi *.o -lncurses -static && strip vi && mv vi /bin/
should probably supply you with what you want.


Thanks, I'll try that. (I haven't done a buildworld yet...)

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



RE: A vi for /bin?

2003-01-25 Thread Petersen
Paul Hoffman wrote:

> I'm kinda surprised this isn't in the FAQ (or at least not in a place 
> that I could find it). It is really impossible to build a vi with no 
> external dependencies that can be installed in /bin? 

What made you think it was impossible?

> All I want is 
> something that knows how to full-screen edit on the console, nothing 
> else. I dread the day that I can only mount / and not /usr and need 
> to edit fstab or rc.conf, and have to use ed.
> 
> (Just in case the answer is "no, you really can't do that", I have 
> put a plain-text copy of the ed man page in /bin, but still...)
> 

Assuming you have the object files from a buildworld hanging around, then
cd /usr/obj/usr/src/usr.bin/vi
cc -O -pipe -o vi *.o -lncurses -static && strip vi && mv vi /bin/
should probably supply you with what you want.

Petersen

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message