ksud: sort the stock mounts correctly.
This commit is contained in:
@@ -259,7 +259,10 @@ impl StockMount {
|
|||||||
.destination_starts_with(std::path::Path::new(mnt))
|
.destination_starts_with(std::path::Path::new(mnt))
|
||||||
.filter(|m| m.fstype != "overlay" && m.fstype != "rootfs")
|
.filter(|m| m.fstype != "overlay" && m.fstype != "rootfs")
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
mounts.sort_by(|a, b| b.dest.cmp(&a.dest)); // inverse order
|
|
||||||
|
// sort it by dest length, so we can mount it in order
|
||||||
|
// TODO: there are maybe submounts, we don't need to mount them, so we can skip them.
|
||||||
|
mounts.sort_by(|a, b| a.dest.as_os_str().len().cmp(&b.dest.as_os_str().len()));
|
||||||
|
|
||||||
let mntroot = std::path::Path::new(crate::defs::STOCK_MNT_ROOT);
|
let mntroot = std::path::Path::new(crate::defs::STOCK_MNT_ROOT);
|
||||||
utils::ensure_dir_exists(mntroot)?;
|
utils::ensure_dir_exists(mntroot)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user