#! @bash@/bin/sh -e shopt -s nullglob export PATH=/empty:@path@ usage() { echo "usage: $0 -f -b -c " >&2 exit 1 } default= # Default configuration, needed for extlinux # fwtarget=/boot/firmware # firmware target directory # boottarget=/boot # boot configuration target directory echo "uefi-builder: $@" while getopts "c:b:f:" opt; do case "$opt" in c) default="$OPTARG" ;; b) boottarget="$OPTARG" ;; f) fwtarget="$OPTARG" ;; \?) usage ;; esac done if [ -z "$boottarget" ] && [ -z "$fwtarget" ]; then echo "Error: at least one of \`-b \` and \`-f \` must be set" usage fi copyForced() { local src="$1" local dst="$2" echo "copying $file to $dst" cp -a "$src/." $dst #mv $dst.tmp $dst/$file } echo "uefi: @uefi@" if [ -n "$fwtarget" ]; then @firmwareBuilder@ -c $default -d $fwtarget echo "copying uefi firmware..." rm -rf $fwtarget/* copyForced @uefi@ $fwtarget/ fi echo "uefi bootloader installed"