~ubuntu-branches/ubuntu/natty/os-prober/natty

« back to all changes in this revision

Viewing changes to linux-boot-probes/mounted/x86/40grub

  • Committer: Bazaar Package Importer
  • Author(s): Frans Pop
  • Date: 2007-02-27 20:16:49 UTC
  • mfrom: (1.1.5 edgy)
  • Revision ID: james.westby@ubuntu.com-20070227201649-dayeca1vogcnuhov
Tags: 1.17
Check for both upper and lowercase filenames when detecting Windows
NT/XP/2000. Thanks to Thanatermesis.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
found_item=0
11
11
 
 
12
entry_result () {
 
13
        if [ -n "$kernel" ] && \
 
14
           [ -e "$mpoint/$kernel" ]; then
 
15
                result "$rootpart:$bootpart:$title:$kernel:$initrd:$parameters"
 
16
                found_item=1
 
17
        fi
 
18
        kernel=""
 
19
        parameters=""
 
20
        initrd=""
 
21
        title=""
 
22
}
 
23
 
12
24
parse_grub_menu () {
13
25
        mpoint="$1"
14
26
        rootpart="$2"
24
36
                set -- $line
25
37
                case "$1" in
26
38
                        title)
 
39
                                entry_result
27
40
                                shift 1
28
41
                                title="$(echo $@ | sed 's/://g')"
29
42
                        ;;
30
43
                        kernel)
31
 
                                kernel="$2"
 
44
                                # Hack alert: sed off any (hdn,n) but
 
45
                                # assume the kernel is on the same
 
46
                                # partition.
 
47
                                kernel="$(echo $2 | sed 's/(.*)//')"
32
48
                                shift 2
33
49
                                parameters="$@"
34
50
                                # Systems with a separate /boot will not have
45
61
                                fi
46
62
                        ;;
47
63
                        boot)
48
 
                                if [ -n "$kernel" ] && \
49
 
                                   [ -e "$mpoint/$kernel" ] && \
50
 
                                   [ -e "$mpoint/$initrd" ]; then
51
 
                                        result "$rootpart:$bootpart:$title:$kernel:$initrd:$parameters"
52
 
                                        found_item=1
53
 
                                fi
 
64
                                entry_result
 
65
                        ;;
 
66
                        module)
 
67
                                log "Skipping entry '$title':"
 
68
                                log "parsing of entries containing 'module' lines is currently not supported"
 
69
                                # Emptying kernel will invalidate the entry
54
70
                                kernel=""
55
 
                                parameters=""
56
 
                                initrd=""
57
 
                                title=""
58
71
                        ;;
59
72
                esac
60
73
        done
 
74
 
 
75
        entry_result
61
76
}
62
77
 
63
78
if [ -e "$mpoint/boot/grub/menu.lst" ]; then