From e1119e9dec93c4a505e6467dd35509a585630d51 Mon Sep 17 00:00:00 2001 From: Juuso Haavisto Date: Sun, 25 Apr 2021 15:32:18 +0300 Subject: [PATCH] README revisions --- README.md | 36 ++++++++++++++++++++++++++++------ http-server/README.md | 7 ++++--- http-server/ignition/README.md | 9 +++++++++ 3 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 http-server/ignition/README.md diff --git a/README.md b/README.md index 834b891..34bb981 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,35 @@ # stateless-fcos -Booting live Fedora CoreOS via iPXE +## Booting live Fedora CoreOS via iPXE -Once upon a time I ran CoreOS machines. Then, CoreOS got bought by RedHat. Then, RedHat got bought by IBM. I was quite happy with it all since I owned RedHat shares. +Once upon a time I ran CoreOS machines. Then, CoreOS got bought by RedHat. Then, RedHat got bought by IBM. I was quite happy with it all. I owned RedHat shares. -Some time after, CoreOS also became Fedora CoreOS. As I evolved my own infra, I found about live booting via iPXE, so I put together an infra. +Next, CoreOS became Fedora CoreOS. When I upgraded to Fedora CoreOS, I found about live booting via iPXE. This was such a hassle that I put up this repository. -This project has all the files for a computer to mimic a router. This is because in my case the inner network is as follows: +## Introduction: + +We want to make a boot sequence as follows: + +BIOS -> PXE -> iPXE -> Fedora CoreOS + +This happens roughly as follows: + +``` +[Client] [Server] +1. BIOS +2. PXE -> DHCP +3. iPXE <- iPXE image (`undionly.kpxe`) +4. REQ TFTP -> TFTP server +5. iPXE BOOT <- Fedora CoreOS initramfs,kernel +6. REQ Ignition -> HTTP server +7. Fedora CoreOS <- Ignition file, Fedora CoreOS rootfs +8. Successful RAM boot +``` + +To prepare for successful RAM boot, you may start from `dhcpd` folder. + +## Background + +My infra is as follows: ``` pfSense router [1]-[2]-[3]-[4] @@ -16,6 +40,6 @@ pfSense router [1]-[2]-[3]-[4] "peli" [1] ``` -The idea is that the router has four ports, of which one goes to a node called "muro", which has two ports, of which one goes to a node called "peli". This project has files so that a) "muro" can share the upstream network to "peli" and b) "peli" can boot from "muro", which in itself boots from pfSense. +In other words, my router has four ports. Port 4 goes to a computer `muro` which has two ports. Muro shares WAN and pfSense LAN connection to `peli`. -Throughout the README, the host computer to which the packages are installed is supposed to be "muro" and the computer which is booting PXE is "peli". \ No newline at end of file +`muro` boots CoreOS from pfSense. `peli` boots CoreOS from `muro`. This project demonstrates how `peli` boots from `muro`. As such, throughout the READMEs the packages are installed on `muro` and the computer which is booting PXE is `peli`. \ No newline at end of file diff --git a/http-server/README.md b/http-server/README.md index faec503..bef58e5 100644 --- a/http-server/README.md +++ b/http-server/README.md @@ -10,8 +10,9 @@ BIOS -> PXE -> iPXE -> **Fedora CoreOS** Any HTTP server will do, but here is one in Python: -1. `podman run -it --cap-add NET_ADMIN --net=host -v $(pwd):/mnt/coreos:Z ubuntu` -2. `apt update && apt install python3` -3. `python3 -m http.server 8014` +1. Look into `ignition/` to see how to produce Ignition files from Butane files. +2. `podman run -it --cap-add NET_ADMIN --net=host -v $(pwd):/mnt/coreos:Z ubuntu` +3. `apt update && apt install python3` +4. `python3 -m http.server 8014` Leave this server open, and boot into PXE on another computer. The computer should now boot into login prompt of Fedora CoreOS. If you can now close all the containers created during these steps unless you plan on booting more nodes. \ No newline at end of file diff --git a/http-server/ignition/README.md b/http-server/ignition/README.md new file mode 100644 index 0000000..e689209 --- /dev/null +++ b/http-server/ignition/README.md @@ -0,0 +1,9 @@ +# ignition + +### How-to use + +1. Specify Butane files in .bu +2. Acquire Butane-to-Ignition compiler, see, e.g. https://docs.fedoraproject.org/en-US/fedora-coreos/producing-ign/ +3. `butane --pretty --strict < example.bu > example.ign` +4. Ensure that the Ignition filename corresponds to that listed in `/ipxe` folder's `.ipxe` files. +5. Start the http-server found in the parent folder. \ No newline at end of file