(cmd *cobra.Command, kernel string, initrds []string, extraCmdline string)
| 96 | } |
| 97 | |
| 98 | func staticFromFlags(cmd *cobra.Command, kernel string, initrds []string, extraCmdline string) *pixiecore.Server { |
| 99 | cmdline, err := cmd.Flags().GetString("cmdline") |
| 100 | if err != nil { |
| 101 | fatalf("Error reading flag: %s", err) |
| 102 | } |
| 103 | bootmsg, err := cmd.Flags().GetString("bootmsg") |
| 104 | if err != nil { |
| 105 | fatalf("Error reading flag: %s", err) |
| 106 | } |
| 107 | |
| 108 | if extraCmdline != "" { |
| 109 | cmdline = fmt.Sprintf("%s %s", extraCmdline, cmdline) |
| 110 | } |
| 111 | |
| 112 | spec := &pixiecore.Spec{ |
| 113 | Kernel: pixiecore.ID(kernel), |
| 114 | Cmdline: cmdline, |
| 115 | Message: bootmsg, |
| 116 | } |
| 117 | for _, initrd := range initrds { |
| 118 | spec.Initrd = append(spec.Initrd, pixiecore.ID(initrd)) |
| 119 | } |
| 120 | |
| 121 | booter, err := pixiecore.StaticBooter(spec) |
| 122 | if err != nil { |
| 123 | fatalf("Couldn't make static booter: %s", err) |
| 124 | } |
| 125 | |
| 126 | s := serverFromFlags(cmd) |
| 127 | s.Booter = booter |
| 128 | |
| 129 | return s |
| 130 | } |
| 131 | |
| 132 | func serverFromFlags(cmd *cobra.Command) *pixiecore.Server { |
| 133 | debug, err := cmd.Flags().GetBool("debug") |
no test coverage detected