[HOWTO] Flash the new bootloader in Linux - AT&T, Rogers, Bell, Telus Samsung Galaxy S III

Perhaps everyone concerned already is aware of this, however I did not find any thread with anything approaching explicit instructions for loading the new bootloader (provided in the CM thread), or, for that matter, any bootloader, on Linux.
Please let me know if any of this is unclear and/or needs to be more explicit.
Compile heimdall:
This can be skipped if you already have a version of heimdall that works with your phone.
For this you will need essential build tools and git. Installing this is distro dependant. For deb based distros (Debian, Ubuntu, etc), you can use:
Code:
sudo apt-get install build-essentials git{/CODE]
[INDENT][LIST=1]
[*]In a good working directory: download [URL="http://sourceforge.net/projects/libusbx/files/latest/download?source=files"]the libusbx source[/URL] and untar, in my case: [CODE]tar -xjf libusbx-1.0.15.tar.bz2
[*]clone the heimdall repo:
Code:
git clone git://github.com/Benjamin-Dobell/Heimdall.git
[*]Change into the libusbx directory (in my case libusbx-1.0.15) and compile it:
run
Code:
./configure
make
sudo make install
[*]Change into the libpit directory within the heimdall repo and compile it:
run
Code:
./configure
make
sudo make install
[*]Change into the heimdall directory in the heimdall repo and compile it:
run
Code:
./configure
make
sudo make install
[*]You should now have a working heimdall install, you can verify by doing:
Code:
heimdall version
[/LIST][/INDENT]
Flash the new bootloader:
Go here to find the Odin flashable bootloader appropriate to your phone. Download it.
Rename the file to remove the md5 (so that it has the tar extension); this is optional, but makes bash filename completion work.
Go somewhere you can work with the files and untar the file, in my case:
Code:
tar -xf I747UCDLK3_aio.tar
Put phone into download mode (there are various ways; search it if you need). Start with cable disconnected.
Connect the USB cable.
Use heimdall to flash all the parts:
Code:
heimdall flash --ABOOT aboot.mbn --RPM rpm.mbn --SBL2 sbl2.mbn --SBL3 sbl3.mbn --TZ tz.mbn

a lot of people wont have git installed. so you might want to explain that here also so that they will be able to clone the heimdall repo.
Install Git:
sudo apt-get install git

Related

[dev]How to Un/Re/Pack a Boot.blob and unyaff a boot.img

Technically i have to give credit to scott crossler
www.scottsroms.com
for showing me the method
and then i came upon turges
faq
Thanks Turge and Scott and whomever created these blobpacktools
but since i keep getting pms
and im sure you do to
scott
Here are the steps for repacking the boot.img. Some involve running the commands via cygwin, others involve running them via the Windows Command Prompt.
The instructions for installing cygwin, extracting and repacking the boot.img were found here: http://www.freeyourandroid.com/guide...ot-img-windows
Once you have setup cygwin, extract the attached files in a folder under your "home" folder in cygwin.
Also unzip blob tools into the same folder as your boot.blob
1.
Code:
copy boot.blob to the same folder and run the following via
the Windows Command Prompt to extract the boot.img from the boot.blob:
BlobUnpack.exe boot.blob
ren boot.blob.LNX boot.img
which will create boot.img
2.
Code:
From the cygwin bash terminal window,
switch to the same folder and run the following
to extract the ramdisk from the boot.img:
./extractboot boot.img
You now have an out/ramdisk folder
that contains the files you want to edit.
3.
Code:
Once done, repack the ramdisk and kernel into boot_new.img
with the following command (via cygwin once again):
./packboot
4.
Code:
then from the Command Prompt repack boot_new.img
into boot2.blob using the following:
blobpack -s boot2.blob LNX boot_new.img
5.
Code:
You can now flash the boot.blob to the staging
partition via a command in updater-script:
Code:
package_extract_file("/boot.blob", "/dev/block/mmcblk0p4");
or by using adb while in recovery/android:
Code:
dd if=/sdcard/boot2.blob of=/dev/block/mmcblk0p4
Lastly the rundown is like this
if you want to take a ota blob
and extract the contents for a raw base
and a raw kernel
1
take the ota and extract the blob file and place
in your folder with blobtools
2. then run
Code:
blobunpack.exe blob
Which now creates
Blob.APP =System.img (can be renamed system.img and unyaffed in the kitchen)or straight cygwin
Blob.sos=Recovery Img
Blob.Ebt=Bootloader information
Blob.Lnx=kernel (can also just be renamed boot.img and unyaffed in kitchen)
Blob.pt=Partition info
so to repack lets say your custom remade image
and your custom kernel
and a recovery of your choice
run
Code:
blobpack.exe -s blob lnx boot.img sos twrp.blob app system.img
then simply take the blob replace in the ota file
and flash in recovery
and it should flash a rom packed as a blob
Hi!
...also you can flash the new boot.blob via fastboot mode
>fastboot-i 0x0B05 flash boot boot.blob
:good:
Call me stupid, but what does repacking the boot.img do? I never pm'ed you, but what would we gain from this. a lil lost
unpacking a boot.img allows you to take a stock already built kernel
and make specific changes to the ramdisk
more specifically
default.prop
can make kernel insecure
debuggable
bootanimation enabled
blah blah blah
and init.rc
but also
cardhu
and goldfish.rc
and init.trace
and init.usb
then repacked and good to flash
seanzscreams said:
Lastly the rundown is like this
if you want to take a ota blob
and extract the contents for a raw base
and a raw kernel
1
take the ota and extract the blob file and place
in your folder with blobtools
2. then run
Code:
blobunpack.exe blob
Which now creates
Blob.APP =System.img (can be renamed system.img and unyaffed in the kitchen)or straight cygwin
Blob.sos=Recovery Img
Blob.Ebt=Bootloader information
Blob.Lnx=kernel (can also just be renamed boot.img and unyaffed in kitchen)
Blob.pt=Partition info
so to repack lets say your custom remade image
and your custom kernel
and a recovery of your choice
run
Code:
blobpack.exe -s blob lnx boot.img sos twrp.blob app system.img
then simply take the blob replace in the ota file
and flash in recovery
and it should flash a rom packed as a blob
Click to expand...
Click to collapse
Hi!
For a linux (Ubuntu) machine you can easily unpack blob.APP
> sudo mkdir mnt
> sudo mount -o loop blob.APP mnt
- now in your mnt directory , you will have /system ! :good:
Hi,
My TF300tl can't unlock bootloader. so can I use this way to pack custom ROM ( cm11, liplop...) as official ROM to flash for my tablet ?
konnichiwa said:
Hi,
My TF300tl can't unlock bootloader. so can I use this way to pack custom ROM ( cm11, liplop...) as official ROM to flash for my tablet ?
Click to expand...
Click to collapse
I wouldn't think so, as the ROM would have to be signed to be official

