From patchwork Sun Aug 1 19:44:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin O'Connor X-Patchwork-Id: 60492 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1B814B70D3 for ; Mon, 2 Aug 2010 05:45:57 +1000 (EST) Received: from localhost ([127.0.0.1]:51694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfeTp-00068F-WB for incoming@patchwork.ozlabs.org; Sun, 01 Aug 2010 15:45:54 -0400 Received: from [140.186.70.92] (port=32890 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfeSC-0005a6-6S for qemu-devel@nongnu.org; Sun, 01 Aug 2010 15:44:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OfeSA-0002Bg-W5 for qemu-devel@nongnu.org; Sun, 01 Aug 2010 15:44:12 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:63732) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfeSA-0002Bb-T4 for qemu-devel@nongnu.org; Sun, 01 Aug 2010 15:44:10 -0400 Received: by qyk35 with SMTP id 35so4854164qyk.4 for ; Sun, 01 Aug 2010 12:44:10 -0700 (PDT) Received: by 10.220.157.140 with SMTP id b12mr3489595vcx.16.1280691850038; Sun, 01 Aug 2010 12:44:10 -0700 (PDT) Received: from localhost (207-172-165-101.c3-0.avec-ubr1.nyr-avec.ny.cable.rcn.com [207.172.165.101]) by mx.google.com with ESMTPS id z2sm2364553vcj.42.2010.08.01.12.44.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 01 Aug 2010 12:44:09 -0700 (PDT) Date: Sun, 1 Aug 2010 15:44:07 -0400 From: Kevin O'Connor To: seabios@seabios.org, qemu-devel@nongnu.org Message-ID: <20100801194407.GB25457@morn.localdomain> References: <20100801194234.GA25457@morn.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100801194234.GA25457@morn.localdomain> User-Agent: Mutt/1.5.20 (2009-12-10) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Subject: [Qemu-devel] [PATCH][QEMU] Load "bootsplash.jpg" if present X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Load the "bootsplash.jpg" file into fw_cfg if it is found in the roms directory. --- a/hw/fw_cfg.c +++ b/hw/fw_cfg.c @@ -304,8 +304,12 @@ 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); }