From 3d5eecab4a5a00df897253dda5792411a1872732 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 14 Sep 2017 13:42:36 +0200 Subject: 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 Message-id: 20170914114236.25343-3-kraxel@redhat.com --- vl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 19633423aa..3fed457921 100644 --- a/vl.c +++ b/vl.c @@ -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. */ -- cgit v1.2.1