I ran into this error while building a liveCD with catalyst. I'm not sure if 3.11 is the first kernel to require bc or if it is needed for some of the recent stable kernels too. Reproducible: Always Portage 2.1.12.2 (unavailable, gcc-4.6.3, glibc-2.15-r3, 3.7.10 i686) ================================================================= System uname: Linux-3.7.10-i686-with-gentoo-2.2 Timestamp of tree: Unknown ld GNU ld (GNU Binutils) 2.23.1 dev-lang/python: 2.7.5::gentoo, 3.2.5-r1::gentoo sys-devel/autoconf: 2.69::gentoo sys-devel/automake: 1.11.6::gentoo, 1.12.6::gentoo sys-devel/binutils: 2.23.1::gentoo sys-devel/libtool: 2.4-r1::gentoo sys-kernel/linux-headers: 3.7::gentoo (virtual/os-headers) Repositories: x-portage x11 ACCEPT_LICENSE="* -@EULA" CFLAGS="-O2 -march=i686 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -march=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="bindist build" Unset: ACCEPT_KEYWORDS, EMERGE_DEFAULT_OPTS, PORTAGE_BUNZIP2_COMMAND
You should not be setting USE=build, that's reserved for boostrapping and causes the sys-devel/bc dependency to be dropped.
I did not realize that catalyst was setting this internally... this is wrong, I think. Here is kernel-2.eclass's RDEPEND: RDEPEND="!build? ( >=sys-libs/ncurses-5.2 sys-devel/make dev-lang/perl sys-devel/bc )" Luckily get by (in our 'genkernel all' call) without ncurses and perl, we already have make, and we got by without bc until kernel 3.9... so it hasn't really been an issue yet. USE=build obviously assumes that you will not build the kernel sources at all, which obviously won't work for catalyst livecd-stage2 target. IMHO the USE=build setting should just be removed from kmerge.sh, but that will end up bringing some other deps that may need to be cleaned up later. A quicker but dirtier fix would be to just make the sys-devel/bc dep non-conditional.
I've asked Tom to check if http://dev.gentoo.org/~mattst88/catalyst/dont-set-build-for-kernel-merges.patch solves the problem.
So this is why live-cd build has been failing for a while. I did a quick grep looking for USE="build", but failed to find this.
Matt- I just tried your patch against catalyst-9999, running "catalyst -f installcd-stage2-minimal.spec", while allowing unstable gentoo-sources-3.10.1. It went even better than I expected, the ONLY extra dep it pulls is sys-devel/bc, and the compile succeeds. ... emerge --quiet --usepkg --buildpkg --newuse gentoo-sources >>> Verifying ebuild manifests >>> Emerging (1 of 2) sys-devel/bc-1.06.95 >>> Installing (1 of 2) sys-devel/bc-1.06.95 >>> Emerging (2 of 2) sys-kernel/gentoo-sources-3.10.1 >>> Installing (2 of 2) sys-kernel/gentoo-sources-3.10.1 >>> Recording sys-kernel/gentoo-sources in "world" favorites file... ... * Linux Kernel 3.10.1-gentoo for x86_64... * .. with config file /var/tmp/gentoo.config * WARNING: No mounted /boot partition detected! * Run mount /boot to mount it! * kernel: Using config from /var/tmp/gentoo.config * kernel: >> Running mrproper... * >> Running oldconfig... * kernel: >> Cleaning... * >> Compiling 3.10.1-gentoo bzImage... * >> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)... * >> Compiling 3.10.1-gentoo modules... * >> Generating module dependency data... * Copying config for successful build to /etc/kernels/kernel-config-x86_64-3.10.1-gentoo
Thanks for testing, Ben. (I was going to wait for Tom to test, but Zero_Chaos wanted it sooner.)
I think we have another problem here, technically a different bug in the code, but it will manifest itself in the exact same way. On my above test, I had kerncache disabled in catalyst.conf, but if you enable kerncache then it passes --nodeps which again causes a failure due to missing bc. Here's the relevant lines from kmerge.sh: if [ -n "${clst_KERNCACHE}" ] then mkdir -p /tmp/kerncache/${clst_kname} clst_root_path=/tmp/kerncache/${clst_kname} PKGDIR=${PKGDIR} clst_myemergeopts="--quiet --nodeps --update --newuse" run_merge "${clst_ksource}" || exit 1 I don't believe --nodeps should be there at all. Having kerncache on does not guarantee that you will not need to build a kernel. Shouldn't the logic here check for a *usable* kernel cache tarball, and then either skip the sources emerge entirely, or emerge it fully with deps, depending on the result?
*** Bug 479460 has been marked as a duplicate of this bug. ***
This is a ten second fix, I agree with Ben. We can safely just drop --nodeps. Any other member of releng ack and I will do it, or consider this and ack and you do it.
This bug is about two bugs now, but the USE=build fix was wrong as well. It accidentally dropped livecd-stage2 use flags as well which caused build failures for me (and nearly a sanity failure since my spec fail wasn't being respected). I've fixed it in git, but the last release is bad.... we need to tag a .1 and pull the bad release, it's broken.
Matt acked me on irc, both of these are fixed.
I'm still getting the 'bc: command not found' build error when enabling kerncache, even with the latest catalyst code from git. It looks like bc is being installed to kerncache/default/livecd-stage2-i686-radeon.live/gentoo but not to the livecd-stage2 chroot.
Is this bug still blocking stabilization of 3.9 and later kernels? From the last comment, I don't think so; maints: Please remove the blocker. :)
This is still broken for catalyst with 'kerncache' turned on. I believe our x86/amd64 autobuild setups have this turned on, so it will be a major issue.
(In reply to Tom Wijsman (TomWij) from comment #13) > Is this bug still blocking stabilization of 3.9 and later kernels? > > From the last comment, I don't think so; maints: Please remove the blocker. > :) Tom, it seems for now we're unable to build kernels for install-cd with 3.9 and later kernels (due to the bc dep). I don't want us (releng) to block kernel stabilization, so if we can't get a patch for catalyst to make it work, we'll try adding bc to the stage1 deps to see if that fixes our build issues.
(In reply to Tom Stellard from comment #12) > I'm still getting the 'bc: command not found' build error when enabling > kerncache, even with the latest catalyst code from git. It looks like bc is > being installed to kerncache/default/livecd-stage2-i686-radeon.live/gentoo > but not to the livecd-stage2 chroot. you are using catalyst-9999, right?
This still affects catalyst-9999 for sure. If a user turns on kerncache, all the kernel build deps (including bc) are built within a kerncache chroot, but genkernel is not run from this same chroot. Seems to me like kerncache is quite broken.
*** Bug 340307 has been marked as a duplicate of this bug. ***
I believe I have found the cause of this issue. The patch below is a rough workaround but it explains the problem: From 75f23450ab55bbb48aba5a962b42441272562ec9 Mon Sep 17 00:00:00 2001 From: Ben Kohler <bkohler@gmail.com> Date: Wed, 11 Oct 2017 10:36:08 -0500 Subject: [PATCH] kmerge.sh: ensure bc is installed when kerncache is active When options=kerncache is on, catalyst finds cached kernel sources and generates a package.provided entry so these sources aren't reinstalled. However, this causes all RDEPEND in *-sources to be ignored. We at least need sys-devel/bc to be installed, even if *-sources is in package.provided. --- targets/support/kmerge.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh index fc066cc..7f78a27 100755 --- a/targets/support/kmerge.sh +++ b/targets/support/kmerge.sh @@ -220,7 +220,7 @@ then [ -L /usr/src/linux ] && rm -f /usr/src/linux - PKGDIR=${PKGDIR} clst_myemergeopts="--quiet --update --newuse" run_merge "${clst_ksource}" || exit 1 + PKGDIR=${PKGDIR} clst_myemergeopts="--quiet --update --newuse" run_merge "sys-devel/bc ${clst_ksource}" || exit 1 SOURCESDIR="/tmp/kerncache/${clst_kname}/sources" if [ -L /usr/src/linux ] -- 2.13.6
Perhaps a cleaner fix would be to "emerge --onlydeps ${clst_ksource}" just before package.provided is generated. Input welcome.
diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh index fc066cc..f29cd38 100755 --- a/targets/support/kmerge.sh +++ b/targets/support/kmerge.sh @@ -195,6 +195,10 @@ then fi fi + # install dependencies of kernel sources ahead of time in case + # package.provided generated below causes them not to be (re)installed + PKGDIR=${PKGDIR} clst_myemergeopts="--quiet --update --newuse --onlydeps" run_merge "${clst_ksource}" || exit 1 + # Create the kerncache directory if it doesn't exists mkdir -p /tmp/kerncache/${clst_kname} -- 2.13.6
https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d0d5260bc23edc1ef41fa0150767e9a4e848eb78