Lorenz Brun | 6b13bf1 | 2021-01-26 19:54:24 +0100 | [diff] [blame^] | 1 | // 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 | |
| 17 | syntax = "proto3"; |
| 18 | |
| 19 | package metropolis.node.build.mkerofs.fsspec; |
| 20 | option 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. |
| 26 | message 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. |
| 33 | message Inode { |
| 34 | oneof type { |
| 35 | File file = 1; |
| 36 | Directory directory = 2; |
| 37 | SymbolicLink symbolic_link = 3; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | message 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 | |
| 54 | message 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 | |
| 65 | message 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 | } |