]> git.proxmox.com Git - grub2.git/commitdiff
Skip Windows os-prober entries on Wubi systems
authorColin Watson <cjwatson@ubuntu.com>
Mon, 13 Jan 2014 12:13:24 +0000 (12:13 +0000)
committerColin Watson <cjwatson@debian.org>
Fri, 4 Sep 2015 10:56:34 +0000 (11:56 +0100)
Since we're already being booted from the Windows boot loader, including
entries that take us back to it mostly just causes confusion, and stops
us from being able to hide the menu if there are no other OSes
installed.

https://blueprints.launchpad.net/ubuntu/+spec/foundations-o-wubi

Forwarded: not-needed
Last-Update: 2013-11-26

Patch-Name: wubi_no_windows.patch

util/grub.d/30_os-prober.in

index f8ac363ad0957adfcc9a21fe519b971955aaad5a..1c44cf27878a07175ccc2011b155de98d1f70206 100644 (file)
@@ -107,6 +107,8 @@ EOF
 
 used_osprober_linux_ids=
 
+wubi=
+
 for OS in ${OSPROBED} ; do
   DEVICE="`echo ${OS} | cut -d ':' -f 1`"
   LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
@@ -139,6 +141,23 @@ for OS in ${OSPROBED} ; do
   case ${BOOT} in
     chain)
 
+      case ${LONGNAME} in
+       Windows*)
+         if [ -z "$wubi" ]; then
+           if [ -x /usr/share/lupin-support/grub-mkimage ] && \
+              /usr/share/lupin-support/grub-mkimage --test; then
+             wubi=yes
+           else
+             wubi=no
+           fi
+         fi
+         if [ "$wubi" = yes ]; then
+           echo "Skipping ${LONGNAME} on Wubi system" >&2
+           continue
+         fi
+         ;;
+      esac
+
          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}")' {