2023-05-17 20:20:53 -07:00
|
|
|
#!/us
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [[ $# -ne 1 ]]; then
|
|
|
|
echo "Must specify disk image name."
|
|
|
|
fi
|
|
|
|
|
|
|
|
dd if=/dev/zero of=$1 bs=1M count=200
|
|
|
|
|
|
|
|
dev=$(losetup --find --partscan --show $1)
|
|
|
|
if [ -z "$dev" ]; then
|
|
|
|
echo "Couldn't mount loopback device"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
echo "Loopback device: ${dev}"
|
|
|
|
|
|
|
|
cleanup() {
|
|
|
|
umount efi
|
|
|
|
rm -rf efi
|
2023-07-31 23:41:24 -07:00
|
|
|
umount sysroot
|
|
|
|
rm -rf sysroot
|
2023-05-29 00:32:54 -07:00
|
|
|
losetup -d $dev
|
2023-05-17 20:20:53 -07:00
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
parted -s $dev mklabel gpt mkpart EFI fat32 1MiB 10MiB mkpart ext2 10MiB 100% set 1 esp on
|
|
|
|
mkfs.fat -F 12 "${dev}p1"
|
|
|
|
mke2fs "${dev}p2"
|
|
|
|
|
2023-06-26 08:29:14 -07:00
|
|
|
limine bios-install "${dev}"
|
2023-05-17 20:20:53 -07:00
|
|
|
|
|
|
|
mkdir -p efi/
|
|
|
|
mount "${dev}p1" efi/
|
|
|
|
|
|
|
|
mkdir -p efi/EFI/BOOT
|
|
|
|
cp /usr/share/limine/BOOTX64.EFI efi/EFI/BOOT
|
2023-06-26 08:29:14 -07:00
|
|
|
cp /usr/share/limine/limine-bios.sys efi/
|
2023-05-17 20:20:53 -07:00
|
|
|
cp ../zion/boot/limine.cfg efi/
|
|
|
|
cp zion/zion efi/
|
2023-05-29 00:32:54 -07:00
|
|
|
mkdir -p efi/sys
|
2023-06-07 11:18:35 -07:00
|
|
|
cp sys/yellowstone/yellowstone efi/sys/yellowstone
|
2023-06-08 02:36:59 -07:00
|
|
|
cp sys/denali/denali efi/sys/denali
|
2023-06-22 00:22:59 -07:00
|
|
|
cp sys/victoriafalls/victoriafalls efi/sys/victoriafalls
|
2023-05-17 20:20:53 -07:00
|
|
|
|
2023-07-31 23:41:24 -07:00
|
|
|
mkdir -p sysroot
|
|
|
|
mount "${dev}p2" sysroot/
|
|
|
|
rsync -a ../sysroot .
|
|
|
|
ls sysroot/
|
|
|
|
|
2023-05-17 20:20:53 -07:00
|
|
|
chown drew:drew $1
|