10_illumos.in 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #! /bin/sh
  2. set -e
  3. # grub-mkconfig helper script.
  4. # Copyright (C) 2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc.
  5. #
  6. # GRUB is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # GRUB is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. prefix="@prefix@"
  19. exec_prefix="@exec_prefix@"
  20. datarootdir="@datarootdir@"
  21. . "$pkgdatadir/grub-mkconfig_lib"
  22. export TEXTDOMAIN=@PACKAGE@
  23. export TEXTDOMAINDIR="@localedir@"
  24. CLASS="--class os"
  25. case "${GRUB_DISTRIBUTOR}" in
  26. *)
  27. OS="Illumos"
  28. CLASS="--class illumos ${CLASS}"
  29. ;;
  30. esac
  31. echo "menuentry '$(echo "$OS" | grub_quote)' ${CLASS} \$menuentry_id_option 'illumos-$(grub_get_device_id "${GRUB_DEVICE_BOOT}")' {"
  32. save_default_entry | grub_add_tab
  33. prepare_grub_to_access_device "${GRUB_DEVICE_BOOT}" | grub_add_tab
  34. message="$(gettext_printf "Loading kernel of Illumos ...")"
  35. cat << EOF
  36. insmod gzio
  37. if cpuid -l ; then
  38. ISADIR=amd64
  39. else
  40. ISADIR=
  41. fi
  42. zfs-bootfs $($grub_mkrelpath /) ZFS_BOOTFS
  43. echo '$(echo "$message" | grub_quote)'
  44. multiboot $($grub_mkrelpath /platform/i86pc/kernel)/\$ISADIR/unix /platform/i86pc/kernel/\$ISADIR/unix -B \$ZFS_BOOTFS,console=text
  45. module $($grub_mkrelpath /platform/i86pc)/\$ISADIR/boot_archive /platform/i86pc/\$ISADIR/boot_archive
  46. }
  47. EOF