~ubuntu-branches/ubuntu/oneiric/base-installer/oneiric

« back to all changes in this revision

Viewing changes to kernel/i386.sh

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-05-26 15:54:12 UTC
  • mfrom: (0.2.18 sid)
  • Revision ID: james.westby@ubuntu.com-20110526155412-aj6c54r99zdaa1u6
Tags: 1.119ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Use and depend on the Ubuntu keyring.
  - Enable the restricted component by default, unless
    apt-setup/restricted is preseeded to false.
  - Set up the default sources.list to look in -updates and -security (the
    latter from apt-setup/security_host) as well as the unadorned suite;
    also -proposed if apt-setup/proposed is true.
  - Use Ubuntu kernel image names.
  - Allow preseeding base-installer/kernel/override-image to force a given
    kernel to be used.
  - Install busybox-initramfs rather than busybox.
  - Revert Joey's patch to call base-installer.d hooks after running
    debootstrap, which broke console-setup's expectation of being able to
    insert its configuration file into /target before console-setup is
    installed by debootstrap.
  - Add armel/imx51, armel/dove, and armel/omap subarchitectures.
  - Install kernel headers to match the kernel. This may be overridden by
    setting base-installer/kernel/headers to false.
  - Add base-installer/kernel/backports-modules template, which may be
    preseeded to install selected linux-backports-modules-* packages.
  - Run dpkg with --force-unsafe-io during installation.
* Explicitly drop code supporting -386 kernels, which were dropped from
  Ubuntu some time ago.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
                HAVE_LM=n
8
8
        fi
9
9
 
10
 
        # Should we offer a bigmem kernel?
 
10
        # Should we offer a PAE kernel?
11
11
        local HAVE_PAE
12
12
        if grep -q '^flags.*\bpae\b' "$CPUINFO"; then
13
13
                HAVE_PAE=y
15
15
                HAVE_PAE=n
16
16
        fi
17
17
 
18
 
        # Should we prefer a bigmem/amd64 kernel - is there RAM above 4GB?
 
18
        # Should we prefer a PAE/amd64 kernel - is there RAM above 4GB?
19
19
        local WANT_PAE
20
20
        if [ -z "$RAM_END" ]; then
21
21
                local MAP MAP_END
34
34
        else
35
35
                WANT_PAE=n
36
36
        fi
37
 
        # or is the installer running a 686-bigmem kernel?
 
37
        # or is the installer running a PAE kernel?
38
38
        case "$KERNEL_FLAVOUR" in
39
 
            686-bigmem*|generic-pae|xen)
 
39
            686-bigmem* | 686-pae* | generic-pae | xen)
40
40
                WANT_PAE=y
41
41
                ;;
42
42
        esac
43
43
 
44
44
        case "$HAVE_LM$HAVE_PAE$WANT_PAE" in
45
45
            yyy)
46
 
                echo 686-bigmem amd64 686 486
 
46
                echo 686-pae 686-bigmem amd64 686 486
47
47
                return 0
48
48
                ;;
49
49
            yyn)
50
 
                echo 686 686-bigmem amd64 486
 
50
                echo 686 686-pae 686-bigmem amd64 486
51
51
                return 0
52
52
                ;;
53
53
            yn?)
54
54
                warning "Processor with LM but no PAE???"
55
55
                ;;
56
56
            nyy)
57
 
                echo 686-bigmem 686 486
 
57
                echo 686-pae 686-bigmem 686 486
58
58
                return 0
59
59
                ;;
60
60
            nyn)
61
 
                echo 686 686-bigmem 486
 
61
                echo 686 686-pae 686-bigmem 486
62
62
                return 0
63
63
                ;;
64
64
            nn?)
66
66
                ;;
67
67
        esac
68
68
 
69
 
        local VENDOR FAMILY MODEL
70
 
        VENDOR=$(sed -n 's/^vendor_id\s*: //; T; p; q' "$CPUINFO")
71
 
        FAMILY=$(sed -n 's/^cpu family\s*: //; T; p; q' "$CPUINFO")
72
 
        MODEL=$(sed -n 's/^model\s*: //; T; p; q' "$CPUINFO")
73
 
 
74
 
        case "$VENDOR" in
75
 
            AuthenticAMD*)
76
 
                case "$FAMILY" in
77
 
                    6|15|16|17|18|20)   echo 686 486 ;;
