-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide an option to rebuild the kernel without downloading it again #104
base: master
Are you sure you want to change the base?
Conversation
Normally, rebuilding the kernel involves removing the previously built kernel source tree, downloading the stock kernel, applying all the SONiC patches, and compiling the kernel and the kernel modules. In a development environment, you might want to skip downloading the kernel and applying all the patches, and just rebuild the kernel. This option is enabled by setting the value for DEFAULT_KERNEL_PROCURE_METHOD to "incremental" in the rules/config file. Procedure to rebuild the kernel: make target/debs/stretch/linux-headers-4.9.0-9-2-common_4.9.168-1+deb9u5_all.deb-clean make target/debs/stretch/linux-headers-4.9.0-9-2-common_4.9.168-1+deb9u5_all.deb You can then upload and install the kernel archive in the switch: target/debs/stretch/linux-image-4.9.0-9-2-amd64_4.9.168-1+deb9u5_amd64.deb
Can anybody take a look at this PR? |
@olivier-singla sorry for the delay. What if the incremental change was to either (or combination of):
Will this change still build kernel as expected? |
@yxieca The patches are applied only once when the directory linux-4.9.168 is not detected. Next builds will just rebuild the kernel. To make advantage of the incremental kernel procure method, I would advise to first apply the patches manually, and then build the kernel (with make target/debs/stretch/linux-headers-4.9.0-9-2-common_4.9.168-1+deb9u5_all.deb). That would save a significant amount of time. Once your patches are finalized you can then delete the linux directory and start a full build for verification. |
@olivier-singla Sorry I think you took my question to an unintended direction. I was saying that the incremental build should have the capability of detecting rebuild is needed when new patch is applied. Otherwise incremental build will miss any newly added/changed/deleted patches. |
retest this please |
How that would be useful? |
|
||
ifneq ($(INCR_BUILD),) | ||
# Force kernel build | ||
rm -f debian/stamps/build_amd64_none_amd64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this incremetal build, it looks like we are not re-applying the patch series. what if the developer add a new kernel patch? Can you do stg pop and then re-apply all the patches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The theory is that, the user will first try the patch by directly applying the changes to the staged repo "sonic-linux-kernel/linux-4.9.189". Re-build, test the image. In fact, to create the patch itself, the staged repo "sonic-linux-kernel/linux-4.9.189" shall be used and when all change set is ready the patches are moved to the patch directory and series file updated. The staged repo is transient in nature till the point patches are tried manually, tested and finalized.
Normally, rebuilding the kernel involves removing the previously built kernel source tree, downloading the stock kernel, applying all the SONiC patches, and compiling the kernel and the kernel modules. In a development environment, you might want to skip downloading the kernel and applying all the patches, and just rebuild the kernel. This option is enabled by setting the value for DEFAULT_KERNEL_PROCURE_METHOD to "incremental" in the rules/config file. Procedure to rebuild the kernel: make target/debs/stretch/linux-headers-4.9.0-9-2-common_4.9.168-1+deb9u5_all.deb-clean make target/debs/stretch/linux-headers-4.9.0-9-2-common_4.9.168-1+deb9u5_all.deb You can then upload and install the kernel archive in the switch: target/debs/stretch/linux-image-4.9.0-9-2-amd64_4.9.168-1+deb9u5_amd64.deb
/easycla |
|
Normally, rebuilding the kernel involves removing the previously built kernel
source tree, downloading the stock kernel, applying all the SONiC patches,
and compiling the kernel and the kernel modules. In a development environment,
you might want to skip downloading the kernel and applying all the patches,
and just rebuild the kernel. This option is enabled by setting the value for
DEFAULT_KERNEL_PROCURE_METHOD to "incremental" in the rules/config file.
Procedure to rebuild the kernel:
make target/debs/stretch/linux-headers-4.9.0-9-2-common_4.9.168-1+deb9u5_all.deb-clean
make target/debs/stretch/linux-headers-4.9.0-9-2-common_4.9.168-1+deb9u5_all.deb
You can then upload and install the kernel archive in the switch:
target/debs/stretch/linux-image-4.9.0-9-2-amd64_4.9.168-1+deb9u5_amd64.deb