2016年6月14日 星期二

Ubuntu Phone - porting - emulator

其實對 emulator 之前沒什麼研究,依official wiki 中步驟[1]抓來的 android code tree 是phablet-4.4.2_r1 [2],看來 wiki 中的 "Building from scratch" 就是抓 phablet 4.4.2_r1 來 build emulator。
如果是直接裝 ubuntu-emulator 其 dependency ubuntu-emulator-runtime.deb 就會把prebuild 的 emulator 放在下面
/usr/share/android/emulator/out/host/linux-x86/bin/emulator-x86
/usr/share/android/emulator/out/host/linux-x86/bin/emulator-arm
然後執行 "ubuntu-emulator run" 時 [2] 時再去執行相對位置的 emulator-*.

如此看來如果要把 Ubuntu emulator 升級當作一個 reference device 的話,可以拉新的 AOSP code,build 出其 emulator binary,還可以升級goldfish kernel [3] 到3.18 or 4.4.  最新的 emulator kernel 已改為 ranchu [6].

目前新的 AOSP tree 不再包含 qemu [4], 而是直接放一個 prebuilt emulator [5]所以可能需要再另外把它拉回來build。

keep updating .....
(
emulator 還不能動:
https://hackpad.com/Phablet-Ubuntu-Touch-z2FB0yq24Eq
)

[1] https://wiki.ubuntu.com/Touch/Emulator
[2] http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/goget-ubuntu-touch/wily/files/head:/ubuntu-emulator/
[3] https://android.googlesource.com/kernel/goldfish.git
[4] https://android.googlesource.com/platform/external/qemu
[5] https://android.googlesource.com/platform/prebuilts/android-emulator
[6] https://groups.google.com/forum/#!topic/android-emulator-dev/dltBnUW_HzU

2016年6月11日 星期六

Ubuntu Phone - porting - tools

工欲善其事,必先利其器,知道工具在那裡並如何使用,會方便很多,這篇文章就用來收集開發時後可以用到的工具,連結等等 ... keep updating...

## Documents
 * https://wiki.ubuntu.com/Touch
  * https://wiki.ubuntu.com/Touch/MaintainingCodePhablet
  * https://wiki.ubuntu.com/Touch/ContainerArchitecture

## Docker which can be used to build AOSP/device tarball.
 * https://hub.docker.com/r/phablet/platform-devel/

## The place to file bug for Ubuntu touch.
 * https://bugs.launchpad.net/canonical-devices-system-image
 * https://bugs.launchpad.net/turbo
 * https://bugs.launchpad.net/avila
 * https://bugs.launchpad.net/arale

## The reference device Sony Z5 for android 6.x (on developing)
 * https://wiki.ubuntu.com/Touch/Devices/minato

## The phablet 6.x common tree.
 * https://code-review.phablet.ubuntu.com/#/admin/projects/aosp/platform/manifest
  * $ repo init -u ssh://<username>@code-review.phablet.ubuntu.com:29418/aosp/platform/manifest \ -b phablet-6.x && repo sync
 * https://wiki.ubuntu.com/Touch/MaintainingCodePhablet

## The server which host device images
 * Global: http://system-image.ubuntu.com/
 * China: http://cn.system-image.ubuntu.com or http://cache-origin.system-image.ubuntu.com

## Tools
 * https://github.com/alex-tu-cc/ubuntu_phone_tools

## Tips
 * How to flash Meizu Pro5 Android edition to Ubuntu?
  * I did not test this way, but it looks good to go.
  * http://askubuntu.com/questions/767323/how-to-install-ubuntu-on-meizu-pro-5-that-was-originally-with-android/767771#767771?newreg=7437cbdaadd6416ea11a98492c08df17

2016年6月7日 星期二

Ubuntu Phone - porting - 緣起

Ubuntu Phone 已經上市一段時間了,但似乎沒看到 community 在 Port 它,可能是實體手機出貨量太少,也可能是 document 不夠(沒看到中文的)導致開發者興趣缺缺,作最僅剩的第三方 phone os,不免覺得有點可惜。其實買 Ubuntu edition phone 滿划算的,因為其可以刷回 Android 版本,但 Android edition 就不行刷到 Ubuntu edition 了(主因為 Ubuntu resize partition)。

