]>
Commit | Line | Data |
---|---|---|
2933c9f7 | 1 | From b1ff1336667cb0ab0abe679d9e38f3e3b5b48e2f Mon Sep 17 00:00:00 2001 |
0cdf09fd CW |
2 | From: Colin Watson <cjwatson@ubuntu.com> |
3 | Date: Mon, 13 Jan 2014 12:13:24 +0000 | |
4 | Subject: Skip Windows os-prober entries on Wubi systems | |
5 | ||
6 | Since we're already being booted from the Windows boot loader, including | |
7 | entries that take us back to it mostly just causes confusion, and stops | |
8 | us from being able to hide the menu if there are no other OSes | |
9 | installed. | |
10 | ||
11 | https://blueprints.launchpad.net/ubuntu/+spec/foundations-o-wubi | |
12 | ||
b288368d | 13 | Forwarded: not-needed |
dee7aaec | 14 | Last-Update: 2013-11-26 |
b288368d | 15 | |
0cdf09fd CW |
16 | Patch-Name: wubi_no_windows.patch |
17 | --- | |
18 | util/grub.d/30_os-prober.in | 19 +++++++++++++++++++ | |
19 | 1 file changed, 19 insertions(+) | |
20 | ||
21 | diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in | |
4dfe4e8e | 22 | index b7e1147c4..271044f59 100644 |
b288368d CW |
23 | --- a/util/grub.d/30_os-prober.in |
24 | +++ b/util/grub.d/30_os-prober.in | |
93c7766a | 25 | @@ -110,6 +110,8 @@ EOF |
b288368d CW |
26 | |
27 | used_osprober_linux_ids= | |
28 | ||
29 | +wubi= | |
30 | + | |
31 | for OS in ${OSPROBED} ; do | |
32 | DEVICE="`echo ${OS} | cut -d ':' -f 1`" | |
33 | LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`" | |
93c7766a | 34 | @@ -146,6 +148,23 @@ for OS in ${OSPROBED} ; do |
b288368d CW |
35 | case ${BOOT} in |
36 | chain) | |
37 | ||
38 | + case ${LONGNAME} in | |
39 | + Windows*) | |
40 | + if [ -z "$wubi" ]; then | |
41 | + if [ -x /usr/share/lupin-support/grub-mkimage ] && \ | |
42 | + /usr/share/lupin-support/grub-mkimage --test; then | |
43 | + wubi=yes | |
44 | + else | |
45 | + wubi=no | |
46 | + fi | |
47 | + fi | |
48 | + if [ "$wubi" = yes ]; then | |
49 | + echo "Skipping ${LONGNAME} on Wubi system" >&2 | |
50 | + continue | |
51 | + fi | |
52 | + ;; | |
53 | + esac | |
54 | + | |
55 | onstr="$(gettext_printf "(on %s)" "${DEVICE}")" | |
56 | cat << EOF | |
93c7766a | 57 | menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' { |