[arch-general] kernel full compilation ?
hello, I need to introduce a small modification in linux-5.4.23/block/blk-core.o : do I need to recompile completely (~4 hours) or is there a way to shorten the compilation time ? I followed Kernel/Arch_Build_System <https://wiki.archlinux.org/index.php/Kernel/Arch_Build_System>. regards, lacsaP.
Em março 3, 2020 9:54 Pascal via arch-general escreveu:
hello,
I need to introduce a small modification in linux-5.4.23/block/blk-core.o : do I need to recompile completely (~4 hours) or is there a way to shorten the compilation time ?
I followed Kernel/Arch_Build_System <https://wiki.archlinux.org/index.php/Kernel/Arch_Build_System>.
regards, lacsaP.
If this is a bug, you might want to ask the linux-lts maintainer to include a patch for this. But, regardless of that, you'll have to compile it, yes. Regards, Giancarlo Razzolini
no, it's not a bug. it's necessary to recompile completely even if the kernel I'm using is the same as the one I want to apply a small modification on ? Le mar. 3 mars 2020 à 14:00, Giancarlo Razzolini <grazzolini@archlinux.org> a écrit :
hello,
I need to introduce a small modification in
Em março 3, 2020 9:54 Pascal via arch-general escreveu: linux-5.4.23/block/blk-core.o :
do I need to recompile completely (~4 hours) or is there a way to shorten the compilation time ?
I followed Kernel/Arch_Build_System <https://wiki.archlinux.org/index.php/Kernel/Arch_Build_System>.
regards, lacsaP.
If this is a bug, you might want to ask the linux-lts maintainer to include a patch for this. But, regardless of that, you'll have to compile it, yes.
Regards, Giancarlo Razzolini
Em março 3, 2020 10:04 Pascal escreveu:
it's necessary to recompile completely even if the kernel I'm using is the same as the one I want to apply a small modification on ?
Yes. The wonders of kernel development. Regards, Giancarlo Razzolini
Am 03.03.20 um 14:04 schrieb Pascal via arch-general:
no, it's not a bug.
it's necessary to recompile completely even if the kernel I'm using is the same as the one I want to apply a small modification on ?
You can take a look here: https://wiki.archlinux.org/index.php/Modprobed-db So you can compile the kernel only for the needed modules.
On Tue, Mar 3, 2020 at 4:06 PM Pascal via arch-general < arch-general@archlinux.org> wrote:
it's necessary to recompile completely even if the kernel I'm using is the same as the one I want to apply a small modification on ?
Yes. The only small consolation is that once you compile it once and have a source tree that has been fully built on your system, further small changes and re-compiles will go much faster because it will figure out _some_ of the things it doesn't need to do again. I the case of the kernel, it still won't be fast. Caleb
yes, I've just recompiled and this second time was much faster ! to be more precise, here is the very small modification made to the file mentioned above : --- src/linux-5.4.23/block/blk-core.c 2020-02-28 17:22:29.000000000 +0100 +++ /tmp/blk-core.c 2020-03-03 14:25:56.049803851 +0100 @@ -799,7 +799,7 @@ "to read-only block-device %s (partno %d)\n", bio_devname(bio, b), part->partno); /* Older lvm-tools actually trigger this */ - return false; + return true; } return false; Le mar. 3 mars 2020 à 14:19, Caleb Maclennan <caleb@alerque.com> a écrit :
On Tue, Mar 3, 2020 at 4:06 PM Pascal via arch-general < arch-general@archlinux.org> wrote:
it's necessary to recompile completely even if the kernel I'm using is the same as the one I want to apply a small modification on ?
Yes.
The only small consolation is that once you compile it once and have a source tree that has been fully built on your system, further small changes and re-compiles will go much faster because it will figure out _some_ of the things it doesn't need to do again. I the case of the kernel, it still won't be fast.
Caleb
On Tue, Mar 3, 2020 at 3:30 PM Pascal via arch-general <arch-general@archlinux.org> wrote:
yes, I've just recompiled and this second time was much faster !
to be more precise, here is the very small modification made to the file mentioned above :
--- src/linux-5.4.23/block/blk-core.c 2020-02-28 17:22:29.000000000 +0100 +++ /tmp/blk-core.c 2020-03-03 14:25:56.049803851 +0100 @@ -799,7 +799,7 @@ "to read-only block-device %s (partno %d)\n", bio_devname(bio, b), part->partno); /* Older lvm-tools actually trigger this */ - return false; + return true; }
return false;
Le mar. 3 mars 2020 à 14:19, Caleb Maclennan <caleb@alerque.com> a écrit :
On Tue, Mar 3, 2020 at 4:06 PM Pascal via arch-general < arch-general@archlinux.org> wrote:
it's necessary to recompile completely even if the kernel I'm using is the same as the one I want to apply a small modification on ?
Yes.
The only small consolation is that once you compile it once and have a source tree that has been fully built on your system, further small changes and re-compiles will go much faster because it will figure out _some_ of the things it doesn't need to do again. I the case of the kernel, it still won't be fast.
Caleb
You could just do: make M=block ;to rebuild the part of the kernel modified make ;to rebuild all other object files affected and to relink the kernel image from the root of your kernel source tree, followed by: make modules_install make install etc See http://files.kroah.com/lkn/lkn_pdf/ch04.pdf, Building Only a Portion of the Kernel.
On Tue, 2020-03-03 at 16:50 +0200, Alexander Kapshuk via arch-general wrote:
You could just do: make M=block ;to rebuild the part of the kernel modified make ;to rebuild all other object files affected and to relink the kernel image
from the root of your kernel source tree, followed by: make modules_install make install etc
See http://files.kroah.com/lkn/lkn_pdf/ch04.pdf, Building Only a Portion of the Kernel.
Please don't. This is completely unsupported. Filipe Laíns
moreover, this seems to only concern the modules, i.e. the parts external parts of the kernel, which is not the case with blk-core.c... Le mar. 3 mars 2020 à 23:56, Filipe Laíns via arch-general < arch-general@archlinux.org> a écrit :
On Tue, 2020-03-03 at 16:50 +0200, Alexander Kapshuk via arch-general wrote:
You could just do: make M=block ;to rebuild the part of the kernel modified make ;to rebuild all other object files affected and to relink the kernel image
from the root of your kernel source tree, followed by: make modules_install make install etc
See http://files.kroah.com/lkn/lkn_pdf/ch04.pdf, Building Only a Portion of the Kernel.
Please don't. This is completely unsupported.
Filipe Laíns
On Tue, 2020-03-03 at 14:29 +0100, Pascal via arch-general wrote:
yes, I've just recompiled and this second time was much faster !
to be more precise, here is the very small modification made to the file mentioned above :
--- src/linux-5.4.23/block/blk-core.c 2020-02-28 17:22:29.000000000 +0100 +++ /tmp/blk-core.c 2020-03-03 14:25:56.049803851 +0100 @@ -799,7 +799,7 @@ "to read-only block-device %s (partno %d)\n", bio_devname(bio, b), part->partno); /* Older lvm-tools actually trigger this */ - return false; + return true; }
This seems very wrong. Has this patch been upstreamed? Filipe Laíns
this is not a patch :-) this is only for testing (https://github.com/msuhanov/Linux-write-blocker) Pascal Le mar. 3 mars 2020 à 17:36, Filipe Laíns via arch-general < arch-general@archlinux.org> a écrit :
On Tue, 2020-03-03 at 14:29 +0100, Pascal via arch-general wrote:
yes, I've just recompiled and this second time was much faster !
to be more precise, here is the very small modification made to the file mentioned above :
--- src/linux-5.4.23/block/blk-core.c 2020-02-28 17:22:29.000000000 +0100 +++ /tmp/blk-core.c 2020-03-03 14:25:56.049803851 +0100 @@ -799,7 +799,7 @@ "to read-only block-device %s (partno %d)\n", bio_devname(bio, b), part->partno); /* Older lvm-tools actually trigger this */ - return false; + return true; }
This seems very wrong. Has this patch been upstreamed?
Filipe Laíns
On 3/3/20 8:04 AM, Pascal via arch-general wrote:
no, it's not a bug.
it's necessary to recompile completely even if the kernel I'm using is the same as the one I want to apply a small modification on ? It's necessary to recompile *software* completely, even if the one you're using is the same as the one you want to apply a small modification to.
The kernel is not special, it operates under the same rules as any other software project. ... IFF you do not want to modify the kernel, but you do want to modify one of its loadable plugins (modules in /lib/modules/......./*.ko) then you can get away with recompiling the plugin completely. This rule likewise applies universally to any software that makes use of loadable plugins. block/blk-core.o is not just for loadable modules though... -- Eli Schwartz Bug Wrangler and Trusted User
Check ccache, it may help with recompile time after the first compilation is done.
thank you for these details. regards, lacsaP. Le mar. 3 mars 2020 à 14:10, José Luis via arch-general < arch-general@archlinux.org> a écrit :
Check ccache, it may help with recompile time after the first compilation is done.
participants (8)
-
Alexander Kapshuk
-
Bjoern Franke
-
Caleb Maclennan
-
Eli Schwartz
-
Filipe Laíns
-
Giancarlo Razzolini
-
José Luis
-
Pascal