June 21st, 2009 | Tags: ,
No Gravatar

VirtualBox is a powerful x86 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL).

The above description (which you may commonly encounter in the web, when you search for VirtualBox) should give a hint on what exactly is VirtualBox. To put it in more understandable terms (hopefully), it is a software tool that you install on your PC (Linux/Windows) and that lets you create so called Virtual Machines (Imagine them as virtual hardware devices emulating all the basic hardware features needed to install/run an Operating System). One can install any x86-supported OS on these Virtual Machines pretty much in the same manner as he/she does it on the actual Hardware / PC.

Various ways of installing VirtualBox on your PC are provided in the link; http://www.virtualbox.org/wiki/Downloads

Typical uses of Virtual Machines for both Linux as well as Windows users:

  • To use as a hardware base to test LiveCD / LiveDVD based distributions

    Let us say, you got to test a LiveCD / LiveDVD based Linux distribution. You want to do that without rebooting your already running PC and also not very comfortable running it on actual hardware. Virtual Machine comes really handy in this situation. Just boot the Virtual Machine with your media as the boot device (CD/DVD drive) and you need not have to burn a CD/DVD if you have a ISO image, accessible in your PC. If you really love the distribution that you are testing, you may use the installer option provided in it (generally provided in many of the Live CD/DVD distros) to install Linux on the Virtual Machine itself.
  • To use as a dedicated development environment

    Let me explain this with an example. I wanted to do GNUStep programming but, I didn’t want to install those GNUStep framework packages on my rather clean and tidy Linux Desktop. All I had to do is to create a Virtual Machine using VirtualBox, install my favorite (Debian) Linux on it and install the necessary GNUStep development packages. Since, I had a complete Debian repository on my Linux Desktop, I could use them as my APT repository to install packages quickly inside my Virtual Machine, without relaying on external mirrors. Typically, the host PC is accessible with a private IP (Ex., 10.0.2.2). Virtual Machine supports multiple NICs so that you can configure one card for host-only network (communication b/n Host PC and Virtual Machine only) and the other for a NAT or Bridged network for Virtual Machine to communicate with the outside world.

The use-cases with Virtual-Machines using VirtualBox are many. You may refer to http://www.virtualbox.org for details.

Enjoy using VirtualBox and utilize your PC to the fullest extent ;-)

May 31st, 2009 | Tags: , ,
No Gravatar

In this world of evolving, computing technologies, GUI – the graphical user interface plays a vital role. Unlike yester years, when GUI and operating systems were tightly coupled and governed by the Operating system vendors, both proprietary and open source, with the introduction of Netbooks, Mobile internet devices, Smartbooks and similar devices, the operating system and GUI act as two parallel entities to investigate and innovate.

When we look at the evolving user interface frameworks and implementations, they are more inclined towards being OS agnostic unlike being tightly coupled to the OS framework. Whether it is I-phone, Moblin, Android, OpenMoko or Qt, in general, things are moving towards an OS agnostic implementation of the user interface layers. Unlike the reports that end-user seldom wishes to explore newer (and perhaps better) user interfaces, in fact, end-user is more keen to explore interfaces that gives him an easy to use appliance model especially while using these smaller, smarter devices.

It may not be appropriate to compare these GUI for small form-factor devices with normal desktop companions. Desktop, notebook/laptop is still a separate segment where in user is expected to learn the interface for sometime before start using it comfortably. As such typical desktop environments, irrespective of the vendor, involve a learning curve which is most likely longer compared to quick-learning in case of smart devices. A clear distinction still exists between those smaller, smarter devices and normal desktop PCs. Depending on these operating environments, GUI framework and implementations also differ appropriately.

May 26th, 2009 | Tags: , ,
No Gravatar
  • Using Ethernet
    From your host machine/PC which has Android SDK, run (from a terminal):


    ADBHOST=IP_ADDRESS adb kill-server
    ADBHOST=IP_ADDRESS adb shell

    Note: You need to run the two commands sequentially and they should be run only after your Android-target is up and running with network enabled. The second command will put you into a shell of the target device. You may try other adb options as well; for example, to install a .apk package.

  • Using USB-Net
    This is very similar to using ethernet way as explained above expect that you need to have the following line in your init.rc file in Android target device:

    service usb-ether /system/bin/ifconfig usb0 IP_ADDRESS up
    oneshot

    Note: Replace IP_ADDRESS with the appropriate ip-address for your Android target device.

April 26th, 2009 | Tags: , , ,
No Gravatar

Here is the consolidated post explaining what I did to get Android image compiled for X86 architecture. This documentation is just a consolidation of information from various sources across the web. You are encouraged to checkout the references at the end of this post to involve directly with Android-x86 porting activities.

Quicknotes:

  • It is assumed that the host used is of 32-bit architecture
  • It is assumed that host PC uses Debian as the Linux distro (Ubuntu should also work fine)
  • It is also assumed that you have superuser previleges (sudo)
  • ‘$>’ in the document indicates the terminal/shell prompt, unless explicitly stated otherwise
  • Your home directory is assumed to have a directory by name ‘bin’ and is included in PATH. If not, you may do so by following the procedure;

    $> mkdir -p ${HOME}/bin
    $> echo export PATH=”${HOME}/bin:$PATH” >> ~/.bashrc
    $> source ~/.bashrc

