# Mount device partitions

description "Mount device partitions"

start on (startup
    and started udev)

emits mounted-android

task

script
    mkdir -p /dev/cpuset
    mount none /dev/cpuset -t cpuset -o nodev,noexec,nosuid

    bash /usr/sbin/mount-android.sh

    # Store updates on userdata partition since cache is too small
    umount /android/cache || true
    mkdir -p /userdata/cache
    mount -o bind /userdata/cache /android/cache
    mkdir -p /android/cache/recovery

    if [ -d /android/metadata ]; then
        mount -o bind /android/metadata /var/lib/lxc/android/rootfs/metadata
    fi
    initctl emit -n mounted-android
end script

