summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2008-07-08 02:30:11 +0200
committerMichael Brown2008-07-08 02:30:11 +0200
commitdbe9269f3a04267b27bd5528715e79bacc356703 (patch)
tree228880f641fa916eb808105c8bd0c70df8291c29
parent[dhcp] Allow DHCP non-option settings to be cleared (diff)
downloadipxe-dbe9269f3a04267b27bd5528715e79bacc356703.tar.gz
ipxe-dbe9269f3a04267b27bd5528715e79bacc356703.tar.xz
ipxe-dbe9269f3a04267b27bd5528715e79bacc356703.zip
[bzimage] Kill off the initrd image type
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".
-rw-r--r--src/arch/i386/image/bzimage.c5
-rw-r--r--src/hci/commands/image_cmd.c26
-rw-r--r--src/image/initrd.c37
-rw-r--r--src/include/gpxe/initrd.h14
4 files changed, 6 insertions, 76 deletions
diff --git a/src/arch/i386/image/bzimage.c b/src/arch/i386/image/bzimage.c
index 9372f55c5..d9c054532 100644
--- a/src/arch/i386/image/bzimage.c
+++ b/src/arch/i386/image/bzimage.c
@@ -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>
@@ -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 */
diff --git a/src/hci/commands/image_cmd.c b/src/hci/commands/image_cmd.c
index b651078b6..05e7ddeea 100644
--- a/src/hci/commands/image_cmd.c
+++ b/src/hci/commands/image_cmd.c
@@ -24,7 +24,6 @@
#include <getopt.h>
#include <gpxe/image.h>
#include <gpxe/command.h>
-#include <gpxe/initrd.h>
#include <usr/imgmgmt.h>
/** @file
@@ -223,23 +222,6 @@ static int kernel_exec ( int argc, char **argv ) {
}
/**
- * 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
*
* @v argv Argument list
@@ -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",
diff --git a/src/image/initrd.c b/src/image/initrd.c
deleted file mode 100644
index f03564a81..000000000
--- a/src/image/initrd.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-/**
- * @file
- *
- * Linux initrd image format
- *
- * This file does nothing except provide a way to mark images as being
- * initrds. The actual processing is done in the Linux kernel image
- * code; this file exists so that we can include the "initrd" command
- * without necessarily dragging in the Linux image format.
- *
- */
-
-#include <gpxe/image.h>
-#include <gpxe/initrd.h>
-
-/** Linux initrd image type */
-struct image_type initrd_image_type __image_type ( PROBE_NORMAL ) = {
- .name = "initrd",
-};
diff --git a/src/include/gpxe/initrd.h b/src/include/gpxe/initrd.h
deleted file mode 100644
index 1871bf781..000000000
--- a/src/include/gpxe/initrd.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _GPXE_INITRD_H
-#define _GPXE_INITRD_H
-
-/**
- * @file
- *
- * Linux initrd image format
- *
- */
-
-#include <gpxe/image.h>
-extern struct image_type initrd_image_type __image_type ( PROBE_NORMAL );
-
-#endif /* _GPXE_INITRD_H */