diff --git a/ChangeLog b/ChangeLog index 351c36968..07c4c9d6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +2005-08-07 Yoshinori K. Okuji + + * kern/rescue.c (grub_rescue_cmd_rmmod): If the reference count is + negative, unload the module. + + * util/i386/pc/grub-setup.c (setup): The name of the PC partition + map is "pc_partition_map" but not "pc". + (usage): Fix the description. The options are --boot-image and + --core-image but not --boot-file or --core-file. + (main): If not specified explicitly, make BOOT_FILE and CORE_FILE + based on DEFAULT_BOOT_FILE and DEFAULT_CORE_FILE with DIR or + DEFAULT_DIRECTORY. + + * util/i386/pc/grub-install.in: Do not specify --boot-file or + --core-file. Specify INSTALL_DEVICE as an argument. + + * util/console.c: Include config.h. + [HAVE_NCURSeS_CURSES_H]: Include ncurses/curses.h. + [HAVE_NCURSES_H]: Include ncurses.h. + [HAVE_CURSES_H]: Include curses.h. + [!A_NORMAL] (A_NORMAL): Defined as zero. + [!A_STANDOUT] (A_STANDOUT): Likewise. + + * conf/i386-pc.rmk (grub_emu_LDFLAGS): Use $(LIBCURSES) instead of + -lncurses. + * conf/powerpc-ieee1275.rmk (grub_emu_LDFLAGS): Likewise. + + * configure.ac: Check for curses libraries and headers. + + * Makefile.in (LIBCURSES): New variable. + + * genmk.rb (Script::rule): Set the executable bits. + + * util/i386/pc/biosdisk.c (grub_util_biosdisk_get_grub_dev): The + name of the PC partition map is "pc_partition_map" but not "pc". + 2005-08-07 Yoshinori K. Okuji * util/i386/pc/grub-install.in (grub_probefs): New variable. diff --git a/Makefile.in b/Makefile.in index 11530b6a6..660c4a1a2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -66,6 +66,7 @@ STRIP = @STRIP@ NM = @NM@ LD = @LD@ RUBY = @RUBY@ +LIBCURSES = @LIBCURSES@ ### General variables. diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 2b8dc4598..5040a11b8 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -1094,7 +1094,7 @@ grub_emu-util_i386_pc_misc.d: util/i386/pc/misc.c -include grub_emu-util_i386_pc_misc.d -grub_emu_LDFLAGS = -lncurses +grub_emu_LDFLAGS = $(LIBCURSES) # For genmoddep. genmoddep_SOURCES = util/genmoddep.c @@ -1122,6 +1122,7 @@ CLEANFILES += grub-install grub-install: util/i386/pc/grub-install.in config.status ./config.status --file=grub-install:util/i386/pc/grub-install.in + chmod +x $@ # Modules. diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 132f40702..796c09d3e 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -92,7 +92,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/i386/pc/biosdisk.c util/i386/pc/getroot.c \ util/i386/pc/misc.c -grub_emu_LDFLAGS = -lncurses +grub_emu_LDFLAGS = $(LIBCURSES) # For genmoddep. genmoddep_SOURCES = util/genmoddep.c diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 29c83a90f..3454da47a 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -486,7 +486,7 @@ grub_emu-util_powerpc_ieee1275_misc.d: util/powerpc/ieee1275/misc.c -include grub_emu-util_powerpc_ieee1275_misc.d -grub_emu_LDFLAGS = -lncurses +grub_emu_LDFLAGS = $(LIBCURSES) grubof_SOURCES = boot/powerpc/ieee1275/crt0.S boot/powerpc/ieee1275/cmain.c \ kern/ieee1275/of.c kern/main.c kern/device.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 55dfd2d2b..232677a8d 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -50,7 +50,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/i386/pc/biosdisk.c util/i386/pc/getroot.c \ util/powerpc/ieee1275/misc.c -grub_emu_LDFLAGS = -lncurses +grub_emu_LDFLAGS = $(LIBCURSES) grubof_SOURCES = boot/powerpc/ieee1275/crt0.S boot/powerpc/ieee1275/cmain.c \ kern/ieee1275/of.c kern/main.c kern/device.c \ diff --git a/config.h.in b/config.h.in index 32ae6d617..ce02c0f82 100644 --- a/config.h.in +++ b/config.h.in @@ -19,6 +19,9 @@ /* Define if C symbols get an underscore after compilation */ #undef HAVE_ASM_USCORE +/* Define to 1 if you have the header file. */ +#undef HAVE_CURSES_H + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H @@ -28,6 +31,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the header file. */ +#undef HAVE_NCURSES_CURSES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NCURSES_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H diff --git a/configure b/configure index dd55bc8cb..c006ae7b6 100644 --- a/configure +++ b/configure @@ -311,7 +311,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM LD ac_ct_LD RUBY BUILD_CC CPP EGREP LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM LD ac_ct_LD RUBY BUILD_CC CPP EGREP LIBCURSES LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -5904,6 +5904,300 @@ fi fi +# Check for curses. +echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 +echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6 +if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char wgetch (); +int +main () +{ +wgetch (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ncurses_wgetch=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ncurses_wgetch=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6 +if test $ac_cv_lib_ncurses_wgetch = yes; then + LIBCURSES="-lncurses" +else + echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 +echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6 +if test "${ac_cv_lib_curses_wgetch+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurses $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char wgetch (); +int +main () +{ +wgetch (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_curses_wgetch=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_curses_wgetch=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6 +if test $ac_cv_lib_curses_wgetch = yes; then + LIBCURSES="-lcurses" +fi + +fi + + + +# Check for headers. + + + +for ac_header in ncurses/curses.h ncurses.h curses.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-grub@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + CC="$tmp_CC" CFLAGS="$tmp_CFLAGS" CPPFLAGS="$tmp_CPPFLAGS" @@ -6564,6 +6858,7 @@ s,@RUBY@,$RUBY,;t t s,@BUILD_CC@,$BUILD_CC,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t +s,@LIBCURSES@,$LIBCURSES,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF diff --git a/configure.ac b/configure.ac index c233f5201..3aa22a6d6 100644 --- a/configure.ac +++ b/configure.ac @@ -94,7 +94,7 @@ if test "x$host_cpu" = xi386; then grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK grub_I386_CHECK_REGPARM_BUG else - AC_DEFINE([NESTED_FUNC_ATTR], [],[Catch gcc bug]) + AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug]) fi AC_PROG_INSTALL @@ -138,6 +138,14 @@ if test "x$host_cpu" = xi386; then [AC_MSG_ERROR([LZO1X-999 must be enabled])]) fi +# Check for curses. +AC_CHECK_LIB(ncurses, wgetch, [LIBCURSES="-lncurses"], + [AC_CHECK_LIB(curses, wgetch, [LIBCURSES="-lcurses"])]) +AC_SUBST(LIBCURSES) + +# Check for headers. +AC_CHECK_HEADERS(ncurses/curses.h ncurses.h curses.h) + CC="$tmp_CC" CFLAGS="$tmp_CFLAGS" CPPFLAGS="$tmp_CPPFLAGS" diff --git a/genmk.rb b/genmk.rb index 9a6910957..703f58c7b 100644 --- a/genmk.rb +++ b/genmk.rb @@ -288,6 +288,7 @@ class Script #{@name}: #{src} config.status ./config.status --file=#{name}:#{src} + chmod +x $@ " end diff --git a/kern/rescue.c b/kern/rescue.c index 5e4303f14..b5a3cb3dd 100644 --- a/kern/rescue.c +++ b/kern/rescue.c @@ -530,7 +530,7 @@ grub_rescue_cmd_rmmod (int argc, char *argv[]) return; } - if (! grub_dl_unref (mod)) + if (grub_dl_unref (mod) <= 0) grub_dl_unload (mod); } diff --git a/util/console.c b/util/console.c index 4ecce3cf4..b938bbc5a 100644 --- a/util/console.c +++ b/util/console.c @@ -18,7 +18,24 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include + +#if defined(HAVE_NCURSES_CURSES_H) +# include +#elif defined(HAVE_NCURSES_H) +# include +#elif defined(HAVE_CURSES_H) +# include +#endif + +/* For compatibility. */ +#ifndef A_NORMAL +# define A_NORMAL 0 +#endif /* ! A_NORMAL */ +#ifndef A_STANDOUT +# define A_STANDOUT 0 +#endif /* ! A_STANDOUT */ + #include #include #include diff --git a/util/i386/pc/biosdisk.c b/util/i386/pc/biosdisk.c index c63d729b6..634414f47 100644 --- a/util/i386/pc/biosdisk.c +++ b/util/i386/pc/biosdisk.c @@ -739,7 +739,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) { struct grub_pc_partition *pcdata = 0; - if (!strcmp (partition->partmap->name, "pc")) + if (strcmp (partition->partmap->name, "pc_partition_map") == 0) pcdata = partition->data; if (pcdata) diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index cdffc4be0..3790fe77f 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -220,8 +220,8 @@ modules="$modules $fs_module _chain pc" $grub_mkimage --output=${grubdir}/core.img $modules || exit 1 # Now perform the installation. -$grub_setup --boot-file=${grubdir}/boot.img --core-file=${grubdir}/core.img \ - --directory=${grubdir} --device-map=${device_map} || exit 1 +$grub_setup --directory=${grubdir} --device-map=${device_map} \ + ${install_device} || exit 1 # Prompt the user to check if the device map is correct. echo "Installation finished. No error reported." diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 2c987f9bb..8a64ea065 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -269,7 +269,8 @@ setup (const char *prefix, const char *dir, struct grub_pc_partition *pcdata = root_dev->disk->partition->data; - if (strcmp (root_dev->disk->partition->partmap->name, "pc")) + if (strcmp (root_dev->disk->partition->partmap->name, + "pc_partition_map") != 0) grub_util_error ("No PC style partitions found"); *install_dos_part @@ -423,7 +424,8 @@ setup (const char *prefix, const char *dir, struct grub_pc_partition *pcdata = root_dev->disk->partition->data; - if (strcmp (root_dev->disk->partition->partmap->name, "pc")) + if (strcmp (root_dev->disk->partition->partmap->name, + "pc_partition_map") != 0) grub_util_error ("No PC style partitions found"); *install_dos_part @@ -487,8 +489,8 @@ Usage: grub-setup [OPTION]... DEVICE\n\ Set up images to boot from DEVICE.\n\ DEVICE must be a GRUB device (e.g. ``(hd0,0)'').\n\ \n\ - -b, --boot-file=FILE use FILE as the boot file [default=%s]\n\ - -c, --core-file=FILE use FILE as the core file [default=%s]\n\ + -b, --boot-image=FILE use FILE as the boot image [default=%s]\n\ + -c, --core-image=FILE use FILE as the core image [default=%s]\n\ -d, --directory=DIR use GRUB files in the directory DIR [default=%s]\n\ -m, --device-map=FILE use FILE as the device map [default=%s]\n\ -r, --root-device=DEV use DEV as the root device [default=guessed]\n\ @@ -655,7 +657,7 @@ main (int argc, char *argv[]) grub_util_error ("Cannot guess the root device. Specify the option ``--root-device''."); } } - + /* Do the real work. */ setup (prefix, dir ? : DEFAULT_DIRECTORY,