From 9f731abc7f960a96a4c58d89717915e632837389 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 May 2015 16:21:34 +0200 Subject: [PATCH] Revert parts accidentally committed 2 commits ago. --- gentpl.py | 2 +- grub-core/loader/i386/linux.c | 11 ++++++----- grub-core/loader/linux.c | 3 +-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gentpl.py b/gentpl.py index 0fd5ba427..f177883f8 100644 --- a/gentpl.py +++ b/gentpl.py @@ -759,7 +759,7 @@ def image(defn, platform): if test x$(TARGET_APPLE_LINKER) = x1; then \ $(MACHO2IMG) $< $@; \ else \ - $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .hash -R .dynsym -R .dynstr -R .rel.text $< $@; \ + $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \ fi """) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c index fddcc461d..291f7289f 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -69,6 +69,7 @@ static grub_addr_t prot_mode_target; static void *initrd_mem; static grub_addr_t initrd_mem_target; static grub_size_t prot_init_space; +static grub_uint32_t initrd_pages; static struct grub_relocator *relocator = NULL; static void *efi_mmap_buf; static grub_size_t maximal_cmdline_size; @@ -1045,7 +1046,7 @@ static grub_err_t grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { - grub_size_t size = 0, aligned_size = 0; + grub_size_t size = 0; grub_addr_t addr_min, addr_max; grub_addr_t addr; grub_err_t err; @@ -1067,7 +1068,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), goto fail; size = grub_get_initrd_size (&initrd_ctx); - aligned_size = ALIGN_UP (size, 4096); + + initrd_pages = (page_align (size) >> 12); /* Get the highest address available for the initrd. */ if (grub_le_to_cpu16 (linux_params.version) >= 0x0203) @@ -1095,7 +1097,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), addr_min = (grub_addr_t) prot_mode_target + prot_init_space; /* Put the initrd as high as possible, 4KiB aligned. */ - addr = (addr_max - aligned_size) & ~0xFFF; + addr = (addr_max - size) & ~0xFFF; if (addr < addr_min) { @@ -1106,8 +1108,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), { grub_relocator_chunk_t ch; err = grub_relocator_alloc_chunk_align (relocator, &ch, - addr_min, addr, aligned_size, - 0x1000, + addr_min, addr, size, 0x1000, GRUB_RELOCATOR_PREFERENCE_HIGH, 1); if (err) diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c index a63a11a7f..117232f0c 100644 --- a/grub-core/loader/linux.c +++ b/grub-core/loader/linux.c @@ -205,8 +205,7 @@ grub_initrd_init (int argc, char *argv[], initrd_ctx->nfiles++; initrd_ctx->components[i].size = grub_file_size (initrd_ctx->components[i].file); - if (argc != 1) - initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4); + initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4); } if (newc)