1 #! /bin/sh
2 set -e
3
4 # grub-mkconfig helper script.
5 # Copyright (C) 2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc.
6 #
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.
11 #
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.
16 #
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/>.
19
20 prefix="@prefix@"
21 exec_prefix="@exec_prefix@"
22 datarootdir="@datarootdir@"
23 . "@datadir@/@PACKAGE@/grub-mkconfig_lib"
24
25 export TEXTDOMAIN=@PACKAGE@
26 export TEXTDOMAINDIR="@localedir@"
27
28 CLASS="--class os"
29
30 case "${GRUB_DISTRIBUTOR}" in
31 *)
32 OS="Illumos"
33 CLASS="--class illumos ${CLASS}"
34 ;;
35 esac
36
37 echo "menuentry '$(echo "$OS" | grub_quote)' ${CLASS} \$menuentry_id_option 'illumos-$(grub_get_device_id "${GRUB_DEVICE_BOOT}")' {"
38 save_default_entry | sed -e "s/^/\t/"
39 prepare_grub_to_access_device "${GRUB_DEVICE_BOOT}" | sed -e "s/^/\t/"
40 message="$(gettext_printf "Loading kernel of Illumos ...")"
41 cat << EOF
42 insmod gzio
43 if cpuid -l ; then
44 ISADIR=amd64
45 else
46 ISADIR=
47 fi
48 zfs-bootfs $($grub_mkrelpath /) ZFS_BOOTFS
49 multiboot $($grub_mkrelpath /platform/i86pc/kernel)/\$ISADIR/unix /platform/i86pc/kernel/\$ISADIR/unix -B \$ZFS_BOOTFS,console=text
50 module $($grub_mkrelpath /platform/i86pc)/\$ISADIR/boot_archive /platform/i86pc/\$ISADIR/boot_archive
51 }
52 EOF