Skip to content

Commit

Permalink
[bzimage] Kill off the initrd image type
Browse files Browse the repository at this point in the history
We can just treat all non-kernel images as initrds, which matches our
behaviour for multiboot kernels.  This allows us to eliminate initrd as
an image type, and treat the "initrd" command as just another synonym for
"imgfetch".
  • Loading branch information
Michael Brown committed Jul 8, 2008
1 parent 2df682c commit dbe9269
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 76 deletions.
5 changes: 2 additions & 3 deletions src/arch/i386/image/bzimage.c
Expand Up @@ -34,7 +34,6 @@
#include <gpxe/image.h>
#include <gpxe/segment.h>
#include <gpxe/init.h>
#include <gpxe/initrd.h>
#include <gpxe/cpio.h>
#include <gpxe/features.h>

Expand Down Expand Up @@ -188,8 +187,8 @@ static size_t bzimage_load_initrd ( struct image *image,
struct cpio_header cpio;
size_t offset = 0;

/* Ignore images which aren't initrds */
if ( initrd->type != &initrd_image_type )
/* Do not include kernel image itself as an initrd */
if ( initrd == image )
return 0;

/* Create cpio header before non-prebuilt images */
Expand Down
26 changes: 4 additions & 22 deletions src/hci/commands/image_cmd.c
Expand Up @@ -24,7 +24,6 @@
#include <getopt.h>
#include <gpxe/image.h>
#include <gpxe/command.h>
#include <gpxe/initrd.h>
#include <usr/imgmgmt.h>

/** @file
Expand Down Expand Up @@ -222,23 +221,6 @@ static int kernel_exec ( int argc, char **argv ) {
return 0;
}

/**
* The "initrd" command
*
* @v argc Argument count
* @v argv Argument list
* @ret rc Exit code
*/
static int initrd_exec ( int argc, char **argv ) {
int rc;

if ( ( rc = imgfetch_core_exec ( &initrd_image_type, IMG_FETCH,
argc, argv ) ) != 0 )
return rc;

return 0;
}

/**
* "imgload" command syntax message
*
Expand Down Expand Up @@ -557,12 +539,12 @@ struct command image_commands[] __command = {
.exec = imgfetch_exec, /* synonym for "imgfetch" */
},
{
.name = "kernel",
.exec = kernel_exec,
.name = "initrd",
.exec = imgfetch_exec, /* synonym for "imgfetch" */
},
{
.name = "initrd",
.exec = initrd_exec,
.name = "kernel",
.exec = kernel_exec,
},
{
.name = "imgload",
Expand Down
37 changes: 0 additions & 37 deletions src/image/initrd.c

This file was deleted.

14 changes: 0 additions & 14 deletions src/include/gpxe/initrd.h

This file was deleted.

0 comments on commit dbe9269

Please sign in to comment.