Steps:

  1. Installing required packages in the host
    Open a terminal and install the required packages using the command;

    $> sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev libreadline5-dev

  2. Setting up git to use proxy (Applicable only if you are using a proxy server)
    Follow the link, to know how to setup git to use the proxy server
  3. Installing Android ‘repo’ script
    To install, initialize, and configure the Android repo, download the repo script and make sure it is executable:

    $> curl http://android.git.kernel.org/repo > ~/bin/repo
    $> chmod a+x ~/bin/repo

  4. Getting the Android source
    • Create a directory to sync android sources and initialize the repo

      $> mkdir ~/android-src
      $> cd ~/android-src
      $> repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake

      Notes: When prompted, configure Repo with your real name and email address. If you plan to submit code, use an email address that is associated with a Google account. A successful initialization will end with a message such as “repo initialized in /android-src”. Your client directory should now contain a .repo directory where files such as the manifest will be kept. Here we are using the ‘cupcake’ branch of android source. If you want to use the ‘master’ branch instead, you can skip the ‘-b cupcake’ option in the above repo command.

    • To get the source files, run (in the android-src directory)

      $> repo sync

      Notes: The above command takes a longer time since, it needs to get more than 2GB of data!

  5. Getting the EeePC-701 reference repo contents
    • Open a local manifest file, using a text-editor such as gedit;

      $> gedit .repo/local_manifest.xml

    • Enter the following content in the opened local manifest file, save and then close it.

      <?xml version="1.0" encoding="UTF-8"?>
      <manifest>
      <project name="platform/vendor/asus/eee_701" path="vendor/asus/eee_701"/>
      </manifest>
    • Get the repo contents for eee_701 by running ‘repo sync’ command again;

      $> repo sync

  6. Downloading and applying X86 specific patches
    • Create a directory to store android-x86 specific patches

      $> mkdir ~/android-x86-patches
      $> cd ~/android-x86-patches

    • Download Android-x86 specific patches into android-x86-patches directory, from android-x86-patches link.

      Notes: I used alarm.patch, boot_able_img.patch, cursor.patch, e2fsprogs.patch and frameworks.patch only
    • Create a shell-script called apply-git-patch in ~/bin directory with the following content;

      #!/bin/bash
      if [ $# -ne 2 ]; then
      echo "Usage: $(basename $0) "
      exit 1
      fi
      BUILD_SRC_DIR="$1"
      PATCHES_DIR="$2"
      for ptch in $PATCHES_DIR/*.patch; do
      dest_dir="$(cat $ptch | grep "projectb" | grep -v grep)"
      if [ -n "$dest_dir" ]; then
      patch_dir="$(echo $dest_dir | awk {'print $2'})"
      pushd "$BUILD_SRC_DIR/$patch_dir"
      echo "########## PATCH START: $ptch ########## "
      git apply --reject --whitespace=fix $ptch
      echo "########## PATCH END: $ptch ########## "
      popd
      fi
      done
      exit 0
    • Make the script executable;

      $> chmod a+x ~/bin/apply-git-patch

    • Now, apply patches using;

      $> apply-git-patch <absolute-path-to-android-src-dir> <absolute-path-to-android-patches-dir>

      (Ex.; apply-git-patch ~/android-src ~/android-x86-patches)

  7. Compiling the source for x86 architecture

    $> cd ~/android-src
    $> sudo TARGET_ARCH=x86 TARGET_PRODUCT=eee_701 DISABLE_DEXPREOPT=true make -j2 installer_img

  8. Flashing the installer image on USB-Pendrive

    $> cd ~/android-src
    $> sudo dd if=out/target/product/eee_701/installer.img of=/dev/sdX

    where, sdX can be sda, sdb, or sdc, … depending on your USB pendrive device file

  9. Installing the image on to a Target x86 device (EeePC, HP-Mini, ….)
    Caution: The installer is rude in the sense, it will simply erase the entire disk on target device and installs the Android stuff. Don’t try it on a production machine unless you know what you are doing. You have been warned!!!

    Insert the USB Pendrive into the Target device and boot using this Pendrive. The installer should carry on the installation, unless there is any issue (which might well be there since, x86 porting is still a community effort and a work in progress).

Online References:

April 9th, 2009 | Tags: , ,
No Gravatar

I was trying to clone Android repository at office when this problem of “Connection refused” started coming when running the ‘repo’ tool. On subsequent googling, I got this really useful link (thanks to Emil Sit) which explained how git can be used over http proxy for those git servers which don’t allow http method as an alternate/bypass to git protocol (As it looks is the case with Android git repository).

Ok, in short, here is what I have done;

1. Typed in the below lines (quoted) into a shell script called gitproxy and put it in $(HOME)/bin directory. Of course, its executable bits has to be set with chmod a+x $(HOME)/bin/gitproxy. My $(HOME)/bin directory is already part of PATH so that I can access my custom scripts easily.

#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config –global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny

# Configuration. Common proxy ports are 3128, 8123, 8000.
_proxy=proxy.yourcompany.com
_proxyport=3128

exec socat STDIO PROXY:$_proxy:$1:$2,proxyport=$_proxyport

I replaced proxy.yourcompany.com with appropriate proxy-server details for my organization and the value for _proxyport with an appropriate value used in my organization (instead of 3128).

2. Installed the package socat with the command; sudo apt-get install socat

3. Ran the command git config –global core.gitproxy gitproxy to configure ‘git’ to use the gitproxy.

4. With the http_proxy environment variable already set using preferences menu in GNOME desktop, I could now able to run git and get the repositories without the annoying “Connection refused” problem.

That’s it!!

TOP

Linmaya is using WP-Gravatar