Skip to content

[build] Fix kdump build failure (Fixes 5097 17023)#22553

Merged
lguohan merged 1 commit intosonic-net:masterfrom
jusherma:kdump-build-failure
May 30, 2025
Merged

[build] Fix kdump build failure (Fixes 5097 17023)#22553
lguohan merged 1 commit intosonic-net:masterfrom
jusherma:kdump-build-failure

Conversation

@jusherma
Copy link
Contributor

@jusherma jusherma commented May 7, 2025

Why I did it

The build fails if kdump is enabled on the build host, even though the relevant build step is performed in a dockerized chroot.

+ sudo LANG=C chroot ./fsroot-cisco-8000 kdump-config symlinks 5.10.0-23-2-amd64
Cannot change symbolic links when kdump is loaded ... failed!

Fixes #5097, Fixes #17023

Work item tracking
  • Microsoft ADO (number only):

How I did it

kdump installation checks if kdump is already running and aborts if so. This is good in most cases, but it's not relevant when installing into a chroot inside a docker container. This adds a basic patch to disable this check during build.

Note that the kdump status of the build host is imported into the docker build container via the sysfs file system:

$ ls -id /sys/kernel/kexec_crash_loaded && cat /sys/kernel/kexec_crash_loaded
7824 /sys/kernel/kexec_crash_loaded
0

$ docker run --rm debian bash -c "ls -id /sys/kernel/kexec_crash_loaded && cat /sys/kernel/kexec_crash_loaded"
7824 /sys/kernel/kexec_crash_loaded
0

The inodes and file content are identical inside and outside of the container.

How to verify it

  1. Enable kdump on the build host
  2. Confirm baseline build fails with the "Cannot change symbolic links when kdump is loaded" error
  3. Apply this change and build succeeds

Which release branch to backport (provide reason below if selected)

  • 202405
  • 202411
  • 202505

Tested branch (Please provide the tested image version)

master (2975205)

Description for the changelog

[build] fix build failure on kdump-enabled hosts

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@jusherma jusherma requested a review from lguohan as a code owner May 7, 2025 06:05
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liushilongbuaa
Copy link
Contributor

/azpw ms_conflict

@jusherma
Copy link
Contributor Author

jusherma commented May 9, 2025

@lguohan could you please take a look? The change is very small

@qiluo-msft qiluo-msft requested a review from saiarcot895 May 19, 2025 22:56
@jusherma
Copy link
Contributor Author

@saiarcot895 @qiluo-msft can you please review? The change is only 17 LOC and the PR has been pending for a few weeks now

@saiarcot895
Copy link
Contributor

Can you modify the description to add Fixes #5097, Fixes #17023? That way, Github will link this PR to those issues and automatically close it when it gets merged.

Copy link
Contributor

@saiarcot895 saiarcot895 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending description change.

The workaround here will be good enough for SONiC's use cases.

@jusherma
Copy link
Contributor Author

Approved pending description change.

The workaround here will be good enough for SONiC's use cases.

Thanks. Just updated description as requested

@qiluo-msft qiluo-msft enabled auto-merge (squash) May 21, 2025 23:37
@jusherma
Copy link
Contributor Author

@lguohan @saiarcot895 has approved. It looks like your approval is needed for merge. Can you please approve

@qiluo-msft
Copy link
Collaborator

Please check kvmtest-t0-sonic failure.

@jusherma
Copy link
Contributor Author

Please check kvmtest-t0-sonic failure.

@qiluo-msft Looks like Azure Pipelines cleared the logs from that run as they're over two weeks old, so I can't see any details.

Also, is this test stable in baseline? I see it failing on some recent commits to master (for example: c19ece7)

Lastly, what does this test check? This change should only impact build.

@lguohan lguohan disabled auto-merge May 30, 2025 00:39
@lguohan lguohan merged commit 7088105 into sonic-net:master May 30, 2025
17 of 19 checks passed
@jusherma
Copy link
Contributor Author

Thanks @lguohan. Can this fix also be double committed into 202405, 202411 and 202505 please?

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202505: #22843

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202505: #22894

@jusherma
Copy link
Contributor Author

jusherma commented Jun 10, 2025

@kperumalbfn can you help get this approved/committed to 202405 as well?

@jusherma jusherma deleted the kdump-build-failure branch June 13, 2025 00:32
@jusherma
Copy link
Contributor Author

@kperumalbfn can you help get this approved/committed to 202405 as well?

Gentle reminder

@jusherma
Copy link
Contributor Author

@yejianquan can you please help get this commited to 202405? It's been pending for two weeks now

@yejianquan
Copy link
Contributor

@yejianquan can you please help get this commited to 202405? It's been pending for two weeks now

Hi @jusherma 202405 release manager is @bingwang-ms

@jusherma
Copy link
Contributor Author

@yejianquan can you please help get this commited to 202405? It's been pending for two weeks now

Hi @jusherma 202405 release manager is @bingwang-ms

@bingwang-ms Can you please help get this committed to 202405? This is a small build fix and already merged to master

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202411: #23035

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Jun 22, 2025
Fix sonic-net#5097, Fix sonic-net#17023

Why I did it
The build fails if kdump is enabled on the build host, even though the relevant build step is performed in a dockerized chroot.

+ sudo LANG=C chroot ./fsroot-cisco-8000 kdump-config symlinks 5.10.0-23-2-amd64
Cannot change symbolic links when kdump is loaded ... failed!

How I did it
kdump installation checks if kdump is already running and aborts if so. This is good in most cases, but it's not relevant when installing into a chroot inside a docker container. This adds a basic patch to disable this check during build.

Note that the kdump status of the build host is imported into the docker build container via the sysfs file system:

$ ls -id /sys/kernel/kexec_crash_loaded && cat /sys/kernel/kexec_crash_loaded
7824 /sys/kernel/kexec_crash_loaded
0

$ docker run --rm debian bash -c "ls -id /sys/kernel/kexec_crash_loaded && cat /sys/kernel/kexec_crash_loaded"
7824 /sys/kernel/kexec_crash_loaded
0
The inodes and file content are identical inside and outside of the container.

How to verify it
Enable kdump on the build host
Confirm baseline build fails with the "Cannot change symbolic links when kdump is loaded" error
Apply this change and build succeeds
@jusherma
Copy link
Contributor Author

@yejianquan can you please help get this commited to 202405? It's been pending for two weeks now

Hi @jusherma 202405 release manager is @bingwang-ms

@bingwang-ms Can you please help get this committed to 202405? This is a small build fix and already merged to master

@bingwang-ms Gentle reminder

@rlhui
Copy link
Contributor

rlhui commented Jul 9, 2025

@abdosi please help check if we'll back port this to msft-202405 or not needed

@jusherma
Copy link
Contributor Author

jusherma commented Aug 7, 2025

@bingwang-ms @abdosi This is now double committed to 202505 and 202411. Can you please help double commit this build fix to 202405?

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #23648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment