+printf "Backing up $CONFIG\n"
+cp $CONFIG "config.preinstall-$DATESTAMP.txt"
+
+printf "Setting up serial for PMS5003..\n"
+# Disable serial terminal over /dev/ttyAMA0
+raspi-config nonint do_serial 1
+# Enable serial port
+raspi-config nonint set_config_var enable_uart 1 $CONFIG
+# Switch serial port to full UART for stability (may adversely affect bluetooth)
+sed -i 's/^#dtoverlay=pi3-miniuart-bt/dtoverlay=pi3-miniuart-bt/' $CONFIG
+if ! grep -q -E "^dtoverlay=pi3-miniuart-bt" $CONFIG; then
+ printf "dtoverlay=pi3-miniuart-bt\n" >> $CONFIG
+fi
+