mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-29 02:31:05 +00:00
merge master to newports/alpha
This commit is contained in:
commit
7c58da503f
251 files changed
+16716
-5054
No files matched your search
@@ -65,7 +65,7 @@ argument () {
|
||||
shift
|
||||
|
||||
if test $# -eq 0; then
|
||||
gettext_printf "%s: option requires an argument -- \`%s'\n" "$0" "$opt" 1>&2
|
||||
gettext_printf "%s: option requires an argument -- \`%s'\n" "$self" "$opt" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
echo $1
|
||||
@@ -215,7 +215,8 @@ export GRUB_DEFAULT \
|
||||
GRUB_INIT_TUNE \
|
||||
GRUB_SAVEDEFAULT \
|
||||
GRUB_ENABLE_CRYPTODISK \
|
||||
GRUB_BADRAM
|
||||
GRUB_BADRAM \
|
||||
GRUB_DISABLE_SUBMENU
|
||||
|
||||
if test "x${grub_cfg}" != "x"; then
|
||||
rm -f "${grub_cfg}.new"
|
||||
|
||||
+27
-24
@@ -467,6 +467,22 @@ add_subst (grub_uint32_t from, grub_uint32_t to, struct glyph_replace **target)
|
||||
*target = new;
|
||||
}
|
||||
|
||||
static void
|
||||
subst (const struct gsub_substitution *sub, grub_uint32_t glyph,
|
||||
struct glyph_replace **target, int *i)
|
||||
{
|
||||
grub_uint16_t substtype;
|
||||
substtype = grub_be_to_cpu16 (sub->type);
|
||||
|
||||
if (substtype == GSUB_SUBSTITUTION_DELTA)
|
||||
add_subst (glyph, glyph + grub_be_to_cpu16 (sub->delta), target);
|
||||
else if (*i >= grub_be_to_cpu16 (sub->count))
|
||||
printf (_("Out of range substitution (%d, %d)\n"), *i,
|
||||
grub_be_to_cpu16 (sub->count));
|
||||
else
|
||||
add_subst (glyph, grub_be_to_cpu16 (sub->repl[(*i)++]), target);
|
||||
}
|
||||
|
||||
static void
|
||||
process_cursive (struct gsub_feature *feature,
|
||||
struct gsub_lookup_list *lookups,
|
||||
@@ -474,24 +490,9 @@ process_cursive (struct gsub_feature *feature,
|
||||
{
|
||||
int j, k;
|
||||
int i;
|
||||
struct glyph_replace **target;
|
||||
struct glyph_replace **target = NULL;
|
||||
struct gsub_substitution *sub;
|
||||
|
||||
auto inline void subst (grub_uint32_t glyph);
|
||||
void subst (grub_uint32_t glyph)
|
||||
{
|
||||
grub_uint16_t substtype;
|
||||
substtype = grub_be_to_cpu16 (sub->type);
|
||||
|
||||
if (substtype == GSUB_SUBSTITUTION_DELTA)
|
||||
add_subst (glyph, glyph + grub_be_to_cpu16 (sub->delta), target);
|
||||
else if (i >= grub_be_to_cpu16 (sub->count))
|
||||
printf (_("Out of range substitution (%d, %d)\n"), i,
|
||||
grub_be_to_cpu16 (sub->count));
|
||||
else
|
||||
add_subst (glyph, grub_be_to_cpu16 (sub->repl[i++]), target);
|
||||
}
|
||||
|
||||
for (j = 0; j < grub_be_to_cpu16 (feature->lookupcount); j++)
|
||||
{
|
||||
int lookup_index = grub_be_to_cpu16 (feature->lookupindices[j]);
|
||||
@@ -552,14 +553,14 @@ process_cursive (struct gsub_feature *feature,
|
||||
void *coverage = (grub_uint8_t *) sub
|
||||
+ grub_be_to_cpu16 (sub->coverage_off);
|
||||
grub_uint32_t covertype;
|
||||
covertype = grub_be_to_cpu16 (*(grub_uint16_t * __attribute__ ((packed))) coverage);
|
||||
covertype = grub_be_to_cpu16 (grub_get_unaligned16 (coverage));
|
||||
i = 0;
|
||||
if (covertype == GSUB_COVERAGE_LIST)
|
||||
{
|
||||
struct gsub_coverage_list *cover = coverage;
|
||||
int l;
|
||||
for (l = 0; l < grub_be_to_cpu16 (cover->count); l++)
|
||||
subst (grub_be_to_cpu16 (cover->glyphs[l]));
|
||||
subst (sub, grub_be_to_cpu16 (cover->glyphs[l]), target, &i);
|
||||
}
|
||||
else if (covertype == GSUB_COVERAGE_RANGE)
|
||||
{
|
||||
@@ -568,7 +569,7 @@ process_cursive (struct gsub_feature *feature,
|
||||
for (l = 0; l < grub_be_to_cpu16 (cover->count); l++)
|
||||
for (m = grub_be_to_cpu16 (cover->ranges[l].start);
|
||||
m <= grub_be_to_cpu16 (cover->ranges[l].end); m++)
|
||||
subst (m);
|
||||
subst (sub, m, target, &i);
|
||||
}
|
||||
else
|
||||
/* TRANSLATORS: most font transformations apply only to
|
||||
@@ -706,8 +707,6 @@ write_be16_section (const char *name, grub_uint16_t data, int* offset,
|
||||
*offset += 10;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
|
||||
|
||||
static void
|
||||
print_glyphs (struct grub_font_info *font_info)
|
||||
{
|
||||
@@ -1221,9 +1220,13 @@ main (int argc, char *argv[])
|
||||
arguments.font_info.style = ft_face->style_flags;
|
||||
arguments.font_info.size = size;
|
||||
|
||||
if (FT_Set_Pixel_Sizes (ft_face, size, size))
|
||||
grub_util_error (_("can't set %dx%d font size"),
|
||||
size, size);
|
||||
err = FT_Set_Pixel_Sizes (ft_face, size, size);
|
||||
|
||||
if (err)
|
||||
grub_util_error (_("can't set %dx%d font size: Freetype error %d: %s"),
|
||||
size, size, err,
|
||||
(err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs))
|
||||
? ft_errmsgs[err] : "");
|
||||
add_font (&arguments.font_info, ft_face, arguments.file_format != PF2);
|
||||
FT_Done_Face (ft_face);
|
||||
}
|
||||
|
||||
+16
-5
@@ -103,7 +103,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections,
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if ((cur_index == STN_UNDEF))
|
||||
else if (cur_index == STN_UNDEF)
|
||||
{
|
||||
if (sym->st_name)
|
||||
grub_util_error ("undefined symbol %s", name);
|
||||
@@ -806,7 +806,8 @@ SUFFIX (check_elf_header) (Elf_Ehdr *e, size_t size, const struct grub_install_i
|
||||
into .text and .data, respectively. Return the array of section
|
||||
addresses. */
|
||||
static Elf_Addr *
|
||||
SUFFIX (locate_sections) (Elf_Shdr *sections, Elf_Half section_entsize,
|
||||
SUFFIX (locate_sections) (const char *kernel_path,
|
||||
Elf_Shdr *sections, Elf_Half section_entsize,
|
||||
Elf_Half num_sections, const char *strtab,
|
||||
size_t *exec_size, size_t *kernel_sz,
|
||||
size_t *all_align,
|
||||
@@ -846,8 +847,17 @@ SUFFIX (locate_sections) (Elf_Shdr *sections, Elf_Half section_entsize,
|
||||
grub_util_info ("locating the section %s at 0x%llx",
|
||||
name, (unsigned long long) current_address);
|
||||
if (image_target->id != IMAGE_EFI)
|
||||
current_address = grub_host_to_target_addr (s->sh_addr)
|
||||
- image_target->link_addr;
|
||||
{
|
||||
current_address = grub_host_to_target_addr (s->sh_addr)
|
||||
- image_target->link_addr;
|
||||
if (grub_host_to_target_addr (s->sh_addr)
|
||||
!= image_target->link_addr)
|
||||
grub_util_error ("`%s' is miscompiled: it's start address is 0x%llx"
|
||||
" instead of 0x%llx: ld.gold bug?",
|
||||
kernel_path,
|
||||
(unsigned long long) grub_host_to_target_addr (s->sh_addr),
|
||||
(unsigned long long) image_target->link_addr);
|
||||
}
|
||||
section_addresses[i] = current_address;
|
||||
current_address += grub_host_to_target_addr (s->sh_size);
|
||||
}
|
||||
@@ -935,7 +945,8 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size,
|
||||
+ grub_host_to_target16 (e->e_shstrndx) * section_entsize);
|
||||
strtab = (char *) e + grub_host_to_target_addr (s->sh_offset);
|
||||
|
||||
section_addresses = SUFFIX (locate_sections) (sections, section_entsize,
|
||||
section_addresses = SUFFIX (locate_sections) (kernel_path,
|
||||
sections, section_entsize,
|
||||
num_sections, strtab,
|
||||
exec_size, kernel_sz, align,
|
||||
image_target);
|
||||
|
||||
@@ -370,11 +370,11 @@ if test -e "${efi64_dir}" || test -e "${efi32_dir}" || test -e "${ia64_dir}"; th
|
||||
mkdir -p "${efi_dir}/efi/boot"
|
||||
|
||||
# build bootia64.efi
|
||||
make_image "${ia64_dir}" ia64-efi "${efi_dir}"/efi/boot/bootia64.efi ""
|
||||
make_image_fwdisk "${ia64_dir}" ia64-efi "${efi_dir}"/efi/boot/bootia64.efi ""
|
||||
# build bootx64.efi
|
||||
make_image "${efi64_dir}" x86_64-efi "${efi_dir}"/efi/boot/bootx64.efi ""
|
||||
make_image_fwdisk "${efi64_dir}" x86_64-efi "${efi_dir}"/efi/boot/bootx64.efi ""
|
||||
# build bootia32.efi
|
||||
make_image "${efi32_dir}" i386-efi "${efi_dir}"/efi/boot/bootia32.efi ""
|
||||
make_image_fwdisk "${efi32_dir}" i386-efi "${efi_dir}"/efi/boot/bootia32.efi ""
|
||||
if [ -e "${efi_dir}"/efi/boot/bootia32.efi ]; then
|
||||
# For old macs. Suggested by Peter Jones.
|
||||
cp "${efi_dir}"/efi/boot/bootia32.efi "${efi_dir}"/efi/boot/boot.efi
|
||||
|
||||
@@ -116,6 +116,9 @@ fi
|
||||
|
||||
memdisk_dir="`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
|
||||
grub_install_files "${source_directory}" "${memdisk_dir}"/boot/grub "${grub_modinfo_target_cpu}-${grub_modinfo_platform}"
|
||||
for file in $source; do
|
||||
cp -f "$file" "${memdisk_dir}"/"$file";
|
||||
done
|
||||
|
||||
memdisk_img=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
|
||||
|
||||
|
||||
+27
-9
@@ -205,17 +205,24 @@ fuse_getattr (const char *path, struct stat *st)
|
||||
st->st_uid = 0;
|
||||
st->st_gid = 0;
|
||||
st->st_rdev = 0;
|
||||
st->st_size = 0;
|
||||
if (!ctx.file_info.dir)
|
||||
{
|
||||
grub_file_t file;
|
||||
file = grub_file_open (path);
|
||||
if (! file)
|
||||
if (! file && grub_errno == GRUB_ERR_BAD_FILE_TYPE)
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
st->st_mode = (0555 | S_IFDIR);
|
||||
}
|
||||
else if (! file)
|
||||
return translate_error ();
|
||||
st->st_size = file->size;
|
||||
grub_file_close (file);
|
||||
else
|
||||
{
|
||||
st->st_size = file->size;
|
||||
grub_file_close (file);
|
||||
}
|
||||
}
|
||||
else
|
||||
st->st_size = 0;
|
||||
st->st_blksize = 512;
|
||||
st->st_blocks = (st->st_size + 511) >> 9;
|
||||
st->st_atime = st->st_mtime = st->st_ctime = ctx.file_info.mtimeset
|
||||
@@ -304,10 +311,21 @@ fuse_readdir_call_fill (const char *filename,
|
||||
tmp = xasprintf ("%s/%s", ctx->path, filename);
|
||||
file = grub_file_open (tmp);
|
||||
free (tmp);
|
||||
if (! file)
|
||||
return translate_error ();
|
||||
st.st_size = file->size;
|
||||
grub_file_close (file);
|
||||
/* Symlink to directory. */
|
||||
if (! file && grub_errno == GRUB_ERR_BAD_FILE_TYPE)
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
st.st_mode = (0555 | S_IFDIR);
|
||||
}
|
||||
else if (!file)
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
st.st_size = file->size;
|
||||
grub_file_close (file);
|
||||
}
|
||||
}
|
||||
st.st_blksize = 512;
|
||||
st.st_blocks = (st.st_size + 511) >> 9;
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ argument () {
|
||||
shift
|
||||
|
||||
if test $# -eq 0; then
|
||||
gettext_printf "%s: option requires an argument -- \`%s'\n" "$0" "$opt" 1>&2
|
||||
gettext_printf "%s: option requires an argument -- \`%s'\n" "$self" "$opt" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
echo $1
|
||||
|
||||
@@ -63,7 +63,7 @@ argument () {
|
||||
shift
|
||||
|
||||
if test $# -eq 0; then
|
||||
gettext_printf "%s: option requires an argument -- \`%s'\n" "$0" "$opt" 1>&2
|
||||
gettext_printf "%s: option requires an argument -- \`%s'\n" "$self" "$opt" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
echo $1
|
||||
|
||||
@@ -191,7 +191,7 @@ EOF
|
||||
EOF
|
||||
|
||||
# Gettext variables and module
|
||||
if [ "x${LANG}" != "xC" ] ; then
|
||||
if [ "x${LANG}" != "xC" ] && [ "x${LANG}" != "x" ]; then
|
||||
cat << EOF
|
||||
set locale_dir=\$prefix/locale
|
||||
set lang=${grub_lang}
|
||||
|
||||
@@ -151,29 +151,29 @@ title_correction_code=
|
||||
# Extra indentation to add to menu entries in a submenu. We're not in a submenu
|
||||
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
|
||||
submenu_indentation=""
|
||||
is_first_entry=true
|
||||
is_top_level=true
|
||||
|
||||
while [ "x$kernels" != "x" ] ; do
|
||||
kernel=`version_find_latest $kernels`
|
||||
|
||||
if [ "x$is_first_entry" = xtrue ]; then
|
||||
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
|
||||
hurd_entry "$kernel" simple
|
||||
submenu_indentation="$grub_tab"
|
||||
|
||||
# TRANSLATORS: %s is replaced with an OS name
|
||||
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnuhurd-advanced-$(grub_get_device_id "${GRUB_DEVICE_BOOT}")' {"
|
||||
is_top_level=false
|
||||
fi
|
||||
|
||||
hurd_entry "$kernel" advanced
|
||||
hurd_entry "$kernel" recovery
|
||||
|
||||
kernels=`echo $kernels | tr ' ' '\n' | grep -vx $kernel | tr '\n' ' '`
|
||||
is_first_entry=false
|
||||
done
|
||||
|
||||
# If at least one kernel was found, then we need to
|
||||
# add a closing '}' for the submenu command.
|
||||
if [ x"$is_first_entry" != xtrue ]; then
|
||||
if [ x"$is_top_level" != xtrue ]; then
|
||||
echo '}'
|
||||
fi
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ title_correction_code=
|
||||
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
|
||||
submenu_indentation=""
|
||||
|
||||
is_first_entry=true
|
||||
is_top_level=true
|
||||
|
||||
while [ "x$list" != "x" ] ; do
|
||||
kfreebsd=`version_find_latest $list`
|
||||
@@ -211,7 +211,7 @@ while [ "x$list" != "x" ] ; do
|
||||
module_dir_rel=$(make_system_path_relative_to_its_root $module_dir)
|
||||
fi
|
||||
|
||||
if [ "x$is_first_entry" = xtrue ]; then
|
||||
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
|
||||
kfreebsd_entry "${OS}" "${version}" simple
|
||||
submenu_indentation="$grub_tab"
|
||||
|
||||
@@ -220,6 +220,7 @@ while [ "x$list" != "x" ] ; do
|
||||
fi
|
||||
# TRANSLATORS: %s is replaced with an OS name
|
||||
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'kfreebsd-advanced-$boot_device_id' {"
|
||||
is_top_level=false
|
||||
fi
|
||||
|
||||
kfreebsd_entry "${OS}" "${version}" advanced
|
||||
@@ -228,12 +229,11 @@ while [ "x$list" != "x" ] ; do
|
||||
fi
|
||||
|
||||
list=`echo $list | tr ' ' '\n' | grep -vx $kfreebsd | tr '\n' ' '`
|
||||
is_first_entry=false
|
||||
done
|
||||
|
||||
# If at least one kernel was found, then we need to
|
||||
# add a closing '}' for the submenu command.
|
||||
if [ x"$is_first_entry" != xtrue ]; then
|
||||
if [ x"$is_top_level" != xtrue ]; then
|
||||
echo '}'
|
||||
fi
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ title_correction_code=
|
||||
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
|
||||
submenu_indentation=""
|
||||
|
||||
is_first_entry=true
|
||||
is_top_level=true
|
||||
while [ "x$list" != "x" ] ; do
|
||||
linux=`version_find_latest $list`
|
||||
gettext_printf "Found linux image: %s\n" "$linux" >&2
|
||||
@@ -226,7 +226,7 @@ while [ "x$list" != "x" ] ; do
|
||||
linux_root_device_thisversion=${GRUB_DEVICE}
|
||||
fi
|
||||
|
||||
if [ "x$is_first_entry" = xtrue ]; then
|
||||
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
|
||||
linux_entry "${OS}" "${version}" simple \
|
||||
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
|
||||
|
||||
@@ -237,6 +237,7 @@ while [ "x$list" != "x" ] ; do
|
||||
fi
|
||||
# TRANSLATORS: %s is replaced with an OS name
|
||||
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
|
||||
is_top_level=false
|
||||
fi
|
||||
|
||||
linux_entry "${OS}" "${version}" advanced \
|
||||
@@ -247,12 +248,11 @@ while [ "x$list" != "x" ] ; do
|
||||
fi
|
||||
|
||||
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
|
||||
is_first_entry=false
|
||||
done
|
||||
|
||||
# If at least one kernel was found, then we need to
|
||||
# add a closing '}' for the submenu command.
|
||||
if [ x"$is_first_entry" != xtrue ]; then
|
||||
if [ x"$is_top_level" != xtrue ]; then
|
||||
echo '}'
|
||||
fi
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ pattern="^ELF[^,]*executable.*statically linked"
|
||||
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
|
||||
submenu_indentation=""
|
||||
|
||||
is_first_entry=true
|
||||
is_top_level=true
|
||||
for k in /netbsd $(ls -t /netbsd?* 2>/dev/null) ; do
|
||||
if ! grub_file_is_not_garbage "$k" ; then
|
||||
continue
|
||||
@@ -157,7 +157,7 @@ for k in /netbsd $(ls -t /netbsd?* 2>/dev/null) ; do
|
||||
|
||||
gettext_printf "Found NetBSD kernel: %s\n" "$k" >&2
|
||||
|
||||
if [ "x$is_first_entry" = xtrue ]; then
|
||||
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
|
||||
netbsd_entry "knetbsd" "$k" simple "${GRUB_CMDLINE_NETBSD_DEFAULT}"
|
||||
submenu_indentation="$grub_tab"
|
||||
|
||||
@@ -166,6 +166,7 @@ for k in /netbsd $(ls -t /netbsd?* 2>/dev/null) ; do
|
||||
fi
|
||||
# TRANSLATORS: %s is replaced with an OS name
|
||||
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'netbsd-advanced-$boot_device_id' {"
|
||||
is_top_level=false
|
||||
fi
|
||||
|
||||
netbsd_entry "knetbsd" "$k" advanced "${GRUB_CMDLINE_NETBSD_DEFAULT}"
|
||||
@@ -174,12 +175,11 @@ for k in /netbsd $(ls -t /netbsd?* 2>/dev/null) ; do
|
||||
netbsd_entry "knetbsd" "$k" recovery "-s"
|
||||
netbsd_entry "multiboot" "$k" recovery "-s"
|
||||
fi
|
||||
is_first_entry=false
|
||||
done
|
||||
|
||||
# If at least one kernel was found, then we need to
|
||||
# add a closing '}' for the submenu command.
|
||||
if [ x"$is_first_entry" != xtrue ]; then
|
||||
if [ x"$is_top_level" != xtrue ]; then
|
||||
echo '}'
|
||||
fi
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ esac
|
||||
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
|
||||
submenu_indentation=""
|
||||
|
||||
is_first_entry=true
|
||||
is_top_level=true
|
||||
|
||||
while [ "x${xen_list}" != "x" ] ; do
|
||||
list="${linux_list}"
|
||||
@@ -205,7 +205,7 @@ while [ "x${xen_list}" != "x" ] ; do
|
||||
if [ -z "$boot_device_id" ]; then
|
||||
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
|
||||
fi
|
||||
if [ "x$is_first_entry" != xtrue ]; then
|
||||
if [ "x$is_top_level" != xtrue ]; then
|
||||
echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
|
||||
fi
|
||||
while [ "x$list" != "x" ] ; do
|
||||
@@ -239,7 +239,7 @@ while [ "x${xen_list}" != "x" ] ; do
|
||||
linux_root_device_thisversion=${GRUB_DEVICE}
|
||||
fi
|
||||
|
||||
if [ "x$is_first_entry" = xtrue ]; then
|
||||
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
|
||||
linux_entry "${OS}" "${version}" "${xen_version}" simple \
|
||||
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
|
||||
|
||||
@@ -251,8 +251,8 @@ while [ "x${xen_list}" != "x" ] ; do
|
||||
# TRANSLATORS: %s is replaced with an OS name
|
||||
echo "submenu '$(gettext_printf "Advanced options for %s (with Xen hypervisor)" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
|
||||
echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
|
||||
is_top_level=false
|
||||
fi
|
||||
is_first_entry=false
|
||||
|
||||
linux_entry "${OS}" "${version}" "${xen_version}" advanced \
|
||||
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
|
||||
@@ -263,7 +263,7 @@ while [ "x${xen_list}" != "x" ] ; do
|
||||
|
||||
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
|
||||
done
|
||||
if [ x"$is_first_entry" != xtrue ]; then
|
||||
if [ x"$is_top_level" != xtrue ]; then
|
||||
echo ' }'
|
||||
fi
|
||||
xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $current_xen | tr '\n' ' '`
|
||||
@@ -271,7 +271,7 @@ done
|
||||
|
||||
# If at least one kernel was found, then we need to
|
||||
# add a closing '}' for the submenu command.
|
||||
if [ x"$is_first_entry" != xtrue ]; then
|
||||
if [ x"$is_top_level" != xtrue ]; then
|
||||
echo '}'
|
||||
fi
|
||||
|
||||
|
||||
@@ -134,6 +134,12 @@ EOF
|
||||
save_default_entry | grub_add_tab
|
||||
prepare_grub_to_access_device ${DEVICE} | grub_add_tab
|
||||
|
||||
if [ x"`${grub_probe} --device ${DEVICE} --target=partmap`" = xmsdos ]; then
|
||||
cat << EOF
|
||||
parttool \${root} hidden-
|
||||
EOF
|
||||
fi
|
||||
|
||||
case ${LONGNAME} in
|
||||
Windows\ Vista*|Windows\ 7*|Windows\ Server\ 2008*)
|
||||
;;
|
||||
@@ -173,7 +179,7 @@ EOF
|
||||
fi
|
||||
prepare_boot_cache=
|
||||
boot_device_id=
|
||||
is_first_entry=true
|
||||
is_top_level=true
|
||||
title_correction_code=
|
||||
OS="${LONGNAME}"
|
||||
|
||||
@@ -209,7 +215,7 @@ EOF
|
||||
prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | grub_add_tab)"
|
||||
fi
|
||||
|
||||
if [ "x$is_first_entry" = xtrue ]; then
|
||||
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
|
||||
cat << EOF
|
||||
menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
|
||||
EOF
|
||||
@@ -227,7 +233,7 @@ EOF
|
||||
}
|
||||
EOF
|
||||
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS} $onstr" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {"
|
||||
is_first_entry=false
|
||||
is_top_level=false
|
||||
fi
|
||||
title="${LLABEL} $onstr"
|
||||
cat << EOF
|
||||
@@ -253,7 +259,7 @@ EOF
|
||||
grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")"
|
||||
fi
|
||||
done
|
||||
if [ x"$is_first_entry" != xtrue ]; then
|
||||
if [ x"$is_top_level" != xtrue ]; then
|
||||
echo '}'
|
||||
fi
|
||||
echo "$title_correction_code"
|
||||
|
||||
+23
-12
@@ -102,10 +102,10 @@ cryptolist.write ("CRC64: crc64\n");
|
||||
for cipher_file in cipher_files:
|
||||
infile = os.path.join (cipher_dir_in, cipher_file)
|
||||
outfile = os.path.join (cipher_dir_out, cipher_file)
|
||||
if cipher_file == "ChangeLog":
|
||||
if cipher_file == "ChangeLog" or cipher_file == "ChangeLog-2011":
|
||||
continue
|
||||
chlognew = " * %s" % cipher_file
|
||||
if re.match ("(Manifest|Makefile\.am|ac\.c|cipher\.c|hash-common\.c|hmac-tests\.c|md\.c|pubkey\.c)$", cipher_file) or cipher_file == "elgamal.c" or cipher_file == "primegen.c" or cipher_file == "test-getrusage.c":
|
||||
if re.match ("(Manifest|Makefile\.am|ac\.c|cipher\.c|hash-common\.c|hmac-tests\.c|md\.c|pubkey\.c)$", cipher_file) or cipher_file == "kdf.c" or cipher_file == "elgamal.c" or cipher_file == "primegen.c" or cipher_file == "ecc.c" or cipher_file == "test-getrusage.c":
|
||||
chlog = "%s%s: Removed\n" % (chlog, chlognew)
|
||||
continue
|
||||
# Autogenerated files. Not even worth mentionning in ChangeLog
|
||||
@@ -139,7 +139,7 @@ for cipher_file in cipher_files:
|
||||
mdnames = []
|
||||
pknames = []
|
||||
hold = False
|
||||
skip = False
|
||||
skip = 0
|
||||
skip2 = False
|
||||
ismd = False
|
||||
ispk = False
|
||||
@@ -160,9 +160,9 @@ for cipher_file in cipher_files:
|
||||
if not re.search (";", line) is None:
|
||||
skip_statement = False
|
||||
continue
|
||||
if skip:
|
||||
if skip > 0:
|
||||
if line[0] == "}":
|
||||
skip = False
|
||||
skip = skip - 1
|
||||
continue
|
||||
if skip2:
|
||||
if not re.search (" *};", line) is None:
|
||||
@@ -195,7 +195,7 @@ for cipher_file in cipher_files:
|
||||
# Used only for selftests.
|
||||
m = re.match ("(static byte|static unsigned char) (weak_keys_chksum)\[[0-9]*\] =", line)
|
||||
if not m is None:
|
||||
skip = True
|
||||
skip = 1
|
||||
fname = m.groups ()[1]
|
||||
chmsg = "(%s): Removed." % fname
|
||||
if nch:
|
||||
@@ -209,7 +209,11 @@ for cipher_file in cipher_files:
|
||||
# We're optimising for size and exclude anything needing good
|
||||
# randomness.
|
||||
if not re.match ("(run_selftests|selftest|_gcry_aes_c.._..c|_gcry_[a-z0-9]*_hash_buffer|tripledes_set2keys|do_tripledes_set_extra_info|_gcry_rmd160_mixblock|serpent_test|dsa_generate_ext|test_keys|gen_k|sign|gen_x931_parm_xp|generate_x931|generate_key|dsa_generate|dsa_sign|ecc_sign|generate|generate_fips186|_gcry_register_pk_dsa_progress|_gcry_register_pk_ecc_progress|progress|scanval|ec2os|ecc_generate_ext|ecc_generate|compute_keygrip|ecc_get_param|_gcry_register_pk_dsa_progress|gen_x931_parm_xp|gen_x931_parm_xi|rsa_decrypt|rsa_sign|rsa_generate_ext|rsa_generate|secret|check_exponent|rsa_blind|rsa_unblind|extract_a_from_sexp|curve_free|curve_copy|point_set)", line) is None:
|
||||
skip = True
|
||||
|
||||
skip = 1
|
||||
if not re.match ("selftest", line) is None and cipher_file == "idea.c":
|
||||
skip = 3
|
||||
|
||||
if not re.match ("serpent_test", line) is None:
|
||||
fw.write ("static const char *serpent_test (void) { return 0; }\n");
|
||||
if not re.match ("dsa_generate", line) is None:
|
||||
@@ -343,9 +347,16 @@ for cipher_file in cipher_files:
|
||||
holdline = line
|
||||
continue
|
||||
m = re.match ("static int tripledes_set2keys \(.*\);", line)
|
||||
if not m is None:
|
||||
continue
|
||||
m = re.match ("static int tripledes_set3keys \(.*\);", line)
|
||||
if not m is None:
|
||||
continue
|
||||
m = re.match ("static int tripledes_set2keys \(", line)
|
||||
if not m is None:
|
||||
skip_statement = True
|
||||
continue
|
||||
m = re.match ("static int tripledes_set3keys \(", line)
|
||||
if not m is None:
|
||||
skip_statement = True
|
||||
continue
|
||||
@@ -451,7 +462,7 @@ for cipher_file in cipher_files:
|
||||
conf.write (" cflags = '$(CFLAGS_GCRY) -Wno-redundant-decls -Wno-sign-compare';\n")
|
||||
elif modname == "gcry_rijndael" or modname == "gcry_md4" or modname == "gcry_md5" or modname == "gcry_rmd160" or modname == "gcry_sha1" or modname == "gcry_sha256" or modname == "gcry_sha512" or modname == "gcry_tiger":
|
||||
# Alignment checked by hand
|
||||
conf.write (" cflags = '$(CFLAGS_GCRY) -Wno-cast-align -Wno-strict-aliasing';\n");
|
||||
conf.write (" cflags = '$(CFLAGS_GCRY) -Wno-cast-align';\n");
|
||||
else:
|
||||
conf.write (" cflags = '$(CFLAGS_GCRY)';\n");
|
||||
conf.write (" cppflags = '$(CPPFLAGS_GCRY)';\n");
|
||||
@@ -522,18 +533,18 @@ for src in sorted (os.listdir (os.path.join (indir, "mpi"))):
|
||||
fw.write ("/* This file was automatically imported with \n")
|
||||
fw.write (" import_gcry.py. Please don't modify it */\n")
|
||||
hold = False
|
||||
skip = False
|
||||
skip = 0
|
||||
for line in f:
|
||||
if skip:
|
||||
if skip > 0:
|
||||
if line[0] == "}":
|
||||
skip = False
|
||||
skip = skip - 1
|
||||
continue
|
||||
if hold:
|
||||
hold = False
|
||||
# We're optimising for size and exclude anything needing good
|
||||
# randomness.
|
||||
if not re.match ("(_gcry_mpi_get_hw_config|gcry_mpi_randomize)", line) is None:
|
||||
skip = True
|
||||
skip = 1
|
||||
continue
|
||||
else:
|
||||
fw.write (holdline)
|
||||
|
||||
@@ -7,9 +7,12 @@
|
||||
/^# *include <time\.h>/ d
|
||||
/^# *include <sys\/socket\.h>/ d
|
||||
/^# *include <sys\/time\.h>/ d
|
||||
/^ typedef long ssize_t;/ d
|
||||
/^ typedef int pid_t;/ d
|
||||
/^# *include <gpg-error\.h>/ s,#include <gpg-error.h>,#include <grub/gcrypt/gpg-error.h>,
|
||||
/^typedef gpg_error_t gcry_error_t;/ d
|
||||
/^typedef gpg_err_code_t gcry_err_code_t;/ d
|
||||
/^typedef struct gcry_mpi \*gcry_mpi_t;/ d
|
||||
/^struct gcry_thread_cbs/ d
|
||||
s,_gcry_mpi_invm,gcry_mpi_invm,g
|
||||
p
|
||||
+2
-2
@@ -658,8 +658,8 @@ struct grub_ieee1275_note
|
||||
|
||||
#include <grub/lib/LzmaEnc.h>
|
||||
|
||||
static void *SzAlloc(void *p, size_t size) { p = p; return xmalloc(size); }
|
||||
static void SzFree(void *p, void *address) { p = p; free(address); }
|
||||
static void *SzAlloc(void *p __attribute__ ((unused)), size_t size) { return xmalloc(size); }
|
||||
static void SzFree(void *p __attribute__ ((unused)), void *address) { free(address); }
|
||||
static ISzAlloc g_Alloc = { SzAlloc, SzFree };
|
||||
|
||||
static void
|
||||
|
||||
+1
-3
@@ -25,6 +25,7 @@
|
||||
#include <grub/font.h>
|
||||
#include <grub/gfxmenu_view.h>
|
||||
#include <grub/color.h>
|
||||
#include <grub/emu/hostdisk.h>
|
||||
|
||||
#define _GNU_SOURCE 1
|
||||
|
||||
@@ -35,9 +36,6 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
void grub_hostfs_init (void);
|
||||
void grub_host_init (void);
|
||||
|
||||
struct header
|
||||
{
|
||||
grub_uint8_t magic;
|
||||
|
||||
+17
-8
@@ -149,33 +149,40 @@ save_blocklists (grub_disk_addr_t sector, unsigned offset, unsigned length,
|
||||
{
|
||||
struct blocklists *bl = data;
|
||||
struct grub_boot_blocklist *prev = bl->block + 1;
|
||||
grub_uint64_t seclen;
|
||||
|
||||
grub_util_info ("saving <%" PRIuGRUB_UINT64_T ",%u,%u>",
|
||||
sector, offset, length);
|
||||
|
||||
if (bl->first_sector == (grub_disk_addr_t) -1)
|
||||
{
|
||||
if (offset != 0 || length != GRUB_DISK_SECTOR_SIZE)
|
||||
if (offset != 0 || length < GRUB_DISK_SECTOR_SIZE)
|
||||
grub_util_error ("%s", _("the first sector of the core file is not sector-aligned"));
|
||||
|
||||
bl->first_sector = sector;
|
||||
return;
|
||||
sector++;
|
||||
length -= GRUB_DISK_SECTOR_SIZE;
|
||||
if (!length)
|
||||
return;
|
||||
}
|
||||
|
||||
if (offset != 0 || bl->last_length != GRUB_DISK_SECTOR_SIZE)
|
||||
if (offset != 0 || bl->last_length != 0)
|
||||
grub_util_error ("%s", _("non-sector-aligned data is found in the core file"));
|
||||
|
||||
seclen = (length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS;
|
||||
|
||||
if (bl->block != bl->first_block
|
||||
&& (grub_target_to_host64 (prev->start)
|
||||
+ grub_target_to_host16 (prev->len)) == sector)
|
||||
{
|
||||
grub_uint16_t t = grub_target_to_host16 (prev->len) + 1;
|
||||
grub_uint16_t t = grub_target_to_host16 (prev->len);
|
||||
t += seclen;
|
||||
prev->len = grub_host_to_target16 (t);
|
||||
}
|
||||
else
|
||||
{
|
||||
bl->block->start = grub_host_to_target64 (sector);
|
||||
bl->block->len = grub_host_to_target16 (1);
|
||||
bl->block->len = grub_host_to_target16 (seclen);
|
||||
#ifdef GRUB_SETUP_BIOS
|
||||
bl->block->segment = grub_host_to_target16 (bl->current_segment);
|
||||
#endif
|
||||
@@ -185,9 +192,9 @@ save_blocklists (grub_disk_addr_t sector, unsigned offset, unsigned length,
|
||||
grub_util_error ("%s", _("the sectors of the core file are too fragmented"));
|
||||
}
|
||||
|
||||
bl->last_length = length;
|
||||
bl->last_length = length & (GRUB_DISK_SECTOR_SIZE - 1);
|
||||
#ifdef GRUB_SETUP_BIOS
|
||||
bl->current_segment += GRUB_DISK_SECTOR_SIZE >> 4;
|
||||
bl->current_segment += seclen << (GRUB_DISK_SECTOR_BITS - 4);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -260,7 +267,7 @@ SETUP (const char *dir,
|
||||
bl.current_segment =
|
||||
GRUB_BOOT_I386_PC_KERNEL_SEG + (GRUB_DISK_SECTOR_SIZE >> 4);
|
||||
#endif
|
||||
bl.last_length = GRUB_DISK_SECTOR_SIZE;
|
||||
bl.last_length = 0;
|
||||
|
||||
/* Read the boot image by the OS service. */
|
||||
boot_path = grub_util_get_path (dir, boot_file);
|
||||
@@ -731,6 +738,8 @@ unable_to_embed:
|
||||
if ((char *) bl.block <= core_img)
|
||||
grub_util_error ("%s", _("no terminator in the core image"));
|
||||
}
|
||||
if (len)
|
||||
grub_util_error ("%s", _("blocklists are incomplete"));
|
||||
core_dev->disk->partition = container;
|
||||
free (buf);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user