Add --firmwarepath to configure

Add a firmware path config option to configure.  Multiple directories
are accepted, with the usual colon as separator.  Default value is
${prefix}/share/qemu-firmware.  The path is searched in addition to the
current search path (typically ${prefix}/share/qemu).

This prepares qemu for the planned split of the prebuilt firmware blobs
into a separate project.

Distributions can also use this to get rid of the firmware symlink farm
and add -- for example -- /usr/share/seabios to the firmware path
instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20170914114236.25343-3-kraxel@redhat.com
This commit is contained in:
Gerd Hoffmann 2017-09-14 13:42:36 +02:00
parent 2a1cce9058
commit 3d5eecab4a
3 changed files with 16 additions and 4 deletions

12
vl.c
View file

@ -3125,6 +3125,7 @@ int main(int argc, char **argv, char **envp)
Error *main_loop_err = NULL;
Error *err = NULL;
bool list_data_dirs = false;
char **dirs;
typedef struct BlockdevOptions_queue {
BlockdevOptions *bdo;
Location loc;
@ -4309,11 +4310,16 @@ int main(int argc, char **argv, char **envp)
qemu_set_log(0);
}
/* If no data_dir is specified then try to find it relative to the
executable path. */
/* add configured firmware directories */
dirs = g_strsplit(CONFIG_QEMU_FIRMWAREPATH, G_SEARCHPATH_SEPARATOR_S, 0);
for (i = 0; dirs[i] != NULL; i++) {
qemu_add_data_dir(dirs[i]);
}
/* try to find datadir relative to the executable path */
qemu_add_data_dir(os_find_datadir());
/* If all else fails use the install path specified when building. */
/* add the datadir specified when building */
qemu_add_data_dir(CONFIG_QEMU_DATADIR);
/* -L help lists the data directories and exits. */