add expand root fs

This commit is contained in:
Gilles Mouchet 2024-05-21 23:43:05 +02:00
parent c6860c03e8
commit c74809d3b3

View File

@ -77,14 +77,21 @@ printSuccess "rootfs-expand package installed successfully"
# extend root part # extend root part
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
printInfo "Extend root partition" printInfo "Extend root partition"
#partSize=`df --output=size -B 1 "$PWD" |tail -n 1` #rootfs-expand
partSize=`df --output=size -B 1 "$PWD" |tail -n 1`
# For prod
#if [ $partSize -gt 61780000000 ]; then #if [ $partSize -gt 61780000000 ]; then
# printSuccess "Root partion already extended" # For dev
#else if [ $partSize -gt 21407727600 ]; then
printSuccess "Root partion already extended"
else
rootfs-expand
if [ $retVal -ne 0 ]; then printError "Problem to extend root partition";exit; fi
printSuccess "Root partition extended"
# parted /dev/mmcblk0 resizepart 3 100% >/dev/null 2>&1 # parted /dev/mmcblk0 resizepart 3 100% >/dev/null 2>&1
# error=$? # error=$?
# resize2fs /dev/mmcblk0p3 >/dev/null 2>&1 # resize2fs /dev/mmcblk0p3 >/dev/null 2>&1
# let retVal=retVal+$error # let retVal=retVal+$error
# if [ $retVal -ne 0 ]; then printError "Problem to extend root partition";exit; fi # if [ $retVal -ne 0 ]; then printError "Problem to extend root partition";exit; fi
# printSuccess "Root partition extended" # printSuccess "Root partition extended"
#fi fi