summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2010-10-07 12:16:21 -0400
committerDavid Zeuthen <davidz@redhat.com>2010-10-07 12:18:45 -0400
commit492e9a417f666bfe22e84ad7d3411e8d0a9a9b53 (patch)
treee1465f6cc0e46ddfde372c775bac63b64e45b999
parent9e3ec1644c897010e4660370b4e68d781fb92d5d (diff)
Rework how options work
In particular, drop the Options key and just include all keys that are prefixed with the name of the item type. This means that e.g. Options=Filesystem:mount_path=/media/My Photos;Filesystem:options=umask=0022,notime becomes FilesystemMountPath=/media/My Photos FilesystemOptions=umask=0022,noatime which is a lot easier to read. Also rename LUKS -> Luks MDRaid -> Raid NickName -> Comment Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--doc/stc.conf.xml108
-rw-r--r--stc/stcenums.h4
-rw-r--r--stc/stcitem.c48
-rw-r--r--stc/stcmonitor.c61
-rw-r--r--stc/test.c41
-rw-r--r--stc/testdata/semi_valid_conf/stc.conf26
-rw-r--r--stc/testdata/semi_valid_conf/stc.conf.d/10.conf2
-rw-r--r--stc/testdata/semi_valid_conf/stc.conf.d/50.conf2
-rw-r--r--stc/testdata/semi_valid_conf/stc.conf.d/50.conf.wrong-extension2
-rw-r--r--stc/testdata/semi_valid_conf/stc.conf.d/90.conf4
-rw-r--r--stc/testdata/semi_valid_conf/stc.conf.d/91.conf2
11 files changed, 147 insertions, 153 deletions
diff --git a/doc/stc.conf.xml b/doc/stc.conf.xml
index 0c8a8f5..e224b90 100644
--- a/doc/stc.conf.xml
+++ b/doc/stc.conf.xml
@@ -30,7 +30,7 @@
devices. These configuration files, collectively, contains a set
of <emphasis>storage items</emphasis>. Each storage item describes
how to mount a filesystem, how to assemble a RAID array, how to
- unlock a LUKS device, how to activate a LVM Volume Group and so
+ unlock a encrypted device, how to activate a LVM Volume Group and so
on.
</para>
<para>
@@ -38,28 +38,28 @@
filesystem this corresponds to whether it is mounted in the
configured location or not. Similarly, for a RAID array it conveys
whether the RAID is currently assembled or not. Additionally,
- items can depend on each other. This allows handling very complex
+ items can depend on each other. This allows handling complex
inter-subsystem storage trees such as:
</para>
<programlisting>
Filesystem
MyData
|
- LUKS
- MyData_LUKS
+ Luks
+ MyData_Luks
|
LVMVolume
+------------ MyData_LV ----------------+
| | |
| | |
- MDRaid MDRaid MDRaid
+ Raid Raid Raid
MyData_LV_PV1 MyData_LV_PV2 MyData_LV_PV3
| | |
(2 x Disks) (2 x Disks) (2 x Disks)
</programlisting>
<para>
The above example shows that <literal>MyData</literal> depends on
- <literal>MyData_LUKS</literal> that depends on
+ <literal>MyData_Luks</literal> that depends on
<literal>MyData_LV</literal>. Additionally,
<literal>MyData_LV</literal> depends on three RAID arrays,
<literal>MyData_LV_PV1</literal>, <literal>MyData_LV_PV2</literal>
@@ -91,7 +91,7 @@ MyData_LV_PV1 MyData_LV_PV2 MyData_LV_PV3
<programlisting>
[Filesystem MyDisk]
Device=/dev/disk/by-uuid/1234:5678
-Options=Filesystem:mount_path=/mnt/somewhere
+FilesystemMountPath=/mnt/somewhere
</programlisting>
<para>
In the above example, the type of the item is
@@ -131,16 +131,6 @@ Options=Filesystem:mount_path=/mnt/somewhere
</varlistentry>
<varlistentry>
- <term><literal>Options</literal></term>
- <listitem>
- <para>
- A list of options to use when starting the item. See each
- item type what set of keys are supported and/or required.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
<term><literal>Depends</literal></term>
<listitem>
<para>
@@ -152,22 +142,23 @@ Options=Filesystem:mount_path=/mnt/somewhere
</listitem>
</varlistentry>
</variablelist>
-
+ <para>
+ Additionally, items can have type-specific keys. See each item
+ type for details.
+ </para>
</refsect1>
<refsect1>
<title>Filesystem Items</title>
<para>
- Items of type <literal>Filesystem</literal> are used to mount a
- device into the filesystem tree — you can use keys
+ Items of type <literal>Filesystem</literal> are used to mount
+ block devices into the filesystem tree — you can use keys
<literal>Device</literal>, <literal>UUID</literal> and
- <literal>Label</literal> to refer to the device.
- </para>
- <para>
- The option <literal>Filesystem:mount_path</literal> is mandatory
- and is used to specify the path where the device should be
- mounted. The option <literal>Filesystem:options</literal> is
- optional and is a comma-separated list of options passed to the
+ <literal>Label</literal> to refer to the device. The option
+ <literal>FilesystemMountPath</literal> is mandatory and is used to
+ specify the path where the device should be mounted. The option
+ <literal>FilesystemOptions</literal> is optional and is a
+ comma-separated list of options to pass to the
<citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
command.
</para>
@@ -179,43 +170,59 @@ Options=Filesystem:mount_path=/mnt/somewhere
#
[Filesystem id1]
Label=Some Label
-Options=Filesystem:mount_path=/mnt/id1
+FilesystemMountPath=/mnt/id1
# Mount by UUID
#
[Filesystem id2]
UUID=4e057fd9-bae5-4a12-83b5-2f654d42edb1
-Options=Filesystem:mount_path=/mnt/id2
+FilesystemMountPath=/mnt/id2
# Mount by device (in this case, a persistent device name provided by udev(7))
#
[Filesystem id3]
Device=/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0-part1
-Options=Filesystem:mount_path=/mnt/id3
+FilesystemMountPath=/mnt/id3
# Specify filesystem options
#
[Filesystem id4]
Label=EOS_DIGITAL
-Options=Filesystem:mount_path=/media/My Photos;Filesystem:options=umask=0022,noatime
+FilesystemMountPath=/media/My Photos
+FilesystemOptions=umask=0022,noatime
</programlisting>
</refsect2>
</refsect1>
<refsect1>
- <title>LUKS Items</title>
+ <title>Luks Items</title>
<para>
- Items of type <literal>LUKS</literal> are used to unlock an
+ Items of type <literal>Luks</literal> are used to unlock an
encrypted device. The keys <literal>Device</literal> and
- <literal>UUID</literal> can be used to refer to the device.
+ <literal>UUID</literal> can be used to refer to the device. The
+ option <literal>LuksPassphrase</literal> is
+ <emphasis>optional</emphasis> and if set, contains the passphrase
+ used to unlock the device. If the
+ <literal>LuksPassphrase</literal> option is not set, then the user
+ is asked for the passphrase when starting the device.
</para>
+
+ <note>
+ <title>Security Note</title>
+ <para>
+ If using the <literal>LuksPassphrase</literal> option, the
+ <literal>Luks</literal> item should be stored in a file that is
+ not world-readable (for example, in a separate file in the
+ <filename>/etc/stc.conf.d</filename> directory). Otherwise any
+ unprivileged user with access to the system will be able to
+ obtain the passphrase.
+ </para>
+ </note>
+
<para>
- The option <literal>LUKS:passphrase</literal> is optional and if
- set, contains the passphrase used to unlock the device (if not
- set, then the user is asked for the passphrase when starting the
- device). The option <literal>LUKS:mapping_name</literal> is
- likewise optional and if set, then the given name will be used for
- the resulting <literal>dm-crypt</literal> device.
+ The option <literal>LuksMappingName</literal> is likewise optional
+ and if set, then the given name will be used for the resulting
+ <literal>dm-crypt</literal> device.
</para>
<refsect2>
@@ -223,26 +230,27 @@ Options=Filesystem:mount_path=/media/My Photos;Filesystem:options=umask=0022,noa
<programlisting>
# Passphrase and mapping name given
#
-[LUKS sekrit_LUKS]
+[Luks sekrit_Luks]
UUID=5b2aeadf-7f10-4df9-92f2-0bc13123d6e5
-Options=LUKS:passphrase=xyz123;LUKS:mapping_name=sekrit
+LuksPassphrase=xyz123
+LuksMappingName=sekrit
-# Example of a Filesystem item that depends on the LUKS item above.
-# This way the LUKS device and the Filesystem will be unlocked/mounted
+# Example of a Filesystem item that depends on the Luks item above.
+# This way the Luks device and the Filesystem will be unlocked/mounted
# respectively locked/unmounted in tandem when running stc(1).
#
[Filesystem sekrit]
UUID=9639-06F4
-Options=Filesystem:mount_path=/mnt/sekrit
-Depends=sekrit_LUKS
+FilesystemMountPath=/mnt/sekrit
+Depends=sekrit_Luks
</programlisting>
</refsect2>
</refsect1>
<refsect1>
- <title>MDRaid Items</title>
+ <title>Raid Items</title>
<para>
- Items of type <literal>MDRaid</literal> are used to assemble
+ Items of type <literal>Raid</literal> are used to assemble
<citerefentry><refentrytitle>md</refentrytitle><manvolnum>4</manvolnum></citerefentry>
aka Linux Software Raid devices. The keys <literal>UUID</literal>
and <literal>Name</literal> can be used to refer to the RAID
@@ -254,12 +262,12 @@ Depends=sekrit_LUKS
<programlisting>
# Refer to array by UUID
#
-[MDRaid BigStorage]
+[Raid BigStorage]
UUID=a4a5646e:933c7856:23bfc059:6e17b7ec
# Refer to array by name (typically in the homehost:name format)
#
-[MDRaid MyRaid]
+[Raid MyRaid]
Name=x61:MyRaid
</programlisting>
</refsect2>
diff --git a/stc/stcenums.h b/stc/stcenums.h
index 0e8a97c..627ff24 100644
--- a/stc/stcenums.h
+++ b/stc/stcenums.h
@@ -54,7 +54,7 @@ typedef enum
* StcItemType:
* @STC_ITEM_TYPE_INVALID: Unknown or invalid item type.
* @STC_ITEM_TYPE_FILESYSTEM: Filesystem mount.
- * @STC_ITEM_TYPE_MD_RAID: Linux Software RAID.
+ * @STC_ITEM_TYPE_RAID: Linux Software RAID.
* @STC_ITEM_TYPE_LUKS: Linux Unified Key System.
*
* Enumeration describing configuration item types.
@@ -63,7 +63,7 @@ typedef enum
{
STC_ITEM_TYPE_INVALID,
STC_ITEM_TYPE_FILESYSTEM,
- STC_ITEM_TYPE_MD_RAID,
+ STC_ITEM_TYPE_RAID,
STC_ITEM_TYPE_LUKS
} StcItemType;
diff --git a/stc/stcitem.c b/stc/stcitem.c
index 0a6d321..19cea4e 100644
--- a/stc/stcitem.c
+++ b/stc/stcitem.c
@@ -542,7 +542,7 @@ _stc_item_mdraid_get_devices (StcItem *item,
}
else
{
- g_warning ("Unsupported target type %s for LUKS", item->target);
+ g_warning ("Unsupported target type %s for Luks", item->target);
}
ret_component_devices = g_list_reverse (ret_component_devices);
@@ -607,7 +607,7 @@ _stc_item_update_state_filesystem (StcItem *item)
if (mount_paths != NULL)
{
const gchar *desired_mount_path;
- desired_mount_path = g_hash_table_lookup (item->options, "Filesystem:mount_path");
+ desired_mount_path = g_hash_table_lookup (item->options, "FilesystemMountPath");
g_assert (desired_mount_path != NULL);
if (_strv_has_str (mount_paths, desired_mount_path))
{
@@ -691,7 +691,7 @@ _stc_item_luks_get_devices (StcItem *item,
}
else
{
- g_warning ("Unsupported target type %s for LUKS", item->target);
+ g_warning ("Unsupported target type %s for Luks", item->target);
}
if (device_with_crypto != NULL)
@@ -767,7 +767,7 @@ _stc_item_update_state_luks (StcItem *item)
}
static StcItemState
-_stc_item_update_state_md_raid (StcItem *item)
+_stc_item_update_state_raid (StcItem *item)
{
StcItemState ret;
GUdevDevice *array_device;
@@ -927,8 +927,8 @@ _stc_item_update_state (StcItem *item)
state = _stc_item_update_state_luks (item);
break;
- case STC_ITEM_TYPE_MD_RAID:
- state = _stc_item_update_state_md_raid (item);
+ case STC_ITEM_TYPE_RAID:
+ state = _stc_item_update_state_raid (item);
break;
default:
@@ -1629,7 +1629,7 @@ _stc_item_start_filesystem (StcItem *item,
gchar *command_line;
const gchar *desired_mount_path;
- desired_mount_path = g_hash_table_lookup (item->options, "Filesystem:mount_path");
+ desired_mount_path = g_hash_table_lookup (item->options, "FilesystemMountPath");
g_assert (desired_mount_path != NULL);
if (mount_paths != NULL && _strv_has_str (mount_paths, desired_mount_path))
@@ -1643,9 +1643,9 @@ _stc_item_start_filesystem (StcItem *item,
goto out;
}
- o_mount_path = g_hash_table_lookup (item->options, "Filesystem:mount_path");
+ o_mount_path = g_hash_table_lookup (item->options, "FilesystemMountPath");
device_file = g_udev_device_get_device_file (device);
- options = g_hash_table_lookup (item->options, "Filesystem:options");
+ options = g_hash_table_lookup (item->options, "FilesystemOptions");
g_assert (o_mount_path != NULL);
g_assert (device_file != NULL);
@@ -1740,7 +1740,7 @@ _stc_item_start_luks (StcItem *item,
}
q_device = g_shell_quote (g_udev_device_get_device_file (device_with_crypto));
- name = g_strdup (g_hash_table_lookup (item->options, "LUKS:mapping_name"));
+ name = g_strdup (g_hash_table_lookup (item->options, "LuksMappingName"));
if (name == NULL)
name = g_strdup_printf ("stc-luks-uuid-%s",
g_udev_device_get_property (device_with_crypto, "ID_FS_UUID"));
@@ -1748,7 +1748,7 @@ _stc_item_start_luks (StcItem *item,
command_line = g_strdup_printf ("cryptsetup luksOpen %s %s", q_device, q_name);
- passphrase = g_strdup (g_hash_table_lookup (item->options, "LUKS:passphrase"));
+ passphrase = g_strdup (g_hash_table_lookup (item->options, "LuksPassphrase"));
if (passphrase == NULL)
{
passphrase = stc_operation_request_passphrase (operation, item);
@@ -1852,10 +1852,10 @@ get_free_md_device (StcItem *item)
}
static gboolean
-_stc_item_start_md_raid (StcItem *item,
- StcOperation *operation,
- GCancellable *cancellable,
- GError **error)
+_stc_item_start_raid (StcItem *item,
+ StcOperation *operation,
+ GCancellable *cancellable,
+ GError **error)
{
GUdevDevice *array_device;
GList *component_devices;
@@ -2021,8 +2021,8 @@ stc_item_start_sync (StcItem *item,
ret = _stc_item_start_luks (item, operation, cancellable, error);
break;
- case STC_ITEM_TYPE_MD_RAID:
- ret = _stc_item_start_md_raid (item, operation, cancellable, error);
+ case STC_ITEM_TYPE_RAID:
+ ret = _stc_item_start_raid (item, operation, cancellable, error);
break;
default:
@@ -2053,7 +2053,7 @@ _stc_item_stop_filesystem (StcItem *item,
{
const gchar *opt_mount_path;
- opt_mount_path = g_hash_table_lookup (item->options, "Filesystem:mount_path");
+ opt_mount_path = g_hash_table_lookup (item->options, "FilesystemMountPath");
g_assert (opt_mount_path != NULL);
if (_strv_has_str (mount_paths, opt_mount_path))
@@ -2180,10 +2180,10 @@ _stc_item_stop_luks (StcItem *item,
/* ---------------------------------------------------------------------------------------------------- */
static gboolean
-_stc_item_stop_md_raid (StcItem *item,
- StcOperation *operation,
- GCancellable *cancellable,
- GError **error)
+_stc_item_stop_raid (StcItem *item,
+ StcOperation *operation,
+ GCancellable *cancellable,
+ GError **error)
{
GUdevDevice *array_device;
gboolean ret;
@@ -2251,8 +2251,8 @@ stc_item_stop_sync (StcItem *item,
ret = _stc_item_stop_luks (item, operation, cancellable, error);
break;
- case STC_ITEM_TYPE_MD_RAID:
- ret = _stc_item_stop_md_raid (item, operation, cancellable, error);
+ case STC_ITEM_TYPE_RAID:
+ ret = _stc_item_stop_raid (item, operation, cancellable, error);
break;
default:
diff --git a/stc/stcmonitor.c b/stc/stcmonitor.c
index 09d581a..7e15eee 100644
--- a/stc/stcmonitor.c
+++ b/stc/stcmonitor.c
@@ -533,9 +533,9 @@ item_type_from_string (const gchar *str)
ret = STC_ITEM_TYPE_INVALID;
if (g_strcmp0 (str, "Filesystem") == 0)
ret = STC_ITEM_TYPE_FILESYSTEM;
- else if (g_strcmp0 (str, "MDRaid") == 0)
- ret = STC_ITEM_TYPE_MD_RAID;
- else if (g_strcmp0 (str, "LUKS") == 0)
+ else if (g_strcmp0 (str, "Raid") == 0)
+ ret = STC_ITEM_TYPE_RAID;
+ else if (g_strcmp0 (str, "Luks") == 0)
ret = STC_ITEM_TYPE_LUKS;
return ret;
@@ -608,19 +608,19 @@ check_validity (StcMonitor *monitor,
item_id);
goto out;
}
- if (g_hash_table_lookup (options, "Filesystem:mount_path") == NULL)
+ if (g_hash_table_lookup (options, "FilesystemMountPath") == NULL)
{
stc_monitor_emit_stc_error (monitor,
path,
line_no,
STC_ERROR_INSUFFICIENT_DATA,
- "Filesystem item %s is missing option Filesystem:mount_path.",
+ "Filesystem item %s is missing option FilesystemMountPath.",
item_id);
goto out;
}
break;
- case STC_ITEM_TYPE_MD_RAID:
+ case STC_ITEM_TYPE_RAID:
if (!(g_str_has_prefix (target, "UUID=") ||
g_str_has_prefix (target, "Name=")))
{
@@ -628,7 +628,7 @@ check_validity (StcMonitor *monitor,
path,
line_no,
STC_ERROR_FAILED,
- "MDRaid item %s has unsupported target type (UUID and Name is supported).",
+ "Raid item %s has unsupported target type (UUID and Name is supported).",
item_id);
goto out;
}
@@ -642,7 +642,7 @@ check_validity (StcMonitor *monitor,
path,
line_no,
STC_ERROR_FAILED,
- "MDRaid item %s has unsupported target type (UUID and Device is supported).",
+ "Raid item %s has unsupported target type (UUID and Device is supported).",
item_id);
goto out;
}
@@ -672,7 +672,7 @@ stc_monitor_load_one_file (StcMonitor *monitor,
GList *ret;
GKeyFile *key_file;
gchar **groups;
- guint n;
+ guint n, m;
gboolean failed;
ret = NULL;
@@ -694,10 +694,11 @@ stc_monitor_load_one_file (StcMonitor *monitor,
gchar *comment;
gchar *sort_key;
gchar *s;
- gchar **options_strv;
StcItem *item;
GHashTable *options;
gchar **depends_strv;
+ const gchar *item_type_as_string;
+ gchar **keys;
tokens = NULL;
target = NULL;
@@ -730,6 +731,7 @@ stc_monitor_load_one_file (StcMonitor *monitor,
group);
goto process_next_item;
}
+ item_type_as_string = tokens[0];
item_id = tokens[1];
if (!is_valid_item_id (item_id))
@@ -779,36 +781,25 @@ stc_monitor_load_one_file (StcMonitor *monitor,
goto process_next_item;
}
- /* Options is optional */
- options_strv = g_key_file_get_string_list (key_file, group, "Options", NULL, NULL);
+ /* Handle item specific options */
options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
- if (options_strv != NULL)
+ keys = g_key_file_get_keys (key_file, group, NULL, NULL);
+ for (m = 0; keys != NULL && keys[m] != NULL; m++)
{
- guint m;
- for (m = 0; options_strv[m] != NULL; m++)
+ gchar *value;
+
+ if (!g_str_has_prefix (keys[m], item_type_as_string))
{
- s = strstr (options_strv[m], "=");
- if (s == NULL)
- {
- stc_monitor_emit_stc_error (monitor,
- path,
- -1,
- STC_ERROR_PARSE_ERROR,
- "Element %d of Options, `%s', for item %s of type %s is malformed "
- "(no equal sign found).",
- m,
- options_strv[m],
- item_id,
- tokens[0]);
- g_strfreev (options_strv);
- goto process_next_item;
- }
- g_hash_table_insert (options,
- g_strndup (options_strv[m], s - options_strv[m]),
- g_strdup (s + 1));
+ g_free (keys[m]);
+ continue;
}
- g_strfreev (options_strv);
+
+ value = g_key_file_get_string (key_file, group, keys[m], NULL);
+ g_hash_table_insert (options,
+ keys[m], /* adopts key value */
+ value); /* adopts value */
}
+ g_free (keys);
/* Comment is optional */
comment = g_key_file_get_string (key_file, group, "Comment", NULL);
diff --git a/stc/test.c b/stc/test.c
index f68f066..f975a29 100644
--- a/stc/test.c
+++ b/stc/test.c
@@ -186,8 +186,7 @@ test_stc_semi_valid_conf (void)
SRCDIR "/testdata/semi_valid_conf/stc.conf: Error parsing item type `XYZType' in group `XYZType ValidIdentifier' (stc-error-quark, 1)\n"
SRCDIR "/testdata/semi_valid_conf/stc.conf: Invalid item identifer `with-dash' in group `Filesystem with-dash'. Only characters in [a-zA-Z0-9_] are supported. (stc-error-quark, 1)\n"
SRCDIR "/testdata/semi_valid_conf/stc.conf: Error parsing group name `Filesystem with space' (stc-error-quark, 1)\n"
- SRCDIR "/testdata/semi_valid_conf/stc.conf: Element 0 of Options, `foo', for item foo of type MDRaid is malformed (no equal sign found). (stc-error-quark, 1)\n"
- SRCDIR "/testdata/semi_valid_conf/stc.conf: MDRaid item bar has unsupported target type (UUID and Name is supported). (stc-error-quark, 0)\n"
+ SRCDIR "/testdata/semi_valid_conf/stc.conf: Raid item bar has unsupported target type (UUID and Name is supported). (stc-error-quark, 0)\n"
SRCDIR "/testdata/semi_valid_conf/stc.conf.d/91.conf: Encountered item with duplicate id `multiple_instances_same_id'. Ignoring previous items. (stc-error-quark, 2)\n"
SRCDIR "/testdata/semi_valid_conf/stc.conf: Item ItemWithUnresolved has unresolved dependency NonExisting. (stc-error-quark, 3)\n"
);
@@ -206,41 +205,41 @@ test_stc_semi_valid_conf (void)
"target `Device=/dev/sda'\n"
"comment `(none)'\n"
"type filesystem\n"
- "options Filesystem:mount_path -> `/mnt/10'\n"
+ "options FilesystemMountPath -> `/mnt/10'\n"
"dependencies (none)\n"
"\n"
"id `in_pri_50'\n"
"target `Device=/dev/sda'\n"
"comment `(none)'\n"
"type filesystem\n"
- "options Filesystem:mount_path -> `/mnt/50'\n"
+ "options FilesystemMountPath -> `/mnt/50'\n"
"dependencies (none)\n"
"\n"
"id `in_pri_90'\n"
"target `Device=/dev/sda'\n"
"comment `(none)'\n"
"type filesystem\n"
- "options Filesystem:mount_path -> `/mnt/90'\n"
+ "options FilesystemMountPath -> `/mnt/90'\n"
"dependencies (none)\n"
"\n"
"id `multiple_instances_same_id'\n"
"target `Device=/dev/multiple_instances_same_id/second'\n"
"comment `(none)'\n"
"type filesystem\n"
- "options Filesystem:mount_path -> `/mnt/m_second'\n"
+ "options FilesystemMountPath -> `/mnt/m_second'\n"
"dependencies (none)\n"
"\n"
"id `BigStorage'\n"
"target `Device=/dev/disk/md-uuid-01234:56789'\n"
"comment `BigStorage'\n"
"type filesystem\n"
- "options Filesystem:mount_path -> `/mnt/BigStorage'\n"
+ "options FilesystemMountPath -> `/mnt/BigStorage'\n"
"dependencies BigStorage_mdraid\n"
"\n"
"id `BigStorage_mdraid'\n"
"target `UUID=01234:56789'\n"
"comment `BigStorage RAID Array'\n"
- "type md-raid\n"
+ "type raid\n"
"options (none)\n"
"dependencies (none)\n"
"\n"
@@ -248,28 +247,28 @@ test_stc_semi_valid_conf (void)
"target `Device=/dev/disk/by-uuid/1234'\n"
"comment `My Secret Stuff'\n"
"type filesystem\n"
- "options Filesystem:mount_path -> `/mnt/SekritStuff'\n"
- " Filesystem:options -> `noatime,dirsync'\n"
- "dependencies SekritStuff_LUKS\n"
+ "options FilesystemMountPath -> `/mnt/SekritStuff'\n"
+ " FilesystemOptions -> `noatime,dirsync'\n"
+ "dependencies SekritStuff_Luks\n"
"\n"
- "id `SekritStuff_LUKS'\n"
+ "id `SekritStuff_Luks'\n"
"target `Device=/dev/disk/by-uuid/12345'\n"
"comment `My Secret Stuff (Encrypted)'\n"
"type luks\n"
- "options LUKS:password -> `xyz123'\n"
+ "options LuksPassphrase -> `xyz123'\n"
"dependencies (none)\n"
"\n"
"id `ItemWithUnresolved'\n"
"target `Device=/dev/sda'\n"
"comment `(none)'\n"
"type filesystem\n"
- "options Filesystem:mount_path -> `/mnt/Z'\n"
+ "options FilesystemMountPath -> `/mnt/Z'\n"
"dependencies NonExisting\n"
"\n"
"id `OtherRaid'\n"
"target `Name=homehost:array_name'\n"
"comment `Other RAID'\n"
- "type md-raid\n"
+ "type raid\n"
"options (none)\n"
"dependencies (none)\n"
"\n"
@@ -432,7 +431,7 @@ test_stc_monitoring (void)
rc = g_file_set_contents (filename,
"[Filesystem item1]\n"
"Device=/dev/sdb\n"
- "Options=Filesystem:mount_path=/item1",
+ "FilesystemMountPath=/item1",
-1,
&error);
g_assert_no_error (error);
@@ -447,11 +446,11 @@ test_stc_monitoring (void)
rc = g_file_set_contents (filename,
"[Filesystem item1]\n"
"Device=/dev/sdb\n"
- "Options=Filesystem:mount_path=/item1"
+ "FilesystemMountPath=/item1"
"\n"
"[Filesystem item2]\n"
"Device=/dev/sdc\n"
- "Options=Filesystem:mount_path=/item2",
+ "FilesystemMountPath=/item2",
-1,
&error);
g_assert_no_error (error);
@@ -466,7 +465,7 @@ test_stc_monitoring (void)
rc = g_file_set_contents (filename,
"[Filesystem item2]\n"
"Device=/dev/sdc\n"
- "Options=Filesystem:mount_path=/item2",
+ "FilesystemMountPath=/item2",
-1,
&error);
g_assert_no_error (error);
@@ -481,7 +480,7 @@ test_stc_monitoring (void)
rc = g_file_set_contents (filename,
"[Filesystem item2]\n"
"Device=/dev/sda\n"
- "Options=Filesystem:mount_path=/item2",
+ "FilesystemMountPath=/item2",
-1,
&error);
g_assert_no_error (error);
@@ -496,7 +495,7 @@ test_stc_monitoring (void)
rc = g_file_set_contents (filename,
"[Filesystem item3]\n"
"Device=/dev/sda\n"
- "Options=Filesystem:mount_path=/item3",
+ "FilesystemMountPath=/item3",
-1,
&error);
g_assert_no_error (error);
diff --git a/stc/testdata/semi_valid_conf/stc.conf b/stc/testdata/semi_valid_conf/stc.conf
index 5f53e7b..010a8c0 100644
--- a/stc/testdata/semi_valid_conf/stc.conf
+++ b/stc/testdata/semi_valid_conf/stc.conf
@@ -4,31 +4,32 @@
[Filesystem BigStorage]
Comment=BigStorage
Device=/dev/disk/md-uuid-01234:56789
-Options=Filesystem:mount_path=/mnt/BigStorage
+FilesystemMountPath=/mnt/BigStorage
Depends=BigStorage_mdraid
Auto=yes
-[MDRaid BigStorage_mdraid]
+[Raid BigStorage_mdraid]
Comment=BigStorage RAID Array
UUID=01234:56789
[Filesystem SekritStuff]
Comment=My Secret Stuff
Device=/dev/disk/by-uuid/1234
-Options=Filesystem:mount_path=/mnt/SekritStuff;Filesystem:options=noatime,dirsync
-Depends=SekritStuff_LUKS
+FilesystemMountPath=/mnt/SekritStuff
+FilesystemOptions=noatime,dirsync
+Depends=SekritStuff_Luks
-[LUKS SekritStuff_LUKS]
+[Luks SekritStuff_Luks]
Comment=My Secret Stuff (Encrypted)
Device=/dev/disk/by-uuid/12345
-Options=LUKS:password=xyz123
+LuksPassphrase=xyz123
[Filesystem ItemWithUnresolved]
Device=/dev/sda
-Options=Filesystem:mount_path=/mnt/Z
+FilesystemMountPath=/mnt/Z
Depends=NonExisting
-[MDRaid OtherRaid]
+[Raid OtherRaid]
Comment=Other RAID
Name=homehost:array_name
@@ -47,12 +48,7 @@ Name=homehost:array_name
# another invalid identifier
[Filesystem with space]
-# invalid options (no equal sign)
-[MDRaid foo]
-UUID=01234:56789
-Options=foo
-
-# can't use Device for MDRaid (it doesn't exist yet)
-[MDRaid bar]
+# can't use Device for Raid (it doesn't exist yet)
+[Raid bar]
Comment=Other RAID
Device=/dev/md0
diff --git a/stc/testdata/semi_valid_conf/stc.conf.d/10.conf b/stc/testdata/semi_valid_conf/stc.conf.d/10.conf
index 33dd844..d88d791 100644
--- a/stc/testdata/semi_valid_conf/stc.conf.d/10.conf
+++ b/stc/testdata/semi_valid_conf/stc.conf.d/10.conf
@@ -1,4 +1,4 @@
[Filesystem in_pri_10]
Device=/dev/sda
-Options=Filesystem:mount_path=/mnt/10
+FilesystemMountPath=/mnt/10
diff --git a/stc/testdata/semi_valid_conf/stc.conf.d/50.conf b/stc/testdata/semi_valid_conf/stc.conf.d/50.conf
index f973184..b2ac281 100644
--- a/stc/testdata/semi_valid_conf/stc.conf.d/50.conf
+++ b/stc/testdata/semi_valid_conf/stc.conf.d/50.conf
@@ -1,4 +1,4 @@
[Filesystem in_pri_50]
Device=/dev/sda
-Options=Filesystem:mount_path=/mnt/50
+FilesystemMountPath=/mnt/50
diff --git a/stc/testdata/semi_valid_conf/stc.conf.d/50.conf.wrong-extension b/stc/testdata/semi_valid_conf/stc.conf.d/50.conf.wrong-extension
index a0f8a5d..dc58712 100644
--- a/stc/testdata/semi_valid_conf/stc.conf.d/50.conf.wrong-extension
+++ b/stc/testdata/semi_valid_conf/stc.conf.d/50.conf.wrong-extension
@@ -3,4 +3,4 @@
# it will cause a duplicate-error since in_pri_50 already exists
[Filesystem in_pri_50]
Device=/dev/sda
-Options=Filesystem:mount_path=/mnt/50;
+FilesystemMountPath=/mnt/50
diff --git a/stc/testdata/semi_valid_conf/stc.conf.d/90.conf b/stc/testdata/semi_valid_conf/stc.conf.d/90.conf
index a2baa63..ddf3c07 100644
--- a/stc/testdata/semi_valid_conf/stc.conf.d/90.conf
+++ b/stc/testdata/semi_valid_conf/stc.conf.d/90.conf
@@ -1,9 +1,9 @@
[Filesystem in_pri_90]
Device=/dev/sda
-Options=Filesystem:mount_path=/mnt/90
+FilesystemMountPath=/mnt/90
# this is for testing that we replace the previous entry (see also 91.conf)
[Filesystem multiple_instances_same_id]
Device=/dev/multiple_instances_same_id/first
-Options=Filesystem:mount_path=/mnt/m_first
+FilesystemMountPath=/mnt/m_first
diff --git a/stc/testdata/semi_valid_conf/stc.conf.d/91.conf b/stc/testdata/semi_valid_conf/stc.conf.d/91.conf
index 0532a4b..8fbb1b9 100644
--- a/stc/testdata/semi_valid_conf/stc.conf.d/91.conf
+++ b/stc/testdata/semi_valid_conf/stc.conf.d/91.conf
@@ -1,4 +1,4 @@
# this is for testing that we replace the previous entry (see also 90.conf)
[Filesystem multiple_instances_same_id]
Device=/dev/multiple_instances_same_id/second
-Options=Filesystem:mount_path=/mnt/m_second
+FilesystemMountPath=/mnt/m_second