loopback

package
v0.1.1-0...-42241d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2021 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package loopback provides support for disk loopback devices (/dev/loopN).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loop

func Loop(loopbackDevice, image *os.File) error

Loop given a handle to a Loopback device (such as /dev/loop0), and a handle to the image to loop mount (such as a squashfs or ext4fs image), performs the required call to loop the image to the provided block device.

func LoopSetReadWrite

func LoopSetReadWrite(loopbackDevice *os.File) error

LoopSetReadWrite clears the read-only flag on the loop devices.

func NextLoopDevice

func NextLoopDevice() (*os.File, error)

NextLoopDevice gets the next loopback device that isn't used.

Under the hood this will ask loop-control for the LOOP_CTL_GET_FREE value, and interpolate that into the conventional GNU/Linux naming scheme for loopback devices, and os.Open that path.

func Unloop

func Unloop(loopbackDevice *os.File) error

Unloop given a handle to the Loopback device (such as /dev/loop0), preforms the required call to the image to unloop the file.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL