summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/interface/syslinux/comboot_call.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/i386/interface/syslinux/comboot_call.c')
-rw-r--r--src/arch/i386/interface/syslinux/comboot_call.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/arch/i386/interface/syslinux/comboot_call.c b/src/arch/i386/interface/syslinux/comboot_call.c
index 818cae840..7ee5f61b4 100644
--- a/src/arch/i386/interface/syslinux/comboot_call.c
+++ b/src/arch/i386/interface/syslinux/comboot_call.c
@@ -166,6 +166,8 @@ void comboot_force_text_mode ( void ) {
* Fetch kernel and optional initrd
*/
static int comboot_fetch_kernel ( char *kernel_file, char *cmdline ) {
+ struct image *kernel;
+ struct image *initrd;
char *initrd_file;
int rc;
@@ -184,8 +186,7 @@ static int comboot_fetch_kernel ( char *kernel_file, char *cmdline ) {
DBG ( "COMBOOT: fetching initrd '%s'\n", initrd_file );
/* Fetch initrd */
- if ( ( rc = imgdownload_string ( initrd_file, NULL, NULL,
- NULL ) ) != 0 ) {
+ if ( ( rc = imgdownload_string ( initrd_file, &initrd ) ) != 0){
DBG ( "COMBOOT: could not fetch initrd: %s\n",
strerror ( rc ) );
return rc;
@@ -198,14 +199,20 @@ static int comboot_fetch_kernel ( char *kernel_file, char *cmdline ) {
DBG ( "COMBOOT: fetching kernel '%s'\n", kernel_file );
- /* Allocate and fetch kernel */
- if ( ( rc = imgdownload_string ( kernel_file, NULL, cmdline,
- image_replace ) ) != 0 ) {
+ /* Fetch kernel */
+ if ( ( rc = imgdownload_string ( kernel_file, &kernel ) ) != 0 ) {
DBG ( "COMBOOT: could not fetch kernel: %s\n",
strerror ( rc ) );
return rc;
}
+ /* Replace comboot image with kernel */
+ if ( ( rc = image_replace ( kernel ) ) != 0 ) {
+ DBG ( "COMBOOT: could not replace with kernel: %s\n",
+ strerror ( rc ) );
+ return rc;
+ }
+
return 0;
}