Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOISSUE - Enhance docs #34

Merged
merged 28 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hal/buildroot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ To build the HAL for Linux, you need to install [Buildroot](https://buildroot.or

After following the steps in [README.md](./linux/README.md), you will have bzImage and rootfs.cpio.gz files.

Next we need to create a filesystem image. We will use `mkfs.ext4` to create the filesystem image.
Next we need to create a filesystem image. We will use `mkfs.ext4` to create the filesystem image. To do so, run the following command from `~/cube/hal/buildroot` directory:

```bash
dd if=/dev/zero of=rootfs.img bs=1M count=30720
mkfs.ext4 ./rootfs.img
```

Now we can run the QEMU VM with the filesystem image.
Now we can run the QEMU VM with the filesystem image from `~/cube/hal` directory.

```bash
sudo bash buildroot/qemu.sh start_cvm
Expand Down
43 changes: 42 additions & 1 deletion hal/buildroot/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,53 @@ Cube HAL for Linux is framework for building custom in-enclave Linux distributio

HAL uses [Buildroot](https://buildroot.org/)'s [_External Tree_ mechanism](https://buildroot.org/downloads/manual/manual.html#outside-br-custom) for building custom distro:

### Step 1: Clone the Buildroot Repository

First, download the Buildroot source code from its repository.

```bash
git clone https://gitlab.com/buildroot.org/buildroot.git
```

### Step 2: Clone the Cube Project Repository

Next, download the Cube project, which will be used as an external layer in Buildroot.
rodneyosodo marked this conversation as resolved.
Show resolved Hide resolved

```bash
git clone https://github.com/ultravioletrs/cube.git
```

### Step 3: Go to the Buildroot Directory

```bash
cd buildroot
```

### Step 4: Set Up the Build Configuration

Run the following command to configure Buildroot with settings from the Cube project.

```bash
make BR2_EXTERNAL=../cube/hal/buildroot/linux cube_defconfig
# Execute 'make menuconfig' only if you want to make additional configuration changes to Buildroot.
```

- `BR2_EXTERNAL=../cube/hal/buildroot/linux`: Tells Buildroot to use the external configuration files from the Cube project located at `../cube/hal/buildroot/linux`.
- `cube_defconfig`: Loads the default configuration for Cube. This sets up Buildroot with settings that are specific to the Cube project.

### Step 5 (Optional): Make Additional Configuration Changes

If you want to adjust any settings manually, you can run the following command to customize the Buildroot configuration:

```bash
make menuconfig
```

This step is optional. If you don’t need to make any changes, you can skip it.

### Step 6: Build the Project

Finally, build the project by running:

```bash
make
```