예제 #1
0
QString SystemConfig::flashInfo()
{
    QString mount_point("/media/flash");
    QString flash("%1/%2 MB");
    flash=flash.arg(freeSpace(mount_point)/1024/1024).arg(diskSpace(mount_point)/1024/1024);
    return flash; 
}
예제 #2
0
파일: util.cpp 프로젝트: urykhy/qcryptdisk
int Mount::do_umount(const QString& name)
{
    QStringList arguments;
    QString mount_point( fstab.mountpoint(name) );
    arguments << aux::umount << mount_point;
    return just_run(aux::sudo, arguments)==0;
}
예제 #3
0
파일: mount.cpp 프로젝트: saltstar/smartnix
// Installs a remote filesystem on vn and adds it to the remote_list_.
zx_status_t Vfs::InstallRemoteLocked(fbl::RefPtr<Vnode> vn, MountChannel h) {
    if (vn == nullptr) {
        return ZX_ERR_ACCESS_DENIED;
    }

    // Allocate a node to track the remote handle
    fbl::AllocChecker ac;
    fbl::unique_ptr<MountNode> mount_point(new (&ac) MountNode());
    if (!ac.check()) {
        return ZX_ERR_NO_MEMORY;
    }
    zx_status_t status = vn->AttachRemote(std::move(h));
    if (status != ZX_OK) {
        return status;
    }
    // Save this node in the list of mounted vnodes
    mount_point->SetNode(std::move(vn));
    remote_list_.push_front(std::move(mount_point));
    return ZX_OK;
}
예제 #4
0
bool wipe_system(const std::shared_ptr<Rom> &rom)
{
    std::string path = rom->full_system_path();
    if (path.empty()) {
        LOGE("Failed to determine full system path");
        return false;
    }

    bool ret;
    if (rom->system_is_image) {
        // Ensure the image is no longer mounted
        std::string mount_point("/raw/images/");
        mount_point += rom->id;
        util::umount(mount_point.c_str());

        ret = log_wipe_file(path);
    } else {
        ret = log_wipe_directory(path, {});
        // Try removing ROM's /system if it's empty
        remove(path.c_str());
    }
    return ret;
}