Building custom ubuntu xenial kernel

Juerg Haefliger juerg.haefliger at canonical.com
Tue Mar 5 18:21:04 UTC 2019


On Mon, 4 Mar 2019 12:20:51 -0800
Yihua Fang <fang.yihua.eric at gmail.com> wrote:

> Thanks a lot for answering. Answers inline.
> On Sun, Mar 3, 2019 at 11:47 PM Juerg Haefliger <
> juerg.haefliger at canonical.com> wrote:  
> 
> > On Fri, 15 Feb 2019 14:49:05 -0800
> > Yihua Fang <fang.yihua.eric at gmail.com> wrote:
> >  
> > > Hi,
> > >
> > > I am new to building the ubuntu kernel. I have found numerous tutorial
> > > online, but may are deprecated or offers only part of the information.
> > >
> > > I am trying to build a ubuntu kernel with edits to some of Kconfig and
> > > add/remove some drivers. I mostly  
> >
> > Mostly? where did you deviate from the instructions?
> >  
> 
> After a success build, I tried clean, editconfigs, then build. I also tried
> genconfigs instead of editconfigs. Both didn't pick up the changed Kconfig.
> Maybe it's because I only changed the default value?

genconfigs just generates the configs and puts them in CONFIGS/. You want
to use editconfigs. What does 'git status' show after you ran that? It should
show modified files under debian.master/config.


> 
> >  
> > > followed this instruction (
> > > https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel). It builds .deb
> > > successfully for the stock source code, however it will not pick up my
> > > changes to Kconfigs.  
> >
> > Hard to tell what's going on without more data. Can post the build logs and
> > the steps your taking?
> >  
> 
> >  
> > > Also, I seems to need to run `fakeroot debian/rules clean` on every  
> > build,  
> > > or the build system complaint certain directory are already created. This
> > > takes quite a while to rebuild each time, so I wonder if there is a  
> > faster  
> > > compile cycle?  
> >
> > I think you do want to start clean. How long is 'quite a while'?
> >  
> 
> If I don't run `fakeroot debian/rules clean` everytime, the build returns:
> """
> mv: cannot move
> '/home/yfang/default/kernel/ubuntu/ubuntu-xenial/debian/linux-modules-4.15.0-46-generic/lib/modules/4.15.0-46-generic/kernel'
> to
> '/home/yfang/default/kernel/ubuntu/ubuntu-xenial/debian/linux-modules-extra-4.15.0-46-generic/lib/modules/4.15.0-46-generic/kernel/kernel':
> Directory not empty
> debian/rules.d/2-binary-arch.mk:123: recipe for target 'install-generic'
> failed
> """
> I tried to remove these directory manually but there are a lot more.

Well yes. We build out of tree and the build fails if the build directory is
polluted.


> This
> leads me to believe there is a faster way of building the kernel in tree
> and incrementally for development purposes.

Not officially, no. You can build in-tree using the kernel's Makefile rather
than debian/rules but the result is then no longer an Ubuntu kernel.


> A clean build on the mainline kernel on the same machine takes about 6-8 minutes
> where as a clean build
> with `fakeroot debian/rule binary-generic binary-headers` takes a good
> 20-30 minutes each time.

Hmm... I ran some tests and also see a rather large delta. Will try to figure
out what's going on.

...Juerg

> 
> >
> > ...Juerg
> >
> >  
> > > Thanks a lot in advance.
> > > Eric  
> >
> >  

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20190305/7b9988ce/attachment-0001.sig>


More information about the kernel-team mailing list