[maemo-developers] Second WSOD and making sure wireless connects at startup.
From: Jason Monroe Martin jasmar at localnet.comDate: Mon Mar 26 17:21:34 EEST 2007
- Previous message: PyGTK CellRendererToggle
- Next message: [OS2006] creating root file system
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
#!/usr/bin/env python2.5 ''' Save all lines to /usr/bin/pynetup, make it executable and do what is in the following comments. This is my second WSOD and I was in a jam. Although I have a discount code for the N800, I do not have the spare money to order it or repair the N770. To make this work you need the python-runtime and OpenSSH needs to be installed and setup. You also have to be able to become root. I had the becomeroot package installed. Leave only one connection listed in /var/lib/gconf/system/osso/connectivity/IAP. Move the rest to /root/my_backup or some other safe place. Add "run-standalone.sh /usr/bin/pynetup" without the quotes to osso-connectivity-ui.sh in the /etc/osso-af-init directory. Like this: if [ $START = TRUE ]; then # check that required environment is defined if [ "x$DISPLAY" = "x" ]; then echo "$0: Error, DISPLAY is not defined" return 2 fi $LAUNCHWRAPPER_NICE_TRYRESTART start "$SVC" $PROG run-standalone.sh /usr/bin/pynetup else $LAUNCHWRAPPER_NICE_TRYRESTART stop "$SVC" $PROG fi ''' import commands import urllib2 import sys import time page = '' # Let's make sure everything is up and settled. time.sleep(15) while 1: # Call the browser with dbus to open a web page. # If there is no connection it should try to open one. result=commands.getoutput('dbus-send ' '--print-reply ' '--dest=com.nokia.osso_browser ' '/usr/bin/browser ' 'com.nokia.osso_browser.load_url ' 'string:"http://192.168.1.1"') # Read a page with python. # In this case it is the WEB GUI on my wireless router. page = urllib2.urlopen('http://192.168.1.1') # I know the page contains the phrase "Bad Request" because # WEB ADMIN stuff is restricted from wireless devices. if page.read().find('Bad Request') == 83: # The link is up. I could do something else here but # I am just happy I can ssh into the tablet now. sys.exit(0) # Must not have worked. Wait and try again. time.sleep(15)
- Previous message: PyGTK CellRendererToggle
- Next message: [OS2006] creating root file system
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]