Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Loop ¶
Loop will, when given a handle to a Loopback device (such as /dev/loop0), and a handle to the fs image to loop mount (such as a squashfs or ext4fs image), preform the required call to loop the image to the provided block device.
The first argument (loopbackDevice) can be obtained using loopback.NextLoopDevice, if one is not known in advance.
func NextLoopDevice ¶
NextLoopDevice will return 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.
Types ¶
type UnmounterFunc ¶ added in v0.1.3
type UnmounterFunc func()
UnmounterFunc will unmount the filesystem, unloop the file, and close the held file descriptor. Be sure this is defer'ed in a sensible location!