diff --git a/ChangeLog b/ChangeLog index 71f0f9fa2..adb768eaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,71 @@ 2010-11-07 BVK Chaitanya - Suppress shell expansion on echo '*' and echo "*" like cases, - reported by Jordan Uggla. + Suppress shell expansion on echo '*' and echo "*" like cases. + Reported by: Jordan Uggla. * grub-core/script/execute.c (grub_script_arglist_to_argv): Escape string arguments before shell expansion. * tests/grub_cmd_echo.in: New testcases. +2010-11-07 Vladimir Serbinenko + + * grub-core/kern/emu/hostdisk.c + (convert_system_partition_to_system_disk): Handle devices like "sdaa1". + +2010-11-06 Vladimir Serbinenko + + * include/grub/emu/misc.h: Don't include grub/util/libzfs.h. + * include/grub/emu/misc.h (grub_get_libzfs_handle): Move from here ... + * include/grub/util/libzfs.h (grub_get_libzfs_handle): ... here. + +2010-11-06 Vladimir Serbinenko + + * grub-core/fs/ntfs.c (grub_ntfs_uuid): Make uppercase. + +2010-11-06 Vladimir Serbinenko + + * util/grub-install.in: Replace useless recomendation to pass + --modules with a recomendation to report a bug. + +2010-11-06 Vladimir Serbinenko + + Properly register serial terminfo. + Reported by: Jordan Uggla + + * grub-core/term/serial.c (grub_serial_terminfo_input_template): New + const. + (grub_serial_terminfo_output_template): Likewise. + (grub_cmd_serial): Register "serial" with terminfo. + (GRUB_MOD_INIT(serial)): Fill grub_serial_terminfo_input and + grub_serial_terminfo_output. + +2010-11-05 Robert Millan + + * util/grub-mkconfig.in: Remove gfxterm.mod probe (no longer + needed). + +2010-11-05 Robert Millan + + On Yeeloong, pass machine type information to Linux. + + * grub-core/loader/mips/linux.c [GRUB_MACHINE_MIPS_YEELOONG] + (LOONGSON_MACHTYPE): New macro, set to + "machtype=lemote-yeeloong-2f-8.9inches". + [LOONGSON_MACHTYPE] (grub_cmd_linux): Pass LOONGSON_MACHTYPE as + additional argument to Linux. + +2010-11-04 Robert Millan + + * util/deviceiter.c (grub_util_iterate_devices): Increase SCSI + limit to 48 (to cope with Sun Fire X4500), and IDE limit to 96 + (its SATA disks are detected as slaveless IDE master drives on + kFreeBSD). + Reported by Carsten Aulbert. + +2010-11-02 Colin Watson + + * util/bin2h.c (main): Fix spelling error in generated output. + 2010-11-01 Grégoire Sutre * grub-core/partmap/bsdlabel.c (iterate_real): Fix an integer overflow. diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c index dd041e23a..414f6513d 100644 --- a/grub-core/fs/ntfs.c +++ b/grub-core/fs/ntfs.c @@ -1072,7 +1072,11 @@ grub_ntfs_uuid (grub_device_t device, char **uuid) data = grub_ntfs_mount (disk); if (data) { + char *ptr; *uuid = grub_xasprintf ("%016llx", (unsigned long long) data->uuid); + if (*uuid) + for (ptr = *uuid; *ptr; ptr++) + *ptr = grub_toupper (*ptr); } else *uuid = NULL; diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index 08f60ee66..12dbe7469 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -1152,16 +1152,22 @@ convert_system_partition_to_system_disk (const char *os_dev, struct stat *st) || strncmp ("sd", p, 2) == 0) && p[2] >= 'a' && p[2] <= 'z') { - /* /dev/[hsv]d[a-z][0-9]* */ - p[3] = '\0'; + char *pp = p + 2; + while (*pp >= 'a' && *pp <= 'z') + pp++; + /* /dev/[hsv]d[a-z]+[0-9]* */ + *pp = '\0'; return path; } /* If this is a Xen virtual block device. */ if ((strncmp ("xvd", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z') { - /* /dev/xvd[a-z][0-9]* */ - p[4] = '\0'; + char *pp = p + 3; + while (*pp >= 'a' && *pp <= 'z') + pp++; + /* /dev/xvd[a-z]+[0-9]* */ + *pp = '\0'; return path; } diff --git a/grub-core/loader/mips/linux.c b/grub-core/loader/mips/linux.c index 44ab64eb5..7b1836982 100644 --- a/grub-core/loader/mips/linux.c +++ b/grub-core/loader/mips/linux.c @@ -32,6 +32,14 @@ #include #include +#ifdef GRUB_MACHINE_MIPS_YEELOONG +/* This can be detected on runtime from PMON, but: + a) it wouldn't work when GRUB is the firmware + and + b) for now we only support Yeeloong anyway. */ +#define LOONGSON_MACHTYPE "machtype=lemote-yeeloong-2f-8.9inches" +#endif + static grub_dl_t my_mod; static int loaded; @@ -214,6 +222,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), /* For arguments. */ linux_argc = argc; +#ifdef LOONGSON_MACHTYPE + linux_argc++; +#endif /* Main arguments. */ size = (linux_argc) * sizeof (grub_uint32_t); /* Initrd address and size. */ @@ -226,7 +237,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), /* Normal arguments. */ for (i = 1; i < argc; i++) size += ALIGN_UP (grub_strlen (argv[i]) + 1, 4); - +#ifdef LOONGSON_MACHTYPE + size += ALIGN_UP (sizeof (LOONGSON_MACHTYPE), 4); +#endif + /* rd arguments. */ size += ALIGN_UP (sizeof ("rd_start=0xXXXXXXXXXXXXXXXX"), 4); size += ALIGN_UP (sizeof ("rd_size=0xXXXXXXXXXXXXXXXX"), 4); @@ -263,6 +277,16 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), linux_argv++; linux_args += ALIGN_UP (sizeof ("a0"), 4); +#ifdef LOONGSON_MACHTYPE + /* In Loongson platform, it is the responsibility of the bootloader/firmware + to supply the OS kernel with machine type information. */ + grub_memcpy (linux_args, LOONGSON_MACHTYPE, sizeof (LOONGSON_MACHTYPE)); + *linux_argv = (grub_uint8_t *) linux_args - (grub_uint8_t *) playground + + target_addr; + linux_argv++; + linux_args += ALIGN_UP (sizeof (LOONGSON_MACHTYPE), 4); +#endif + for (i = 1; i < argc; i++) { grub_memcpy (linux_args, argv[i], grub_strlen (argv[i]) + 1); diff --git a/grub-core/term/serial.c b/grub-core/term/serial.c index 1ef17aa25..d36388359 100644 --- a/grub-core/term/serial.c +++ b/grub-core/term/serial.c @@ -69,7 +69,7 @@ serial_fetch (grub_term_input_t term) return data->port->driver->fetch (data->port); } -struct grub_serial_input_state grub_serial_terminfo_input = +const struct grub_serial_input_state grub_serial_terminfo_input_template = { .tinfo = { @@ -77,7 +77,7 @@ struct grub_serial_input_state grub_serial_terminfo_input = } }; -struct grub_serial_output_state grub_serial_terminfo_output = +const struct grub_serial_output_state grub_serial_terminfo_output_template = { .tinfo = { @@ -87,6 +87,10 @@ struct grub_serial_output_state grub_serial_terminfo_output = } }; +struct grub_serial_input_state grub_serial_terminfo_input; + +struct grub_serial_output_state grub_serial_terminfo_output; + int registered = 0; static struct grub_term_input grub_serial_term_input = @@ -216,6 +220,8 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) { if (!registered) { + grub_terminfo_output_register (&grub_serial_term_output, "vt100"); + grub_term_register_input ("serial", &grub_serial_term_input); grub_term_register_output ("serial", &grub_serial_term_output); } @@ -337,6 +343,14 @@ GRUB_MOD_INIT(serial) cmd = grub_register_extcmd ("serial", grub_cmd_serial, 0, N_("[OPTIONS...]"), N_("Configure serial port."), options); + grub_memcpy (&grub_serial_terminfo_output, + &grub_serial_terminfo_output_template, + sizeof (grub_serial_terminfo_output)); + + grub_memcpy (&grub_serial_terminfo_input, + &grub_serial_terminfo_input_template, + sizeof (grub_serial_terminfo_input)); + #ifndef GRUB_MACHINE_EMU grub_ns8250_init (); #endif diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h index 47a80d3d7..ef0d18300 100644 --- a/include/grub/emu/misc.h +++ b/include/grub/emu/misc.h @@ -24,7 +24,6 @@ #include #include -#include #ifdef __CYGWIN__ # include @@ -79,6 +78,4 @@ extern char * canonicalize_file_name (const char *path); int grub_device_mapper_supported (void); #endif -libzfs_handle_t *grub_get_libzfs_handle (void); - #endif /* GRUB_EMU_MISC_H */ diff --git a/include/grub/util/libzfs.h b/include/grub/util/libzfs.h index 0500f70d7..a02caa335 100644 --- a/include/grub/util/libzfs.h +++ b/include/grub/util/libzfs.h @@ -42,4 +42,6 @@ extern nvlist_t *zpool_get_config (zpool_handle_t *, nvlist_t **); #endif /* ! HAVE_LIBZFS_H */ +libzfs_handle_t *grub_get_libzfs_handle (void); + #endif diff --git a/util/bin2h.c b/util/bin2h.c index e81ede8c6..ee1c7fd32 100644 --- a/util/bin2h.c +++ b/util/bin2h.c @@ -96,7 +96,7 @@ main (int argc, char *argv[]) if (b == EOF) goto abort; - printf ("/* THIS CHUNK OF BYTES IS AUTOMATICALY GENERATED */\n" + printf ("/* THIS CHUNK OF BYTES IS AUTOMATICALLY GENERATED */\n" "unsigned char %s[] =\n{\n", sym); while (1) diff --git a/util/deviceiter.c b/util/deviceiter.c index 1cf511934..34d34b7bb 100644 --- a/util/deviceiter.c +++ b/util/deviceiter.c @@ -601,7 +601,7 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), #endif /* __linux__ */ /* IDE disks. */ - for (i = 0; i < 26; i++) + for (i = 0; i < 96; i++) { char name[16]; @@ -655,7 +655,7 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), #endif /* __linux__ */ /* The rest is SCSI disks. */ - for (i = 0; i < 26; i++) + for (i = 0; i < 48; i++) { char name[16]; diff --git a/util/grub-install.in b/util/grub-install.in index 8b0f5ebe1..20b3cab46 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -466,9 +466,9 @@ fi # Create the core image. First, auto-detect the filesystem module. fs_module=`$grub_probe --target=fs --device ${grub_device}` -if test "x$fs_module" = x -a "x$modules" = x; then - echo "Auto-detection of a filesystem module failed." 1>&2 - echo "Please specify the module with the option \`--modules' explicitly." 1>&2 +if test "x$fs_module" = x ; then + echo "Auto-detection of a filesystem of ${grub_device} failed." 1>&2 + echo "Please report this together with the output of \"$grub_probe --target=fs -v ${grubdir}\" to " 1>&2 exit 1 fi diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index b59911cd0..73f730131 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -168,20 +168,6 @@ fi for x in ${GRUB_TERMINAL_OUTPUT}; do if [ "x${x}" = "xgfxterm" ]; then - # If this platform supports gfxterm, try to use it. - if ! test -e ${GRUB_PREFIX}/gfxterm.mod ; then - if [ "x$termoutdefault" != "x1" ]; then - echo "gfxterm isn't available on your platform" >&2 ; exit 1 - fi - GRUB_TERMINAL_OUTPUT= - break; - fi - if [ ! -s "${GRUB_PREFIX}/video.lst" ] ; then - if [ "x$termoutdefault" != "x1" ]; then - echo "No suitable backend could be found for gfxterm." >&2 ; exit 1 - fi - GRUB_TERMINAL_OUTPUT= - fi if [ -n "$GRUB_FONT" ] ; then if is_path_readable_by_grub ${GRUB_FONT} > /dev/null ; then GRUB_FONT_PATH=${GRUB_FONT}