Updated variable names and casing
This commit is contained in:
32
partition.sh
32
partition.sh
@@ -8,14 +8,14 @@ source \
|
||||
source \
|
||||
"${BASEDIR}/system.conf"
|
||||
|
||||
if [[ ! "${DISK}" == **/dev/disk/by-id/** ]]; then
|
||||
if [[ "${DISK}" == **/dev/nvme** ]]; then
|
||||
PART3='p3'
|
||||
if [[ ! "${disk}" == **/dev/disk/by-id/** ]]; then
|
||||
if [[ "${disk}" == **/dev/nvme** ]]; then
|
||||
part3='p3'
|
||||
else
|
||||
PART3='3'
|
||||
part3='3'
|
||||
fi
|
||||
else
|
||||
PART3='-part3'
|
||||
part3='-part3'
|
||||
fi
|
||||
|
||||
swapoff \
|
||||
@@ -23,36 +23,36 @@ swapoff \
|
||||
|
||||
wipefs \
|
||||
-a \
|
||||
${DISK}
|
||||
${disk}
|
||||
|
||||
if [[ ! "${DISK_TYPE}" == 'HDD' ]]; then
|
||||
if [[ ! "${diskType}" == 'HDD' ]]; then
|
||||
blkdiscard \
|
||||
-f \
|
||||
${DISK}
|
||||
${disk}
|
||||
fi
|
||||
|
||||
sgdisk \
|
||||
--zap-all \
|
||||
${DISK}
|
||||
${disk}
|
||||
|
||||
sgdisk \
|
||||
-n1:0:+512M \
|
||||
-t1:EF00 \
|
||||
-c1:EFI \
|
||||
${DISK}
|
||||
${disk}
|
||||
|
||||
if [[ "${ENABLE_SWAP}" == "yes" ]]; then
|
||||
SWAP_SIZE="$(((($(vmstat -sS M | grep 'total memory' | sed 's/ M total memory//') / 1024) + 1) * 2))"
|
||||
if [[ "${enableSwap}" == "yes" ]]; then
|
||||
swapSize="$(((($(vmstat -sS M | grep 'total memory' | sed 's/ M total memory//') / 1024) + 1) * 2))"
|
||||
|
||||
if [[ "${SWAP_SIZE#}" -gt '32' ]]; then
|
||||
SWAP_SIZE='32'
|
||||
if [[ "${swapSize#}" -gt '32' ]]; then
|
||||
swapSize='32'
|
||||
fi
|
||||
|
||||
sgdisk \
|
||||
-n2:0:+${SWAP_SIZE}G \
|
||||
-n2:0:+${swapSize}G \
|
||||
-t2:BF02 \
|
||||
-c2:swap \
|
||||
${DISK}
|
||||
${disk}
|
||||
fi
|
||||
|
||||
sgdisk \
|
||||
|
||||
Reference in New Issue
Block a user