diff options
Diffstat (limited to 'sysutils/grub2-pcbsd/files')
20 files changed, 0 insertions, 1943 deletions
diff --git a/sysutils/grub2-pcbsd/files/00_header.in b/sysutils/grub2-pcbsd/files/00_header.in deleted file mode 100644 index e3d1cec6c2fd..000000000000 --- a/sysutils/grub2-pcbsd/files/00_header.in +++ /dev/null @@ -1,361 +0,0 @@ -#! /bin/sh -set -e - -# grub-mkconfig helper script. -# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc. -# -# GRUB is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# GRUB is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GRUB. If not, see <http://www.gnu.org/licenses/>. - -transform="s,x,x," - -prefix="/usr/local" -exec_prefix="${prefix}" -datarootdir="${prefix}/share" -grub_lang=`echo $LANG | cut -d . -f 1` - -export TEXTDOMAIN=grub -export TEXTDOMAINDIR="/usr/local/share/locale" - -. "${datarootdir}/grub/grub-mkconfig_lib" - -# Set indicator that we haven't written device access yet -haveDevAccess=0 - -# Work-around for systems with GPTID enabled still -echo "insmod part_gpt" - -# Do this as early as possible, since other commands might depend on it. -# (e.g. the `loadfont' command might need lvm or raid modules) -for i in ${GRUB_PRELOAD_MODULES} ; do - echo "insmod $i" -done - -if [ -e "/root/beadm.install" ] ; then - BEADM="/root/beadm.install" -else - BEADM="beadm" -fi - -if [ "x${GRUB_DEFAULT}" = "x" ] ; then - GRUB_DEFAULT=0 -fi -if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then GRUB_DEFAULT='${saved_entry}' ; fi -if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi -if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=auto ; fi - -# Check if we have more than one BE, and need to show the menu by default -beNum=`$BEADM list 2>/dev/null | grep -v 'Mountpoint' | wc -l | awk '{print $1}'` -if [ $beNum -gt 1 ] ; then GRUB_HIDDEN_TIMEOUT=""; fi - -if [ "x${GRUB_DEFAULT_BUTTON}" = "x" ] ; then GRUB_DEFAULT_BUTTON="$GRUB_DEFAULT" ; fi -if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_entry}' ; fi -if [ "x${GRUB_TIMEOUT_BUTTON}" = "x" ] ; then GRUB_TIMEOUT_BUTTON="$GRUB_TIMEOUT" ; fi - -cat << EOF -if [ -s \$prefix/grubenv ]; then - load_env -fi -EOF -if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then - cat <<EOF -if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then - set default="${GRUB_DEFAULT_BUTTON}" -else - set default="${GRUB_DEFAULT}" -fi -EOF -else - cat <<EOF -set default="${GRUB_DEFAULT}" -EOF -fi -cat <<EOF - -if [ x"\${feature_menuentry_id}" = xy ]; then - menuentry_id_option="--id" -else - menuentry_id_option="" -fi - -export menuentry_id_option - -if [ x"\${gelipassphrase}" != x ]; then - set pass="\$gelipassphrase" - export pass -fi - -if [ "\${prev_saved_entry}" ]; then - set saved_entry="\${prev_saved_entry}" - save_env saved_entry - set prev_saved_entry= - save_env prev_saved_entry - set boot_once=true -fi - -function savedefault { - if [ -z "\${boot_once}" ]; then - saved_entry="\${chosen}" - save_env saved_entry - fi -} - -function load_video { -EOF -if [ -n "${GRUB_VIDEO_BACKEND}" ]; then - cat <<EOF - insmod ${GRUB_VIDEO_BACKEND} -EOF -else -# If all_video.mod isn't available load all modules available -# with versions prior to introduction of all_video.mod -cat <<EOF - insmod vbe - insmod vga - insmod video_bochs - insmod video_cirrus -EOF -fi -cat <<EOF -} - -EOF - -serial=0; -gfxterm=0; -for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do - if [ xserial = "x$x" ]; then - serial=1; - fi - if [ xgfxterm = "x$x" ]; then - gfxterm=1; - fi -done - -if [ "x$serial" = x1 ]; then - if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then - grub_warn "$(gettext "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used.")" - GRUB_SERIAL_COMMAND=serial - fi - echo "${GRUB_SERIAL_COMMAND}" -fi - -if [ "x$gfxterm" = x1 ]; then - if [ -n "$GRUB_FONT" ] ; then - # Make the font accessible - if [ $haveDevAccess -ne 1 ] ; then - haveDevAccess=1 - prepare_grub_to_access_device `${grub_probe} --target=device "${GRUB_FONT}"` - fi - cat << EOF -if loadfont `make_system_path_relative_to_its_root "${GRUB_FONT}"` ; then -EOF - else - for dir in "${pkgdatadir}" "`echo '/boot/grub' | sed "s,//*,/,g"`" /usr/share/grub ; do - for basename in unicode unifont ascii; do - path="${dir}/${basename}.pf2" - if is_path_readable_by_grub "${path}" > /dev/null ; then - font_path="${path}" - else - continue - fi - break 2 - done - done - if [ -n "${font_path}" ] ; then - cat << EOF -if [ x\$feature_default_font_path = xy ] ; then - font=unicode -else -EOF - # Make the font accessible - if [ $haveDevAccess -ne 1 ] ; then - haveDevAccess=1 - prepare_grub_to_access_device `${grub_probe} --target=device "${font_path}"` - fi - cat << EOF - font="`make_system_path_relative_to_its_root "${font_path}"`" -fi - -if loadfont \$font ; then -EOF - else - cat << EOF -if loadfont unicode ; then -EOF - fi - fi - - cat << EOF - if [ x"\${grub_platform}" = xpc ] ; then - set gfxmode=${GRUB_GFXMODE} - load_video - insmod gfxterm - else - # EFI - insmod efi_gop - insmod gfxterm - insmod font - insmod videotest - insmod videoinfo - set gfxmode=${GRUB_GFXMODE} - fi -EOF - -# Gettext variables and module -if [ "x${LANG}" != "xC" -a "x${grub_lang}" != "xen_US" ] ; then - cat << EOF - set locale_dir=\$prefix/locale - set lang=${grub_lang} - insmod gettext -EOF -fi - -cat <<EOF -fi -EOF -fi - -case x${GRUB_TERMINAL_INPUT} in - x) - # Just use the native terminal - ;; - x*) - cat << EOF -terminal_input ${GRUB_TERMINAL_INPUT} -EOF - ;; -esac - -case x${GRUB_TERMINAL_OUTPUT} in - x) - # Just use the native terminal - ;; - x*) - cat << EOF -terminal_output ${GRUB_TERMINAL_OUTPUT} -EOF - ;; -esac - -if [ "x$gfxterm" = x1 ]; then - if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \ - && is_path_readable_by_grub "$GRUB_THEME"; then - gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&2 - - if [ $haveDevAccess -ne 1 ] ; then - haveDevAccess=1 - prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"` - fi - cat << EOF -insmod gfxmenu -EOF - themedir="`dirname "$GRUB_THEME"`" - for x in "$themedir"/*.pf2 "$themedir"/f/*.pf2; do - if [ -f "$x" ]; then - cat << EOF -loadfont (\$root)`make_system_path_relative_to_its_root $x` -EOF - fi - done - if [ x"`echo "$themedir"/*.jpg`" != x"$themedir/*.jpg" ] || [ x"`echo "$themedir"/*.jpeg`" != x"$themedir/*.jpeg" ]; then - cat << EOF -insmod jpeg -EOF - fi - if [ x"`echo "$themedir"/*.png`" != x"$themedir/*.png" ]; then - cat << EOF -insmod png -EOF - fi - if [ x"`echo "$themedir"/*.tga`" != x"$themedir/*.tga" ]; then - cat << EOF -insmod tga -EOF - fi - - cat << EOF -set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME` -export theme -EOF - elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \ - && is_path_readable_by_grub "$GRUB_BACKGROUND"; then - gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&2 - case "$GRUB_BACKGROUND" in - *.png) reader=png ;; - *.tga) reader=tga ;; - *.jpg|*.jpeg) reader=jpeg ;; - *) gettext "Unsupported image format" >&2; echo >&2; exit 1 ;; - esac - if [ $haveDevAccess -ne 1 ] ; then - haveDevAccess=1 - prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"` - fi - cat << EOF -insmod $reader -background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"` -EOF - fi -fi - -make_timeout () -{ - if [ "x${1}" != "x" ] ; then - if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then - verbose= - else - verbose=" --verbose" - fi - cat << EOF -echo "Hold Left-Shift for menu.." -if sleep$verbose --interruptible ${1} ; then - if keystatus --shift; then - set timeout=-1 - else - set timeout=0 - fi -fi -EOF - else - cat << EOF -set timeout=${2} -EOF - fi -} - -if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then - cat <<EOF -if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then -EOF -make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}" -echo else -make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}" -echo fi -else -make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}" -fi - -if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ] && [ "x$GRUB_BUTTON_CMOS_CLEAN" = "xyes" ]; then - cat <<EOF -cmosclean $GRUB_BUTTON_CMOS_ADDRESS -EOF -fi - -# Play an initial tune -if [ "x${GRUB_INIT_TUNE}" != "x" ] ; then - echo "play ${GRUB_INIT_TUNE}" -fi - -if [ "x${GRUB_BADRAM}" != "x" ] ; then - echo "badram ${GRUB_BADRAM}" -fi diff --git a/sysutils/grub2-pcbsd/files/10_kfreebsd.in b/sysutils/grub2-pcbsd/files/10_kfreebsd.in deleted file mode 100644 index d9d0dfb0009d..000000000000 --- a/sysutils/grub2-pcbsd/files/10_kfreebsd.in +++ /dev/null @@ -1,247 +0,0 @@ -#! /bin/sh -set -e - -# grub-mkconfig helper script. -# Copyright (C) 2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc. -# -# GRUB is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# GRUB is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GRUB. If not, see <http://www.gnu.org/licenses/>. - -# Check if we have beadm installed, if not do normal freebsd detection -if [ -e "/usr/local/sbin/beadm" ] ; then exit 0; fi - -prefix="@prefix@" -exec_prefix="@exec_prefix@" -datarootdir="@datarootdir@" -. "$pkgdatadir/grub-mkconfig_lib" - -export TEXTDOMAIN=@PACKAGE@ -export TEXTDOMAINDIR="@localedir@" - -CLASS="--class os" - -case "${GRUB_DISTRIBUTOR}" in - Debian) - OS="${GRUB_DISTRIBUTOR} GNU/kFreeBSD" - CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') --class gnu-kfreebsd --class gnu ${CLASS}" - ;; - *) - OS="FreeBSD" - CLASS="--class freebsd --class bsd ${CLASS}" - ;; -esac - -load_kfreebsd_module () -{ - mod="$1" - allow_fail="$2" - - if ! test -e "${module_dir}/${mod}.ko" ; then - if [ "${allow_fail}" = "true" ] ; then - # Return silently - return - else - # Print an error and fail. - ls "${module_dir}/${mod}.ko" > /dev/null - fi - fi - - if [ -z "${prepare_module_dir_cache}" ]; then - prepare_module_dir_cache="$(prepare_grub_to_access_device $(${grub_probe} -t device "${module_dir}") | grub_add_tab)" - fi - - printf '%s\n' "${prepare_module_dir_cache}" - cat << EOF - kfreebsd_module_elf ${module_dir_rel}/${mod}.ko -EOF -} - -title_correction_code= - -kfreebsd_entry () -{ - os="$1" - version="$2" - type="$3" - args="$4" - if [ -z "$boot_device_id" ]; then - boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" - fi - if [ x$type != xsimple ] ; then - if [ x$type = xrecovery ] ; then - title="$(gettext_printf "%s, with kFreeBSD %s (recovery mode)" "${os}" "${version}")" - else - title="$(gettext_printf "%s, with kFreeBSD %s" "${os}" "${version}")" - fi - replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')" - if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then - quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)" - title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;" - grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "kfreebsd-advanced-$boot_device_id>kfreebsd-$version-$type-$boot_device_id")" - fi - echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'kfreebsd-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" - else - echo "menuentry '$(echo "$OS" | grub_quote)' ${CLASS} \$menuentry_id_option 'kfreebsd-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" - fi - if [ x$type != xrecovery ] ; then - save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/" - fi - if [ -z "${prepare_boot_cache}" ]; then - prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)" - fi - - printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" - message="$(gettext_printf "Loading kernel of FreeBSD %s ..." ${version})" - sed "s/^/$submenu_indentation/" << EOF - echo '$(echo "$message" | grub_quote)' - kfreebsd ${rel_dirname}/${basename} ${args} -EOF - - if test -n "${devices}" ; then - sed "s/^/$submenu_indentation/" << EOF - kfreebsd_loadenv ${devices_rel_dirname}/${devices_basename} -EOF - fi - - load_kfreebsd_module acpi true - - for abstraction in dummy $(${grub_probe} -t abstraction --device ${GRUB_DEVICE}) ; do - case $abstraction in - lvm) load_kfreebsd_module geom_linux_lvm false ;; - esac - done - - case "${kfreebsd_fs}" in - zfs) - load_kfreebsd_module opensolaris false - - ls "/boot/zfs/zpool.cache" > /dev/null - printf '%s\n' "${prepare_boot_cache}" - sed "s/^/$submenu_indentation/" << EOF - kfreebsd_module $(make_system_path_relative_to_its_root /boot)/zfs/zpool.cache type=/boot/zfs/zpool.cache -EOF - ;; - esac - - if [ x${kfreebsd_fs} = xufs ]; then - load_kfreebsd_module ${kfreebsd_fs} true | sed "s/^/$submenu_indentation/" - else - load_kfreebsd_module ${kfreebsd_fs} false | sed "s/^/$submenu_indentation/" - fi - - sed "s/^/$submenu_indentation/" << EOF - set kFreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${kfreebsd_device} - set kFreeBSD.vfs.root.mountfrom.options=rw -} -EOF -} - -list= -for i in /boot/kfreebsd-* /boot/kernel/kernel ; do - if grub_file_is_not_garbage "$i" ; then - list="$list $i" - fi -done -prepare_boot_cache= -boot_device_id= -title_correction_code= - -# Extra indentation to add to menu entries in a submenu. We're not in a submenu -# yet, so it's empty. In a submenu it will be equal to '\t' (one tab). -submenu_indentation="" - -is_top_level=true - -while [ "x$list" != "x" ] ; do - kfreebsd=`version_find_latest $list` - gettext_printf "Found kernel of FreeBSD: %s\n" "$kfreebsd" >&2 - basename=`basename $kfreebsd` - dirname=`dirname $kfreebsd` - rel_dirname=`make_system_path_relative_to_its_root $dirname` - - if [ -f /boot/device.hints ] ; then - devices=/boot/device.hints - devices_basename=`basename $devices` - devices_dirname=`dirname $devices` - devices_rel_dirname=`make_system_path_relative_to_its_root $devices_dirname` - fi - - case ${GRUB_FS} in - ufs1 | ufs2) kfreebsd_fs=ufs ;; - ext2) kfreebsd_fs=ext2fs ;; - *) kfreebsd_fs=${GRUB_FS} ;; - esac - - case ${GRUB_FS} in - zfs) - # zpool name - kfreebsd_device=$(${grub_probe} -t fs_label --device ${GRUB_DEVICE}) - # filesystem name (empty string for the main filesystem) - kfreebsd_device="${kfreebsd_device}$(${grub_mkrelpath} / | sed -e "s,/*@$,,")" - ;; - *) - kfreebsd_device=${kfreebsd_fs}id/${GRUB_DEVICE_UUID} - # Debian GNU/kFreeBSD can't remount root if it's supplied as UUID but - # as an UUID - if [ "x${GRUB_DISTRIBUTOR}" = "xDebian" ] \ - && ! (cat /etc/fstab | awk '!/^[[:space:]]*#/ && $2=="/" { print $1; }' \ - | grep "${kfreebsd_fs}id/${GRUB_DEVICE_UUID}" > /dev/null); then - kfreebsd_device=${GRUB_DEVICE} - fi - ;; - esac - - version=`echo $basename | sed -e "s,^[^0-9]*-,,g;s/\.gz$//g"` - alt_version=`echo $version | sed -e "s,\.old$,,g"` - - module_dir= - for i in "/lib/modules/${version}" "/lib/modules/${alt_version}" \ - "/boot/kernel"; do - if test -e "$i" ; then - module_dir="$i" - break - fi - done - if test -n "${module_dir}" ; then - gettext_printf "Found kernel module directory: %s\n" "${module_dir}" >&2 - module_dir_rel=$(make_system_path_relative_to_its_root $module_dir) - fi - - if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then - kfreebsd_entry "${OS}" "${version}" simple - submenu_indentation="$grub_tab" - - if [ -z "$boot_device_id" ]; then - boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" - fi - # TRANSLATORS: %s is replaced with an OS name - echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'kfreebsd-advanced-$boot_device_id' {" - is_top_level=false - fi - - kfreebsd_entry "${OS}" "${version}" advanced - if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then - kfreebsd_entry "${OS}" "${version}" recovery "-s" - fi - - list=`echo $list | tr ' ' '\n' | fgrep -vx "$kfreebsd" | tr '\n' ' '` -done - -# If at least one kernel was found, then we need to -# add a closing '}' for the submenu command. -if [ x"$is_top_level" != xtrue ]; then - echo '}' -fi - -echo "$title_correction_code" - diff --git a/sysutils/grub2-pcbsd/files/10_ktrueos.in b/sysutils/grub2-pcbsd/files/10_ktrueos.in deleted file mode 100644 index 15410ac18d8a..000000000000 --- a/sysutils/grub2-pcbsd/files/10_ktrueos.in +++ /dev/null @@ -1,389 +0,0 @@ -#!/bin/sh -# -# Copyright 2015 iXsystems (Kris Moore) -# All rights reserved -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted providing that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -# Script to detect TrueOS / PC-BSD disk installations and create grub -# entries for them - -# Check if we have beadm installed, if not skip this file -if [ ! -e "/usr/local/sbin/beadm" ] ; then exit 0; fi - -ROOTFS=`mount | awk '/ \/ / {print $1}'` -BEDS="$( echo ${ROOTFS} | awk -F '/' '{print $2}' )" -if [ "$BEDS" = "dev" ] ; then BEDS="ROOT"; fi - -serial=0; -console=0; -for x in ${GRUB_TERMINAL_OUTPUT}; do - if [ xserial = "x$x" ]; then - serial=1; - fi - if [ xgfxterm = "x$x" ]; then - console=1; - fi - if [ xconsole = "x$x" ]; then - console=1; - fi -done - -if [ "x$serial" = "x1" ]; then - if [ "x$console" = "x1" ]; then - out="-Dh" - else - out="-h" - fi -fi - -display_loaderopts() -{ - # Optional ARG1, set to a ZFS dataset to mount and read values from - if [ -n "$1" ] ; then - fMnt="/mnt.$$" - mkdir $fMnt - mount -t zfs ${1} $fMnt >/dev/null - if [ $? -ne 0 ] ; then - echo "Failed to mount ${1}" >&2 - return - fi - else - fMnt="" - fi - - # Create our placeholder to save _load entries to parse - touch /tmp/.lRObjs.$$ - touch /tmp/.lSysCtls.$$ - - # Loader files, in order of which to read them - lFiles="${fMnt}/boot/loader.conf.local ${fMnt}/boot/loader.conf ${fMnt}/boot/loader.conf.trueos ${fMnt}/boot/loader.conf.pcbsd" - for f in $lFiles - do - if [ ! -e "$f" ] ; then continue ; fi - - # Lets parse any of the _load= lines - grep "_load=" ${f} | grep -v "^#" >/tmp/.lObjs.$$ - while read line - do - loadVal="`echo $line | cut -d '=' -f 1`" - # Is this value already set in a higher priority file? - grep -q "^${loadVal}" /tmp/.lRObjs.$$ - if [ $? -eq 0 ];then continue; fi - - # Save this value for later - echo "$line" >> /tmp/.lRObjs.$$ - haveObjs=1 - - done < /tmp/.lObjs.$$ - rm /tmp/.lObjs.$$ - - # Lets look for any sysctls to set - grep "." ${f} | grep "=" | grep -v "^#" | grep -v "_load" >/tmp/.sObjs.$$ - while read line - do - loadVal="`echo $line | cut -d '=' -f 1`" - # Is this value already set in a higher priority file? - grep -q "^${loadVal}" /tmp/.lSysCtls.$$ - if [ $? -eq 0 ];then continue; fi - - # Save this value for later - echo "$line" >> /tmp/.lSysCtls.$$ - haveSysCtls=1 - - done < /tmp/.sObjs.$$ - rm /tmp/.sObjs.$$ - done - - # Using GELI encryption? - haveGELI="false" - - # Now lets echo out the modules to load - if [ "$haveObjs" = "1" ] ; then - while read line - do - echo "$line" | grep -q '"YES"' - if [ $? -ne 0 ] ; then continue ; fi - module="`echo $line | cut -d '=' -f 1 | sed 's|_load||g'`" - # Try to locate module now - if [ -e "${fMnt}/boot/kernel/${module}.ko" ] ; then - mPath="kernel" - elif [ -e "${fMnt}/boot/modules/${module}.ko" ] ; then - mPath="modules" - else - # This isn't a module that we can see, lets set it as a variable - #echo "No such module $line, setting as a variable" >&2 - echo "$line" >> /tmp/.lSysCtls.$$ - continue - fi - - # Are we loading GELI module? - if [ "$module" = "geom_eli" ] ; then haveGELI="true" ; fi - - echo " kfreebsd_module_elf ${loadPrefix}/@/boot/${mPath}/${module}.ko" - done < /tmp/.lRObjs.$$ - fi - - # Add our compat kenv lines - echo " set kFreeBSD.bootfile=\"kernel\"" - echo " set kFreeBSD.kernel=\"kernel\"" - echo " set kFreeBSD.kernel_options=\"\"" - echo " set kFreeBSD.kernelname=\"/boot/kernel/kernel\"" - echo " set kFreeBSD.module_path=\"/boot/kernel;/boot/modules\"" - - # Any kenv to set? - if [ "$haveSysCtls" = "1" ] ; then - while read line - do - # Strip out the vfs.root.mountfrom, we set that elsewhere - echo "$line" | grep -q "vfs.root.mountfrom" - if [ $? -eq 0 ] ; then continue ; fi - - line="`echo $line | sed 's|"||g'`" - key="`echo $line | cut -d '=' -f 1`" - val="`echo $line | cut -d '=' -f 2`" - if [ -z "$key" -o -z "$val" ] ; then continue ; fi - echo " set kFreeBSD.${key}=\"${val}\"" - done < /tmp/.lSysCtls.$$ - fi - - rm /tmp/.lRObjs.$$ - rm /tmp/.lSysCtls.$$ - if [ -n "$1" ] ; then - umount /mnt.$$ >/dev/null - rmdir /mnt.$$ >/dev/null - fi - - # Set the grub.platform kenv variable - echo " set kFreeBSD.grub.platform=\"\$grub_platform\"" - - # See if we need to do GELI passphrase passthrough - if [ "$haveGELI" = "true" ] ; then - echo " set kFreeBSD.kern.geom.eli.passphrase=\"\$pass\"" - fi -} - -detect_beadm() -{ - /usr/bin/which -s beadm >/dev/null 2>/dev/null - if [ $? -ne 0 ] ; then return 0; fi - - # Check if we are running from the installer and use its beadm - if [ -e "/root/beadm.install" ] ; then - BEADM="/root/beadm.install" - - # Check if this is valid - testBE=`$BEADM list` - if [ -z "$testBE" ] ; then - # No BE's, lets switch back to regular mode - BEADM="`/usr/bin/which beadm`" - fi - else - BEADM="`/usr/bin/which beadm`" - fi - - ${BEADM} list >/dev/null 2>/dev/null - if [ $? -ne 0 ] ; then return 0; fi - - - if [ -e "/etc/defaults/pcbsd" ] ; then - NICK="PC-BSD" - else - NICK="TrueOS" - fi - - # Only list the default BE here - $BEADM list -H >/tmp/.grub-beadm.$$ 2>/dev/null - while read line - do - be=`echo $line | awk '{print $1}'` - flags=`echo $line | awk '{print $2}'` - - # Is this BE marked as wanting to be used for next boot? Make it the first one if so - if [ "$flags" = "NR" -o "$flags" = "R" ] ; then - BE_LIST="$be" - break - fi - done < /tmp/.grub-beadm.$$ - rm /tmp/.grub-beadm.$$ - - # Get list of beadm datasets - for b in $BE_LIST - do - # Got a beadm snapshot, lets get the complete dataset name - beLine=`${BEADM} list -a | grep "/$BEDS/${b}[[:space:]]"` - cdataset=`echo $beLine | awk '{print $1}'` - cdatadate=`echo $beLine | awk '{print $5}'` - cdatatime=`echo $beLine | awk '{print $6}'` - ztank=`echo $cdataset | cut -d '/' -f 1` - shortdataset="/`echo $cdataset | cut -d '/' -f 2-5`" - # Get the BE nickname if it exists - beNickName=`${BEADM} list | grep "^${b} " | tr -s ' ' | cut -d ' ' -f 7-12` - if [ -z "$beNickName" ] ; then - beNickName="$b" - fi - - # First part of this dataset - cat > /tmp/.grubdataset.$$.1 << EOF - insmod zfs - search --no-floppy -s -l $ztank -EOF - - # Second part of loader to save - cat > /tmp/.grubdataset.$$.2 << EOF - kfreebsd_module ${shortdataset}/@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache - set kFreeBSD.vfs.root.mountfrom=zfs:$cdataset -EOF - - # Now lets look for options in loader.conf to load - loadPrefix="${shortdataset}" - # If this is the current mounted dataset, we can skip mounting it - mount | grep -q -e "$cdataset on / (" -e "$cdataset on /mnt (" - if [ $? -eq 0 ] ; then - display_loaderopts >>/tmp/.grubdataset.$$.2 - else - display_loaderopts $cdataset >> /tmp/.grubdataset.$$.2 - fi - - # Lets start a submenu for each BE -cat << EOF - -submenu "${NICK} (${beNickName}) - ${cdatadate} ${cdatatime}" { -EOF - - # Lets do the default entry first - ################################# - cat << EOF - menuentry "Normal Bootup" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out}" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - } -EOF - - # Next lets do single user mode - ################################# - cat << EOF - menuentry "Single User Mode" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out} -s" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - } -EOF - - # Next lets do verbose mode - ################################# - cat << EOF - menuentry "Verbose Mode" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out} -v" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - } -EOF - - if [ -e "/etc/defaults/pcbsd" ] ; then - # Next lets do display wizard - ################################# - cat << EOF - menuentry "Run the Display Wizard" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out}" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - set kFreeBSD.runwiz=YES - } -EOF - # Now for vesa mode - ################################# - cat << EOF - menuentry "Run X in vesa mode" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out}" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - set kFreeBSD.xvesa=YES - } -EOF - # Now for non-xorg mode - ################################# - cat << EOF - menuentry "Boot to console (Disable X)" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out}" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - set kFreeBSD.noxorg=YES - } -EOF - fi - - - # Lastly lets close the submenu section - cat << EOF -} - -EOF - done - - # Cleanup after ourselves - if [ -e "/tmp/.grubdataset.$$.1" ] ; then - rm /tmp/.grubdataset.$$.1 - rm /tmp/.grubdataset.$$.2 - fi -} - -# Detect our types of disk layouts -detect_beadm - diff --git a/sysutils/grub2-pcbsd/files/30_os-prober.in b/sysutils/grub2-pcbsd/files/30_os-prober.in deleted file mode 100644 index 4a58fdecd57f..000000000000 --- a/sysutils/grub2-pcbsd/files/30_os-prober.in +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/sh -# -# Copyright 2015 iXsystems (Kris Moore) -# All rights reserved -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted providing that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -# Check if we have beadm installed, if not skip this file -if [ ! -e "/usr/local/sbin/beadm" ] ; then exit 0; fi - -# Script to detect other NON BSD OS's and add to grub.cfg - -check_ntfs_part() -{ - local disk="$1" - - fs_uuid=`grub-probe --device /dev/${disk} --target=fs_uuid 2>/dev/null` - if [ -z "$fs_uuid" ] ; then - echo "Warning: Could not get fs_uuid for $disk" - return - fi - - cat << EOF -menuentry "Microsoft Windows ($disk)" { - search --no-floppy --fs-uuid --set=root $fs_uuid - chainloader +1 -} -EOF -} - -print_uefichain() { - cat << EOF -menuentry "Chainload Disk (hd${hdnum} - $1)" { - set root=('hd${hdnum},${rootpre}1') - chainloader $1 -} - -EOF -} - -if [ -e "/usr/local/etc/default/grub" ] ; then - . /usr/local/etc/default/grub -fi -if [ -n "$GRUB_NODUALBOOT" ] ; then - exit 0 -fi - -# Look for file-systems on the zpool disk -for disk in `zpool status | grep ONLINE | grep -v "state:" | awk '{print $1}'` -do - disk="`echo $disk | sed 's|.eli||g'`" - if [ ! -e "/dev/$disk" ] ; then continue ; fi - - # Get the parent disk name - parentdisk=`grub-probe --target=disk --device /dev/$disk 2>/dev/null` - parentdisk="`echo $parentdisk | sed 's|/dev/||g'`" - if [ ! -e "/dev/$parentdisk" ] ; then continue ; fi - - for ldisk in `cd /dev/ && ls ${parentdisk}s[0-9] ${parentdisk}p[0-99] 2>/dev/null` - do - fs_type=`grub-probe --device /dev/${ldisk} --target=fs 2>/dev/null` - case $fs_type in - ntfs) check_ntfs_part "$ldisk" ;; # Start checking for NTFS - *) ;; # Unknown for now, add more! - esac - done -done - -# Look for other disks to chainload -hdnum=0 -for disk in `cd /dev/ && ls ada[0-9] da[0-9] 2>/dev/null` -do - # Skip disks apart of zpool - zpool status | grep ONLINE | grep -v "state:" | grep -q "$disk" - if [ $? -eq 0 ] ; then - hdnum=`expr $hdnum + 1` - continue - fi - - # Check if the first partition on this disk is EFI - if [ -e "/dev/${disk}s1" ] ; then - fp="/dev/${disk}s1" - rootpre="" - else - fp="/dev/${disk}p1" - rootpre="gpt" - fi - - # Add UEFI chainloader - if [ "`grub-probe --device -t fs $fp 2>/dev/null`" = "fat" ] ; then - - # Lets mount the FAT partition and look for UEFI boots - uefimnt="/tmp/.grub-uefi.$$" - if [ ! -d "$uefimnt" ] ; then mkdir $uefimnt; fi - mount_msdosfs $fp $uefimnt - if [ $? -eq 0 ] ; then - if [ -e "${uefimnt}/EFI/Boot/bootx64.efi" ] ; then - print_uefichain "/EFI/Boot/bootx64.efi" - fi - cd $uefimnt - for i in `find . | grep \.efi$ | grep -v "./EFI/Boot/bootx64.efi"` - do - i="`echo $i | sed 's|\./|/|g'`" - print_uefichain "$i" - done - cd /dev - umount $uefimnt - rmdir $uefimnt - fi - - else - # Add BIOS chainloader - cat << EOF -menuentry "Chainload Disk (hd${hdnum})" { - set root=(hd${hdnum}) - chainloader +1 -} -EOF - fi - hdnum=`expr $hdnum + 1` -done diff --git a/sysutils/grub2-pcbsd/files/50_otherbe.in b/sysutils/grub2-pcbsd/files/50_otherbe.in deleted file mode 100644 index 6d527cf68b82..000000000000 --- a/sysutils/grub2-pcbsd/files/50_otherbe.in +++ /dev/null @@ -1,396 +0,0 @@ -#!/bin/sh -# -# Copyright 2015 iXsystems (Kris Moore) -# All rights reserved -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted providing that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - -# Script to detect TrueOS / PC-BSD disk installations and create grub -# entries for them - -# Check if we have beadm installed, if not skip this file -if [ ! -e "/usr/local/sbin/beadm" ] ; then exit 0; fi - -ROOTFS=`mount | awk '/ \/ / {print $1}'` -BEDS="$( echo ${ROOTFS} | awk -F '/' '{print $2}' )" -if [ "$BEDS" = "dev" ] ; then BEDS="ROOT"; fi - -serial=0; -console=0; -for x in ${GRUB_TERMINAL_OUTPUT}; do - if [ xserial = "x$x" ]; then - serial=1; - fi - if [ xgfxterm = "x$x" ]; then - console=1; - fi - if [ xconsole = "x$x" ]; then - console=1; - fi -done - -if [ "x$serial" = "x1" ]; then - if [ "x$console" = "x1" ]; then - out="-Dh" - else - out="-h" - fi -fi - -display_loaderopts() -{ - # Optional ARG1, set to a ZFS dataset to mount and read values from - if [ -n "$1" ] ; then - fMnt="/mnt.$$" - mkdir $fMnt - mount -t zfs ${1} $fMnt >/dev/null - if [ $? -ne 0 ] ; then - echo "Failed to mount ${1}" >&2 - return - fi - else - fMnt="" - fi - - # Create our placeholder to save _load entries to parse - touch /tmp/.lRObjs.$$ - touch /tmp/.lSysCtls.$$ - - # Loader files, in order of which to read them - lFiles="${fMnt}/boot/loader.conf.local ${fMnt}/boot/loader.conf ${fMnt}/boot/loader.conf.trueos ${fMnt}/boot/loader.conf.pcbsd" - for f in $lFiles - do - if [ ! -e "$f" ] ; then continue ; fi - - # Lets parse any of the _load= lines - grep "_load=" ${f} | grep -v "^#" >/tmp/.lObjs.$$ - while read line - do - loadVal="`echo $line | cut -d '=' -f 1`" - # Is this value already set in a higher priority file? - grep -q "^${loadVal}" /tmp/.lRObjs.$$ - if [ $? -eq 0 ];then continue; fi - - # Save this value for later - echo "$line" >> /tmp/.lRObjs.$$ - haveObjs=1 - - done < /tmp/.lObjs.$$ - rm /tmp/.lObjs.$$ - - # Lets look for any sysctls to set - grep "." ${f} | grep "=" | grep -v "^#" | grep -v "_load" >/tmp/.sObjs.$$ - while read line - do - loadVal="`echo $line | cut -d '=' -f 1`" - # Is this value already set in a higher priority file? - grep -q "^${loadVal}" /tmp/.lSysCtls.$$ - if [ $? -eq 0 ];then continue; fi - - # Save this value for later - echo "$line" >> /tmp/.lSysCtls.$$ - haveSysCtls=1 - - done < /tmp/.sObjs.$$ - rm /tmp/.sObjs.$$ - done - - # Using GELI encryption? - haveGELI="false" - - # Now lets echo out the modules to load - if [ "$haveObjs" = "1" ] ; then - while read line - do - echo "$line" | grep -q '"YES"' - if [ $? -ne 0 ] ; then continue ; fi - module="`echo $line | cut -d '=' -f 1 | sed 's|_load||g'`" - # Try to locate module now - if [ -e "${fMnt}/boot/kernel/${module}.ko" ] ; then - mPath="kernel" - elif [ -e "${fMnt}/boot/modules/${module}.ko" ] ; then - mPath="modules" - else - # This isn't a module that we can see, lets set it as a variable - #echo "No such module $line, setting as a variable" >&2 - echo "$line" >> /tmp/.lSysCtls.$$ - continue - fi - - # Are we loading GELI module? - if [ "$module" = "geom_eli" ] ; then haveGELI="true" ; fi - - echo " kfreebsd_module_elf ${loadPrefix}/@/boot/${mPath}/${module}.ko" - done < /tmp/.lRObjs.$$ - fi - - # Add our compat kenv lines - echo " set kFreeBSD.bootfile=\"kernel\"" - echo " set kFreeBSD.kernel=\"kernel\"" - echo " set kFreeBSD.kernel_options=\"\"" - echo " set kFreeBSD.kernelname=\"/boot/kernel/kernel\"" - echo " set kFreeBSD.module_path=\"/boot/kernel;/boot/modules\"" - - # Any kenv to set? - if [ "$haveSysCtls" = "1" ] ; then - while read line - do - # Strip out the vfs.root.mountfrom, we set that elsewhere - echo "$line" | grep -q "vfs.root.mountfrom" - if [ $? -eq 0 ] ; then continue ; fi - - line="`echo $line | sed 's|"||g'`" - key="`echo $line | cut -d '=' -f 1`" - val="`echo $line | cut -d '=' -f 2`" - if [ -z "$key" -o -z "$val" ] ; then continue ; fi - echo " set kFreeBSD.${key}=\"${val}\"" - done < /tmp/.lSysCtls.$$ - fi - - rm /tmp/.lRObjs.$$ - rm /tmp/.lSysCtls.$$ - if [ -n "$1" ] ; then - umount /mnt.$$ >/dev/null - rmdir /mnt.$$ >/dev/null - fi - - # Set the grub.platform kenv variable - echo " set kFreeBSD.grub.platform=\"\$grub_platform\"" - - # See if we need to do GELI passphrase passthrough - if [ "$haveGELI" = "true" ] ; then - echo " set kFreeBSD.kern.geom.eli.passphrase=\"\$pass\"" - fi -} - -detect_beadm() -{ - /usr/bin/which -s beadm >/dev/null 2>/dev/null - if [ $? -ne 0 ] ; then return 0; fi - - # Check if we are running from the installer and use its beadm - if [ -e "/root/beadm.install" ] ; then - BEADM="/root/beadm.install" - - # Check if this is valid - testBE=`$BEADM list` - if [ -z "$testBE" ] ; then - # No BE's, lets switch back to regular mode - BEADM="`/usr/bin/which beadm`" - fi - else - BEADM="`/usr/bin/which beadm`" - fi - - ${BEADM} list >/dev/null 2>/dev/null - if [ $? -ne 0 ] ; then return 0; fi - - - if [ -e "/etc/defaults/pcbsd" ] ; then - NICK="PC-BSD" - else - NICK="TrueOS" - fi - - # Now we will list all the non-default BEs - $BEADM list -H >/tmp/.grub-beadm.$$ 2>/dev/null - while read line - do - be=`echo $line | awk '{print $1}'` - flags=`echo $line | awk '{print $2}'` - - # Skip the active BE - if [ "$flags" = "NR" -o "$flags" = "R" ] ; then - continue - fi - BE_LIST="${be} ${BE_LIST}" - done < /tmp/.grub-beadm.$$ - rm /tmp/.grub-beadm.$$ - - if [ -z "$BE_LIST" ] ; then return; fi - - echo "submenu \"Boot Environment Menu\" {" - - # Get list of beadm datasets - for b in $BE_LIST - do - # Got a beadm snapshot, lets get the complete dataset name - beLine=`${BEADM} list -a | grep "/$BEDS/${b}"` - cdataset=`echo $beLine | awk '{print $1}'` - cdatadate=`echo $beLine | awk '{print $5}'` - cdatatime=`echo $beLine | awk '{print $6}'` - ztank=`echo $cdataset | cut -d '/' -f 1` - shortdataset="/`echo $cdataset | cut -d '/' -f 2-5`" - # Get the BE nickname if it exists - beNickName=`${BEADM} list | grep "^${b} " | tr -s ' ' | cut -d ' ' -f 7-12` - if [ -z "$beNickName" ] ; then - beNickName="$b" - fi - - # First part of this dataset - cat > /tmp/.grubdataset.$$.1 << EOF - insmod zfs - search --no-floppy -s -l $ztank -EOF - - # Second part of loader to save - cat > /tmp/.grubdataset.$$.2 << EOF - kfreebsd_module ${shortdataset}/@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache - set kFreeBSD.vfs.root.mountfrom=zfs:$cdataset -EOF - - # Now lets look for options in loader.conf to load - loadPrefix="${shortdataset}" - # If this is the current mounted dataset, we can skip mounting it - mount | grep -q -e "$cdataset on / (" -e "$cdataset on /mnt (" - if [ $? -eq 0 ] ; then - display_loaderopts >>/tmp/.grubdataset.$$.2 - else - display_loaderopts $cdataset >> /tmp/.grubdataset.$$.2 - fi - - # Lets start a submenu for each BE -cat << EOF - -submenu "${NICK} (${beNickName}) - ${cdatadate} ${cdatatime}" { -EOF - - # Lets do the default entry first - ################################# - cat << EOF - menuentry "Normal Bootup" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out}" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - } -EOF - - # Next lets do single user mode - ################################# - cat << EOF - menuentry "Single User Mode" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out} -s" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - } -EOF - - # Next lets do verbose mode - ################################# - cat << EOF - menuentry "Verbose Mode" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out} -v" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - } -EOF - - if [ -e "/etc/defaults/pcbsd" ] ; then - # Next lets do display wizard - ################################# - cat << EOF - menuentry "Run the Display Wizard" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out}" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - set kFreeBSD.runwiz=YES - } -EOF - # Now for vesa mode - ################################# - cat << EOF - menuentry "Run X in vesa mode" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out}" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - set kFreeBSD.xvesa=YES - } -EOF - # Now for non-xorg mode - ################################# - cat << EOF - menuentry "Boot to console (Disable X)" { -EOF - # Get the dataset guts - cat /tmp/.grubdataset.$$.1 - echo " kfreebsd ${shortdataset}/@/boot/kernel/kernel ${out}" - echo " kfreebsd_loadenv ${shortdataset}@/boot/device.hints" - cat /tmp/.grubdataset.$$.2 - - # Set any options - cat << EOF - set kFreeBSD.noxorg=YES - } -EOF - fi - - - # Lastly lets close the submenu section - cat << EOF -} - -EOF - done - - echo "}" - echo "" - - # Cleanup after ourselves - if [ -e "/tmp/.grubdataset.$$.1" ] ; then - rm /tmp/.grubdataset.$$.1 - rm /tmp/.grubdataset.$$.2 - fi -} - -# Detect our types of disk layouts -detect_beadm - diff --git a/sysutils/grub2-pcbsd/files/patch-configure.ac b/sysutils/grub2-pcbsd/files/patch-configure.ac deleted file mode 100644 index 0410fc189060..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-configure.ac +++ /dev/null @@ -1,20 +0,0 @@ ---- configure.ac.orig 2015-06-03 14:54:01 UTC -+++ configure.ac -@@ -1459,7 +1459,7 @@ fi - - if test x"$starfield_excuse" = x; then - for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do -- for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/truetype/ttf-dejavu /usr/share/fonts/dejavu /usr/share/fonts/truetype; do -+ for dir in . /usr/src /usr/local/lib/X11/fonts/dejavu /usr/share/fonts/truetype/ttf-dejavu /usr/local/share/fonts/dejavu /usr/share/fonts/truetype; do - if test -f "$dir/DejaVuSans.$ext"; then - DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext" - break 2 -@@ -1481,7 +1481,7 @@ AC_SUBST([DJVU_FONT_SOURCE]) - FONT_SOURCE= - - for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do -- for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont /usr/share/fonts/uni /usr/share/fonts/truetype/unifont /usr/share/fonts/misc; do -+ for dir in . /usr/src /usr/local/lib/X11/fonts/local /usr/local/share/fonts/unifont /usr/local/share/fonts/gnu-unifont /usr/share/fonts/truetype/unifont /usr/share/fonts/misc; do - if test -f "$dir/unifont.$ext"; then - md5="$(md5sum "$dir/unifont.$ext"|awk '{ print $1; }')" - # PCF and BDF from version 6.3 isn't hanled properly by libfreetype. diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_disk_geli.c b/sysutils/grub2-pcbsd/files/patch-grub-core_disk_geli.c deleted file mode 100644 index f8d1f9bed333..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-grub-core_disk_geli.c +++ /dev/null @@ -1,12 +0,0 @@ ---- grub-core/disk/geli.c.orig 2015-01-30 16:34:55 UTC -+++ grub-core/disk/geli.c -@@ -445,6 +445,9 @@ recover_key (grub_disk_t source, grub_cr - if (!grub_password_get (passphrase, MAX_PASSPHRASE)) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied"); - -+ /* Set the GELI passphrase to GRUB env, for passing to FreeBSD kernel */ -+ grub_env_set ("gelipassphrase", passphrase); -+ - /* Calculate the PBKDF2 of the user supplied passphrase. */ - if (grub_le_to_cpu32 (header.niter) != 0) - { diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_lib_libgcrypt_src_types.h b/sysutils/grub2-pcbsd/files/patch-grub-core_lib_libgcrypt_src_types.h deleted file mode 100644 index 9b353e42f498..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-grub-core_lib_libgcrypt_src_types.h +++ /dev/null @@ -1,11 +0,0 @@ ---- grub-core/lib/libgcrypt/src/types.h.orig 2014-03-03 16:00:26 UTC -+++ grub-core/lib/libgcrypt/src/types.h -@@ -113,6 +113,8 @@ - #endif - #endif - -+typedef uint64_t u64; -+ - typedef union { - int a; - short b; diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_loader_i386_bsd.c b/sysutils/grub2-pcbsd/files/patch-grub-core_loader_i386_bsd.c deleted file mode 100644 index b2e3d9793f4f..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-grub-core_loader_i386_bsd.c +++ /dev/null @@ -1,18 +0,0 @@ ---- grub-core/loader/i386/bsd.c.orig 2015-01-30 16:34:55 UTC -+++ grub-core/loader/i386/bsd.c -@@ -416,11 +416,14 @@ grub_freebsd_add_meta_module (const char - grub_addr_t addr, grub_uint32_t size) - { - const char *name; -- name = grub_strrchr (filename, '/'); -+ /* Don't strip the full path, some FreeBSD functionality, such -+ * as dtrace, rely on this. Instead only strip out the portion after ZFS @ sign */ -+ name = grub_strrchr (filename, '@'); - if (name) - name++; - else - name = filename; -+ - if (grub_strcmp (type, "/boot/zfs/zpool.cache") == 0) - name = "/boot/zfs/zpool.cache"; - diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_freebsd_getroot.c b/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_freebsd_getroot.c deleted file mode 100644 index a25e60121570..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_freebsd_getroot.c +++ /dev/null @@ -1,108 +0,0 @@ ---- grub-core/osdep/freebsd/getroot.c.orig 2015-01-23 02:27:45 UTC -+++ grub-core/osdep/freebsd/getroot.c -@@ -296,6 +296,105 @@ grub_util_get_grub_dev_os (const char *o - return grub_dev; - } - -+int grub_util_check_geom_label(const char *name) -+{ -+ struct gmesh mesh; -+ struct gclass *class; -+ struct ggeom *geom; -+ struct gprovider *pp; -+ struct gprovider *pplabel; -+ struct gconsumer *cp; -+ const char *geom_name; -+ const char *test_name; -+ int err; -+ -+ err = geom_gettree (&mesh); -+ if (err != 0) -+ grub_util_error ("%s", _("couldn't open geom")); -+ -+ LIST_FOREACH (class, &mesh.lg_class, lg_class) -+ if (strcasecmp (class->lg_name, "label") == 0) -+ break; -+ if (!class) -+ grub_util_error ("%s", _("couldn't find geom `label' class")); -+ -+ if (strncmp (name, "/dev/", sizeof ("/dev/") - 1) == 0) -+ test_name = name + sizeof ("/dev/") - 1; -+ else -+ test_name = name; -+ -+ LIST_FOREACH (geom, &class->lg_geom, lg_geom) -+ { -+ LIST_FOREACH(pp, &geom->lg_provider, lg_provider) -+ { -+ geom_name = pp->lg_name; -+ if (strcasecmp (geom_name, test_name) != 0) -+ continue; -+ -+ LIST_FOREACH(cp, &geom->lg_consumer, lg_consumer) -+ { -+ pplabel = cp->lg_provider; -+ if (pplabel == NULL) -+ continue; -+ return 1; -+ } -+ } -+ } -+ return 0; -+} -+ -+const char * -+grub_util_convert_geom_label_to_dev (const char *name, int *full_path) -+{ -+ struct gmesh mesh; -+ struct gclass *class; -+ struct ggeom *geom; -+ struct gprovider *pp; -+ struct gprovider *pplabel; -+ struct gconsumer *cp; -+ static char buf[256]; -+ const char *geom_name; -+ int err; -+ -+ grub_util_info ("Converting label '%s' to device", name); -+ -+ err = geom_gettree (&mesh); -+ if (err != 0) -+ grub_util_error ("%s", _("couldn't open geom")); -+ -+ LIST_FOREACH (class, &mesh.lg_class, lg_class) -+ if (strcasecmp (class->lg_name, "label") == 0) -+ break; -+ if (!class) -+ grub_util_error ("%s", _("couldn't find geom `label' class")); -+ -+ -+ LIST_FOREACH (geom, &class->lg_geom, lg_geom) -+ { -+ LIST_FOREACH(pp, &geom->lg_provider, lg_provider) -+ { -+ geom_name = pp->lg_name; -+ if (strcasecmp (geom_name, name) != 0) -+ continue; -+ -+ LIST_FOREACH(cp, &geom->lg_consumer, lg_consumer) -+ { -+ pplabel = cp->lg_provider; -+ if (pplabel == NULL) -+ continue; -+ -+ if ( full_path ) -+ snprintf(buf, sizeof(buf), "/dev/%s", pplabel->lg_name); -+ else -+ snprintf(buf, sizeof(buf), "%s", pplabel->lg_name); -+ return buf; -+ } -+ } -+ } -+ grub_util_error ("%s", _("couldn't convert gptid to real device name")); -+ return 0; -+} -+ - /* FIXME: geom actually gives us the whole container hierarchy. - It can be used more efficiently than this. */ - void diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_getroot.c b/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_getroot.c deleted file mode 100644 index 824a9c552c1e..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_getroot.c +++ /dev/null @@ -1,15 +0,0 @@ ---- grub-core/osdep/unix/getroot.c.orig 2015-06-03 14:54:01 UTC -+++ grub-core/osdep/unix/getroot.c -@@ -507,6 +507,12 @@ grub_guess_root_devices (const char *dir - if (!os_dev) - os_dev = find_root_devices_from_libzfs (dir); - -+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -+ if (os_dev) -+ if ( grub_util_check_geom_label(os_dev) ) -+ os_dev = grub_util_convert_geom_label_to_dev (os_dev + sizeof ("/dev/") - 1, 1); -+#endif -+ - if (os_dev) - { - char **cur; diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_platform.c b/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_platform.c deleted file mode 100644 index 15b7cb871052..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_platform.c +++ /dev/null @@ -1,100 +0,0 @@ ---- grub-core/osdep/unix/platform.c.orig 2014-03-03 16:00:26 UTC -+++ grub-core/osdep/unix/platform.c -@@ -81,52 +81,8 @@ get_ofpathname (const char *dev) - static void - grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) - { -- int fd; -- pid_t pid = grub_util_exec_pipe ((const char * []){ "efibootmgr", NULL }, &fd); -- char *line = NULL; -- size_t len = 0; -- -- if (!pid) -- { -- grub_util_warn (_("Unable to open stream from %s: %s"), -- "efibootmgr", strerror (errno)); -- return; -- } -- -- FILE *fp = fdopen (fd, "r"); -- if (!fp) -- { -- grub_util_warn (_("Unable to open stream from %s: %s"), -- "efibootmgr", strerror (errno)); -- return; -- } -- -- line = xmalloc (80); -- len = 80; -- while (1) -- { -- int ret; -- char *bootnum; -- ret = getline (&line, &len, fp); -- if (ret == -1) -- break; -- if (grub_memcmp (line, "Boot", sizeof ("Boot") - 1) != 0 -- || line[sizeof ("Boot") - 1] < '0' -- || line[sizeof ("Boot") - 1] > '9') -- continue; -- if (!strcasestr (line, efi_distributor)) -- continue; -- bootnum = line + sizeof ("Boot") - 1; -- bootnum[4] = '\0'; -- if (!verbosity) -- grub_util_exec ((const char * []){ "efibootmgr", "-q", -- "-b", bootnum, "-B", NULL }); -- else -- grub_util_exec ((const char * []){ "efibootmgr", -- "-b", bootnum, "-B", NULL }); -- } -- -- free (line); -+ // We don't have efibootmgr on FreeBSD, have to set externally -+ return; - } - - void -@@ -134,40 +90,8 @@ grub_install_register_efi (grub_device_t - const char *efifile_path, - const char *efi_distributor) - { -- const char * efidir_disk; -- int efidir_part; -- efidir_disk = grub_util_biosdisk_get_osdev (efidir_grub_dev->disk); -- efidir_part = efidir_grub_dev->disk->partition ? efidir_grub_dev->disk->partition->number + 1 : 1; -- -- if (grub_util_exec_redirect_null ((const char * []){ "efibootmgr", "--version", NULL })) -- { -- /* TRANSLATORS: This message is shown when required executable `%s' -- isn't found. */ -- grub_util_error (_("%s: not found"), "efibootmgr"); -- } -- -- /* On Linux, we need the efivars kernel modules. */ --#ifdef __linux__ -- grub_util_exec ((const char * []){ "modprobe", "-q", "efivars", NULL }); --#endif -- /* Delete old entries from the same distributor. */ -- grub_install_remove_efi_entries_by_distributor (efi_distributor); -- -- char *efidir_part_str = xasprintf ("%d", efidir_part); -- -- if (!verbosity) -- grub_util_exec ((const char * []){ "efibootmgr", "-q", -- "-c", "-d", efidir_disk, -- "-p", efidir_part_str, "-w", -- "-L", efi_distributor, "-l", -- efifile_path, NULL }); -- else -- grub_util_exec ((const char * []){ "efibootmgr", -- "-c", "-d", efidir_disk, -- "-p", efidir_part_str, "-w", -- "-L", efi_distributor, "-l", -- efifile_path, NULL }); -- free (efidir_part_str); -+ // We don't have efibootmgr on FreeBSD, have to set externally -+ return; - } - - void diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_partmap_gpt.c b/sysutils/grub2-pcbsd/files/patch-grub-core_partmap_gpt.c deleted file mode 100644 index 5ed32e5fd0ae..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-grub-core_partmap_gpt.c +++ /dev/null @@ -1,20 +0,0 @@ ---- grub-core/partmap/gpt.c.orig 2014-10-20 16:16:07 UTC -+++ grub-core/partmap/gpt.c -@@ -37,6 +37,7 @@ static const grub_gpt_part_type_t grub_g - - #ifdef GRUB_UTIL - static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT; -+static const grub_gpt_part_type_t grub_gpt_partition_type_freebsd_boot = GRUB_GPT_PARTITION_TYPE_FREEBSD_BOOT; - #endif - - /* 512 << 7 = 65536 byte sectors. */ -@@ -155,7 +156,8 @@ find_usable_region (grub_disk_t disk __a - disk->partition = p2; - - /* If there's an embed region, it is in a dedicated partition. */ -- if (! grub_memcmp (&gptdata.type, &grub_gpt_partition_type_bios_boot, 16)) -+ if (! grub_memcmp (&gptdata.type, &grub_gpt_partition_type_bios_boot, 16) || -+ ! grub_memcmp (&gptdata.type, &grub_gpt_partition_type_freebsd_boot, 16)) - { - ctx->start = p->start; - ctx->len = p->len; diff --git a/sysutils/grub2-pcbsd/files/patch-include_grub_emu_getroot.h b/sysutils/grub2-pcbsd/files/patch-include_grub_emu_getroot.h deleted file mode 100644 index 10e7f60c58ae..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-include_grub_emu_getroot.h +++ /dev/null @@ -1,11 +0,0 @@ ---- include/grub/emu/getroot.h.orig 2015-01-23 02:27:45 UTC -+++ include/grub/emu/getroot.h -@@ -44,6 +44,8 @@ char *grub_util_get_grub_dev (const char - #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) - void grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out, - char **name_out); -+int grub_util_check_geom_label(const char *name); -+const char *grub_util_convert_geom_label_to_dev (const char *name, int *full_path); - #endif - - #include <sys/stat.h> diff --git a/sysutils/grub2-pcbsd/files/patch-include_grub_gpt__partition.h b/sysutils/grub2-pcbsd/files/patch-include_grub_gpt__partition.h deleted file mode 100644 index d8da78eea7b3..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-include_grub_gpt__partition.h +++ /dev/null @@ -1,17 +0,0 @@ ---- include/grub/gpt_partition.h.orig 2014-03-03 16:00:26 UTC -+++ include/grub/gpt_partition.h -@@ -43,6 +43,14 @@ typedef struct grub_gpt_part_type grub_g - { 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49 } \ - } - -+#define GRUB_GPT_PARTITION_TYPE_FREEBSD_BOOT \ -+ { grub_cpu_to_le32_compile_time (0x83bd6b9d), \ -+ grub_cpu_to_le16_compile_time (0x7f41), \ -+ grub_cpu_to_le16_compile_time (0x11dc), \ -+ { 0xbe, 0x0b, 0x00, 0x15, 0x60, 0xb8, 0x4f, 0x0f } \ -+ } -+ -+ - #define GRUB_GPT_PARTITION_TYPE_LDM \ - { grub_cpu_to_le32_compile_time (0x5808C8AAU),\ - grub_cpu_to_le16_compile_time (0x7E8F), \ diff --git a/sysutils/grub2-pcbsd/files/patch-po_LINGUAS b/sysutils/grub2-pcbsd/files/patch-po_LINGUAS deleted file mode 100644 index 2dbcb6e4d4cc..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-po_LINGUAS +++ /dev/null @@ -1,5 +0,0 @@ ---- po/LINGUAS.orig 2015-01-30 16:30:32 UTC -+++ po/LINGUAS -@@ -1 +1 @@ --ast ca da de de@hebrew de_CH en@arabic en@cyrillic en@greek en@hebrew en@piglatin en@quot eo es fi fr gl hu id it ja lt nb nl pa pl pt_BR ru sl sv tr uk vi zh_CN zh_TW -+ast ca da de eo es fi fr gl hu id it ja lt nb nl pa pl pt_BR ru sl sv tr uk vi zh_CN zh_TW diff --git a/sysutils/grub2-pcbsd/files/patch-util_grub-install.c b/sysutils/grub2-pcbsd/files/patch-util_grub-install.c deleted file mode 100644 index bee5b764e6db..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-util_grub-install.c +++ /dev/null @@ -1,19 +0,0 @@ ---- util/grub-install.c.orig 2015-06-03 14:54:01 UTC -+++ util/grub-install.c -@@ -236,7 +236,16 @@ argp_parser (int key, char *arg, struct - case ARGP_KEY_ARG: - if (install_device) - grub_util_error ("%s", _("More than one install device?")); -+#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) -+ /* Check if passing a FreeBSD geom label */ -+ if ( grub_util_check_geom_label(arg) ) -+ install_device = \ -+ xstrdup(grub_util_convert_geom_label_to_dev (arg + sizeof ("/dev/") - 1, 1)); -+ else -+ install_device = xstrdup (arg); -+#else - install_device = xstrdup (arg); -+#endif - return 0; - - default: diff --git a/sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig.in b/sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig.in deleted file mode 100644 index 3fb66966ecc0..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig.in +++ /dev/null @@ -1,14 +0,0 @@ ---- util/grub-mkconfig.in.orig 2015-06-03 14:54:01 UTC -+++ util/grub-mkconfig.in -@@ -281,3 +281,11 @@ fi - - gettext "done" >&2 - echo >&2 -+ -+# If pcbsd-utils are installed, the restamp-grub command will exist -+# Use it to do the grub-install and copy grub.cfg to other BEs -+which restamp-grub >/dev/null 2>/dev/null -+if [ $? -eq 0 ] ; then -+ restamp-grub -+fi -+ diff --git a/sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig__lib.in b/sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig__lib.in deleted file mode 100644 index 219e3c95aee8..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig__lib.in +++ /dev/null @@ -1,21 +0,0 @@ ---- util/grub-mkconfig_lib.in.orig 2015-06-03 14:54:01 UTC -+++ util/grub-mkconfig_lib.in -@@ -139,7 +139,17 @@ prepare_grub_to_access_device () - echo "insmod ${module}" - done - -- fs="`"${grub_probe}" --device $@ --target=fs`" -+ # KPM - 6-24-2013 -+ # Add this work-around since GRUB doesn't like to identify ZFS -+ # partitions which are in a raidz configuration, gives Unknown FS error -+ # We can instead look at zpool to see if this device is used though -+ zpool status 2>/dev/null | grep -q "`echo ${device} | sed 's|/dev/||g'`" -+ if [ $? -eq 0 ] ; then -+ fs="zfs" -+ else -+ fs="`"${grub_probe}" --device $@ --target=fs`" -+ fi -+ - for module in ${fs} ; do - echo "insmod ${module}" - done diff --git a/sysutils/grub2-pcbsd/files/patch-util_grub-probe.c b/sysutils/grub2-pcbsd/files/patch-util_grub-probe.c deleted file mode 100644 index eb75b0c1587e..000000000000 --- a/sysutils/grub2-pcbsd/files/patch-util_grub-probe.c +++ /dev/null @@ -1,19 +0,0 @@ ---- util/grub-probe.c.orig 2015-06-03 14:54:01 UTC -+++ util/grub-probe.c -@@ -805,7 +805,16 @@ argp_parser (int key, char *arg, struct - - case ARGP_KEY_ARG: - assert (arguments->ndevices < arguments->device_max); -+#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) -+ /* Check if passing a FreeBSD geom label */ -+ if ( grub_util_check_geom_label(arg) ) -+ arguments->devices[arguments->ndevices++] = \ -+ xstrdup(grub_util_convert_geom_label_to_dev (arg + sizeof ("/dev/") - 1, 1)); -+ else -+ arguments->devices[arguments->ndevices++] = xstrdup(arg); -+#else - arguments->devices[arguments->ndevices++] = xstrdup(arg); -+#endif - break; - - default: |