Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Could not find a Makefile in the kernel source direc[SOLVED]

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
dcljr
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 139
Joined: Sat Aug 20, 2005 6:53 pm
Location: Austin, TX

Could not find a Makefile in the kernel source direc[SOLVED]

  • Quote

Post by dcljr » Sat Jul 19, 2008 10:32 am

Okay, so this evening I emerge --sync'd and emerge -uD system'd, and python got updated from 2.4.4-r6 to 2.5.2-r5. So I python-updater'd and about 30 packages started compiling...

[edit]Forgot to mention, I updated my profile from 2006.1 to 2008.0 after sync'ing! I decided to emerge -uD first, instead of emerge -uDN, because the list of packages was much shorter... :)[/edit]

Midway through, gentoo-sources-2.6.25-r6 got emerged. Now, this is after 2.6.23-r8 was emerged on Feb 25th and 2.6.24-r8 on May 22nd -- both causing no apparent problems. I don't use the symlink USE flag, and have done nothing to upgrade from my current kernel, linux-2.6.18-gentoo-r6. (Old, I know. I don't like to configure kernels!)

Anyway, so a couple of packages after that, gnome-menus-2.20.3 died with the message:

Code: Select all

ERROR: setup
Could not find a Makefile in the kernel source directory.
Please ensure that /usr/src/linux points to a complete set of Linux sources

ERROR: gnome-base/gnome-menus-2.20.3 failed.
Call stack:
                  ebuild.sh, line   49:  Called pkg_setup
  gnome-menus-2.20.3.ebuild, line   30:  Called linux-info_pkg_setup
          linux-info.eclass, line  595:  Called die
The specific snippet of code:
  	get_version || die "Unable to calculate Linux Kernel version"
 The die message:
  Unable to calculate Linux Kernel version

If you need support, post the topmost build error, and the call stack if relevant.
A complete build log is located at '/var/log/portage/gnome-base:gnome-menus-2.20.3:20080719-090053.log'.
The ebuild environment file is located at '/var/tmp/portage/gnome-base/gnome-menus-2.20.3/temp/die.env'.


INFO: setup
Determining the location of the kernel source code
Found kernel source directory:
    /usr/src/linux
The symlink is pointing to the correct directory but, indeed, there is no Makefile in there. There's one in the most recent kernel directory, however (/usr/src/linux-2.6.25-gentoo-r6).

So, does this mean the previous Makefile gets removed when a new version of gentoo-sources is emerged? If so, why didn't the previous two emerges (in Feb and May) cause any problems? Because new versions of gnome-menus were emerged shortly after gentoo-sources both times. (In fact, gnome-menus-2.20.3 was only being re-emerged, since it was the version emerged right after gentoo-sources-2.6.24-r8 on May 22nd.)

More importantly, how can I fix this problem so I can finish updating to Python 2.5? I still have the .config file in /usr/src/linux-2.6.18-gentoo-r6. Can I just do a "null" make menuconfig and get the same Makefile that was there before? (Forgive my ignorance -- I never have gotten used to this whole make concept...)

And while we're at it, why should gnome-menus even need to find a Makefile in the kernel sources directory in the first place?

- dcljr
Last edited by dcljr on Thu Jul 24, 2008 1:04 am, edited 1 time in total.
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Sun Jul 20, 2008 8:32 am

dcljr wrote:So, does this mean the previous Makefile gets removed when a new version of gentoo-sources is emerged?
No.
dcljr wrote:More importantly, how can I fix this problem so I can finish updating to Python 2.5?
The easiest way would be to copy /var/db/pkg/sys-kernel/gentoo-sources-2.6.18-r6/gentoo-sources-2.6.18-r6.ebuild into a local overlay then emerge '=sys-kernel/gentoo-sources-2.6.18-r6', after making a backup of the .config file for insurance. Once the package has been installed again, it should be intact and building the kernel as specified in the .config should restore the source tree to a state fully consistent with the installed kernel. It would also be worthwhile to verify the integrity of the file system under which the source tree is stored.
dcljr wrote:I still have the .config file in /usr/src/linux-2.6.18-gentoo-r6. Can I just do a "null" make menuconfig and get the same Makefile that was there before? (Forgive my ignorance -- I never have gotten used to this whole make concept...)
It does not work that way, the .config file is generated as directed by the Makefile, the relationship is not commutative.

Edit: Corrected the path to the ebuild, it formerly lacked the leading /.
Last edited by desultory on Mon Jul 21, 2008 8:28 am, edited 1 time in total.
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

Re: Could not find a Makefile in the kernel source directory

  • Quote

Post by Hu » Sun Jul 20, 2008 4:23 pm

dcljr wrote: And while we're at it, why should gnome-menus even need to find a Makefile in the kernel sources directory in the first place?
- dcljr
=gnome-base/gnome-menus-2.20.3 inherits linux-info. It is linux-info that wants to find a Makefile. The ebuild uses linux-info for the purpose of checking whether you have inotify configured in the kernel. It appears that the ebuild does not have any legitimate need to find the Makefile. It is just an unfortunate side effect of how the eclass works.
Top
dcljr
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 139
Joined: Sat Aug 20, 2005 6:53 pm
Location: Austin, TX

  • Quote

