rpms/olpc-utils/F-10 diskspace.patch, NONE, 1.1 olpc-login, NONE, 1.1 olpc-utils-touchpad.patch, NONE, 1.1 x11-input.fdi, NONE, 1.1 xorg-dcon.conf, NONE, 1.1 olpc-utils.spec, 1.3, 1.4

Peter Robinson pbrobinson at fedoraproject.org
Sat Dec 6 10:29:52 UTC 2008


Author: pbrobinson

Update of /cvs/pkgs/rpms/olpc-utils/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18480

Modified Files:
	olpc-utils.spec 
Added Files:
	diskspace.patch olpc-login olpc-utils-touchpad.patch 
	x11-input.fdi xorg-dcon.conf 
Log Message:
- sync with OLPC branch


diskspace.patch:

--- NEW FILE diskspace.patch ---
commit fc768d34a543ca40cd4d84e38da522bcccf9ebe3
Author: Chris Ball <cjb at laptop.org>
Date:   Sat Sep 27 20:50:43 2008 -0400

    dlo#7932: Fix failsafe script in the presence of pretty-boot.
    
    This is more complicated than I'd hoped.  In the presence of pretty-boot
    we're started with input coming in on tty2 but output happening on tty1.
    The resolution is to have one script that checks to see whether we're
    in pretty-boot and switches to VT2 if we are, and to move the script
    that actually does input/output to "diskspacerecover".  On ugly-boot
    it'll run on tty1 as normal, on pretty-boot it'll run on tty2.
    
    A long-term fix is to have /etc/init.d/z-boot-anim-stop return us to
    a more sane environment than this; it should set the controlling
    terminal back to tty1 and chvt 1, but I wasn't able to make this work.

diff --git a/etc/rc.d/init.d/diskspacecheck b/etc/rc.d/init.d/diskspacecheck
index c4411a5..7095fa2 100755
--- a/etc/rc.d/init.d/diskspacecheck
+++ b/etc/rc.d/init.d/diskspacecheck
@@ -2,110 +2,38 @@
 # -*- coding: utf-8 -*-
 #
 # chkconfig: 345 02 02
-# description: If the NAND doesn't have enough free space, delete datastore\
-#              objects until it does.  This doesn't modify the datastore's\
-#              index.
+# description: If the NAND doesn't have enough free space, set up a VT for\
+#              diskspacerecover.
 # processname: diskspacecheck
 
 # Author:      Chris Ball <cjb at laptop.org>
 
-import os, sys, statvfs, subprocess, shutil
+import os, sys, statvfs, pyvt, time
 
 THRESHOLD = 1024 * 20  # 20MB
 DATASTORE_PATH = "/home/olpc/.sugar/default/datastore/store/*-*"
 ACTIVITY_PATH  = "/home/olpc/Activities/*"
 
