示例#1
0
        internal void UpdateProperties(LocalisationProperties theModel)
        {
            List <Task <ProcessResult> > Tasks = new List <Task <ProcessResult> >();

            RepopulateAndGetProperties();

            bool AskToRestart = false;

            Task <ProcessResult> StartTimesyncd   = null;
            Task <ProcessResult> DisableTimesyncd = null;

            if (TimeSyncdEnabled != theModel.TimeSyncdEnabled)
            {
                LoggingActions.LogTaskAction(Log, theModel.TimeSyncdEnabled, EventLogEntryCodes.TimesyncdEnabling, EventLogEntryCodes.TimesyncdStopping);

                if (theModel.TimeSyncdEnabled)
                {
                    Task <ProcessResult> EnableTimesyncd = ProcessRunner.GetProcessResultAsync(c_LinuxSystemControlCommand, "enable systemd-timesyncd");
                    EnableTimesyncd.Wait();
                    LoggingActions.LogTaskResult(Log, EnableTimesyncd, EventLogEntryCodes.TimesyncdEnabled, EventLogEntryCodes.TimesyncdEnablingError);

                    if (EnableTimesyncd.Result.Okay())
                    {
                        Log?.Invoke(EventLogEntryCodes.TimesyncdStarting, null);
                        StartTimesyncd = ProcessRunner.GetProcessResultAsync(c_LinuxSystemControlCommand, "start systemd-timesyncd");
                        Tasks.Add(StartTimesyncd);
                    }
                }
                else
                {
                    Task <ProcessResult> StopTimesyncd = ProcessRunner.GetProcessResultAsync(c_LinuxSystemControlCommand, "stop systemd-timesyncd");
                    StopTimesyncd.Wait();
                    LoggingActions.LogTaskResult(Log, StopTimesyncd, EventLogEntryCodes.TimesyncdStopped, EventLogEntryCodes.TimesyncdStoppingError);

                    if (StopTimesyncd.Result.Okay())
                    {
                        Log?.Invoke(EventLogEntryCodes.TimesyncdDisabling, null);
                        DisableTimesyncd = ProcessRunner.GetProcessResultAsync(c_LinuxSystemControlCommand, "disable systemd-timesyncd");
                        Tasks.Add(DisableTimesyncd);
                    }
                }
            }

            Task <ProcessResult> StartFakeHWClock   = null;
            Task <ProcessResult> DisableFakeHWClock = null;

            if (FakeHWClockEnabled != theModel.FakeHWClockEnabled)
            {
                LoggingActions.LogTaskAction(Log, theModel.FakeHWClockEnabled, EventLogEntryCodes.FakeHwClockEnabling, EventLogEntryCodes.FakeHwClockStopping);

                if (theModel.FakeHWClockEnabled)
                {
                    Task <ProcessResult> EnableFakeHWClock = ProcessRunner.GetProcessResultAsync(c_LinuxSystemControlCommand, "enable fake-hwclock");
                    EnableFakeHWClock.Wait();
                    LoggingActions.LogTaskResult(Log, EnableFakeHWClock, EventLogEntryCodes.FakeHwClockEnabled, EventLogEntryCodes.FakeHwClockEnablingError);

                    if (EnableFakeHWClock.Result.Okay())
                    {
                        Log?.Invoke(EventLogEntryCodes.TimesyncdEnabling, null);
                        StartFakeHWClock = ProcessRunner.GetProcessResultAsync(c_LinuxSystemControlCommand, "start fake-hwclock");
                        Tasks.Add(StartFakeHWClock);
                    }
                }
                else
                {
                    Task <ProcessResult> StopFakeHWClock = ProcessRunner.GetProcessResultAsync(c_LinuxSystemControlCommand, "stop fake-hwclock");
                    StopFakeHWClock.Wait();
                    LoggingActions.LogTaskResult(Log, StopFakeHWClock, EventLogEntryCodes.FakeHwClockStopped, EventLogEntryCodes.FakeHwClockStoppingError);

                    if (StopFakeHWClock.Result.Okay())
                    {
                        Log?.Invoke(EventLogEntryCodes.FakeHwClockDisabling, null);
                        DisableFakeHWClock = ProcessRunner.GetProcessResultAsync(c_LinuxSystemControlCommand, "disable fake-hwclock");
                        Tasks.Add(DisableFakeHWClock);
                    }
                }
            }

            Task <ProcessResult> SetTimeZone = null;

            if (TimeZone != theModel.TimeZone)
            {
                Log?.Invoke(EventLogEntryCodes.TimeZoneSetting, new string[] { theModel.TimeZone });
                SetTimeZone = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_change_timezone " + theModel.TimeZone);
                Tasks.Add(SetTimeZone);
            }

            Task <ProcessResult> SetWifiCountry = null;

            if (WifiCountry != theModel.WifiCountry)
            {
                if (theModel.WifiCountry == string.Empty)
                {
                    AskToRestart = true;
                    Log?.Invoke(EventLogEntryCodes.WifiCountrySetting, new string[] { "None" });
                    SetWifiCountry = UnsetWiFiSequence();
                    Tasks.Add(SetWifiCountry);
                }
                else
                {
                    AskToRestart = true;
                    Log?.Invoke(EventLogEntryCodes.WifiCountrySetting, new string[] { theModel.WifiCountry });
                    SetWifiCountry = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_wifi_country " + theModel.WifiCountry);
                    Tasks.Add(SetWifiCountry);
                }
            }

            Task <ProcessResult> SetDate = null;

            if (theModel.SetDate)
            {
                DateTime DateConvert = DateTime.ParseExact(theModel.Date.Replace("/", ""), "ddMMyyyy", CultureInfo.InvariantCulture);
                string   DateCommand = "+%Y%m%d -s \"" + DateConvert.ToString("yyyyMMdd") + "\"";
                Log?.Invoke(EventLogEntryCodes.DateSetting, new string[] { "date " + DateCommand });
                SetDate = ProcessRunner.GetProcessResultAsync(c_DateCommand, DateCommand);
                Tasks.Add(SetDate);
            }

            Task <ProcessResult> SetTime = null;

            if (theModel.SetTime)
            {
                string TimeCommand = "+%T -s \"" + theModel.Time + "\"";
                Log?.Invoke(EventLogEntryCodes.TimeSetting, new string[] { "date " + TimeCommand });
                SetTime = ProcessRunner.GetProcessResultAsync(c_DateCommand, TimeCommand);
                Tasks.Add(SetTime);
            }

            if (AskToRestart)
            {
                RestartDue?.Invoke();
            }

            Task.WaitAll(Tasks.ToArray());

            Task <ProcessResult> SyncRTC = null;

            if (HWClockPresent && (theModel.SetTime || theModel.SetDate || (theModel.TimeSyncdEnabled && !TimeSyncdEnabled)) && theModel.HWClockPresent)
            {
                Log?.Invoke(EventLogEntryCodes.RTCSyncing, null);
                SyncRTC = ProcessRunner.GetProcessResultAsync(c_HardwareClockCommand, "-w");
                SyncRTC.Wait();
            }

            // Check if Tasks have completed Okay and Log result
            LoggingActions.LogTaskResult(Log, StartTimesyncd, EventLogEntryCodes.TimesyncdStarted, EventLogEntryCodes.TimesyncdStartingError);
            LoggingActions.LogTaskResult(Log, DisableTimesyncd, EventLogEntryCodes.TimesyncdDisabled, EventLogEntryCodes.TimesyncdDisablingError);
            LoggingActions.LogTaskResult(Log, StartFakeHWClock, EventLogEntryCodes.FakeHwClockStarted, EventLogEntryCodes.FakeHwClockStartingError);
            LoggingActions.LogTaskResult(Log, DisableFakeHWClock, EventLogEntryCodes.FakeHwClockDisabled, EventLogEntryCodes.FakeHwClockDisablingError);
            LoggingActions.LogTaskResult(Log, SetTimeZone, EventLogEntryCodes.TimeZoneSet, EventLogEntryCodes.TimeZoneSettingError);
            LoggingActions.LogTaskResult(Log, SetWifiCountry, EventLogEntryCodes.WifiCountrySet, EventLogEntryCodes.WifiCountrySettingError);
            LoggingActions.LogTaskResult(Log, SetDate, EventLogEntryCodes.DateSet, EventLogEntryCodes.DateSettingError);
            LoggingActions.LogTaskResult(Log, SetTime, EventLogEntryCodes.TimeSet, EventLogEntryCodes.TimeSettingError);
            LoggingActions.LogTaskResult(Log, SyncRTC, EventLogEntryCodes.RTCSynced, EventLogEntryCodes.RTCSyncError);
        }
        internal void UpdateProperties(NetworkProperties theModel)
        {
            List <Task <ProcessResult> > Tasks = new List <Task <ProcessResult> >();
            bool AskToRestart = false;

            bool Eth0Changes  = false;
            bool Wlan0Changes = false;

            NetworkProperties CurrentSettings = Core.Instance.Network.RepopulateAndGetProperties();

            if (theModel.Eth0Routers == null)
            {
                theModel.Eth0Routers = new string[0];
            }
            if (theModel.Eth0DomainNameServers == null)
            {
                theModel.Eth0DomainNameServers = new string[0];
            }
            if (theModel.Wlan0Routers == null)
            {
                theModel.Wlan0Routers = new string[0];
            }
            if (theModel.Wlan0DomainNameServers == null)
            {
                theModel.Wlan0DomainNameServers = new string[0];
            }

            if (CurrentSettings.Eth0IPAddress != theModel.Eth0IPAddress)
            {
                Eth0Changes = true;
                if (string.IsNullOrEmpty(theModel.Eth0IPAddress))
                {
                    Log?.Invoke(EventLogEntryCodes.NICIP4DynamicChanging, new string[] { c_Eth0 });
                }
                else
                {
                    Log?.Invoke(EventLogEntryCodes.NICIP4StaticChanging, new string[] { c_Eth0, theModel.Eth0IPAddress });
                }
            }

            if (CurrentSettings.Eth0IP6Address != theModel.Eth0IP6Address)
            {
                Eth0Changes = true;
                if (string.IsNullOrEmpty(theModel.Eth0IP6Address))
                {
                    Log?.Invoke(EventLogEntryCodes.NICIP6DynamicChanging, new string[] { c_Eth0 });
                }
                else
                {
                    Log?.Invoke(EventLogEntryCodes.NICIP6StaticChanging, new string[] { c_Eth0, theModel.Eth0IP6Address });
                }
            }

            if (!CurrentSettings.Eth0Routers.OrderBy(e => e).SequenceEqual(theModel.Eth0Routers.OrderBy(e => e)))
            {
                Eth0Changes = true;
                Log?.Invoke(EventLogEntryCodes.NICRoutersChanging, new string[] { c_Eth0, string.Join(" ", theModel.Eth0Routers) });
            }

            if (!CurrentSettings.Eth0DomainNameServers.OrderBy(e => e).SequenceEqual(theModel.Eth0DomainNameServers.OrderBy(e => e)))
            {
                Eth0Changes = true;
                Log?.Invoke(EventLogEntryCodes.NICDNSChanging, new string[] { c_Eth0, string.Join(" ", theModel.Eth0DomainNameServers) });
            }

            if (CurrentSettings.Wlan0IPAddress != theModel.Wlan0IPAddress)
            {
                Wlan0Changes = true;
                if (string.IsNullOrEmpty(theModel.Wlan0IPAddress))
                {
                    Log?.Invoke(EventLogEntryCodes.NICIP6DynamicChanging, new string[] { c_Wlan0 });
                }
                else
                {
                    Log?.Invoke(EventLogEntryCodes.NICIP6StaticChanging, new string[] { c_Wlan0, theModel.Wlan0IPAddress });
                }
            }

            if (CurrentSettings.Wlan0IP6Address != theModel.Wlan0IP6Address)
            {
                Wlan0Changes = true;
                if (string.IsNullOrEmpty(theModel.Eth0IP6Address))
                {
                    Log?.Invoke(EventLogEntryCodes.NICIP6DynamicChanging, new string[] { c_Wlan0 });
                }
                else
                {
                    Log?.Invoke(EventLogEntryCodes.NICIP6StaticChanging, new string[] { c_Wlan0, theModel.Wlan0IP6Address });
                }
            }

            if (!CurrentSettings.Wlan0Routers.OrderBy(e => e).SequenceEqual(theModel.Wlan0Routers.OrderBy(e => e)))
            {
                Wlan0Changes = true;
                Log?.Invoke(EventLogEntryCodes.NICDNSChanging, new string[] { c_Wlan0, string.Join(" ", theModel.Wlan0Routers) });
            }

            if (!CurrentSettings.Wlan0DomainNameServers.OrderBy(e => e).SequenceEqual(theModel.Wlan0DomainNameServers.OrderBy(e => e)))
            {
                Wlan0Changes = true;
                Log?.Invoke(EventLogEntryCodes.NICDNSChanging, new string[] { c_Wlan0, string.Join(" ", theModel.Wlan0DomainNameServers) });
            }

            Task <ProcessResult> IPAddressTask = null;

            if (Eth0Changes || Wlan0Changes)
            {
                NICProperties eth0 = new NICProperties(c_Eth0);
                eth0.IPAddress         = theModel.Eth0IPAddress;
                eth0.IP6Address        = theModel.Eth0IP6Address;
                eth0.Routers           = theModel.Eth0Routers;
                eth0.DomainNameServers = theModel.Eth0DomainNameServers;

                NICProperties wlan0 = new NICProperties(c_Wlan0);
                wlan0.IPAddress         = theModel.Wlan0IPAddress;
                wlan0.IP6Address        = theModel.Wlan0IP6Address;
                wlan0.Routers           = theModel.Wlan0Routers;
                wlan0.DomainNameServers = theModel.Wlan0DomainNameServers;

                IPAddressTask = FlushNetworkSequence(Eth0Changes, Wlan0Changes, eth0, wlan0);
                Tasks.Add(IPAddressTask);
            }

            Task <ProcessResult> HostNameTask = null;

            if (CurrentSettings.HostName != theModel.HostName)
            {
                AskToRestart = true;
                HostNameTask = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_hostname " + theModel.HostName);
                Tasks.Add(HostNameTask);
                Log?.Invoke(EventLogEntryCodes.HostNameChanging, new string[] { theModel.HostName });
            }

            Task <ProcessResult> SetWiFiSSIDPassphrase = null;

            if (!string.IsNullOrEmpty(theModel.NewSSID))
            {
                SetWiFiSSIDPassphrase = SetWiFiSSIDPassphraseSequence(theModel);
                Tasks.Add(SetWiFiSSIDPassphrase);
            }

            if (AskToRestart)
            {
                RestartDue?.Invoke();
            }

            Task.WaitAll(Tasks.ToArray());

            // Check if Tasks have completed Okay and Log result

            LoggingActions.LogTaskResult(Log, IPAddressTask, EventLogEntryCodes.NICIPChangesComplete, EventLogEntryCodes.NICIPChangesError);
            LoggingActions.LogTaskResult(Log, HostNameTask, EventLogEntryCodes.HostNameChanged, EventLogEntryCodes.HostNameChangeError);
            LoggingActions.LogTaskResult(Log, SetWiFiSSIDPassphrase, EventLogEntryCodes.SSIDChanged, EventLogEntryCodes.SSIDChangeError);
        }
        internal void UpdateProperties(InterfacingProperties theModel)
        {
            List <Task <ProcessResult> > Tasks = new List <Task <ProcessResult> >();

            bool AskToRestart = false;

            RepopulateAndGetProperties();

            Task <ProcessResult> SetCamera = null;

            if (Camera != theModel.Camera)
            {
                AskToRestart = true;
                LoggingActions.LogTaskAction(Log, theModel.Camera, EventLogEntryCodes.CameraSettingEnabling, EventLogEntryCodes.CameraSettingDisabling);
                SetCamera = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_camera " + (theModel.Camera ? c_Enabled : c_Disabled));
                Tasks.Add(SetCamera);
            }

            Task <ProcessResult> SetSSH = null;

            if (SSH != theModel.SSH)
            {
                LoggingActions.LogTaskAction(Log, theModel.SSH, EventLogEntryCodes.SSHSettingEnabling, EventLogEntryCodes.SSHSettingDisabling);
                SetSSH = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_ssh " + (theModel.SSH ? c_Enabled : c_Disabled));
                Tasks.Add(SetSSH);
            }

            Task <ProcessResult> SetVNC = null;

            if (VNC != theModel.VNC)
            {
                LoggingActions.LogTaskAction(Log, theModel.VNC, EventLogEntryCodes.VNCSettingEnabling, EventLogEntryCodes.VNCSettingDisabling);
                SetVNC = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_vnc " + (theModel.VNC ? c_Enabled : c_Disabled));
                Tasks.Add(SetVNC);
            }

            Task <ProcessResult> SetSPI = null;

            if (SPI != theModel.SPI)
            {
                LoggingActions.LogTaskAction(Log, theModel.SPI, EventLogEntryCodes.SPISettingEnabling, EventLogEntryCodes.SPISettingDisabling);
                SetSPI = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_spi " + (theModel.SPI ? c_Enabled : c_Disabled));
                Tasks.Add(SetSPI);
            }

            Task <ProcessResult> SetI2C = null;

            if (I2C != theModel.I2C)
            {
                LoggingActions.LogTaskAction(Log, theModel.I2C, EventLogEntryCodes.I2CSettingEnabling, EventLogEntryCodes.I2CSettingDisabling);
                SetI2C = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_i2c " + (theModel.I2C ? c_Enabled : c_Disabled));
                Tasks.Add(SetI2C);
            }

            Task <ProcessResult> SetSerial = null;

            if (Serial != theModel.Serial)
            {
                AskToRestart = true;
                LoggingActions.LogTaskAction(Log, theModel.Serial, EventLogEntryCodes.SerialSettingEnabling, EventLogEntryCodes.SerialSettingDisabling);
                SetSerial = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_serial " + (theModel.Serial ? c_Enabled : c_Disabled));
                Tasks.Add(SetSerial);
            }

            Task <ProcessResult> SetOneWire = null;

            if (OneWire != theModel.OneWire)
            {
                AskToRestart = true;
                LoggingActions.LogTaskAction(Log, theModel.OneWire, EventLogEntryCodes.OneWireSettingEnabling, EventLogEntryCodes.OneWireSettingDisabling);
                SetOneWire = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_onewire " + (theModel.OneWire ? c_Enabled : c_Disabled));
                Tasks.Add(SetOneWire);
            }

            Task <ProcessResult> SetRemoteGPIO = null;

            if (RemoteGPIO != theModel.RemoteGPIO)
            {
                LoggingActions.LogTaskAction(Log, theModel.RemoteGPIO, EventLogEntryCodes.RemoteGPIOSettingEnabling, EventLogEntryCodes.RemoteGPIOSettingDisabling);
                SetRemoteGPIO = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_rgpio " + (theModel.RemoteGPIO ? c_Enabled : c_Disabled));
                Tasks.Add(SetRemoteGPIO);
            }

            Task.WaitAll(Tasks.ToArray());

            if (AskToRestart)
            {
                RestartDue?.Invoke();
            }

            // Check if Tasks have completed Okay and Log result
            LoggingActions.LogTaskResult(Log, SetCamera, theModel.Camera, EventLogEntryCodes.CameraSettingEnabled, EventLogEntryCodes.CameraSettingDisabled, EventLogEntryCodes.CameraSettingError);
            LoggingActions.LogTaskResult(Log, SetSSH, theModel.SSH, EventLogEntryCodes.SSHSettingEnabled, EventLogEntryCodes.SSHSettingDisabled, EventLogEntryCodes.SSHSettingError);
            LoggingActions.LogTaskResult(Log, SetVNC, theModel.VNC, EventLogEntryCodes.VNCSettingEnabled, EventLogEntryCodes.VNCSettingDisabled, EventLogEntryCodes.VNCSettingError);
            LoggingActions.LogTaskResult(Log, SetSPI, theModel.SPI, EventLogEntryCodes.SPISettingEnabled, EventLogEntryCodes.SPISettingDisabled, EventLogEntryCodes.SPISettingError);
            LoggingActions.LogTaskResult(Log, SetI2C, theModel.I2C, EventLogEntryCodes.I2CSettingEnabled, EventLogEntryCodes.I2CSettingDisabled, EventLogEntryCodes.I2CSettingError);
            LoggingActions.LogTaskResult(Log, SetSerial, theModel.Serial, EventLogEntryCodes.SerialSettingEnabled, EventLogEntryCodes.SerialSettingDisabled, EventLogEntryCodes.SerialSettingError);
            LoggingActions.LogTaskResult(Log, SetOneWire, theModel.OneWire, EventLogEntryCodes.OneWireSettingEnabled, EventLogEntryCodes.OneWireSettingDisabled, EventLogEntryCodes.OneWireSettingError);
            LoggingActions.LogTaskResult(Log, SetRemoteGPIO, theModel.RemoteGPIO, EventLogEntryCodes.RemoteGPIOSettingEnabled, EventLogEntryCodes.RemoteGPIOSettingDisabled, EventLogEntryCodes.RemoteGPIOSettingError);
        }
