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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
/keys
/.idea
/.vscode
hack/disk/bootloader_util
hack/disk/mbr.bin
9 changes: 9 additions & 0 deletions hack/disk/boot_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"boot_entries": [
{
"partition": 0,
"uki_path": "/EFI/BOOT/BOOTX64.EFI",
"boot_count_enabled": false
}
]
}
17 changes: 17 additions & 0 deletions hack/disk/make.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
disk: hack/disk/bootloader_util hack/disk/mbr.bin
head -c 64M /dev/zero > target/disk
printf 'label: gpt\nstart=2048, type=uefi, name=EFI\n' | /usr/sbin/sfdisk target/disk
mformat -i target/disk@@2048S -F -v EFI ::
mmd -i target/disk@@2048S ::/EFI
mmd -i target/disk@@2048S ::/EFI/BOOT
mcopy -i target/disk@@2048S target/uki.efi ::/EFI/BOOT/BOOTX64.EFI
dd if=hack/disk/mbr.bin of=target/disk bs=446 count=1 conv=notrunc 2> /dev/null
dd if=hack/disk/mbr.bin of=target/disk bs=512 iseek=1 count=2 seek=34 conv=notrunc 2> /dev/null
./hack/disk/bootloader_util target/disk < hack/disk/boot_config.json

hack/disk/bootloader_util:
curl -sSLf https://github.com/nkraetzschmar/bootloader/releases/download/v0.0.1/bootloader_util > '$@'
chmod +x '$@'

hack/disk/mbr.bin:
curl -sSLf https://github.com/nkraetzschmar/bootloader/releases/download/v0.0.1/mbr.bin > '$@'
1 change: 1 addition & 0 deletions hack/hack.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include hack/initramfs/make.mk
include hack/cloud-hypervisor/make.mk
include hack/cloud-hypervisor-firmware/make.mk
include hack/uki/make.mk
include hack/disk/make.mk

container-release:
# make cargo index cache
Expand Down
Loading