September 2007

Setting the OpenMoko timezone

If you want to set the timezone on your phone correctly, do the following:

  1. ipkg install tzdata
  2. ipkg install your desired tzdata-* packages.  For instance, I use “tzdata-australia“.
  3. Enable your desired timezone by symlinking it to “/etc/localtime“.  Adjust the following example command line for your locality.
    • ln -s /usr/share/zoneinfo/Australia/Adelaide /etc/localtime
  4. The “date” command should now show the correct time for your timezone.  If it is not correct, then install the “ntpclient” package, and use it to set your clock.

Note that this technique should work on any OpenEmbedded-based Linux distribution.

    NSLU2-Linux
    OpenMoko

    Comments Off

    Permalink

    Intercepting hotplug on the Freecom FSG-3

    The Freecom FSG-3 wireless storage router has four USB ports, and has support for hotplug built into the kernel.  This makes it ideal for use as a docking station for OpenMoko phones.

    Unfortunately, it does not have the normal hotplug agent scripts that you expect to find on a desktop Linux distribution.

    So you have to roll your own:

    1. Run “mv /sbin/hotplug /sbin/hotplug.freecom
    2. Create a new “/sbin/hotplug” shell script (the following is an example of how to automatically enable USB networking for an OpenMoko phone):
      #!/bin/sh
      
      case $1 in
        ( usb )
          case $PRODUCT/$INTERFACE in
            ( 1457/5122/212/2/6/0 ) # OpenMoko GTA01 cdc-ether
              case $ACTION in
                ( add )
                  ifconfig usb0 192.168.0.200 up
                  ;;
                ( remove )
                  ifconfig usb0 192.168.0.200 down
                  ;;
              esac
              ;;
          esac
          ;;
      esac
      
      /sbin/hotplug.freecom "$@"
      

    3. Run “chmod ugo+x /sbin/hotplug” to ensure that your new hotplug script is executable.
    4. See http://linux-hotplug.sourceforge.net/?selected=usb for the list of environment variables you can use to distinguish different devices.

    Freecom FSG-3
    OpenMoko

    Comments Off

    Permalink

    Replacing dropbear with openssh

    I prefer to use OpenSSH rather than Dropbear on my devices.  The main reason is to get sftp support (which is required by sshfs).  Another reason is to get better support for agent forwarding (which is essential for bouncing from one machine to another without leaving your private keys all over the internet).

    To do this on OpenMoko (or any other OpenEmbedded-based distribution for that matter, for instance SlugOS or Angstrom):

    1. Edit /etc/init.d/dropbear by replacing “DROPBEAR_PORT=22” with “DROPBEAR_PORT=2222” (or any other unused port).
    2. Run “ipkg install -force-depends openssh” to install openssh.
    3. Make sure you have set a root password before rebooting (use “passwd” to set it).
    4. Reboot (dropbear will restart on the new port, and openssh will start on the normal ssh port).
    5. Check that openssh is now serving on port 22 by logging into the device over ssh.
    6. Run “ipkg remove -force-depends dropbear” to remove dropbear.
    7. Then run “ipkg install openssh-sftp” to install support for the sftp protocol which sshfs uses.

    Freecom FSG-3
    NSLU2-Linux
    OpenMoko

    Comments Off

    Permalink