scripts/QCOM: Disable auto-suspend on GNOME desktop
Causes problems when DB845c enters in s2idle and never recovers.
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
Change-Id: Ib8d6dfcf3bdb6b9499fe8936bf0a0a19c7e58772
diff --git a/scripts/QCOM/21-customize b/scripts/QCOM/21-customize
index 27a216c..6fcfe39 100755
--- a/scripts/QCOM/21-customize
+++ b/scripts/QCOM/21-customize
@@ -38,3 +38,24 @@
cp $target/boot/initrd.img-${KVERS} $OUT/
cp $target/boot/config-${KVERS} $OUT/
cp $target/boot/System.map-${KVERS} $OUT/
+
+# Disable GDM3 suspend causes problems in DB845c
+# GDM provides PostLogin hook but dosen't set DISPLAY and dconf.
+# gsettings tools cannot be used.
+if [ -d $target/etc/gdm3 ]; then
+ mkdir -p $target/home/linaro/.config/autostart/
+ cat > $target/home/linaro/.config/autostart/nosuspend.desktop << EOF
+[Desktop Entry]
+Encoding=UTF-8
+Exec=/usr/bin/dconf write /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type "'nothing'"
+Name=Disable suspend
+Comment=Disable suspend on GNOME3
+Terminal=false
+OnlyShowIn=GNOME
+Type=Application
+StartupNotify=false
+X-GNOME-Autostart-enabled=true
+EOF
+
+ chroot $target chown -R linaro:linaro /home/linaro/.config
+fi