summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatol Pomozov2015-06-17 08:48:44 -0700
committerAnatol Pomozov2015-06-17 08:48:44 -0700
commit6766f5ff032adb04d3b90cf02161953af3e8fa59 (patch)
tree6169d04441c7447e5f7f5e89f9b88506942e15fd
downloadaur-mactel-boot.tar.gz
Initial import
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD37
-rw-r--r--mactel-boot-setup66
3 files changed, 118 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..e10540503f7f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = mactel-boot
+ pkgdesc = Utility to bless EFI bootloaders in Apple-Intel Macs
+ pkgver = 0.9
+ pkgrel = 3
+ url = https://bugzilla.redhat.com/show_bug.cgi?id=755093
+ arch = i686
+ arch = x86_64
+ license = GPL
+ source = http://www.codon.org.uk/~mjg59/mactel-boot/mactel-boot-0.9.tar.bz2
+ source = mactel-boot-setup
+ sha256sums = 7c58df71b4c8fe3bdb719063a34265fe8e338d6cb5db024fc90ae716cbbf52f6
+ sha256sums = d74b68d3a7dde589a03779b3a245d66a04dda8247d876f5aea56e3fe365fc8f7
+
+pkgname = mactel-boot
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b9d7e4aa383e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: Anatol Pomozov <anatol.pomozov@gmail.com>
+# Contributor: Keshav P R <(the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
+
+pkgname=mactel-boot
+pkgver=0.9
+pkgrel=3
+pkgdesc='Utility to bless EFI bootloaders in Apple-Intel Macs'
+url='https://bugzilla.redhat.com/show_bug.cgi?id=755093'
+license=(GPL)
+arch=(i686 x86_64)
+source=(http://www.codon.org.uk/~mjg59/mactel-boot/mactel-boot-$pkgver.tar.bz2
+ mactel-boot-setup)
+sha256sums=('7c58df71b4c8fe3bdb719063a34265fe8e338d6cb5db024fc90ae716cbbf52f6'
+ 'd74b68d3a7dde589a03779b3a245d66a04dda8247d876f5aea56e3fe365fc8f7')
+
+prepare() {
+ # Build should respect CFLAGS from Arch build system
+ # and do not put files into /usr/sbin
+ sed -e 's/$(CC) -g -o hfs-bless bless.c/$(CC) $(CFLAGS) -o hfs-bless bless.c/' \
+ -e 's|/usr/sbin/hfs-bless|/usr/bin/hfs-bless|' \
+ -i "$srcdir/mactel-boot-$pkgver/Makefile"
+}
+
+build() {
+ cd $pkgname-$pkgver
+ make
+}
+
+package() {
+ cd $pkgname-$pkgver
+
+ make DESTDIR="$pkgdir" install
+
+ install -D -m0755 "$srcdir/mactel-boot-setup" "$pkgdir/usr/bin/mactel-boot-setup"
+ install -d "$pkgdir/usr/share/mactel-boot"
+ install -D -m0644 "$srcdir/mactel-boot-$pkgver/SystemVersion.plist" "$pkgdir/usr/share/mactel-boot/SystemVersion.plist"
+}
diff --git a/mactel-boot-setup b/mactel-boot-setup
new file mode 100644
index 000000000000..7e0bca327c7b
--- /dev/null
+++ b/mactel-boot-setup
@@ -0,0 +1,66 @@
+#!/usr/bin/env bash
+
+## Based on http://pkgs.fedoraproject.org/gitweb/?p=mactel-boot.git;a=blob_plain;f=mactel-boot-setup;hb=f17
+
+## Execute as root
+
+_HFS_PLUS_PART_MP="${1}"
+_LOADER_PATH="${2}"
+_LOADER_CONFIG="${3}"
+
+if [[ -z "${1}" ]] || [[ -z "${2}" ]]; then
+ echo
+ echo "Usage: mactel-boot-setup <HFS_PLUS_PARTITION_MOUNTPOINT> <LOADER_PATH> <LOADER_CONFIG>"
+ echo
+ echo "Example: mactel-boot-setup /boot/mactel /EFI/refind/refindx64.efi /EFI/refind/refind.conf"
+ echo
+ exit 0
+fi
+
+### check for root
+if [[ ! ${UID} -eq 0 ]]; then
+ echo "ERROR: Please run as root user!"
+ exit 1
+fi
+
+if [[ "$(df -T "${_HFS_PLUS_PART_MP}" | tail -n +2 | awk '{print $2}')" == "hfsplus" ]]; then
+ if [[ -f "${_HFS_PLUS_PART_MP}/${_LOADER_PATH}" ]]; then
+ [[ ! -f "${_HFS_PLUS_PART_MP}/mach_kernel" ]] && echo "This file is required for booting" > "${_HFS_PLUS_PART_MP}/mach_kernel"
+
+ mkdir -p "${_HFS_PLUS_PART_MP}/System/Library/CoreServices"
+ cp -f "/usr/share/mactel-boot/SystemVersion.plist" "${_HFS_PLUS_PART_MP}/System/Library/CoreServices/SystemVersion.plist"
+
+ [[ -z ${_LOADER_CONFIG} ]] && _LOADER_CONFIG="$(echo "${_LOADER_PATH}" | sed 's|efi|cfg|g')"
+
+ ln -f "${_HFS_PLUS_PART_MP}/${_LOADER_PATH}" "${_HFS_PLUS_PART_MP}/System/Library/CoreServices/boot.efi"
+ [[ -f "${_HFS_PLUS_PART_MP}/${_LOADER_CONFIG}" ]] && ln -sf "${_HFS_PLUS_PART_MP}/${_LOADER_CONFIG}" "${_HFS_PLUS_PART_MP}/System/Library/CoreServices/$(basename "${_HFS_PLUS_PART_MP}/${_LOADER_CONFIG}")"
+
+ if [[ -f "/usr/share/mactel-boot/arch.vol" ]]; then
+ cp -f "/usr/share/mactel-boot/arch.vol" "$(dirname "${_HFS_PLUS_PART_MP}/${_LOADER_PATH}")/.disk_label"
+ cp -f "/usr/share/mactel-boot/arch.vol" "${_HFS_PLUS_PART_MP}/System/Library/CoreServices/.disk_label"
+ else
+ touch "$(dirname "${_HFS_PLUS_PART_MP}/${_LOADER_PATH}")/.disk_label"
+ touch "${_HFS_PLUS_PART_MP}/System/Library/CoreServices/.disk_label"
+ fi
+
+ if [[ -f "/boot/efi/EFI/arch/refind/icons/os_arch.icns" ]]; then
+ cp "/boot/efi/EFI/arch/refind/icons/os_arch.icns" "${_HFS_PLUS_PART_MP}/.VolumeIcon.icns"
+ else
+ touch "${_HFS_PLUS_PART_MP}/.VolumeIcon.icns"
+ fi
+
+ hfs-bless "${_HFS_PLUS_PART_MP}/${_LOADER_PATH}"
+ echo
+ else
+ echo "${_HFS_PLUS_PART_MP}/${_LOADER_PATH} not found."
+ fi
+else
+ echo
+ echo "${_HFS_PLUS_PART_MP} is not an HFS-PLUS Partition Mountpoint"
+ echo
+ exit 2
+fi
+
+unset _HFS_PLUS_PART_MP
+unset _LOADER_PATH
+unset _LOADER_CONFIG