越过Samsung bootloader lock烧写custom kernel

本文详细介绍了如何为三星SGS3设备解锁并安装CyanogenMod 10系统的过程,包括使用Heimdall工具的准备工作、安装自定义恢复环境(CWM)的方法、以及通过ADB侧载安装CM10和GApps的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

首先,阅读一些解锁必须要知道的事

http://wiki.cyanogenmod.org/w/Install_CM_for_n7000


工具准备过程:

(以下内容是google出来的,在我的编译过程中,找不到libusb-1.0但ldconfig -p | grep libusb却明明确确的摆在那,又重装了一个。。。

在重新编译heimdall过程中,提到libusb.h没定义LIBUSB_LOGXXX等等没有定义。。。。一看。。。。的确没定义。。。。哎。。。。

http://libusb.sourceforge.net/api-1.0/libusb_8h_source.html 的内容替换 /usr/include/libusb-1.0/libusb.h )

如果是在MAC上,要关闭以下几个三星驱动才能刷

http://blog.scott.wallace.sh/2012/03/getting-heimdall-to-work-on-your-mac.html


There is a bunch of information about doing this already.  I'm just documenting what I steps I took to do this under Linux.

First, I got the Heimdall 64 bit binary.  This would not run, not sure why:

wskellenger@marquette ~/utils $ ./heimdall
bash: ./heimdall: No such file or directory


Even as root, it refused to do anything useful:

wskellenger@marquette ~/utils $ sudo ./heimdall

Okay, so I downloaded the 32 bit version.

wskellenger@marquette ~/utils $ ./heimdall
./heimdall: error while loading shared libraries: libusb-1.0.so.0: cannot open shared object file: No such file or directory


I don't really understand this either, as I have libusb:

 wskellenger@marquette ~/utils $ sudo ldconfig -v | grep libusb
/sbin/ldconfig.real: Can't stat /lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
    libusb-0.1.so.4 -> libusb-0.1.so.4.4.4
/sbin/ldconfig.real: Cannot stat /usr/lib/x86_64-linux-gnu/libnss_db.so    libusb-0.1.so.4 -> libusb-0.1.so.4.4.4
: No such file or directory
    libusb-1.0.so.0 -> libusb-1.0.so.0.1.0
    libusb-0.1.so.4 -> libusb.so
/sbin/ldconfig.real: Cannot stat /usr/lib32/libnss_db.so: No such file or directory
    libusbmuxd.so.1 -> libusbmuxd.so.1.0.7


After some Googling around and coming up empty, I just decided to build heimdall from source.  This was easy enough.

cd ~/Projects
git clone https://github.com/Benjamin-Dobell/Heimdall.git
cd Heimdall
git checkout v1.4.1RC2

Now you should have all of the sources you need to build.  The following instructions are from the Heimdall README. 

wskellenger@marquette ~/Projects/Heimdall $ cd libpit
wskellenger@marquette ~/Projects/Heimdall/libpit $ ./configure
wskellenger@marquette ~/Projects/Heimdall/libpit $ make
wskellenger@marquette ~/Projects/Heimdall/libpit $ cd ..
wskellenger@marquette ~/Projects/Heimdall $ cd heimdall
wskellenger@marquette ~/Projects/Heimdall/heimdall $ ./configure
wskellenger@marquette ~/Projects/Heimdall/heimdall $ make

wskellenger@marquette ~/Projects/Heimdall/heimdall $ sudo make install

You'll see this message after doing the install, do what it says:

 IMPORTANT - You must reboot your machine or execute the following as root:
service udev restart


If you want the frontend, also do:

wskellenger@marquette ~/Projects/Heimdall/heimdall-frontend $ qmake-qt4 heimdall-frontend.pro
wskellenger@marquette ~/Projects/Heimdall/heimdall-frontend $ make
wskellenger@marquette ~/Projects/Heimdall/heimdall-frontend $ sudo make install


That's it.  If you type 'heimdall' at a prompt now you should see some stuff on the screen.

Now, I took a brand new SGS3, and pressed HOME (the single button), Volume DOWN, and POWER at the same time.  You will feel a small buzz of the vibrator, and then see a screen about how this is dangerous and so forth.  Press volume UP to proceed.

At this point you'll see just our little green android guy and an indication that it is "Downloading...", but we haven't done anything yet.

Let's get the recovery installed first.  First I checked to see if anything from Samsung was connected.  Indeed there was:

 wskellenger@marquette ~/Projects/Heimdall/heimdall $ sudo lsusb
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 04e8:685d Samsung Electronics Co., Ltd 
Bus 001 Device 003: ID 2635:0601  
Bus 001 Device 004: ID 0a5c:21d7 Broadcom Corp. 
Bus 001 Device 005: ID 0c45:6495 Microdia 


Now I just moved the clockworkmod image that I downloaded from here over to my utils directory.

wskellenger@marquette ~/utils $ mv ~/Downloads/recovery-clockwork-6.0.2.3-d2att.img .

I also renamed it to recovery.img, probably isn't necessary but I did so anyway:

wskellenger@marquette ~/utils $ mv recovery-clockwork-6.0.2.3-d2att.img recovery.img

Now let's try to flash it with Heimdall:

wskellenger@marquette ~/utils $ heimdall flash --recovery recovery.img --no-reboot
Heimdall v1.4 RC2

Copyright (c) 2010-2012, Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Checking if protocol is initialised...
Protocol is not initialised.

Initialising protocol...
Protocol initialisation successful.

Beginning session...

This device may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading RECOVERY
100%
RECOVERY upload successful

Ending session...
Releasing device interface...
Re-attaching kernel driver...


At this point I just tried to reboot the device into recovery to see if I had CWM installed or not.  I popped the battery out to get out of the previous download mode.  Maybe there is a better way to do this, not sure.  Now reboot into recovery.  Hold Volume UP, HOME, and POWER.  When you feel the small vibration, keep holding for a little while longer.  You will see the SGS3 logo and then hopefully boot into CWM recovery.

Once inside CWM, the first thing I'm going to do is a Nandroid backup of this baby.  Go to backup and recovery and select backup.  This will take a little while so be patient.  In the meantime I'll download CM10.

Edit 6-May-2013:  If you just want to root your device, and keep the stock Samsung ROM, at this point you cansideload the UPDATE-SuperSU-v1.xx.zip file available here.  After this, reboot, check to see if the SuperSU app is installed, and you're done.

Okay, back to installing CM 10.  I went with one of the 10.1 monthly release snapshots, available at http://get.cm.

Now that you've got the CM package and you've made a backup, we can sideload the CM10 .zip file onto the device.  First let's see if we can see the device or not:

wskellenger@marquette ~/utils $ adb devices
List of devices attached 
3c1b4cf7    recovery


Pretty sweet.  Let's go to 'install zip  from sideload' in the Clockworkmod menu.  The screen should show:

Sideload started ...
Now send the package you want to apply
to the device with "adb sideload <filename>" ...

So, let's do that:

wskellenger@marquette ~/Downloads $ adb sideload cm-10.1-20130121-EXPERIMENTAL-d2att-M1.zip 
sending: 'sideload'  100% 


After this you'll see the phone open and install the update automatically.  This is pretty sick.  We also need gapps so let's download and install that the same way.  I got gapps from goo.im.

Again, select "install zip from sideload", and adb sideload the gapps package:

wskellenger@marquette ~/Downloads $ adb sideload gapps-jb-20121212-signed.zip sending: 'sideload'  100% 

That's pretty much it folks.  I actually did a wipe data, wipe cache, wipe dalvik.  After that I feared that I perhaps undid the gapps installation so I installed gapps again after this.  Then I did "reboot system now" and unplugged the USB cable.

Booyah, I'm seeing the familiar CyanogenMod bootscreen. 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值