Skip to content

Commit

Permalink
Merge branch 'master' into vrx-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecarr authored Dec 18, 2024
2 parents 33d4be4 + 7f17b4c commit 86b2aff
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions OpenIPC_Config/ViewModels/SetupTabViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,10 @@ public async Task DownloadStart()

if (SelectedFwVersion != string.Empty && sensorType != string.Empty)
{
var firmwarePath = $"{Models.OpenIPC.AppDataConfigDirectory}/firmware/{SelectedFwVersion}.tgz";
string firmwarePath = Path.Combine(Models.OpenIPC.AppDataConfigDirectory, "firmware", $"{SelectedFwVersion}.tgz");


//var firmwarePath = $"{Models.OpenIPC.AppDataConfigDirectory}/firmware/{SelectedFwVersion}.tgz";
var localTmpPath = $"{Models.OpenIPC.LocalTempFolder}";
if (!Directory.Exists(localTmpPath)) Directory.CreateDirectory(localTmpPath);

Expand Down Expand Up @@ -476,7 +479,7 @@ public async Task DownloadStart()
ProgressText = "Download complete, starting upload...";

// Step 2: Upload file
string remotePath = $"{Models.OpenIPC.RemoteTempFolder}/{SelectedFwVersion}.tgz";
string remotePath = $"/tmp/{SelectedFwVersion}.tgz";
await UploadFirmwareAsync(firmwarePath, remotePath);

// await SshClientService.UploadFileAsync(DeviceConfig.Instance, firmwarePath,
Expand All @@ -487,7 +490,7 @@ public async Task DownloadStart()
// Step 3: Decompress using gzip
await DecompressFirmwareAsync(remotePath);

// var remoteFilePath = Path.Combine(Models.OpenIPC.RemoteTempFolder, $"{SelectedFwVersion}.tgz");
// var remoteFilePath = $"/tmp/{SelectedFwVersion}.tgz");
// await SshClientService.ExecuteCommandAsync(DeviceConfig.Instance, $"gzip -d {remoteFilePath}");
// DownloadProgress = 70;
ProgressText = "Decompression complete, extracting files...";
Expand All @@ -499,7 +502,7 @@ public async Task DownloadStart()

// await SshClientService.ExecuteCommandAsync(DeviceConfig.Instance,
// $"tar -xvf {Models.OpenIPC.RemoteTempFolder}/{SelectedFwVersion}.tar -C /tmp");
// DownloadProgress = 85;
//DownloadProgress = 85;
ProgressText = "Extraction complete, upgrading system...";

// Step 5: Execute sysupgrade
Expand All @@ -518,9 +521,9 @@ public async Task DownloadStart()
}


kernelPath = $"{Models.OpenIPC.RemoteTempFolder}/uImage.{sensorType}";
rootfsPath = $"{Models.OpenIPC.RemoteTempFolder}/rootfs.squashfs.{sensorType}";

kernelPath = $"/tmp/uImage.{sensorType}";
rootfsPath = $"/tmp/rootfs.squashfs.{sensorType}";
//sysupgrade --kernel=/tmp/uImage.%4 --rootfs=/tmp/rootfs.squashfs.%4 -n
// await SshClientService.ExecuteCommandAsync(DeviceConfig.Instance,
// $"sysupgrade --kernel={kernelPath} --rootfs={rootfsPath} -n");
Expand Down

0 comments on commit 86b2aff

Please sign in to comment.