From 8df9b36e3d8968e5c72a2577763ba9dd0ce9cc92 Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Sun, 14 Apr 2024 06:04:44 +0000 Subject: [PATCH] fix: use nproc in kernel build script for default jobs, and fix DEV.md guide --- DEV.md | 12 +++++++++--- hack/kernel/build.sh | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/DEV.md b/DEV.md index aff5e3f..b6ed1b6 100644 --- a/DEV.md +++ b/DEV.md @@ -31,12 +31,18 @@ it's corresponding code path from the above table. 2. Install required packages: ```sh -$ apt install git xen-system-amd64 flex bison libelf-dev libssl-dev bc protobuf-compiler libprotobuf-dev squashfs-tools erofs-utils +$ apt install git xen-system-amd64 build-essential libclang-dev musl-tools flex bison libelf-dev libssl-dev bc protobuf-compiler libprotobuf-dev squashfs-tools erofs-utils ``` - 3. Install [rustup](https://rustup.rs) for managing a Rust environment. +Make sure to install the targets that you need for krata: + +```sh +$ rustup target add x86_64-unknown-linux-gnu +$ rustup target add x86_64-unknown-linux-musl +``` + 4. Configure `/etc/default/grub.d/xen.cfg` to give krata guests some room: ```sh @@ -48,7 +54,7 @@ After changing the grub config, update grub: `update-grub` Then reboot to boot the system as a Xen dom0. -You can validate that Xen is setup by running `xl info` and ensuring it returns useful information about the Xen hypervisor. +You can validate that Xen is setup by running `dmesg | grep "Hypervisor detected"` and ensuring it returns a line like `Hypervisor detected: Xen PV`, if that is missing, the host is not running under Xen. 5. Clone the krata source code: ```sh diff --git a/hack/kernel/build.sh b/hack/kernel/build.sh index 121d2b6..48d127d 100755 --- a/hack/kernel/build.sh +++ b/hack/kernel/build.sh @@ -26,7 +26,7 @@ KERNEL_SRC="${KERNEL_DIR}/linux-${KERNEL_VERSION}-${TARGET_ARCH_STANDARD}" if [ -z "${KRATA_KERNEL_BUILD_JOBS}" ] then - KRATA_KERNEL_BUILD_JOBS="2" + KRATA_KERNEL_BUILD_JOBS="$(nproc)" fi if [ ! -f "${KERNEL_SRC}/Makefile" ]