Re-building Linux kernel without “clean”

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
9
down vote

favorite
2












I'm building a custom kernel based off 4.11 (for Mintx64, if it matters). I've already compiled and installed it to prove that it works. Now I've made a few small changes to a couple of files (in the driver and net subsystems, this is why I need to compile a custom kernel in the first place!)



Now I want to build the modified kernel. However when I run



fakeroot make -j5 deb-pkg LOCALVERSION=myname KDEB_PKGVERSION=1 


The build system appears to start by "clean"-ing a whole load of stuff, so I stopped it quickly. Unfortunately the computer I'm using is not blessed with a good CPU and takes many hours to build from scratch. Therefore I'd rather avoid doing it again if possible!



Is it possible to make just an incremental build without everything be "clean"d or is this a requirement of the kernel build system?



The output I got was:



CHK include/config/kernel.release
make clean
CLEAN .
CLEAN arch/x86/lib
...









share|improve this question























  • @jc__ see output from build above, I can't immediately find where the makefile for that target is, but I'm still looking :)
    – T Kilney
    Jun 2 '17 at 19:28














up vote
9
down vote

favorite
2












I'm building a custom kernel based off 4.11 (for Mintx64, if it matters). I've already compiled and installed it to prove that it works. Now I've made a few small changes to a couple of files (in the driver and net subsystems, this is why I need to compile a custom kernel in the first place!)



Now I want to build the modified kernel. However when I run



fakeroot make -j5 deb-pkg LOCALVERSION=myname KDEB_PKGVERSION=1 


The build system appears to start by "clean"-ing a whole load of stuff, so I stopped it quickly. Unfortunately the computer I'm using is not blessed with a good CPU and takes many hours to build from scratch. Therefore I'd rather avoid doing it again if possible!



Is it possible to make just an incremental build without everything be "clean"d or is this a requirement of the kernel build system?



The output I got was:



CHK include/config/kernel.release
make clean
CLEAN .
CLEAN arch/x86/lib
...









share|improve this question























  • @jc__ see output from build above, I can't immediately find where the makefile for that target is, but I'm still looking :)
    – T Kilney
    Jun 2 '17 at 19:28












up vote
9
down vote

favorite
2









up vote
9
down vote

favorite
2






2





I'm building a custom kernel based off 4.11 (for Mintx64, if it matters). I've already compiled and installed it to prove that it works. Now I've made a few small changes to a couple of files (in the driver and net subsystems, this is why I need to compile a custom kernel in the first place!)



Now I want to build the modified kernel. However when I run



fakeroot make -j5 deb-pkg LOCALVERSION=myname KDEB_PKGVERSION=1 


The build system appears to start by "clean"-ing a whole load of stuff, so I stopped it quickly. Unfortunately the computer I'm using is not blessed with a good CPU and takes many hours to build from scratch. Therefore I'd rather avoid doing it again if possible!



Is it possible to make just an incremental build without everything be "clean"d or is this a requirement of the kernel build system?



The output I got was:



CHK include/config/kernel.release
make clean
CLEAN .
CLEAN arch/x86/lib
...









share|improve this question















I'm building a custom kernel based off 4.11 (for Mintx64, if it matters). I've already compiled and installed it to prove that it works. Now I've made a few small changes to a couple of files (in the driver and net subsystems, this is why I need to compile a custom kernel in the first place!)



Now I want to build the modified kernel. However when I run



fakeroot make -j5 deb-pkg LOCALVERSION=myname KDEB_PKGVERSION=1 


The build system appears to start by "clean"-ing a whole load of stuff, so I stopped it quickly. Unfortunately the computer I'm using is not blessed with a good CPU and takes many hours to build from scratch. Therefore I'd rather avoid doing it again if possible!



Is it possible to make just an incremental build without everything be "clean"d or is this a requirement of the kernel build system?



The output I got was:



CHK include/config/kernel.release
make clean
CLEAN .
CLEAN arch/x86/lib
...






linux-mint kernel compiling






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 13 mins ago









Rui F Ribeiro

37.3k1374118




37.3k1374118










asked Jun 2 '17 at 19:03









T Kilney

585




585











  • @jc__ see output from build above, I can't immediately find where the makefile for that target is, but I'm still looking :)
    – T Kilney
    Jun 2 '17 at 19:28
















  • @jc__ see output from build above, I can't immediately find where the makefile for that target is, but I'm still looking :)
    – T Kilney
    Jun 2 '17 at 19:28















@jc__ see output from build above, I can't immediately find where the makefile for that target is, but I'm still looking :)
– T Kilney
Jun 2 '17 at 19:28




@jc__ see output from build above, I can't immediately find where the makefile for that target is, but I'm still looking :)
– T Kilney
Jun 2 '17 at 19:28










3 Answers
3






active

oldest

votes

















up vote
7
down vote



accepted










The make clean is only for the deb-pkg target. Take a look at scripts/package/Makefile:



deb-pkg: FORCE
$(MAKE) clean
$(call cmd,src_tar,$(KDEB_SOURCENAME))
$(MAKE) KBUILD_SRC=
+$(call cmd,builddeb)

bindeb-pkg: FORCE
$(MAKE) KBUILD_SRC=
+$(call cmd,builddeb)


If you build the bindeb-pkg instead, it won't do a clean. You probably don't need the source packages anyway.



I suspect it does a clean because it doesn't want to tar up build artifacts in the source tarball.






