-
Notifications
You must be signed in to change notification settings - Fork 88
Install
To build oasis, you need a POSIX system with following tools:
- C toolchain for both host and target system
- target toolchain must support
#include_next
- target toolchain must support
- curl
- git
- gzip (or compatible tool)
- ninja
- rc (plan9-compatible)
- zic
On a Debian-based system, you'll need to install a few packages.
sudo apt install 9base bison curl git ninja-build pax
PATH=$PATH:/usr/lib/plan9/bin
If you plan to build desktop components as well, you'll need a few more.
sudo apt install libwayland-dev libpng-dev
You'll also need a toolchain targeting musl libc. I recommend musl-cross-make if you want to build your own. If not, feel free to use my pre-built toolchain.
git clone '--depth=1' https://github.com/michaelforney/oasis-toolchain
PATH=$PATH:$PWD/oasis-toolchain/bin
You should make sure that your git config has a set user and email (for applying patches).
git config --global user.name $MYNAME
git config --global user.email $MYEMAIL
These instructions use some references to environment variables. You are meant to replace those with appropriate values for your system.
-
EDITOR: Your text editor (e.g.vim). -
DRIVE: Your target disk device (e.g.sda). -
ROOTPART: Your / partition device (e.g.sda2). -
BOOTPART: Your /boot partition device (e.g.sda1). -
TIMEZONE: Your timezone (e.g.US/Pacific). -
ROOT: Mounted root filesystem for target.
First, prepare a root directory for oasis at $ROOT. You should
mount any sub-filesystems you want at this time (for example, /boot).
cd $ROOT
git clone -c 'core.sharedRepository=group' https://github.com/michaelforney/oasis src/oasis
cd src/oasis
Next, configure config.rc to your liking.
cp config.def.rc config.rc
$EDITOR config.rc
Generate the ninja build files.
rc ./setup.rc
Build oasis.
ninja commit
Prepare root repository.
cd $ROOT
git init --template src/oasis/template
git remote add local src/oasis/out/root.git
git fetch local
git checkout master
You may want to include a toolchain.
git remote add toolchain https://github.com/michaelforney/oasis-toolchain
git fetch toolchain '--depth=1'
git branch -t toolchain toolchain/master
git merge --allow-unrelated-histories toolchain
Prepare your /etc directory.
(cd /tmp && curl -LO https://github.com/michaelforney/oasis-etc/archive/master.tar.gz)
zcat /tmp/master.tar.gz | pax -r -s ',^oasis-etc-[^/]*,etc,'
./libexec/applyperms -d etc
rm etc/.perms
It is possible to maintain your /etc directory with git just as /
(set oasis.root=..), but this is not recommended since perp uses the
VTX bit to keep track of active services, and merge conflicts or
permission errors could have disastrous side-effects.
Set up your system configuration.
ln -s ../share/zoneinfo/$TIMEZONE etc/localtime
cat >>etc/fstab <<EOF
/dev/$ROOTPART / ext4 rw,relatime 0 1
/dev/$BOOTPART /boot ext2 rw,relatime,noauto 0 0
EOF
touch var/log/lastlog
Configure /etc/rc.local to do any necessary initialization for your
system (e.g. keymap, networking). This script runs during boot before
starting perp. You may also want to make changes to /etc/profile.
$EDITOR etc/rc.local
$EDITOR etc/profile
The default root password is oasis. If you would like to choose
something else before booting into the system, you should chroot into
the new filesystem and run passwd.
Build/obtain a kernel. By convention, install it at /boot/linux.
For a oasis-specific kernel build procedure, see Kernel.
Feel free to install any bootloader you want.
syslinux is one option that is easy and convenient. On Debian-based
systems, you can install extlinux.
sudo apt install extlinux
For a BIOS system:
mkdir $ROOT/boot/syslinux
extlinux --install $ROOT/boot/syslinux
dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/$DRIVE bs=440
cat >$ROOT/boot/syslinux/syslinux.cfg <<EOF
PROMPT 1
TIMEOUT 50
DEFAULT oasis
LABEL oasis
LINUX ../linux
APPEND root=/dev/$ROOTPART init=/bin/sinit ro
EOF
On an oasis system, if installed, mbr.bin can be found at
/lib/syslinux/bios/mbr.bin.
If your system uses UEFI and you built your kernel with
CONFIG_EFI_STUB=y, you can use efibootmgr to set up a new boot
entry.
efibootmgr -c -d /dev/$DRIVE -p $BOOTPARTNUM -l /linux -L oasis "root=/dev/$BOOTPART init=/bin/sinit ro"
You might also want to enable efibootmgr in your config.rc.
Some common administration tasks are described in Administration.