#!/bin/bash ### BEGIN INIT INFO # Provides: secondrun # Required-Start: $all # Required-Stop: # Should-Start: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Script to run when second starting # Description: Expanding rottfs ### END INIT INFO # script from https://github.com/igorpecovnik/lib # modified by https://github.com/bleuchtang/sunxi-debian N=/etc/init.d/secondrun case "$1" in start) echo "" echo "##########################################" echo "## SECONDRUN INIT SCRIPT ##" echo "## WAIT SOME MINUTES FOR CONFIGURATIONS ##" echo "##########################################" echo "" echo "##############################" echo "# Expanding rootfs partition #" echo "##############################" echo "" /sbin/resize2fs /dev/mmcblk0p1 /sbin/insserv -r secondrun ;; *) echo "Usage: $N {start}" >&2 exit 1 ;; esac exit 0