Debian Codegraph @

kernel/README

raw
1 Each architecture must define the following functions in kernel/$ARCH.sh:
2
3 arch_get_kernel_flavour ()
4
5 Prints a string describing the flavour of kernel to install. This can be
6 in whatever scheme you like; it just has to be in sync with the other
7 architecture-specific functions, where it's used.
8
9 May expect $ARCH and $SUBARCH to be set to the architecture and
10 subarchitecture (if applicable) respectively.
11
12 This function should describe the kernel flavour in sufficiently general
13 terms as to be able to test the usability of kernels of any major
14 version. As such, it is not a good idea to make this function
15 conditional on $KERNEL_MAJOR. If you need radically different kernel
16 names depending on the kernel major version, you should handle that in
17 the other architecture-specific functions.
18
19 Returns zero if successful, or non-zero otherwise. If non-zero, it
20 should print some kind of warning to syslog explaining why.
21
22 arch_check_usable_kernel (kernel, flavour)
23
24 Test whether a kernel is usable at all. For the purposes of this test,
25 we assume that SMP is usable on UP and vice versa (is this safe?). Some
26 architectures just have a hierarchy of optimized kernels, whereas some
27 have subarchitectures that are incompatible at the kernel level. This
28 function should cope with both cases.
29
30 Note that by default any postfix (starting with a hyphen) is allowed
31 after the flavor. This allows for custom kernels and also, for example,
32 for kernel meta packages for stable kernel updates that have a postfix
33 to distinguish them from the regular kernel meta packages.
34 This means that if a specific postfix (such as -smp, or -bigmem) is not
35 allowed, this should be tested explicitly.
36
37 The same goes for prefixes: any prefix before the flavor is allowed by
38 default.
39
40 Returns zero if the kernel is usable on this flavour, or non-zero
41 otherwise.
42
43 arch_get_kernel (flavour)
44
45 Print the preferred kernels for this flavour, one per line, in order of
46 preference.
47
48 No return value; must not fail. (If there's a problem, one of the two
49 functions above should already have failed.)
50
51 Shell variables all functions may expect:
52
53 ARCH
54 The architecture (as returned by udpkg --print-architecture).
55 SUBARCH
56 The subarchitecture (as returned by archdetect).
57 CPUINFO
58 The location of /proc/cpuinfo, parameterised for the benefit of the test
59 suite.
60 OFCPUS
61 Open Firmware /cpus directory. Useful on OF platforms when CPUINFO grepping
62 won't work.
63 KERNEL_MAJOR
64 The major version of the running kernel, e.g. 2.6.
65 KERNEL_VERSION
66 The full version of the running kernel, e.g. 2.6.8.
67 KERNEL_FLAVOUR
68 The flavour of the running kernel, e.g. 486, 686-bigmem.
69 MACHINE
70 The machine hardware name (as returned by uname -m).
71 NUMCPUS
72 The number of CPUs in the machine. Will only be set if /var/numcpus
73 exists, and may not be very accurate (ie, 2 for any SMP machine).
74 Only of use when grepping CPUINFO won't work.
75
76 Please update the regression tests in the tests/ directory when making
77 changes here. In particular, calls to inspect the kernel version or
78 files in /proc need support in the test suite so that the full test
79 suite can be run for all architectures on any architecture.