deactivating resize for RC1

This commit is contained in:
rootzoll 2021-03-27 16:43:55 +01:00
parent 2dc8f84071
commit 133da8d99b

View File

@ -48,51 +48,51 @@ rootPartitionBytes=$(lsblk -b -o NAME,SIZE | grep "${rootPartition}" | tr -s ' '
echo "rootPartition(${rootPartition})" >> ${logFile}
echo "rootPartitionBytes(${rootPartitionBytes})" >> ${logFile}
if [ ${#rootPartition} -gt 0 ]; then
echo "### CHECKING ROOT PARTITION SIZE ###" >> ${logFile}
sudo sed -i "s/^message=.*/message='Checking Disk size'/g" ${infoFile}
echo "Size in Bytes is: ${rootPartitionBytes} bytes on ($rootPartition)" >> ${logFile}
if [ $rootPartitionBytes -lt $minimumSizeByte ]; then
echo "Disk filesystem is smaller than ${minimumSizeByte} byte." >> ${logFile}
if [ ${fsexpanded} -eq 1 ]; then
echo "There was already an attempt to expand the fs, but still not bigger than 8GB." >> ${logFile}
echo "SD card seems to small - at least a 16GB disk is needed. Display on LCD to user." >> ${logFile}
sudo sed -i "s/^state=.*/state=sdtoosmall/g" ${infoFile}
sudo sed -i "s/^message=.*/message='Min 16GB SD card needed'/g" ${infoFile}
exit 1
else
echo "Try to expand SD card FS, display info and reboot." >> ${logFile}
sudo sed -i "s/^state=.*/state=reboot/g" ${infoFile}
sudo sed -i "s/^message=.*/message='Expanding SD Card'/g" ${infoFile}
sudo sed -i "s/^fsexpanded=.*/fsexpanded=1/g" ${infoFile}
if [ "${cpu}" == "x86_64" ]; then
echo "Please expand disk size." >> ${logFile}
# TODO: Expand disk size on x86_64
elif [ ${isRaspbian} -gt 0 ]; then
if [ -x ${resizeRaspbian} ]; then
echo "RUNNING EXPAND: ${resizeRaspbian}" >> ${logFile}
sudo $resizeRaspbian --expand-rootfs
else
echo "FAIL to execute: ${resizeRaspbian}" >> ${logFile}
fi
elif [ ${isArmbian} -gt 0 ]; then
if [ -x ${resizeArmbian} ]; then
echo "RUNNING EXPAND: ${resizeArmbian}" >> ${logFile}
sudo $resizeArmbian start
else
echo "FAIL to execute: ${resizeArmbian}" >> ${logFile}
fi
fi
sleep 6
sudo shutdown -r now
exit 0
fi
else
echo "Size looks good. Bigger than ${minimumSizeByte} byte disk is used." >> ${logFile}
fi
else
echo "Disk of root partition ('$rootPartition') not detected, skipping the size check." >> ${logFile}
fi
#if [ ${#rootPartition} -gt 0 ]; then
# echo "### CHECKING ROOT PARTITION SIZE ###" >> ${logFile}
# sudo sed -i "s/^message=.*/message='Checking Disk size'/g" ${infoFile}
# echo "Size in Bytes is: ${rootPartitionBytes} bytes on ($rootPartition)" >> ${logFile}
# if [ $rootPartitionBytes -lt $minimumSizeByte ]; then
# echo "Disk filesystem is smaller than ${minimumSizeByte} byte." >> ${logFile}
# if [ ${fsexpanded} -eq 1 ]; then
# echo "There was already an attempt to expand the fs, but still not bigger than 8GB." >> ${logFile}
# echo "SD card seems to small - at least a 16GB disk is needed. Display on LCD to user." >> ${logFile}
# sudo sed -i "s/^state=.*/state=sdtoosmall/g" ${infoFile}
# sudo sed -i "s/^message=.*/message='Min 16GB SD card needed'/g" ${infoFile}
# exit 1
# else
# echo "Try to expand SD card FS, display info and reboot." >> ${logFile}
# sudo sed -i "s/^state=.*/state=reboot/g" ${infoFile}
# sudo sed -i "s/^message=.*/message='Expanding SD Card'/g" ${infoFile}
# sudo sed -i "s/^fsexpanded=.*/fsexpanded=1/g" ${infoFile}
# if [ "${cpu}" == "x86_64" ]; then
# echo "Please expand disk size." >> ${logFile}
# # TODO: Expand disk size on x86_64
# elif [ ${isRaspbian} -gt 0 ]; then
# if [ -x ${resizeRaspbian} ]; then
# echo "RUNNING EXPAND: ${resizeRaspbian}" >> ${logFile}
# sudo $resizeRaspbian --expand-rootfs
# else
# echo "FAIL to execute: ${resizeRaspbian}" >> ${logFile}
# fi
# elif [ ${isArmbian} -gt 0 ]; then
# if [ -x ${resizeArmbian} ]; then
# echo "RUNNING EXPAND: ${resizeArmbian}" >> ${logFile}
# sudo $resizeArmbian start
# else
# echo "FAIL to execute: ${resizeArmbian}" >> ${logFile}
# fi
# fi
# sleep 6
# sudo shutdown -r now
# exit 0
# fi
# else
# echo "Size looks good. Bigger than ${minimumSizeByte} byte disk is used." >> ${logFile}
# fi
#else
# echo "Disk of root partition ('$rootPartition') not detected, skipping the size check." >> ${logFile}
#fi
# import config values
sudo chmod 777 ${configFile}