diff --git a/src/Core/System/PBXInstaller.php b/src/Core/System/PBXInstaller.php index 8ba1c9db2..62a21582e 100644 --- a/src/Core/System/PBXInstaller.php +++ b/src/Core/System/PBXInstaller.php @@ -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; diff --git a/src/Core/System/Storage.php b/src/Core/System/Storage.php index fd39992d9..1033704c0 100644 --- a/src/Core/System/Storage.php +++ b/src/Core/System/Storage.php @@ -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); } /**