FunKey-OS/FunKey/board/funkey/rootfs-overlay/etc/init.d/S02resize_rootfs

25 lines
512 B
Bash
Executable File

#!/bin/sh
THIS=$(basename $0)
case "$1" in
start)
sleep 1
echo "$THIS: starting resizing the root partition" | tee /dev/kmsg &&
resize_rootfs &&
rm /etc/init.d/S02resize_rootfs
if [ $? -eq 0 ]; then
echo "$THIS: finished resizing the root partition, rebooting to enlarge the root filesystem" | tee /dev/kmsg
reboot
exit 0
else
echo "$THIS: cannot resize the root partition, aborting" | tee /dev/kmsg
exit 1
fi
;;
*)
echo "Usage: $0 start" >&2
exit 2
;;
esac