compiling grub2 on Ubuntu (Xubuntu) 8.04
Ran into a few problems compiling grub2 (1.96) on my Ubuntu box; highlights of the apparent fixes are
- install liblzo2-2 and liblzo2-dev
- create a static link named /usr/lib/liblzo2.so to /usr/lib/liblzo2.so.2.0.0
Compile errors I was getting are below.
Signature · 181 lines
Tom Carpenter 1. first attempt after installing liblzo2-2 =========================================== # ./configure checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for cmp... cmp checking for bison... bison checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for ruby... no checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... 64 checking for _LARGE_FILES value needed for large files... no checking whether byte ordering is bigendian... no checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for void *... yes checking size of void *... 4 checking for long... yes checking size of long... 4 checking for __lzo_init_v2 in -llzo2... no checking for __lzo_init_v2 in -llzo... no checking for __lzo_init2 in -llzo... no configure: error: LZO library version 1.02 or later is required 2. create static link, ran 'configure', then tried running 'make' ================================================================= # ls -la /usr/lib | grep lzo lrwxrwxrwx 1 root root 16 2008-05-22 14:30 liblzo2.so.2 -> liblzo2.so.2.0.0 -rw-r--r-- 1 root root 125740 2007-06-16 08:58 liblzo2.so.2.0.0 # ln -s /usr/lib/liblzo2.so.2.0.0 /usr/lib/liblzo2.so # ./configure checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for cmp... cmp checking for bison... bison checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for ruby... no checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... 64 checking for _LARGE_FILES value needed for large files... no checking whether byte ordering is bigendian... no checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for void *... yes checking size of void *... 4 checking for long... yes checking size of long... 4 checking for __lzo_init_v2 in -llzo2... yes checking for lzo1x_999_compress... yes checking lzo/lzo1x.h usability... no checking lzo/lzo1x.h presence... no checking for lzo/lzo1x.h... no checking lzo1x.h usability... no checking lzo1x.h presence... no checking for lzo1x.h... no checking for posix_memalign... yes checking for memalign... yes checking for objcopy... objcopy checking for strip... strip checking for nm... nm checking whether optimization for size works... yes checking whether -falign-loops works... yes checking whether the linker accepts `--build-id=none'... yes checking whether `gcc' accepts `-fstack-protector'... yes checking whether objcopy works for absolute addresses... yes checking if C symbols get an underscore after compilation... no checking if start is defined by the compiler... no checking if _start is defined by the compiler... yes checking if __bss_start is defined by the compiler... yes checking if edata is defined by the compiler... yes checking if _edata is defined by the compiler... yes checking if end is defined by the compiler... yes checking if _end is defined by the compiler... yes checking whether addr32 must be in the same line as the instruction... yes checking for .code16 addr32 assembler support... yes checking whether an absolute indirect call/jump must not be prefixed with an asterisk... no checking if GCC has the regparm=3 bug... no configure: creating ./config.status config.status: creating Makefile config.status: creating gensymlist.sh config.status: creating genkernsyms.sh config.status: creating stamp-h config.status: creating config.h config.status: linking ./include/grub/i386 to include/grub/cpu config.status: linking ./include/grub/i386/pc to include/grub/machine # make gcc -Iutil/i386/pc -I./util/i386/pc -I. -Iinclude -I./include -Wall -W -DGRUB_LIBDIR=\"/usr/local/lib/`echo grub/i386-pc | sed 's,x,x,'`\" -g -O2 -DGRUB_UTIL=1 -DGRUB_MEMORY_MACHINE_LINK_ADDR=0x8200 -MD -c -o grub_mkimage-util_i386_pc_grub_mkimage.o util/i386/pc/grub-mkimage.c util/i386/pc/grub-mkimage.c: In function ‘compress_kernel’: util/i386/pc/grub-mkimage.c:49: error: ‘lzo_uint’ undeclared (first use in this function) util/i386/pc/grub-mkimage.c:49: error: (Each undeclared identifier is reported only once util/i386/pc/grub-mkimage.c:49: error: for each function it appears in.) util/i386/pc/grub-mkimage.c:49: error: expected ‘;’ before ‘size’ util/i386/pc/grub-mkimage.c:56: warning: implicit declaration of function ‘lzo_init’ util/i386/pc/grub-mkimage.c:56: error: ‘LZO_E_OK’ undeclared (first use in this function) util/i386/pc/grub-mkimage.c:60: error: ‘LZO1X_999_MEM_COMPRESS’ undeclared (first use in this function) util/i386/pc/grub-mkimage.c:65: warning: implicit declaration of function ‘lzo1x_999_compress’ util/i386/pc/grub-mkimage.c:65: error: expected ‘)’ before ‘lzo_byte’ util/i386/pc/grub-mkimage.c:66: warning: type defaults to ‘int’ in declaration of ‘type name’ util/i386/pc/grub-mkimage.c:68: error: ‘lzo_byte’ undeclared (first use in this function) util/i386/pc/grub-mkimage.c:68: error: expected expression before ‘)’ token util/i386/pc/grub-mkimage.c:70: error: ‘size’ undeclared (first use in this function) make: *** [grub_mkimage-util_i386_pc_grub_mkimage.o] Error 1 3. install liblzo2-dev, re-ran 'configure'; 'make' runs now ========================================================== lzo related messages from re-run of 'configure' . . . checking for __lzo_init_v2 in -llzo2... yes checking for lzo1x_999_compress... yes checking lzo/lzo1x.h usability... yes checking lzo/lzo1x.h presence... yes checking for lzo/lzo1x.h... yes checking lzo1x.h usability... no checking lzo1x.h presence... no checking for lzo1x.h... no . . .
Quoted 4 lines · Tom Carpenter
Ran into a few problems compiling grub2 (1.96) on my Ubuntu box; highlights of the apparent fixes are
- install liblzo2-2 and liblzo2-dev
That's sufficient for me.
Quoted 2 lines
- create a static link named
/usr/lib/liblzo2.soto/usr/lib/liblzo2.so.2.0.0
That should not be needed. /usr/lib/liblzo2.so is included in liblzo2-dev.
Quoted 1 line
1. first attempt after installing liblzo2-2
...
Quoted 4 lines
checking for
__lzo_init_v2in -llzo2... no
checking for__lzo_init_v2in -llzo... no
checking for__lzo_init2in -llzo... no
configure: error: LZO library version 1.02 or later is required
That's to be expected.
Quoted 11 lines
2. create static link, ran 'configure', then tried running 'make'
=================================================================# ls -la /usr/lib | grep lzo lrwxrwxrwx 1 root root 16 2008-05-22 14:30 liblzo2.so.2 -> liblzo2.so.2.0.0 -rw-r--r-- 1 root root 125740 2007-06-16 08:58 liblzo2.so.2.0.0# ln -s /usr/lib/liblzo2.so.2.0.0 /usr/lib/liblzo2.so# ./configure
...
Quoted 8 lines
checking for
__lzo_init_v2in -llzo2... yes checking forlzo1x_999_compress... yes checkinglzo/lzo1x.husability... no checkinglzo/lzo1x.hpresence... no checking forlzo/lzo1x.h... no checkinglzo1x.husability... no checkinglzo1x.hpresence... no checking forlzo1x.h... no
...
Quoted 3 lines
util/i386/pc/grub-mkimage.c: In function ‘compress_kernel’:util/i386/pc/grub-mkimage.c:49: error: ‘lzo_uint’ undeclared (first use in this function)
That's to be expected. The headers are still missing.
Quoted 15 lines
3. install liblzo2-dev, re-ran 'configure'; 'make' runs now
==========================================================lzo related messages from re-run of 'configure' .
.
.
checking for__lzo_init_v2in -llzo2... yes checking forlzo1x_999_compress... yes checkinglzo/lzo1x.husability... yes checkinglzo/lzo1x.hpresence... yes checking forlzo/lzo1x.h... yes
checkinglzo1x.husability... no checkinglzo1x.hpresence... no
checking forlzo1x.h... no
Now it's working. Creating the link manually wasn't needed.
Signature · 2 lines
Regards, Pavel Roskin