-def main():
-    # First, check to see whether we have enough free space.
-    if find_freespace() < THRESHOLD:
-        print "Not enough disk space."
-
-        # Per Trac #5637, delete orphaned leaks in .sugar/default/data.
-        # This is safe on any build.
-        try:
-            shutil.rmtree("/home/olpc/.sugar/default/data")
-        except OSError:
-            pass
-        
-        if find_freespace() >= THRESHOLD:
-            # The above gained enough free space.
-            return
-
-        # Okay, we'll have to delete some real data.
-        # Add datastore files to filelist string
-        lines = os.popen("du -s %s" % DATASTORE_PATH).readlines()
-        
-        # Add activities to filelist
-        lines += (os.popen("du -s %s" % ACTIVITY_PATH).readlines())
-        
-        filesizes = [line.split('\t') for line in lines]
-        for file in filesizes:
-           file[0] = int(file[0])     # size
-           file[1] = file[1].rstrip() # path
-        filesizes.sort()
-        filelist = [file[1] for file in filesizes]
-        
-        # Unfreeze the DCON, print a message.
-        unfreeze_dcon()
-
-        # The below string is in latin-1, because Unicode isn't present
-        # in the environment when this script runs.
-        string = u"""
-Your disk is nearly full.  The system cannot operate with a full disk.
-To create free space, some of the entries in your Journal will now be
-deleted.  If you wish to avoid having items deleted, power down your
-XO and bring it to an expert for backup and recovery.
-
-Error code:  DISKFULL
-
-Press the return key to delete some Journal entries, or the 'c' key 
-and then return key to attempt to boot anyway.
-
-
-Su disco está casi lleno.  El sistema no puede funcionar si el disco
-está lleno.  Para liberar espacio, se deben borrar algunas entradas de
-su Diario ahora.  Si prefiere no tener que borrar datos, apague su XO y
-llévelo a un experto para que haga una copia de seguridad y
-recuperación de datos.
-
-Código del error:  DISKFULL
-
-Pulse retorno tecla para borrar algunas entradas del Diario, o presiona 
-'c' y retorno para iniciar de cualquier manera.
-"""
-
-        key = raw_input(string.encode('utf-8'))
-
-        if key is 'c':
-           return
-            
-        # Now, delete files/directories one at a time.
-        while find_freespace() < THRESHOLD and len(filelist) > 0:
-            delete_entry(filelist.pop())
-
-def find_freespace():
-    # Determine free space on /.
-    stat = os.statvfs("/")
-    freebytes  = stat[statvfs.F_BSIZE] * stat[statvfs.F_BAVAIL]
-    freekbytes = freebytes / 1024
-    return freekbytes
-
-def delete_entry(entry):
-    # Delete a single file from the datastore, or an activity directory
-    print "Deleting " + entry
-    try:
-        if os.path.isdir(entry):
-            shutil.rmtree(entry)
-        else:
-            os.remove(entry)                
-    except OSError:
-        print "Couldn't delete " + entry
-
-def unfreeze_dcon():
-    # Don't think there's anything useful I can do if this write fails.
-    dcon = open('/sys/class/backlight/dcon-bl/device/freeze', 'w')
-    dcon.write('0')
-    dcon.close()
-    os.system("/sbin/setsysfont")
-    os.system("/bin/unicode_start sun12x22")
-main()
+# Determine free space on /.
+stat = os.statvfs("/")
+freebytes  = stat[statvfs.F_BSIZE] * stat[statvfs.F_BAVAIL]
+freekbytes = freebytes / 1024
+
+# If we have enough disk space, exit.
+if freekbytes > THRESHOLD:
+    exit
+
+# Disable pretty-boot.
+if os.system("ps awux | grep 0-boot-anim-start | grep -v grep") == 0:
+    # Pretty-boot is running.  Kill it, and set up a new VT for the next script.
+    os.system("/etc/init.d/z-boot-anim-stop start")
+    pyvt.chcon("/dev/tty1")
+    pyvt.chcon("/dev/console")
+    pyvt.chvt(2)
+
+# Don't think there's anything useful I can do if this write fails.
+dcon = open('/sys/class/backlight/dcon-bl/device/freeze', 'w')
+dcon.write('0')
+dcon.close()
+os.system("/sbin/setsysfont")
+os.system("/bin/unicode_start sun12x22")
diff --git a/etc/rc.d/init.d/diskspacerecover b/etc/rc.d/init.d/diskspacerecover
new file mode 100755
index 0000000..050a051
--- /dev/null
+++ b/etc/rc.d/init.d/diskspacerecover
@@ -0,0 +1,101 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# chkconfig: 345 03 03
+# description: If the NAND doesn't have enough free space, delete datastore\
+#              objects until it does.  This doesn't modify the datastore's\
+#              index.
+# processname: diskspacerecover
+
+# Author:      Chris Ball <cjb at laptop.org>
+
+import os, sys, statvfs, subprocess, shutil, fcntl
+
+THRESHOLD = 1024 * 600  # 20MB
+DATASTORE_PATH = "/home/olpc/.sugar/default/datastore/store/*-*"
+ACTIVITY_PATH  = "/home/olpc/Activities/*"
+
+def main():
+    # First, check to see whether we have enough free space.
+    if find_freespace() < THRESHOLD:
+        print "Not enough disk space."
+
+        # Per Trac #5637, delete orphaned leaks in .sugar/default/data.
+        # This is safe on any build.
+        try:
+            shutil.rmtree("/home/olpc/.sugar/default/data")
+        except OSError:
+            pass
+        
+        if find_freespace() >= THRESHOLD:
+            # The above gained enough free space.
+            return
+
+        # Okay, we'll have to delete some real data.
+        # Add datastore files to filelist string
+        lines = os.popen("du -s %s" % DATASTORE_PATH).readlines()
+        
+        # Add activities to filelist
+        lines += (os.popen("du -s %s" % ACTIVITY_PATH).readlines())
+        
+        filesizes = [line.split('\t') for line in lines]
+        for file in filesizes:
+           file[0] = int(file[0])     # size
+           file[1] = file[1].rstrip() # path
+        filesizes.sort()
+        filelist = [file[1] for file in filesizes]
+        
+        # The below string is in latin-1, because Unicode isn't present
+        # in the environment when this script runs.
+        string = u"""
+Your disk is nearly full.  The system cannot operate with a full disk.
+To create free space, some of the entries in your Journal will now be
+deleted.  If you wish to avoid having items deleted, power down your
+XO and bring it to an expert for backup and recovery.
+
+Error code:  DISKFULL
+
+Press the return key to delete some Journal entries, or the 'c' key 
+and then return key to attempt to boot anyway.
+
+
+Su disco está casi lleno.  El sistema no puede funcionar si el disco
+está lleno.  Para liberar espacio, se deben borrar algunas entradas de
+su Diario ahora.  Si prefiere no tener que borrar datos, apague su XO y
+llévelo a un experto para que haga una copia de seguridad y
+recuperación de datos.
+
+Código del error:  DISKFULL
+
+Pulse retorno tecla para borrar algunas entradas del Diario, o presiona 
+'c' y retorno para iniciar de cualquier manera.
+"""
+
+        key = raw_input(string.encode('utf-8'))
+
+        if key is 'c':
+           return
+            
+        # Now, delete files/directories one at a time.
+        while find_freespace() < THRESHOLD and len(filelist) > 0:
+            delete_entry(filelist.pop())
+
+def find_freespace():
+    # Determine free space on /.
+    stat = os.statvfs("/")
+    freebytes  = stat[statvfs.F_BSIZE] * stat[statvfs.F_BAVAIL]
+    freekbytes = freebytes / 1024
+    return freekbytes
+
+def delete_entry(entry):
+    # Delete a single file from the datastore, or an activity directory
+    print "Deleting " + entry
+    try:
+        if os.path.isdir(entry):
+            shutil.rmtree(entry)
+        else:
+            os.remove(entry)                
+    except OSError:
+        print "Couldn't delete " + entry
+
+main()


--- NEW FILE olpc-login ---
#%PAM-1.0
auth       required    pam_env.so
auth       required    pam_permit.so
account    required    pam_nologin.so
account    include     system-auth
password   include     system-auth
session    optional    pam_keyinit.so force revoke
session    include     system-auth
session    required    pam_loginuid.so
session    optional    pam_console.so


olpc-utils-touchpad.patch:

--- NEW FILE olpc-utils-touchpad.patch ---
--- olpc-utils-0.73-orig/olpc-session	2008-05-15 15:39:42.000000000 -0500
+++ olpc-utils-0.73/olpc-session	2008-06-13 13:46:06.000000000 -0500
@@ -34,7 +34,7 @@
 export GTK_IM_MODULE
 
 # set mouse & keyboard speed
-xset m 7/4 0 
+xset m 7/4 2 
 xset r rate 500 30
 
 [ -n "$XKB_OPTION" ] && XKB_OPTION=`echo "$XKB_OPTION" | sed -e 's/\b/-option /g'`


--- NEW FILE x11-input.fdi ---
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.touchpad">
      <merge key="input.x11_driver" type="string">mouse</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.x11_driver" type="string">evdev</merge>
      </match>
    </match>

    <match key="info.capabilities" contains="input.mouse">
      <merge key="input.x11_driver" type="string">mouse</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.x11_driver" type="string">evdev</merge>
      </match>
    </match>

    <match key="info.capabilities" contains="input.keys">
      <merge key="input.xkb.rules" type="string">base</merge>

      <!-- If we're using Linux, we use evdev by default (falling back to
           keyboard otherwise). -->
      <merge key="input.x11_driver" type="string">keyboard</merge>
      <merge key="input.xkb.model" type="string">olpc</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.x11_driver" type="string">evdev</merge>
        <merge key="input.xkb.model" type="string">evdev</merge>
      </match>

      <merge key="input.xkb.layout" type="string">us</merge>

      <merge key="input.xkb.variant" type="string" />
    </match>

    <!-- older versions of HAL use "keyboard" instead of keys -->
    <match key="info.capabilities" contains="input.keyboard">
      <merge key="input.xkb.rules" type="string">base</merge>

      <!-- If we're using Linux, we use evdev by default (falling back to
           keyboard otherwise). -->
      <merge key="input.x11_driver" type="string">keyboard</merge>
      <merge key="input.xkb.model" type="string">pc105</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.x11_driver" type="string">evdev</merge>
        <merge key="input.xkb.model" type="string">evdev</merge>
      </match>

      <merge key="input.xkb.layout" type="string">us</merge>

      <merge key="input.xkb.variant" type="string" />
    </match>
  </device>
