]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Merge from trunk
authorRobert Millan <rmh@aybabtu.com>
Fri, 25 Dec 2009 22:29:47 +0000 (22:29 +0000)
committerRobert Millan <rmh@aybabtu.com>
Fri, 25 Dec 2009 22:29:47 +0000 (22:29 +0000)
16 files changed:
1  2 
conf/i386-coreboot.rmk
conf/i386-ieee1275.rmk
conf/i386-pc.rmk
disk/ata.c
font/font.c
fs/cpio.c
genmk.rb
include/grub/at_keyboard.h
kern/elf.c
loader/powerpc/ieee1275/linux.c
po/POTFILES
term/at_keyboard.c
term/gfxterm.c
term/serial.c
util/grub-install.in
util/grub-mkrawimage.c

Simple merge
Simple merge
Simple merge
diff --cc disk/ata.c
Simple merge
diff --cc font/font.c
Simple merge
diff --cc fs/cpio.c
Simple merge
diff --cc genmk.rb
Simple merge
index ba8071f20d6bd8bcbe269b78aabe054207f88462,0000000000000000000000000000000000000000..10421540ae05f349962ad45d1f961e0a2eec0255
mode 100644,000000..100644
--- /dev/null
@@@ -1,52 -1,0 +1,54 @@@
-  *  Copyright (C) 2007,2008  Free Software Foundation, Inc.
 +/*
 + *  GRUB  --  GRand Unified Bootloader
++ *  Copyright (C) 2007,2008,2009  Free Software Foundation, Inc.
 + *
 + *  GRUB 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 3 of the License, or
 + *  (at your option) any later version.
 + *
 + *  GRUB 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 GRUB.  If not, see <http://www.gnu.org/licenses/>.
 + */
 +
 +#ifndef GRUB_AT_KEYBOARD_HEADER
 +#define GRUB_AT_KEYBOARD_HEADER       1
 +
 +#define SHIFT_L               0x2a
 +#define SHIFT_R               0x36
 +#define CTRL          0x1d
 +#define ALT           0x38
 +#define CAPS_LOCK     0x3a
++#define NUM_LOCK      0x45
++#define SCROLL_LOCK   0x46
 +
 +/* Used for sending commands to the controller.  */
 +#define KEYBOARD_COMMAND_ISREADY(x)   !((x) & 0x02)
 +#define KEYBOARD_COMMAND_READ         0x20
 +#define KEYBOARD_COMMAND_WRITE                0x60
 +#define KEYBOARD_COMMAND_REBOOT               0xfe
 +
 +#define KEYBOARD_SCANCODE_SET1                0x40
 +
 +#define KEYBOARD_ISMAKE(x)    !((x) & 0x80)
 +#define KEYBOARD_ISREADY(x)   ((x) & 0x01)
 +#define KEYBOARD_SCANCODE(x)  ((x) & 0x7f)
 +
 +#ifdef GRUB_MACHINE_IEEE1275
 +#define OLPC_UP               GRUB_TERM_UP
 +#define OLPC_DOWN     GRUB_TERM_DOWN
 +#define OLPC_LEFT     GRUB_TERM_LEFT
 +#define OLPC_RIGHT    GRUB_TERM_RIGHT
 +#else
 +#define OLPC_UP               '\0'
 +#define OLPC_DOWN     '\0'
 +#define OLPC_LEFT     '\0'
 +#define OLPC_RIGHT    '\0'
 +#endif
 +
 +#endif
