Skip to content

Commit

Permalink
freebsd: Document how to build on FreeBSD
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Schaefer <[email protected]>
  • Loading branch information
JohnAZoidberg committed Aug 6, 2024
1 parent 2e30627 commit e4892be
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ cargo build -p framework_tool
ls -l target/debug/framework_tool

# Build the UEFI application
# Needs mtools installed via your OS package manager
# See in FreeBSD section for building on FreeBSD
# Can't be built with cargo! That's why we need to exclude it in the other commands.
make -C framework_uefi
ls -l framework_uefi/build/x86_64-unknown-uefi/boot.efi
Expand Down Expand Up @@ -311,3 +313,14 @@ cargo build --no-default-features --features freebsd
# Running the tool
cargo run --no-default-features --features freebsd
```

Build UEFI tool

```
# Build just tool
gmake -C framework_uefi build/x86_64-unknown-uefi/boot.efi
# Build QEMU image
# TODO: Does not work yet, need a replacement for GNU parted
gmake -C framework_uefi MKFS=newfs_msdos
```
4 changes: 3 additions & 1 deletion framework_uefi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ BUILD=build/$(TARGET)

SRC_DIR=.

MKFS=mkfs.vfat

QEMU?=qemu-system-x86_64
QEMU_FLAGS=\
-M q35 \
Expand Down Expand Up @@ -33,7 +35,7 @@ $(BUILD)/boot.img: $(BUILD)/efi.img
# Create filesystem with updater (bootx64.efi)
$(BUILD)/efi.img: $(BUILD)/boot.efi
dd if=/dev/zero of=$@.tmp bs=512 count=98304
mkfs.vfat $@.tmp
$(MKFS) $@.tmp
mmd -i $@.tmp efi
mmd -i $@.tmp efi/boot
mcopy -i $@.tmp $< ::efi/boot/bootx64.efi
Expand Down

0 comments on commit e4892be

Please sign in to comment.