Skip to content

Commit

Permalink
mantle/platform: qemuexec: rename --knetargs to --firstbootkargs
Browse files Browse the repository at this point in the history
This is a little more inline with what's being done, which is to
apply the given arguments to the first boot of the machine only.
  • Loading branch information
dustymabe committed Feb 3, 2022
1 parent c49a4e4 commit c350ea6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
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")
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

0 comments on commit c350ea6

Please sign in to comment.