Skip to content
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

mantle/platform: rename IgnitionNetworkKargs to AppendFirstbootKernelArgs and expose to ext tests #2683

Merged
merged 3 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions mantle/cmd/kola/qemuexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ var (
usernet bool
cpuCountHost bool

hostname string
ignition string
butane string
kargs []string
knetargs string
hostname string
ignition string
butane string
kargs []string
firstbootkargs string

ignitionFragments []string
bindro []string
Expand All @@ -75,7 +75,7 @@ const maxAdditionalNics = 16

func init() {
root.AddCommand(cmdQemuExec)
cmdQemuExec.Flags().StringVarP(&knetargs, "knetargs", "", "", "Arguments for Ignition networking on kernel commandline")
cmdQemuExec.Flags().StringVarP(&firstbootkargs, "firstbootkargs", "", "", "Additional first boot kernel arguments")
Copy link
Member

Choose a reason for hiding this comment

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

Minor: firstboot-kargs?

Copy link
Member Author

Choose a reason for hiding this comment

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

ehh - i'm not in love with either way. I kept no dashes since knetargs didn't have one either.

Copy link
Member Author

Choose a reason for hiding this comment

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

If this passes CI I'll merge it.

cmdQemuExec.Flags().StringArrayVar(&kargs, "kargs", nil, "Additional kernel arguments applied")
cmdQemuExec.Flags().BoolVarP(&usernet, "usernet", "U", false, "Enable usermode networking")
cmdQemuExec.Flags().StringSliceVar(&ignitionFragments, "add-ignition", nil, "Append well-known Ignition fragment: [\"autologin\", \"autoresize\"]")
Expand Down Expand Up @@ -264,8 +264,8 @@ func runQemuExec(cmd *cobra.Command, args []string) error {
config.Mount9p(dest, false)
}
builder.ForceConfigInjection = forceConfigInjection
if len(knetargs) > 0 {
builder.AppendFirstbootKernelArgs = knetargs
if len(firstbootkargs) > 0 {
builder.AppendFirstbootKernelArgs = firstbootkargs
}
builder.AppendKernelArgs = strings.Join(kargs, " ")
builder.Firmware = kola.QEMUOptions.Firmware
Expand Down
6 changes: 3 additions & 3 deletions mantle/platform/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ func (gf *coreosGuestfish) destroy() {
}

// setupPreboot performs changes necessary before the disk is booted
func setupPreboot(confPath, knetargs, kargs string, diskImagePath string, diskSectorSize int) error {
func setupPreboot(confPath, firstbootkargs, kargs string, diskImagePath string, diskSectorSize int) error {
gf, err := newGuestfish(diskImagePath, diskSectorSize)
if err != nil {
return err
Expand All @@ -731,8 +731,8 @@ func setupPreboot(confPath, knetargs, kargs string, diskImagePath string, diskSe
}

// See /boot/grub2/grub.cfg
if knetargs != "" {
grubStr := fmt.Sprintf("set ignition_network_kcmdline='%s'\n", knetargs)
if firstbootkargs != "" {
grubStr := fmt.Sprintf("set ignition_network_kcmdline='%s'\n", firstbootkargs)
if err := exec.Command("guestfish", gf.remote, "write", "/ignition.firstboot", grubStr).Run(); err != nil {
return errors.Wrapf(err, "guestfish write")
}
Expand Down