Skip to content

Commit

Permalink
#837 Поправил вывод команды parted
Browse files Browse the repository at this point in the history
  • Loading branch information
boffart committed Nov 22, 2024
1 parent 03e4a54 commit 8607aae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/Core/System/PBXInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ private function convertDiscLayout():void
}
$echoPath = Util::which('echo');
$partedPath = Util::which('parted');
$fixCommand = "echo Fix | $partedPath --script $disk print";
exec($fixCommand);
$command = "$partedPath --script $disk print | grep 'Partition Table' | awk '{print $3}'";
$command = "$partedPath --script $disk print 2>/dev/null | grep 'Partition Table' | awk '{print $3}'";
exec($command, $partitionTypeOutput, $partedStatus);
if ($partedStatus !== 0 || empty($partitionTypeOutput)) {
return;
Expand Down
3 changes: 1 addition & 2 deletions src/Core/System/RootFS/sbin/pbx_firmware
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ fi
# Inform the user of the installation process
if [ -r "${img_file}" ]; then
if command -v gdisk > /dev/null 2>&1; then
echo Fix | /sbin/parted --script "$DISK" print >/dev/null 2>&1;
PARTITION_TYPE=$(/sbin/parted --script "$DISK" print | grep "Partition Table" | awk '{print $3}')
PARTITION_TYPE=$(/sbin/parted --script "$DISK" print 2>/dev/null | grep "Partition Table" | awk '{print $3}')
echo " - Performing an action for the msdos section"
if [ "$PARTITION_TYPE" == "msdos" ]; then
echo -e "w\nY\n" | gdisk "/dev/${systemDevice}" > /dev/null 2>&1;
Expand Down

0 comments on commit 8607aae

Please sign in to comment.