summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-02-26 20:39:40 +0000
committerphk <phk@FreeBSD.org>1995-02-26 20:39:40 +0000
commitd773cfca4531516a15a696040d35192e4dfe6808 (patch)
tree407c1b48c5535a8cb59759b73657f142236e473a /sbin
parent1dd481b8d7851f558c5cc6fec2065727877ba7b0 (diff)
downloadFreeBSD-src-d773cfca4531516a15a696040d35192e4dfe6808.zip
FreeBSD-src-d773cfca4531516a15a696040d35192e4dfe6808.tar.gz
The things you have to go through some times! Add a minimal program to
read a termcap entry, since tset is picky about filedescriptors...
Diffstat (limited to 'sbin')
-rw-r--r--sbin/sysinstall/Makefile12
-rw-r--r--sbin/sysinstall/rtermcap.c14
2 files changed, 22 insertions, 4 deletions
diff --git a/sbin/sysinstall/Makefile b/sbin/sysinstall/Makefile
index 768cf74..d141faa 100644
--- a/sbin/sysinstall/Makefile
+++ b/sbin/sysinstall/Makefile
@@ -1,6 +1,7 @@
PROG = sysinstall
MANEXT = 1
NOMAN= yet
+CLEANFILES= makedevs.c rtermcap
.PATH: ${.CURDIR}/../disklabel
@@ -18,7 +19,7 @@ BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot/obj
BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot
.endif
-makedevs.c: dev2c.sh Makefile
+makedevs.c: dev2c.sh Makefile rtermcap
mkdir -p dev
cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev
( cd dev; sh ./MAKEDEV all )
@@ -32,16 +33,19 @@ makedevs.c: dev2c.sh Makefile
< ${BOOTS}/boot1 >> makedevs.tmp
file2c 'const unsigned char boot2[] = {' '};' \
< ${BOOTS}/boot2 >> makedevs.tmp
- tset -Q -S cons25 | sed 's/^.* //' | \
+ ./rtermcap cons25 | \
file2c 'const char termcap_cons25[] = {' ',0};' \
>> makedevs.tmp
- tset -Q -S cons25-m | sed 's/^.* //' | \
+ ./rtermcap cons25-m | \
file2c 'const char termcap_cons25_m[] = {' ',0};' \
>> makedevs.tmp
- tset -Q -S vt100 | sed 's/^.* //' | \
+ ./rtermcap vt100 | \
file2c 'const char termcap_vt100[] = {' ',0};' \
>> makedevs.tmp
mv makedevs.tmp makedevs.c
+rtermcap: ${.CURDIR}/rtermcap.c
+ ${CC} -o rtermcap ${.CURDIR}/rtermcap.c -ltermcap
+
.include <bsd.prog.mk>
diff --git a/sbin/sysinstall/rtermcap.c b/sbin/sysinstall/rtermcap.c
new file mode 100644
index 0000000..3f18e8b
--- /dev/null
+++ b/sbin/sysinstall/rtermcap.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include <termcap.h>
+
+int
+main(int argc, char **argv)
+{
+ char buf[4096];
+ int i;
+
+ i = tgetent(buf, argv[1]);
+
+ printf("%s",buf);
+ return 0;
+}
OpenPOWER on IntegriCloud