wm: doc

ref: 453b9bd07592f8d40329b43971ab0ea3d419c6c4
dir: /cpu-p9.ms/

View raw version
Configuring the cpu server for plan 9

First add your user to the adm group. See fossil-p9.

Afterwards, set your timezone, see timezone-p9.ms.

Next, make sure to configure your network information. See ndb-p9.ms.

term% mkdir /cfg/$sysname/
term% dircp /cfg/example /cfg/$sysname/

Then, edit /cfg/$sysname/cpurc to uncomment this line:

# ip/ipconfig -g your-gateway ether /net/ether0 your-ip-address your-subnet-mask

Note: You may also want to copy this to /cfg/$sysname/termrc and also to run the
command manually, because by default, plan 9 runs as a terminal service. It will not
run as a cpu service until the cpu kernel has been compiled as described below.

Note: You *must* run ip/ipconfig before running ndb/dns (and possibly other
network services). Otherwise, you might see errors like:

ndb/dns: can't read my ip address

term% auth/wrkey
bad authentication password
bad authentication id
bad authentication domain
authid: glenda
authdom: fork.inter9.org
auth password:
secstore password:

Make sure to configure the auth server, see auth-p9.ms.

Build the cpu kernel:

cd /sys/src/9/pc
mk 'CONF=pccpuf'
term% 9fat:
term% cp /sys/src/9/pc/9pccpuf /n/9fat/
Add these lines to the beginning of /n/9fat/plan9.ini

[menu]
menuitem=cpu, Plan 9 CPU Kernel
menuitem=terminal, Plan 9 Terminal Kernel
menudefault=cpu, 10

[cpu]
bootfile=sdC0/!9fat!9pccpuf

[terminal]
bootfile=sdC0!9fat!9pcf

[common]
nobootprompt=local!#S/sdC0/fossil

Make sure to replace sdC0 with your actual disk.
Make sure also to delete the pre-existing line:

bootfile=sdC0!9fat!9pcf

Clear nvram and then set a new password:

term% echo garbage >/dev/sdC0/nvram

Remember to replace sdC0 with your actual hard disk.

Set the password:

term% auth/keyfs

Add the hostowner bootes to sys and adm groups:

term% con -Cl /srv/fscons
prompt: uname bootes bootes
prompt: uname sys +bootes
prompt: uname adm +bootes
prompt: fsys main
main: create /active/cron/bootes bootes bootes d775
main: create /active/sys/log/cron bootes bootes a664

Append these lines to the bottom of /lib/ndb/auth:

hostid=bootes
       uid=!sys uid=!adm uid=*

You may need to reboot and login as hostowner (bootes) in order for
the next step to work.

If you do reboot, select 1 for Plan 9 CPU Kernel:

Plan 9 Startup Menu:
====================
    1. Plan 9 CPU Kernel
    2. Plan 9 Terminal Kernel
Selection[default==1 (10s timeout)]: 1

When prompted, fill in the following values:

authid: bootes
authdom: example.com
auth password:
secstore password:

Change the hostowner's password:

term% auth/keyfs
term% auth/changeuser bootes

If you are using 9front drawterm and want to connect in text-only mode
(no graphics) with the -G flag, you will need to edit $home/lib/profile
to remove calls to rio. Comment out line 31:

#		exec rio

You can run the below command:

term% mv (/usr/$user/lib/)^(profile profile.bak)
term% sed '31s/^/#/' /usr/$user/lib/profile.bak > /usr/$user/lib/profile

Then afterwards, you will be able to connect with drawterm -G as
follow:

$ drawterm -u $USER -h $SYSNAME -G