Skip to content

Add UKI modify mode, SELinux, and kernel cmdline support for ACL#736

Open
liulanze wants to merge 1 commit into
mainfrom
user/lanzeliu/acl-support-2
Open

Add UKI modify mode, SELinux, and kernel cmdline support for ACL#736
liulanze wants to merge 1 commit into
mainfrom
user/lanzeliu/acl-support-2

Conversation

@liulanze
Copy link
Copy Markdown
Contributor

UKI passthrough mode: tested, passed
UKI create mode: tested, passed
UKI modify mode: tested, passed
os.kernelCommandLine: tested, passed
os.selinux: tested, passed
os.hostname: tested, passed
os.additionalFiles: tested, passed
os.additionalDirs: tested, passed
os.groups / os.users: tested, passed
os.modules: tested, passed
os.services: tested, passed
os.imageHistory: tested, passed
scripts.postCustomization: tested, passed
output.artifacts: tested, passed


// GetSELinuxConfigDir returns the path to the SELinux configuration
// directory relative to the image root.
GetSELinuxConfigDir() string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

GetSELinuxConfigFile()? This would remove the need to construct it at multiple call sites.

return imagecustomizerapi.SELinuxModeDefault, err
selinuxConfigDir := distroHandler.GetSELinuxConfigDir()
if isPathOnReadOnlyMount("/"+selinuxConfigDir, imageChroot) {
// The SELinux config dir is on a read-only partition (e.g. dm-verity /usr on ACL).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change in behavior isn't necessary the right move for non-ACL distributions. I think code path would be better captured with a distrohandler function.

return fmt.Errorf("failed to extract cmdline from addon (%s):\n%w", addonFilePath, err)
var cmdline string
_, statErr := os.Stat(addonFilePath)
if statErr == nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similarly, this code path would be better captured with a distrohandler function. It should still throw an error for non-ACL distributions since it is invalid state.

In general, when adding support for a new distro-version, one should only change behavior for other distro-versions if a bug has been surfaced that only the new distro-version hits.

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