-
Notifications
You must be signed in to change notification settings - Fork 68
Use grubby to update kernel command line arguments #511
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: main
Are you sure you want to change the base?
Changes from all commits
bf914ac
7c24498
ed92571
a56f89f
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 |
|---|---|---|
|
|
@@ -69,33 +69,7 @@ def check_os_supported(cls, detected_os_info): | |
| return False | ||
|
|
||
| def disable_predictable_nic_names(self): | ||
|
Contributor
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. Worth taking into account to modify custom implementations of
Contributor
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. Besides OCI, there's no other implementations. We should be fine, since that's already handled here: https://github.com/cloudbase/coriolis-provider-oci/pull/3/files (the extra implementations seem to be removed, as they should :D ) |
||
| grub_cfg = "etc/default/grub" | ||
| if not self._test_path(grub_cfg): | ||
| LOG.warning( | ||
| "Could not find /%s. Skipping predictable NIC names disabling.", | ||
| grub_cfg, | ||
| ) | ||
| return | ||
| contents = self._read_file_sudo(grub_cfg) | ||
| cfg = utils.Grub2ConfigEditor(contents) | ||
| cfg.append_to_option( | ||
| "GRUB_CMDLINE_LINUX_DEFAULT", | ||
| {"opt_type": "key_val", "opt_key": "net.ifnames", "opt_val": 0}, | ||
| ) | ||
| cfg.append_to_option( | ||
| "GRUB_CMDLINE_LINUX_DEFAULT", | ||
| {"opt_type": "key_val", "opt_key": "biosdevname", "opt_val": 0}, | ||
| ) | ||
| cfg.append_to_option( | ||
| "GRUB_CMDLINE_LINUX", | ||
| {"opt_type": "key_val", "opt_key": "net.ifnames", "opt_val": 0}, | ||
| ) | ||
| cfg.append_to_option( | ||
| "GRUB_CMDLINE_LINUX", | ||
| {"opt_type": "key_val", "opt_key": "biosdevname", "opt_val": 0}, | ||
| ) | ||
| self._write_file_sudo("etc/default/grub", cfg.dump()) | ||
| self._schedule_grub2_update() | ||
| self._update_kernel_cmdline_args(args_to_add=["net.ifnames=0", "biosdevname=0"]) | ||
|
|
||
| def set_net_config(self, nics_info, dhcp): | ||
| if dhcp: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.