-
Notifications
You must be signed in to change notification settings - Fork 587
OSModifier: Extend EMU API to update verity and root device #10584
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
base: 3.0-dev
Are you sure you want to change the base?
Changes from all commits
24cdbc9
6a428d6
a5e4489
dc5b2a1
92f7141
5031f77
7b181ec
c6fc3e5
b449d43
7555cc3
d78451e
a074e69
991f2db
4be5716
b020804
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -591,6 +591,28 @@ func selinuxModeToArgs(selinuxMode imagecustomizerapi.SELinuxMode) ([]string, er | |
return newSELinuxArgs, nil | ||
} | ||
|
||
// Converts an SELinux mode into the list of required command-line args for that mode (with enforcing mode). | ||
func selinuxModeToArgsWithEnforcingArg(selinuxMode imagecustomizerapi.SELinuxMode) ([]string, error) { | ||
newSELinuxArgs := []string(nil) | ||
switch selinuxMode { | ||
case imagecustomizerapi.SELinuxModeDisabled: | ||
newSELinuxArgs = []string{installutils.CmdlineSELinuxDisabledArg} | ||
|
||
case imagecustomizerapi.SELinuxModeForceEnforcing: | ||
newSELinuxArgs = []string{installutils.CmdlineSELinuxSecurityArg, installutils.CmdlineSELinuxEnabledArg, | ||
installutils.CmdlineSELinuxEnforcingArg} | ||
|
||
case imagecustomizerapi.SELinuxModePermissive, imagecustomizerapi.SELinuxModeEnforcing: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to create a new mode called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if it makes sense to add a force-permissive mode in MIC, the trident will pass value |
||
newSELinuxArgs = []string{installutils.CmdlineSELinuxSecurityArg, installutils.CmdlineSELinuxEnabledArg, | ||
elainezhao1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
installutils.CmdlineSELinuxPermissiveArg} | ||
|
||
default: | ||
return nil, fmt.Errorf("unknown SELinux mode (%s)", selinuxMode) | ||
} | ||
|
||
return newSELinuxArgs, nil | ||
} | ||
|
||
// Update the SELinux kernel command-line args. | ||
func updateSELinuxCommandLineHelperAll(grub2Config string, selinuxMode imagecustomizerapi.SELinuxMode, allowMultiple bool, requireKernelOpts bool) (string, error) { | ||
newSELinuxArgs, err := selinuxModeToArgs(selinuxMode) | ||
|
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.
Since this change is outside the MIC directories, it will need to be approved by shiproom. I recommend making the change that shiproom needs to review as small as possible. So, it might be good to handle the SELinux stuff as a separate PR.