pop-os / sys-mount Goto Github PK
View Code? Open in Web Editor NEWHigh level FFI binding around the sys mount & umount2 calls, for Rust
License: MIT License
High level FFI binding around the sys mount & umount2 calls, for Rust
License: MIT License
in the unix ecosystem a tool findmnt
is available to filter infomation for mounted filesystems.
It would be great to get an analogon implementation via sys-mount.
https://github.com/karelzak/util-linux
loopdev
supports detaching loopback devices, which resolves the original blocker as stated in the documentation for sys_mount::unmount
.
npm i -g loopback-cli
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: This version is no longer supported, please upgrade to 3.x
npm WARN deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 127
npm ERR! path /root/.nvm/versions/node/v16.14.1/lib/node_modules/loopback-cli/node_modules/ejs
npm ERR! command failed
npm ERR! command sh -c node ./postinstall.js
npm ERR! sh: node: command not found
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-04-16T13_37_29_408Z-debug-0.log
It would be nice to be able to mount a drive based on what is in the /etc/fstab file, without a script needing to know the source path.
For example a minimal .travis.yml
for this would be:
language: rust
rust: 1.24.1
script: cargo check
This would avoid the problem described in #2 (comment) of pull requests breaking compatibility with rustc versions that need to be supported.
Would you consider adding a feature to make the loopdev-related functions optional, which would remove the dependency on the loopdev crate? This would be helpful for usage that only wants to mount non-loopback filesystems.
Currently, umount only supports unmounting by the target path where the device is mounted. Yet it should be capable of automatically discovering the target path associated with that device, and using that. This can be achieved through the use of our proc-mounts crate.
On some architectures c_ulong isn't u64, resulting in build errors such as:
error[E0308]: mismatched types
--> .../sys-mount-1.2.0/src/mount.rs:315:13
|
315 | flags.bits(),
| ^^^^^^^^^^^^ expected u32, found u64
error[E0308]: mismatched types
--> .../sys-mount-1.2.0/src/mount.rs:20:22
|
20 | const BIND = MS_BIND;
| ^^^^^^^ expected u64, found u32
error[E0308]: mismatched types
--> .../sys-mount-1.2.0/src/mount.rs:24:25
|
24 | const DIRSYNC = MS_DIRSYNC;
| ^^^^^^^^^^ expected u64, found u32
Is it possible to use this library to somehow grant unpriviledge users the ability to mount arbitrary filesystems (not necessarily in fstab), similar to what pmount
does?
It looks like the changes for sys-mount 2.1.1 haven't been pushed to the repository.
we need the "loopdev optional" feature, thanks!
Is it possible to mount a loop device with a given offset? If so how might I do that?
Can an owner of https://crates.io/crates/sys-mount please publish v1.2.2 in order to release commits e05b6a5 and 2c7a0ff ?
Thank you for merging those PRs so quickly by the way!
The Mount
struct stores the target path internally. I'd love to have a target_path()
method that returns it as a &Path
, to avoid having to store it separately.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.