blob: 712de1c7e57dc54cbed65838326498ee1dc9df17 [file] [log] [blame]
Lorenz Brun6b13bf12021-01-26 19:54:24 +01001// Copyright 2020 The Monogon Project Authors.
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17syntax = "proto3";
18
Lorenz Brun4c326022022-01-25 13:42:45 +010019package metropolis.node.build.fsspec;
20option go_package = "source.monogon.dev/metropolis/node/build/fsspec";
Lorenz Brun6b13bf12021-01-26 19:54:24 +010021
22// FSSpec is the spec from which a filesystem is generated. It consists of files, directories and symbolic
23// links. Directories are also automatically inferred when required for the placement of files or symbolic
24// links. Inferred directories always have uid 0, gid 0 and permissions 0555. This can be overridden by
25// explicitly specifying a directory at a given path.
26message FSSpec {
27 repeated File file = 1;
28 repeated Directory directory = 2;
29 repeated SymbolicLink symbolic_link = 3;
Lorenz Brun4c326022022-01-25 13:42:45 +010030 repeated SpecialFile special_file = 4;
Lorenz Brun6b13bf12021-01-26 19:54:24 +010031}
32
33// For internal use only. Represents all supported inodes in a oneof.
34message Inode {
35 oneof type {
36 File file = 1;
37 Directory directory = 2;
38 SymbolicLink symbolic_link = 3;
Lorenz Brun4c326022022-01-25 13:42:45 +010039 SpecialFile special_file = 4;
Lorenz Brun6b13bf12021-01-26 19:54:24 +010040 }
41}
42
43message File {
44 // The path where the file ends up in the filesystem.
45 string path = 1;
46 // The path on the host filesystem where the file contents should be taken from.
47 string source_path = 2;
48 // Unix permission bits
49 uint32 mode = 3;
50 // Owner uid
51 uint32 uid = 4;
52 // Owner gid
53 uint32 gid = 5;
54}
55
56message Directory {
57 // The path where the directory ends up in the filesystem.
58 string path = 1;
59 // Unix permission bits
60 uint32 mode = 2;
61 // Owner uid
62 uint32 uid = 3;
63 // Owner gid
64 uint32 gid = 4;
65}
66
67message SymbolicLink {
68 // The path where the symbolic link ends up in the filesystem.
69 string path = 1;
70 // The path to which the symbolic link resolves to.
71 string target_path = 2;
Lorenz Brun4c326022022-01-25 13:42:45 +010072}
73
74message SpecialFile {
75 // The path where the special file ends up in the filesystem.
76 string path = 1;
77
78 enum Type {
79 CHARACTER_DEV = 0;
80 BLOCK_DEV = 1;
81 FIFO = 2;
82 }
83
84 // Type of special file.
85 Type type = 2;
86
87 // The major device number of the special file.
88 uint32 major = 3;
89 // The minor number of the special file. Ignored for FIFO-type special files.
90 uint32 minor = 4;
91
92 // Unix permission bits
93 uint32 mode = 5;
94 // Owner uid
95 uint32 uid = 6;
96 // Owner gid
97 uint32 gid = 7;
Lorenz Brun6b13bf12021-01-26 19:54:24 +010098}