Merge mainline into net

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-09-02 17:18:21 +02:00
commit a9deb976dd
7 changed files with 194 additions and 18 deletions

View file

@ -1,3 +1,35 @@
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.
* grub-core/fs/i386/pc/pxe.c (grub_pxe_pxenv): Put correct type bangpxe.
(grub_pxe_scan): Fix types and pxe_rm_entry computation.
All users updated.
* include/grub/i386/pc/pxe.h (grub_pxe_bangpxe): New struct.
(grub_pxe_pxenv): Correct type.
2010-09-01 Colin Watson <cjwatson@ubuntu.com>
* NEWS: Document most of the important changes since 1.98.
2010-09-01 Colin Watson <cjwatson@ubuntu.com>
* util/grub-mkrescue.in (usage): Tidy up usage output (and hence
generated manual page) a little.
2010-09-01 Colin Watson <cjwatson@ubuntu.com>
* docs/grub.texi: Add myself as an author.
2010-09-01 Vladimir Serbinenko <phcoder@gmail.com>
* Makefile.util.def (libgrub.a): Add missing sunpc.

89
NEWS
View file

@ -1,9 +1,98 @@
New in 1.99:
* New relocator. Allows for more kernel support and more
straightforward loader writing.
* Handle USB pendrives exposed as floppies.
* New Automake-based build system.
* Add `sendkey' command (i386-pc only).
* ZFS support in `grub-install' and `grub-mkconfig'. Note: complete
functionality requires external ZFS implementation (available from
grub-extras).
* Support 1.x versions of mdadm metadata.
* Fix corruption when reading Reiserfs directory entries.
* Bidirectional text and diacritics support.
* Skip LVM snapshots.
* MIPS Yeeloong firmware port.
* Change grub-mkdevicemap to emit /dev/disk/by-id/ names where possible
on GNU/Linux.
* Add `grub-mkconfig' support for Xen with Linux.
* Add `grub-mkconfig' support for initrd images on Fedora 13.
* Support >3GiB and <16MiB RAM in i386-qemu.
* Add support for Cirrus 5446 and Bochs video cards.
* Load more appropriate video drivers automatically in `grub-mkconfig'.
* USB improvements, including hotplugging/hotunplugging, hub support,
and USB serial support.
* AMD Geode CS5536 support.
* Extensive updates to the Texinfo documentation.
* Add `grub-probe' support for the btrfs filesystem, permitting / to
reside on btrfs as long as /boot is on a filesystem natively supported
by GRUB.
* Handle symbolic links under /dev/mapper on GNU/Linux.
* Handle installation across multiple partition table types.
* Add `cmostest' command (i386/x86_64 only).
* Add support for DM-RAID disk devices on GNU/Linux.
* Remove `grub-mkisofs'. `grub-mkrescue' now uses GNU xorriso to build
CD images.
* `grub-mkrescue' support for EFI, coreboot, and QEMU platforms.
* Unify `grub-mkimage' source code across platforms.
* Fix VGA (as opposed to VBE) video driver, formerly a terminal driver.
* Add menu hotkey support.
* Add support for the nilfs2 filesystem.
* `grub-probe' and `grub-mkconfig' support for NetBSD.
* Support setting a background image in `grub-mkconfig'.
* Support multiple terminals in `grub-mkconfig'.
* Regexp support.
* MIPS multiboot2 support.
* Multiboot2 tag support.
* sunpc partition table support.
* Add a number of new language features to GRUB script: `for', `while',
`until', `elif', function parameters, `break', `continue', and
`shift'.
* Support nested partition tables. GRUB now prefers to name partitions
in the form `(hd0,msdos1,bsd1)' rather than `(hd0,1,a)'.
* Speed up consecutive hostdisk operations on the same device.
* Compile parts of `grub-emu' as modules.
New in 1.98 - 2010-03-06:
* Multiboot on EFI support.

View file

@ -46,6 +46,7 @@ Invariant Sections.
@subtitle The GRand Unified Bootloader, version @value{VERSION}, @value{UPDATED}.
@author Gordon Matzigkeit
@author Yoshinori K. Okuji
@author Colin Watson
@c The following two commands start the copyright page.
@page
@vskip 0pt plus 1filll

View file

@ -34,7 +34,7 @@
#define SEGOFS(x) ((SEGMENT(x) << 16) + OFFSET(x))
#define LINEAR(x) (void *) (((x >> 16) << 4) + (x & 0xFFFF))
struct grub_pxenv *grub_pxe_pxenv;
struct grub_pxe_bangpxe *grub_pxe_pxenv;
static grub_uint32_t grub_pxe_your_ip;
static grub_uint32_t grub_pxe_default_server_ip;
static grub_uint32_t grub_pxe_default_gateway_ip;
@ -53,41 +53,47 @@ struct grub_pxe_data
static grub_uint32_t pxe_rm_entry = 0;
static struct grub_pxenv *
static struct grub_pxe_bangpxe *
grub_pxe_scan (void)
{
struct grub_bios_int_registers regs;
struct grub_pxenv *ret;
void *pxe;
struct grub_pxenv *pxenv;
struct grub_pxe_bangpxe *bangpxe;
regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
regs.ebx = 0;
regs.ecx = 0;
regs.eax = 0x5650;
regs.es = 0;
grub_bios_interrupt (0x1a, &regs);
if ((regs.eax & 0xffff) != 0x564e)
return NULL;
ret = (struct grub_pxenv *) ((regs.es << 4) + (regs.ebx & 0xffff));
if (grub_memcmp (ret->signature, GRUB_PXE_SIGNATURE, sizeof (ret->signature))
pxenv = (struct grub_pxenv *) ((regs.es << 4) + (regs.ebx & 0xffff));
if (grub_memcmp (pxenv->signature, GRUB_PXE_SIGNATURE,
sizeof (pxenv->signature))
!= 0)
return NULL;
if (ret->version < 0x201)
if (pxenv->version < 0x201)
return NULL;
pxe = (void *) ((((ret->pxe_ptr & 0xffff0000) >> 16) << 4)
+ (ret->pxe_ptr & 0xffff));
if (!pxe)
bangpxe = (void *) ((((pxenv->pxe_ptr & 0xffff0000) >> 16) << 4)
+ (pxenv->pxe_ptr & 0xffff));
if (!bangpxe)
return NULL;
/* !PXE */
if (*(grub_uint32_t *) pxe != 0x45585021)
if (grub_memcmp (bangpxe->signature, GRUB_PXE_BANGPXE_SIGNATURE,
sizeof (bangpxe->signature)) != 0)
return NULL;
pxe_rm_entry = ret->rm_entry;
return ret;
pxe_rm_entry = bangpxe->rm_entry;
return bangpxe;
}
static grub_err_t
@ -406,7 +412,7 @@ parse_dhcp_vendor (void *vend, int limit)
static void
grub_pxe_detect (void)
{
struct grub_pxenv *pxenv;
struct grub_pxe_bangpxe *pxenv;
struct grub_pxenv_get_cached_info ci;
struct grub_pxenv_boot_player *bp;

View file

@ -192,6 +192,19 @@ struct grub_pxenv
grub_uint32_t pxe_ptr; /* SEG:OFF to !PXE struct. */
} __attribute__ ((packed));
struct grub_pxe_bangpxe
{
grub_uint8_t signature[4];
#define GRUB_PXE_BANGPXE_SIGNATURE "!PXE"
grub_uint8_t length;
grub_uint8_t chksum;
grub_uint8_t rev;
grub_uint8_t reserved;
grub_uint32_t undiromid;
grub_uint32_t baseromid;
grub_uint32_t rm_entry;
} __attribute__ ((packed));
struct grub_pxenv_get_cached_info
{
grub_uint16_t status;
@ -306,7 +319,7 @@ struct grub_pxenv_unload_stack
int EXPORT_FUNC(grub_pxe_call) (int func, void * data, grub_uint32_t pxe_rm_entry);
extern struct grub_pxenv *grub_pxe_pxenv;
extern struct grub_pxe_bangpxe *grub_pxe_pxenv;
void grub_pxe_unload (void);

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)

View file

@ -62,7 +62,8 @@ Make GRUB rescue image.
$self generates a bootable rescue image with specified source files, source
directories, or mkisofs options listed by: xorriso -as mkisofs -help
Option -- switches to native xorriso command mode. or directories.
Option -- switches to native xorriso command mode.
Report bugs to <bug-grub@gnu.org>.
Mail xorriso support requests to <bug-xorriso@gnu.org>.