Browse Source

Make linux.system.kernel functional

tags/2016.12
Filip Pytloun 9 years ago
parent
commit
281034a655
2 changed files with 49 additions and 50 deletions
  1. +27
    -0
      README.rst
  2. +22
    -50
      linux/system/kernel.sls

+ 27
- 0
README.rst View File



To disable set autologin to `false`. To disable set autologin to `false`.


Kernel
~~~~~~

Install always up to date LTS kernel and headers from Ubuntu trusty:

.. code-block:: yaml

linux:
system:
kernel:
type: generic
lts: trusty
headers: true

Install specific kernel version and ensure all other kernel packages are
not present. Also install extra modules and headers for this kernel:

.. code-block:: yaml

linux:
system:
kernel:
type: generic
extra: true
headers: true
version: 4.2.0-22

Repositories Repositories
~~~~~~~~~~~~ ~~~~~~~~~~~~



+ 22
- 50
linux/system/kernel.sls View File



{%- if system.kernel is defined %} {%- if system.kernel is defined %}


Basic kernel:

linux:
system:
kernel:
hold: true
versions:
generic:
headers: true


linux:
system:
kernel:
source:
engine: pkg
repo: from_repo
version: 1.13.42
hold: true
headers: true
generic: true

linux-headers-3.13.0-34
linux-image-3.13.0-34-generic
linux-headers-3.13.0-34-generic

{%- if system.kernel.get('source', {'engine': 'pkg'}).engine == 'pkg' %}

{%- if system.kernel.version is defined %} {%- if system.kernel.version is defined %}


linux_kernel_package: linux_kernel_package:
pkg.installed: pkg.installed:
- name: linux-image-{{ system.kernel.version }}
- names:
- linux-image-{{ system.kernel.version }}-{{ system.kernel.type|default('generic') }}
{%- if system.kernel.get('headers', False) %}
- linux-headers-{{ system.kernel.version }}-{{ system.kernel.type|default('generic') }}
{%- endif %}
{%- if system.kernel.get('extra', False) %}
- linux-extra-{{ system.kernel.version }}-{{ system.kernel.type|default('generic') }}
{%- endif %}
- refresh: true - refresh: true


{%- else %}

linux_kernel_package:
pkg.latest:
- name: linux-image-generic
- refresh: true

{%- endif %}

{%- if system.kernel.headers is defined %}
{%- if system.kernel.version is defined %}

linux_kernel_package:
pkg.installed:
- name: linux-image-{{ system.kernel.version }}
- version:
- refresh: true
# Not very Salt-ish.. :-(
linux_kernel_old_absent:
cmd.wait:
- name: "apt-get purge -y --no-input $(dpkg -l '*linux-image-[0-9]*' '*linux-headers-[0-9]*' '*linux-extra-[0-9]*' | grep -E '^ii' | awk '{print $2}' | grep -v '{{ system.kernel.version }}')"
- watch:
- pkg: linux_kernel_package


{%- else %} {%- else %}


linux_kernel_package: linux_kernel_package:
pkg.latest: pkg.latest:
- name: linux-image-generic
- names:
- linux-image-{{ system.kernel.type|default('generic') }}{% if system.kernel.get('lts', False) %}-lts-{{ system.kernel.lts }}{% endif %}
{%- if system.kernel.get('headers', False) %}
- linux-headers-{{ system.kernel.type|default('generic') }}{% if system.kernel.get('lts', False) %}-lts-{{ system.kernel.lts }}{% endif %}
{%- endif %}
{%- if system.kernel.get('extra', False) %}
- linux-extra-{{ system.kernel.type|default('generic') }}{% if system.kernel.get('lts', False) %}-lts-{{ system.kernel.lts }}{% endif %}
{%- endif %}
- refresh: true - refresh: true


{%- endif %} {%- endif %}
{%- endif %}


{%- endif %} {%- endif %}


{%- endif %} {%- endif %}

{%- endif %}

Loading…
Cancel
Save