Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2017-10-31 20:40:23 +0300
committernachoparker <nacho@ownyourbits.com>2017-10-31 20:43:34 +0300
commitb27974fde31f1afd1b4cdd48927417eace0fa39c (patch)
tree2853389b60dc02bfa4166596b80c3f0ea972e3fc
parent515b73151f515febcba94f56b6dabf73d42d087f (diff)
build: expand filesystem during first bootv0.31.28
-rw-r--r--changelog.md4
-rw-r--r--nextcloudpi.sh35
2 files changed, 36 insertions, 3 deletions
diff --git a/changelog.md b/changelog.md
index 801ee15b..9eadb8d0 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 5fc71d13..581bcef0 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
}