From 0353bfc00c3b9c5351abf32fe60314bc5641165b Mon Sep 17 00:00:00 2001 From: David Teller Date: Tue, 1 Nov 2016 21:15:25 +0100 Subject: [PATCH] Let root manipulate a fuse-mounted redoxfs vfs. This (along with a few Makefile changes) solves my issues building on macOS. --- fuse/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fuse/main.rs b/fuse/main.rs index 99f6b76ae8..c5a9377b6d 100644 --- a/fuse/main.rs +++ b/fuse/main.rs @@ -7,6 +7,7 @@ extern crate time; use image::Image; use std::env; +use std::ffi::OsStr; use std::path::Path; use time::Timespec; use fuse::{FileType, FileAttr, Filesystem, Request, ReplyData, ReplyEntry, ReplyAttr, ReplyCreate, ReplyDirectory, ReplyEmpty, ReplyStatfs, ReplyWrite}; @@ -289,7 +290,14 @@ fn main() { if let Some(mountpoint) = env::args_os().nth(2) { fuse::mount(RedoxFS { fs: filesystem - }, &mountpoint, &[]); + }, &mountpoint, &[ + // One of the uses of this redoxfs fuse wrapper is to populate a filesystem + // while building the Redox OS kernel. This means that we need to write on + // a filesystem that belongs to `root`, which in turn means that we need to + // be `root`, thus that we need to allow `root` to have access. + OsStr::new("-o"), + OsStr::new("allow_root"), + ]); } else { println!("redoxfs: no mount point provided"); }