Thursday, May 9, 2013

extract-files.sh: remote object does not exist

According to the official Cyanogenmod build guide, there is one step called "Extract Proprietary Blobs", in which you have to connect the device with USB and run "extract-file.sh" to get those "blobs" from the device.

However, in running the extract-files, it's very often to see output like
remote object '/system/lib/egl/libplayback_adreno200.so' does not exist
It didn't say it's an "Error", but actually the script will just stop there, leaving the remaining blobs unextracted.

If you thought, oh, only one file does not exists, maybe not a big deal, so you continue to build the framework, it's highly likely that the framework you build will not work properly, due to lack of blobs.

Solution:
Download a released Cyanogenmod for that device (the same version with the one you are trying to compiling), unzip it to a folder, suppose the folder is "/home/cm"
Then when running the extract-file.sh, instead of connecting your device to USB and extracting from device (which is the default behavior if you don't provide any argument to the extract-files.sh), you can simply run
./extract-files.sh /home/cm
(replace /home/cm to the folder where you unzip the Cyanogenmod, of course)
Then the extract-files.sh will copy blobs from that folder.

If there is still some file missing (e.g. libpn544_fw.so for Galaxy S3), then google it, download it and put it in the right path -- in general, missing blobs is not a good thing, we should avoid it as much as we can, and that's why I commented out the text below, which is a very bad solution.


When I try to follow the wiki page to build Cyanogenmod from source, there is one step called
Extract Proprietary Blobs
in which I need to go to device/samsung/quincyatt folder and execute extract-files.sh to get those "blobs" from the device.

In executing the extract-files.sh, the script stops and says
remote object '/system/lib/egl/libplayback_adreno200.so' does not exist
Well, it's not an error, so I thought it happens to be the last file not exists, but actually it's not.
Go to the device folder, and run
grep -lr "libplayback_adreno200.so" *
I find it's in samsung/msm8660-com/com-proprietary-files.txt, so open that file, search for "libplayback_adreno200.so", and comment it out, re-execute the script, the script proceeds to extracting more files.

If similar error happens again, just repeat the same process.

Wednesday, May 8, 2013

Error: selected processor does not support ARM mode smc #0

When compiling kernel for SGH-I717, an error occurs:
Error: selected processor does not support ARM mode smc #0

It happens when
CC   arch/arm/mach-msm/scm.o

So following the post http://blog.csdn.net/gchww/article/details/7571584 and http://wakefang.blogspot.com/2011/08/error-selected-processor-does-not.html,

open scm.c (since this is the file where the compilation error occurs, as shown in the error message above. You should replace it with the appropriate file in you case, of course) and search for "asm", add the following line

asm(".arch_extension sec\n\t");

before every asm instruction.
Re-compile, it works.

P.S. if same error occurs again for another file, do the same operation for that file.

Samsung Note Model Number

When I try to get the kernel source code from http://opensource.samsung.com/, there is a full list of SGH-I717 models, like
SGH-I717
SGH-I717D
SGH-I717M
SGH-I717R

And I'm not sure which one to get.

Google it and find that:
SGH-I717 = AT&T
SGH-I717R = Rogers
SGH-I717D = Telus
SGH-I717M = Bell

Since I'm in US and using AT&T, I should download the one for SGH-I717

Hope this helps if you have the same question : )

Get standalone ARM Toolchain for Android from NDK

This tutorial shows how to get standalone ARM toolchain for Android.

------------------------------
Edit:
Actaully... you can get standalone ARM toolchain by
$ sudo apt-get install gcc-arm-linux-gnueabi
That's it.. no need to continue reading..
------------------------------

It used to be very complex procedure to build a toolchain, but luckily in NDK, google already prepare it ready for you. Follow the steps below, you will get your standalone toolchain (cross compiler) for ARM in 10min.

1. Download the Android NDK from
    http://developer.android.com/tools/sdk/ndk/index.html
    and untar it

