This section explains how to install HIP on Android (emulator or a real device). See http://infrahip.hiit.fi/hipl/contrib/android/ for binary images.
The kernel needs to be updated to support the various features required by HIPL that aren't present in the standard distribution. These include ipv6 support and various IPSec- and packet filtering related options
iptables and ip6tables tool. Android ships with iptables, so we would also need ip6tables
Any ipv6 ready tool for testing connectivity. Like ping6 or wget
There is no DNS proxy support. The one in HIPL is written in python, which cannot be run in Android due to lack of python support. So the mappings will have to be added in "/etc/hosts" or "/data/hip/hosts" file
There is no LD_PRELOAD support. The reasons being: Android'd linker doesn't have support for LD_PRELOAD environment variable, and also most of the Android applications are java based, they are launched in a different way, not much use for LD_PRELOAD.
We are providing precompiled images for emulator and Android "HTC Dream" G1, though they may not be always uptodate, so compiling from source is recommended.
Emulator
Download and unzip the SDK (android-sdk-hipl*.zip) from the infrahip page
Run the emulator
$ cd android-sdk
$ tools/emulator -data platforms/android-1.5/images/userdata.img &
Test the connection
$ tools/adb shell # Log into emulator shell # hipd -k 2>/dev/null & # hipfw -klpF 2>/dev/null & # hipconf add map 2001:1b:a9be:c6a6:34e5:8361:c07f:a990 193.167.187.134 # We don't have dns proxy # wget http://[2001:001b:a9be:c6a6:34e5:8361:c07f:a990] -O- #LSI also can be used here
If you need to see the output, run each binary in its own "adb shell".
Device - Android "HTC Dream" G1
Please see here for more generic details
Download the pre-compiled flashable images(android-dream-hipl*.zip) from the infrahip page and unzip them
Flash the downloaded images(boot.img and system.img) into device by following the instructions at HTC page. We don't need to update all the images, just the boot and system images.
$ ./fastboot boot boot.img $ ./fastboot system system.img
WARNING: The system and boot partitions will be overwritten, though the data partition would remain same
Test the connection
Remember to connect the device into USB port
$ tools/adb shell # Log into device shell # hipd -k 2>/dev/null & # hipfw -klpF 2>/dev/null & # hipconf add map 2001:1b:a9be:c6a6:34e5:8361:c07f:a990 193.167.187.134 # We don't have dns proxy # wget http://[2001:001b:a9be:c6a6:34e5:8361:c07f:a990] -O- #LSI also can be used here
If you need to see the output, run each binary in its own "adb shell".
This section explains how to compile HIP either for emulator or a device
Compiling for emulator
Get source by following the guidelines specified at android.com. Use "cupcake" branch
Inside .repo directory(within android source directory), create a file called "local_manifest.xml". This file contains description of extra packages required for HIP support
<?xml version="1.0" encoding="UTF-8"?> <manifest> <remote name="surki-github" fetch="git://github.com/surki/" /> <remove-project name="platform/external/iptables" /> <project path="kernel" name="kernel/common" revision="refs/heads/android-goldfish-2.6.29" /> <project path="external/iptables" name="iptables" revision="refs/heads/android-hipl" remote="surki-github" /> <project path="external/wget" name="wget" revision="refs/heads/android-hipl" remote="surki-github" /> <project path="external/hipl" name="hipl" revision="refs/heads/android-hipl" remote="surki-github" /> </manifest>
and do a
repo sync
which will bring all the HIPL specific changes into local repository
Compile the source
$ cd ~/src/mydroid #Android source directory $ source build/envsetup.sh $ lunch generic-eng #Chooses a generic build for emulator and sets up the required env. variables $ make TARGET_PRODUCT:=generic
Compile the kernel
$ cd ~/src/mydroid #Android source directory $ source build/envsetup.sh $ lunch generic-eng #Chooses a generic build and sets up the required env. variables $ cd kernel # Kernel source $ export CROSS_COMPILE=arm-eabi- ARCH=arm $ make goldfish_defconfig $ make menuconfig #To select HIPL specific kernel options
Select the HIP specific kernel options as mentioned in HIP "Compiling the Kernel" page.
$ make
Test the connection
$ export PATH=$PATH:~/src/mydroid/out/host/linux-x86/bin $ emulator -kernel kernel/arch/arm/boot/zImage -system out/target/product/generic/system.img -data out/target/product/generic/userdata.img & $ adb shell # Log into emulator shell # hipd -k 2>/dev/null & # hipfw -klpF 2>/dev/null & # hipconf add map 2001:1b:a9be:c6a6:34e5:8361:c07f:a990 193.167.187.134 # We don't have dns proxy # wget http://[2001:001b:a9be:c6a6:34e5:8361:c07f:a990] -O- #LSI also can be used here
If you need to debug, run each binary in its own "adb shell".
Compiling for device Android "HTC Dream" G1
Please refer to Android site for more generic details
Get the source(follow it up from Android site). Cupcake
Apply this local manifest
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="surki-github" fetch="git://github.com/surki/" />
<remove-project name="platform/external/iptables" />
<project path="kernel" name="kernel/common" revision="refs/heads/android-msm-2.6.29" />
<project path="external/iptables" name="iptables" revision="refs/heads/android-hipl" remote="surki-github" />
<project path="external/wget" name="wget" revision="refs/heads/android-hipl" remote="surki-github" />
<project path="external/hipl" name="hipl" revision="refs/heads/android-hipl" remote="surki-github" />
</manifest>and do a
repo sync
Compile the kernel as specified in the above section
make TARGET_PRODUCT:=dream TARGET_PREBUILT_KERNEL:=kernel/arch/arm/boot/zImage
Flash the built images(boot.img and system.img) into device by following the instructions at HTC page. We don't need to update all the images, just the boot and system images.
$ fastboot boot out/target/product/dream-open/boot.img $ fastboot system out/target/product/dream-open/system.img
WARNING: The system and boot partitions will be overwritten, though the data partition would remain same
Test the connection
Remember to connect the device into USB port
$ tools/adb shell # Log into device shell # hipd -k 2>/dev/null & # hipfw -klpF 2>/dev/null & # hipconf add map 2001:1b:a9be:c6a6:34e5:8361:c07f:a990 193.167.187.134 # We don't have dns proxy # wget http://[2001:001b:a9be:c6a6:34e5:8361:c07f:a990] -O- #LSI also can be used here
If you need to see the output, run each binary in its own "adb shell".
Flashing the device
During development, to update hip binaries, you will have to use "adb". So use something like
$ adb sync
from the android source directory
During development, to update hip binaries, you will have to remount /system partition read/write(by default system directory is readonly). So use something like
# mount -oremount,rw /dev/block/mtdblock0 /system
HIP configuration files are located at "/data/hip/"
hipd crashes sometimes when run in simulator. Restarting will be required if it crashes