天天看點

android cygwin下載下傳源代碼Cannot find install-sh, install.sh, or shtool in ac-aux

一、cygwin 在 winXP下安裝完成後使用目前使用者登入後看所在磁盤的檔案權限是沒有問題的,但在win7下發現所有檔案的權限都丢失了,導緻使用cygwin編譯出來的檔案的權限也為空,這個問題可以使用以下方法來解決: 

将cygwin修改為使用root使用者登入

  1. 找到cygwin的etc目錄中有一個名為passwd的檔案。
  2. 用UE或記事本打開passwd這個檔案,找到以下部分,把其中的windows使用者名換成root(共3處都改過來)。  

    Administrator :unused:500 :513 :U-PC-201103250049\Administrator ,S-1-5-21-1343024091-57989841-1417001333-500:/home/Administrator :/bin/bash

    藍色 部分是替換成root,這個隻是改名而已,真正關鍵部分是紅色 部分,那個才是權限控制,将500和513都改成0,這樣才能擷取真正的root權限,改成如下:

    root:unused:0:0:U-PC-201103250049\root,S-1-5-21-1343024091-57989841-1417001333-500:/home/root:/bin/bash,需要注意的是如果你使用目前使用者為AA,那麼需要修改 passwd檔案中AA的那一行,這樣在windows下你使用AA使用者在cygwin登入後才會是root的權限

  3. 在cygwin的home目錄下面建立目錄root   
  4. 啟動cygwin進入以後,就會以真正的root權限運作了
  5. 二、解決cygwin上gpg: can’t lock memory: Permission denied問題
  6. 問題出在gnupg代碼的util/secmem.c中使用uid來建立開辟記憶體空間,由于重裝cygwin造成記錄的uid和系統不一緻,解決方法也簡單,重建passwd就行了:

    mkpasswd > /etc/passwd

    經常上面的方法也解決不了問題,這時就需要以下的方法

    First install subversion and wget through the standard cygwin setup program. Then run the following commands:

      # svn --force export http://apt-cyg.googlecode.com/svn/trunk/ /bin/
      # chmod +x /bin/apt-cyg      
    • use apt-cyg, for example:
      # apt-cyg install gnupg      

上面的也還是解決不了問題,隻好去下載下傳gnupg來安裝 ftp://ftp.gnupg.org/gcrypt/gnupg/ 使用以下指令 autoconf automake

上面仍然不起作用 是以我試了.configure 出現以下錯誤

Cannot find install-sh, install.sh, or shtool in ac-aux

這時這裡有篇文章解決了我 的問題 http://askubuntu.com/questions/27677/cannot-find-install-sh-install-sh-or-shtool-in-ac-aux 通過以下方式就沒有問題了

de style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: 'Ubuntu Mono', 'Ubuntu Beta Mono A', Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; color: rgb(34, 34, 34);"  >$ libtoolize --force
$ aclocal
$ autoheader
$ automake --force-missing --add-missing
$ autoconf
$ ./configure
    de>
         

http://d.zhu.im/Android/

$ repo sync

正常情況下,上面就是下載下傳android4.2源碼的流程,但我在下載下傳的過程中遇到了下面問題

問題1:“A new repo command ( 1.18) is available.”

其實這個問題就是說你本地的repo版本不是1.18,比這個舊,在出現這個的時候,下面會有一個提示你怎麼操作的,如:

... A new repo command ( 1.18) is available.

... You should upgrade soon:

 cp /home/pn/android/.repo/repo/repo/home/pn/bin/repo(執行這一句就可以),開始我苦悲的上網找這個的解決方法,,,,浪費不少時間。。

問題2:“error: Exited sync due to fetch errors...”

這個問題,網上都說是需要IP認證,其中我也根據

http://blog.csdn.net/fantao015/article/details/7625559

上面的操作,執行了一遍,其中包括注冊了一個@gmail.com郵件,後面發現我沒有用到這個也全部下載下傳成功了。

問題3:經常提示

error: Failed connect to android.googlesource.com:443;Connection refused while accessinghttps://android.googlesource.com/a/platform/frameworks/base/info/refs

fatal: HTTP request failed

error: Cannot fetch platform/tools/motodev

error: Cannot fetch platform/frameworks/base

error: Cannot fetch platform/prebuilts/sdk

error: Exited sync due to fetch errors

等錯誤資訊。

解決方法:編輯/etc/hosts檔案

 $ vim /etc/hosts

增加下面内容,儲存

74.125.71.82 www.googlesource.com

74.125.71.82 android.googlesource.com

203.208.46.172 cache.pack.google.com

59.24.3.173cache.pack.google.com

然後重新輸入

$ repo sync

這個關于DNS解析,提示了通路成功率,有興趣的童鞋可以研究下。。哎,如果早找到該操作,就節省了我不錯時間。。。。

Ref:

1 Downloading the Source Tree: http://source.android.com/source/downloading.html

2 android4.2源碼下載下傳過程: http://blog.csdn.net/lengxibo/article/details/8299888#reply

3  http://zhu.im/Android/   非常好的一個連結,裡面1.6到4.2各個版本都有,如果懶得自己下載下傳就直接在此下載下傳