Builing your own Ouya Kernel

Hi,
I made a tutorial explaining how to compile the ouya's kernel from scratch.
I made this tutorial because I needed to enable the nfs protocol versions 3 and 4 to use file shares from my Synology NAS. The ouya's kernel enabled by default only comes with version 2 and i had problems to mount my NFS shares.
Let's start. my english is not very good then ignore the grammatical errors.
Let's first download the required files. I'm on the premise that you have an ubuntu linux installed on your machine.
*** DOWNLOAD OUYA FIRMWARE ***
1. Open your browser and type:
https://devs.ouya.tv/api/firmware_builds
2. Search for a string like this:
http://cds.t2z5c2q6.hwcdn.net/ota/RC-OUYA-1.2.1084-r1_ota.zip (this is the latest version of ouya firmware)
3. Download it:
$ wget http://cds.t2z5c2q6.hwcdn.net/ota/RC-OUYA-1.2.1084-r1_ota.zip
2. Create a directory an put the file there:
$ mkdir ouyafiles
4. unzip it:
$ unzip RC-OUYA-1.2.1084-r1_ota.zip
5. Now you have a lot of files and directories. We need only one. The name of file is: boot.img. We need to unzip this file to retrieve the ramdisk file that will be needed along with the compiled kernel. For this we need to download the following perl script:
$ wget http://www.enck.org/tools/split_bootimg_pl.txt
5. Rename the script and change the permissions to execute:
$ mv split_bootimg_pl.txt split_bootimg.pl
$ chmod 755 split_bootimg.pl
6. Run this command to unpack the file:
$ ./split_bootimg.pl boot.img
7. Now you have 2 files: boot.img-kernel and boot.img-ramdisk.gz. We only need the boot.img-ramdisk.gz. Lets unzip this again and rename the unzipped file:
$ gzip -dc ../boot.img-ramdisk.gz | cpio -i
$ mv boot.img-ramdisk ramdisk
8. OK. Now you have this file. We will use it later in the tutorial.
*** DOWNLOAD ANDROID NDK ***
1. Open the Browser and paste this URL: http://developer.android.com/tools/sdk/ndk/index.html
2. Download the Linux 64-bit (x86) package file:
$ wget http://dl.google.com/android/ndk/android-ndk-r9d-linux-x86_64.tar.bz2
3. Unzip it:
$ tar -jxvf android-ndk-r9d-linux-x86_64.tar.bz2
4. Rename the unzipped directory to "ndk":
$ mv android-ndk-r9d ndk
5. Load the environment variables:
$ export CROSS_COMPILE=/your_home_directory/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
$ export ARCH=arm
Obs.: (remember the /your_home_directory/ is the default home directory that you user in linux uses to work).
*** DOWNLOAD THE OUYA KERNEL SOURCE ***
1. Open your browser and go to this URL:
https://github.com/ouya/ouya_1_1-kernel
2. In the right side of the page you will have a download button called "Download ZIP". Click and Download it.
3. Unpack it and rename the unzipped directory to "kernel"
4. Maybe the /kernel/drivers/pci/Kconfig file will corrupt before unzip the file. Kconfig is a symbolic link. Remove it and Download again using the command inside the kernel/drivers/pci/ directory:
$ wget https://raw.githubusercontent.com/ouya/ouya_1_1-kernel/master/drivers/pci/Kconfig
6. Now you have the default ouya kernel for compile!
*** RECOVER .CONFIG FILE FROM OUYA ***
1. You need to retrieve a file that is in ouya. To retrieve the file you need install the package android-tools-adb. use the following command:
$ sudo apt-get install android-tools-adb
2. Now you have to connect your ouya via usb. By default your ouya don't enable adb. You need to go to DEVELOPMENT screen on your ouya and enable “ADB: ON”.
3. Fine. Now test if the adb is connecting. Try this commands:
$ adb start-server
$ adb devices (this will show something like this “1234567890ABCDEF device”)
PS.: if no devices appears... you need to search in the internet about “how to use adb to connect android devices”
4. Now you will pull the config file:
$ adb pull /proc/config.gz config.gz (this will pull config.gz to your computer)
5. Unzip it and copy to kernel directory:
$ gunzip config.gz
$ cp config /your_home_directory/kernel/.config
6. Now your kernel is ready to compile. We're ensuring that the standards are consistent settings. From now on it is your responsibility to enable and disable kernel configurations.
*** REBUILDING KERNEL ***
1. Go to Kernel Directory:
$ cd /your_home_directory/kernel/
2. Make sure to run the environment variables CROSS_COMPILE and ARCH described above in the tutorial.
$ export CROSS_COMPILE=/your_home_directory/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
$ export ARCH=arm
3. Use this command to change some settings:
$ make menuconfig
4. Use this command to build the kernel after you change your new settings:
$ make
5. Some warnings will display in your console... its normal.
6. if the process run ok you 'll have a bzImage file under the directory kernel/arch/arm/boot
7. copy this file to the same directory where you store the ramdisk file.
*** UPLOAD THE NEW KERNEL AND THE RAMDISK TO OUYA ***
1. You will need to install the fastboot on linux using this command:
$ apt-get install android-tools-fastboot
2. Now you have to reboot your device in bootloader mode:
$ adb reboot-bootloader
3. You can check if you devices enters in this mode using this command:
$ fastboot devices
4. If it works. You can upload your new kernel and the default ramdisk:
$ fastboot flash:raw boot ./zImage ./ramdisk
The system should now boot with your custom kernel installed!
*** DOWNLOAD OUYA FIRMWARE ***
$ mv boot.img-ramdisk ramdisk
Click to expand...
Click to collapse
Why do we need this? Can't we simply copy it from an existing OUYA machine?
ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
Click to expand...
Click to collapse
The current android-ndk-r10e only has androideabi-4.8 and androideabi-4.9. Can I use them, too?
Edit: I got an error ("unknown CPU architecture") with android-ndk-r10e and arm-linux-androideabi-4.8 so I used android-ndk-r9d with arm-linux-androideabi-4.6, and that worked.
6. if the process run ok you 'll have a bzImage file
Click to expand...
Click to collapse
It's actually a zImage file (without the b).
Thank you so much for the tutorial!

