core: change mount options settings so that last defined wins

Currently mount options are handled in such a way that the first
definition for a given partition wins, and documented as such.
Change them so that they behave like other options, and the
last specified wins.
Applies to RootImageOptions=, MountImages= and ExtensionImages=.
Switch from a linked list to an array indexed by the partition
specifier to store them.
This commit is contained in:
Luca Boccassi
2026-01-06 17:59:10 +01:00
parent 9573ad4e76
commit 9de41f677c
14 changed files with 311 additions and 378 deletions
+1 -1
View File
@@ -183,7 +183,7 @@ typedef struct ExecContext {
struct rlimit *rlimit[_RLIMIT_MAX];
char *working_directory, *root_directory, *root_image, *root_verity, *root_hash_path, *root_hash_sig_path;
struct iovec root_hash, root_hash_sig;
LIST_HEAD(MountOptions, root_image_options);
MountOptions *root_image_options;
bool root_ephemeral;
bool working_directory_missing_ok:1;
bool working_directory_home:1;