* include/grub/i386/linux.h (linux_kernel_header): Fix init_size type.

* grub-core/loader/i386/linux.c (grub_cmd_linux): Differentiate between
	prot_size and prot_file_size.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-03-04 12:13:05 +01:00
parent 49de079bbe
commit 7c8d0ce7f4
3 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2012-03-03 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/i386/linux.h (linux_kernel_header): Fix init_size type.
* grub-core/loader/i386/linux.c (grub_cmd_linux): Differentiate between
prot_size and prot_file_size.
2012-03-03 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/diskfilter.c (is_lv_readable): New argument "easily".

View file

@ -658,7 +658,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
struct linux_kernel_header lh;
struct linux_kernel_params *params;
grub_uint8_t setup_sects;
grub_size_t real_size, prot_size;
grub_size_t real_size, prot_size, prot_file_size;
grub_ssize_t len;
int i;
grub_size_t align, min_align;
@ -735,7 +735,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS;
real_size = setup_sects << GRUB_DISK_SECTOR_BITS;
prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE;
prot_file_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE;
if (grub_le_to_cpu16 (lh.version) >= 0x205
&& lh.kernel_alignment != 0
@ -761,7 +761,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
else
{
min_align = 0;
prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE;
prot_size = prot_file_size;
preffered_address = grub_le_to_cpu32 (lh.code32_start);
}
@ -971,7 +971,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
maximal_cmdline_size
- (sizeof (LINUX_IMAGE) - 1));
len = prot_size;
len = prot_file_size;
if (grub_file_read (file, prot_mode_mem, len) != len && !grub_errno)
grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
argv[0]);

View file

@ -140,7 +140,7 @@ struct linux_kernel_header
grub_uint32_t payload_length;
grub_uint64_t setup_data;
grub_uint64_t pref_address;
grub_uint64_t init_size;
grub_uint32_t init_size;
} __attribute__ ((packed));
/* Boot parameters for Linux based on 2.6.12. This is used by the setup