#!/bin/bash

/usr/bin/raspi-config --expand-rootfs > /dev/null 2>&1

/bin/sed -i~ '/\/root\/nems\/nems-tools\/gpio-extender\/raspi-resize/d' /etc/rc.local

# Log that patch (resize) has been applied to this system
# Activates features such as bootscreen.sh
if ! grep -q "PATCH-000002" /var/log/nems/patches.log; then
  echo "PATCH-000002" >> /var/log/nems/patches.log
fi

sync
reboot
