forked from koniifer/ableos
Merge branch 'repbuild-mount-unmount' of https://git.ablecorp.us:443/theoddgarlic/ableos into theoddgarlic-repbuild-mount-unmount
This commit is contained in:
commit
709b90c8f4
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -6,3 +6,5 @@ shadeable/target
|
||||||
qprofiler
|
qprofiler
|
||||||
userland/*/target
|
userland/*/target
|
||||||
kernel/target
|
kernel/target
|
||||||
|
userland/root_fs/mnt/*
|
||||||
|
!*/.gitkeep
|
||||||
|
|
|
@ -9,7 +9,7 @@ use ext2::{
|
||||||
|
|
||||||
fn load_fs() -> Synced<Ext2<Size1024, Vec<u8>>> {
|
fn load_fs() -> Synced<Ext2<Size1024, Vec<u8>>> {
|
||||||
let mut volume = Vec::new();
|
let mut volume = Vec::new();
|
||||||
volume.extend_from_slice(include_bytes!("../../../userland/root_rs/ext2.img"));
|
volume.extend_from_slice(include_bytes!("../../../userland/root_fs/ext2.img"));
|
||||||
|
|
||||||
let fs = Synced::<Ext2<Size1024, _>>::new(volume).unwrap();
|
let fs = Synced::<Ext2<Size1024, _>>::new(volume).unwrap();
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,16 @@ enum Command {
|
||||||
#[clap(long, short, arg_enum)]
|
#[clap(long, short, arg_enum)]
|
||||||
machine: Option<MachineType>,
|
machine: Option<MachineType>,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Mount {
|
||||||
|
#[clap(long, short)]
|
||||||
|
path: Option<String>,
|
||||||
|
},
|
||||||
|
|
||||||
|
Unmount {
|
||||||
|
#[clap(long, short)]
|
||||||
|
path: Option<String>,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(clap::ArgEnum, Debug, Clone)]
|
#[derive(clap::ArgEnum, Debug, Clone)]
|
||||||
|
@ -89,6 +99,16 @@ fn main() -> anyhow::Result<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Command::Mount { path } => {
|
||||||
|
let path = path.unwrap_or("./userland/root_fs/mnt".to_string());
|
||||||
|
xshell::cmd!("sudo mount userland/root_fs/ext2.img {path}").run()?;
|
||||||
|
},
|
||||||
|
|
||||||
|
Command::Unmount { path } => {
|
||||||
|
let path = path.unwrap_or("./userland/root_fs/mnt".to_string());
|
||||||
|
xshell::cmd!("sudo umount {path}").run()?;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Binary file not shown.
Loading…
Reference in a new issue