make /n/other work

This commit is contained in:
cinap_lenrek 2011-04-29 12:50:51 +00:00
parent eb7a73034c
commit 840b3bf28a
3 changed files with 19 additions and 21 deletions

View file

@ -12,7 +12,7 @@ mkdir bin bin/rc bin/mips bin/386 bin/power bin/arm
mkdir lib tmp mkdir lib tmp
chmod +t tmp chmod +t tmp
# try to create tmp space on other # try to create tmp space on other
9fs other >/dev/null >[2=1] && \ mount -C /srv/cwfs /n/other other >/dev/null >[2=1] && \
mkdir -m 775 /n/other/usr/$user >/dev/null >[2=1] && \ mkdir -m 775 /n/other/usr/$user >/dev/null >[2=1] && \
mkdir -m 750 /n/other/usr/$user/tmp >/dev/null >[2=1] && \ mkdir -m 750 /n/other/usr/$user/tmp >/dev/null >[2=1] && \
bind -c /n/other/usr/$user/tmp $home/tmp bind -c /n/other/usr/$user/tmp $home/tmp
@ -24,6 +24,8 @@ auth/cron -c
cat > lib/profile <<! cat > lib/profile <<!
bind -a $x^home/bin/rc /bin bind -a $x^home/bin/rc /bin
bind -a $x^home/bin/$x^cputype /bin bind -a $x^home/bin/$x^cputype /bin
mount -qC /srv/cwfs /n/other other
bind -qc /n/other/usr/$x^user/tmp $x^home/tmp
bind -c $x^home/tmp /tmp bind -c $x^home/tmp /tmp
font = /lib/font/bit/pelm/euro.9.font font = /lib/font/bit/pelm/euro.9.font
switch($x^service){ switch($x^service){
@ -48,7 +50,6 @@ case cpu
prompt=('cpu% ' ' ') prompt=('cpu% ' ' ')
fn cpu%{ $x^* } fn cpu%{ $x^* }
startupasfs startupasfs
news
if (! test -e /mnt/term/mnt/wsys) { if (! test -e /mnt/term/mnt/wsys) {
# cpu call from drawterm # cpu call from drawterm
font=/lib/font/bit/pelm/latin1.8.font font=/lib/font/bit/pelm/latin1.8.font
@ -59,7 +60,6 @@ case cpu
case con case con
prompt=('cpu% ' ' ') prompt=('cpu% ' ' ')
startupasfs startupasfs
news
} }
! !
cat > lib/plumbing <<! cat > lib/plumbing <<!

View file

@ -7,9 +7,9 @@ extern int oldcachefmt;
Map *devmap; Map *devmap;
int sfd, rfd;
Biobuf bin; Biobuf bin;
int chatty = 0; int chatty = 0;
int sfd = -1;
void void
machinit(void) machinit(void)
@ -177,23 +177,23 @@ postservice(void)
if(service[0] == 0) if(service[0] == 0)
panic("no service name"); panic("no service name");
if(sfd < 0){ /* serve 9p for -s */
if(pipe(p) < 0) if(sfd >= 0){
panic("can't make a pipe"); srvchan(sfd, "stdio");
sfd = p[0]; sfd = -1;
rfd = p[1];
} }
/* post 9p service */ /* post 9p service */
snprint(buf, sizeof(buf), "#s/%s", service);
srvfd(buf, 0666, sfd);
close(sfd);
srvchan(rfd, buf);
if(pipe(p) < 0) if(pipe(p) < 0)
panic("can't make a pipe"); panic("can't make a pipe");
snprint(buf, sizeof(buf), "#s/%s", service);
srvfd(buf, 0666, p[0]);
close(p[0]);
srvchan(p[1], buf);
/* post cmd service */ /* post cmd service */
if(pipe(p) < 0)
panic("can't make a pipe");
snprint(buf, sizeof(buf), "#s/%s.cmd", service); snprint(buf, sizeof(buf), "#s/%s.cmd", service);
srvfd(buf, 0220, p[0]); srvfd(buf, 0220, p[0]);
close(p[0]); close(p[0]);
@ -294,8 +294,6 @@ main(int argc, char **argv)
machinit(); machinit();
conf.confdev = "/dev/sdC0/fscache"; conf.confdev = "/dev/sdC0/fscache";
rfd = sfd = -1;
ARGBEGIN{ ARGBEGIN{
case 'a': /* announce on this net */ case 'a': /* announce on this net */
ann = EARGF(usage()); ann = EARGF(usage());
@ -310,8 +308,8 @@ main(int argc, char **argv)
strcpy(service, EARGF(usage())); strcpy(service, EARGF(usage()));
break; break;
case 's': case 's':
sfd = dup(0, -1); dup(0, -1);
rfd = dup(1, -1); sfd = dup(1, -1);
close(0); close(0);
if(open("/dev/cons", OREAD) < 0) if(open("/dev/cons", OREAD) < 0)
open("#c/cons", OREAD); open("#c/cons", OREAD);

View file

@ -1,6 +1,8 @@
bind -a $home/bin/rc /bin bind -a $home/bin/rc /bin
bind -a $home/bin/$cputype /bin bind -a $home/bin/$cputype /bin
bind -c tmp /tmp mount -qC /srv/cwfs /n/other other
bind -qc /n/other/usr/$user/tmp $home/tmp
bind -c $home/tmp /tmp
if(! syscall create /tmp/xxx 1 0666 >[2]/dev/null) if(! syscall create /tmp/xxx 1 0666 >[2]/dev/null)
ramfs # in case we're running off a cd ramfs # in case we're running off a cd
font = /lib/font/bit/pelm/euro.9.font font = /lib/font/bit/pelm/euro.9.font
@ -26,12 +28,10 @@ case cpu
bind -a /mnt/term/dev /dev bind -a /mnt/term/dev /dev
prompt=('cpu% ' ' ') prompt=('cpu% ' ' ')
fn cpu%{ $* } fn cpu%{ $* }
news
if (! test -e /mnt/term/mnt/wsys) { # cpu call from drawterm if (! test -e /mnt/term/mnt/wsys) { # cpu call from drawterm
font=/lib/font/bit/pelm/latin1.8.font font=/lib/font/bit/pelm/latin1.8.font
exec rio exec rio
} }
case con case con
prompt=('cpu% ' ' ') prompt=('cpu% ' ' ')
news
} }