Adds ability to run root-fs expansion non-interactively by passing the argument --expand-rootfs.

This is very useful if you need to implement an automatic disk space expansion.
This commit is contained in:
Viktor Petersson 2013-03-26 22:58:32 +01:00
parent 9199bf25ea
commit 3320564bd2
2 changed files with 17 additions and 8 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.swp

View File

@ -3,6 +3,7 @@
#
# See LICENSE file for copyright and license details
INTERACTIVE=True
ASK_TO_REBOOT=0
do_info() {
@ -65,8 +66,9 @@ esac
EOF
chmod +x /etc/init.d/resize2fs_once &&
update-rc.d resize2fs_once defaults &&
whiptail --msgbox "Root partition has been resized.\n\
The filesystem will be enlarged upon the next reboot" 20 60 2
if [ "$INTERACTIVE" = True ]; then
whiptail --msgbox "Root partition has been resized.\nThe filesystem will be enlarged upon the next reboot" 20 60 2
fi
}
set_config_var() {
@ -378,6 +380,12 @@ do
printf "Not currently supported\n"
exit 1
;;
--expand-rootfs)
INTERACTIVE=False
do_expand_rootfs
printf "Please reboot\n"
exit 0
;;
*)
# unknown option
;;