Skip to content

Commit

Permalink
Fix Network Interface Copy
Browse files Browse the repository at this point in the history
Fixes Issue: #261

Pull Request #236 introduced a bug where local network interfaces
are always copied to the target media.
This PR correct this by only copying when copyNetwork is set to
true; this is enabled in the UI when the users changes a network
interface (for static).

Signed-off-by: Mark D Horn <[email protected]>
  • Loading branch information
mdhorn committed Mar 12, 2019
1 parent 786a1f2 commit 5dbee42
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,10 @@ func Install(rootDir string, model *model.SystemInstall, options args.Args) erro
}
}

if err = network.CopyNetworkInterfaces(rootDir); err != nil {
return err
if model.CopyNetwork {
if err = network.CopyNetworkInterfaces(rootDir); err != nil {
return err
}
}

if model.Telemetry.URL != "" {
Expand Down
1 change: 1 addition & 0 deletions model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type SystemInstall struct {
Version uint `yaml:"version,omitempty,flow"`
StorageAlias []*StorageAlias `yaml:"block-devices,omitempty,flow"`
LegacyBios bool `yaml:"legacyBios,omitempty,flow"`
CopyNetwork bool `yaml:"copyNetwork,omitempty,flow"`
Environment map[string]string `yaml:"env,omitempty,flow"`
CryptPass string `yaml:"-"`
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/InstallerYAMLSyntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ Item | Description | Default
`autoUpdate` | Should the system automatically update to the latest release of Clear Linux OS as part of the installation?; true or false | true
`postReboot` | Should the system reboot after the installation completes?; true or false | true
`postArchive` | Should the system archive the log and configuration file on the target media?; true or false | true
`LegacyBios` | Is the install using the Legacy boot from BIOS?; true or false | false
`legacyBios` | Is the install using the Legacy boot from BIOS?; true or false | false
`copyNetwork` | Copy the locally configured network interfaces to target; `/etc/systemd/network` | false
`telemetry` | Should telemetry be enabled by default; true or false | false
`telemetryURL` | URL of where the telemetry records should publish | `-UNDEFINED-`
`telemetryPolicy` | Policy string displayed to users during interactive installs | `-UNDEFINED-`
Expand Down
1 change: 1 addition & 0 deletions tui/network_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ func newNetworkInterfacePage(tui *Tui) (Page, error) {
page.GotoPage(TuiPageNetwork)
})
if dialog.RunNetworkTest() {
page.getModel().CopyNetwork = true
page.tui.getPage(TuiPageNetwork).SetDone(true)

// Automatically close if it worked
Expand Down

0 comments on commit 5dbee42

Please sign in to comment.