WLOG - notes something different

9front

A lot has been published on the 9front project/fork/distro. Especially by the 9front itself. All worth reading.

Until the reading is complete, here are a couple of notes as a quick start or a reminder.

shutdown or reboot

To shutdown or reboot the system you shutdown the filesystem connection.

Shutdown:

fshalt

Reboot:

fshalt -r

Wait till you get a printout either in console or a screen the process has completed.

administration

run command at startup

There is a couple of ways to run a coomand or a program at startup and all stem from either /bin/termrc or /bin/cpurc depending on the service selected at boot.

Where they are put depends if this is a local execution or configured to be run by the cpu server somewhere else. It also depends when in the process the commands will be executed.

local - /bin

To run commands put them in the /bin/termrc.local or /bin/cpurc.local in the form of an rc script.

These files will be called by the respective /bin/termrc or /bin/crprc scripts towards the beginning.

remote - /cfg/SYSNAME

To run commands put them in the /cfg/SYSNAME/termrc or /cfg/SYSNAME/cpurc in the form of an rc script. Here SYSNAME should be replaced with the name of the remote terminal managed by the cpu server. If the name is the name of the cpu server it will run localy on the cpu server.

These files will be called by the respective /bin/termrc or /bin/crprc scripts towards the end.

system install

An install scrit is provided under 9front base instalation / bootable image.

Run it and follow instructions:

inst/start

system update

Updating the 9front system involves rebuilding the entire system from source, since all the updates are distributed through the source tree.

This process involves the following steps:

  1. (optional) cleaning out the source tree (clean OR nuke)
  2. updating the source tree (sysupdate)
  3. building source tree (mk)
  4. building and installing the new kernel (mk AND cp)
  5. (optional) updating documentation (mk)

0. clean out source tree

This step can be skipped since it adds additional time when compiling. But if there are issues compiling the source after updating the source tree, revisit this step.

The source tree can be cleaned or nuked. Clean removes intermediate and object files. Nuke also removes libraries.

Note: recomended usage is nuke, it will take more time to compile, but will also recompile the libraries, which will avoid issues if compiling kernel later.

clean:

cd /sys/src
mk clean

nuke:

cd /sys/src
mk nuke

If there are compiling issues in a specific directory, this can be performed on the specific subdirectory alone.

1. update source tree

To perform this, you have to be the system user.

Run the command sysupdate to pull in the changes.

sysupdate

2 build source tree

To perform this, you have to be the system user.

Make sure all the necessary directories are created, and compile the system source.

cd /
. /sys/lib/rootstub
cd /sys/src
mk install

3. build and install the kernel

To perform this, you have to be the system user.

Compile the new kernel, mount the DOS boot partition, and copy over the new img.

compiling

Go into the correct subdirectory for your architecture.

For 64 bit x86:

cd /sys/src/9/pc64
mk

For 32 bit Raspbberry Pi 1:

cd /sys/src/9/bcm
mk

installing

Mount and copy over the kernel image. Pay attention to the image name, since it has to be the same as in plan9.ini. Don't hesitate to make a backup copy of the old image.

Mount the boot partition

9fs 9fat

The boot partition should now be mounted in the folder /n/9fat.

On some systems, especially if connecting remotely through drawterm, not all devices will be mounted. That will cause the 9fscommand to fail.

Bind the missing devices to your terminal namespace and repeat the 9fs command.

If desired, create a backup of the current image and then copy over the new image. Alternately, the new image can be copied over with a new name, and the plan9.ini file can be edited.

For 64 bit x86:

cd /n/9fat
# here create a backup copy if desired
cp /sys/src/9/pc64/9pc64 .

For 32 bit Raspbberry Pi 1:

cd /n/9fat
# here create a backup copy if desired
cp /sys/src/9/bcm/9pi .

reboot the system

You need to properly shut down or reboot the system, so file system operations get synced and everything is unmounted properly.

Reboot:

fshalt -r

4 rebuild documentation

To perform this, you have to be the system user.

Go into the subdirectory for documentation and run mk script to rebuild it

cd /sys/man
mk
cd /sys/doc
mk

links