burrow-pi-img/stage2/01-sys-tweaks/files/resize2fs_once
2018-11-16 00:52:05 -08:00

27 lines
623 B
Bash

#!/bin/sh
### BEGIN INIT INFO
# Provides: resize2fs_once
# Required-Start:
# Required-Stop:
# Default-Start: 3
# Default-Stop:
# Short-Description: Resize the root filesystem to fill partition
# Description:
### END INIT INFO
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting resize2fs_once"
ROOT_DEV=$(findmnt / -o source -n) &&
resize2fs $ROOT_DEV &&
update-rc.d resize2fs_once remove &&
rm /etc/init.d/resize2fs_once &&
sed -i '/vfat\|ext4/s/defaults/defaults,ro/' /etc/fstab &&
log_end_msg $?
;;
*)
echo "Usage: $0 start" >&2
exit 3
;;
esac