]> git.lizzy.rs Git - plan9front.git/blob - sys/lib/newuser
let the kernel set dma mode for ata by default
[plan9front.git] / sys / lib / newuser
1 #!/bin/rc
2
3 user=`{cat /dev/user}
4 home=/usr/$user
5 if(test -f $home/lib/profile){
6         echo user directories already made
7         exit no
8 }
9 cd $home
10 x='$'
11 mkdir bin bin/rc bin/mips bin/386 bin/power bin/arm
12 mkdir lib tmp
13 chmod +t tmp
14 bind -c $home/tmp /tmp
15
16 mail -c
17 auth/cron -c
18
19 cat > lib/profile <<!
20 bind -a $x^home/bin/rc /bin
21 bind -a $x^home/bin/$x^cputype /bin
22 bind -c $x^home/tmp /tmp
23 font = /lib/font/bit/pelm/euro.9.font
24 switch($x^service){
25 case terminal
26         plumber
27         startupasfs
28         echo -n accelerated > '#m/mousectl'
29         echo -n 'res 3' > '#m/mousectl'
30         prompt=('term% ' '      ')
31         fn term%{ $x^* }
32         exec rio
33 case cpu
34         if (test -e /mnt/term/mnt/wsys) {
35                 # rio already running
36                 wsys = /mnt/term^`{cat /mnt/term/env/wsys}
37                 bind -a /mnt/term/mnt/wsys /dev
38                 echo -n $x^sysname > /dev/label
39         }
40         bind /mnt/term/dev/cons /dev/cons
41         bind /mnt/term/dev/consctl /dev/consctl
42         bind -a /mnt/term/dev /dev
43         prompt=('cpu% ' '       ')
44         fn cpu%{ $x^* }
45         startupasfs
46         news
47         if (! test -e /mnt/term/mnt/wsys) {
48                 # cpu call from drawterm
49                 font=/lib/font/bit/pelm/latin1.8.font
50                 plumber
51                 auth/factotum
52                 exec rio
53         }
54 case con
55         prompt=('cpu% ' '       ')
56         startupasfs
57         news
58 }
59 !
60 cat > lib/plumbing <<!
61 # to update: cp /usr/$user/lib/plumbing /mnt/plumb/rules
62
63 editor = acme
64
65 include basic
66
67 !
68
69 . lib/profile