]> Frank Brehm's Git Trees - config/uhu1/etc.git/commitdiff
saving uncommitted changes in /etc prior to emerge run
authorroot <root@uhu1.uhu-banane.de>
Fri, 11 Nov 2016 13:34:22 +0000 (14:34 +0100)
committerroot <root@uhu1.uhu-banane.de>
Fri, 11 Nov 2016 13:34:22 +0000 (14:34 +0100)
grub.d/00_header
grub.d/10_linux
grub.d/20_linux_xen
grub.d/30_os-prober

index fb9b85943240ffdb13769d2911ec4603aba3c3bf..0f2f784ea83c3474bd635e2cc3d56b3c7059a335 100755 (executable)
@@ -25,7 +25,7 @@ grub_lang=`echo $LANG | cut -d . -f 1`
 export TEXTDOMAIN=grub
 export TEXTDOMAINDIR="${datarootdir}/locale"
 
-. "/usr/share/grub/grub-mkconfig_lib"
+. "$pkgdatadir/grub-mkconfig_lib"
 
 # Do this as early as possible, since other commands might depend on it.
 # (e.g. the `loadfont' command might need lvm or raid modules)
@@ -285,7 +285,7 @@ make_timeout ()
     if [ "x${3}" != "x" ] ; then
        timeout="${2}"
        style="${3}"
-    elif [ "x${1}" != "x" -a "x${1}" != "x0" ] ; then
+    elif [ "x${1}" != "x" ] && [ "x${1}" != "x0" ] ; then
        # Handle the deprecated GRUB_HIDDEN_TIMEOUT scheme.
        timeout="${1}"
        if [ "x${2}" != "x0" ] ; then
index 0b2914f433f526901833f77ceec0b78003eebc44..3f77f7bf87fcbbdc854f0fad0e2410910ae4170d 100755 (executable)
@@ -21,7 +21,7 @@ prefix="/usr"
 exec_prefix="/usr"
 datarootdir="/usr/share"
 
-. "/usr/share/grub/grub-mkconfig_lib"
+. "$pkgdatadir/grub-mkconfig_lib"
 
 export TEXTDOMAIN=grub
 export TEXTDOMAINDIR="${datarootdir}/locale"
@@ -43,9 +43,11 @@ case ${GRUB_DEVICE} in
   ;;
 esac
 
+# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter
+# and mounting btrfs requires user space scanning, so force UUID in this case.
 if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
     || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
-    || uses_abstraction "${GRUB_DEVICE}" lvm; then
+    || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then
   LINUX_ROOT_DEVICE=${GRUB_DEVICE}
 else
   LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
index efc272502d19146578d37979eb5b3097eff6291f..b3ac8549847fd460969eba8d6799c28bb0ea49de 100755 (executable)
@@ -21,7 +21,7 @@ prefix="/usr"
 exec_prefix="/usr"
 datarootdir="/usr/share"
 
-. "/usr/share/grub/grub-mkconfig_lib"
+. "$pkgdatadir/grub-mkconfig_lib"
 
 export TEXTDOMAIN=grub
 export TEXTDOMAINDIR="${datarootdir}/locale"
@@ -43,9 +43,11 @@ case ${GRUB_DEVICE} in
   ;;
 esac
 
+# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter
+# and mounting btrfs requires user space scanning, so force UUID in this case.
 if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
     || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
-    || uses_abstraction "${GRUB_DEVICE}" lvm; then
+    || test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm; then
   LINUX_ROOT_DEVICE=${GRUB_DEVICE}
 else
   LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
index d7e7923b277b064b049540219df9d5308afb961d..aa66c6e9a274452c3dc029b38bc0cb6ec79b3faa 100755 (executable)
@@ -24,13 +24,13 @@ datarootdir="/usr/share"
 export TEXTDOMAIN=grub
 export TEXTDOMAINDIR="${datarootdir}/locale"
 
-. "/usr/share/grub/grub-mkconfig_lib"
+. "$pkgdatadir/grub-mkconfig_lib"
 
 if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
   exit 0
 fi
 
-if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then
+if [ -z "`which os-prober 2> /dev/null`" ] || [ -z "`which linux-boot-prober 2> /dev/null`" ] ; then
   # missing os-prober and/or linux-boot-prober
   exit 0
 fi
@@ -71,6 +71,9 @@ EOF
            fi
            if [ /kernelcache -nt /System/Library/Extensions ]; then
               $1 /kernelcache boot-uuid=\${uuid} rd=*uuid
+           elif [ -f /System/Library/Kernels/kernel ]; then
+              $1 /System/Library/Kernels/kernel boot-uuid=\${uuid} rd=*uuid
+              xnu_kextdir /System/Library/Extensions
            else
               $1 /mach_kernel boot-uuid=\${uuid} rd=*uuid
               if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
@@ -112,16 +115,17 @@ for OS in ${OSPROBED} ; do
   LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
   LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
   BOOT="`echo ${OS} | cut -d ':' -f 4`"
-  UUID="`${grub_probe} --target=fs_uuid --device ${DEVICE%@*}`"
-  EXPUUID="$UUID"
+  if UUID="`${grub_probe} --target=fs_uuid --device ${DEVICE%@*}`"; then
+    EXPUUID="$UUID"
 
-  if [ x"${DEVICE#*@}" != x ] ; then
+    if [ x"${DEVICE#*@}" != x ] ; then
       EXPUUID="${EXPUUID}@${DEVICE#*@}"
-  fi
+    fi
 
-  if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" -a "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then
-    echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2
-    continue
+    if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" ] && [ "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then
+      echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2
+      continue
+    fi
   fi
 
   BTRFS="`echo ${OS} | cut -d ':' -f 5`"
@@ -134,6 +138,9 @@ for OS in ${OSPROBED} ; do
     LONGNAME="${LABEL}"
   fi
 
+  # os-prober returns text string followed by optional counter
+  CLASS="--class $(echo "${LABEL}" | LC_ALL=C sed 's,[[:digit:]]*$,,' | cut -d' ' -f1 | tr 'A-Z' 'a-z' | LC_ALL=C sed 's,[^[:alnum:]_],_,g')"
+
   gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2
 
   case ${BOOT} in
@@ -141,7 +148,7 @@ for OS in ${OSPROBED} ; do
 
          onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
       cat << EOF
-menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
+menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
 EOF
       save_default_entry | grub_add_tab
       prepare_grub_to_access_device ${DEVICE} | grub_add_tab
@@ -173,7 +180,7 @@ EOF
        DEVICE=${DEVICE%@*}
        onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
       cat << EOF
-menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' {
+menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' {
 EOF
       save_default_entry | sed -e "s/^/\t/"
       prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
@@ -229,7 +236,7 @@ EOF
 
        if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
             cat << EOF
-menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
+menuentry '$(echo "$OS $onstr" | grub_quote)' $CLASS --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
 EOF
            save_default_entry | grub_add_tab
            printf '%s\n' "${prepare_boot_cache}"
@@ -277,9 +284,11 @@ EOF
       echo "$title_correction_code"
     ;;
     macosx)
-      OSXUUID="${UUID}"
-      osx_entry xnu_kernel 32
-      osx_entry xnu_kernel64 64
+      if [ "${UUID}" ]; then
+       OSXUUID="${UUID}"
+       osx_entry xnu_kernel 32
+       osx_entry xnu_kernel64 64
+      fi
     ;;
     hurd)
       onstr="$(gettext_printf "(on %s)" "${DEVICE}")"