From: Kevin O'Connor <kevin@koconnor.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCHv3] Load "bootsplash.jpg" if present
Date: Mon, 2 Aug 2010 12:11:57 -0400 [thread overview]
Message-ID: <20100802161157.GA11743@morn.localdomain> (raw)
Load the "bootsplash.jpg" file into fw_cfg if it is found in the roms
directory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
---
Changes v2->v3:
Fix coding style (missing braces).
Changes v1->v2:
Add signed-off-by line.
---
hw/fw_cfg.c | 9 +++++++--
hw/pc.c | 8 ++++++++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
index 72866ae..5a2c0aa 100644
--- a/hw/fw_cfg.c
+++ b/hw/fw_cfg.c
@@ -304,8 +304,13 @@ int fw_cfg_add_file(FWCfgState *s, const char *dir, const char *filename,
basename = filename;
}
- snprintf(s->files->f[index].name, sizeof(s->files->f[index].name),
- "%s/%s", dir, basename);
+ if (dir && dir[0]) {
+ snprintf(s->files->f[index].name, sizeof(s->files->f[index].name),
+ "%s/%s", dir, basename);
+ } else {
+ strncpy(s->files->f[index].name, basename,
+ sizeof(s->files->f[index].name));
+ }
for (i = 0; i < index; i++) {
if (strcmp(s->files->f[index].name, s->files->f[i].name) == 0) {
FW_CFG_DPRINTF("%s: skip duplicate: %s\n", __FUNCTION__,
diff --git a/hw/pc.c b/hw/pc.c
index 58dea57..6893799 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -54,6 +54,7 @@
#endif
#define BIOS_FILENAME "bios.bin"
+#define BOOTSPLASH_FILENAME "bootsplash.jpg"
#define PC_MAX_BIOS_SIZE (4 * 1024 * 1024)
@@ -963,6 +964,13 @@ void pc_memory_init(ram_addr_t ram_size,
fw_cfg = bochs_bios_init();
rom_set_fw(fw_cfg);
+ /* Optional bootsplash file */
+ filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BOOTSPLASH_FILENAME);
+ if (filename) {
+ qemu_free(filename);
+ rom_add_file(BOOTSPLASH_FILENAME, "", 0);
+ }
+
if (linux_boot) {
load_linux(fw_cfg, kernel_filename, initrd_filename, kernel_cmdline, below_4g_mem_size);
}
--
1.7.2
next reply other threads:[~2010-08-02 16:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-02 16:11 Kevin O'Connor [this message]
2010-08-02 16:33 ` [Qemu-devel] [PATCHv3] Load "bootsplash.jpg" if present Anthony Liguori
2010-08-02 16:47 ` Kevin O'Connor
2010-08-02 16:52 ` Anthony Liguori
2010-08-02 18:10 ` Kevin O'Connor
2010-08-02 18:54 ` Anthony Liguori
2010-08-03 9:52 ` Richard W.M. Jones
2010-08-03 12:51 ` Anthony Liguori
2010-08-03 12:54 ` Richard W.M. Jones
2010-08-03 13:04 ` Richard W.M. Jones
2010-08-03 13:33 ` Anthony Liguori
2010-08-03 14:38 ` [Qemu-devel] " Paolo Bonzini
2010-08-04 1:07 ` Kevin O'Connor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100802161157.GA11743@morn.localdomain \
--to=kevin@koconnor.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).