blob: 3d6e8dcd03a62fdf2be1c2cf72953704c75b8960 [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
19package metropolis.node.build.mkerofs.fsspec;
20option go_package = "source.monogon.dev/metropolis/node/build/mkerofs/fsspec";
21
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;
30}
31
32// For internal use only. Represents all supported inodes in a oneof.
33message Inode {
34 oneof type {
35 File file = 1;
36 Directory directory = 2;
37 SymbolicLink symbolic_link = 3;
38 }
39}
40
41message File {
42 // The path where the file ends up in the filesystem.
43 string path = 1;
44 // The path on the host filesystem where the file contents should be taken from.
45 string source_path = 2;
46 // Unix permission bits
47 uint32 mode = 3;
48 // Owner uid
49 uint32 uid = 4;
50 // Owner gid
51 uint32 gid = 5;
52}
53
54message Directory {
55 // The path where the directory ends up in the filesystem.
56 string path = 1;
57 // Unix permission bits
58 uint32 mode = 2;
59 // Owner uid
60 uint32 uid = 3;
61 // Owner gid
62 uint32 gid = 4;
63}
64
65message SymbolicLink {
66 // The path where the symbolic link ends up in the filesystem.
67 string path = 1;
68 // The path to which the symbolic link resolves to.
69 string target_path = 2;
70}