4
# grub-mkconfig helper script.
5
# Copyright (C) 2006,2007,2008,2009,2012 Free Software Foundation, Inc.
7
# GRUB is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
12
# GRUB is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
21
exec_prefix="@exec_prefix@"
22
datarootdir="@datarootdir@"
24
export TEXTDOMAIN=@PACKAGE@
25
export TEXTDOMAINDIR="@localedir@"
27
. "@datadir@/@PACKAGE@/grub-mkconfig_lib"
30
if [ x$2 = x32 ]; then
31
# TRANSLATORS: it refers to kernel architecture (32-bit)
32
bitstr="$(gettext "(32-bit)")"
34
# TRANSLATORS: it refers to kernel architecture (64-bit)
35
bitstr="$(gettext "(64-bit)")"
37
# TRANSLATORS: it refers on the OS residing on device %s
38
onstr="$(gettext_printf "(on %s)" "${GRUB_DEVICE}")"
40
menuentry '$(echo "Darwin/Mac OS X $bitstr $onstr" | grub_quote)' --class osx --class darwin --class os \$menuentry_id_option 'osprober-xnu-$2-$(grub_get_device_id "${GRUB_DEVICE}")' {
42
save_default_entry | sed -e "s/^/ /"
43
prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/ /"
47
if [ /var/vm/sleepimage -nt10 / ]; then
48
if xnu_resume /var/vm/sleepimage; then
52
if [ \$do_resume = 0 ]; then
53
xnu_uuid ${OSXUUID} uuid
54
if [ -f /Extra/DSDT.aml ]; then
55
acpi -e /Extra/DSDT.aml
57
if [ /kernelcache -nt /System/Library/Extensions ]; then
58
$1 /kernelcache boot-uuid=\${uuid} rd=*uuid
60
$1 /mach_kernel boot-uuid=\${uuid} rd=*uuid
61
if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
62
xnu_mkext /System/Library/Extensions.mkext
64
xnu_kextdir /System/Library/Extensions
67
if [ -f /Extra/Extensions.mkext ]; then
68
xnu_mkext /Extra/Extensions.mkext
70
if [ -d /Extra/Extensions ]; then
71
xnu_kextdir /Extra/Extensions
73
if [ -f /Extra/devprop.bin ]; then
74
xnu_devprop_load /Extra/devprop.bin
76
if [ -f /Extra/splash.jpg ]; then
78
xnu_splash /Extra/splash.jpg
80
if [ -f /Extra/splash.png ]; then
82
xnu_splash /Extra/splash.png
84
if [ -f /Extra/splash.tga ]; then
86
xnu_splash /Extra/splash.tga
93
OSXUUID="`${grub_probe} --target=fs_uuid --device ${GRUB_DEVICE} 2> /dev/null`"
94
osx_entry xnu_kernel 32
95
osx_entry xnu_kernel64 64