diff --cc kern/elf.c
index 1e51839a069920b2cfeaedda642d92fe7d6eece5,10fe9c758c2ee2bbb1d9ff1de822d670cec12fab..0c5b4a3b46ac38c611c51da9bb5647397563797b
@@@ -196,12 -198,9 +198,12 @@@ grub_elf32_size (grub_elf_t elf, Elf32_
  
    grub_elf32_phdr_iterate (elf, calcsize, 0);
  
 +  if (base)
 +    *base = 0;
 +
    if (nr_phdrs == 0)
      {
-       grub_error (GRUB_ERR_BAD_OS, "No program headers present");
+       grub_error (GRUB_ERR_BAD_OS, "no program headers present");
        return 0;
      }
  
@@@ -380,12 -379,9 +384,12 @@@ grub_elf64_size (grub_elf_t elf, Elf64_
  
    grub_elf64_phdr_iterate (elf, calcsize, 0);
  
 +  if (base)
 +    *base = 0;
 +
    if (nr_phdrs == 0)
      {
-       grub_error (GRUB_ERR_BAD_OS, "No program headers present");
+       grub_error (GRUB_ERR_BAD_OS, "no program headers present");
        return 0;
      }
  
Simple merge
diff --cc po/POTFILES
index 28623a0964b107449619369c901b556666cfa70c,6efa1221902156670b4b0b96d7fd153f9ffa0642..b36f7bbf2222d8bf24e19fafd1a17e751ddbdf1a
@@@ -1,5 -1,14 +1,14 @@@
  # List of files which contain translatable strings.
 -util/i386/pc/grub-mkimage.c
+ commands/i386/pc/play.c
+ commands/loadenv.c
+ commands/search.c
+ commands/help.c
+ lib/arg.c
+ normal/dyncmd.c
 +util/grub-mkrawimage.c
  util/i386/pc/grub-setup.c
  
  util/mkisofs/eltorito.c
Simple merge
diff --cc term/gfxterm.c
Simple merge
diff --cc term/serial.c
Simple merge
index 494ac6bc39e06a3ee9935a5fbe7a490743a3ce6b,7283e1b40b93fb5a87f90a3298c5000c4ad1ec59..bc7035a2d7f3b4ea85083e0f6b5fccc017528d5d
@@@ -29,7 -29,7 +29,8 @@@ PACKAGE_TARNAME=@PACKAGE_TARNAME
  PACKAGE_VERSION=@PACKAGE_VERSION@
  target_cpu=@target_cpu@
  platform=@platform@
+ host_os=@host_os@
 +font=@datadir@/@PACKAGE_TARNAME@/ascii.pf2
  pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
  
  grub_setup=${sbindir}/`echo grub-setup | sed ${transform}`
index 58b30f5becb8a83e6330c84afd315237f6bafc63,3c2cb7549b0d9f095551cb1499b5f7a5e79ed520..8186c860155f6e8dd728b2a65fb7d68c936accd9
@@@ -236,19 -204,19 +236,19 @@@ generate_image (const char *dir, char *
      num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
      if (num > 0xffff)
        grub_util_error (_("the core image is too big"));
-     
 -   
++
      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)
 -      grub_util_error (_("diskboot.img size must be %u bytes"), GRUB_DISK_SECTOR_SIZE);
 -   
 +      grub_util_error (_("diskboot.img size must be %u bytes"),
 +                     GRUB_DISK_SECTOR_SIZE);
-     
++
      boot_img = grub_util_read_image (boot_path);
-     
 -   
 -    /* i386 is a little endian architecture.  */
++
      *((grub_uint16_t *) (boot_img + GRUB_DISK_SECTOR_SIZE
                         - GRUB_BOOT_MACHINE_LIST_SIZE + 8))
 -      = grub_cpu_to_le16 (num);
 -   
 +      = grub_host_to_target16 (num);
-     
++
      grub_util_write_image (boot_img, boot_size, out);
      free (boot_img);
      free (boot_path);
  #ifdef GRUB_MACHINE_PCBIOS
    if (GRUB_KERNEL_MACHINE_LINK_ADDR + core_size > GRUB_MEMORY_MACHINE_UPPER)
      grub_util_error (_("Core image is too big (%p > %p)\n"),
 -                   GRUB_KERNEL_MACHINE_LINK_ADDR + core_size, GRUB_MEMORY_MACHINE_UPPER);
 +                   GRUB_KERNEL_MACHINE_LINK_ADDR + core_size,
 +                   GRUB_MEMORY_MACHINE_UPPER);
 +#endif
 +
 +#if defined(GRUB_MACHINE_MIPS)
 +  if (format == GRUB_PLATFORM_IMAGE_ELF)
 +    {
 +      char *elf_img;
 +      size_t program_size;
 +      Elf32_Ehdr *ehdr;
 +      Elf32_Phdr *phdr;
 +      grub_uint32_t target_addr;
 +
 +      program_size = ALIGN_UP (core_size, 4);
 +
 +      elf_img = xmalloc (program_size + sizeof (*ehdr) + sizeof (*phdr));
 +      memset (elf_img, 0, program_size + sizeof (*ehdr) + sizeof (*phdr));
 +      memcpy (elf_img  + sizeof (*ehdr) + sizeof (*phdr), core_img, core_size);
 +      ehdr = (void *) elf_img;
 +      phdr = (void *) (elf_img + sizeof (*ehdr));
 +      memcpy (ehdr->e_ident, ELFMAG, SELFMAG);
 +      ehdr->e_ident[EI_CLASS] = ELFCLASS32;
 +#ifdef GRUB_CPU_MIPSEL
 +      ehdr->e_ident[EI_DATA] = ELFDATA2LSB;
 +#else
 +      ehdr->e_ident[EI_DATA] = ELFDATA2MSB;
 +#endif
 +      ehdr->e_ident[EI_VERSION] = EV_CURRENT;
 +      ehdr->e_ident[EI_OSABI] = ELFOSABI_NONE;
 +      ehdr->e_type = grub_host_to_target16 (ET_EXEC);
 +      ehdr->e_machine = grub_host_to_target16 (EM_MIPS);
 +      ehdr->e_version = grub_host_to_target32 (EV_CURRENT);
 +
 +      ehdr->e_phoff = grub_host_to_target32 ((char *) phdr - (char *) ehdr);
 +      ehdr->e_phentsize = grub_host_to_target16 (sizeof (*phdr));
 +      ehdr->e_phnum = grub_host_to_target16 (1);
 +
 +      /* No section headers.  */
 +      ehdr->e_shoff = grub_host_to_target32 (0);
 +      ehdr->e_shentsize = grub_host_to_target16 (0);
 +      ehdr->e_shnum = grub_host_to_target16 (0);
 +      ehdr->e_shstrndx = grub_host_to_target16 (0);
-       
++
 +      ehdr->e_ehsize = grub_host_to_target16 (sizeof (*ehdr));
-       
++
 +      phdr->p_type = grub_host_to_target32 (PT_LOAD);
 +      phdr->p_offset = grub_host_to_target32 (sizeof (*ehdr) + sizeof (*phdr));
 +      phdr->p_flags = grub_host_to_target32 (PF_R | PF_W | PF_X);
-       
++
 +      target_addr = ALIGN_UP (GRUB_KERNEL_MACHINE_LINK_ADDR 
 +                            + kernel_size + total_module_size, 32);
 +      ehdr->e_entry = grub_host_to_target32 (target_addr);
 +      phdr->p_vaddr = grub_host_to_target32 (target_addr);
 +      phdr->p_paddr = grub_host_to_target32 (target_addr);
 +      phdr->p_align = grub_host_to_target32 (GRUB_KERNEL_MACHINE_LINK_ALIGN);
 +      ehdr->e_flags = grub_host_to_target32 (0x1000 | EF_MIPS_NOREORDER 
 +                                           | EF_MIPS_PIC | EF_MIPS_CPIC);
 +      phdr->p_filesz = grub_host_to_target32 (core_size);
 +      phdr->p_memsz = grub_host_to_target32 (core_size);
 +
 +      free (core_img);
 +      core_img = elf_img;
 +      core_size = program_size  + sizeof (*ehdr) + sizeof (*phdr);
 +  }
  #endif
  
    grub_util_write_image (core_img, core_size, out);