blob: 634b2aded6992679693a6435288ec3b642b6ddce [file] [log] [blame]
Lorenz Brunc7b036b2023-06-01 12:23:57 +02001syntax = "proto3";
2
Tim Windelschmidt2f9f6242025-01-11 08:25:54 +01003package osbase.kmod.spec;
Lorenz Brunc7b036b2023-06-01 12:23:57 +02004
Tim Windelschmidt9f21f532024-05-07 15:14:20 +02005option go_package = "source.monogon.dev/osbase/kmod/spec";
Lorenz Brunc7b036b2023-06-01 12:23:57 +02006
7// Module contains important metadata about a Linux kernel module.
8message Module {
9 // Name of the module
10 string name = 1;
11 // Path of the module, relative to the module root.
12 // Unset if built-in.
13 string path = 2;
14 // List of Meta.modules indices on which this module depends.
15 repeated uint32 depends = 3;
16}
17
18message RadixNode {
19 enum Type {
20 // Matches one or more characters literally.
Tim Windelschmidta10d0cb2025-01-13 14:44:15 +010021 TYPE_LITERAL = 0;
Lorenz Brunc7b036b2023-06-01 12:23:57 +020022 // Matches zero or more arbitrary characters.
Tim Windelschmidta10d0cb2025-01-13 14:44:15 +010023 TYPE_WILDCARD = 1;
Lorenz Brunc7b036b2023-06-01 12:23:57 +020024 // Matches exactly one arbitrary character.
Tim Windelschmidta10d0cb2025-01-13 14:44:15 +010025 TYPE_SINGLE_WILDCARD = 2;
Lorenz Brunc7b036b2023-06-01 12:23:57 +020026 // Matches exactly one character between start_byte and end_byte.
Tim Windelschmidta10d0cb2025-01-13 14:44:15 +010027 TYPE_BYTE_RANGE = 3;
Lorenz Brunc7b036b2023-06-01 12:23:57 +020028 // Root matches nothing, but serves a the root node for a radix
29 // tree.
Tim Windelschmidta10d0cb2025-01-13 14:44:15 +010030 TYPE_ROOT = 4;
Lorenz Brunc7b036b2023-06-01 12:23:57 +020031 }
32 Type type = 1;
33
34 // Only valid for LITERAL type
35 string literal = 2;
36
37 // Only valid when BYTE_RANGE type
38 uint32 start_byte = 3;
39 uint32 end_byte = 4;
40
41 // Contains a list of radix nodes which are children of this node.
42 repeated RadixNode children = 5;
43
44 // A list of module indices (in the Meta.modules list) which have
45 // match expressions ending at this node.
46 repeated uint32 module_index = 6;
47}
48
49// Meta contains metadata about all modules in a Linux kernel
50message Meta {
51 // Contains a list of modules, including built-in ones.
52 repeated Module modules = 1;
53
54 // Contains the root node of a radix tree for looking up modules to load
55 // for a given device modalias.
56 RadixNode module_device_matches = 2;
57}