$${VAR} will be rewritten as ${VAR} and not expanded.
Only alphanumeric characters and underscores (those with matches regular
expression \w+$) are allowed in variable name.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Variables can be defined in [variables] section in profile configuration.
Variables are specified the following way:
[variables]
VARIABLE1 = VALUE1
VARIABLE2 = VALUE2
Variables are expanded on definition and assignment. Previously defined variable
is redefined by its new definition.
Variables can be referenced in plugins configuration by using '$' prefix, e.g.:
[variables]
delay = 20
[audio]
timeout = $delay
There can be also included external file with definition of variables by using
'include' directive:
[variables]
include = filename
The 'filename' is processed by ConfigObj parser. Comments are supported by '#'
character. Multiple sections are not supported and files with multiple sections
are flattened to single section configuration file.
The variables are also supported by the script plugin. It exports variables into
environment before the script is executed. The variable names are prefixed by
the 'TUNED_' string. Example:
[variables]
VARIABLE1 = VALUE1
will be exported into environment as:
TUNED_VARIABLE1 = VALUE1
If there is already TUNED_ prefix in the variable name, no other prefix is
added, i.e.:
[variables]
TUNED_VARIABLE1 = VALUE1
will be exported as:
TUNED_VARIABLE1 = VALUE1
and not TUNED_TUNED_VARIABLE1.
Resolves: rhbz#1225124
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
It is supported by 'nightly' makefile target. It creates
snapshot from the GIT HEAD, makes mockbuild,
creates repo and uploads result on the fedorapeople.
Also fixed makefile to support parallel builds, added
couple of hopefully useful targets, implemented local
RPM build target 'rpm'.
Other targets (e.g. 'srpm') can be also used to work
with snapshots. It is controlled by BUILD makefile
varible. If set to 'release' normal release is done.
If set to anything else (e.g. 'snapshot') snapshot
is done.
There is also support for GIT snapshots in the upstream
provided SPEC file. Snapshot build is done if
built with '--with snapshot', normal (release) build
is done otherwise.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
By default build as development release with build date and git suffix
added to the release number. Build without this suffix if built
--with release
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Usage:
[net]
coalesce=PARAM1 VALUE1 PARAM2 VALUE2
features=PARAM1 VALUE1 PARAM2 VALUE2
It is also possible to specify it by:
coalesce=PARAM1: VALUE1; PARAM2: VALUE2
or:
coalesce=PARAM1 VALUE1, PARAM2 VALUE2
or mix all separators.
Resolves: rhbz#1152539
Resolves: rhbz#1152541
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
They were intended to be class methods and that's why there
were defined with the 'cls' parameter, but they actually
weren't class methods.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
At first try to compare current and new values as integers. If it fails
try to compare them as hexadecimal values. If it fails compare them
as strings.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Accomplished by switch from GRUB_CMDLINE_LINUX to GRUB_CMDLINE_LINUX_DEFAULT
in /etc/default/grub
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Also introduced function remove_ws in utils which returns string
with consolidated whitespaces. Consolidated means with stripped
leading and trailing whitespaces and with multiple whitespaces
turned into one space.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Added 'verify' shell function to the 'functions' API. This
function is optional, if defined in the script, it is called
during the verification. It's return code is checked. Function
return code '0' means verification passed, other value means
failure.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Also added helper get_bool() function to utils. It can parse
variour boolean representations (e.g. from sysfs) and returns
string "0" for false and string "1" for true. If it cannot
parse boolean value, it returns original string.
Also fixed comparison of values for verify command in
plugins base class. Now it explicitly converts the values
to strings.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
The verify command verifies whether the current system settings matches
activated profile. It also writes all settings from the active profile
with the current / expected values to the log. It is good for checking
what is exactly set and what changed during the run.
Currently custom commands and plugin_scheduler are not supported.
Resolves: rhbz#1150047
Fixes: #34
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>