Beispiel #1
0
# partdisks crypto library. - (C) 2011-12 Eugenio "g7" Paolantonio and the Semplice Team.
# All rights reserved. Work released under the GNU GPL license, version 3 or later.
#
# This is a module of linstaller, should not be executed as a standalone application.

## Maybe it's better to move everything to python-cryptosetup when it
## lands on Debian... ~g7

import os, commands

import subprocess

import linstaller.core.main as m
import linstaller.core.libmodules.partdisks.library as lib

FillQuality = m.enum("LOW", "HIGH")


class LUKSdrive:
    """ A LUKS-encrypted drive/partition. """

    def __init__(self, device=None, string_device=None):

        if not device and not string_device:
            raise m.CodeError("At least device or string_device must be specified!")
        elif device and string_device:
            raise m.CodeError("You must specify only device OR string_device!")

        if device:
            self.string_device = device.path
        else:
Beispiel #2
0
import t9n.library
_ = t9n.library.translation_init("linstaller")

# FIXME: These variables should be in distribution's configuration file.
min_size = 0.2 # In GB.
rec_size = 0.3 # In GB.

# Convert min_size and rec_size in MB.
min_size *= 1000
rec_size *= 1000

# FIXME
obj_old = False

# Resize actions enum
ResizeAction = m.enum("GROW", "SHRINK")

supported = {
	"ext2" : ("/sbin/mkfs.ext2",""),
	"ext3" : ("/sbin/mkfs.ext3",""),
	"ext4" : ("/sbin/mkfs.ext4",""),
	"fat32" : ("/sbin/mkfs.vfat","-F 32"),
	"fat16" : ("/sbin/mkfs.vfat","-F 16"),
	"ntfs" : ("/sbin/mkfs.ntfs","-Q"), # lol
	"hfs+" : ("/sbin/mkfs.hfsplus",""),
	"jfs" : ("/sbin/mkfs.jfs",""),
	"btrfs" : ("/sbin/mkfs.btrfs","-f"),
	"reiserfs" : ("/sbin/mkfs.reiser4","-y"),
	"xfs" : ("/sbin/mkfs.xfs",""),
	"linux-swap(v1)" : ("/sbin/mkswap",""),
}
Beispiel #3
0
# -*- coding: utf-8 -*-
# linstaller core apt library - (C) 2013 Eugenio "g7" Paolantonio and the Semplice Team.
# All rights reserved. Work released under the GNU GPL license, version 3 or later.
#
# This is a module of linstaller, should not be executed as a standalone application.

import linstaller.core.main as m

import os
os.environ["DEBIAN_FRONTEND"] = "noninteractive"

import apt_pkg
import apt
import shutil

RepositoryType = m.enum("TRIVIAL", "AUTOMATIC")
MarkType = m.enum("INSTALL","DELETE","KEEP","UPGRADE")

class Cache(apt.cache.Cache):
	
	""" This class is intended to manage packages and repositories in target, 
	outside the chroot. """
	
	def __init__(self, rootdir="/linstaller/target", memonly=True, sourceslist="/tmp/linstaller_sourceslist.list"):
		
		# Just one catch: we need to specify rootdir as libraries cannot
		# access the main_settings dictionary.
		# The calling module should set rootdir to self.main_settings["target"].
		
		apt.cache.Cache.__init__(self, progress=None, rootdir=rootdir, memonly=memonly)