From b2c81f2e516887139aab262dd9c0379795804399 Mon Sep 17 00:00:00 2001 From: Michael Mrozek Date: Wed, 27 Jun 2012 01:48:55 +0200 Subject: [PATCH 1/1] rc.pandora-state: Now puts a "Yes" into /tmp/nocleanwarn if the system has not shutdown properly. .xinitrc: Checks if there's a "Yes" in /tmp/nocleanwarn and sets it to "No" after having shown the warning. Bumped recipes. --- recipes/pandora-system/pandora-skel.bb | 2 +- recipes/pandora-system/pandora-skel/.xinitrc | 8 +++++--- recipes/pandora-system/pandora-state.bb | 2 +- recipes/pandora-system/pandora-state/rc.pandora-state | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/recipes/pandora-system/pandora-skel.bb b/recipes/pandora-system/pandora-skel.bb index 441eeb6..1155032 100644 --- a/recipes/pandora-system/pandora-skel.bb +++ b/recipes/pandora-system/pandora-skel.bb @@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora" # /etc/skel is used by Shadow's useradd so you really have that installed for this to make sense ;) RDEPENDS = "shadow" -PR = "r16" +PR = "r17" SRC_URI = " \ file://.xinitrc \ diff --git a/recipes/pandora-system/pandora-skel/.xinitrc b/recipes/pandora-system/pandora-skel/.xinitrc index 5fb625a..f22c628 100644 --- a/recipes/pandora-system/pandora-skel/.xinitrc +++ b/recipes/pandora-system/pandora-skel/.xinitrc @@ -85,14 +85,16 @@ chmod +x /tmp/gui.stop # This way, we can easily do a quick switch from any session to the next one by simply # echo'ing the new session executable into /tmp/gui.load and exiting. -if [ -f /tmp/nocleanwarn ]; then +nocleanwarn=$(cat /tmp/nocleanwarn) + +if [ $nocleanwarn = "Yes" ]; then defmhz="$(cat /etc/pandora/conf/cpu.conf | grep default | awk -F\: '{print $2}')" if [ $defmhz -gt 600 ]; then - if zenity --question --title="Unclean Shutdown" --text="Warning!\n\nThe system has not been shutdown properly last time.\n\nAs you overclocked the CPU as default speed, this might be the reason for that.\nTherefore CPU speed has been currently set to 500 MHz.\n\nShould it be set to your default speed ($defmhz MHz) or shall we keep the 500 MHz for this session?" --ok-label="Set it to $defmhz MHz" --cancel-label="Keep 500MHz"; then + if zenity --question --title="Unclean Shutdown" --text="Warning!\n\nThe system has not been shutdown properly last time.\n\nAs you overclocked the CPU as default speed, this might be the reason for that.\nTherefore CPU speed has been currently set to 600 MHz.\n\nShould it be set to your default speed ($defmhz MHz) or shall we keep the 600 MHz for this session?" --ok-label="Set it to $defmhz MHz" --cancel-label="Keep 500MHz"; then sudo /usr/pandora/scripts/op_cpuspeed.sh $defmhz fi fi - rm /tmp/nocleanwarn + echo "No" > /tmp/nocleanwarn fi while true diff --git a/recipes/pandora-system/pandora-state.bb b/recipes/pandora-system/pandora-state.bb index a2ad78e..eb76275 100755 --- a/recipes/pandora-system/pandora-state.bb +++ b/recipes/pandora-system/pandora-state.bb @@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora" RDEPENDS = "pandora-scripts" -PR = "r12" +PR = "r13" inherit update-rc.d INITSCRIPT_NAME = "pandora-state" diff --git a/recipes/pandora-system/pandora-state/rc.pandora-state b/recipes/pandora-system/pandora-state/rc.pandora-state index dc548ba..7fd1de4 100644 --- a/recipes/pandora-system/pandora-state/rc.pandora-state +++ b/recipes/pandora-system/pandora-state/rc.pandora-state @@ -56,7 +56,7 @@ d_start() { /usr/pandora/scripts/op_cpuspeed.sh -n $cpuspeed else echo "No clean shutdown - will not set CPU speed" - touch /tmp/nocleanwarn + echo "Yes" > /tmp/nocleanwarn fi sed -n '1p' /etc/pandora/conf/nubs.state > /proc/pandora/nub0/mode sed -n '2p' /etc/pandora/conf/nubs.state > /proc/pandora/nub0/mouse_sensitivity -- 2.39.2