aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-03-21 16:11:18 +0100
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-03-21 16:11:18 +0100
commitd8af9b21f095dce1f6ea84aa4bdadd313a12c031 (patch)
tree7f1afa89c39e3d0c22bc165a3017a7775c079263
parentd3edc221c6cc0525f3e012fa3dfff3ed6099e83b (diff)
create /proc and /tmp mountpoints
-rw-r--r--src/main.rs56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 853ded2..32e6154 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -499,6 +499,32 @@ fn write_root(
},
})?;
+ let proc_inode = tree.add(SqsSourceFile {
+ path: PathBuf::from("/proc"),
+ content: SqsSource {
+ data: SqsSourceData::Dir(Box::new(Vec::new().into_iter())),
+ uid: 0,
+ gid: 0,
+ mode: 0o755,
+ modified: 0,
+ xattrs: HashMap::new(),
+ flags: 0,
+ },
+ })?;
+
+ let tmp_inode = tree.add(SqsSourceFile {
+ path: PathBuf::from("/tmp"),
+ content: SqsSource {
+ data: SqsSourceData::Dir(Box::new(Vec::new().into_iter())),
+ uid: 0,
+ gid: 0,
+ mode: 0o755,
+ modified: 0,
+ xattrs: HashMap::new(),
+ flags: 0,
+ },
+ })?;
+
tree.add(SqsSourceFile {
path: PathBuf::from("/"),
content: SqsSource {
@@ -508,6 +534,8 @@ fn write_root(
(OsString::from("dev"), dev_inode),
(OsString::from("boot"), boot_inode),
(OsString::from("data"), data_inode),
+ (OsString::from("proc"), proc_inode),
+ (OsString::from("tmp"), tmp_inode),
]
.into_iter(),
)),
@@ -588,6 +616,32 @@ fn write_empty_root(partition: &mut StreamSlice<File>) -> anyhow::Result<()> {
},
})?;
+ let proc_inode = tree.add(SqsSourceFile {
+ path: PathBuf::from("/proc"),
+ content: SqsSource {
+ data: SqsSourceData::Dir(Box::new(Vec::new().into_iter())),
+ uid: 0,
+ gid: 0,
+ mode: 0o755,
+ modified: 0,
+ xattrs: HashMap::new(),
+ flags: 0,
+ },
+ })?;
+
+ let tmp_inode = tree.add(SqsSourceFile {
+ path: PathBuf::from("/tmp"),
+ content: SqsSource {
+ data: SqsSourceData::Dir(Box::new(Vec::new().into_iter())),
+ uid: 0,
+ gid: 0,
+ mode: 0o755,
+ modified: 0,
+ xattrs: HashMap::new(),
+ flags: 0,
+ },
+ })?;
+
tree.add(SqsSourceFile {
path: PathBuf::from("/"),
content: SqsSource {
@@ -597,6 +651,8 @@ fn write_empty_root(partition: &mut StreamSlice<File>) -> anyhow::Result<()> {
(OsString::from("dev"), dev_inode),
(OsString::from("boot"), boot_inode),
(OsString::from("data"), data_inode),
+ (OsString::from("proc"), proc_inode),
+ (OsString::from("tmp"), tmp_inode),
]
.into_iter(),
)),