Author: mcayland Date: Fri May 23 14:24:32 2014 New Revision: 1303 URL: http://tracker.coreboot.org/trac/openbios/changeset/1303
Log: arch/ppc/qemu: do not override boot-device if already set
Only set the boot-device env variable if it is not yet set, do not override values set e.g. by -prom-env option of QEMU.
Signed-off-by: BALATON Zoltan balaton@eik.bme.hu Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/init.c Fri May 23 14:01:51 2014 (r1302) +++ trunk/openbios-devel/arch/ppc/qemu/init.c Fri May 23 14:24:32 2014 (r1303) @@ -659,7 +659,7 @@ char buf[64], qemu_uuid[16]; const char *stdin_path, *stdout_path, *boot_path; uint32_t temp = 0; - + char *boot_device; ofmem_t *ofmem = ofmem_arch_get_private();
openbios_init(); @@ -867,23 +867,27 @@ push_str("/options"); fword("find-device");
- uint16_t boot_device = fw_cfg_read_i16(FW_CFG_BOOT_DEVICE); - switch (boot_device) { - case 'c': - boot_path = "hd"; - break; - default: - case 'd': - boot_path = "cd"; - break; - } + /* Setup default boot devices (not overriding user settings) */ + fword("boot-device"); + boot_device = pop_fstr_copy(); + if (boot_device && strcmp(boot_device, "disk") == 0) { + switch (fw_cfg_read_i16(FW_CFG_BOOT_DEVICE)) { + case 'c': + boot_path = "hd"; + break; + default: + case 'd': + boot_path = "cd"; + break; + }
- /* Setup default boot devices */ - snprintf(buf, sizeof(buf), "%s:,\\:tbxi %s:,\ppc\bootinfo.txt %s:,%%BOOT", boot_path, boot_path, boot_path); - push_str(buf); - fword("encode-string"); - push_str("boot-device"); - fword("property"); + snprintf(buf, sizeof(buf), "%s:,\\:tbxi %s:,\ppc\bootinfo.txt %s:,%%BOOT", boot_path, boot_path, boot_path); + push_str(buf); + fword("encode-string"); + push_str("boot-device"); + fword("property"); + } + free(boot_device);
/* Set up other properties */