From 4ac9bd0438a69b74f038deaf16c1ee86dbc04c22 Mon Sep 17 00:00:00 2001 From: okuji Date: Mon, 8 Aug 2005 23:15:21 +0000 Subject: [PATCH] 2005-08-08 Yoshinori K. Okuji * Makefile.in (LIBLZO): New variable. * configure.ac: Check for LZO version 2. * util/i386/pc/grub-mkimage.c [HAVE_LZO_LZO1X_H]: Include lzo/lzo1x.h instead of lzo1x.h. * conf/i386-pc.rmk (grub_mkimage_LDFLAGS): Use $(LIBLZO) instead of -llzo. * util/i386/pc/grub-setup.c (main): Do not free PREFIX twice. Reported by Vladimir Serbinenko . * partmap/pc.c (pc_partition_map_probe): Restore P->DATA after copying the data from PARTITION to P. --- ChangeLog | 18 +++ Makefile.in | 1 + NEWS | 6 +- THANKS | 1 + conf/i386-pc.mk | 2 +- conf/i386-pc.rmk | 2 +- config.h.in | 7 +- configure | 306 +++++++++++++++++++++++++++++++++++- configure.ac | 13 +- partmap/pc.c | 3 +- util/i386/pc/grub-mkimage.c | 6 +- util/i386/pc/grub-setup.c | 5 +- 12 files changed, 352 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07c4c9d6a..48ca6d296 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2005-08-08 Yoshinori K. Okuji + + * Makefile.in (LIBLZO): New variable. + + * configure.ac: Check for LZO version 2. + + * util/i386/pc/grub-mkimage.c [HAVE_LZO_LZO1X_H]: Include + lzo/lzo1x.h instead of lzo1x.h. + + * conf/i386-pc.rmk (grub_mkimage_LDFLAGS): Use $(LIBLZO) instead + of -llzo. + + * util/i386/pc/grub-setup.c (main): Do not free PREFIX + twice. Reported by Vladimir Serbinenko . + + * partmap/pc.c (pc_partition_map_probe): Restore P->DATA after + copying the data from PARTITION to P. + 2005-08-07 Yoshinori K. Okuji * kern/rescue.c (grub_rescue_cmd_rmmod): If the reference count is diff --git a/Makefile.in b/Makefile.in index 660c4a1a2..5bd8fdb70 100644 --- a/Makefile.in +++ b/Makefile.in @@ -67,6 +67,7 @@ NM = @NM@ LD = @LD@ RUBY = @RUBY@ LIBCURSES = @LIBCURSES@ +LIBLZO = @LIBLZO@ ### General variables. diff --git a/NEWS b/NEWS index 2770f1d15..b9d621d20 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,8 @@ -New in 1.90: +New in 1.91: + +* Add support for LZO version 2. + +New in 1.90 - 2005-08-07: * Rename the project name PUPA to GRUB. Now this version is the developmental version of GRUB officially. diff --git a/THANKS b/THANKS index bc49b47f4..56b724ca6 100644 --- a/THANKS +++ b/THANKS @@ -20,6 +20,7 @@ Tomas Ebenlendr Tsuneyoshi Yasuo Vincent Guffens Vincent Pelletier +Vladimir Serbinenko Also, we thank the projects GNU Automake and LZO. Some code was stolen from them. diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 5040a11b8..9f04e6dc8 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -305,7 +305,7 @@ grub_mkimage-util_resolve.d: util/resolve.c -include grub_mkimage-util_resolve.d -grub_mkimage_LDFLAGS = -llzo +grub_mkimage_LDFLAGS = $(LIBLZO) # For grub-setup. grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 796c09d3e..460e127be 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -55,7 +55,7 @@ noinst_UTILITIES = genmoddep # For grub-mkimage. grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ util/resolve.c -grub_mkimage_LDFLAGS = -llzo +grub_mkimage_LDFLAGS = $(LIBLZO) # For grub-setup. grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \ diff --git a/config.h.in b/config.h.in index ce02c0f82..9ac3fb5f0 100644 --- a/config.h.in +++ b/config.h.in @@ -25,8 +25,11 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the `lzo' library (-llzo). */ -#undef HAVE_LIBLZO +/* Define to 1 if you have the header file. */ +#undef HAVE_LZO1X_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LZO_LZO1X_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H diff --git a/configure b/configure index c006ae7b6..019e153f2 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 LIBCURSES 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 LIBLZO LIBCURSES LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -5726,8 +5726,143 @@ _ACEOF # Check LZO when compiling for the i386. if test "x$host_cpu" = xi386; then + # There are three possibilities. LZO version 2 installed with the name + # liblzo2, with the name liblzo, and LZO version 1. + echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6 +if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llzo2 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 +/* 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 __lzo_init_v2 (); +int +main () +{ +__lzo_init_v2 (); + ; + 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_lzo2___lzo_init_v2=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_lzo2___lzo_init_v2=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_lzo2___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6 +if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then + LIBLZO="-llzo2" +else + echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6 +if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llzo $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 __lzo_init_v2 (); +int +main () +{ +__lzo_init_v2 (); + ; + 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_lzo___lzo_init_v2=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_lzo___lzo_init_v2=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_lzo___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6 +if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then + LIBLZO="-llzo" +else + echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6 if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5792,18 +5927,19 @@ fi echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6 if test $ac_cv_lib_lzo___lzo_init2 = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBLZO 1 -_ACEOF - - LIBS="-llzo $LIBS" - + LIBLZO="-llzo" else { { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5 echo "$as_me: error: LZO library version 1.02 or later is required" >&2;} { (exit 1); exit 1; }; } fi +fi + +fi + + + LIBS="$LIBS $LIBLZO" echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6 if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then @@ -5902,6 +6038,159 @@ echo "$as_me: error: LZO1X-999 must be enabled" >&2;} { (exit 1); exit 1; }; } fi + + # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h. + + +for ac_header in lzo/lzo1x.h lzo1x.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 + fi # Check for curses. @@ -6858,6 +7147,7 @@ s,@RUBY@,$RUBY,;t t s,@BUILD_CC@,$BUILD_CC,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t +s,@LIBLZO@,$LIBLZO,;t t s,@LIBCURSES@,$LIBCURSES,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t diff --git a/configure.ac b/configure.ac index 3aa22a6d6..90c5e1743 100644 --- a/configure.ac +++ b/configure.ac @@ -132,10 +132,19 @@ AC_CHECK_SIZEOF(long) # Check LZO when compiling for the i386. if test "x$host_cpu" = xi386; then - AC_CHECK_LIB(lzo, __lzo_init2, , - AC_MSG_ERROR([LZO library version 1.02 or later is required])) + # There are three possibilities. LZO version 2 installed with the name + # liblzo2, with the name liblzo, and LZO version 1. + AC_CHECK_LIB(lzo2, __lzo_init_v2, [LIBLZO="-llzo2"], + AC_CHECK_LIB(lzo, __lzo_init_v2, [LIBLZO="-llzo"], + AC_CHECK_LIB(lzo, __lzo_init2, [LIBLZO="-llzo"], + AC_MSG_ERROR([LZO library version 1.02 or later is required])))) + AC_SUBST(LIBLZO) + LIBS="$LIBS $LIBLZO" AC_CHECK_FUNC(lzo1x_999_compress, , [AC_MSG_ERROR([LZO1X-999 must be enabled])]) + + # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h. + AC_CHECK_HEADERS(lzo/lzo1x.h lzo1x.h) fi # Check for curses. diff --git a/partmap/pc.c b/partmap/pc.c index 694c6fc22..398786f27 100644 --- a/partmap/pc.c +++ b/partmap/pc.c @@ -1,7 +1,7 @@ /* pc.c - Read PC style partition tables. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002, 2004 Free Software Foundation, Inc. + * Copyright (C) 2002,2004,2005 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 @@ -234,6 +234,7 @@ pc_partition_map_probe (grub_disk_t disk, const char *str) && pcdata->bsd_part == partdata->bsd_part) { grub_memcpy (p, partition, sizeof (*p)); + p->data = pcdata; grub_memcpy (pcdata, partdata, sizeof (*pcdata)); return 1; } diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index be915140c..546f4738a 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -35,7 +35,11 @@ #define _GNU_SOURCE 1 #include -#include +#if defined(HAVE_LZO_LZO1X_H) +# include +#elif defined(HAVE_LZO1X_H) +# include +#endif static void compress_kernel (char *kernel_img, size_t kernel_size, diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 8a64ea065..a2ff6fbf3 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -436,6 +436,10 @@ setup (const char *prefix, const char *dir, else *install_dos_part = *install_bsd_part = grub_cpu_to_le32 (-1); + grub_util_info ("dos partition is %u, bsd partition is %u, prefix is %s", + grub_le_to_cpu32 (*install_dos_part), + grub_le_to_cpu32 (*install_bsd_part), + prefix); strcpy (install_prefix, prefix); /* Write the first two sectors of the core image onto the disk. */ @@ -678,7 +682,6 @@ main (int argc, char *argv[]) free (boot_file); free (core_file); - free (prefix); free (dir); free (dev_map); free (root_dev);