Cricket S3 SCH-R530C "sbl1.mbn" file needed.

Hello guy, i have a S3 SCH-R530C hard bricked(pls don't ask me how i hard bricked it!).
A guy from xda sent me a tutorial how to unbrick it without JTAG(Will post the tut at the end), but when i download the package the sbl1.mbn is missing.
Does anyone have it ?
Or maybe you have a better tutorial for debrick ? Anything will help. Thank you
Copy past tutorial, all credits goes to "robbiejobs"
First part:
You'll need these files :
1.) R530U debrick img https://app.box.com/SCH-R530U
2.) R530C stock image ( I guess the version doesn't matter, but you better try with 4.3 first ) http://terafile.co/88b027e65750/R530...RICMK3_CRI.zip
---
Extract R530CVVUCMK3_R530CCRICMK3_CRI.zip you'll get some .tar.md5 file, extract that file too and then grab these files
sbl1.mbn
sbl2.mbn
sbl3.mbn
aboot.mbn
rpm.mbn
tz.mbn
Second part:
I've waited for almost 2 years to have R530C debrick image, no one have that file. I almost give up, and then my stupid idea came up... ( You'll need linux terminal, and basic linux command knowledge )
1.) Download odin package for your device ( make sure it's the same version with your latest firmware before got bricked )
2.) Extract the .tar.md5 file ( WinRar / 7zip will give error message, just ignore it )
3.) Grab debrick image for your device, or at least the same variant ( R530C / U / M ) firmware version doesn't matter.
4.) Clone the debrick image to your microSD card.
5.) Now back to extracted folder of your firmware, copy these files :
sbl1.mbn
sbl2.mbn
sbl3.mbn
aboot.mbn
rpm.mbn
tz.mbn
to your working directory
6.) List your debrick microSD partition using parted ( mine was /dev/sdb, make sure you have the right partition before doing these commands )
I forgot the command, but it's something like
Code:
parted /dev/sdb
Code:
(parted) print
7.) Now you can see the partition list (sbl1,sbl2,etc)
8.) And then do this :
sudo dd if=sbl1.mbn of=/dev/sdbX
sudo dd if=sbl2.mbn of=/dev/sdbX
sudo dd if=sbl3.mbn of=/dev/sdbX
sudo dd if=aboot.mbn of=/dev/sdbX
sudo dd if=rpm.mbn of=/dev/sdbX
sudo dd if=tz.mbn of=/dev/sdbX
9.) After finishing all the command, remove your microSD from card reader, cross finger.. and Good Luck.
Sorry for my "not-so-easy" tutorial, I wish I could explain it a little easier to understand.. but my english sucks
This forum is for the GSM/LTE version of the s3. Try posting your question here: http://forum.xda-developers.com/galaxy-s3-verizon
audit13 said:
This forum is for the GSM/LTE version of the s3. Try posting your question here: http://forum.xda-developers.com/galaxy-s3-verizon
Click to expand...
Click to collapse
I was not sure where to post it, since there is no cricket , but thank you.

