merge from trunk

This commit is contained in:
Colin Watson 2010-01-05 10:53:03 +00:00
commit bc11fee9f5
260 changed files with 7022 additions and 3839 deletions

View file

@ -15,11 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
hexify()
{
echo -n "$@" | od -A n -t x1 - | sed -e 's/ //g' | tr '\n' '\0'
}
if [ x$1 == x ]; then
echo "Filename required".
fi
echo "`hexify efi`{ `hexify device-properties`:"
ioreg -lw0 -p IODeviceTree -n efi -r -x |grep device-properties | sed 's/.*<//;s/>.*//;'
echo ";}"
ioreg -lw0 -p IODeviceTree -n efi -r -x |grep device-properties | sed 's/.*<//;s/>.*//;' | xxd -r -p > $1

View file

@ -29,6 +29,7 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@
PACKAGE_VERSION=@PACKAGE_VERSION@
target_cpu=@target_cpu@
platform=@platform@
host_os=@host_os@
pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`

View file

@ -204,19 +204,19 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
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);
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_util_write_image (boot_img, boot_size, out);
free (boot_img);
free (boot_path);

View file

@ -356,8 +356,12 @@ setup (const char *dir,
goto unable_to_embed;
}
grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "part_msdos") ?
find_usable_region_gpt : find_usable_region_msdos));
if (strcmp (dest_partmap, "part_msdos") == 0)
grub_partition_iterate (dest_dev->disk, find_usable_region_msdos);
else if (strcmp (dest_partmap, "part_gpt") == 0)
grub_partition_iterate (dest_dev->disk, find_usable_region_gpt);
else
grub_util_error (_("No DOS-style partitions found"));
if (embed_region.end == embed_region.start)
{