ungleich-tools/alpine-build-uefi-stick.sh

39 lines
731 B
Bash
Raw Normal View History

#!/bin/sh
# Nico Schottelius, 12019-11-25
set -e
echo "incomplete script: partition table, size"
exit 1
version=3.10.3
tmpdir=$(mktemp -d)
file=alpine-standard-${version}-x86_64.iso
url=http://dl-cdn.alpinelinux.org/alpine/v3.10/releases/x86_64/$file
uefifile=${file%.iso}.efi
# FIXME: get this from the ISO and round up a bit - size in MiB
uefisize=200
wget -c "$url"
# cretae the output file
dd if=/dev/zero of=${uefifile} bs=1M count=${uefisize}
mkdir "$tmpdir/iso"
mkdir "$tmpdir/efi"
mkfs.vfat -F32 ${uefifile}
mount -o loop "${file}" "$tmpdir/iso"
mount -o loop "${uefifile}" "$tmpdir/efi"
cd "$tmpdir/iso"
tar c . | ( cd "$tmpdir/efi"; tar xv )
umount "$tmpdir/iso" "$tmpdir/efi"
# FIXME: create partition!!