Add unfinished script to create alpine linux uefi boot stick

This commit is contained in:
Nico Schottelius 2019-11-25 14:48:35 +01:00
parent 315131c3ad
commit 47d2a91776

38
alpine-build-uefi-stick.sh Executable file
View file

@ -0,0 +1,38 @@
#!/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!!