78
 
                    *)                  echo 486 ;;
79
 
                esac
80
 
                ;;
81
 
            GenuineIntel)
82
 
                case "$FAMILY" in
83
 
                    6|15)       echo 686 486 ;;
84
 
                    *)          echo 486 ;;
85
 
                esac
86
 
                ;;
87
 
            GenuineTMx86*)
88
 
                case "$FAMILY" in
89
 
                    # Do all of these have cmov?
90
 
                    6|15)       echo 686 486 ;;
91
 
                    *)          echo 486 ;;
92
 
                esac
93
 
                ;;
94
 
            CentaurHauls)
95
 
                case "$FAMILY" in
96
 
                    6)
97
 
                        case "$MODEL" in
98
 
                            9|10|13)    echo 686 486 ;;
99
 
                            *)          echo 486 ;;
100
 
                        esac
101
 
                        ;;
102
 
                    *)
103
 
                        echo 486 ;;
104
 
                esac
105
 
                ;;
106
 
            *)
107
 
                echo 486 ;;
108
 
        esac
109
 
        return 0
 
69
        # Should we offer a 686 kernel?
 
70
        if grep -q '^flags.*\bfpu\b.*\btsc\b.*\bcx8\b.*\bcmov\b' "$CPUINFO"; then
 
71
                echo 686 486
 
72
        else
 
73
                echo 486
 
74
        fi
110
75
}
111
76
 
112
77
arch_check_usable_kernel () {
115
80
        set -- $2
116
81
        while [ $# -ge 1 ]; do
117
82
                case "$1:$NAME" in
118
 
                    486:*-386|486:*-386-*)
119
 
                        return 0
120
 
                        ;;
121
 
                    686-bigmem:*-generic-pae|686-bigmem:*-generic-pae-*)
122
 
                        return 0
123
 
                        ;;
124
 
                    *:*-generic-pae|*:*-generic-pae-*)
125
 
                        # Don't allow -generic-pae for non-bigmem
126
 
                        ;;
127
 
                    686*:*-generic|686*:*-generic-*)
128
 
                        return 0
129
 
                        ;;
130
 
                    686*:*-virtual|686*:*-virtual-*)
131
 
                        return 0
132
 
                        ;;
133
 
                    686*:*-rt|686*:*-rt-*)
134
 
                        return 0
135
 
                        ;;
136
 
                    686-bigmem:*-xen|686-bigmem:*-xen-*)
 
83
                    *:*-"$1")
 
84
                        return 0;
 
85
                        ;;
 
86
                    *:*-"$1"-bigmem* | *:*-"$1"-pae*)
 
87
                        # Don't allow -bigmem or -pae suffix, as these
 
88
                        # require extra CPU features
 
89
                        ;;
 
90
                    *:*-"$1"-*)
 
91
                        # Do allow any other hyphenated suffix
 
92
                        return 0
 
93
                        ;;
 
94
                    686-pae:*-generic-pae | 686-pae:*-generic-pae-*)
 
95
                        return 0
 
96
                        ;;
 
97
                    *:*-generic-pae | *:*-generic-pae-*)
 
98
                        # Don't allow -generic-pae for non-pae
 
99
                        ;;
 
100
                    686*:*-generic | 686*:*-generic-*)
 
101
                        return 0
 
102
                        ;;
 
103
                    686*:*-virtual | 686*:*-virtual-*)
 
104
                        return 0
 
105
                        ;;
 
106
                    686*:*-rt | 686*:*-rt-*)
 
107
                        return 0
 
108
                        ;;
 
109
                    686-pae:*-xen | 686-pae:*-xen-*)
137
110
                        return 0
138
111
                        ;;
139
112
                esac
148
121
        set -- $1
149
122
        while [ $# -ge 1 ]; do
150
123
                case $1 in
151
 
                    686-bigmem)
 
124
                    686-pae)
152
125
                        echo "linux-generic-pae"
153
126
                        echo "linux-image-generic-pae"
154
127
                        echo "linux-xen"
162
135
                        echo "linux-rt"
163
136
                        echo "linux-image-rt"
164
137
                        ;;
165
 
                    486)
166
 
                        echo "linux-386"
167
 
                        echo "linux-image-386"
168
 
                        ;;
169
138
                esac
170
139
                shift
171
140
        done