Score:0

Cannot compile Ubuntu kernel for AMD64 from GIT source

it flag

I need to test a LKM using several old kernel versions which I have to take from GIT.

Based on the Ubuntu wiki pages BuildYourOwnKernel and KernelGitGuide I'm following the below recipe:

$ git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/<series> <series>
$ cd <series>
$ git tag -l Ubuntu-*
$ git checkout Ubuntu-v.w.x-y.z
$ LANG=C fakeroot debian/rules clean
$ LANG=C fakeroot debian/rules binary-headers binary-generic binary-perarch

That worked with many kernel versions I tested, including older than Ubuntu-2.6.32-418.35. However, I hit the following weird error.

$ dpkg --print-architecture
amd64

$ git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/maverick maverick

$ cd maverick

$ git tag -l Ubuntu-2.6.32-418.35*
Ubuntu-2.6.32-418.35

$ git checkout Ubuntu-2.6.32-418.35

$ LANG=C fakeroot debian/rules clean

$ LANG=C fakeroot debian/rules binary-headers binary-generic binary-perarch
...
dpkg-gencontrol: error: current host architecture 'amd64' does not appear in package's architecture list (armel)

See log for the full output and extra system info.

I have some questions:

  • Are the git Ubuntu-v.w.x-y.z tags limited to one/some specific arch/s? In this case, it seems the Ubuntu-2.6.32-418.35 tag only supports armel.
  • If so, is there a way to know beforehand which Ubuntu-v.w.x-y.z tags support amd64?
  • Is there a way to change the kernel configuration to compile Ubuntu-2.6.32-418.35 for amd64. I tried to LANG=C fakeroot debian/rules editconfigs but it looks like the arm config and in the system list there is no i386/amd64. There is no a .config file in the root directory, no sure what's the right way to do that when you compile a kernel using debian/rules. Is there a way to change it for the x86 config? how?

Thanks

paladin avatar
kr flag
`dpkg-gencontrol: error: current host architecture 'amd64' does not appear in package's architecture list (armel)`, you have downloaded the wrong source code (you need amd64 source code, and not armel source code).
David avatar
cn flag
Also note theses old kernels are not used on any current supported version of Ubuntu and therefore are off topic here.
it flag
@David unsupported.. what? :) This is NOT the Ubuntu ticket system and this is definitely NOT a bug report. I'm (obviously) doing something wrong here and that's why I'm asking for help
it flag
@paladin download the wrong source code? Can you please elaborate this?. AFAIK there are no such thing like the "amd64" source code. What do you mean with that? In the Linux kernel, all the architectures are in the same source code.
paladin avatar
kr flag
Dear @Tavo, the low level (i. e. assembler) kernel programming is different for each CPU architecture. So you need to use the correct source code for your CPU architecture. Please take a look here -> https://github.com/torvalds/linux/tree/master/arch
it flag
@paladin, nope... that's already in the kernel source tree. You don't have to download anything else. If you follow the link I'm using above to clone the repo, you will find the arch directory with all the architectures. See https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/maverick/tree/arch .In `x86` is the code for both 32bit and 64bit. A mainline kernel takes the arch from the .config. But when you compile the kernel the Ubuntu/Debian way, as this post is about, that changes
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.