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
1 #!/bin/sh
2 # vi: ts=4 noexpandtab
3
4 RESIZE_MODE="background"
5 GROWROOT="enabled"
6 if [ -f /etc/default/resizefs ]; then
7         . /etc/default/resizefs
8 fi
9
10 case "$1" in
11         start)
12                 lxc-is-container && exit 0
13                 [ -e /dev/root ] || exit 0
14                 case "$GROWROOT" in
15                         disabled|off|0) :;;
16                         *)
17                                 growroot /dev/root ||
18                                         { echo "failed growing /dev/root"; exit 1; }
19                 esac
20                 # here we have to use start-stop-daemon or the resize
21                 # process gets killed when rc.sysinit ends (LP: #1261710)
22                 case "$RESIZE_MODE" in
23                         background)
24                                 cirros-per once resize-rootfs -- \
25                                         start-stop-daemon --start --background \
26                                                 --exec=/sbin/resize-filesystem -- \
27                                                 /dev/root /run/resize.rootfs /dev/console
28                                 ;;
29                         foreground)
30                                 cirros-per once resize-rootfs -- \
31                                                 /sbin/resize-filesystem \
32                                                 /dev/root /run/resize.rootfs /dev/console
33                                 ;;
34                         disabled) : ;;
35                         *)
36                                 echo "resizefs: unknown RESIZE_MODE='$RESIZE_MODE'." \
37                                         "Doing nothing." 1>&2
38                                 ;;
39                 esac
40                 ;;
41         stop|restart|reload) : ;;
42         *)
43                 echo $"Usage: $0 {start}"
44                 exit 1
45                 ;;
46 esac
47
48 exit $?