mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
update ota script, rbind for dependency mounts, cli list-ingredients fix, and formatting
This commit is contained in:
@@ -70,12 +70,20 @@ async fn e2fsck_runner(
|
||||
if code & 4 != 0 {
|
||||
tracing::error!(
|
||||
"{}",
|
||||
t!("disk.fsck.errors-not-corrected", device = logicalname.as_ref().display(), stderr = e2fsck_stderr),
|
||||
t!(
|
||||
"disk.fsck.errors-not-corrected",
|
||||
device = logicalname.as_ref().display(),
|
||||
stderr = e2fsck_stderr
|
||||
),
|
||||
);
|
||||
} else if code & 1 != 0 {
|
||||
tracing::warn!(
|
||||
"{}",
|
||||
t!("disk.fsck.errors-corrected", device = logicalname.as_ref().display(), stderr = e2fsck_stderr),
|
||||
t!(
|
||||
"disk.fsck.errors-corrected",
|
||||
device = logicalname.as_ref().display(),
|
||||
stderr = e2fsck_stderr
|
||||
),
|
||||
);
|
||||
}
|
||||
if code < 8 {
|
||||
|
||||
@@ -29,25 +29,31 @@ impl Default for FileType {
|
||||
pub struct Bind<Src: AsRef<Path>> {
|
||||
src: Src,
|
||||
filetype: FileType,
|
||||
recursive: bool,
|
||||
}
|
||||
impl<Src: AsRef<Path>> Bind<Src> {
|
||||
pub fn new(src: Src) -> Self {
|
||||
Self {
|
||||
src,
|
||||
filetype: FileType::Directory,
|
||||
recursive: false,
|
||||
}
|
||||
}
|
||||
pub fn with_type(mut self, filetype: FileType) -> Self {
|
||||
self.filetype = filetype;
|
||||
self
|
||||
}
|
||||
pub fn recursive(mut self, recursive: bool) -> Self {
|
||||
self.recursive = recursive;
|
||||
self
|
||||
}
|
||||
}
|
||||
impl<Src: AsRef<Path> + Send + Sync> FileSystem for Bind<Src> {
|
||||
async fn source(&self) -> Result<Option<impl AsRef<Path>>, Error> {
|
||||
Ok(Some(&self.src))
|
||||
}
|
||||
fn extra_args(&self) -> impl IntoIterator<Item = impl AsRef<std::ffi::OsStr>> {
|
||||
["--bind"]
|
||||
[if self.recursive { "--rbind" } else { "--bind" }]
|
||||
}
|
||||
async fn pre_mount(&self, mountpoint: &Path, mount_type: MountType) -> Result<(), Error> {
|
||||
let from_meta = tokio::fs::metadata(&self.src).await.ok();
|
||||
|
||||
@@ -24,7 +24,11 @@ pub async fn bind<P0: AsRef<Path>, P1: AsRef<Path>>(
|
||||
) -> Result<(), Error> {
|
||||
tracing::info!(
|
||||
"{}",
|
||||
t!("disk.mount.binding", src = src.as_ref().display(), dst = dst.as_ref().display())
|
||||
t!(
|
||||
"disk.mount.binding",
|
||||
src = src.as_ref().display(),
|
||||
dst = dst.as_ref().display()
|
||||
)
|
||||
);
|
||||
if is_mountpoint(&dst).await? {
|
||||
unmount(dst.as_ref(), true).await?;
|
||||
|
||||
Reference in New Issue
Block a user