Merge branch 'bump-ver' into 'master'
Expose custom mount API and bump version See merge request redox-os/installer!63
This commit is contained in:
Generated
+28
-5
@@ -952,6 +952,15 @@ version = "1.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
|
||||
|
||||
[[package]]
|
||||
name = "humansize"
|
||||
version = "2.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7"
|
||||
dependencies = [
|
||||
"libm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper"
|
||||
version = "1.7.0"
|
||||
@@ -1278,6 +1287,12 @@ version = "0.2.176"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174"
|
||||
|
||||
[[package]]
|
||||
name = "libm"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
|
||||
|
||||
[[package]]
|
||||
name = "libredox"
|
||||
version = "0.1.10"
|
||||
@@ -1408,6 +1423,12 @@ dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parse-size"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "487f2ccd1e17ce8c1bfab3a65c89525af41cfad4c8659021a1e9a2aacd73b89b"
|
||||
|
||||
[[package]]
|
||||
name = "percent-encoding"
|
||||
version = "2.3.2"
|
||||
@@ -1578,7 +1599,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"socket2",
|
||||
"tracing",
|
||||
"windows-sys 0.60.2",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1697,7 +1718,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "redox_installer"
|
||||
version = "0.2.37"
|
||||
version = "0.2.38"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arg_parser",
|
||||
@@ -1749,9 +1770,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "redoxfs"
|
||||
version = "0.8.0"
|
||||
version = "0.8.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "063eedabd74ddf71810e72aae1c73f3485ffc7b1e757d9466b9099046c05d7be"
|
||||
checksum = "da25f807d736d169077c076bc44837ef250257680a91efedda6891474735a833"
|
||||
dependencies = [
|
||||
"aes",
|
||||
"argon2",
|
||||
@@ -1761,10 +1782,12 @@ dependencies = [
|
||||
"env_logger",
|
||||
"fuser",
|
||||
"getrandom 0.2.16",
|
||||
"humansize",
|
||||
"libc",
|
||||
"libredox",
|
||||
"log",
|
||||
"lz4_flex",
|
||||
"parse-size",
|
||||
"range-tree",
|
||||
"redox-path",
|
||||
"redox-scheme",
|
||||
@@ -2644,7 +2667,7 @@ version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
||||
dependencies = [
|
||||
"windows-sys 0.60.2",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "redox_installer"
|
||||
version = "0.2.37"
|
||||
version = "0.2.38"
|
||||
description = "A Redox filesystem builder"
|
||||
license = "MIT"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
|
||||
@@ -338,7 +338,7 @@ fn main() {
|
||||
}
|
||||
|
||||
// Slow install method via file copy
|
||||
with_redoxfs_mount(fs, |mount_path| {
|
||||
with_redoxfs_mount(fs, None, |mount_path| {
|
||||
let mut config: Config = Config::from_file(&root_path.join("filesystem.toml"))?;
|
||||
|
||||
// Copy filesystem.toml, which is not packaged
|
||||
|
||||
+27
-16
@@ -356,18 +356,29 @@ where
|
||||
callback(fs)
|
||||
}
|
||||
|
||||
pub fn with_redoxfs_mount<D, T, F>(fs: FileSystem<D>, callback: F) -> Result<T>
|
||||
fn decide_mount_path(mount_path: Option<&Path>) -> PathBuf {
|
||||
let mount_path = mount_path.map(|p| p.to_path_buf()).unwrap_or_else(|| {
|
||||
PathBuf::from(if cfg!(target_os = "redox") {
|
||||
format!("file.redox_installer_{}", process::id())
|
||||
} else {
|
||||
format!("/tmp/redox_installer_{}", process::id())
|
||||
})
|
||||
});
|
||||
mount_path
|
||||
}
|
||||
|
||||
pub fn with_redoxfs_mount<D, T, F>(
|
||||
fs: FileSystem<D>,
|
||||
mount_path: Option<&Path>,
|
||||
callback: F,
|
||||
) -> Result<T>
|
||||
where
|
||||
D: Disk + Send + 'static,
|
||||
F: FnOnce(&Path) -> Result<T>,
|
||||
{
|
||||
let mount_path = if cfg!(target_os = "redox") {
|
||||
format!("file.redox_installer_{}", process::id())
|
||||
} else {
|
||||
format!("/tmp/redox_installer_{}", process::id())
|
||||
};
|
||||
let mount_path = decide_mount_path(mount_path);
|
||||
|
||||
if cfg!(not(target_os = "redox")) && !Path::new(&mount_path).exists() {
|
||||
if cfg!(not(target_os = "redox")) && !mount_path.exists() {
|
||||
fs::create_dir(&mount_path)?;
|
||||
}
|
||||
|
||||
@@ -401,7 +412,7 @@ where
|
||||
}
|
||||
};
|
||||
|
||||
unmount_path(&mount_path)?;
|
||||
unmount_path(&mount_path.as_os_str().to_str().unwrap())?;
|
||||
|
||||
join_handle.join().unwrap();
|
||||
|
||||
@@ -412,16 +423,16 @@ where
|
||||
res
|
||||
}
|
||||
|
||||
pub fn with_redoxfs_ar<D, T, F>(mut fs: FileSystem<D>, callback: F) -> Result<T>
|
||||
pub fn with_redoxfs_ar<D, T, F>(
|
||||
mut fs: FileSystem<D>,
|
||||
mount_path: Option<&Path>,
|
||||
callback: F,
|
||||
) -> Result<T>
|
||||
where
|
||||
D: Disk + Send + 'static,
|
||||
F: FnOnce(&Path) -> Result<T>,
|
||||
{
|
||||
let mount_path = if cfg!(target_os = "redox") {
|
||||
format!("file.redox_installer_{}", process::id())
|
||||
} else {
|
||||
format!("/tmp/redox_installer_{}", process::id())
|
||||
};
|
||||
let mount_path = decide_mount_path(mount_path);
|
||||
|
||||
let res = callback(Path::new(&mount_path));
|
||||
|
||||
@@ -828,11 +839,11 @@ fn install_inner(config: Config, output: &Path) -> Result<()> {
|
||||
};
|
||||
with_whole_disk(output, &disk_option, move |fs| {
|
||||
if config.general.no_mount.unwrap_or(false) {
|
||||
with_redoxfs_ar(fs, move |mount_path| {
|
||||
with_redoxfs_ar(fs, None, move |mount_path| {
|
||||
install_dir(config, mount_path, cookbook)
|
||||
})
|
||||
} else {
|
||||
with_redoxfs_mount(fs, move |mount_path| {
|
||||
with_redoxfs_mount(fs, None, move |mount_path| {
|
||||
install_dir(config, mount_path, cookbook)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user