mirror of
https://github.com/FOGProject/fos.git
synced 2026-04-11 23:25:55 -05:00
Merge pull request #9 from FOGProject/revert-8-revert-7-master
Revert "Revert "Fix some regex patterns and logic for setting UUID partition type info""
This commit is contained in:
@@ -807,6 +807,7 @@ makeAllSwapSystems() {
|
||||
[[ -z $imgPartitionType ]] && handleError "No image partition type passed (${FUNCNAME[0]})\n Args Passed: $*"
|
||||
local swapuuidfilename=""
|
||||
swapUUIDFileName "$imagePath" "$disk_number"
|
||||
[[ -r "$swapuuidfilename" ]] || return
|
||||
local parts=""
|
||||
local part=""
|
||||
local part_number=0
|
||||
|
||||
@@ -85,10 +85,10 @@ restoreUUIDInformation() {
|
||||
for part in $parts; do
|
||||
partitionIsSwap "$part"
|
||||
getPartitionNumber "$part"
|
||||
local escape_part=$(escapeItem $part)
|
||||
[[ $is_swap -gt 0 ]] && continue
|
||||
pat="/^.*\/dev\/[A-Za-z0-9]+([Pp]|)[$part_number].*"
|
||||
partuuid=$(awk -F[,\ ] "match(\$0, ${pat}uuid=([A-Za-z0-9-]+)[,]?.*$/, type){printf(\"%s:%s\", $part_number, tolower(type[2]))}" $sfdiskoriginalpartitionfilename)
|
||||
parttype=$(awk -F[,\ ] "match(\$0, ${pat}type=([A-Za-z0-9-]+)[,]?.*$/, type){printf(\"%s:%s\", $part_number, tolower(type[2]))}" $sfdiskoriginalpartitionfilename)
|
||||
partuuid=$(awk -F[,\ ] "match(\$0, /^${escape_part} : .*uuid=([A-Za-z0-9-]+)[,]?.*$/, type){printf(\"%s:%s\", $part_number, tolower(type[1]))}" $sfdiskoriginalpartitionfilename)
|
||||
parttype=$(awk -F[,\ ] "match(\$0, /^${escape_part} : .*type=([A-Za-z0-9-]+)[,]?.*$/, type){printf(\"%s:%s\", $part_number, tolower(type[1]))}" $sfdiskoriginalpartitionfilename)
|
||||
dots "Partition type being set to"
|
||||
echo $parttype
|
||||
debugPause
|
||||
@@ -354,8 +354,7 @@ makeSwapSystem() {
|
||||
local part_number=""
|
||||
local escape_part=$(escapeItem $part)
|
||||
getPartitionNumber "$part"
|
||||
local pat="/^\/dev\/[A-Za-z0-9]+([Pp]|)[$part_number]\ /"
|
||||
local uuid=$(awk "$pat{print \$2}" $file)
|
||||
local uuid=$(awk "/^${escape_part} /{print \$2}" $file)
|
||||
local hasgpt=0
|
||||
hasGPT "$disk"
|
||||
case $hasgpt in
|
||||
|
||||
Reference in New Issue
Block a user