但是如果 WIDI support[1][註1] 順暢度達成後,當成一個開發阿宅的隨身小 pc[2],用來 ssh 到家中或是公司的 server ,在外面開會或是在朋友家中也可以當一個臨時的報告用小 pc 也是滿方便的,甚至有些家庭可能就不需要買文書小筆電可以在外用手機,回家變桌機。這實在是個人滿期待看到的結果。

App 生態不完整是當然不流行的一大主因,但個人認為這是鷄跟蛋的問題,就跟 Android 剛出的時後也是被笑完全跟 Iphone 沒得比,但後來也是追上來了。只要有抓到大家想要的點,自然就會有人用了。目前每次 OTA 後,所有裝過的 deb packages 都要重裝是令個人感覺比較不方便的地方,不知道有沒有什麼好方法解決。

因此,我想借這個 blog 來分享一些開發的經驗,所以留言開放大家點歌~哦不,是點主題,看有那些你很想要知道的,但一直找不到資料,我可以盡我所能(=有空的時後)的回答大家。

目前我想先分享一些 porting 上可能會遇到的問題,以及大約的架構 (說得太淺請別笑我,大家切撮指教)

其實有很多問題也可以直接上 mail list [4]上詢問,上面高手如雲。

[1] http://news.softpedia.com/news/ubuntu-touch-ota-11-update-introduces-wireless-display-support-to-ubuntu-phones-504681.shtml
[2] http://www.techrepublic.com/article/ubuntu-convergence-finally-impresses-me/
[3] https://wiki.ubuntu.com/Touch/Devices/minato
[4] https://lists.launchpad.net/ubuntu-phone/

[註1] 因為目前很多手機都將 MHL 功能拿掉,所以目前看來只有 WIDI 比較可行,不過還是有一些手機存在 MHL [3],如果可以順利 porting 完成,可能也有助於手機廠再回頭看 MHL 這塊。

2015年11月15日 星期日

import AOSP to gitlab


AOSP have almost 700 repositories, it is failed to import them into gitlab.

Install from source, it introduced database (postgresql) and redis

Gitlab architecture:


unofficial gitlab docker:

detail description of parameters:

issue "500 error" after import lots of repositories:

It seems be fixed in this issue?

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/raketasks/import.md
root@8395b04d4219:/home/git/gitlab# bundle exec rake gitlab:import:repos RAILS_ENV=production

The official docker image give me another issue:
Failed to create repository via gitlab-shell

2015年7月12日 星期日

snappy notes


Test snappy in docker:
http://andrea.corbellini.name/2015/03/25/running-ubuntu-snappy-inside-docker/

[ 小米換到 coolpad 大神 F2 ]

# 之前寫的忘記有沒有寫完 ... 就丟出來吧 XD

最近買了CP 值滿高的 Coolpad 大神 F2 今天剛拿到,感覺還不錯,但是要從原本的手機移過來也是個大問題,雖然很多資料都已經放到雲端,但還是有些是存在App 中,且要一個一個 App 去裝,也很麻煩,因此試了幾個方法。

1. 鈦備份:
這個應該是最好的選則,我之前也有買鈦備份專業版,但可惜的是,它一定要在 root 下使用,偏偏在 coolpad 大陸宣佈 root 後還是照樣有保固的同時,台灣就是沒有同步 (奇怪平常不是一直叫是一個國家,怎麼現在又不同國了?),所以,不能用。

2. adb backup[1]:
看起來也是滿可行的一個方法,但不知為何我的小米 2S 在執行 adb backup 後,device screen 上沒有出現任何訊息 ..... WTF!
adb shell 'pm list packages -f' 
adb backup -apk com.moneyqube -f mi2s-package.ab



[1]: http://android.stackexchange.com/questions/28296/full-backup-of-non-rooted-devices

Google Authenticator - lastpass


因為last pass 的 2-factors authentication show code 的地方沒有 link 常見的底線,容易被忽略 ...... 

接下來跳出的 QR code 用 QR droid 及 手機內建的相機可能辨識不出來,要裝 goggles 就可以了。