</deviceinfo>


--- NEW FILE xorg-dcon.conf ---
# Xorg configuration file for OLPC

Section "ServerLayout"
	Identifier     "Default Layout"
	Screen      0  "Screen0" 0 0
EndSection

#Section "ServerFlags"
	#Option "AllowEmptyInput" "yes"
#EndSection

Section "Module"
	SubSection "extmod"
		Option "omit XFree86-DGA"
		#Option "omit XFree86-Misc" # needed by 'xset m'
		Option "omit MIT-SUNDRY-NONSTANDARD"
		Option "omit TOG-CUP"
		Option "omit Extended-Visual-Information"
	EndSubSection
	Load  "freetype"
	Load  "evdev"
	# Load "record" # Mostly a debugging tool
EndSection

Section "Extensions"
	Option  "XTEST" "Disable" # Mostly a debugging tool
	#Option  "SECURITY" "Disable" # CRASH!
	Option  "XC-APPGROUP" "Disable"
	Option  "XINERAMA" "Disable"
EndSection

Section "Monitor"
	Identifier  "Monitor0"
	HorizSync   30-67
	VertRefresh 48-52 
	DisplaySize 152 114
	Mode "1200x900"
		DotClock 57.275
		HTimings 1200 1208 1216 1240
		VTimings 900 905 908 912
		Flags    "-HSync" "-VSync"
	EndMode
EndSection

Section "Device"
	Identifier  "Videocard0"
	Driver      "amd"
	VendorName  "Advanced Micro Devices, Inc."
	BoardName   "AMD Geode GX/LX"

	Option     "AccelMethod" "EXA"
	Option     "NoCompression" "true"
	Option     "PanelGeometry" "1200x900"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Videocard0"
	Monitor    "Monitor0"
	DefaultDepth 16
	SubSection "Display"
		Depth   16
		Modes   "1200x900"
	EndSubSection
EndSection
Section "InputDevice"
        Identifier "fake"
        Driver     "void"
EndSection

Section "InputDevice"
        Identifier "ATKbd"
        Driver     "evdev"

        Option  "Name"  "AT Translated Set 2 keyboard"
        Option  "evBits"    "+1"
        Option  "keyBits"   "~1-255 ~352-511"
        Option  "Pass"      "2"
EndSection
Section "InputDevice"
        Identifier "Keyboard"
        Driver     "evdev"

        Option  "evBits"    "+1"
        Option  "keyBits"   "~1-115 ~117-255"
        Option  "Pass"      "3"
EndSection

Section "InputDevice"
        Identifier "Mouse"
        Driver     "evdev"

        Option  "evBits"    "+1-2"
        Option  "keyBits"   "~272-287"
        Option  "Pass"      "3"
EndSection
Section "InputDevice"
        Identifier "GS"
        Driver     "evdev"

        Option  "Name" "OLPC ALPS GlideSensor"
        Option  "evBits"    "+1 +3"
        Option  "keyBits"   "~272-287"
        Option  "absBits"   "~0-2 ~24"
        Option  "Pass"      "2"
        Option  "Mode"      "Relative"
EndSection


Index: olpc-utils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/olpc-utils/F-10/olpc-utils.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- olpc-utils.spec	18 Nov 2008 00:01:01 -0000	1.3
+++ olpc-utils.spec	6 Dec 2008 10:29:22 -0000	1.4
@@ -91,11 +91,8 @@
 %config(noreplace) %{_sysconfdir}/ConsoleKit/run-session.d/pam-foreground-compat.ck
 
 %changelog
-* Mon Nov 17 2008 Peter Robinson <pbrobinson at gmail.com> 0.89-6
-- Actually commit patch to cvs
-
-* Sat Oct 25 2008 Peter Robinson <pbrobinson at gmail.com> 0.89-5
-- Merge OLPC-3 branch into devel
+* Fri Dec  5 2008 Peter Robinson <pbrobinson at gmail.com> 0.89-6
+- Rebuild for Python 2.6 and merge from branch
 
 * Sat Oct  1 2008 Marco Pesenti Gritti <mpg at redhat.com> 0.89-4
 - Marco Pesenti Gritti (1):




More information about the fedora-extras-commits mailing list