Use self implemented parse_mount_info

This commit is contained in:
LoveSy
2024-02-27 22:27:52 +08:00
committed by John Wu
parent 1a70796339
commit 62fc7868ac
6 changed files with 121 additions and 198 deletions

View File

@@ -114,10 +114,10 @@ static void mount_preinit_dir(string preinit_dev) {
xmkdir(PREINITMNT, 0);
bool mounted = false;
// First, find if it is already mounted
rust::Vec<uint8_t> mnt_point;
std::string mnt_point;
if (rust::is_device_mounted(dev, mnt_point)) {
// Already mounted, just bind mount
xmount((const char *) mnt_point.data(), PREINITMNT, nullptr, MS_BIND, nullptr);
xmount(mnt_point.data(), PREINITMNT, nullptr, MS_BIND, nullptr);
mounted = true;
}