Skip to content
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
3 changes: 1 addition & 2 deletions hack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This directory includes scripts to run FeOS as the pid 1 process within a VM.
make build-container
make kernel
make initramfs
make ucode
make uki

# create `vm-br0` bridge on your machine:
Expand Down Expand Up @@ -41,5 +42,3 @@ If you want to run FeOS within a [cloud-hypervisor](https://www.cloudhypervisor.
--kernel target/kernel/vmlinuz \
--initramfs target/initramfs.zst \
--cmdline "`cat target/cmdline`"


4 changes: 3 additions & 1 deletion hack/build-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
libprotobuf-dev \
sbsigntool python3-pefile systemd-boot \
musl-tools \
ca-certificates
ca-certificates \
iucode-tool \
libarchive-tools

RUN cargo new xyz; cd xyz; cargo fetch; cd ..; rm -rf xyz
RUN rustup component add clippy
Expand Down
1 change: 1 addition & 0 deletions hack/hack.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SHELL := /bin/bash
include hack/build-container/make.mk
include hack/kernel/make.mk
include hack/initramfs/make.mk
include hack/ucode/make.mk
include hack/cloud-hypervisor/make.mk
include hack/cloud-hypervisor-firmware/make.mk
include hack/uki/make.mk
Expand Down
2 changes: 2 additions & 0 deletions hack/ucode/make.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ucode:
docker run --rm -u $${UID} -v "`pwd`:/feos" feos-builder ./hack/ucode/mk-ucode
25 changes: 25 additions & 0 deletions hack/ucode/mk-ucode
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -exuo pipefail

mkdir -p target
target_dir="$(realpath target)"

on_exit() {
cd /
[ -z "${tmp_dir-}" ] || rm -rf "$tmp_dir"
}

trap on_exit EXIT

tmp_dir="$(mktemp -d)"
cd "$tmp_dir"

git clone --depth 1 https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files.git intel-microcode
git clone --depth 1 https://gitlab.com/kernel-firmware/linux-firmware.git linux-firmware

mkdir -p kernel/x86/microcode
iucode_tool --write-to=kernel/x86/microcode/GenuineIntel.bin intel-microcode/intel-ucode
cat linux-firmware/amd-ucode/microcode_amd*.bin > kernel/x86/microcode/AuthenticAMD.bin

bsdtar --uid 0 --gid 0 -cf - kernel | bsdtar -cf - --format=newc @- > "$target_dir/ucode.cpio"
1 change: 1 addition & 0 deletions hack/uki/make.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ uki: keys
--os-release @/feos/hack/uki/os-release.txt \
--linux /feos/target/kernel/vmlinuz \
--initrd /feos/target/initramfs.zst \
--microcode /feos/target/ucode.cpio \
--cmdline @/feos/target/cmdline \
--secureboot-private-key /feos/keys/secureboot.key \
--secureboot-certificate /feos/keys/secureboot.pem \
Expand Down