#!/bin/sh
#
# Copyright (c) 2020-2022 HandsomeMod Project
#
# This file is licensed under the terms of the GNU General Public
# License version 2. This program is licensed "as is" without any
# warranty of any kind, whether express or implied.

rootpart=$(findmnt -n -o SOURCE /)
mount -o ro,remount /
tune2fs -O^resize_inode ${rootpart}
fsck.ext4 -yDf ${rootpart} > /dev/null
mount -o rw,remount /
resize2fs ${rootpart} > /dev/null

apk del rootfs-resizer
reboot
