debian-forge/osbuild
Tom Gundersen c124ab264b loop: add helpers to use IPC to create loop devices
loop.py is a simple wrapper around the kernel loop API. remoteloop.py
uses this to create a server/clinet pair that communicates over an
AF_UNIX/SOCK_DGRAM socket to allow the server to create loop devices
for the client.

The client passes a fd that should be bound to the resulting loop
device, and a dir-fd where the loop device node should be created.
The server returns the name of the device node to the client.

The idea is that the client is run from whithin a container without
access to devtmpfs (and hence /dev/loop-control), and the server
runs on the host. The client would typically pass its (fake) /dev
as the output directory.

For the client this will be similar to `losetup -f foo.img --show`.

[@larskarlitski: pylint: ignore the new LoopInfo class, because it
only has dynamic attributes. Also disable attribute-defined-outside-init,
which (among other problems) is not ignored for that class.]

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-07-19 00:51:12 +02:00
..
__init__.py BuildRoot: include the osbulid module in the containers 2019-07-19 00:51:12 +02:00
__main__.py add __main__ file for convenient CLI usage 2019-07-18 10:17:39 +02:00
loop.py loop: add helpers to use IPC to create loop devices 2019-07-19 00:51:12 +02:00
remoteloop.py loop: add helpers to use IPC to create loop devices 2019-07-19 00:51:12 +02:00