summaryrefslogtreecommitdiff
path: root/image.sh
blob: 7d32df4b852b67c5e0eb55be4de315e6cc156c66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

imagefile=uefi.img
loaderfile=loader/loader.efi
kernelfile=kernel/kernel.os

if [[ ! -f ${imagefile} ]]; then
    dd if=/dev/zero of=${imagefile} bs=1024 count=1440
    mformat -i uefi.img -f1440 ::
fi

mmd -i ${imagefile} -Do ::EFI
mmd -i ${imagefile} -Do ::EFI/BOOT
mcopy -i ${imagefile} -Do ${loaderfile} ::EFI/BOOT/BOOTX64.EFI
mmd -i ${imagefile} -Do ::adasoft
mmd -i ${imagefile} -Do ::adasoft/sophia
mcopy -i ${imagefile} ${kernelfile} -Do ::adasoft/sophia