Commit d9980653 authored by Nikos Skalkotos's avatar Nikos Skalkotos

Do a spell-check on the project's files

 * Fix various spelling errors
 * Add module comments on all python utilities
parent 6d9b1b5c
......@@ -18,10 +18,10 @@
2013-10-18, v0.11
* Update the documentation
* Change local-backend identifier from file:// to local//
* Change local backend identifier from file:// to local//
* Make sure the user does not specify local images outside IMAGE_DIR by
using .. in the IMG_ID parameter
* HELPER: Fix a bug triggered when the image is corructed
* HELPER: Fix a bug triggered when the image is corrupted
2013-09-23, v0.10.1
* Merge the ChangeLog files of snf-image and snf-image-helper
......@@ -31,11 +31,11 @@
2013-09-19, v0.10
* Move the snf-image-helper image from squeeze to wheezy
* Add documentations under /docs
* Fix a bug in the network back-end
* Fix a bug in the network backend
2013-09-02, v0.9.3
* Add code to download and install a fixed snf-image-helper image. This is
the default behaviour for snf-image-update-helper.
* Add code to download and install a fixed snf-image-helper image. This
is the default behavior for snf-image-update-helper.
2013-08-27, v0.9.2
* Use devflow building system
......@@ -52,22 +52,22 @@
2013-03-12, v0.8.1
* Fix a bug in helper-monitor.py
* Make snf-image-update-helper install a patched version of ntfs-3g.
The debian squeeze version does not recognize the "--no-mtab" option
The Debian Squeeze version does not recognize the "--no-mtab" option
* Update contact email address
2013-03-09, v0.8
* Add support for xen
* Add support for Xen
* Increase the default HELPER_SIZE and TIMEOUT values
* Cleanup the code and remove settings no longer used
* Rename snf-image-host to snf-image
* HELPER: Add support for xen
* HELPER: Add support for Xen
* HELPER: Cleanup the helper code
2013-01-21, v0.7.6
* Make the size of the helper VM image configurable
* HELPER: Mount /proc and /dev before chrooting
* HELPER: Fix a bug in DeleteSSHKeys task where the code for checking for
non-default keys was never called.
* HELPER: Fix a bug in DeleteSSHKeys task where the code for checking
for non-default keys was never called.
2013-01-17, v0.7.5
* Cleanup defaults file and remove redundant variables
......@@ -75,27 +75,28 @@
passed with ./configure
2013-01-08, v0.7.4
* HELPER: Fix a bug in the code that determines which partition to resize
* HELPER: On linux images, mount all local partition during deployment. Not
just /.
* HELPER: Fix a bug in the code that determines which partition to
resize
* HELPER: On Linux images, mount all local partitions during the
deployment, not just /.
2013-01-04, v0.7.3
* Fix multistrap.conf to work with apt2.dev.grnet.gr
2013-01-04, v0.7.2
* Change snf-image-helper repository to apt2.dev.grnet.gr
* HELPER: In windows images make sure the file C:\Window\panther\Unattend.xml
gets removed after sysprep runs
* HELPER: In Windows images make sure the file:
`C:\Windows\panther\Unattend.xml' gets removed after sysprep runs
* HELPER: Support extended partitions with id 0x0f
* HELPER: Fix a bug in the error monitoring system
* HELPER: Fix a bug in AssignHostname for archlinux images
* HELPER: In AssignHostname check for the presence of /etc/hostname before
trying to determine the disto of a Linux image.
* HELPER: Fix a bug in AssignHostname for Arch Linux images
* HELPER: In AssignHostname check for the presence of /etc/hostname
before trying to determine the disto of a Linux image.
2012-12-07, v0.7.1
* Make pithcat work with pithosmap URLs
* HELPER: Fix a race condition where in some cases could lead to a kernel
panic for the helper VM.
* HELPER: Fix a race condition where in some cases could lead to a
kernel panic for the helper VM.
2012-12-03, v0.7
* Abandon debootstrap in favor of multistrap. This way we can define
......@@ -110,50 +111,49 @@
* Specify snf-image-helper as the init process when running the helper
VM
* HELPER: Make snf-image-helper the init process of the system
* HELPER: Shutdown the helper image fast using the apropriate SysRq key
* HELPER: Use eatmydata to omit the syncs performed by resize2fs when
resizing a file system. You can supress this behaviour by defining
* HELPER: Shutdown the helper VM fast using the appropriate SysRq key
* HELPER: Use `eatmydata' to omit the syncs performed by resize2fs when
resizing a file system. You can suppress this behavior by defining
the DO_SYNC image property.
2012-11-20, v0.6.5
* HELPER: Fix a bug in AssignHostname configuration task where the script did
not search for the presence of the Unattend.xml file in the VM, in
a case-insensitive way
* HELPER: Fix a bug in AssignHostname configuration task where the
script did not search for the presence of the Unattend.xml file in
the VM, in a case-insensitive way.
2012-11-15, v0.6.4
* Fix a bug in snf-image-update-helper introduced in v0.6.3
2012-11-13, v0.6.3
* Fix a bug in snf-image-update-helper where the temporary image file
was not removed if an error occured.
* HELPER: Don't overwrite C:\Unattend.xml file in windows images, unless the
image property USE_DEFAULT_UNATTEND is defined.
was not removed if an error occurred.
* HELPER: Don't overwrite C:\Unattend.xml file in Windows images,
unless the image property USE_DEFAULT_UNATTEND is defined.
* HELPER: Fix a bug in the error monitoring system
* HELPER: Correct some error messages
2012-10-12, v0.6.2
* Seperate the error messages that should be logged by the system from
* Separate the error messages that should be logged by the system from
those that should be propagated to the user through the monitoring
mechanism. Don't allow internal configuration options get revieled to
* HELPER: Remove the rule of updating the password for user `user' in Fedora
and Ubuntu when the USERS image property is missing.
mechanism. Don't allow internal configuration options get revealed to
* HELPER: Remove the rule of updating the password for user `user' in
Fedora and Ubuntu when the USERS image property is missing.
* HELPER: Check if a user exists before updating its password.
the user.
2012-10-05, v0.6.1
* Use Coordinated Universal Time when logging.
* Fix a bug in the way snf-image-update-helper reads the links of the
kernel and the initrd in the helper VM.
* Use environmental variables instead of input options to pass sensitive
data to pithcat. This is needed because when pithcat is running, every
user can see the program's command line by using ps.
* Use environmental variables instead of input options to pass
sensitive data to pithcat. This is needed because when pithcat is
running, every user can see the program's command line by using ps.
2012-09-15, v0.6
* Fix import and export scripts
* Add new config_url os parameter. This can be used by snf-image to
download a json file that contains the value for other os parameters
* HELPER: Make sure EnforcePersonality is the last task that runs before
UmountImage. Doing this ensures that user-enjected files never
* HELPER: Make sure EnforcePersonality is the last task that runs
before UmountImage. Doing this ensures that user-injected files never
get overwritten by any other configuration task.
2012-08-31, v0.5
......@@ -162,11 +162,11 @@
when running.
* Make the name of image properties case insensitive
* Abandon timelimit command in favor of timeout
* Add support for null image backend type. This backend type can be
* Add support for null image backend type. This back-end type can be
used if we want snf-image to configure the VM disk without first
copying an image to it.
* HELPER: Add a new progress monitoring mechanish
* HELPER: Add support for arch linux
* HELPER: Add a new progress monitoring mechanism
* HELPER: Add support for arch Linux
2012-06-29, v0.4.2
* HELPER: Make the name of image properties case-insensitive
......@@ -185,7 +185,7 @@
* Create package list in snf-update-helper every time debootstrap is
performed. If a cache file is found, snf-update-helper will use this
list to determine if it is OK to use this cache file or not.
* Add mechanism for overwritting the helper's Unattend.xml file
* Add mechanism for overwriting the helper's Unattend.xml file
* HELPER: Add support for creating SWAP partitions
* HELPER: Add support for GPT partition tables
* HELPER: Add support for resizing logical partitions
......@@ -201,45 +201,45 @@
* HELPER: Force Automatic Update in Windows images
2012-03-05, v0.3.4
* HELPER: Fix 2 bugs in Delete SSH Keys task, caused by the use of pipefail
bash option
* HELPER: Fix 2 bugs in Delete SSH Keys task, caused by the use of
pipefail bash option
2012-02-29, v0.3.3
* Fix a bug in pithcat where the restored image had incorrect
size. The trailing zeros in the image files where not restored.
* Fix a bug in pithcat where the restored image had incorrect size.
The trailing zeros in the image files where not restored.
* HELPER: Check if the images partition table is valid
2012-02-06, v0.3.2
* Make pithcat work with pithos v0.8.3
2012-01-26, v0.3.1
* HELPER: Fix a bug in the OS detection code
* HELPER: Fix a bug in the OS detection code
2011-01-12, v0.3
* Put all helpers run-time created files in a tmpfs jail
* Remove the ARCH field from the image name
* Support remote (network accessable) and pithos hosted images
* Support remote (network accessible) and Pithos hosted images
* Remove custom images format (remote images is a supergroup)
* HELPER: Warn and in some cases fail if the instance is of an unknown
* HELPER: Force a resize when the filesystem is clean, even if resize2fs
complains
* HELPER: Force a resize when the file system is clean, even if
resize2fs complains
* HELPER: Make sure OSFAMILY image property is specified
2011-11-18, v0.2
* Support diskdump format
* Support custom images format. Custom images are diskdump images
that can be accessed from a URL
* Support custom images format. Custom images are diskdump images that
can be accessed from a URL
* Add a new OS parameter (img_properties)
* HELPER: Add support for Image Properties
* HELPER: Add new FixPartitionTable task
* HELPER: Add new task that disables RDP connections during windows setup
* HELPER: Add new task to disable RDP connections during Windows setup
* HELPER: Extend image personalization to support custom ownership and
permissions in the injected files
2011-10-20, v0.1.2
* Fix a debootstrap bug in snf-image-update-helper
* Use --one-file-system option when creating cache for update-helper
* Add setting for allowing the user to manually pick a debian mirror
* Add setting for allowing the user to manually pick a Debian mirror
for debootstrap.
2011-10-17, v0.1.1
......
......@@ -16,7 +16,7 @@ extdump and ntfsdump image formats
++++++++++++++++++++++++++++++++++
Those two formats are dumps (raw copies using dd) of partitions hosting Linux
systems on ext{2,3,4} and Windows systems on ntfs file systems respectively.
systems on ext{2,3,4} and Windows systems on NTFS file systems respectively.
Partitions hosting a Windows or Linux system that are suitable for dumping
should have the following properties:
......@@ -30,7 +30,7 @@ should have the following properties:
Known Issues
------------
* For Linux systems, having grub installed in the partition is fragile and
* For Linux systems, having GRUB installed on a partition is fragile and
things can go wrong if you shrink the partition.
* More complicated partition schemes are not supported.
......@@ -155,4 +155,4 @@ actual error message or a *stderr* field that hosts the last 10 lines of the
standard error output stream of *snf-image-helper*. Valid *error* messages look
like this:
``{"subtype": "error", "type": "image-helper", "messages": ["The image contains a(n) msdos partition table. For FreeBSD images only GUID Partition Tables are supported."], "timestamp": 1379507910.799365}``
``{"subtype": "error", "type": "image-helper", "messages": ["The image contains a(n) MSDOS partition table. For FreeBSD images only GUID Partition Tables are supported."], "timestamp": 1379507910.799365}``
......@@ -15,7 +15,7 @@ separate steps:
| 1. Fill the newly provisioned disk with Image data
| 2. Customize the Image accordingly
For (1), snf-image can fetch the Image from a number of back-ends, as we
For (1), snf-image can fetch the Image from a number of backends, as we
describe later. For (2) snf-image spawns a helper VM and runs a number of
configuration tasks inside the isolated environment. Once the last task returns
successfully, the helper VM ceases and snf-image returns the newly configured
......@@ -41,7 +41,7 @@ the supported hypervisor as dictated by Ganeti. It runs as an unprivileged
user.
There is no restriction on the distribution running inside the helper VM, as
long as it executes the snf-image-helper component automatically upon bootup.
long as it executes the snf-image-helper component automatically upon boot-up.
The snf-image-update-helper script is provided with snf-image to automate the
creation of a helper VM image based on Debian Stable, using multistrap.
......@@ -57,8 +57,8 @@ created and ensured by snf-image:
maintains.
* The helper VM is expected to output "SUCCESS" to its second serial port if
image customization was successful inside the VM.
* If "SUCCESS" is not returned, snf-image assumes that, execution of the helper
VM or snf-image-helper has failed.
* If "SUCCESS" is not returned, snf-image assumes that, execution of the
helper VM or snf-image-helper has failed.
* The helper VM is expected to shutdown automatically once it is done. Its
execution is time-limited; if it has not terminated after a number of
seconds, configurable via ``/etc/default/snf-image``, snf-image sends a
......@@ -84,33 +84,33 @@ The architecture is presented below:
.. _storage-backends:
Storage back-ends
^^^^^^^^^^^^^^^^^
Storage backends
^^^^^^^^^^^^^^^^
As stated above, for step (1), *snf-image* is capable of fetching images that
are stored in a variety of different back-ends and then extracting them onto
the newly created block device. The following back-ends are supported:
are stored in a variety of different backends and then extracting them onto the
newly created block device. The following back-ends are supported:
* **Local back-end**:
The local back-end is used to retrieve images that are stored on the Ganeti
* **Local backend**:
The local backend is used to retrieve images that are stored on the Ganeti
node that the image deployment takes place. All local images are expected to
be found under a predefined image directory. By default */var/lib/snf-image*
is used, but the user may change this by overwriting the value of the
*IMAGE_DIR* variable under ``/etc/default/snf-image``.
* **Network back-end**:
The network back-end is used to retrieve images that are accessible from the
* **Network backend**:
The network backend is used to retrieve images that are accessible from the
network. snf-image can fetch images via *http:*, *https:*, *ftp:* or
*ftps:*, using `cURL <http://curl.haxx.se/>`_.
* **Pithos back-end**:
* **Pithos backend**:
*snf-image* contains a special command-line tool (*pithcat*) for retrieving
images residing on a Pithos installation. To set up snf-image's Pithos
back-end the user needs to setup the ``PITHOS_DATA`` and ``PITHOS_DB``
backend the user needs to setup the ``PITHOS_DATA`` and ``PITHOS_DB``
variables inside ``/etc/default/snf-image`` accordingly.
* **Null back-end**:
If the null back-end is selected, no image copying is performed. This
* **Null backend**:
If the null backend is selected, no image copying is performed. This
actually is meant for bypassing step (1) altogether. This is useful, if the
disk provisioned by Ganeti already contains an OS installation before
*snf-image* is executed (for example if the disk was created as a clone of
......@@ -132,7 +132,7 @@ partition in the end. The task will fail if the environmental variable
is missing.
**FilesystemResizeUnmounted**: Extends the file system of the last partition to
cover up the whole partition. This only works for ext{2,3,4} and ufs2 file
cover up the whole partition. This only works for ext{2,3,4}, FFS and UFS2 file
systems. Any other file system type is ignored and a warning is triggered. The
task will fail if *SNF_IMAGE_DEV* environmental variable is missing.
......@@ -157,12 +157,12 @@ are also recreated. Besides removing files that comply to the
depends on is *SNF_IMAGE_TARGET*.
**DisableRemoteDesktopConnections**: This script temporary disables RDP
connections on windows instances by changing the value of *fDenyTSConnection*
connections on Windows instances by changing the value of *fDenyTSConnection*
registry key. RDP connections will be enabled back during the specialize pass
of the Windows setup. The task will fail if *SNF_IMAGE_TARGET* is not defined.
**InstallUnattend**: Installs the Unattend.xml files on windows instances. This
is needed by windows in order to perform an unattended setup. The
**InstallUnattend**: Installs the Unattend.xml files on Windows instances. This
is needed by Windows in order to perform an unattended setup. The
*SNF_IMAGE_TARGET* variables needs to be present for this task to run.
**SELinuxAutorelabel**: Creates *.autorelabel* file in Red Hat images. This is
......
......@@ -15,9 +15,9 @@ following OS Parameters:
injected to the image
* **img_properties** (optional): additional image properties used to customize
the image (:ref:`details <image-properties>`)
* **img_personality** (optional): files to be injected into the image
filesystem (:ref:`details <image-personality>`)
* **config_url** (optional): the url to download configuration data from
* **img_personality** (optional): files to be injected into the image's file
system (:ref:`details <image-personality>`)
* **config_url** (optional): the URL to download configuration data from
.. _image-format:
......@@ -42,10 +42,10 @@ Image ID (img_id)
^^^^^^^^^^^^^^^^^
The **img_id** OS parameter points to the actual Image that we want to deploy.
It is a URI and its prefix denotes the type of :ref:`back-end <storage-backends>`
It is a URI and its prefix denotes the type of :ref:`backend <storage-backends>`
to be used. If no prefix is used, it defaults to the local back-end:
* **Local back-end**:
* **Local backend**:
To select it, the prefix should be ``local://``, followed by the name of the
image. All local images are expected to be found under a predefined image
directory (``/var/lib/snf-image`` by default).
......@@ -55,7 +55,7 @@ to be used. If no prefix is used, it defaults to the local back-end:
| We need to assign:
| ``img_id=local://slackware.diskdump``
* **Network back-end**:
* **Network backend**:
If the **imd_id** starts with ``http:``, ``https:``, ``ftp:`` or ``ftps:``,
snf-image will treat the **img_id** as a remote URL and will try to fetch the
image using `cURL <http://curl.haxx.se/>`_.
......@@ -63,7 +63,7 @@ to be used. If no prefix is used, it defaults to the local back-end:
| For example, if we want to deploy an image from an http location:
| ``img_id=http://www.synnefo.org/path/to/image/slackware-image``
* **Pithos back-end**:
* **Pithos backend**:
If the **img_id** is prefixed with ``pithos://`` or ``pithosmap://`` the
image is considered to reside on a Pithos deployment. For ``pithosmap://``
images, the user needs to have set a valid value for the
......@@ -77,7 +77,7 @@ to be used. If no prefix is used, it defaults to the local back-end:
| or if we already know the map:
| ``img_id=pithosmap://<slackware-image-map-name>/<size>``
* **Null back-end**:
* **Null backend**:
To select the Null back-end and skip the fetching and extraction step, we set
``img_id=null``.
......@@ -141,9 +141,9 @@ Optional properties
* **SWAP=<partition id>:<size>**
If this property is defined, *snf-image* will create a swap partition with
the specified size in MB. The *partition id* is the number that the linux
the specified size in MB. The *partition id* is the number that the Linux
kernel will assign to this partition. For example, if you have a disk with
an msdos partition table on it and one primary partition, the image
an MSDOS partition table on it and one primary partition, the image
property *SWAP=2:512* would instruct *snf-image* to create a 512MB long
primary partition for swap with id=2. On the other hand, if the SWAP
property had this form: *SWAP=5:512*, since primary partitions may have an
......@@ -174,7 +174,7 @@ img_properties OS parameter
+++++++++++++++++++++++++++
Image properties are passed to snf_image through the img_properties OS
parameter as a simple json string like the one below:
parameter as a simple JSON string like the one below:
| {
| "PROPERTY1": "VALUE1",
......@@ -210,7 +210,7 @@ The format of this parameter is a JSON array of objects. Each object in the
array supports the following keys:
* **path**: The absolute path of the file (string)
* **contents**: The content of the file encoded as a base64 string (string)
* **contents**: The content of the file encoded as a Base64 string (string)
* **owner**: The user ownership of the file (string)
* **group**: The group ownership of the file (string)
* **mode**: The permission mode of the file (number)
......
......@@ -92,7 +92,7 @@ image properties:
| ROOT_PARTITION=1
| USERS=root
Hence, the ganeti command for creating a VM from this image file would look
Hence, the Ganeti command for creating a VM from this image file would look
like this:
.. code-block:: console
......@@ -101,7 +101,7 @@ like this:
-O img_passwd=1Ki77y,img_format=diskdump,img_id=debian_base-7.0-x86_64,img_properties='{"OSFAMILY":"linux"\,"ROOT_PARTITION":"1"\,"USERS":"root"}' \
-t plain --disk=0:size=10G --no-name-check --no-ip-check --no-nics my_debian_server1
If you don't want to configure the image at all and just copy it to the ganeti
If you don't want to configure the image at all and just copy it to the Ganeti
provided disk, use the ``EXCLUDE_ALL_TASKS`` image property, like this:
.. code-block:: console
......@@ -112,7 +112,7 @@ provided disk, use the ``EXCLUDE_ALL_TASKS`` image property, like this:
To configure a VM without first copying an image into the hard disk (e.g. if
the hard disk is a snapshot from an existing VM's hard disk) you may use the
*null* storage back-end like this:
*null* storage backend like this:
.. code-block:: console
......
......@@ -261,9 +261,9 @@ get_distro() {
get_partition_table() {
local dev output
dev="$1"
# If the partition table is gpt then parted will raise an error if the
# secondary gpt is not it the end of the disk, and a warning that has to
# do with the "Last Usable LBA" entry in gpt.
# If the partition table is GUID and the secondary GPT header is not at the
# end of the disk, parted will raise an error and will also print a warning
# about the "Last Usable LBA" entry of the header.
if ! output="$("$PARTED" -s -m "$dev" unit s print | grep -E -v "^(Warning|Error): ")"; then
log_error "Unable to read partition table for device \`${dev}'. The image seems corrupted."
fi
......@@ -410,7 +410,7 @@ create_partition() {
$PARTED -s -m $device set "$id" "$flag" on
done
else
# For gpt
# For GPT
start=${start:0:${#start}-1} # remove the s at the end
end=${end:0:${#end}-1} # remove the s at the end
$SGDISK -n "$id":"$start":"$end" -t "$id":"$ptype" "$device"
......@@ -633,10 +633,10 @@ cleanup() {
for i in $REVERSE_INDEXES; do
# If something fails here, it's better to retry it for a few times
# before we give up with an error. This is needed for kpartx when
# dealing with ntfs partitions mounted through fuse. umount is not
# dealing with NTFS partitions mounted through fuse. umount is not
# synchronous and may return while the partition is still busy. A
# premature attempt to delete partition mappings through kpartx on
# a device that hosts previously mounted ntfs partition may fail
# a device that hosts previously mounted NTFS partition may fail
# with a `device-mapper: remove ioctl failed: Device or resource
# busy' error. A sensible workaround for this is to wait for a
# while and then try again.
......
......@@ -17,11 +17,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
"""Decode a json encoded string with properties
"""Decode a JSON encoded string with properties
This program decodes a json encoded properties string and outputs it in a
bash sourcable way. The properties are passed to the program through a JSON
string either read from a file or from standard input and are outputed to a
This program decodes a JSON encoded properties string and outputs it in a
bash sourceable way. The properties are passed to the program through a JSON
string either read from a file or from standard input and are outputted to a
target file.
"""
......
......@@ -173,9 +173,9 @@ class Disklabel:
24 16 Pack Identifier
32 4 Bytes per sector
36 4 Data sectors per track
40 4 Tracks per cilinder
40 4 Tracks per cylinder
44 4 Data cylinders per unit
48 4 Data sectors per cylynder
48 4 Data sectors per cylinder
52 4 Data sectors per unit
56 8 Unique label identifier
64 4 Alt cylinders per unit
......@@ -189,7 +189,7 @@ class Disklabel:
106 2 Version
108 4*4 Reserved for future use
124 4 Magic number
128 2 Xor of data Inclu. partitions
128 2 Xor of data including partitions
130 2 Number of partitions in following
132 4 size of boot area at sn0, bytes
136 4 Max size of fs superblock, bytes
......@@ -206,9 +206,9 @@ class Disklabel:
4 4 Starting sector
8 2 Starting sector (high part)
10 2 Number of sectors (high part)
12 1 Filesystem type
13 1 Filesystem Fragment per block
14 2 FS cylinders per group
12 1 File system type
13 1 File system Fragment per block
14 2 File system cylinders per group
"""
Partition = namedtuple(
......@@ -387,7 +387,7 @@ class Disklabel:
self.bstart = bstart & 0xffffffff
def getbstart(self):
"""Get start of usable region"""
"""Get start of useable region"""
return (self.bstarth << 32) + self.bstart
def setbend(self, bend):
......@@ -396,6 +396,7 @@ class Disklabel:
self.bend = bend & 0xffffffff
def getbend(self):
"""Get end of useable region"""
return (self.bendh << 32) + self.bend
def enlarge_disk(self, new_size):
......@@ -409,7 +410,7 @@ class Disklabel:
self.ncylinders = self.getdsize() // (self.nsectors * self.ntracks)
self.setbend(self.ncylinders * self.nsectors * self.ntracks)
# Partition 'c' descriptes the entire disk
# Partition 'c' describes the entire disk
self.ptable.setpsize(2, new_size)
# Fix the MBR table
......@@ -502,7 +503,7 @@ class Disklabel:
"The magic number again: 0x%x\n" % self.magic2 + \
"Checksum: %d\n" % self.checksum + \
"Number of partitions: %d\n" % self.npartitions + \
"Size of boot aread at sn0: %d\n" % self.bbsize + \
"Size of boot area at sn0: %d\n" % self.bbsize + \
"Max size of fs superblock: %d\n" % self.sbsize + \
"%s" % self.ptable
......
......@@ -40,7 +40,7 @@ def random_salt(length=8):
METHOD = {
# Name: (algoritm, options)
# Name: (algorithm, options)
'md5': (passlib.hash.md5_crypt, {}),
'blowfish': (passlib.hash.bcrypt, {}),
'sha256': (
......
......@@ -42,7 +42,7 @@ set -o errtrace
trap report_error ERR
if grep snf_image_activate_helper /proc/cmdline > /dev/null; then
# terminate helper vm when the script exits
# terminate helper VM when the script exits
add_cleanup system_poweroff
else
log_error "Kernel command line activation flag: " \
......
......@@ -39,7 +39,7 @@ if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = openbsd ]; then
@scriptsdir@/disklabel.py -d "$($BLOCKDEV --getsz "$SNF_IMAGE_DEV")" -p "$SNF_IMAGE_DEV"
# Tell the kernel to recreate the disk partitions.
# We cannot use partprobe to do this because partprobe uses BLKPG ioctl
# to create the partitions device files by itself one by one. Since parted
# and creates the partition device files by itself one by one. Since parted
# does not support disklabels, the partitions with id larger than 4 will
# not be created.
# We need to tell the kernel to read the partition table by itself.
......@@ -69,7 +69,7 @@ if [ "$table_type" == "gpt" ]; then
"$SGDISK" --move-second-header "$SNF_IMAGE_DEV"
elif [ "$table_type" != "msdos" ]; then
log_error "Device: \'${SNF_IMAGE_DEV}' contains unsupported partition " \
"table type: \`$table_type'. Only msdos & gpt partitions are" \
"table type: \`$table_type'. Only MSDOS & GPT partitions are" \
"supported."
fi
......@@ -112,7 +112,7 @@ fi
extended=""
if [ "$table_type" != "msdos" ]; then
# For gpt partitions, get the partition GUID code as partition type
# For GPT partitions, get the partition GUID code as partition type
last_part_type="$($SGDISK -i "$last_part_id" "$SNF_IMAGE_DEV" | grep "^Partition GUID code:" | cut -d"(" -f1 | cut -d: -f2 | xargs echo)"
elif [ $last_part_id -gt 4 ]; then
last_part_type="logical"
......@@ -161,7 +161,7 @@ enlarge_partition "$SNF_IMAGE_DEV" "$last_part" "$last_part_type" "${new_end}s"
if [ $swap_num -gt 0 ]; then
swap_part="$swap_num:${swap_start}s:${swap_end}s:0:linux-swap(v1)::;"
if [ "$table_type" != "msdos" ]; then
swap_ptype="swap" # in gpt this is used as a partition name
swap_ptype="swap" # in GPT this is used as a partition name
elif [ $swap_num -ge 5 ]; then
if [ -z "$extended" ]; then
extended="0:$((swap_start - 2))s:${swap_end}s:0:::;"
......
......@@ -21,7 +21,7 @@
# Provides: FilesystemResizeUnmounted
# RunBefore: MountImage
# RunAfter: FixPartitionTable
# Short-Description: Resize filesystem to use all the available space
# Short-Description: Resize file system to use all the available space
### END TASK INFO
set -e
......@@ -77,7 +77,7 @@ if [[ "$ptype" == ext[234] ]]; then
state=$($TUNE2FS -l "$device" | grep ^Filesystem\ state: | cut -d: -f2);
state=$(echo $state) #trim the value
# We force a filesystem resize here if the file system is clean, even if
# We force a file system resize here if the file system is clean, even if
# resize2fs complains. By default resize2fs will refuse to resize a file
# system that has been mounted after the last fs check, but since we are
# sure the file system is clean it's safe enough to bypass this.
......
......@@ -89,7 +89,7 @@ fi
fi
if [ "x$distro" = "xdebian" ]; then
# Most distros recreate missing keys...debian complains
# Most distros recreate missing keys but Debian complains
type=""
if [ -e "$target/$key" ]; then
if grep -e "-----BEGIN DSA PRIVATE KEY-----" "