#!/bin/sh
set -e

if [ -n "$D" ]; then
    $INTERCEPT_DIR/postinst_intercept delay_to_first_boot resize-rootfs mlprefix=
    exit 0
fi
    root=`mount | grep "on / " | awk -F' ' '{print $1}'`
    if [[ "$root" == *"sdcard"* ]]; then
    echo "Running on temporary installation, ignoring resize of filesystem."
    else
    echo "Resizing root partition to fill userdata..."
    resize2fs "$root"
    fi
