mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-28 16:58:03 +01:00
extend sd card before fatpack (#3783)
This commit is contained in:
parent
4cbdde88c2
commit
7943fe0611
2 changed files with 26 additions and 1 deletions
|
@ -32,7 +32,7 @@ minimumSizeByte=16384000000
|
|||
rootPartition=$(sudo mount | grep " / " | cut -d " " -f 1 | cut -d "/" -f 3)
|
||||
rootPartitionBytes=$(lsblk -b -o NAME,SIZE | grep "${rootPartition}" | tr -s ' ' | cut -d " " -f 2)
|
||||
|
||||
# make conculsions
|
||||
# make conclusions
|
||||
needsExpansion=0
|
||||
tooSmall=0
|
||||
if [ $rootPartitionBytes -lt $minimumSizeByte ]; then
|
||||
|
|
|
@ -9,6 +9,31 @@ if [ "$EUID" -ne 0 ]
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# check if sd card needs expansion before fatpack
|
||||
source <(sudo /home/admin/config.scripts/blitz.bootdrive.sh status)
|
||||
if [ "${fsexpanded}" != "1" ]; then
|
||||
|
||||
echo "################################################"
|
||||
echo "# SD CARD NEEDS EXPANSION BEFORE FATPACK"
|
||||
echo "# this will be done now ... and trigger a reboot"
|
||||
echo "# after reboot run this script again"
|
||||
echo "################################################"
|
||||
|
||||
# write a stop file to prevent full bootstrap
|
||||
# after fsexpand reboot
|
||||
touch /boot/stop
|
||||
|
||||
# trigger fsexpand
|
||||
/home/admin/config.scripts/blitz.bootdrive.sh fsexpand
|
||||
|
||||
# make sure this expand is not marked (because its not done after release)
|
||||
sed -i "s/^fsexpanded=.*/fsexpanded=0/g" /home/admin/raspiblitz.info
|
||||
|
||||
# trigger reboot
|
||||
shutdown -h -r now
|
||||
exit 0
|
||||
fi
|
||||
|
||||
apt_install() {
|
||||
apt install -y ${@}
|
||||
if [ $? -eq 100 ]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue