Skip to content

Commit

Permalink
Fix system upgrade for Amazon AWS with nvme storage
Browse files Browse the repository at this point in the history
  • Loading branch information
jorikfon committed Apr 10, 2024
1 parent ddfce41 commit b43b92d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/Core/System/RootFS/sbin/check-update-pbx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ do
# shellcheck source=/system/update.sh
source "$updateScript";

rm "$updateScript";

# Umount the disk.
umount "$disk";

Expand Down
6 changes: 4 additions & 2 deletions src/Core/System/RootFS/sbin/pbx_firmware
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ if [ "$md5Hash" != "$(/bin/gunzip -c "${img_file}" |/bin/busybox md5sum | /bin/b
echoToTeletype " - Update aborted...";
rm -rf "$img_file";
sleep 3;
/sbin/pbx_reboot;
# Set a flag to indicate rebooting.
touch /tmp/rebooting;
else
# Inform the user of successful checksum verification
echoToTeletype " - Successful checksum verification";
Expand Down Expand Up @@ -143,7 +144,8 @@ if [ -f /offload/livecd ]; then
touch /tmp/ejectcd

echoToTeletype " - rebooting system..."
/sbin/pbx_reboot;
# Set a flag to indicate rebooting.
touch /tmp/rebooting;
else
# Format the 3rd partition and mount it as /cf/. Then, copy the configuration back and remove the image file
echo " - conf partition: ${partition3Name}";
Expand Down
2 changes: 1 addition & 1 deletion src/Core/System/SystemLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function startSystem(): bool
}

// Connect storage in a cloud if needed
$this->echoStartMsg(' - Auto connect storage for a cloud ...'.PHP_EOL);
$this->echoStartMsg(' - Auto connect storage for a cloud ...');
if (!$this->isDocker && !$this->isRecoveryMode) {
$connectResult = Storage::connectStorageInCloud();
$this->echoResultMsg($connectResult);
Expand Down
5 changes: 2 additions & 3 deletions src/PBXCoreREST/Lib/System/UpgradeFromImageAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,9 @@ private static function writeUpdateScript(array $parameters) :array
{
$messages = [];
$updateSh = "#!/bin/sh".PHP_EOL.
'rm -rf "$0";'.PHP_EOL.
"export storage_uuid='{$parameters['storage_uuid']}';".PHP_EOL.
"export cf_uuid='{$parameters['cf_uuid']};".PHP_EOL.
"export updateFile='{$parameters['imageFileLocation']};".PHP_EOL;
"export cf_uuid='{$parameters['cf_uuid']}';".PHP_EOL.
"export updateFile='{$parameters['imageFileLocation']}';".PHP_EOL;

// Mount boot partition
$systemDir = '/system';
Expand Down

0 comments on commit b43b92d

Please sign in to comment.