| |
- __builtin__.object
-
- UbPreseedFileContent
- nrvr.diskimage.isoimage.IsoImage(__builtin__.object)
-
- Ub1404IsoImage
class Ub1404IsoImage(nrvr.diskimage.isoimage.IsoImage) |
|
An Ubuntu .iso ISO CD-ROM or DVD-ROM disk image for use with preseed. |
|
- Method resolution order:
- Ub1404IsoImage
- nrvr.diskimage.isoimage.IsoImage
- __builtin__.object
Methods defined here:
- __init__(self, isoImagePath)
- Create new Ubuntu Ub1404IsoImage descriptor.
A descriptor can describe an .iso image that does or doesn't yet exist on the host disk.
- cloneWithAutoBootingPreseed(self, _preseedFileContent, _firstTimeStartScript, modifications=[], cloneIsoImagePath=None)
- Clone with preseed file added and modified to automatically boot with it.
For more on behavior see documentation of class IsoImage method cloneWithModifications.
For details of modifications see method modificationsIncludingPreseedFile,
which is expected to be different per release specific subclass.
_preseedFileContent
A UbPreseedFileContent object.
_firstTimeStartScript
A string.
cloneIsoImagePath
if not given then in same directory with a timestamp in the filename.
return
IsoImage(cloneIsoImagePath).
- genisoimageOptions(self, bootImage='isolinux/isolinux.bin', bootCatalog='isolinux/boot.cat', label=None, udf=False, ignoreJoliet=True)
- Auxiliary method, called by cloneWithModifications.
As implemented calls superclass method genisoimageOptions and extends the returned list.
Could be improved in the future.
Could be overridden for a subclass.
- modificationsIncludingPreseedFile(self, _preseedFileContent, _firstTimeStartScript)
- Construct and return a list of modifications to be passed to method cloneWithModifications.
This method is called by method cloneWithAutoBootingPreseed, which takes the returned list
and passes it to method cloneWithModifications.
As implemented known to support Ubuntu 14.04 LTS.
_preseedFileContent
A UbPreseedFileContent object.
_firstTimeStartScript
A string.
Return a list of modifications which will be passed to method cloneWithModifications.
Methods inherited from nrvr.diskimage.isoimage.IsoImage:
- cloneWithModifications(self, modifications=[], cloneIsoImagePath=None, udf=False, ignoreJoliet=True, pause=False)
- Clone with any number of instances of IsoImageModification applied.
A temporary assembly directory in the same directory as cloneIsoImagePath needs disk space,
but it is removed automatically upon completion of cloning.
modifications
a list of IsoImageModification instances.
cloneIsoImagePath
if not given then in same directory with a timestamp in the filename.
return
IsoImage(cloneIsoImagePath).
- cloneWithModificationsUsingMount(self, modifications=[], cloneIsoImagePath=None, udf=False, ignoreJoliet=True, pause=False)
- Clone with any number of instances of IsoImageModification applied.
This is an older implementation which regrettably because of the mount command requires
having superuser privileges.
It is still here in case a newer implementation doesn't work right, which could be for any
of a number of reasons, for example for symbolic links.
A temporary assembly directory in the same directory as cloneIsoImagePath needs disk space,
but it is removed automatically upon completion of cloning.
modifications
a list of IsoImageModification instances.
cloneIsoImagePath
if not given then in same directory with a timestamp in the filename.
return
IsoImage(cloneIsoImagePath).
- copyToDirectory(self, copyDirectory, udf=False, ignoreJoliet=True, tolerance=0.0)
- Copy all files into a directory.
Not using mount command, no need to run as root.
- exists(self)
- Return True if .iso image exists on the host disk.
- mount(self, mountDir, udf=False)
- Mount .iso image.
- remove(self)
- Remove (delete) .iso image from the host disk.
- unmount(self)
- Unmount .iso image.
Class methods inherited from nrvr.diskimage.isoimage.IsoImage:
- commandsUsedInImplementation(cls) from __builtin__.type
- Return a list to be passed to SystemRequirements.commandsRequired().
This class can be passed to SystemRequirements.commandsRequiredByImplementations().
Data descriptors inherited from nrvr.diskimage.isoimage.IsoImage:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- isoImagePath
- Path of the .iso image.
|
class UbPreseedFileContent(__builtin__.object) |
|
The text content of a preseed file for Ubuntu. |
|
Methods defined here:
- __init__(self, string)
- Create new preseed file content container.
Documentation is at https://help.ubuntu.com/14.04/installation-guide/i386/apb.html .
Not sure whether documentation says what encoding a preseed file can or has to be.
This constructor does unicode(string), as befits the 21st century.
Unless you find documentation, don't put anything into it that is not in the ASCII range.
- addNetworkConfigurationDhcp(self, device)
- Add an additional network device with DHCP.
device
a string, e.g. "eth0".
Should be increased past "eth0" if adding more than one additional configuration.
As implemented there is no protection against a conflict in case there would be a
pre-existing network configuration for the device.
return
self, for daisychaining.
- addNetworkConfigurationStatic(self, device, ipaddress, netmask='255.255.255.0', gateway=None, nameservers=None)
- Add an additional network device with static IP.
As implemented only supports IPv4.
device
a string, e.g. "eth0".
Should be increased past "eth0" if adding more than one additional configuration.
As implemented there is no protection against a conflict in case there would be a
pre-existing network configuration for the device.
ipaddress
IP address.
netmask
netmask.
Defaults to 255.255.255.0.
gateway
gateway.
If None then default to ip.1.
nameservers
one nameserver or a list of nameservers.
If None then default to gateway.
If empty list then remove option.
return
self, for daisychaining.
- addPackage(self, package)
- Add package or package group to %packages section.
return
self, for daisychaining.
- addPreseedCommandLine(self, qowner, qname, command)
- Add an additional line to an existing preseed command.
qowner
"d-i" or other owner.
qname
name string, e.g. "preseed/late_command".
command
command string, e.g. "in-target apt-get -y install curl".
return
self, for daisychaining.
- replaceHostname(self, hostname)
- Replace hostname value.
hostname
new hostname.
return
self, for daisychaining.
- replaceLang(self, lang)
- Replace lang option.
lang
e.g. "de_DE.UTF-8" to replace "en_US.UTF-8".
As implemented does not do any sanity checking.
return
self, for daisychaining.
- replaceRootpw(self, pwd)
- Replace rootpw option.
pwd
pwd will be encrypted. If starting with $ it is assumed to be encrypted already.
return
self, for daisychaining.
- setPreseedValue(self, qowner, qname, qtype, qvalue)
- Set a preseed value in the command section.
qowner
"d-i" or other owner.
qname
name string, e.g. "pkgsel/update-policy".
qtype
type string, e.g. "boolean", "string", "select", or "multiselect".
qvalue
value string.
return
self, for daisychaining.
- setSwappiness(self, swappiness)
- Set swappiness.
swappiness
an int between 0 and 100.
return
self, for daisychaining.
- setUpdatePolicyNone(self)
- Set policy for applying updates to "none" (no automatic updates).
No automatic updates.
return
self, for daisychaining.
- setUpdatePolicyUnattended(self)
- Set policy for applying updates to "unattended-upgrades"
(install security updates automatically).
Install security updates automatically.
return
self, for daisychaining.
- setUpgradeFull(self)
- Set whether to upgrade packages after debootstrap to "full-upgrade".
return
self, for daisychaining.
- setUpgradeNone(self)
- Set whether to upgrade packages after debootstrap to "none".
return
self, for daisychaining.
- setUpgradeSafe(self)
- Set whether to upgrade packages after debootstrap to "safe-upgrade".
return
self, for daisychaining.
- setUser(self, username, pwd=None, fullname=None)
- Set the one user Ubuntu preseed can set up.
For Ubuntu, a full name is effectively required.
Also, apparently only one user can be set by Ubuntu preseed.
username
username to set.
The Linux username.
pwd
pwd will be encrypted. If starting with $ it is assumed to be encrypted already.
fullname
the user's full name, which Ubuntu apparently expects to be given.
If None then default to username.capitalize().
return
self, for daisychaining.
Class methods defined here:
- cryptedPwd(cls, plainPwd) from __builtin__.type
- Encrypt in a format acceptable for preseed.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- string
- The whole content.
| |