示例#4
0
        internal void UpdateProperties(BootProperties theModel)
        {
            List <Task <ProcessResult> > Tasks = new List <Task <ProcessResult> >();

            bool AskToRestart = false;

            RepopulateAndGetProperties();

            Task <ProcessResult> SetBootBehaviour = null;

            if (theModel.BootBehaviour != 0)
            {
                AskToRestart = true;
                LoggingActions.LogTaskAction(Log, (theModel.BootBehaviour - 1), new EventLogEntryCodes[] {
                    EventLogEntryCodes.BootBehaviourSettingConsole,
                    EventLogEntryCodes.BootBehaviourSettingConsoleAutologin,
                    EventLogEntryCodes.BootBehaviourSettingDesktop,
                    EventLogEntryCodes.BootBehaviourSettingDesktopAutologin
                });
                SetBootBehaviour = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_boot_behaviour B" + theModel.BootBehaviour);
                Tasks.Add(SetBootBehaviour);
            }

            Task <ProcessResult> SetNetworkWait = null;

            if (NetworkWait != theModel.NetworkWait)
            {
                LoggingActions.LogTaskAction(Log, theModel.NetworkWait, EventLogEntryCodes.NetworkWaitSettingTrue, EventLogEntryCodes.NetworkWaitSettingFalse);
                SetNetworkWait = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_boot_wait " + (theModel.NetworkWait ? "0" : "1"));
                Tasks.Add(SetNetworkWait);
            }

            Task <ProcessResult> SetSplashScreen = null;

            if (SplashScreen != theModel.SplashScreen)
            {
                LoggingActions.LogTaskAction(Log, theModel.SplashScreen, EventLogEntryCodes.SplashScreenSettingTrue, EventLogEntryCodes.SplashScreenSettingFalse);
                SetSplashScreen = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_boot_splash " + (theModel.SplashScreen ? "0" : "1"));
                Tasks.Add(SetSplashScreen);
            }

            Task <ProcessResult> SetBootOrder = null;

            if (theModel.BootOrder != 0)
            {
                LoggingActions.LogTaskAction(Log, (theModel.BootOrder - 1), new EventLogEntryCodes[] {
                    EventLogEntryCodes.BootOrderSettingUSB,
                    EventLogEntryCodes.BootOrderSettingNetwork
                });
                SetBootOrder = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_boot_order B" + theModel.BootOrder);
                Tasks.Add(SetBootOrder);
            }

            Task <ProcessResult> SetBootROM = null;

            if (theModel.BootROM != 0)
            {
                AskToRestart = true;
                LoggingActions.LogTaskAction(Log, (theModel.BootROM - 1), new EventLogEntryCodes[] {
                    EventLogEntryCodes.BootROMSettingLatest,
                    EventLogEntryCodes.BootROMSettingDefault
                });
                SetBootROM = ProcessRunner.GetProcessResultAsync(c_LinuxRaspconfigCommand, "nonint do_boot_rom E" + theModel.BootROM);
                Tasks.Add(SetBootROM);
            }

            if (AskToRestart)
            {
                RestartDue?.Invoke();
            }

            Task.WaitAll(Tasks.ToArray());

            // Check if Tasks have completed Okay and Log result
            LoggingActions.LogTaskResult(Log, SetBootBehaviour, EventLogEntryCodes.BootBehaviourSet, EventLogEntryCodes.BootBehaviourSettingError);
            LoggingActions.LogTaskResult(Log, SetNetworkWait, EventLogEntryCodes.NetworkWaitSet, EventLogEntryCodes.NetworkWaitSettingError);
            LoggingActions.LogTaskResult(Log, SetSplashScreen, EventLogEntryCodes.SplashScreenSet, EventLogEntryCodes.SplashScreenSettingError);
            LoggingActions.LogTaskResult(Log, SetBootOrder, EventLogEntryCodes.BootOrderSet, EventLogEntryCodes.BootOrderSettingError);
            LoggingActions.LogTaskResult(Log, SetBootROM, EventLogEntryCodes.BootROMSet, EventLogEntryCodes.BootROMSettingError);
        }