Commit 7e28b018 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Merge branch 'release-0.17'

parents 6b187d7d a8209e3d
2015-01-09, v0.17rc1
* Add support for btrfs
* Add support for xfs
* Add support for CoreOS
* Make all errors one line long
* Create man pages for snf-image-{update,create}-helper
* Shrink the helper VM
* Check the md5sum after downloading the helper VM
* Fix bugs
2014-10-30, v0.16.3
* pithcat: Set the default umask to 007 and fix the initialization of
the backend
......
......@@ -11,21 +11,32 @@ BUILDDIR = _build
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
......@@ -40,6 +51,11 @@ dirhtml:
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
......@@ -65,12 +81,60 @@ qthelp:
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/snf-image.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/snf-image"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/snf-image"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
"run these through (pdf)latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
......
......@@ -191,13 +191,16 @@ Windows setup. On \*BSD systems ``/etc/master.passwd`` is altered,
that will recreate the aforementioned file during the first boot. The list of
users whose passwords will changed is determined by the
*SNF_IMAGE_PROPERTY_USERS* variable (see :ref:`image-properties`). For this
task to run *SNF_IMAGE_TARGET* and *SNF_IMAGE_PASSWORD* variables need to be
task to run *SNF_IMAGE_TARGET* and *SNF_IMAGE_PASSWD* variables need to be
present.
**FilesystemResizeMounted**: Injects a script into a Windows image file system
that will enlarge the last file system to cover up the whole partition. The
script will run during the specialize pass of the Windows setup. If the
*SNF_IMAGE_TARGET* variable is missing, the task will fail.
**FilesystemResizeMounted**: For Windows VMs this task injects a script into
the VM's file system that will enlarge the last file system to cover up the
whole partition. The script will run during the specialize pass of the Windows
setup. For Linux VMs this task is used to extend the last file system in case
its type is Btrfs or XFS, since those file systems require to be mounted in
order to resize them. If the *SNF_IMAGE_TARGET* variable is missing, the task
will fail.
**EnforcePersonality**: Injects the files specified by the
*SNF_IMAGE_PROPERTY_OSFAMILY* variable into the file system. If the variable is
......@@ -208,43 +211,43 @@ task to run.
only environment variable required is *SNF_IMAGE_TARGET*.
+-------------------------------+---+--------------------------------------------+--------------------------------------------------+
| | | Dependencies | Enviromental Variables [#]_ |
+ Name | +------------------+-------------------------+-------------------------+------------------------+
| |Pr.| Run-After | Run-Before | Required | Optional |
+===============================+===+==================+=========================+=========================+========================+
|FixPartitionTable |10 | |FilesystemResizeUnmounted|DEV | |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|FilesystemResizeUnmounted |20 |FixPartitionTable |MountImage |DEV | |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|MountImage |30 | |UmountImage |DEV | |
| | | | |TARGET | |
| | | | |PROPERTY_ROOT_PARTITION | |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|AddSwap |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
| | | | | |PROPERTY_SWAP |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|DeleteSSHKeys |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|DisableRemoteDesktopConnections|40 |EnforcePersonality|UmountImage |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|InstallUnattend |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|SELinuxAutorelabel |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|AssignHostname |50 |InstallUnattend |EnforcePersonality |TARGET | |
| | | | |HOSTNAME |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|ChangePassword |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_USERS |
| | | | | |PROPERTY_OSFAMILY |
| | | | | |PASSWORD |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|FilesystemResizeMounted |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|EnforcePersonality |60 |MountImage |UmountImage |TARGET |PERSONALITY |
| | | | | |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|UmountImage |80 |MountImage | |TARGET | |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
+-------------------------------+---+--------------------------------------------+-------------------------------------------+
| | | Dependencies | Enviromental Variables [#]_ |
+ Name | +------------------+-------------------------+-------------------------+-----------------+
| |Pr.| Run-After | Run-Before | Required | Optional |
+===============================+===+==================+=========================+=========================+=================+
|FixPartitionTable |10 | |FilesystemResizeUnmounted|DEV | |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|FilesystemResizeUnmounted |20 |FixPartitionTable |MountImage |DEV | |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|MountImage |30 | |UmountImage |DEV | |
| | | | |TARGET | |
| | | | |PROPERTY_ROOT_PARTITION | |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|AddSwap |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY|
| | | | | |PROPERTY_SWAP |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|DeleteSSHKeys |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|DisableRemoteDesktopConnections|40 |EnforcePersonality|UmountImage |TARGET |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|InstallUnattend |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|SELinuxAutorelabel |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|AssignHostname |50 |InstallUnattend |EnforcePersonality |TARGET | |
| | | | |HOSTNAME |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|ChangePassword |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_USERS |
| | | | | |PROPERTY_OSFAMILY|
| | | | | |PASSWD |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|FilesystemResizeMounted |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|EnforcePersonality |60 |MountImage |UmountImage |TARGET |PERSONALITY |
| | | | | |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|UmountImage |80 |MountImage | |TARGET | |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
.. [#] all environment variables are prefixed with *SNF_IMAGE_*
......@@ -213,3 +213,21 @@ latex_documents = [
# If false, no module index is generated.
#latex_use_modindex = True
# -- Options for manual page output -------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('man/snf-image-update-helper', 'snf-image-update-helper',
"Update snf-image's helper files",
'Synnefo development team <synnefo-devel@googlegroups.com>', 1),
('man/snf-image-create-helper', 'snf-image-create-helper',
'Create a new helper image for snf-image',
'Synnefo development team <synnefo-devel@googlegroups.com>', 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
......@@ -23,9 +23,6 @@ some external programs in ``/etc/default/snf-image``:
# HELPER_DIR: Directory hosting the helper files
# HELPER_DIR="/var/lib/snf-image/helper/"
# HELPER_SIZE: Size of the helper VM image in MB
# HELPER_SIZE="600"
# HELPER_TIMEOUT: Soft and hard timeout limits for helper instance. The helper
# instance will be terminated after a given time if it hasn't exited by itself.
# A TERM signal will be send if the instance is running after a
......@@ -97,6 +94,7 @@ some external programs in ``/etc/default/snf-image``:
# Paths for needed programs. Uncomment and change the variables below if you
# don't want to use the default one.
# MD5SUM="md5sum"
# KVM="kvm"
# LOSETUP="losetup"
# KPARTX="kpartx"
......
......@@ -26,8 +26,10 @@ snf-image also supports Image customization via hooks. Hooks allow for:
snf-image is being used in large scale production environments with Ganeti to
successfully deploy many major Linux distributions (Debian, Ubuntu/Kubuntu,
CentOS, Fedora, OpenSUSE, Slackware, Arch Linux), Windows Server flavors
(2008 R2, 2012, 20012 R2), as well as BSD systems (FreeBSD, OpenBSD, NetBSD).
CentOS, Fedora, OpenSUSE, Slackware, Arch Linux, CoreOS), Windows Server
flavors (2008 R2, 2012, 20012 R2), as well as BSD systems (FreeBSD, OpenBSD,
NetBSD). It is also known to work well with current Desktop versions of Windows
(7, 8, 8.1).
The snf-image Ganeti OS Definition is released under
`GPLv2 <http://www.gnu.org/licenses/gpl-2.0.html>`_.
......
......@@ -92,7 +92,7 @@ To install snf-image from source, download the provided source package:
.. code-block:: console
$ wget http://apt.dev.grnet.gr/wheezy/snf-image_<VERSION>.orig.tar.gz
$ wget https://apt.dev.grnet.gr/wheezy/snf-image_<VERSION>.orig.tar.gz
Untar, configure and build the source:
......
......@@ -156,7 +156,7 @@ Optional properties
exists in the above-mentioned location. For more information on "answer
files" please refer to :ref:`windows-deployment`.
* **PASSWORD_HASHING_METHOD=md5|sha1|blowfish|sha256|sha512**
* **PASSWD_HASHING_METHOD=md5|sha1|blowfish|sha256|sha512**
This property can be used on Unix instances to specify the method to be used
to hash the users password. By default this is determined by the type of the
instance. For Linux and FreeBSD instances ``sha512`` is used, for OpenBSD
......
:orphan:
snf-image-create-helper manual page
===================================
Synopsis
--------
**snf-image-create-helper** [OPTIONS]
Description
-----------
Run multistrap and create a small Debian image populated with the
snf-image-helper package. This image is needed by ganeti's \`snf-image' guest
OS type to work.
Options
-------
-d DIRECTORY
Use this directory to host the created files instead of the default
[default: $HELPER_DIR]
-h Print this message
-p PACKAGE
Install this deb package in the helper image, instead of the default
-y Assume Yes to all queries and do not prompt
Files
-----
/etc/default/snf-image
Configuration file
/etc/snf-image/multistrap.conf
Multistrap configuration file
/etc/snf-image/apt.pref.d
Directory hosting APT preference files to be used during multistrap
:orphan:
snf-image-update-helper manual page
===================================
Synopsis
--------
**snf-image-update-helper** [OPTIONS]
Description
-----------
Download a fixed snf-image-helper image and install it under $HELPER_DIR.
Options
-------
-h Print this message
-u URL
Download URL to use for the helper image instead of the default
-y Assume Yes to all queries and do not prompt
-f Force the installation even if the snf-image and helper versions don't match
files
-----
/etc/default/snf-image
Configuration file for snf-image
/etc/defaults/snf-image-update-helper
Contains the default download URL
......@@ -12,53 +12,49 @@ that have been tested with *snf-image* and provided here for testing purposes:
* Debian Wheezy Base System
[`diskdump <http://cdn.synnefo.org/debian_base-7.0-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/debian_base-7.0-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/debian_base-7.0-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/debian_base-7.0-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/debian_base-7.0-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/debian_base-7.0-x86_64.diskdump.meta>`_]
* Debian Desktop
[`diskdump <http://cdn.synnefo.org/debian_desktop-7.0-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/debian_desktop-7.0-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/debian_desktop-7.0-x86_64.diskdump.meta>`_]
* CentOS 6.x
[`diskdump <http://cdn.synnefo.org/centos-6-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/centos-6-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/centos-6-x86_64.diskdump.meta>`_]
* Fedora Desktop 20
[`diskdump <http://cdn.synnefo.org/fedora-20-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/fedora-20-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/fedora-20-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/debian_desktop-7.0-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/debian_desktop-7.0-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/debian_desktop-7.0-x86_64.diskdump.meta>`_]
* CentOS 7.x
[`diskdump <https://cdn.synnefo.org/centos-7-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/centos-7-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/centos-7-x86_64.diskdump.meta>`_]
* Fedora Desktop 21
[`diskdump <https://cdn.synnefo.org/fedora-21-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/fedora-21-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/fedora-21-x86_64.diskdump.meta>`_]
* Ubuntu Desktop LTS 14.04
[`diskdump <http://cdn.synnefo.org/ubuntu_desktop-14.04-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/ubuntu_desktop-14.04-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/ubuntu_desktop-14.04-x86_64.diskdump.meta>`_]
* Kubuntu LTS 14.04
[`diskdump <http://cdn.synnefo.org/kubuntu-14.10-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/kubuntu-14.10-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/kubuntu-14.10-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/ubuntu_desktop-14.04-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/ubuntu_desktop-14.04-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/ubuntu_desktop-14.04-x86_64.diskdump.meta>`_]
* Ubuntu Server LTS 14.04
[`diskdump <http://cdn.synnefo.org/ubuntu_server-14.04-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/ubuntu_server-14.04-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/ubuntu_server-14.04-x86_64.diskdump.meta>`_]
* OpenSUSE Desktop 13.1
[`diskdump <http://cdn.synnefo.org/opensuse_desktop-13.1-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/opensuse_desktop-13.1-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/opensuse_desktop-13.1-x86_64.diskdump.meta>`_]
* Oracle Linux 6.5
[`diskdump <http://cdn.synnefo.org/oraclelinux-6.5-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/oraclelinux-6.5-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/oraclelinux-6.5-x86_64.diskdump.meta>`_]
* FreeBSD 9.2
[`diskdump <http://cdn.synnefo.org/freebsd-9.2-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/freebsd-9.2-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/freebsd-9.2-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/ubuntu_server-14.04-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/ubuntu_server-14.04-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/ubuntu_server-14.04-x86_64.diskdump.meta>`_]
* OpenSUSE Desktop 13.2
[`diskdump <https://cdn.synnefo.org/opensuse_desktop-13.2-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/opensuse_desktop-13.2-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/opensuse_desktop-13.2-x86_64.diskdump.meta>`_]
* Oracle Linux 6.x
[`diskdump <https://cdn.synnefo.org/oraclelinux-6-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/oraclelinux-6-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/oraclelinux-6-x86_64.diskdump.meta>`_]
* FreeBSD 10.0
[`diskdump <https://cdn.synnefo.org/freebsd-10.0-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/freebsd-10.0-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/freebsd-10.0-x86_64.diskdump.meta>`_]
* OpenBSD 5.5
[`diskdump <http://cdn.synnefo.org/openbsd-5.5-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/openbsd-5.5-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/openbsd-5.5-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/openbsd-5.5-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/openbsd-5.5-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/openbsd-5.5-x86_64.diskdump.meta>`_]
* NetBSD 6.1
[`diskdump <http://cdn.synnefo.org/netbsd-6.1-x86_64.diskdump>`_]
[`md5sum <http://cdn.synnefo.org/netbsd-6.1-x86_64.diskdump.md5sum>`_]
[`metadata <http://cdn.synnefo.org/netbsd-6.1-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/netbsd-6.1-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/netbsd-6.1-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/netbsd-6.1-x86_64.diskdump.meta>`_]
Sample Usage
^^^^^^^^^^^^
......
__version__ = "0.16.3"
__version__ = "0.17rc1"
......@@ -37,8 +37,10 @@ DUMPFS_OPENBSD=dumpfs.openbsd
DATE="date -u" # Time in UTC
EATMYDATA=eatmydata
MOUNT="mount -n"
HIVEXGET="hivexget"
HIVEXREGEDIT="hivexregedit"
HIVEXGET=hivexget
HIVEXREGEDIT=hivexregedit
BTRFS=btrfs
XFS_GROWFS=xfs_growfs
CLEANUP=( )
ERRORS=( )
......@@ -181,7 +183,9 @@ system_poweroff() {
get_base_distro() {
local root_dir=$1
if [ -e "$root_dir/etc/debian_version" ]; then
if [ -d "$root_dir/etc/coreos" ]; then
echo "coreos"
elif [ -e "$root_dir/etc/debian_version" ]; then
echo "debian"
elif [ -e "$root_dir/etc/redhat-release" ]; then
echo "redhat"
......@@ -413,7 +417,7 @@ create_partition() {
# 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 -a 1 -n "$id":"$start":"$end" -t "$id":"$ptype" "$device"
$SGDISK -a 1 -n "$id":"$start":"$end" -t "$id":"$ptype" -c "$id":"$name" "$device"
fi
}
......@@ -502,6 +506,19 @@ bsd2linux() {
log_error "Couldn't find out mapping for BSD partition: \`$partition' in \`$device'"
}
find_mount_target() {
local device
device="$1"
while read entry; do
set $entry
if [ "$device" = "$1" -o "$device" = "$(readlink -f "$1")" ]; then
echo "$2"
break
fi
done <<< "$(cat /proc/mounts)"
}
mount_all() {
local osfamily target fs device fstab entry duid opts types num
osfamily="$1"
......@@ -510,7 +527,7 @@ mount_all() {
case "$osfamily" in
linux)
fs="ext[234]|msdos|vfat|ntfs"
fs="ext[234]|msdos|vfat|ntfs|btrfs|xfs"
;;
freebsd)
fs="ufs|msdosfs|ntfs"
......
......@@ -85,7 +85,7 @@ if [[ "$ptype" == ext[234] ]]; then
elif [[ "$ptype" == "freebsd-ufs" ]]; then
$GROWFS_UFS -y "$device"
else
warn "Don't know how to resize partition \`$id' with file system \`$ptype'."
warn "Don't know how to resize unmounted partition \`$id' with file system \`$ptype'."
fi
exit 0
......
......@@ -68,13 +68,18 @@ if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = "windows" ]; then
exit 0
fi
if [ ! -f "$SNF_IMAGE_TARGET/etc/fstab" ]; then
log_error "\`/etc/fstab' is missing from the root partition." \
if [ ! -d "$SNF_IMAGE_TARGET/etc" ]; then
log_error "\`/etc' is missing from the root partition." \
"Please check if the value for image property \`ROOT_PARTITION'" \
"(=$SNF_IMAGE_PROPERTY_ROOT_PARTITION) is valid."
fi
mount_all "$SNF_IMAGE_PROPERTY_OSFAMILY" "$SNF_IMAGE_DEV" "$SNF_IMAGE_TARGET"
if [ -f "$SNF_IMAGE_TARGET/etc/fstab" ]; then
mount_all "$SNF_IMAGE_PROPERTY_OSFAMILY" "$SNF_IMAGE_DEV" "$SNF_IMAGE_TARGET"
else
warn "\`/etc/fstab' is missing from the root partition." \
"Unable to mount any other device."
fi
exit 0
......
......@@ -66,6 +66,8 @@ linux_hostname() {
else
distro=$(get_base_distro "$target")
case "$distro" in
coreos)
echo "$hostname" > "$target/etc/hostname";;
redhat)
sed -i -e "s/HOSTNAME=.*$/HOSTNAME=$hostname/g" "$target/etc/sysconfig/network";;
slackware|suse)
......@@ -95,7 +97,9 @@ linux_hostname() {
# Some Linux distributions assign the hostname to 127.0.1.1 in order to be
# resolvable to an IP address. Lets replace this if found in /etc/hosts
sed -i -e "s/^[[:blank:]]*127\.0\.1\.1[[:blank:]].\+$/127.0.1.1\t$hostname/" "$target/etc/hosts"
if [ -f "$target/etc/hosts" ]; then
sed -i -e "s/^[[:blank:]]*127\.0\.1\.1[[:blank:]].\+$/127.0.1.1\t$hostname/" "$target/etc/hosts"
fi
}
freebsd_hostname() {
......
......@@ -114,10 +114,14 @@ unix_password() {
;;
esac
method="${SNF_IMAGE_PROPERTY_PASSWORD_HASHING_METHOD:-$default_method}"
echo -n "Encrypting password with \`$method' method ... "
encrypted=$("@scriptsdir@/hashpwd.py" -m "$method" "$password")
echo "done"
method="${SNF_IMAGE_PROPERTY_PASSWD_HASHING_METHOD:-$default_method}"
if [ "$method" != "none" ]; then
echo -n "Encrypting password with \`$method' method ... "
encrypted=$("@scriptsdir@/hashpwd.py" -m "$method" "$password")
echo "done"
else
encrypted="$password"
fi
users=()
......@@ -153,7 +157,7 @@ if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
fi
if [ -z "${SNF_IMAGE_PASSWORD+dummy}" ]; then
if [ -z "${SNF_IMAGE_PASSWD+dummy}" -a -z "${SNF_IMAGE_PASSWD_HASH+dummy}" ]; then
warn "Task ${PROGNAME:2} will not run. Password is not set"
exit 0
fi
......@@ -162,9 +166,16 @@ fi
SNF_IMAGE_PROPERTY_USERS=$(echo $SNF_IMAGE_PROPERTY_USERS)
if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = "windows" ]; then
windows_password "$SNF_IMAGE_TARGET" "$SNF_IMAGE_PASSWORD"