The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / src / etc / init.d / resizefs
diff --git a/cirros-testvm/src-cirros/src/etc/init.d/resizefs b/cirros-testvm/src-cirros/src/etc/init.d/resizefs
new file mode 100755 (executable)
index 0000000..1c7c90d
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+# vi: ts=4 noexpandtab
+
+RESIZE_MODE="background"
+GROWROOT="enabled"
+if [ -f /etc/default/resizefs ]; then
+       . /etc/default/resizefs
+fi
+
+case "$1" in
+       start)
+               lxc-is-container && exit 0
+               [ -e /dev/root ] || exit 0
+               case "$GROWROOT" in
+                       disabled|off|0) :;;
+                       *)
+                               growroot /dev/root ||
+                                       { echo "failed growing /dev/root"; exit 1; }
+               esac
+               # here we have to use start-stop-daemon or the resize
+               # process gets killed when rc.sysinit ends (LP: #1261710)
+               case "$RESIZE_MODE" in
+                       background)
+                               cirros-per once resize-rootfs -- \
+                                       start-stop-daemon --start --background \
+                                               --exec=/sbin/resize-filesystem -- \
+                                               /dev/root /run/resize.rootfs /dev/console
+                               ;;
+                       foreground)
+                               cirros-per once resize-rootfs -- \
+                                               /sbin/resize-filesystem \
+                                               /dev/root /run/resize.rootfs /dev/console
+                               ;;
+                       disabled) : ;;
+                       *)
+                               echo "resizefs: unknown RESIZE_MODE='$RESIZE_MODE'." \
+                                       "Doing nothing." 1>&2
+                               ;;
+               esac
+               ;;
+       stop|restart|reload) : ;;
+       *)
+               echo $"Usage: $0 {start}"
+               exit 1
+               ;;
+esac
+
+exit $?