Add i386-pc-pxe image target.

* util/grub-mkimage.c (image_target_desc): New enum value
	IMAGE_I386_PC_PXE.
	(image_targets): New target i386-pc-pxe.
	(generate_image): Handle i386-pc-pxe image.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-09-02 16:07:52 +02:00
parent 9a09392057
commit 529cc99acf
2 changed files with 44 additions and 1 deletions

View file

@ -1,3 +1,12 @@
2010-09-02 Vladimir Serbinenko <phcoder@gmail.com>
Add i386-pc-pxe image target.
* util/grub-mkimage.c (image_target_desc): New enum value
IMAGE_I386_PC_PXE.
(image_targets): New target i386-pc-pxe.
(generate_image): Handle i386-pc-pxe image.
2010-09-02 Vladimir Serbinenko <phcoder@gmail.com>
Fix grub_pxe_scan.

View file

@ -54,7 +54,8 @@ struct image_target_desc
enum {
IMAGE_I386_PC, IMAGE_EFI, IMAGE_COREBOOT,
IMAGE_SPARC64_AOUT, IMAGE_SPARC64_RAW, IMAGE_I386_IEEE1275,
IMAGE_YEELOONG_ELF, IMAGE_QEMU, IMAGE_PPC, IMAGE_YEELOONG_FLASH
IMAGE_YEELOONG_ELF, IMAGE_QEMU, IMAGE_PPC, IMAGE_YEELOONG_FLASH,
IMAGE_I386_PC_PXE
} id;
enum
{
@ -140,6 +141,24 @@ struct image_target_desc image_targets[] =
.install_bsd_part = GRUB_KERNEL_I386_PC_INSTALL_BSD_PART,
.link_addr = GRUB_KERNEL_I386_PC_LINK_ADDR
},
{
.name = "i386-pc-pxe",
.voidp_sizeof = 4,
.bigendian = 0,
.id = IMAGE_I386_PC_PXE,
.flags = PLATFORM_FLAGS_LZMA,
.prefix = GRUB_KERNEL_I386_PC_PREFIX,
.data_end = GRUB_KERNEL_I386_PC_DATA_END,
.raw_size = GRUB_KERNEL_I386_PC_RAW_SIZE,
.total_module_size = GRUB_KERNEL_I386_PC_TOTAL_MODULE_SIZE,
.kernel_image_size = GRUB_KERNEL_I386_PC_KERNEL_IMAGE_SIZE,
.compressed_size = GRUB_KERNEL_I386_PC_COMPRESSED_SIZE,
.section_align = 1,
.vaddr_offset = 0,
.install_dos_part = GRUB_KERNEL_I386_PC_INSTALL_DOS_PART,
.install_bsd_part = GRUB_KERNEL_I386_PC_INSTALL_BSD_PART,
.link_addr = GRUB_KERNEL_I386_PC_LINK_ADDR
},
{
.name = "i386-efi",
.voidp_sizeof = 4,
@ -664,6 +683,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
switch (image_target->id)
{
case IMAGE_I386_PC:
case IMAGE_I386_PC_PXE:
{
unsigned num;
char *boot_path, *boot_img;
@ -678,6 +698,20 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
if (num > 0xffff)
grub_util_error (_("the core image is too big"));
if (image_target->id == IMAGE_I386_PC_PXE)
{
char *pxeboot_path, *pxeboot_img;
size_t pxeboot_size;
pxeboot_path = grub_util_get_path (dir, "pxeboot.img");
pxeboot_size = grub_util_get_image_size (pxeboot_path);
pxeboot_img = grub_util_read_image (pxeboot_path);
grub_util_write_image (pxeboot_img, pxeboot_size, out);
free (pxeboot_img);
free (pxeboot_path);
}
boot_path = grub_util_get_path (dir, "diskboot.img");
boot_size = grub_util_get_image_size (boot_path);
if (boot_size != GRUB_DISK_SECTOR_SIZE)