diff --git a/changelog.md b/changelog.md index 801ee15ba..9eadb8d05 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,7 @@ -[v0.31.28](https://github.com/nextcloud/nextcloudpi/commit/57f516e) (2017-10-31) nc-backup: check available sapace +[v0.31.28](https://github.com/nextcloud/nextcloudpi/commit/ce81f39) (2017-10-31) build: expand filesystem during first boot -[v0.31.27](https://github.com/nextcloud/nextcloudpi/commit/2eda5f8) (2017-10-31) nc-restore: restore db password before occ command +[v0.31.27](https://github.com/nextcloud/nextcloudpi/commit/6df5707) (2017-10-31) nc-backup: check available space [v0.31.26](https://github.com/nextcloud/nextcloudpi/commit/f5ac88d) (2017-10-30) build: check ncp-launcher existence for old images diff --git a/nextcloudpi.sh b/nextcloudpi.sh index 5fc71d13d..581bcef07 100644 --- a/nextcloudpi.sh +++ b/nextcloudpi.sh @@ -198,7 +198,40 @@ cleanup() rm /var/lib/apt/lists/* -r rm -f /home/pi/.bash_history - rm /etc/udev/rules.d/90-qemu.rules + # remove QEMU specific rules + rm -f /etc/udev/rules.d/90-qemu.rules + + # restore expand filesystem on first boot + cat > /etc/init.d/resize2fs_once <<'EOF' +#!/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" && \ + resize2fs /dev/mmcblk0p2 && \ + update-rc.d resize2fs_once remove && \ + rm /etc/init.d/resize2fs_once && \ + log_end_msg $? + ;; + *) + echo "Usage: $0 start" >&2 + exit 3 + ;; +esac +EOF + chmod +x /etc/init.d/resize2fs_once + systemctl enable resize2fs_once systemctl disable ssh }