share|improve this answer



























    up vote
    2
    down vote













    You could try producing those deb packages with a different tool, make-kpkg that is installed by apt-get install kernel-package. Then for example



    make-kpkg --rootcmd=fakeroot --initrd --uc --us -j2 kernel_image kernel_headers


    This command should not do a make clean each time.






    share|improve this answer



























      up vote
      1
      down vote













      I fixed this by going into the makefile for the deb-pkg command and removing "make clean" from the script. This did not seem to cause any ill effects with the build and I have been running the custom kernel for a week or two now without problems. YMMV!






      share|improve this answer




















        Your Answer







        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "106"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        convertImagesToLinks: false,
        noModals: false,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













         

        draft saved


        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f368864%2fre-building-linux-kernel-without-clean%23new-answer', 'question_page');

        );

        Post as a guest






























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        7
        down vote



        accepted










        The make clean is only for the deb-pkg target. Take a look at scripts/package/Makefile:



        deb-pkg: FORCE
        $(MAKE) clean
        $(call cmd,src_tar,$(KDEB_SOURCENAME))
        $(MAKE) KBUILD_SRC=
        +$(call cmd,builddeb)

        bindeb-pkg: FORCE
        $(MAKE) KBUILD_SRC=
        +$(call cmd,builddeb)


        If you build the bindeb-pkg instead, it won't do a clean. You probably don't need the source packages anyway.



        I suspect it does a clean because it doesn't want to tar up build artifacts in the source tarball.






        share|improve this answer
























          up vote
          7
          down vote



          accepted










          The make clean is only for the deb-pkg target. Take a look at scripts/package/Makefile:



          deb-pkg: FORCE
          $(MAKE) clean
          $(call cmd,src_tar,$(KDEB_SOURCENAME))
          $(MAKE) KBUILD_SRC=
          +$(call cmd,builddeb)

          bindeb-pkg: FORCE
          $(MAKE) KBUILD_SRC=
          +$(call cmd,builddeb)


          If you build the bindeb-pkg instead, it won't do a clean. You probably don't need the source packages anyway.



          I suspect it does a clean because it doesn't want to tar up build artifacts in the source tarball.






          share|improve this answer






















            up vote
            7
            down vote



            accepted







            up vote
            7
            down vote



            accepted






            The make clean is only for the deb-pkg target. Take a look at scripts/package/Makefile:



            deb-pkg: FORCE
            $(MAKE) clean
            $(call cmd,src_tar,$(KDEB_SOURCENAME))
            $(MAKE) KBUILD_SRC=
            +$(call cmd,builddeb)

            bindeb-pkg: FORCE
            $(MAKE) KBUILD_SRC=
            +$(call cmd,builddeb)


            If you build the bindeb-pkg instead, it won't do a clean. You probably don't need the source packages anyway.



            I suspect it does a clean because it doesn't want to tar up build artifacts in the source tarball.






            share|improve this answer












            The make clean is only for the deb-pkg target. Take a look at scripts/package/Makefile:



            deb-pkg: FORCE
            $(MAKE) clean
            $(call cmd,src_tar,$(KDEB_SOURCENAME))
            $(MAKE) KBUILD_SRC=
            +$(call cmd,builddeb)

            bindeb-pkg: FORCE
            $(MAKE) KBUILD_SRC=
            +$(call cmd,builddeb)


            If you build the bindeb-pkg instead, it won't do a clean. You probably don't need the source packages anyway.



            I suspect it does a clean because it doesn't want to tar up build artifacts in the source tarball.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 13 at 21:47









            RawwrBag

            18613




            18613






















                up vote
                2
                down vote













                You could try producing those deb packages with a different tool, make-kpkg that is installed by apt-get install kernel-package. Then for example



                make-kpkg --rootcmd=fakeroot --initrd --uc --us -j2 kernel_image kernel_headers


                This command should not do a make clean each time.






                share|improve this answer
























                  up vote
                  2
                  down vote













                  You could try producing those deb packages with a different tool, make-kpkg that is installed by apt-get install kernel-package. Then for example



                  make-kpkg --rootcmd=fakeroot --initrd --uc --us -j2 kernel_image kernel_headers


                  This command should not do a make clean each time.






                  share|improve this answer






















                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    You could try producing those deb packages with a different tool, make-kpkg that is installed by apt-get install kernel-package. Then for example



                    make-kpkg --rootcmd=fakeroot --initrd --uc --us -j2 kernel_image kernel_headers


                    This command should not do a make clean each time.






                    share|improve this answer












                    You could try producing those deb packages with a different tool, make-kpkg that is installed by apt-get install kernel-package. Then for example



                    make-kpkg --rootcmd=fakeroot --initrd --uc --us -j2 kernel_image kernel_headers


                    This command should not do a make clean each time.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jun 2 '17 at 20:58









                    J.J. Hakala

                    1766




                    1766




















                        up vote
                        1
                        down vote













                        I fixed this by going into the makefile for the deb-pkg command and removing "make clean" from the script. This did not seem to cause any ill effects with the build and I have been running the custom kernel for a week or two now without problems. YMMV!






                        share|improve this answer
























                          up vote
                          1
                          down vote













                          I fixed this by going into the makefile for the deb-pkg command and removing "make clean" from the script. This did not seem to cause any ill effects with the build and I have been running the custom kernel for a week or two now without problems. YMMV!






                          share|improve this answer






















                            up vote
                            1
                            down vote










                            up vote
                            1
                            down vote









                            I fixed this by going into the makefile for the deb-pkg command and removing "make clean" from the script. This did not seem to cause any ill effects with the build and I have been running the custom kernel for a week or two now without problems. YMMV!






                            share|improve this answer












                            I fixed this by going into the makefile for the deb-pkg command and removing "make clean" from the script. This did not seem to cause any ill effects with the build and I have been running the custom kernel for a week or two now without problems. YMMV!







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jun 20 '17 at 9:15









                            T Kilney

                            585




                            585



























                                 

                                draft saved


                                draft discarded















































                                 


                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f368864%2fre-building-linux-kernel-without-clean%23new-answer', 'question_page');

                                );

                                Post as a guest













































































                                Popular posts from this blog

                                How to check contact read email or not when send email to Individual?

                                Bahrain

                                Postfix configuration issue with fips on centos 7; mailgun relay