微信公眾平臺(tái)制作網(wǎng)站,58網(wǎng)絡(luò)推廣,武漢百度關(guān)鍵詞搜索,收到橙子建站的驗(yàn)證碼學(xué)習(xí)了這么多其他人的博客,終于編譯成功了。技術(shù)小白前來分享,有不到位的希望大牛們指正。開源的意義在于分享。本文主要為遇到的錯(cuò)誤解決 http://blog.sina.com.cn/s/blog_4ba5b45e0102ejbb.html這篇文章對(duì)我的幫助很大,感謝作者
源碼是別…學(xué)習(xí)了這么多其他人的博客,終于編譯成功了。技術(shù)小白前來分享,有不到位的希望大牛們指正。開源的意義在于分享。本文主要為遇到的錯(cuò)誤解決
http://blog.sina.com.cn/s/blog_4ba5b45e0102ejbb.html這篇文章對(duì)我的幫助很大,感謝作者
源碼是別人給的,所以直接開始編譯
cm12編譯
1.
對(duì)本地庫的操作:
android要求的庫
更新 sudo yum update
sudo yum install mesa-libGL-devel
sudo yum install libstdc++.so.6
sudo yum install gcc, yum install gcc-c++
sudo apt-get install git-core 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 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
由于以上是對(duì)于unbunte的安裝,fedora里會(huì)顯示有些包沒有。所以又看了fedora官網(wǎng)提供的android編譯環(huán)境
https://fedoraproject.org/wiki/HOWTO_Setup_Android_Development
yum install glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686
2.
首先:下載
kernel http://www.github.com/cyanogenmod/android_kernel_samsung_smdk4412
device http://www.github.com/cyanogenmod/android_device_samsung_n7100
下載 android_device_samsung_n7100 到/cm12/device/samsung/目錄
Put the kernel in kernel/samsung/smdk4412并且命名為kernel
3.
要求openjdk7,fedora21只提供openjdk8
修改build/core/main.mk
改為requires_openjdk := false
具體:
For building Android, your best bet is to just install the Oracle JDK 7. I downloaded jdk-7u80-linux-x64.tar.gz and put in /opt/oracle/java/.
Then you can just edit build/core/main.mk and force for all cases
requires_openjdk := false
Note that even if you get OpenJDK 1.7 installed on Fedora it returns 'java -version' differently than Ubuntu and you'll have to change the build/core/main.mk check for the version to look for "openjdk" instead of "java" at the beginning of the version.
Using the Oracle JDK is fine, though. It is used for all host types that are not Linux.
4.
錯(cuò)誤
build/core/main.mk:118: You are building on a case-insensitive filesystem.
build/core/main.mk:119: Please move your source tree to a case-sensitive filesystem.
build/core/main.mk:120: ************************************************************
build/core/main.mk:121: *** Case-insensitive filesystems not supported. Stop.
solution:
Remove this from build/core/main.mk, then compile:
ifneq ($(HOST_OS),windows)
ifneq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc)
# check for a case sensitive file system
ifneq (a,$(shell mkdir -p $(OUT_DIR) ; \
echo a > $(OUT_DIR)/casecheck.txt; \
echo B > $(OUT_DIR)/CaseCheck.txt; \
cat $(OUT_DIR)/casecheck.txt))
$(warning ************************************************************)
$(warning You are building on a case-insensitive filesystem.)
$(warning Please move your source tree to a case-sensitive filesystem.)
$(warning ************************************************************)
$(error Case-insensitive filesystems not supported)
endif
endif
endif
It will disable the case-sensitivity check.
5.
ake: *** 沒有規(guī)則可以創(chuàng)建“/home/pengfei/work/Android/cm12/out/target/product/n7100/system/bin/gpsd”需要的目標(biāo)“vendor/samsung/n7100/proprietary/system/bin/gpsd”。 停止
solution:
https://github.com/TheMuppets/proprietary_vendor_samsung/tree/cm-12.0
下載n7100和smdk4412-common
直接拷貝到相應(yīng)的 /vendor/samsung/ 目錄下
6.
錯(cuò)誤
build/core/product_config.mk:238: *** _nic.PRODUCTS.[[device/samsung/n8000/cm.mk]]: "hardware/samsung/exynos4x12.mk" does not exist。 停止。
** Don't have a product spec for: 'cm_n8000'
** Do you have the right repo manifest?
No such item in brunch menu. Try 'breakfast'
solution:
解決辦法:缺少samsung硬件基礎(chǔ)庫。
https://github.com/CyanogenMod/android_hardware_samsung 下載后將里面的文件替換到 hardware/samsung/下面。
7.
[root@localhost android-cm-10.2]# breakfast n8000
including vendor/cm/vendorsetup.sh
build/core/product_config.mk:238: *** _nic.PRODUCTS.[[device/samsung/n8000/cm.mk]]: "device/samsung/n80xx-common/n80xx-common.mk" does not exist。 停止。
Device n8000 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
^X^CTraceback (most recent call last):
File "build/tools/roomservice.py", line 76, in
result = json.loads(urllib.request.urlopen(githubreq).read().decode())
File "/usr/lib64/python2.6/socket.py", line 354, in read
data = self._sock.recv(rbufsize)
File "/usr/lib64/python2.6/httplib.py", line 542, in read
s = self.fp.read(amt)
File "/usr/lib64/python2.6/socket.py", line 383, in read
data = self._sock.recv(left)
File "/usr/lib64/python2.6/ssl.py", line 215, in recv
return self.read(buflen)
File "/usr/lib64/python2.6/ssl.py", line 136, in read
return self._sslobj.read(len)
KeyboardInterrupt
build/core/product_config.mk:238: *** _nic.PRODUCTS.[[device/samsung/n8000/cm.mk]]: "device/samsung/n80xx-common/n80xx-common.mk" does not exist。 停止。
** Don't have a product spec for: 'cm_n8000'
** Do you have the right repo manifest?
由于n8000的很多驅(qū)動(dòng)是基于 n80xx-common 驅(qū)動(dòng)包的,所以需要預(yù)先下載 n80xx-common 驅(qū)動(dòng)包,這也是為何 n8000 驅(qū)動(dòng)包那么小的緣故。
從 https://github.com/CyanogenMod/android_device_samsung_n80xx-common
這里面將 n80xx-common 驅(qū)動(dòng)包下載下來,放到 cm-10/device/samsung/n80xx-common 這個(gè)目錄下,這個(gè)目錄本身是沒有的,需要新建。
chmod +x android-cm-10.2/device/samsung/n80xx-common/extract-files.sh
https://github.com/CyanogenMod/android_device_samsung_n7100/tree/cm-12.0https://github.com/CyanogenMod/android_device_samsung_smdk4412-common
下載后放到
device/samsung/
8.
一直顯示這個(gè)錯(cuò)誤
make: *** No rule to make target `out/target/product/n7000/kernel', needed by `out/target/product/n7000/boot.img'看看
或者cannot load kernel out/target/product/n7000/kernel
solution:
我覺得是因?yàn)槭紫仁菦]有編好內(nèi)核。
而沒能編出來內(nèi)核是因?yàn)槲液雎粤诉@一步./extract-files.sh,認(rèn)為是給電腦編,不需要連接手機(jī),原諒我是小白。
這個(gè)腳本的主要作用是將手機(jī)中的驅(qū)動(dòng)so庫pull出來。
這期間還需要手機(jī)的root,國內(nèi)網(wǎng)站的包刷了,總fail,
這個(gè)網(wǎng)站的包能用,下載CF-Auto-Root和Odin 3.09
http://www.ibtimes.co.uk/root-galaxy-note-2-n7100-all-android-4-4-2-kitkat-firmware-1446111
9.
root之后進(jìn)行./extract-files.sh,依然報(bào)錯(cuò): adbd cannot run as root in production builds
root不徹底
http://stackoverflow.com/questions/25271878/android-adbd-cannot-run-as-root-in-production-buildshttp://forum.xda-developers.com/showthread.php?t=1687590
The problem is that, even though your phone is rooted, the 'adbd' server on the phone does not use root permissions. You can try to bypass these checks or install a different adbd on your phone or install a custom kernel/distribution that includes a patched adbd.
Or, a much easier solution is to use 'adbd insecure' from chainfire which will patch your adbd on the fly. It's not permanent, so you have to run it before starting up the adb server (or else set it to run every boot). You can get the app from the google play store for a couple bucks:
https://play.google.com/store/apps/details?id=eu.chainfire.adbd&hl=en
Or you can get it for free, the author has posted a free version on xda-developers:
http://forum.xda-developers.com/showthread.php?t=1687590
Install it to your device (copy it to the device and open the apk file with a file manager), run 'adb insecure' on the device, and finally kill the adb server on your computer:
% adb kill-server
And then restart the server and it should already be root.
這段英文講的很詳細(xì),大概ia就算第二個(gè)網(wǎng)站可以免費(fèi)下到adb insecure,下到以后直接復(fù)制到手機(jī)的文件夾里,以便可以直接從手機(jī)操作,點(diǎn)擊安裝起來。運(yùn)行這個(gè)軟件,點(diǎn)擊兩個(gè)鉤:enable insecure adbd enable at boot.之后要在電腦上面adb kill-server。再重新連接adb shell su。
再進(jìn)到目錄/device/samsung/n7100下,./extract-files.sh。
下面看看怎么編內(nèi)核
總體流程是這個(gè)樣子的:
$ cd ~/cm12
$ source build/envsetup.sh
$ breakfast n7100
$ cd /device/samsung/n7100
$ ./extract-files.sh。。。。。。做這步的時(shí)候,手機(jī)要root。
回到/cm12$ croot
http://ju.outofmemory.cn/entry/226866 這篇文章非常詳細(xì)并且正確
按照文中所說:進(jìn)入kernel目錄下面,kernel/samsung/smdk4412
make ARCH=arm cyanogenmod_n7100_defconfig
make ARCH=arm menuconfig
cp .config arch/arm/configs/cyanogenmod_n7100_defconfig
make mrproper。。。。。這步不能丟
回到根目錄mka bootimage