updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / mactel-boot / mactel-boot-install.sh
blob117cdd0613639d3c02180b76a5545695775f70f6
1 #!/bin/bash
3 ## Execute as root
5 _HFS_PLUS_PART_MP="${1}"
7 if [[ -z "${1}" ]]; then
8 echo
9 echo "Usage: ${0} <HFS_PLUS_PARTITION_MOUNTPOINT>"
10 echo
11 echo "Example: ${0} /boot/mactel"
12 echo
13 exit 0
16 set -x -e
18 if [[ "$(df -T "${_HFS_PLUS_PART_MP}" | tail -n +2 | awk '{print $2}')" == "hfsplus" ]]; then
20 echo
22 mkdir -p "${_HFS_PLUS_PART_MP}/System/Library/CoreServices"
23 cp "/usr/share/mactel-boot/SystemVersion.plist" "${_HFS_PLUS_PART_MP}/System/Library/CoreServices/SystemVersion.plist"
25 echo
27 echo "This file is required for booting" > "${_HFS_PLUS_PART_MP}/mach_kernel"
29 touch "${_HFS_PLUS_PART_MP}/System/Library/CoreServices/boot.efi"
30 touch "${_HFS_PLUS_PART_MP}/.VolumeIcon.icns"
32 echo
34 hfs-bless "${_HFS_PLUS_PART_MP}" "${_HFS_PLUS_PART_MP}/System/Library/CoreServices" "${_HFS_PLUS_PART_MP}/System/Library/CoreServices/boot.efi"
36 echo
37 else
38 echo
39 echo "${_HFS_PLUS_PART_MP} is not an HFS PLUS Partition Mountpoint"
40 echo
43 set +x +e
45 unset _HFS_PLUS_PART_MP