Skip to content

Commit

Permalink
build: expand filesystem during first boot
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Oct 31, 2017
1 parent 515b731 commit b27974f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
4 changes: 2 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
35 changes: 34 additions & 1 deletion nextcloudpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit b27974f

Please sign in to comment.