Compare commits

..

No commits in common. "ryansquared/create-mount-points" and "master" have entirely different histories.

1 changed files with 1 additions and 6 deletions

View File

@ -9,6 +9,7 @@ fn init_rootfs() {
let no_dse = MS_NODEV | MS_NOSUID | MS_NOEXEC; let no_dse = MS_NODEV | MS_NOSUID | MS_NOEXEC;
let no_se = MS_NOSUID | MS_NOEXEC; let no_se = MS_NOSUID | MS_NOEXEC;
let args = [ let args = [
("devtmpfs", "/dev", "devtmpfs", no_se, "mode=0755"),
("devtmpfs", "/dev", "devtmpfs", no_se, "mode=0755"), ("devtmpfs", "/dev", "devtmpfs", no_se, "mode=0755"),
("devpts", "/dev/pts", "devpts", no_se, ""), ("devpts", "/dev/pts", "devpts", no_se, ""),
("shm", "/dev/shm", "tmpfs", no_dse, "mode=0755"), ("shm", "/dev/shm", "tmpfs", no_dse, "mode=0755"),
@ -19,12 +20,6 @@ fn init_rootfs() {
("cgroup_root", "/sys/fs/cgroup", "tmpfs", no_dse, "mode=0755"), ("cgroup_root", "/sys/fs/cgroup", "tmpfs", no_dse, "mode=0755"),
]; ];
for (src, target, fstype, flags, data) in args { for (src, target, fstype, flags, data) in args {
if std::fs::exists(target).unwrap_or(false) {
match std::fs::create_dir_all(target) {
Ok(()) => dmesg(format!("Created mount point {}", target)),
Err(e) => eprintln!("{}", e),
}
}
match mount(src, target, fstype, flags, data) { match mount(src, target, fstype, flags, data) {
Ok(())=> dmesg(format!("Mounted {}", target)), Ok(())=> dmesg(format!("Mounted {}", target)),
Err(e)=> eprintln!("{}", e), Err(e)=> eprintln!("{}", e),