2. There is a "toolchain" folder in the ndk, but I find that if I use that directly, there will be errors like:
    stdio.h:50:23: fatal error: sys/cdefs.h: No such file or directory
    If you go to the "docs" folder in the ndk folder, in STANDALONE-TOOLCHAIN.html, it explains in detail how to get a standalone toolchain from the ndk.
    For your convenience, I post the command here:
    First go to your ndk folder
    $ ./build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=~/my-android-toolchain-dir

    The --platform=android-9 specify the Android API level you want to support; --install-dir specifies the directory where you want to put the toolchain, if you omit the --install-dir, it will create a tar.bz2 file for you, and you can untar it anywhere you want -- which is better, i think : )
    If you are using 64bit Linux, you will have to add --system=linux_x86_64 in the command above

3. Try to compile a HelloWorld program using the new toolchain, and enjoy!

Tuesday, July 24, 2012

学术会议申根签证的申请经验

      由于8月份要去芬兰参加一个学术会议,前段时间去纽约芬兰大使馆申请欧洲的申根签证(Schengen Visa),在此记下经验,教训,希望对大家有所帮助~
      请注意,我是在美国持F-1签证去芬兰大使馆申请申根签证,其他国家的要求或流程可能会有所出入,具体要求请参见申请国家的大使馆网页。


1. 准备篇

      以下是我的准备list:
      1) 签证申请表(点我下载
      2) 往返芬兰机票(reservation也可以)
      3) 芬兰hotel reservation email
      4) 会议主办方的support letter
      5) 会议travel grant 的证明
      6) advisor的support letter,主要是说travel grant 没有cover的费用他会负责
      7) passport, 美国visa+i94, I-20 的原件以及复印件
      8) 一张个人照片 (点击查看:芬兰签证对照片的要求)
      9) a copy of credit card (就是把credit card 影印一下打印出来。。)
      10) insurance letter from insurance company
      + 签证费 约76刀,如果需要签证邮寄服务的话再加10刀(注意那里不能用credit card,最好带现金)

      1) - 9) 没什么好说的,按步就班准备就可以了,最容易出错的就是10)了。在芬兰纽约大使馆官网上关于insurance的要求是这样说的:

      Valid traveller's insurance, which is valid during the whole stay and in the whole Schengen territory. The insurance must cover costs caused by sudden illness and accidents, including the transport home of the patient up to the amount of USD 50,000 and in case of death the costs for transport home of the deceased OR medical insurance with the same coverage. Travelers insurance has to be non-deductable.
Coverage must be indicated in letter from insurance company, a copy of the insurance card is not enough.
If you travel from Finland to another Schengen country your insurance has to cover that flight as well

       很长的一段。。最重要的一用句就是加下划线的一句:insurance card is not enough. 签证的时候问了签证官我才知道,原来是要你写email给你的insurance company, 让他们发一封邮件给你,上面写明: 1. 你的姓名,2. 保险类型(international health insurance), 2. 保险涵盖日期  3, 保险赔偿金额(按上面要求,要$50,000), 把那个email打印出来带过去才可以。
       你如果实在忘了带了,也可以以后通过email补交给大使馆(我就是这么做的。。)只不过有点耽误时间。。



2. 实战篇

      好,准备齐了所有资料后就可以出发去纽约芬兰大使馆签证了!
      在纽约 Time Square 地铁站坐 7号线(到法拉盛的地铁),两站后下车,往东南,就是往 1st Avenue的方向步行10-15分钟, 在 1st Avenue与 42nd Street的交叉处就可以看到壮观的联合国大厦~


      我当时傻乎乎的就准备往里进,心里还乐呵呵的想,进城办趟签证还可以进一趟联合国大厦,不错呀。。结果当然果断被门卫拦住了,一问才知道,原来芬兰大使馆并不在联合国大厦里,而在其北边的一所高楼中(地址是:866 United Nations Plaza, New York, NY 10017),如下图中圈圈所示:

     
      进去后跟黑人大叔门卫打个招呼,登个记,出示下photo ID, 他会告诉你芬兰大使馆在250, 然后直奔目的地就行了~
      官上网写的签证时间是上午10点到12点,但实际那里最早9点就可以签了~ 我9点钟去一个排队等签的人都没有,即来即签,非常爽~
      接下来就是交材料了,也没有问我什么问题,可能是材料比较齐全吧,但就是保险有问题。。如上面所说,这里就不再重复了,后来第二天把insurance company的letter给他们发个email过去就行了~



3. 签完了~~

       签完了,吼吼,继续坐7号线到法拉盛,去美食广场美美吃一顿麻辣香锅~~