Difference between revisions of "How to get the Android distribution"

From IGEP - ISEE Wiki

Jump to: navigation, search
(removed as known issue because is tested (2011-02-24))
(Annex: libertas.rc: Copied from provided root-fs image, since libertas.rc was not provided in "build-from-sources")
Line 587: Line 587:
 
     return 0;
 
     return 0;
 
  }
 
  }
 +
</pre>
 +
 +
=== Annex: libertas.rc ===
 +
 +
Save the following block to device/ti/igepv2/libertas/libertas.rc
 +
 +
<pre>
 +
#!/system/bin/sh
 +
 +
load_libertas()
 +
{
 +
insmod /system/lib/modules/libertas.ko
 +
#insmod /system/lib/modules/libertas_sdio.ko
 +
# Let WiFi part know that the driver is already loaded
 +
setprop wlan.driver.status ok
 +
 +
echo "Loaded Libertas WiFi modules"
 +
 +
return 0;
 +
}
 +
 +
unload_libertas()
 +
{
 +
if rmmod libertas; then :; else return 1; fi
 +
#if rmmod libertas_sdio; then :; else return 1; fi
 +
 +
echo "Unloaded Libertas WiFi modules."
 +
return 0;
 +
}
 +
 +
# Deal with the type of invocation we get.
 +
#
 +
case "$1" in
 +
"start")
 +
load_libertas
 +
;;
 +
stop)
 +
if ! unload_libertas; then
 +
echo "Couldn't unload modules" >&2;
 +
fi
 +
;;
 +
reload|restart)
 +
if unload_libertas; then
 +
load_libertas
 +
else
 +
echo "Couldn't unload modules" >&2;
 +
fi
 +
;;
 +
*)
 +
echo "$0: unknown argument $1." >&2;
 +
;;
 +
esac
 
</pre>
 
</pre>
  

Revision as of 11:52, 24 March 2011

How to get the Android distribution

Android-logo.png
Android is a software stack for mobile devices that includes an operating system, middleware and key applications, that uses a modified version of the Linux kernel. It was initially developed by Android Inc., a firm later purchased by Google, and lately by the Open Handset Alliance. It allows developers to write managed code in the Java language, controlling the device via Google-developed Java libraries.

Rowboat project provides Android on OMAP35xx and DM37xx platforms and enables key processor hardware features (ARM plus NEON, DSP, 2D/3D Accelerated Graphics and others). Key differentiators among many others:

  • Active and open development of a quality Android port.
  • Focused on a stable, well tested and benchmarked Android port for OMAP35xx and DM37xx.
  • Graphics and Multimedia performance optimizations.

Overview of How-To

This How-To is meant to be a starting point for people to learn build and run Android images for IGEP v2 devices as quickly and easily as possible.

Feedback and Contributing

At any point, if you see a mistake you can contribute to this How-To.

How to get involved

The Rowboat project

There are many ways to get involved with the Rowboat project.

Become a Rowboat user

  • Try out Rowboat Android - either pre-built or from source
  • Give us feedback via IRC #rowboat or the Rowboat mailing list (rowboat@googlegroups.com)
  • If you find an issue or bug, file a project issue

Share your Rowboat knowledge

  • Add Wiki articles or edit existing topics
  • Share your knowledge on #rowboat or rowboat@googlegroups.com

Submit code

  • Send your patches to the mailing list, rowboat@googlegroups.com

References

Android Platform Setup Environment

Ubuntu Linux (32-bit x86) To set up your Linux development environment, make sure you have the following:

Required Packages:

  • Git 1.5.4 or newer and the GNU Privacy Guard.
  • JDK 5.0, update 12 or higher. Java 6 is not supported, because of incompatibilities with @Override.
  • flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev (optional), build-essential, zip, curl.

In Ubuntu Linux you will do:

sudo dpkg-reconfigure dash

You need to answer 'no' when asked if you want to install 'dash' as /bin/sh.


To get the repo for java5 add these lines to your /etc/apt/sources.list

deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
$ sudo apt-get install sun-java5-jdk git-core gnupg expect flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev libreadline5-dev realpath coreutils

Then use command

sudo update-java-alternatives -s java-1.5.0-sun

to switch your default Java machine to version 1.5.

  • You might also want Valgrind, a tool that will help you find memory leaks, stack corruption, array bounds overflows, etc.
$ sudo apt-get install valgrind

Once you installed the requirements, you will create a working directory and download the repo tool.

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

Android Froyo 2.2 Platform

Pre-built images for impatients

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE'.

Release x-loader u-boot Kernel Rootfs Platform
 Android 2.2 (Froyo) for DM3730   x-load-1.4.4-1   u-boot-2010.06-1   uImage-2.6.32.bin   dm3730-2.2  http://developer.android.com/sdk/android-2.2.html
 Android 2.2 (Froyo) for OMAP3530   x-load-1.4.4-1   u-boot-2010.06-1   uImage-2.6.32.bin   N/A http://developer.android.com/sdk/android-2.2.html

boot.scr files:

Quick steps: create a bootable sdcard

$ wget http://downloads.igep.es/binaries/x-loader/v1.4.4-1/x-load-1.4.4-1.igep0020-sdcard.bin.ift
$ wget http://downloads.igep.es/binaries/u-boot-arm/v2010.06-1/u-boot-arm-2010.06-1.igep0020.bin
$ wget http://downloads.igep.es/android/froyo-2.2/uImage-android-2.6.32.bin
$ wget http://downloads.igep.es/android/froyo-2.2/android-dm3730-froyo-2.2-20110223161010.tar.bz2
$ wget http://downloads.igep.es/files/media-samples.tar.gz
$ tar xzf media-samples.tar.gz

Download one of

$ wget http://downloads.igep.es/android/froyo-2.2/boot-dvi.scr
$ wget http://downloads.igep.es/android/froyo-2.2/boot-lcd-70.scr
$ wget http://downloads.igep.es/android/froyo-2.2/boot-lcd-43.scr

and rename to boot.scr

$ mv <boot.scr file> boot.scr

Make the sd card

$ wget http://downloads.igep.es/android/froyo-2.2/mkmmc-android.sh
$ chmod a+x mkmmc-android.sh
$ sudo ./mkmmc-android.sh <device> x-load-1.4.4-1.igep0020-sdcard.bin.ift u-boot-arm-2010.06-1.igep0020.bin uImage-android-2.6.32.bin boot.scr android-dm3730-froyo-2.2-20110223161010.tar.bz2 media-samples

Enhancements

Known issues

  • RECOMMENDED at least a class 6 SD card
  • RTC doesn't work. Board cannot save time between reboots.
  • ADB doesn't work over USB. Connecting board to a PC shows nothing in lsusb at all. ADB works over ethernet. Refer to 'adb connect' command.
  • 4x4 keyboard doesn't work
  • Ethernet + Wifi do not work together, the problem is in the android network "stack". In rowboat froyo an wired ethernet component was copied from (guessing) android-x86 and this is conflicting with the wifi part. This is also mentioned on the android-x86 mailinglist as being an issue.So is not a kernel/ wifi driver issue but entirely an android stack issue.
    • If you want to use wifi, it seems that it cannot connect to a wifi ap but if you boot the second time it is ok, to use wifi do the following:
      • step 1: Turn off ethernet: Settings -> Ethernet configuration -> Turn off ethernet
      • step 2: reboot
      • step 3: Turn on wifi: Settings -> Wireless & networks -> Wi-Fi settings -> Turn on Wi-Fi
    • If you want to use ethernet
      • step 1: Turn off wifi: Settings -> Wireless & networks -> Wi-Fi settings -> Turn off Wi-Fi
      • step 2: reboot
      • step 3: Turn on ethernet: Settings -> Ethernet configuration -> Turn on ethernet
  • Bluetooth not supported yet

Build Android Froyo from sources

Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest:

$ mkdir froyo
$ cd froyo
$ repo init -u git://gitorious.org/rowboat/manifest.git -m rowboat-froyo-dsp.xml

To pull down files to your working directory from the repositories as specified in the default manifest, run

$ repo sync

Attention BEFORE continue you must apply all patches described here

Download libertas modules and move to device/ti/igepv2/libertas/

$ mkdir device/ti/igepv2/libertas/
$ wget http://downloads.igep.es/android/froyo-2.2/libertas.ko
$ wget http://downloads.igep.es/android/froyo-2.2/libertas_sdio.ko
$ mv libertas.ko device/ti/igepv2/libertas/
$ mv libertas_sdio.ko device/ti/igepv2/libertas/

and download libertas firmware and move to device/ti/igepv2/firmware/

$ mkdir device/ti/igepv2/firmware/
$ wget http://downloads.igep.es/android/froyo-2.2/sd8686.bin
$ wget http://downloads.igep.es/android/froyo-2.2/sd8686_helper.bin
$ mv sd8686*bin device/ti/igepv2/firmware/

Download the TI DVSDK package to the external/ti-dsp folder manually from the table in webpage http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dvsdk/DVSDK_4_00/latest/index_FDS.html. Registration might be needed.

  • For DM37xx platform, download dvsdk_dm3730-evm_4_01_00_09_setuplinux package;
  • For OMAP35xx platform, download dvsdk_omap3530-evm_4_01_00_09_setuplinux package.
$ cp <dvsdk package> external/ti-dsp

and run the get-tidsp.sh script

$ external/ti-dsp/./get_tidsp.sh

Current kernel version works but there is an updated kernel in IGEP repositories, so it's recommended use this version, to do this add the linux-omap-2.6 IGEP repository and switch to linux-android-2.6.32.y branch.

$ cd kernel
$ git remote add igep git://git.igep.es/pub/scm/linux-omap-2.6.git
$ git fetch igep
$ git checkout igep/linux-2.6.32.y-android -b linux-2.6.32.y-android
$ cd ..

Now you're ready for build, do

source build/envsetup.sh
lunch igepv2-eng
make TARGET_PRODUCT=igepv2 -j8 OMAPES=(2.x|3.x|5.x)

Set OMAPES variable to install proper version of SGX drivers (Default is 3.x):

  • OMAPES=2.x, for OMAP3530 ES1 or ES2;
  • OMAPES=3.x, for OMAP3530 ES3.0;
  • OMAPES=5.x, for DM37x

Next step is create a tarball containing the rootfs

$ mkdir froyo-rootfs
$ cp -r out/target/product/igepv2/root/* froyo-rootfs/
$ cp -r out/target/product/igepv2/system froyo-rootfs/
$ sudo build/tools/mktarball.sh out/host/linux-x86/bin/fs_get_stats froyo-rootfs . rootfs froyo-rootfs.tar.bz2

Create a SD card

$ wget http://downloads.igep.es/binaries/x-loader/v1.4.4-1/x-load-1.4.4-1.igep0020-sdcard.bin.ift
$ wget http://downloads.igep.es/binaries/u-boot-arm/v2010.06-1/u-boot-arm-2010.06-1.igep0020.bin

Create ONE of these scripts (boot.source)

  • a) DM3730 + DVI 1280x720
mmc init 0
fatload mmc 0 80200000 uImage
setenv bootargs 'mem=71M@0x80000000 mem=384M@0x88000000 console=tty0 console=ttyS2,115200n8 \
       androidboot.console=ttyS2 root=/dev/mmcblk0p2 rw rootfstype=ext3 init=/init rootwait ip=off \
       omap_vout.vid1_static_vrfb_alloc=y omapfb.mode=dvi:1280x720MR-16 mpurate=1000'
bootm 0x80200000
  • b) DM3730 + Seiko 7.0 inch WVGA (800 x RGB x 480) TFT with Touch-Panel
mmc init 0
fatload mmc 0 80200000 uImage
setenv bootargs 'mem=71M@0x80000000 mem=384M@0x88000000 console=tty0 console=ttyS2,115200n8 \
       androidboot.console=ttyS2 root=/dev/mmcblk0p2 rw rootfstype=ext3 init=/init rootwait ip=off \
       omap_vout.vid1_static_vrfb_alloc=y omapdss.def_disp=lcd-70 omapfb.mode=dvi:1280x720MR-16 mpurate=1000'
bootm 0x80200000
  • c) DM3730 + Powertip 4.3 inch (480 x RGB x 272) TFT with Touch-Panel (not tested yet)
mmc init 0
fatload mmc 0 80200000 uImage
setenv bootargs 'mem=71M@0x80000000 mem=384M@0x88000000 console=tty0 console=ttyS2,115200n8 \
       androidboot.console=ttyS2 root=/dev/mmcblk0p2 rw rootfstype=ext3 init=/init rootwait ip=off \
       omap_vout.vid1_static_vrfb_alloc=y omapdss.def_disp=lcd-43 omapfb.mode=dvi:1280x720MR-16 mpurate=1000'
bootm 0x80200000

and build the u-boot script with

$ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Boot setup script' -d boot.source boot.scr

download some media samples

$ wget http://downloads.igep.es/files/media-samples.tar.gz
$ tar xzf media-samples.tar.gz

finally create the sdcard with the mkmmc-android.sh script

$ wget http://downloads.igep.es/android/froyo-2.2/mkmmc-android.sh
$ chmod a+x mkmmc-android.sh
$ sudo ./mkmmc-android.sh <device> x-load-1.4.4-1.igep0020-sdcard.bin.ift u-boot-arm-2010.06-1.igep0020.bin kernel/arch/arm/boot/uImage boot.scr froyo-rootfs.tar.bz2 media-samples

Warning: Provide the right device name after the script name when you invoke the script. If you get this wrong it can wipe your HDD.

Annex: patches

Save blocks of code below instructions correspondingly as files patch1, patch2, patch3

then do:

This needs to be reviewed as patch below is wrong!

cd device/ti/igepv2
patch -b < ../../../patch1
cd ../../..
cd external/wpa_supplicant
patch -b < ../../patch2
cd ../..
cd hardware/libhardware_legacy/wifi
patch -b < ../../../patch3
cd ../../..

Project device/ti/igepv2/

project device/ti/igepv2/
diff --git a/AndroidBoard.mk b/AndroidBoard.mk
index bd28495..01b7385 100644
--- a/AndroidBoard.mk
+++ b/AndroidBoard.mk
@@ -27,6 +27,36 @@ PRODUCT_COPY_FILES += \
 PRODUCT_COPY_FILES += \
 	$(LOCAL_PATH)/vold.fstab:system/etc/vold.fstab
 
+# WPA
+PRODUCT_COPY_FILES += \
+	$(LOCAL_PATH)/wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf
+
+PRODUCT_COPY_FILES += \
+	$(LOCAL_PATH)/wpa_supplicant.conf:data/misc/wifi/wpa_supplicant.conf
+
+# Libertas SDIO firmware
+ifneq ($(wildcard $(LOCAL_PATH)/firmware/sd8686.bin),)
+PRODUCT_COPY_FILES += \
+	$(LOCAL_PATH)/firmware/sd8686.bin:system/etc/firmware/sd8686.bin
+endif
+ifneq ($(wildcard $(LOCAL_PATH)/firmware/sd8686_helper.bin),)
+PRODUCT_COPY_FILES += \
+	$(LOCAL_PATH)/firmware/sd8686_helper.bin:system/etc/firmware/sd8686_helper.bin
+endif
+
+# Libertas modules
+PRODUCT_COPY_FILES += \
+        $(LOCAL_PATH)/libertas/libertas.ko:system/lib/modules/libertas.ko
+
+PRODUCT_COPY_FILES += \
+        $(LOCAL_PATH)/libertas/libertas_sdio.ko:system/lib/modules/libertas_sdio.ko
+
+PRODUCT_COPY_FILES += \
+	$(LOCAL_PATH)/libertas/rc.libertas:system/bin/libertas/rc.libertas
+
+PRODUCT_COPY_FILES += \
+	$(LOCAL_PATH)/dhcpcd.conf:system/etc/dhcpcd/dhcpcd.conf
+
 # initlogo
 PRODUCT_COPY_FILES += \
 $(LOCAL_PATH)/../../rowboat/generic/initlogo/android-robot-on-black-480x640.rle:root/initlogo.rle.bak
diff --git a/BoardConfig.mk b/BoardConfig.mk
index b9e86b3..95187de 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -11,7 +11,7 @@ BUILD_WITH_ALSA_UTILS := true
 
 BUILD_PV_VIDEO_ENCODERS := 1
 
-BOARD_USES_OMAP3_LIGHTS := true
+BOARD_USES_OMAP3_LIGHTS := false
 
 BOARD_USES_VIRTUAL_TOUCHSCREEN := true
 USE_CUSTOM_RUNTIME_HEAP_MAX := "64M"
diff --git a/dhcpcd.conf b/dhcpcd.conf
new file mode 100644
index 0000000..54006c7
--- /dev/null
+++ b/dhcpcd.conf
@@ -0,0 +1,6 @@
+# dhcpcd configuration for Android Wi-Fi interface
+# See dhcpcd.conf(5) for details.
+
+interface wlan0
+# dhcpcd-run-hooks uses these options.
+option subnet_mask, routers, domain_name_servers
diff --git a/init.rc b/init.rc
old mode 100644
new mode 100755
index 57bf9bc..fecd861
--- a/init.rc
+++ b/init.rc
@@ -1,5 +1,3 @@
-# IGEPv2 development init.rc
-
 # Add our initlogo
 #on early-init
 #    symlink /initlogo.rle.bak /initlogo.rle
@@ -124,13 +122,24 @@ loglevel 3
     chmod 0777 /dev/video2
     chmod 0777 /dev/omap-resizer
 
+# loading dsp modules
+    insmod /system/ti-dsp/cmemk.ko "phys_start=0x84700000 phys_end=0x85900000 allowOverlap=1 useHeapIfPoolUnavailable=1"
+    insmod /system/ti-dsp/dsplinkk.ko
+    insmod /system/ti-dsp/lpm_omap3530.ko
+    insmod /system/ti-dsp/sdmak.ko
+
 # create basic filesystem structure
-    mkdir /system/etc/wifi 0770 system wifi
+    mkdir /system/etc/wifi 0770 wifi wifi
     chmod 0770 /system/etc/wifi
-    chown system wifi /system/etc/wifi
     chmod 0666 /system/etc/wifi/wpa_supplicant.conf
-    #chown wifi wifi /system/etc/wifi/wpa_supplicant.conf
-    chown system wifi /system/etc/wifi/wpa_supplicant.conf
+    chown wifi wifi /system/etc/wifi
+    #wpa_supplicant control socket for android wifi.c (android private socket)
+    mkdir /data/misc/wifi 0770 wifi wifi
+    mkdir /data/misc/wifi/sockets 0770 wifi wifi
+    chmod 0770 /data/misc/wifi
+    chmod 0660 /data/misc/wifi/wpa_supplicant.conf
+    chown wifi wifi /data/misc/wifi
+    chown wifi wifi /data/misc/wifi/wpa_supplicant.conf
 
     mkdir /data/misc 01771 system misc
     mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
@@ -140,31 +149,14 @@ loglevel 3
     mkdir /data/misc/systemkeys 0700 system system
     mkdir /data/misc/vpn/profiles 0770 system system
 
-    # wpa_supplicant socket
-    mkdir /data/system/wpa_supplicant 0771 system wifi
-    chmod 0771 /data/system/wpa_supplicant
-    chown system wifi /data/system/wpa_supplicant
-
-    mkdir /data/system/wpa_supplicant/sta 0771 system wifi
-    chmod 0771 /data/system/wpa_supplicant/sta
-    chown system wifi /data/system/wpa_supplicant/sta
-
-    # give system access to wpa_supplicant.conf for backup and restore
-    mkdir /data/misc/wifi 0770 system wifi
-    chown system wifi /data/misc/wifi
-    mkdir /data/misc/wifi/sockets 0770 system wifi
-    chmod 0770 /data/misc/wifi
-    chmod 0660 /data/misc/wifi/wpa_supplicant.conf
-    chown system wifi /data/misc/wifi/wpa_supplicant.conf
-
     mkdir /data/local 0771 shell shell
     mkdir /data/local/tmp 0771 shell shell
     mkdir /data/data 0771 system system
     mkdir /data/app-private 0771 system system
     mkdir /data/app 0771 system system
     mkdir /data/property 0700 root root
-    mkdir /data/misc/dhcp 0770 dhcp dhcp
-    chown dhcp dhcp /data/misc/dhcp
+    mkdir /data/misc/dhcp 0770 system dhcp
+    chown system dhcp /data/misc/dhcp
 
     # create dalvik-cache and double-check the perms
     mkdir /data/dalvik-cache 0771 system system
@@ -290,6 +282,8 @@ on boot
     setprop net.tcp.buffersize.edge    4093,26280,35040,4096,16384,35040
     setprop net.tcp.buffersize.gprs    4092,8760,11680,4096,8760,11680
 
+    setprop wifi.interface wlan0
+
     class_start default
 
 ## Daemon processes to be run by init.
@@ -297,8 +291,13 @@ on boot
 service console /system/bin/sh
     console
 
-# Start PowerVR SGX DDK
+# start PowerVR
 service pvr /system/bin/sgx/rc.pvr start
+    oneshot
+
+# start wifi
+service libertas /system/bin/libertas/rc.libertas start
+    oneshot
 
 # adbd is controlled by the persist.service.adb.enable system property
 service adbd /sbin/adbd
@@ -342,8 +341,8 @@ service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-sys
     onrestart restart media
 
 service media /system/bin/mediaserver
-    user media
-    group system audio camera graphics inet net_bt net_bt_admin net_raw
+    user root
+    group system audio camera graphics inet net_bt net_bt_admin net_raw sdcard_rw
     ioprio rt 4
 
 service bootanim /system/bin/bootanimation
@@ -357,12 +356,11 @@ service dbus /system/bin/dbus-daemon --system --nofork
     user bluetooth
     group bluetooth net_bt_admin
 
-#service wpa_supplicant /system/bin/wpa_supplicant -Dwext -dd -iwlan0 -c /system/etc/wifi/wpa_supplicant.conf
-#    #socket wpa_wlan0 dgram 660 system wifi
-#    #user system
-#    group system wifi inet
-#    disabled
-#    oneshot
+service wpa_supplicant /system/bin/wpa_supplicant -dd -Dwext -iwlan0 -c/system/etc/wifi/wpa_supplicant.conf
+    socket wpa_wlan0 dgram 660 wifi wifi
+    group system wifi inet
+    disabled
+    oneshot
 
 service bluetoothd /system/bin/bluetoothd -n
     socket bluetooth stream 660 bluetooth bluetooth
diff --git a/vold.fstab b/vold.fstab
index fc83907..b58f21f 100644
--- a/vold.fstab
+++ b/vold.fstab
@@ -1,2 +1,2 @@
-dev_mount sdcard /mnt/sdcard auto /devices/platform/mmci-omap-hs.0/mmc_host/mmc0
+dev_mount sdcard /mnt/sdcard 3 /devices/platform/mmci-omap-hs.0/mmc_host/mmc0
 diff --git a/dhcpcd.conf b/dhcpcd.conf
new file mode 100644
index 0000000..54006c7
--- /dev/null
+++ b/dhcpcd.conf
@@ -0,0 +1,6 @@
+# dhcpcd configuration for Android Wi-Fi interface
+# See dhcpcd.conf(5) for details.
+
+interface wlan0
+# dhcpcd-run-hooks uses these options.
+option subnet_mask, routers, domain_name_servers
diff --git a/wpa_supplicant.conf b/wpa_supplicant.conf
new file mode 100644
index 0000000..a35efd3
--- /dev/null
+++ b/wpa_supplicant.conf
@@ -0,0 +1,6 @@
+ctrl_interface=wlan0
+update_config=1
+
+network={
+	key_mgmt=NONE
+}

Project external/wpa_supplicant/

project external/wpa_supplicant/
diff --git a/os_unix.c b/os_unix.c
index 8498b15..7b1b929 100644
--- a/os_unix.c
+++ b/os_unix.c
@@ -187,7 +187,7 @@ int os_program_init(void)
 	prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
 
 	setgid(AID_WIFI);
-	setuid(AID_WIFI);
+	setuid(AID_SYSTEM);
 
 	struct __user_cap_header_struct header;
 	struct __user_cap_data_struct cap;

Project hardware/libhardware_legacy/

project hardware/libhardware_legacy/
diff --git a/wifi/wifi.c b/wifi/wifi.c
index 3f8708d..b114946 100644
--- a/wifi/wifi.c
+++ b/wifi/wifi.c
@@ -263,8 +263,8 @@ int ensure_config_file_exists()
     if (chown(SUPP_CONFIG_FILE, AID_SYSTEM, AID_WIFI) < 0) {
         LOGE("Error changing group ownership of %s to %d: %s",
              SUPP_CONFIG_FILE, AID_WIFI, strerror(errno));
-        unlink(SUPP_CONFIG_FILE);
-        return -1;
+        //unlink(SUPP_CONFIG_FILE);
+        //return -1;
     }
     return 0;
 }

Annex: libertas.rc

Save the following block to device/ti/igepv2/libertas/libertas.rc

#!/system/bin/sh

load_libertas()
{
	insmod /system/lib/modules/libertas.ko
	#insmod /system/lib/modules/libertas_sdio.ko
	# Let WiFi part know that the driver is already loaded
	setprop wlan.driver.status ok

	echo "Loaded Libertas WiFi modules"

	return 0;
}

unload_libertas()
{
	if rmmod libertas; then :; else return 1; fi
	#if rmmod libertas_sdio; then :; else return 1; fi

	echo "Unloaded Libertas WiFi modules."
	return 0;
}

# Deal with the type of invocation we get.
#
case "$1" in
"start")
	load_libertas
	;;
stop)
	if ! unload_libertas; then
		echo "Couldn't unload modules" >&2;
	fi
	;;
reload|restart)
	if unload_libertas; then
		load_libertas
	else
		echo "Couldn't unload modules" >&2;
	fi
	;;
*)
	echo "$0: unknown argument $1." >&2;
	;;
esac

Android Eclair 2.1 Platform

Pre-built images for impatients

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE'.

Release Kernel Rootfs Platform
Android 2.1 (Eclair) 2.6.29-igep0020 2.1 Update 1 http://developer.android.com/sdk/android-2.1.html

Build Android Eclair from sources

Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest:

$ mkdir android
$ cd android
$ repo init -u git://gitorious.org/rowboat/manifest.git -m < manifest name >

where manifest name is:

  • rowboat-eclair.xml - for eclair version of rowboat
  • rowboat-eclair-dsp.xml - for eclair version of rowboat with DSP support

To pull down files to your working directory from the repositories as specified in the default manifest, run

$ repo sync

If you want eclair with DSP support you need to download and place codec_engine_2_24_01.tar.gz under the external/ti-dsp folder. Codec Engine is available here. Note you may need to have an account on software-dl.ti.com

Now build for your target product, do

$ make TARGET_PRODUCT=igepv2 -j8

for rowboat-eclair or

$ make TARGET_PRODUCT=igepv2 BUILD_WITH_GST=true dvsdk -j8

for rowboat-eclair-dsp

Next step is create a tarball containing the rootfs

$ cd out/target/product/igepv2
$ mkdir android-rootfs
$ cp -r root/* android-rootfs
$ cp -r system android-rootfs
$ sudo ../../../../build/tools/mktarball.sh ../../../host/linux-x86/bin/fs_get_stats android-rootfs . rootfs rootfs.tar.bz2
$ cd ../../../../

The next step is build the Linux kernel for your board.

$ export PATH=${PWD}/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:$PATH
$ cd kernel/
$ make ARCH=arm igep0020_android_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-eabi- uImage -j8
$ cd ..

Now, you're ready to install and run your new android image.

Installing and Using the Result on a NFS-mounted root filesystem

With factory seetings, the board will attempt to mount its root filesystem from the server as /srv/nfs/<distro>/<project>/<machine>, where

***<distro> where distro is <your distro>
***<project> where project is <your project>
***<machine> where machine is <your machine>

Create the directory structure and extract the root file system to the NFS server

$ sudo mkdir -p /srv/nfs/android/android-image-eclair/igep0020
$ pushd /srv/nfs/android/android-image-eclair/igep0020
$ sudo tar jxf rootfs.tar.bz2
$ popd

After this the only configuration that needs to be added is an entry for your target root directory to your /etc/exports file, for instance like this:

# Poky image rootfs
/srv/nfs/android/android-image-eclair/igep0020       *(rw,no_root_squash,no_subtree_check,sync)

After modifying the /etc/exports file you will make sure the NFS system is notified about the change, for instance by issuing the command:

$ sudo exportfs -a

The target also can get its kernel image from your tftp server. Similar to the NFS root filesystem, the target system will attempt to get its kernel image from the server as /srv/tftp/<distro>/<project>/<machine>. Follow next steps to configure your board and run the your new image.

Create the directory structure and copy the kernel image to the TFTP server, refer to The Linux kernel for build your own image.

$ mkdir -p /srv/tftp/android/android-image-eclair/igep0020
$ cp kernel/arch/arm/boot/uImage /srv/tftp/android/android-image-eclair/igep0020

Then, connect your development board as explained in IGEP v2 Software SDK Manual

Next, power up your board and stop u-boot's autoboot by pressing a key.

Now, it's time to change the U-Boot environment.

U-Boot> setenv distro android
U-Boot> setenv project android-image-eclair
U-Boot> setenv bootargs-base mem=512M androidboot.console=ttyS2 console=tty0 console=ttyS2,115200n8 init=/init rootwait omap-dss.def_disp=dvi omapfb.video_mode=720x480MR-16@60

If you want to set as default boot option, you can also save your new environment

U-Boot> saveenv

The last step is run the boot command.

U-Boot> run nfs-boot

Links and resources

--- That's all folks ---