How to setup and use SP Flash Tool on Ubuntu 20.04/later/other Distro based on Ubuntu 20.04/later

Hello!
I had problems with setup SP Flash Tool on Ubuntu/Kubuntu 20.04. So here is a guide, how to do it .
1. Download SP Flash Tool for Linux: https://spflashtool.com/download/
2. Extract it, and rename folders, so that there are files in the "Flash Tool" folder
3. Delete "Lib"folder
4. Type this commands:
Code:
sudo add-apt-repository ppa:linuxuprising/libpng12
sudo apt update
sudo apt install libpng12-0
sudo apt install libusb-dev
5. Type
Code:
cd ~/Downloads/"Flash Tool"
sudo chmod a+x flash_tool
sudo chmod a+x flash_tool.sh
sudo ./flash_tool
If you have problem with " libqtwebkit4.so.4", follow this steps:
Open Terminal and type:
Code:
sudo add-apt-repository ppa:rock-core/qt4
sudo apt update
sudo apt install libqtwebkit4
SP Flash Tool will now works.
Voila!
Hello,I don't seem to have a field for the Scatter txt.Any ideas?
Show screenshot
It's alright,I used a Windows PC to do it,but thanks for the reply anyway
Hi had trouble as attached.I deleted lib and renamed folder all I got is bland screen.Attach will show.
Did it all again,and just named the extracted folder.
Went through your commands and it worked
Downloaded upgradeed Ubuntu 20
And truly,Thank You for your work.
Oldlearner said:
Hi had trouble as attached.I deleted lib and renamed folder all I got is bland screen.Attach will show.
Did it all again,and just named the extracted folder.
Went through your commands and it worked
Downloaded upgradeed Ubuntu 20
And truly,Thank You for your work.
Click to expand...
Click to collapse
This worked for me: https://github.com/P0cL4bs/WiFi-Pumpkin-deprecated/issues/53#issuecomment-309120875
Basically, its adding
Code:
QT_X11_NO_MITSHM=1
in the system variable file.
The first cmd is not working this is my download as there been updates on the site is my drive correct .. this cmd not workingsudo add-apt-repository ppa:linuxuprising/libpng12

[GUIDE]How to build unruu from source on Debian GNU/Linux based distributions

This program is for unpacking rom.zip from RUU on Unix-like operating systems
All commands below are to be executed from the terminal NOT as root
1)
Code:
sudo apt install m4 git unshield libunshield-dev dh-autoreconf
2)
Code:
git clone https://github.com/kmdm/unruu.git
3)
Code:
cd unruu
4)
Code:
./autogen.sh
5)
Code:
./configure
6)
Code:
make
7)
Code:
sudo make install
To use this utility is very simple: unruu /path/to/ruu/ruu.exe
For example: unruu /home/alex/RUU_Express.exe

Categories

Resources