From 55e706c918922def17f5012c23cfe88c4c645208 Mon Sep 17 00:00:00 2001 From: Axel Kellermann Date: Tue, 19 Nov 2013 23:39:51 +0100 Subject: [PATCH] * util/grub.d/30_os-prober.in: Add GRUB_OS_PROBER_SKIP_LIST to selectively skipping systems. --- ChangeLog | 5 +++++ docs/grub.texi | 4 ++++ util/grub-mkconfig.in | 1 + util/grub.d/30_os-prober.in | 14 +++++++++++++- 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 169af17ee..6aeb177dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-19 Axel Kellermann + + * util/grub.d/30_os-prober.in: Add GRUB_OS_PROBER_SKIP_LIST to + selectively skipping systems. + 2013-11-19 Colin Watson * Makefile.util.def (grub-mkimage): Add diff --git a/docs/grub.texi b/docs/grub.texi index de72d0cce..6aee292f0 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1451,6 +1451,10 @@ Normally, @command{grub-mkconfig} will try to use the external systems installed on the same system and generate appropriate menu entries for them. Set this option to @samp{true} to disable this. +@item GRUB_OS_PROBER_SKIP_LIST +List of space-separated FS UUIDs of filesystems to be ignored from os-prober +output. For efi chainloaders it's @@ + @item GRUB_DISABLE_SUBMENU Normally, @command{grub-mkconfig} will generate top level menu entry for the kernel with highest version number and put all other found kernels diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index db58ab930..3413bbc5f 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -216,6 +216,7 @@ export GRUB_DEFAULT \ GRUB_SAVEDEFAULT \ GRUB_ENABLE_CRYPTODISK \ GRUB_BADRAM \ + GRUB_OS_PROBER_SKIP_LIST \ GRUB_DISABLE_SUBMENU if test "x${grub_cfg}" != "x"; then diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 502faeaa8..3d1b93893 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -112,6 +112,18 @@ 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 [ x"${DEVICE#*@}" != x ] ; then + EXPUUID="${EXPUUID}@${DEVICE#*@}" + 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 + fi + BTRFS="`echo ${OS} | cut -d ':' -f 5`" if [ "x$BTRFS" = "xbtrfs" ]; then BTRFSuuid="`echo ${OS} | cut -d ':' -f 6`" @@ -265,7 +277,7 @@ EOF echo "$title_correction_code" ;; macosx) - OSXUUID="`${grub_probe} --target=fs_uuid --device ${DEVICE} 2> /dev/null`" + OSXUUID="${UUID}" osx_entry xnu_kernel 32 osx_entry xnu_kernel64 64 ;;