Package liveusb :: Module creator :: Class LiveUSBCreator
[hide private]
[frames] | no frames]

Class LiveUSBCreator

source code

object --+
         |
        LiveUSBCreator

An OS-independent parent class for Live USB Creators

Instance Methods [hide private]
 
__init__(self, opts)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_setup_logger(self) source code
 
detect_removable_drives(self)
This method should populate self.drives with removable devices
source code
 
verify_filesystem(self)
Verify the filesystem of our device, setting the volume label if necessary.
source code
 
get_free_bytes(self, drive=None)
Return the number of free bytes on a given drive.
source code
 
extract_iso(self)
Extract the LiveCD ISO to the USB drive
source code
 
verify_iso_md5(self)
Verify the MD5 checksum of the ISO
source code
 
install_bootloader(self)
Install the bootloader to our device.
source code
 
_setup_olpc(self)
Install the Open Firmware configuration for the OLPC.
source code
 
terminate(self)
Terminate any subprocesses that we have spawned
source code
 
mount_device(self)
Mount self.drive, setting the mount point to self.mount
source code
 
unmount_device(self)
Unmount the device mounted at self.mount
source code
 
popen(self, cmd, **kwargs)
A wrapper method for running subprocesses.
source code
 
verify_iso_sha1(self, progress=None)
Verify the SHA1 checksum of our ISO if it is in our release list
source code
 
check_free_space(self)
Make sure there is enough space for the LiveOS and overlay
source code
 
create_persistent_overlay(self) source code
 
update_configs(self)
Generate our syslinux.cfg
source code
 
delete_liveos(self)
Delete the existing LiveOS
source code
 
write_log(self)
Write out our subprocess stdout/stderr to a log file
source code
 
existing_liveos(self) source code
 
get_liveos(self) source code
 
existing_overlay(self) source code
 
get_overlay(self) source code
 
get_release_from_iso(self)
If the ISO is for a known release, return it.
source code
 
_set_drive(self, drive) source code
 
get_proxies(self)
Return a dictionary of proxy settings
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  iso = None
  label = "FEDORA"
  fstype = None
  drives = {}
  overlay = 0
  dest = None
  uuid = None
  pids = []
  output = StringIO()
  totalsize = 0
  isosize = 0
  _drive = None
  mb_per_sec = 0
  log = None
  drive = property(fget= lambda self: self.drives [self._drive],...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, opts)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

verify_filesystem(self)

source code 

Verify the filesystem of our device, setting the volume label if necessary. If something is not right, this method throws a LiveUSBError.

get_free_bytes(self, drive=None)

source code 

Return the number of free bytes on a given drive.

If drive is None, then use the currently selected device.

install_bootloader(self)

source code 

Install the bootloader to our device.

Platform-specific classes inheriting from the LiveUSBCreator are expected to implement this method to install the bootloader to the specified device using syslinux. This specific implemention is platform independent and performs sanity checking along with adding OLPC support.

_setup_olpc(self)

source code 

Install the Open Firmware configuration for the OLPC.

This method will make the selected device bootable on the OLPC. It does this by installing a /boot/olpc.fth open firmware configuration file that enables booting off of USB and SD cards on the XO.

popen(self, cmd, **kwargs)

source code 

A wrapper method for running subprocesses.

This method handles logging of the command and it's output, and keeps track of the pids in case we need to kill them. If something goes wrong, an error log is written out and a LiveUSBError is thrown.

Parameters:
  • cmd - The commandline to execute. Either a string or a list.
  • kwargs - Extra arguments to pass to subprocess.Popen

Class Variable Details [hide private]

drive

Value:
property(fget= lambda self: self.drives [self._drive], fset= lambda se\
lf, d: self._set_drive(d))