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

cleanup formatting, fix build issues and add more extensive docs #33

Open
wants to merge 7 commits into
base: rel_v1.1.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ ansible-venv
*.retry
results
rootfs
ansible.log
72 changes: 48 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pxe-server
==========
# pxe-server

This repository contains PXE server (TFTP+NFS) that should help in installing,
testing and developing operating systems and firmware for PXE-capable
Expand All @@ -10,11 +9,12 @@ It was inspired by effort required to test PC Engines apu2 platform.
We use PXE server without DHCP, what may cause problems to BSD systems and is
subject of our further work on this project.

Usage
-----
## Usage

<!--
# pxe-server deployment

TBD: what is to goal of following deployment procedure?
## Ansible setup

```
Expand All @@ -30,9 +30,37 @@ ssh-copy-id -i ~/.ssh/ansible <user>@<target_host>

## Initial deployment

### Rootfs components creation
-->

### Required containers creation

Before anything below will work you need some containers used further in the
process.

#### Build apt-cacher

```bash
./apt-cacher/build.sh
```

#### Run apt-cacher

```bash
docker compose up
```

#### Rootfs builder container

You may want to check `rootfs-builder/Dockerfile` first to confirm you like
Debian base image which would be used.

```bash
./rootfs-builder/build.sh <ip_address>
```

### Rootfs components creation

```bash
docker run --privileged --rm -v $HOME/.ansible:/root/.ansible \
-v $HOME/.ccache:/home/debian/.ccache -v $PWD:/home/debian/scripts \
-t -i 3mdeb/rootfs-builder ansible-playbook -i hosts \
Expand All @@ -41,7 +69,7 @@ docker run --privileged --rm -v $HOME/.ansible:/root/.ansible \

### Rootfs preparation

```
```bash
docker run --privileged --rm -v $HOME/.ansible:/root/.ansible \
-v $HOME/.ccache:/home/debian/.ccache -v $PWD:/home/debian/scripts \
-t -i 3mdeb/rootfs-builder ansible-playbook -i hosts \
Expand All @@ -60,17 +88,16 @@ ansible-playbook -i "<target_host>," -b --ask-become-pass pxe-server.yml

`v1.0.0` tests results:

| Description | Result |
| --- | --- |
| XEN1.2 Verify if IOMMU is enabled | PASS |
| XEN1.4 Verify if IOMMU is enabled on Xen Linux dev | PASS |
| XEN1.5 Verify if IOMMU is enabled on Xen dev | PASS |
| DEB1.1 Debian from iPXE 4.14.y | PASS |
| DEB1.5 Debian from iPXE 4.9.y | PASS |
| TCL1.1 Boot to Core 6.4 booted over iPXE | PASS |
| VOY1.1 Boot into Voyage installer | PASS |
| PFS1.1 pfSense 2.4.x install test | PASS |

| Description | Result |
| -------------------------------------------------- | ------ |
| XEN1.2 Verify if IOMMU is enabled | PASS |
| XEN1.4 Verify if IOMMU is enabled on Xen Linux dev | PASS |
| XEN1.5 Verify if IOMMU is enabled on Xen dev | PASS |
| DEB1.1 Debian from iPXE 4.14.y | PASS |
| DEB1.5 Debian from iPXE 4.9.y | PASS |
| TCL1.1 Boot to Core 6.4 booted over iPXE | PASS |
| VOY1.1 Boot into Voyage installer | PASS |
| PFS1.1 pfSense 2.4.x install test | PASS |

### Performance

Expand Down Expand Up @@ -117,7 +144,6 @@ Playbook run took 0 days, 0 hours, 5 minutes, 9 seconds

====


`init.sh` downloads all necessary files, OS images, PXE and extracts them in
proper directories.

Expand All @@ -128,8 +154,7 @@ Please note that `init.sh` also download prepared Debian boot images. In root
directory of those images you can find `CHANGELOG` document which briefly
describe modifications.

APU2 development and testing
----------------------------
## APU2 development and testing

### Setting up docker container

Expand Down Expand Up @@ -168,7 +193,7 @@ initialization (`NFS_SRV_IP`).
Currently supported options are:

1. `Debian stable netboot` - it is a Debian Stretch rootfs served over nfs with custom
kernel
kernel
2. `Voyage netinst` - a Voyage Linux network installation image
3. `Debian stable netinst` - runs a Debian stable amd64 network installation from external repository
4. `Debian testing netinst` - runs a Debian testing amd64 network installation from external repository
Expand All @@ -182,15 +207,14 @@ Those credentials are visible during boot:
```
Debian GNU/Linux 9 apu2 ttyS0 [root:debian]

apu2 login:
apu2 login:
```

## Robot Framework

Some automation of above process has been prepared. Relevant source code can be
found [here](https://github.com/pcengines/apu-test-suite)


## Issues

I have encountered issues with network interface configuration. The
Expand All @@ -201,7 +225,7 @@ configuration is retrieved from DHCP 3 times:
3. At system startup (defined in /etc/network/interfaces)

> 1 and 2 are necessary, 3 is only needed to get internet connection on booted
system.
> system.

Requesting configuration that many times makes a little mess, so as a temporary
workaround add a static IP for the `net0/eth0` interface on Your DHCP server.
Expand Down
1 change: 1 addition & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[defaults]
callback_whitelist = profile_tasks, profile_roles, timer
log_path=/home/debian/scripts/ansible.log
2 changes: 1 addition & 1 deletion apt-cacher/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# Here, `dockerhost` is the IP address or FQDN of a host running the Docker daemon
# which acts as an APT proxy server.
FROM ubuntu
FROM debian:stable

VOLUME ["/var/cache/apt-cacher-ng"]
RUN apt-get update && apt-get install -y apt-cacher-ng
Expand Down
2 changes: 1 addition & 1 deletion apt-cacher/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker build -t apt-cacher .
docker build -t apt-cacher -f apt-cacher/Dockerfile .
Loading