-
Notifications
You must be signed in to change notification settings - Fork 1
Host configuration
Since poudriere-remote.sh requires root access via sudo to a remote host to automatically bootstrap Poudriere and build packages, some users might prefer to create a Poudriere host manually. In such case, you can follow these instructions:
-
Install FreeBSD with an additional disk for a zpool (let's call it mydisk0).
We tested a VMDK snapshot image for amd64 14.0-CURRENT.
-
Create a user (let's call it myuser) and log in the host as the user.
-
Create a zpool zdata.
sudo zpool create zdata mydisk0
-
Create file systems for CHERI and Poudriere.
sudo zfs create zdata/cheri sudo zfs create zdata/distfiles sudo zfs create zdata/poudriere
-
Set the owner of new directories to your user.
sudo chown myuser /zdata/cheri /zdata/distfiles /zdata/poudriere
-
Install cheribuild dependencies.
sudo pkg install \ autoconf \ automake \ bash \ cmake \ git \ glib \ gmake \ gsed \ libtool \ ninja \ pixman \ pkgconf \ python3 \ texinfo
-
Install Poudriere dependencies.
sudo pkg install poudriere nginx
-
Clone cheribuild with the user mode support.
git clone --branch qemu-cheri-bsd-user https://github.com/CTSRD-CHERI/cheribuild.git /zdata/cheri/cheribuild
-
Build the CheriABI BSD user mode.
/zdata/cheri/cheribuild/cheribuild.py --source-root /zdata/cheri bsd-user-qemu
-
Build a pure-capability CheriBSD.
- Morello (aarch64c):
/zdata/cheri/cheribuild/cheribuild.py --source-root /zdata/cheri --no-skip-sdk --qemu/no-use-smbd --morello-qemu/no-use-smbd sdk-morello-purecap
- Morello (aarch64):
/zdata/cheri/cheribuild/cheribuild.py --source-root /zdata/cheri --no-skip-sdk --qemu/no-use-smbd --morello-qemu/no-use-smbd sdk-aarch64
- For CHERI-RISC-V (riscv64c):
/zdata/cheri/cheribuild/cheribuild.py --source-root /zdata/cheri --no-skip-sdk --qemu/no-use-smbd sdk-riscv64-purecap
- Morello (aarch64c):
-
Update the built sysroot to be owned by root:wheel.
sudo chown -R root:wheel /zdata/cheri/output/rootfs-*
-
Clone the poudriere-infrastructure repository.
git clone https://github.com/CTSRD-CHERI/poudriere-infrastructure.git /zdata/cheri/poudriere-infrastructure
-
Create symbolic links for configuration files from the poudriere-infrastructure repository.
cd /zdata/cheri/poudriere-infrastructure find etc usr -type f -o -type l | xargs -I % -S 1024 sudo sh -c 'mkdir -p "/$(dirname %)"; ln -s "$(realpath . )/%" "/%"'
Examine ln(1) errors as some files might already exist. In such case, remove or move them aside, and execute the above command again.
-
Copy jail files from this repository.
cd /zdata/cheri/poudriere-infrastructure find zdata -type f -o -type l | xargs -I % -S 1024 sudo sh -c 'mkdir -p "/$(dirname "%")"; cp -a "%" "/%"'
-
Move the pure-capability rtld aside to make space for an amd64 rtld.
- For Morello (aarch64c):
mv /zdata/cheri/output/rootfs-morello-purecap/libexec/ld-elf.so.1 /zdata/cheri/output/rootfs-morello-purecap/libexec/ld-aarch64c-elf.so.1 cp /libexec/ld-elf.so.1 /zdata/cheri/output/rootfs-morello-purecap/libexec/ld-elf.so.1
- For Morello (aarch64):
mv /zdata/cheri/output/rootfs-aarch64/libexec/ld-elf.so.1 /zdata/cheri/output/rootfs-aarch64/libexec/ld-aarch64-elf.so.1 cp /libexec/ld-elf.so.1 /zdata/cheri/output/rootfs-aarch64/libexec/ld-elf.so.1
- For CHERI-RISC-V (riscv64c):
mv /zdata/cheri/output/rootfs-riscv64-purecap/libexec/ld-elf.so.1 /zdata/cheri/output/rootfs-riscv64-purecap/libexec/ld-riscv64c-elf.so.1 cp /libexec/ld-elf.so.1 /zdata/cheri/output/rootfs-riscv64-purecap/libexec/ld-elf.so.1
- For Morello (aarch64c):
-
Configure binmiscctl(8).
sudo service qemu_user_static start
-
Create a jail.
- For Morello (aarch64c):
sudo poudriere jail -c -j cheribsd-morello-purecap -v 14.0-CURRENT -a arm64.aarch64c -m null -M /zdata/cheri/output/rootfs-morello-purecap
- For Morello (aarch64):
sudo poudriere jail -c -j cheribsd-aarch64 -v 14.0-CURRENT -a arm64.aarch64 -m null -M /zdata/cheri/output/rootfs-aarch64
- For CHERI-RISC-V (riscv64c):
sudo poudriere jail -c -j cheribsd-riscv64-purecap -v 14.0-CURRENT -a riscv.riscv64c -m null -M /zdata/cheri/output/rootfs-riscv64-purecap
- For Morello (aarch64c):
-
Create a ports tree.
- If you don't want to modify ports:
sudo poudriere ports -c -p main -m git -U https://github.com/CTSRD-CHERI/cheribsd-ports.git -B main
- If you want to modify ports on your host, we recommend to clone a repository:
and import it as a ports tree:
git clone [email protected]:CTSRD-CHERI/cheribsd-ports.git /path/to/cheribsd-ports
sudo poudriere ports -c -p main -m null -M /path/to/cheribsd-ports
- If you don't want to modify ports:
-
Start nginx to browse Poudriere reports.
sudo service nginx start
-
Start a test package build.
- For Morello (aarch64c):
sudo poudriere bulk -j cheribsd-morello-purecap -p main ports-mgmt/pkg
- For Morello (aarch64):
sudo poudriere bulk -j cheribsd-aarch64 -p main ports-mgmt/pkg
- For CHERI-RISC-V (riscv64c):
sudo poudriere bulk -j cheribsd-riscv64-purecap -p main ports-mgmt/pkg
- For Morello (aarch64c):
-
Open
http://<host>/
to observe a build status in your browser. -
Your package repository should be accessible with:
- For Morello (aarch64c):
pkg+http://<host>/packages/cheribsd-morello-purecap-main/
- For Morello (aarch64):
pkg+http://<host>/packages/cheribsd-aarch64-main/
- For CHERI-RISC-V (riscv64c):
pkg+http://<host>/packages/cheribsd-riscv64-purecap-main/
- For Morello (aarch64c):