~ubuntu-branches/ubuntu/utopic/libdebian-installer/utopic

« back to all changes in this revision

Viewing changes to src/system/subarch-arm-linux.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-09-14 17:59:37 UTC
  • mfrom: (8.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100914175937-r7dzef3t8mbdq2b9
Tags: 0.76ubuntu1
* Resynchronise with Debian, in order to get Michael's archdetect
  heuristic work for Maverick.  Remaining changes:
  - Appease the combination of _FORTIFY_SOURCE=2 (used by default on
    Ubuntu) and -Werror.
  - Add Dove SoC subarchitecture.
  - Add Beagle OMAP3 support.
  - Add the i386/efi and amd64/efi platforms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#include <stdio.h>
4
4
#include <string.h>
5
5
#include <strings.h>
 
6
#include <sys/utsname.h>
6
7
 
7
8
#include <debian-installer/system/subarch.h>
8
9
 
11
12
        char *ret;
12
13
};
13
14
 
 
15
static const char *supported_generic_subarches[] = {
 
16
    "dove",
 
17
    "omap",
 
18
    "omap4",
 
19
    NULL
 
20
};
 
21
 
14
22
static struct map map_hardware[] = {
15
23
    { "Acorn-RiscPC" , "rpc" },
16
24
    { "EBSA285" , "netwinder" },
23
31
    { "OMAP3 Beagle Board", "omap" }, /* first OMAP hw platform, more to come */
24
32
    { "ADS" , "ads" }, /* Matches only ADS boards. Put any exceptions before. */
25
33
    { "Applied Data Systems" , "ads" }, /* More ADS boards. */
 
34
    { "HP t5325 Thin Client", "kirkwood" },
26
35
    { "Marvell DB-88F6281-BP Development Board", "kirkwood" },
27
36
    { "Marvell RD-88F6192-NAS Development Board", "kirkwood" },
28
37
    { "Marvell RD-88F6281 Reference Board", "kirkwood" },
 
38
    { "Marvell GuruPlug Reference Board", "kirkwood" },
29
39
    { "Marvell OpenRD Base Board", "kirkwood" },
30
40
    { "Marvell OpenRD Client Board", "kirkwood" },
 
41
    { "Marvell OpenRD Ultimate Board", "kirkwood" },
31
42
    { "Marvell SheevaPlug Reference Board", "kirkwood" },
 
43
    { "Marvell eSATA SheevaPlug Reference Board", "kirkwood" },
32
44
    { "QNAP TS-119/TS-219", "kirkwood" },
33
45
    { "QNAP TS-41x", "kirkwood" },
 
46
    { "Seagate FreeAgent DockStar", "kirkwood" },
34
47
    { "Buffalo/Revogear Kurobox Pro", "orion5x" },
35
48
    { "D-Link DNS-323", "orion5x" },
36
49
    { "QNAP TS-109/TS-209", "orion5x" },
102
115
 
103
116
        return "unknown";
104
117
}
 
118
 
 
119
const char *di_system_subarch_analyze_guess(void)
 
120
{
 
121
        struct utsname sysinfo;
 
122
        size_t uname_release_len, i;
 
123
 
 
124
        /* Attempt to determine subarch based on kernel release version */
 
125
        uname(&sysinfo);
 
126
        uname_release_len = strlen(sysinfo.release);
 
127
 
 
128
        for (i = 0; supported_generic_subarches[i] != NULL; i++)
 
129
        {
 
130
                size_t subarch_len = strlen (supported_generic_subarches[i]);
 
131
                if (!strncmp(sysinfo.release+uname_release_len-subarch_len,
 
132
                        supported_generic_subarches[i],
 
133
                        subarch_len))
 
134
                {
 
135
                        return supported_generic_subarches[i];
 
136
                }
 
137
        }
 
138
 
 
139
        /* If we get here, try falling back on the normal detection method */
 
140
        return di_system_subarch_analyze();
 
141
}