Post by dcljr » Mon Jul 21, 2008 5:14 am

desultory wrote:
dcljr wrote:So, does this mean the previous Makefile gets removed when a new version of gentoo-sources is emerged?
No.
So why isn't it there? (rhetorical question... unless someone has an idea)
desultory wrote:The easiest way would be to copy var/db/pkg/sys-kernel/gentoo-sources-2.6.18-r6/gentoo-sources-2.6.18-r6.ebuild into a local overlay...
No can do. gentoo-sources-2.6.18-r6 isn't in the tree anymore, and since I've sync'd since it was dropped, I no longer have a copy of the ebuild.
Hu wrote:It is linux-info that wants to find a Makefile. The ebuild uses linux-info for the purpose of checking whether you have inotify configured in the kernel.
Surely there's a more robust way of checking that... Anyway, could I just "hardcode" that information into the gnome-menus-2.20.3 ebuild? :-)

It would be in this part:

Code: Select all

pkg_setup() {
	if use kernel_linux ; then
		CONFIG_CHECK="~INOTIFY"
		linux-info_pkg_setup
	fi

	G2CONF="${G2CONF}
		$(use_enable kernel_linux inotify)
		$(use_enable debug)
		$(use_enable python)"
}
Hmm... No clue.

Oh, well. I guess it's time to upgrade the kernel, anyway....

- dcljr
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Mon Jul 21, 2008 8:40 am

dcljr wrote:So why isn't it there? (rhetorical question... unless someone has an idea)
There are several possibilities, the package could have been removed, the Makefile could have been deleted deliberately or otherwise, there could have been some form of corruption of the file system or any or various other things could have happened to the file.
dcljr wrote:
desultory wrote:The easiest way would be to copy var/db/pkg/sys-kernel/gentoo-sources-2.6.18-r6/gentoo-sources-2.6.18-r6.ebuild into a local overlay...
No can do. gentoo-sources-2.6.18-r6 isn't in the tree anymore, and since I've sync'd since it was dropped, I no longer have a copy of the ebuild.
No, can do. Unless the package is no longer installed ion the system there should be a copy of the ebuild at the location I specified, though I neglected the leading / when I initially posted. Given the structure of the sys-kernel/gentoo-sources ebuilds, combining the available ebuild with the files which should still be in $DISTDIR should allow any arbitrary installed kernel to be reinstalled. Even if the package is not installed, there remain other sources for the necessary ebuild.
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Tue Jul 22, 2008 2:53 am

dcljr wrote:
Hu wrote:It is linux-info that wants to find a Makefile. The ebuild uses linux-info for the purpose of checking whether you have inotify configured in the kernel.
Surely there's a more robust way of checking that... Anyway, could I just "hardcode" that information into the gnome-menus-2.20.3 ebuild? :-)

It would be in this part:

Code: Select all

pkg_setup() {
	if use kernel_linux ; then
		CONFIG_CHECK="~INOTIFY"
		linux-info_pkg_setup
	fi

	G2CONF="${G2CONF}
		$(use_enable kernel_linux inotify)
		$(use_enable debug)
		$(use_enable python)"
}
Hmm... No clue.

Oh, well. I guess it's time to upgrade the kernel, anyway....

- dcljr
There may be more robust ways. I did not study the eclass in sufficient detail to criticize whether the current way is the best way.

Yes, you could just hack the ebuild. Remove the entire if block to remove the dependency on linux-info.eclass. That said, I have not tested this modification. Other things could break, but if anything fails, it will probably be reasonably obvious whether it is related to your change. For what it is worth, I doubt there will be problems.
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Tue Jul 22, 2008 2:57 am

[post=5158577]Fixing[/post] the problem is both faster and easier than trying to work around it.
Top
dcljr
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 139
Joined: Sat Aug 20, 2005 6:53 pm
Location: Austin, TX

  • Quote

Post by dcljr » Thu Jul 24, 2008 1:03 am

desultory wrote:There are several possibilities, the package could have been removed
Well, looky there:

Code: Select all

1211505536: Started emerge on: May 22, 2008 20:18:56
1211505536:  *** emerge --quiet depclean
1211505536:  >>> depclean
1211505543: === Unmerging... (sys-kernel/gentoo-sources-2.6.23-r8)
1211505572:  >>> unmerge success: sys-kernel/gentoo-sources-2.6.23-r8
1211505572: === Unmerging... (sys-kernel/gentoo-sources-2.6.18-r6)
1211505592:  >>> unmerge success: sys-kernel/gentoo-sources-2.6.18-r6
And that's the only time I've ever (accidentally) done a quiet depclean! Sigh...

Anyway, as I said before, I guess it's time to upgrade the damn kernel, anyway.... :)

Thanks to all for the replies.

- dcljr
Top
Post Reply

8 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic