Build android image

Started by gvi70000, September 18, 2014, 09:31:31 PM

Previous topic - Next topic

gvi70000

in
/home/gvi/android/olimex-a20/lichee/tools/pack/out
i have the file
system.fex
but in
android4.2/out/target/product/olinuxino-a20/system.img

system.img dosent exists.

if i right click on the first file i get

This link cannot be used because its target "/home/gvi/android/olimex-a20/android4.2/out/target/product/olinuxino-a20/system.img" doesn't exist.


is it normat that after ./build.sh -psun7i_android

i get INFO: skip make rootfs for android ??

INFO: build u-boot OK.
INFO: build rootfs ...
INFO: skip make rootfs for android
INFO: build rootfs OK.
INFO: build lichee OK.



dave-at-axon

Did you manage to build the Android source? Did you run envsetup, lunch, extract-bsp and make -j4

The missing system.img would indicate that it is not done yet.

The ./build.sh is just to build the Android Linux kernel.

gvi70000

QuoteDid you manage to build the Android source? Did you run envsetup, lunch, extract-bsp and make -j4
yes, i did. I was wondering if is normat that after ./build.sh -psun7i_android to get INFO: skip make rootfs for android

dave-at-axon

I just did a build on the Linux kernel and I get the same as you are seeing.

INFO: build u-boot OK.
INFO: build rootfs ...
INFO: skip make rootfs for android
INFO: build rootfs OK.
INFO: build lichee OK.

gvi70000

Ok, so that's normal.

I will make a clean install of 12.04 and apply all that i have found and learn. If it will not work then i will have the following to sell with a discount

1x Olimex A20 with 4Gb NAND
2x 7" LCD with adapter included (lcd connector on adapter changed to a quality one)

dave-at-axon

Good luck with it. If you have the right environment setup and all the files that Google dev says you should have then it will work as long as you have added the missing files from Olimex if you are using their source.

gvi70000

Thanks,

I am using your archives, right now i am building...

I will post the results

dave-at-axon

Cool. You'll need to make a few small changes to use the resistive touch LCD from Olimex but it's not too complex to work out.

Give me a shout if you need any help with it.

The main thing is to get it to build and once that is building without errors you can start to make changes and add or remove what you need.

gvi70000

Hi,
The LCD itself is not from Olimex...

Here are the steps i detail that i followed

1. Update SO sudo apt-get update

2. DOWNLOAD and INSTALL jdk-6u24-linux-x64.bin from oracle download page
cd ~/Downloads/
chmod +x jdk-6u24-linux-x64.bin
./jdk-6u24-linux-x64.bin
sudo mkdir /usr/lib/jvm
sudo mv jdk1.6.0_24 /usr/lib/jvm
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_24/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_24/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_24/bin/javaws" 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo nano /etc/environment
# add this line at file tail
JAVA_HOME="/usr/lib/jvm/jdk1.6.0_24"
source /etc/environment

3. sudo apt-get install git gnupg flex bison gperf build-essential \
  zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
  libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
  libgl1-mesa-dev g++-multilib mingw32 tofrodos \
  python-markdown libxml2-utils xsltproc zlib1g-dev:i386

Doesent work for all, some have to be installed manual - see point 5 - i think the order is not right

4. sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get install g++-4.6
sudo apt-get install gcc-arm-linux-gnueabi

or

sudo apt-get install gcc-4.6 g++-4.6 g++-4.6-multilib gcc-4.6-multilib

5. sudo apt-get install
bison
flex
xsltproc
gperf
libswitch-perl
libxml2-utils
git
gnupg
build-essential
zip
curl
libc6-dev
libncurses5-dev:i386
x11proto-core-dev
libx11-dev:i386
libreadline6-dev:i386
libglapi-mesa:i386
libgl1-mesa-glx:i386
libgl1-mesa-dev
g++-multilib
mingw32
tofrodos
python-markdown
libxml2-utils
xsltproc
zlib1g-dev:i386
u-boot-tools


6. sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

7. sudo nano /etc/udev/rules.d/51-android.rules

The recommended approach is to create a file /etc/udev/rules.d/51-android.rules (as the root user) and to copy the following lines in it. <username> must be replaced by the actual username of the user who is authorized to access the phones over USB.
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
# adb protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="<username>"
# fastboot protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="<username>"
# adb protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="<username>"
# fastboot protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="<username>"
# adb protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="<username>"
# adb protocol on panda (PandaBoard ES)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="0600", OWNER="<username>"
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="<username>"
# usbboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d00f", MODE="0600", OWNER="<username>"
# usbboot protocol on panda (PandaBoard ES)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d010", MODE="0600", OWNER="<username>"
# adb protocol on grouper/tilapia (Nexus 7)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0600", OWNER="<username>"
# fastboot protocol on grouper/tilapia (Nexus 7)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0600", OWNER="<username>"
# adb protocol on manta (Nexus 10)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0600", OWNER="<username>"
# fastboot protocol on manta (Nexus 10)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee0", MODE="0600", OWNER="<username>"

7. Setting up ccache
Go in Home folder
Press CTRL+H and edit the file .bashrc
export USE_CCACHE=1

since we are in this file...add 2 more lines

PATH=$PATH:$HOME/android/olimex-a20/android4.2/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin
PATH=$PATH:$HOME/android/olimex-a20/android4.2/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/

****
read this
http://axonjakarta.wordpress.com/2014/02/14/olimex-a20-android-building-4/
****

8. In Home folder create
android and then olimex-a20
so the final structure will look like /home/<username>/android/olimex-a20

9. download from
http://dl.linux-sunxi.org/users/tsvetan/ANDROID-4.2.2-SDK2.0-KERNEL-3.4/
Android 4.2, Linux 3.4 and olinuxino-a20

copy the files in to the folder /home/<username>/android/olimex-a20

10.
cd /home/<username>/android/olimex-a20
tar zxvf android4.2.tar.gz
tar zxvf lichee-v2.0.tar.gz

11. Check

gcc -v
sudo update-alternatives --config java
sudo update-alternatives --config javac

12.
cd /home/<username>/android/olimex-a20/lichee
./build.sh -psun7i_android

13. Wait for the build to end and you will get

INFO: build u-boot OK.
INFO: build rootfs ...
INFO: skip make rootfs for android
INFO: build rootfs OK.
INFO: build lichee OK.

14.
copy olinuxino-a20.tgz in the folder below
cd /home/<username>/android/olimex-a20/android4.2/device/softwinner/
tar zxfv olinuxino-a20.tgz
cd ../../

now you are in /home/<username>/android/olimex-a20/android4.2

source build/envsetup.sh

you get

including device/asus/grouper/vendorsetup.sh
including device/asus/tilapia/vendorsetup.sh
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/armv7-a/vendorsetup.sh
including device/generic/mips/vendorsetup.sh
including device/generic/x86/vendorsetup.sh
including device/samsung/maguro/vendorsetup.sh
including device/samsung/manta/vendorsetup.sh
including device/samsung/toroplus/vendorsetup.sh
including device/samsung/toro/vendorsetup.sh
including device/softwinner/common/vendorsetup.sh
including device/softwinner/olinuxino-a20/vendorsetup.sh
including device/softwinner/wing-k70/vendorsetup.sh
including device/softwinner/wing-nck70/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including sdk/bash_completion/adb.bash

lunch

select olinuxino-a20_eng option 15

you get

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
TARGET_PRODUCT=olinuxino_a20
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.13.0-35-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39
OUT_DIR=out
============================================

extract-bsp

/home/<username>/android/olimex-a20/android4.2/device/*/olinuxino-a20/bImage copied!
/home/<username>/android/olimex-a20/android4.2/device/*/olinuxino-a20/modules copied!

make -j4

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
TARGET_PRODUCT=olinuxino_a20
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.13.0-35-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39
OUT_DIR=out
============================================
Checking build tools versions...
external/bluetooth/bluedroid/Android.mk:8: NO BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR, using only generic configuration
CEDARX_PRODUCTOR: GENERIC
find: `../../vendor/unbundled_google/libs/gcm/gcm-client/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-server/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-client/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-server/src': No such file or directory
find: `src': No such file or directory

.
.
.


Now i got a new error

Import includes file: out/target/product/olinuxino-a20/obj/STATIC_LIBRARIES/libgtest_main_intermediates/import_includes
Import includes file: out/target/product/olinuxino-a20/obj/STATIC_LIBRARIES/libgtest_intermediates/import_includes
Import includes file: out/target/product/olinuxino-a20/obj/STATIC_LIBRARIES/libtestUtil_intermediates/import_includes
Export includes file: system/extras/tests/binder/benchmarks/Android.mk -- out/target/product/olinuxino-a20/obj/EXECUTABLES/binderAddInts_intermediates/export_includes
Import includes file: out/target/product/olinuxino-a20/obj/EXECUTABLES/dalvik-vm-unit-tests_intermediates/import_includes
make: *** No rule to make target `device/softwinner/olinuxino-a20/modules/modules/fusion_F0710A.ko', needed by `out/target/product/olinuxino-a20/fusion_F0710A.ko'.  Stop.
make: *** Waiting for unfinished jobs....
Export includes file: dalvik/unit-tests/Android.mk -- out/target/product/olinuxino-a20/obj/EXECUTABLES/dalvik-vm-unit-tests_intermediates/export_includes

that before was not an issue

I tried win m, y and n when i have to choose the F0710A but the result is the same



dave-at-axon

This should be easy enough to fix. This will happen because your Linux kernel build did not include the Fusion driver.

As you don't have that Fusion LCD, we should remove it from the build.

Open the file olinuxino_a20.mk in the /device/softwinner/olinuxino_a20 directory.

Go to line 24 and comment out the line that loads the fusion_F0710A.ko file. Remove the \ from the preceding line.

Try the build again. If this works you need to edit the init.sun7i.rc file to change to the RTP driver. You'll also need to edit the FEX file to change to the RTP driver. This is not used used during the build, only when you pack the files so you change and re-pack as needed.


Add in line 212 and comment out 215

gvi70000

#25
Hi Dave,

I have tried your proposal on Ubuntu 12.04 and Debian 7.6 both x64 ant i cant compile the image

Applying the same steps on Ubuntu 14.04 works without any issues with your archives, so i have managed to compile the image.

Regarding your last post i have the following questions:

1. Changing olinuxino_a20.mk in the /device/softwinner/olinuxino_a20 directory still stops the process and ask if i want to add the driver. Ho do i remove this? i will use make ARCH=arm menuconfig?

2.
Quote
Try the build again. If this works you need to edit the init.sun7i.rc file to change to the RTP driver. You'll also need to edit the FEX file to change to the RTP driver. This is not used used during the build, only when you pack the files so you change and re-pack as needed.
can you please point the path to these files? because using search i find several.

3. In Android where do i set the default display type and resolution?

PS I can boot from SD with your image but the screen goes off in few seconds and i have no touch :)

dave-at-axon

Quote from: gvi70000 on September 23, 2014, 11:47:36 PM
Regarding your last post i have the following questions:

1. Changing olinuxino_a20.mk in the /device/softwinner/olinuxino_a20 directory still stops the process and ask if i want to add the driver. Ho do i remove this? i will use make ARCH=arm menuconfig?

This is annoying to me too. Any changes made to the config always ask for confirmation. I have found though that if you do a clean first then menuconfig it doesn't ask me.

Quote
Quote
edit the init.sun7i.rc file
can you please point the path to these files? because using search i find several.

It's located in the device/softwinner/olimex-a20 directory.

Quote
3. In Android where do i set the default display type and resolution?

As far as I can tell, this is done in the FEX file. The settings in my archive are for the Fusion display so you may need to adjust the settings to get it to work with different resolutions.

Quote
PS I can boot from SD with your image but the screen goes off in few seconds and i have no touch :)

Ah yes, that dreaded off in a few seconds. Once you get touch working, you can change this in the settings. I've not found out the location of settings for this to set a higher default off time as part of the build.

Getting it compiled and running is a good start though. We just need now to enable your touch.

I assume you are using resistive into the processor touch interface? If yes, then changing the init.sun7i.rc should work. Another quick way for testing is to connect via the debug on UART0 and issue commands to uninstall the fusion touch driver using rmmod and then insmod the sun7i touch. The names are in the init.sun7i.rc file.

You can also try this over ADB via the USB port as I disabled the authorisation on ADB connection. :)

gvi70000

Hello Dave,

I have tried to compile with the files from Olimex archives but i am getting a lot of errors.
With the files from you is working fine, so i have some questions.

1. In menuconfig is it possible to select the Olimex LCD and TS driver? If yes can you tell me which are they?
2. I downloaded thate latest driver for RTL8188CUS from RTL and seems that it is the sale as the one named 8188E or 8172C from the linux-3.4, i will just mark with * and try to use. After menuconfig do i need to run make?
3. from where can i control the animation at the boot time? times to keep the logos on the screen?

Thank you

dave-at-axon

Give me a few hours and I will sort out what you need to do to change the Olimex LCD.

I stick the details on the blog as others may need it too. I post the files there too.

The boot animation is just zip file with a series of images. There is a but more work to do the once that appears after the AllWinner on initial power up. None of the images ever appears on the HDMI though, only the LCD.

I'll stick this on the blog too if I get time.

gvi70000

That will be great, your blog is far far the best resource to compile the image