GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mdaffin/loopdev: A rust library to setup and control loopback devices

BranchesTags
Open more actions menu

Latest commit

 

History

130 Commits
130 Commits

Folders and files

NameName
Last commit message
Last commit date
.cargo
.cargo
 
 
.github/workflows
.github/workflows
 
 
losetup
losetup
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.travis-deploy
.travis-deploy
 
 
.travis.yml
.travis.yml
 
 
Cargo.toml
Cargo.toml
 
 
Cross.toml
Cross.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Vagrantfile
Vagrantfile
 
 
build.rs
build.rs
 
 

Repository files navigation

Build Status crates.io

loopdev

Setup and control loop devices.

Provides rust interface with similar functionality to the Linux utility losetup.

Documentation

Examples

use loopdev::LoopControl;
let lc = LoopControl::open().unwrap();
let ld = lc.next_free().unwrap();

println!("{}", ld.path().unwrap().display());

ld.attach_file("disk.img").unwrap();
// ...
ld.detach().unwrap();

Development

Running The Tests Locally

Unfortunately the tests require root only syscalls and thus must be run as root. There is little point in mocking out these syscalls as I want to test they actually function as expected and if they were to be mocked out then the tests would not really be testing anything useful.

A vagrant file is provided that can be used to create an environment to safely run these tests locally as root. With Vagrant and VirtualBox installed you can do the following to run the tests.

vagrant up
vagrant ssh
sudo -i
cd /vagrant
cargo test

Note that the tests are built with root privileges, but since vagrant maps this directory back to the host as your normal user there is minimal issues with this. At worst the vagrant box will become trashed and can be rebuilt in minutes.

About

A rust library to setup and control loopback devices

Topics

hacktoberfestlooploopbackrust

Resources

Readme
MIT license
Activity

Stars

22 stars

Watchers

4 watching

Forks

49 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.