No Build ID error when building new OpenVZ kernel in FEDORA8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am Xing, a PHD candidate in University of Utah. I am trying to compile
and install an OpenVZ kernel in FEDORA8, but one error prevents me. The
error is "No build ID note found in /var/tmp/kernel***". I have tried
several ways to solve it but still failed. I introduced what I did to solve
this problem and hope to get some help from you.

The procedure I did to build a kernel RPM from SRPM.
1). Install SCR RPM

-bash-3.2$ sudo rpm -ihv
~/openvz/ovzkernel-2.6.18-128.2.1.el5.028stab064.7.src.rpm
   1:ovzkernel              #######################################[100%]

2). Change buildid in kernel-ovz.spec

-bash-3.2$ vim ./SPECS/kernel-ovz.spec
%define buildid .emulab_openvz_migration  //for easy distinguish.


3). Prepare kernel source tree.
-bash-3.2$ sudo rpmbuild -bp --target=`uname -m` kernel-ovz.spec
Building target platforms: x86_64
Building for target x86_64

4). create my own patch
I).
-bash-3.2$ sudo cp -r ./BUILD/ovzkernel-2.6.18/linux-2.6.18.x86_64
./BUILD/ovzkernel-2.6.18.orig
-bash-3.2$ sudo cp -r BUILD/ovzkernel-2.6.18.orig
BUILD/ovzkernel-2.6.18.new


II). -bash-3.2$ sudo vim BUILD/ovzkernel-2.6.18.new/kernel/cpt/cpt_files.h

#define check_one_vfsmount(mnt) \
        (strcmp(mnt->mnt_sb->s_type->name, "rootfs") != 0 && \
         strcmp(mnt->mnt_sb->s_type->name, "vzfs") != 0 && \
         strcmp(mnt->mnt_sb->s_type->name, "ext3") != 0 && \
         strcmp(mnt->mnt_sb->s_type->name, "ext2") != 0 && \
         strcmp(mnt->mnt_sb->s_type->name, "simfs") != 0 && \
         strcmp(mnt->mnt_sb->s_type->name, "unionfs") != 0 && \
         strcmp(mnt->mnt_sb->s_type->name, "tmpfs") != 0 && \
         strcmp(mnt->mnt_sb->s_type->name, "devpts") != 0 && \
         strcmp(mnt->mnt_sb->s_type->name, "proc") != 0 && \
         strcmp(mnt->mnt_sb->s_type->name, "sysfs") != 0 && \
         strcmp(mnt->mnt_sb->s_type->name, "nfs") != 0 && \
         strcmp(mnt->mnt_sb->s_type->name, "binfmt_misc") != 0)

III). Set LDFLAGS(I tried to set in some experiments)
-bash-3.2$ sudo vim BUILD/ovzkernel-2.6.18.new/arch/x86_64/Makefile
LDFLAGS         := -m elf_x86_64 --build-id

IV). create the patch(patch can be reused. patch locates at
~/linux-2.6.18-nfs.patch)
-bash-3.2$ cd BUILD
-bash-3.2$ diff -uNrp ovzkernel-2.6.18.orig ovzkernel-2.6.18.new >
~/linux-2.6.18-openvz-nfs.patch


V). copy to $TOPDIR/SOURCE
-bash-3.2$ sudo cp ~/linux-2.6.18-openvz-nfs.patch SOURCES/


5). change kernel spec file.
sudo vim kernel-ovz.spec

I). add new patch into it.

Patch120000: linux-2.6.18-openvz-nfs.patch
# End VZ patches

II). add patch command

%patch110008 -p1

%patch120000 -p1
%endif

6). set LDFLAGS in cmd
-bash-3.2$ echo $LDFLAGS
--build-id
7). Rebuild kernel RPMs.
-bash-3.2$ sudo rpmbuild -bb --with baseonly --without debuginfo
--target=`uname -m` ./SPECS/kernel-ovz.spec
Building target platforms: x86_64
Building for target x86_64 
...

Without setting --build-id at
BUILD/ovzkernel-2.6.18.new/arch/x86_64/Makefile, the error is as following:
"extracting debug info from
/var/tmp/kernel-2.6.18-128.2.1.el5.emulab_openvz_migration-root/usr/src/kernels/2.6.18-128.2.1.el5.emulab_openvz_migration-x86_64/scripts/genksyms/genksyms
extracting debug info from
/var/tmp/kernel-2.6.18-128.2.1.el5.emulab_openvz_migration-root/lib/modules/2.6.18-128.2.1.el5.emulab_openvz_migration/kernel/lib/ts_kmp.ko
*** ERROR: No build ID note found in
/var/tmp/kernel-2.6.18-128.2.1.el5.emulab_openvz_migration-root/lib/modules/2.6.18-128.2.1.el5.emulab_openvz_migration/kernel/lib/ts_kmp.ko
xargs: stat: terminated by signal 13
error: Bad exit status from /var/tmp/rpm-tmp.5481 (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.5481 (%install)"

If I set --build-id at BUILD/ovzkernel-2.6.18.new/arch/x86_64/Makefile,
the error is as following:
ld: warning: Cannot create .note.gnu.build-id section, --build-id ignored.
ld: warning: Cannot create .note.gnu.build-id section, --build-id ignored.
/bin/sh: line 1: 11125 Segmentation fault      ld -m elf_x86_64 --build-id
-r -o drivers/i2c/built-in.o drivers/i2c/busses/built-in.o
drivers/i2c/chips/built-in.o drivers/i2c/algos/built-in.o
make[2]: *** [drivers/i2c/built-in.o] Error 139
make[1]: *** [drivers/i2c] Error 2
make[1]: *** Waiting for unfinished jobs....
ld: warning: Cannot create .note.gnu.build-id section, --build-id ignored.
ld: warning: Cannot create .note.gnu.build-id section, --build-id ignored.
ld: warning: Cannot create .note.gnu.build-id section, --build-id ignored.
make: *** [drivers] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.48864 (%build)

2). I also tried to add "%define _missing_build_ids_terminate_build 0" or
"%define debug_package %{nil}" at the top of SPECS/kernel-ovz.spec, but it
does not work and still reports "No BUILD ID" error.

3). If I tried to change $(LD) to $(CC) in /linux/Makefile(The top
Makefile in Linux source tree), but it reports lots of "undefined
reference" errors.
==
arch/x86_64/lib/lib.a(thunk.o): In function `__up_wakeup':
(.sched.text+0xdf): undefined reference to `__up'
/usr/lib64/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init':
(.text+0x1d): undefined reference to `__init_array_end'
/usr/lib64/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init':
(.text+0x4a): undefined reference to `__init_array_start'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtend.o: In function
`__do_global_ctors_aux':
crtstuff.c:(.text+0x6): relocation truncated to fit: R_X86_64_32 against
`.ctors'
collect2: ld returned 1 exit status

4). Add LDFLAGS+=--build-id in kernel-ovz.spec before %build and %install.
But it still reported "No BUILD ID" errors(If I remember correctly).


I really hope to receive any suggestions to solve this problem. Thanks for
your help.
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux