Skip to content

Commit

Permalink
Update zimaos-fix.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrykuku authored Jul 12, 2024
1 parent f44a280 commit 0aac678
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions zimaos-fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ temp_file=$(mktemp)
tmpRoot="/tmp/root"
mkdir -p "$tmpRoot"
rootfs=$(mount | grep ' / ' | cut -d ' ' -f 1)
p8=$(mount | grep ' /DATA ' | cut -d ' ' -f 1)

mount "$rootfs" /tmp/root > /dev/null 2>&1

find /mnt/overlay/etc/ -type f -exec sh -c 'for f; do [ ! -s "$f" ] && echo "$f"; done' sh {} + > "$temp_file"
Expand All @@ -20,6 +22,17 @@ done < "$temp_file"
rm "$temp_file"
umount "$tmpRoot"

if [ -n "$p8" ]; then
p8_size=$(df -BG | grep "$p8" | awk '{print $2}')
p8_size=${p8_size%G}
if [ "$p8_size" -lt 2 ]; then
echo "Expanding..."
resize2fs "$p8"
echo "Partition 8 expanded."
fi
fi


if [ $counter -gt 0 ]; then
echo "Done! Please reboot your device."
exit 0
Expand Down

0 comments on commit 0aac678

Please sign in to comment.