Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
snf-image
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
snf-image
Commits
276b9e43
Commit
276b9e43
authored
Oct 04, 2016
by
Nikos Skalkotos
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into debian-trusty
parents
9f1884de
d7d7934f
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
467 additions
and
161 deletions
+467
-161
ChangeLog
ChangeLog
+9
-0
docs/advanced.rst
docs/advanced.rst
+10
-10
docs/architecture.rst
docs/architecture.rst
+94
-72
docs/index.rst
docs/index.rst
+1
-1
docs/installation.rst
docs/installation.rst
+19
-4
docs/interface.rst
docs/interface.rst
+6
-0
docs/usage.rst
docs/usage.rst
+38
-30
docs/version.py
docs/version.py
+1
-1
snf-image-helper/common.sh.in
snf-image-helper/common.sh.in
+20
-0
snf-image-helper/networking/Makefile.am
snf-image-helper/networking/Makefile.am
+1
-1
snf-image-helper/networking/ifcfg.sh.in
snf-image-helper/networking/ifcfg.sh.in
+0
-0
snf-image-helper/networking/ifupdown.sh.in
snf-image-helper/networking/ifupdown.sh.in
+0
-0
snf-image-helper/networking/nm.sh.in
snf-image-helper/networking/nm.sh.in
+86
-0
snf-image-helper/tasks/50ChangeMachineId.in
snf-image-helper/tasks/50ChangeMachineId.in
+66
-0
snf-image-helper/tasks/50ConfigureNetwork.in
snf-image-helper/tasks/50ConfigureNetwork.in
+10
-5
snf-image-helper/tasks/Makefile.am
snf-image-helper/tasks/Makefile.am
+1
-0
snf-image-host/common.sh.in
snf-image-host/common.sh.in
+46
-4
snf-image-host/create
snf-image-host/create
+5
-10
snf-image-host/export
snf-image-host/export
+1
-5
snf-image-host/import
snf-image-host/import
+1
-5
snf-image-host/kvm-common.sh
snf-image-host/kvm-common.sh
+39
-10
snf-image-host/snf-image-update-helper.in
snf-image-host/snf-image-update-helper.in
+10
-0
snf-image-host/xen-common.sh
snf-image-host/xen-common.sh
+1
-1
version
version
+1
-1
version.m4
version.m4
+1
-1
No files found.
ChangeLog
View file @
276b9e43
2016-10-4, v0.20.1
* Fix a "no properly formatted MD5 checksum lines found" bug in
snf-image-update-helper
2016-10-3, v0.20
* Add support for NetworkManager in CofigureNetwork configuration task
* Add a new Linux configuration task for regenerating the machine ID
* Update the documentation
2016-07-20, v0.19.1
* Add "auto" to the known Linux file systems
...
...
docs/advanced.rst
View file @
276b9e43
...
...
@@ -52,16 +52,16 @@ Although *diskdump* is a lot more flexible than the older formats, there are
still some rules to follow:
* For Linux:
* All block devices in ``/etc/fstab`` should be specified using persistent
names (UUID or LABEL)
* LVM partitions are not supported
* Only ext{2,3,4} file systems are supported
* All block devices in ``/etc/fstab`` should be specified using persistent
names (UUID or LABEL)
* LVM partitions are not supported
* Only ext{2,3,4} file systems are supported
* For FreeBSD:
* GUID Partition Tables (GPT) should be used
* Only UFS2 file systems are supported
* Labels should be omitted in ``/etc/fstab`` entries
* GUID Partition Tables (GPT) should be used
* Only UFS2 file systems are supported
* Labels should be omitted in ``/etc/fstab`` entries
* For {Open,Net}BSD:
* Only FFS file systems should be used
* Only FFS file systems should be used
.. _windows-deployment:
...
...
@@ -144,7 +144,7 @@ one:
The ``@TIMEZONE_INDEX@`` container will be replaced during the installation of
the file by the index value of the time zone which is specified through the
*WINDOWS_TIMEZONE* configuration variable. For more info check `here
<https://msdn.microsoft.com/en-us/library/ms912391%28v=winembedded.11%29.aspx>`_.
<https://msdn.microsoft.com/en-us/library/ms912391%28v=winembedded.11%29.aspx>`_
_
.
This file is known to work with Windows XP and in order for the deployment to
be completely unattended, the user must provide a Windows Product key using the
*os_product_key* OS parameter *snf-image* offers. As with the newer Windows
...
...
@@ -291,7 +291,7 @@ environment variables that are present when the configuration tasks run.
|NIC_%N_* |The Ganeti provided environment variable for the Nth |
| |network interface controller. Check |
| |`here <http://docs.ganeti.org/ganeti/current/man/ganeti|
| |-os-interface.html>`_
|
| |-os-interface.html>`_
_
|
+---------------------+-------------------------------------------------------+
|DHCP_TAGS |The value of the DHCP_TAGS configuration parameter (see|
| |:ref:`Configuration Parameters |
...
...
docs/architecture.rst
View file @
276b9e43
...
...
@@ -149,31 +149,22 @@ if any of the environment variables *SNF_IMAGE_DEV*,
*SNF_IMAGE_PROPERTY_ROOT_PARTITION* or *SNF_IMAGE_TARGET* is unset or has a
non-sane value.
**AddSwap**: Formats the swap partition added by *FixPartitionTable* task and
adds an appropriate swap entry in the system's ``/etc/fstab``. The script will
only run if *SNF_IMAGE_PROPERTY_SWAP* is present and will fail if
*SNF_IMAGE_TARGET* in not defined.
**DeleteSSHKeys**: On Linux and \*BSD instances, this script will clear out any
ssh keys found in the instance's disk. For Debian and Ubuntu systems, the keys
are also recreated. Besides removing files that comply to the
``/etc/ssh/ssh_*_key`` pattern, the script will also parses
``/etc/ssh/sshd_config`` file for custom keys. The only variable this script
depends on is *SNF_IMAGE_TARGET*.
**DisableRemoteDesktopConnections**: This script temporary disables RDP
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
*SNF_IMAGE_TARGET* variables needs to be present for this task to run.
**SELinuxAutorelabel**: Creates *.autorelabel* file in Red Hat images. This is
needed if SELinux is enabled to enforce an automatic file system relabeling
during the first boot. The only environment variable required by this task is
*SNF_IMAGE_TARGET*.
**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.
**AddSwap**: Formats the swap partition added by *FixPartitionTable* task and
adds an appropriate swap entry in the system's ``/etc/fstab``. The script will
only run if *SNF_IMAGE_PROPERTY_SWAP* is present and will fail if
*SNF_IMAGE_TARGET* in not defined.
**AssignHostname**: Assigns or changes the hostname of the instance. The task
will fail if the Linux distribution is not supported and ``/etc/hostname`` is
...
...
@@ -182,6 +173,11 @@ SUSE and Gentoo derived distributions. The hostname is read from
*SNF_IMAGE_HOSTNAME* variable. In addition to the latter, *SNF_IMAGE_TARGET* is
also required.
**ChangeMachineId**: On Linux instances, this script will generate a new random
machine ID and will place it in ``/etc/machine-id``. For more info check
`here <https://www.freedesktop.org/software/systemd/man/machine-id.html>`_. The
task will fail if *SNF_IMAGE_TARGET* is missing.
**ChangePassword**: Changes the password for a list of existing users. On Linux
systems this is accomplished by directly altering the instance's
``/etc/shadow`` file. On Windows systems a script is injected into the VM's
...
...
@@ -202,16 +198,25 @@ variables are exported to the task. The only variable required by this task is
adjust the *DHCP_TAGS* and the *\*_DHCPV6_TAGS* configuration parameters (see
:doc:`/configuration`).
**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.
**DeleteSSHKeys**: On Linux and \*BSD instances, this script will clear out any
ssh keys found in the instance's disk. For Debian and Ubuntu systems, the keys
are also recreated. Besides removing files that comply to the
``/etc/ssh/ssh_*_key`` pattern, the script will also parses
``/etc/ssh/sshd_config`` file for custom keys. The only variable this script
depends on is *SNF_IMAGE_TARGET*.
**DisableRemoteDesktopConnections**: This script temporary disables RDP
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.
**SELinuxAutorelabel**: Creates *.autorelabel* file in Red Hat images. This is
needed if SELinux is enabled to enforce an automatic file system relabeling
during the first boot. The only environment variable required by this task is
*SNF_IMAGE_TARGET*.
**EnforcePersonality**: Injects the files specified by the
*SNF_IMAGE_P
ROPERTY_OSFAMIL
Y* variable into the file system. If the variable is
*SNF_IMAGE_P
ERSONALIT
Y* variable into the file system. If the variable is
missing a warning is produced. Only *SNF_IMAGE_TARGET* is required for this
task to run.
...
...
@@ -222,48 +227,65 @@ a warning is produced.
**UmountImage**: Umounts the file systems previously mounted by MountImage. The
only environment variable required is *SNF_IMAGE_TARGET*.
+-------------------------------+---+--------------------------------------------+----------------------------------------------+
| | | Dependencies | Environment 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 |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|ConfigureNetwork |50 |InstallUnattend |EnforcePersonality |TARGET |NIC_* |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|FilesystemResizeMounted |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|EnforcePersonality |60 |MountImage |UmountImage |TARGET |PERSONALITY |
| | | | | |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|RunCustomTask |70 |MountImage |UmountImage |TARGET |PROPERTY_CUSTOM_TASK|
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|UmountImage |80 |MountImage | |TARGET | |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
**FilesystemResizeAfterUmount**: This is used for doing offline resize if the
file system in the last partition is NTFS. This is done after umount and not
before mounting the file system, because *ntfsresize* (which is used to perform
the actual resize) will mark the file system as dirty at the end and mounting
it afterwards is not recommended. This is done in order to force a chkdsk the
next time Windows boots. Offline NTFS resize is favored on windows-legacy and
non-windows OSes that do not support online resize. If you want to force
offline resize on newer Windows systems, the *OFFLINE_NTFSRESIZE* image
property must be defined.
+-------------------------------+---+--------------------------------------------+-----------------------------------------------------+
| | | Dependencies | Environment Variables [#]_ |
+ Name | +------------------+-------------------------+-------------------------+---------------------------+
| |Pr.| Run-After | Run-Before | Required | Optional |
+===============================+===+==================+=========================+=========================+===========================+
|FixPartitionTable |10 | |FilesystemResizeUnmounted|DEV | |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|FilesystemResizeUnmounted |20 |FixPartitionTable |MountImage |DEV |RESIZE_PART |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|MountImage |30 | |UmountImage |DEV | |
| | | | |TARGET | |
| | | | |PROPERTY_ROOT_PARTITION | |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|InstallUnattend |35 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|FilesystemResizeMounted |40 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
| | | | | |RESIZE_PART |
| | | | | |PROPERTY_OFFLINE_NTFSRESIZE|
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|AddSwap |50 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
| | | | | |PROPERTY_SWAP |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|AssignHostname |50 |InstallUnattend |EnforcePersonality |TARGET | |
| | | | |HOSTNAME |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|ChangeMachineId |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|ChangePassword |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_USERS |
| | | | | |PROPERTY_OSFAMILY |
| | | | | |PASSWD |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|ConfigureNetwork |50 |InstallUnattend |EnforcePersonality |TARGET |NIC_* |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|DeleteSSHKeys |50 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|DisableRemoteDesktopConnections|50 |EnforcePersonality|UmountImage |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|SELinuxAutorelabel |50 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|EnforcePersonality |60 |MountImage |UmountImage |TARGET |PERSONALITY |
| | | | | |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|RunCustomTask |70 |MountImage |UmountImage |TARGET |PROPERTY_CUSTOM_TASK |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|UmountImage |80 |MountImage | |TARGET | |
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
|FilesystemResizeAfterUmount |81 |UmountImage | |DEV |RESIZE_PART |
| | | | | |PROPERTY_OSFAMILY |
| | | | | |PROPERTY_OFFLINE_NTFSRESIZE|
+-------------------------------+---+------------------+-------------------------+-------------------------+---------------------------+
.. [#] all environment variables are prefixed with *SNF_IMAGE_*
docs/index.rst
View file @
276b9e43
...
...
@@ -27,7 +27,7 @@ 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, CoreOS), Windows Server
flavors (2008 R2, 2012, 20
0
12 R2), as well as BSD systems (FreeBSD, OpenBSD,
flavors (2008 R2, 2012, 2012 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) as well as Windows XP.
...
...
docs/installation.rst
View file @
276b9e43
...
...
@@ -13,13 +13,19 @@ Installing snf-image using packages
Debian GNU/Linux
^^^^^^^^^^^^^^^^
For Debian 7.x (Wheezy) we provide packages in our APT repository. To use
our repository
add the following lines to file ``/etc/apt/sources.list``:
We provide Debian packages in our APT repository. To use our packages on
Debian 7.x (Wheezy)
add the following lines to file ``/etc/apt/sources.list``:
``deb http://apt.dev.grnet.gr wheezy/``
``deb-src http://apt.dev.grnet.gr wheezy/``
For Debian 8.x (Jessie) add the following lines:
``deb http://apt.dev.grnet.gr jessie/``
``deb-src http://apt.dev.grnet.gr jessie/``
After you update ``/etc/apt/sources.list`` import the repo's GPG key:
.. code-block:: console
...
...
@@ -39,13 +45,19 @@ the post install phase of the package installation.
Ubuntu
^^^^^^
For Ubuntu 14.04 LTS we provide packages in our APT repository. To use our
repository
add the following lines to file ``/etc/apt/sources.list``:
We provide Ubuntu packages in our APT repository. To use our packages on
Ubuntu 14.04 LTS
add the following lines to file ``/etc/apt/sources.list``:
``deb http://apt.dev.grnet.gr trusty/``
``deb-src http://apt.dev.grnet.gr trusty/``
For Ubuntu 16.04 LTS add the following lines:
``deb http://apt.dev.grnet.gr xenial/``
``deb-src http://apt.dev.grnet.gr xenial/``
After you update ``/etc/apt/sources.list`` import the repo's GPG key:
.. code-block:: console
...
...
@@ -65,6 +77,9 @@ the post install phase of the package installation.
CentOS
^^^^^^
.. warning::
CentOS packages are no longer actively supported.
For CentOS 6.5 we provide packages in our Yum repository.
To add the GRNET repository in your system, run:
...
...
docs/interface.rst
View file @
276b9e43
...
...
@@ -228,6 +228,12 @@ All image formats properties
you want to write a custom configuration task check
:ref:`Configuration Tasks Environment<configuration-tasks-environment>`.
* **NM_NETWORKING=bool**
If this property is defined with a yes value, the *ConfigureNetwork* task
will try to configure the Ganeti-provided NICs by creating Network Manager
configuration files, instead of using the distro-specific network
configuration mechanism (*ifupdown* for Debian, *ifcfg* for Red Hat, etc.).
* **EXCLUDE_ALL_TASKS=bool**
If this property is defined with a yes value, the image will not be
configured at all, during the deployment. This is really handy because it
...
...
docs/usage.rst
View file @
276b9e43
...
...
@@ -12,45 +12,53 @@ that have been tested with *snf-image* and provided here for testing purposes:
* Debian Jessie Base System
[`diskdump <https://cdn.synnefo.org/debian_base-8.0-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/debian_base-8.0-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/debian_base-8.0-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/debian_base-8.0-x86_64.diskdump>`_
_
]
[`md5sum <https://cdn.synnefo.org/debian_base-8.0-x86_64.diskdump.md5sum>`_
_
]
[`metadata <https://cdn.synnefo.org/debian_base-8.0-x86_64.diskdump.meta>`_
_
]
* Debian Jessie Desktop
[`diskdump <https://cdn.synnefo.org/debian_desktop-8.0-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/debian_desktop-8.0-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/debian_desktop-8.0-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/debian_desktop-8.0-x86_64.diskdump>`_
_
]
[`md5sum <https://cdn.synnefo.org/debian_desktop-8.0-x86_64.diskdump.md5sum>`_
_
]
[`metadata <https://cdn.synnefo.org/debian_desktop-8.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>`_]
[`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 23
[`diskdump <https://cdn.synnefo.org/fedora-23-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/fedora-23-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/fedora-23-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/fedora-23-x86_64.diskdump>`__]
[`md5sum <https://cdn.synnefo.org/fedora-23-x86_64.diskdump.md5sum>`__]
[`metadata <https://cdn.synnefo.org/fedora-23-x86_64.diskdump.meta>`__]
* Ubuntu Desktop LTS 16.04
[`diskdump <https://cdn.synnefo.org/ubuntu_desktop-16.04-x86_64.diskdump>`__]
[`md5sum <https://cdn.synnefo.org/ubuntu_desktop-16.04-x86_64.diskdump.md5sum>`__]
[`metadata <https://cdn.synnefo.org/ubuntu_desktop-16.04-x86_64.diskdump.meta>`__]
* Ubuntu Server LTS 16.04
[`diskdump <https://cdn.synnefo.org/ubuntu_server-16.04-x86_64.diskdump>`__]
[`md5sum <https://cdn.synnefo.org/ubuntu_server-16.04-x86_64.diskdump.md5sum>`__]
[`metadata <https://cdn.synnefo.org/ubuntu_server-16.04-x86_64.diskdump.meta>`__]
* Ubuntu Desktop LTS 14.04
[`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>`_]
[`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 <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>`_]
[`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>`_]
[`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 7.x
[`diskdump <https://cdn.synnefo.org/oraclelinux-7-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/oraclelinux-7-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/oraclelinux-7-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/oraclelinux-7-x86_64.diskdump>`_
_
]
[`md5sum <https://cdn.synnefo.org/oraclelinux-7-x86_64.diskdump.md5sum>`_
_
]
[`metadata <https://cdn.synnefo.org/oraclelinux-7-x86_64.diskdump.meta>`_
_
]
* FreeBSD 10.2
[`diskdump <https://cdn.synnefo.org/freebsd-10.2-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/freebsd-10.2-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/freebsd-10.2-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/freebsd-10.2-x86_64.diskdump>`_
_
]
[`md5sum <https://cdn.synnefo.org/freebsd-10.2-x86_64.diskdump.md5sum>`_
_
]
[`metadata <https://cdn.synnefo.org/freebsd-10.2-x86_64.diskdump.meta>`_
_
]
* NetBSD 7.0
[`diskdump <https://cdn.synnefo.org/netbsd-7.0-x86_64.diskdump>`_]
[`md5sum <https://cdn.synnefo.org/netbsd-7.0-x86_64.diskdump.md5sum>`_]
[`metadata <https://cdn.synnefo.org/netbsd-7.0-x86_64.diskdump.meta>`_]
[`diskdump <https://cdn.synnefo.org/netbsd-7.0-x86_64.diskdump>`_
_
]
[`md5sum <https://cdn.synnefo.org/netbsd-7.0-x86_64.diskdump.md5sum>`_
_
]
[`metadata <https://cdn.synnefo.org/netbsd-7.0-x86_64.diskdump.meta>`_
_
]
Sample Usage
^^^^^^^^^^^^
...
...
docs/version.py
View file @
276b9e43
__version__
=
"0.
19
.1"
__version__
=
"0.
20
.1"
snf-image-helper/common.sh.in
View file @
276b9e43
...
...
@@ -290,6 +290,26 @@ get_distro() {
fi
}
get_networking_tool() {
local root_dir distro tool
root_dir=$1
if check_yes_no SNF_IMAGE_PROPERTY_NM_NETWORKING; then
tool="nm"
else
distro=$(get_base_distro "$root_dir")
if [ "$distro" = debian ]; then
tool=ifupdown
elif [ "$distro" = redhat ]; then
tool=ifcfg
else
tool=$distro
fi
fi
echo "@networkingdir@/$tool.sh"
}
get_partition_table() {
local dev output
dev="$1"
...
...
snf-image-helper/networking/Makefile.am
View file @
276b9e43
networkingdir
=
$(libdir)
/
$(PACKAGE)
/networking
dist_networking_SCRIPTS
=
debian.sh redhat.sh freebsd.sh openbsd.sh netbsd
.sh
dist_networking_SCRIPTS
=
ifupdown.sh ifcfg.sh freebsd.sh openbsd.sh netbsd.sh nm
.sh
edit
=
sed
\
-e
's|@sysconfdir[@]|
$(sysconfdir)
|g'
\
...
...
snf-image-helper/networking/
redhat
.sh.in
→
snf-image-helper/networking/
ifcfg
.sh.in
View file @
276b9e43
File moved
snf-image-helper/networking/
debia
n.sh.in
→
snf-image-helper/networking/
ifupdow
n.sh.in
View file @
276b9e43
File moved
snf-image-helper/networking/nm.sh.in
0 → 100644
View file @
276b9e43
#! /bin/bash
# Copyright (C) 2016 GRNET S.A.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# Script for configuring network manager connections
set
-e
.
"@commondir@/common.sh"
networking_opts
"
$@
"
SYSTEM_CONNECTIONS
=
"
$SNF_IMAGE_TARGET
/etc/NetworkManager/system-connections/"
if
[
"
$initialize
"
=
yes
]
;
then
exit
0
fi
if
[
"
$finalize
"
=
yes
]
;
then
exit
0
fi
if
[
"
$ipv4
"
=
"none"
]
;
then
ipv4_section+
=
"method=disabled"
elif
[
"
$ipv4
"
=
"dhcp"
]
;
then
ipv4_section+
=
"method=auto"
else
ipv4_section+
=
"method=manual
address1=
$IP
/
${
SUBNET
##*/
}
"
if
[
-n
"
$GATEWAY
"
]
;
then
ipv4_section+
=
",
$GATEWAY
"
fi
fi
if
[
"
$ipv6
"
!=
'none'
]
;
then
ipv6_section
=
"method=auto"
else
ipv6_section
=
"method=disabled"
fi
connection
=
"
$SYSTEM_CONNECTIONS
/Wired connection
$index
"
cat
>
"
$connection
"
<<
EOF
[connection]
id=Wired connection
$index
uuid=
$(
cat
/proc/sys/kernel/random/uuid
)
type=ethernet
autoconnect=true
[ethernet]
mac-address=
$MAC
mac-address-blacklist=
[ipv4]
dns-search=
$ipv4_section
[ipv6]
addr-gen-mode=eui64
dns-search=
ip6-privacy=0
$ipv6_section
EOF
# For security, the 'keyfile' plugin that will read the connection files found
# under /etc/NetworkManager/system-connections will ignore files that are
# readable or writeable by any user or group other than 'root' since private
# keys and passphrases may be stored in plaintext inside the file.
chown
0:0
"
$connection
"
chmod
600
"
$connection
"
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
snf-image-helper/tasks/50ChangeMachineId.in
0 → 100644
View file @
276b9e43
#! /bin/bash
# Copyright (C) 2016 GRNET S.A.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
### BEGIN TASK INFO
# Provides: ClearMachineId
# RunBefore: EnforcePersonality
# RunAfter: FilesystemResizeMounted
# Short-Description: Regenerate /etc/machine-id file in Linux Systems
### END TASK INFO
set
-e
.
"@commondir@/common.sh"
trap
task_cleanup EXIT
report_task_start
# Check if the task should be prevented from running.
check_if_excluded
check_if_mounted_excluded
if
[
!
-d
"
$SNF_IMAGE_TARGET
"
]
;
then
log_error
"Target dir:
\`
$SNF_IMAGE_TARGET
' is missing."
fi
# Check if the image overwrites the task
check_if_overwritten
if
[
"
$SNF_IMAGE_PROPERTY_OSFAMILY
"
!=
"linux"
]
;
then
exit
0
fi
# Generate a new random UUID
uuid
=
$(
sed
's/-//g'
/proc/sys/kernel/random/uuid
)
if
[
-f
"
$SNF_IMAGE_TARGET
/etc/machine-id"
]
;
then
echo
"
$uuid
"
>
"
$SNF_IMAGE_TARGET
/etc/machine-id"
else
warn
"
\`
/etc/machine-id' file is not present"
fi
# The machine-id may be also cached by dbus
if
[
-f
"
$SNF_IMAGE_TARGET
/var/lib/dbus/machine-id"
]
;
then
echo
"
$uuid
"
>
"
$SNF_IMAGE_TARGET
/var/lib/dbus/machine-id"
else
warn
"
\`
/var/lib/dbus/machine-id' file is not present"
fi
exit
0
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
snf-image-helper/tasks/50ConfigureNetwork.in
View file @
276b9e43
...
...
@@ -42,17 +42,20 @@ fi
# Check if the image overwrites the task
check_if_overwritten
distro
=
$(
get_base_distro
"
$SNF_IMAGE_TARGET
"
)
networking_tool
=
$(
get_networking_tool
"
$SNF_IMAGE_TARGET
"
)
if
[
!
-f
"
@networkingdir@/
$distro
.sh
"
]
;
then
if
[
!
-f
"
$networking_tool
"
]
;
then
warn
"Don't know how to configure the network for this OS"
exit
0
else
echo
"Using
$networking_tool
"
fi
export
SNF_IMAGE_TARGET
# Initialize the driver
"@networkingdir@/
$distro
.sh"
-i
echo
"Running:
$networking_tool
-i"
"
$networking_tool
"
-i
for
index
in
$(
seq
0
$((
SNF_IMAGE_NIC_COUNT-1
))
)
;
do
dhcp
=
no
...
...
@@ -129,12 +132,14 @@ for index in $(seq 0 $((SNF_IMAGE_NIC_COUNT-1))); do
fi
fi
"@networkingdir@/
$distro
.sh"
$ARGS
echo
"Running:
$networking_tool
$ARGS
"
"
$networking_tool
"
$ARGS
done
# Finalize the driver
"@networkingdir@/
$distro
.sh"
-f
echo
"Running:
$networking_tool
-f"
"
$networking_tool
"
-f
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
...
...