Skip to content

Image Customizer: clean the /boot folder selectively if keepKdumpBootFiles is specified #296

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gmileka
Copy link
Contributor

@gmileka gmileka commented Jun 27, 2025

Clean the /boot folder selectively if keepKdumpBootFiles is specified.

If set to true, the Image Customizer tool will not delete any kdump files found under the boot folder on the full OS image. The kdump files include:

  • a crashdump initramfs image named initramfs-<kernel-version>kdump.img.
  • a kernel named vmlinuz-<kernel-version> - where its version matches that of the initramfs-<kernel-version>kdump.img.

The default is false.

Note that by default, the Image Customizer tool removes the /boot folder from the full OS image. This is because all of its contents have already been copied unto the root of the PXE artifacts folder.

  • Tests added/updated
  • Documentation updated (if needed)
  • Code conforms to style guidelines

@gmileka gmileka force-pushed the user/gmileka/clean-boot branch from 2cc3608 to 641a0e6 Compare June 27, 2025 18:28
@gmileka gmileka changed the title User/gmileka/clean boot Image Customizer: clean the /boot folder selectively if keepKdumpBootFiles is specified Jun 27, 2025
@gmileka gmileka marked this pull request as ready for review June 27, 2025 18:51
@gmileka gmileka requested a review from a team as a code owner June 27, 2025 18:51
@gmileka gmileka force-pushed the user/gmileka/clean-boot branch from 7151c1b to 8b3c5ff Compare June 27, 2025 18:52
@@ -32,6 +32,23 @@ pxe:

See also the [PXE Support](../../concepts/pxe.md) page.

## keepKdumpBootFiles [bool]
Copy link
Contributor

Choose a reason for hiding this comment

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

Use of this new API should sit behind a preview feature flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

! yes, I missed that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pending

@@ -25,13 +26,16 @@ import (
)

const (
bootDirPermissions = 0700
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: 0o700

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pending

// without having to do an extra iteration.
sort.Strings(bootFolderFilePaths)

savedFilesDir, err := os.MkdirTemp("", "files-to-save-*")
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the build directory for storing temporary files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pending

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants