Can't compile own kerne; error: Bad exit status

Issues related to applications and software problems and general support
Post Reply
bryn1u
Posts: 40
Joined: 2010/04/09 15:38:07
Contact:

Can't compile own kerne; error: Bad exit status

Post by bryn1u » 2021/07/02 00:03:06

Hey guys,

Im trying to compile my own kernel based on Centos 8 Stream config. During compilation via "make -j8 rpm-pkg" command im getting some error:

Code: Select all


  AR      kernel/built-in.a
  CC [M]  kernel/kheaders.o
error: Bad exit status from /var/tmp/rpm-tmp.Ve4SVu (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.Ve4SVu (%build)
make[1]: *** [scripts/Makefile.package:59: rpm-pkg] Error 1
make: *** [Makefile:1549: rpm-pkg] Error 2
I cat /var/tmp/rpm-tmp.Ve4SVu

Code: Select all

make: *** [Makefile:1549: rpm-pkg] Error 2
[root@Proton linux-5.10.47]# cat /var/tmp/rpm-tmp.Ve4SVu
#!/bin/sh

  RPM_SOURCE_DIR="/usr/src/kernels/linux-5.10.47"
  RPM_BUILD_DIR="/root/rpmbuild/BUILD"
  RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection"
  RPM_LD_FLAGS="-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld"
  RPM_ARCH="x86_64"
  RPM_OS="linux"
  RPM_BUILD_NCPUS="8"
  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUS
  RPM_DOC_DIR="/usr/share/doc"
  export RPM_DOC_DIR
  RPM_PACKAGE_NAME="kernel"
  RPM_PACKAGE_VERSION="5.10.47"
  RPM_PACKAGE_RELEASE="1"
  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
  LANG=C
  export LANG
  unset CDPATH DISPLAY ||:
  RPM_BUILD_ROOT="/root/rpmbuild/BUILDROOT/kernel-5.10.47-1.x86_64"
  export RPM_BUILD_ROOT

  PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/lib64/pkgconfig:/usr/share/pkgconfig"
  export PKG_CONFIG_PATH
  CONFIG_SITE=${CONFIG_SITE:-NONE}
  export CONFIG_SITE
  PYTHON_DISALLOW_AMBIGUOUS_VERSION=warn
  export PYTHON_DISALLOW_AMBIGUOUS_VERSION

  set -x
  umask 022
  cd "/root/rpmbuild/BUILD"
cd 'kernel-5.10.47'
make  KBUILD_BUILD_VERSION=1


exit $?
[root@Proton linux-5.10.47]#
I found the 1549 line numer in Makefile:

Code: Select all

1543 # Packaging of the kernel to various formats
1544 # ---------------------------------------------------------------------------
1545
1546 %src-pkg: FORCE
1547         $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@
1548 %pkg: include/config/kernel.release FORCE
1549         $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@
1550
1551 # Brief documentation of the typical targets used
1552 # ---------------------------------------------------------------------------
1553
1554 boards := $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*_defconfig)
1555 boards := $(sort $(notdir $(boards)))
1556 board-dirs := $(dir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*/*_defconfig))
1557 board-dirs := $(sort $(notdir $(board-dirs:/=)))
1558
1559 PHONY += help
1560 help:
1561         @echo  'Cleaning targets:'
1562         @echo  '  clean           - Remove most generated files but keep the config and'
1563         @echo  '                    enough build support to build external modules'
1564         @echo  '  mrproper        - Remove all generated files + config + various backup files'
1565         @echo  '  distclean       - mrproper + remove editor backup and patch files'
1566         @echo  ''
1567         @echo  'Configuration targets:'
1568         @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help
Someone can help me understand what's wrong with this ? I tried on Fedora config and works without any problems.
Thanks !

Post Reply