backend Package

keyboard Module

Keyboard utilities

vinstall.backend.keyboard.set_kb_layout(layout)[source]

Set the keyboard layout. #TODO: add variants and options

vinstall.backend.keyboard.xkb()[source]

Get available keyboard settings

media Module

utils Module

Collection of small utilities.

class vinstall.backend.utils.Chroot(new_root, chdir=True)[source]

Bases: object

Execute block in a chrooted context

>>> with Chroot("/mnt"):
...     dostuff()

If chdir kwarg is True, os.chdir to “/” before entering

vinstall.backend.utils.activate_swap(path=None)[source]
vinstall.backend.utils.bind_mount(src, mountpoint)[source]

Mount a filesystem with –bind

vinstall.backend.utils.capture_output(*args, **kwargs)[source]
vinstall.backend.utils.capture_output_binary(*args, **kwargs)[source]
vinstall.backend.utils.depmod()[source]

Run depmod

vinstall.backend.utils.exec_chroot(root, command)[source]

Change the root dir for current shell and run the given command.

Arguments:

dir: The directory to for chrooting to. command: The command to be executed under the new root.
>>> exec_chroot('/', 'pwd')
0
vinstall.backend.utils.format_partition(path, filesystem)[source]

Create a filesystem in a partition using mkfs.

vinstall.backend.utils.get_existing_fs(partition_path)[source]

Return the FS for a (mounted) mountpoint

vinstall.backend.utils.get_mem_size()[source]

Get the amount of RAM availablein the system in mB.

vinstall.backend.utils.get_mounted(mountpoint)[source]

Return device for a mountpoint

vinstall.backend.utils.is_mounted(device)[source]

Returns true if device is mounted.

vinstall.backend.utils.mkinitrd(root, fs, disable_bootsplash=False)[source]

Create an initrd

vinstall.backend.utils.mount(src, mountpoint, filesystem='auto')[source]

Mount a filesystem.

Arguments:

src: the filesystem or device to be mounted. filesystem: filesystem type passed to the mount command, for example:

“ext3”. Default is auto.
vinstall.backend.utils.mountiso(src, mountpoint)[source]

Mount a filesystem.

Arguments:

src: the filesystem or device to be mounted. extra: extra options to be passed to the mount command, for example:

“-o loop”. Default is None.
filesystem: filesystem type passed to the mount command, for example:
“ext3”. Default is auto.
vinstall.backend.utils.run_program(*args, **kwargs)[source]
vinstall.backend.utils.run_program_and_capture_output(*args, **kwargs)[source]
vinstall.backend.utils.run_program_and_capture_output_binary(*args, **kwargs)[source]
vinstall.backend.utils.supported_filesystems()[source]

Returns a list of filesystems supported by the system.

vinstall.backend.utils.umount(mounted)[source]

Unmount a filesystem.

Arguments:

A mounted filesystem or device.
>>> umount('/mnt/loop')
0