diff options
author | alex <alex@FreeBSD.org> | 2001-01-20 09:12:55 +0000 |
---|---|---|
committer | alex <alex@FreeBSD.org> | 2001-01-20 09:12:55 +0000 |
commit | f725213b09cfb818cb4c379f21de4dcf56db12d3 (patch) | |
tree | 636608cff25444554df98c1f01cea4b37529303a /release/picobsd/tinyware | |
parent | 19d6e5bb42dd780ccdc64b7aefdcba086e5376ec (diff) | |
download | FreeBSD-src-f725213b09cfb818cb4c379f21de4dcf56db12d3.zip FreeBSD-src-f725213b09cfb818cb4c379f21de4dcf56db12d3.tar.gz |
Make the name of the init script and the interpreter compile time options.
If not defined, default to the old values (with _PATH_BSHELL instead
of "/bin/sh", though).
Reviewed by: markm
Diffstat (limited to 'release/picobsd/tinyware')
-rw-r--r-- | release/picobsd/tinyware/oinit/Makefile | 18 | ||||
-rw-r--r-- | release/picobsd/tinyware/oinit/oinit.c | 15 |
2 files changed, 26 insertions, 7 deletions
diff --git a/release/picobsd/tinyware/oinit/Makefile b/release/picobsd/tinyware/oinit/Makefile index 1fb9b2d..c655bb7 100644 --- a/release/picobsd/tinyware/oinit/Makefile +++ b/release/picobsd/tinyware/oinit/Makefile @@ -1,9 +1,19 @@ # $FreeBSD$ # -PROG=oinit -#CFLAGS+=-DUSE_HISTORY -CFLAGS+=-DOINIT_RC=\"/etc/oinit.rc\" -#LDADD=-lutil -ledit -ltermcap +PROG= oinit + +SH_PATH?= /bin/sh +SH_NAME?= -sh +SH_ARG?= /etc/rc + +CFLAGS= -DSH_PATH=\"${SH_PATH}\" -DSH_NAME=\"${SH_NAME}\" \ + -DSH_ARG=\"${SH_ARG}\" + + +#CFLAGS+= -DUSE_HISTORY +#CFLAGS+= -DOINIT_RC=\"/etc/oinit.rc\" + +#LDADD= -lutil -ledit -ltermcap LDADD=-lutil NOMAN=yes diff --git a/release/picobsd/tinyware/oinit/oinit.c b/release/picobsd/tinyware/oinit/oinit.c index 66b5623..87b2448 100644 --- a/release/picobsd/tinyware/oinit/oinit.c +++ b/release/picobsd/tinyware/oinit/oinit.c @@ -599,6 +599,15 @@ start_session(int vty, int argc, char **argv) * normal /etc/rc interpreted by Bourne shell. */ #ifndef OINIT_RC +#ifndef SH_NAME +#define SH_NAME "-sh" +#endif +#ifndef SH_PATH +#define SH_PATH _PATH_BSHELL +#endif +#ifndef SH_ARG +#define SH_ARG "/etc/rc" +#endif void runcom() { @@ -617,10 +626,10 @@ runcom() dup2(fd,1); dup2(fd,2); if(fd>2) close(fd); - argv[0]="-sh"; - argv[1]="/etc/rc"; + argv[0]=SH_NAME; + argv[1]=SH_ARG; argv[2]=0; - execvp("/bin/sh",argv); + execvp(SH_PATH,argv); printf("runcom(): %s\n",strerror(errno)); _exit(1); } |