#!/bin/bash # convert archboot.iso to gpt bootable for MacBookAir # works with archboot 2011.07-2 [[ $# -ne 2 ]] && echo "Usage: $0 " && exit ARCHBOOT_ISO=$1 TARGET_FILE=$2 ARCHBOOT_DIR=$(mktemp -d) ESP_DIR=$(mktemp -d) SYSTEM_DIR=$(mktemp -d) TARGET_DIR=$(mktemp -d) echo ========================Mounting archboot # Set up archboot for copying mount $ARCHBOOT_ISO -o loop $ARCHBOOT_DIR echo ========================Preparing archboot files # We will use two partitions to store archboot in the target image. # The first partition is for EFI boot files, it MUST be fat32; # fat32 does not support soft links, which are used in Arch, # hence the need for a second partition. # Also, we only need x86_64, strip out i686 etc. # First partition cp -r $ARCHBOOT_DIR/efi $ESP_DIR cat >$ESP_DIR/efi/grub2/grub.cfg <"