View Single Post
Old 07-04-2009, 04:32 AM   #44
ebs
Zealot
ebs will become famous soon enoughebs will become famous soon enoughebs will become famous soon enoughebs will become famous soon enoughebs will become famous soon enoughebs will become famous soon enough
 
Posts: 100
Karma: 629
Join Date: Jun 2009
Location: California, USA
Device: Kindle DX
usbnetworking auto start

If you are seriously playing with internal Kindle software (e.g. mucking with java stuff), I recommend making usbnetworking "auto-startable". Otherwise, if you corrupt something in framework, you'd need serial console for recovery.
Add this simple script to /etc/init.d:

Code:
[root@kindle init.d]# cat /etc/init.d/usbnet
#!/bin/sh

_FUNCTIONS=/etc/rc.d/functions
[ -f ${_FUNCTIONS} ] && . ${_FUNCTIONS}

US_ENABLE=/mnt/us/usbnet/AUTO

case "$1" in

        start)
                if [ -f ${US_ENABLE} ]; then
                        /mnt/us/usbnet/usbnetwork
                else
                        msg "not usbnet" I
                fi
        ;;

        stop)
                ;;
        *)
                msg "Usage: $0 {start|stop}" W >&2
                exit 1
                ;;
esac

exit 0
And then make it start-up script:
Code:
[root@kindle rcS.d]# ls -al /etc/rcS.d/*usbnet
lrwxrwxrwx    1 root     root           16 Jan  2  1970 /etc/rcS.d/S72usbnet -> ../init.d/usbnet
After that, you'll be able to enable usbnetworking automatically by creating file "AUTO" in "usbnet" directory on user partition

Last edited by ebs; 07-04-2009 at 02:22 PM.
ebs is offline