Skip to content

Commit

Permalink
#745 Расширил вывод информации в консоль для отладки (2).
Browse files Browse the repository at this point in the history
#745 Расширил вывод информации в консоль для отладки (2).
  • Loading branch information
boffart authored Jun 18, 2024
2 parents 387ddfb + 04c1d8b commit 4716d08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/Core/System/PBXInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,10 @@ private function copyConfiguration():void
echo Util::translate("Copying configuration...").PHP_EOL;
Util::mwMkdir('/mnttmp');

$confPartitionName = Storage::getDevPartName("/dev/$this->target_disk", '3');
echo "Target disk: $this->target_disk ...".PHP_EOL;
$confPartitionName = Storage::getDevPartName($this->target_disk, '3');
// Mount the disk with settings.
$mount = Util::which('mount');
$mount = Util::which('mount');
$umount = Util::which('umount');
$resUMount = Processes::mwExec("$umount $confPartitionName");
echo "Umount $confPartitionName: $resUMount ...".PHP_EOL;
Expand Down
6 changes: 2 additions & 4 deletions src/Core/System/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,12 +654,10 @@ public static function getDevPartName(string $dev, string $part): string
$grepPath = Util::which('grep');
$sortPath = Util::which('sort');

$command = "{$lsBlkPath} -r | {$grepPath} ' part' | {$sortPath} -u | {$cutPath} -d ' ' -f 1 | {$grepPath} \"" . basename(
$dev
) . "\" | {$grepPath} \"{$part}\$\"";
$command = "$lsBlkPath -r -p | $grepPath ' part' | $sortPath -u | $cutPath -d ' ' -f 1 | $grepPath '" . basename($dev) . "' | $grepPath \"$part\$\"";
Processes::mwExec($command, $out);
$devName = trim(implode('', $out));
return '/dev/'.trim($devName);
return trim($devName);
}

/**
Expand Down

0 comments on commit 4716d08

Please sign in to comment.