[arch-general] building cwm or twrp on arch
Hi, As I was not able to fing a CWM (clock work mode) recovery image, neither a TWRP (TeamWin Recovery Project) recovery image for Huawei SnapTo, I'm planning on building CWM for that phone on Arch. I was looking at [1], so to have an idea of what packages I needed to install, but [1] doesn't focus on building CWM/TWRP, besides I couldn't notice how the sdk and others under [2] were sourced, or included into PATH, LD_LIBRARY_PATH, etc. So I have already installed: android-tools android-sdk android-sdk-platform-tools android-sdk-build-tools android-platform And several other android build requirements, except for ncurses5-compat-libs and lib32-ncurses5-compat-libs (not planning to install them unless strictly necessary). However searching I found [3], which in turns indicate one should do: export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH" But then it also indicates: . build/envsetup.sh lunch cyanogen_cooperve-eng make clean Which I'd guess those are the initial cyanogen build steps, and depend on the cynogenmod sources being downloaded there. However I'm still missing how to build CWM/TWRP recovery images for that particular phone model. If anyone has pointers to where one can read how to build such images for any phone model (being able to specify the one for which it's to be built), or huawei snapto in particular, then that'd be great. Or if anyone can include instructions on how to build such images, then that'd be also great. Thanks a lot, -- Javier [1] https://wiki.archlinux.org/index.php/android [2] /opt/android-sdk [3] http://forum.xda-developers.com/showthread.php?t=2259929
El 22/01/16 a las 18:46, Javier Vasquez escribió:
Hi,
As I was not able to fing a CWM (clock work mode) recovery image, neither a TWRP (TeamWin Recovery Project) recovery image for Huawei SnapTo, I'm planning on building CWM for that phone on Arch.
I was looking at [1], so to have an idea of what packages I needed to install, but [1] doesn't focus on building CWM/TWRP, besides I couldn't notice how the sdk and others under [2] were sourced, or included into PATH, LD_LIBRARY_PATH, etc.
So I have already installed:
android-tools android-sdk android-sdk-platform-tools android-sdk-build-tools android-platform
And several other android build requirements, except for ncurses5-compat-libs and lib32-ncurses5-compat-libs (not planning to install them unless strictly necessary).
However searching I found [3], which in turns indicate one should do:
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
But then it also indicates:
. build/envsetup.sh lunch cyanogen_cooperve-eng make clean
Which I'd guess those are the initial cyanogen build steps, and depend on the cynogenmod sources being downloaded there.
However I'm still missing how to build CWM/TWRP recovery images for that particular phone model.
If anyone has pointers to where one can read how to build such images for any phone model (being able to specify the one for which it's to be built), or huawei snapto in particular, then that'd be great. Or if anyone can include instructions on how to build such images, then that'd be also great.
Thanks a lot,
Hi Javier, try to switch python to python2 during the build, then you can switch back to python3: $ sudo ln -sf /usr/bin/python2 /usr/bin/python [ do the build ] $ sudo ln -sf /usr/bin/python3 /usr/bin/python It's ugly, I know. Also you can try to use virtualenv2, it's explained in the wiki [1]. [1]: https://wiki.archlinux.org/index.php/Android#Setting_up_the_build_environmen...
On Fri, Jan 22, 2016 at 1:12 PM, Joan Figueras <ffigue@gmail.com> wrote: Hi Javier,
try to switch python to python2 during the build, then you can switch back to python3:
$ sudo ln -sf /usr/bin/python2 /usr/bin/python [ do the build ] $ sudo ln -sf /usr/bin/python3 /usr/bin/python
It's ugly, I know. Also you can try to use virtualenv2, it's explained in the wiki [1].
[1]: https://wiki.archlinux.org/index.php/Android#Setting_up_the_build_environmen...
Well, with the help of [1], [2], [3], and several others, plus of course the Arch wiki, I could build the CWM image, though it didn't work. After installing it through adb/fastboot, as on [4], actually the recovery image gets lost. One thing to notice is that for this device (huawei snapto) the boot image couldn't be acquired through adb shell "dump_image", so finding the boot partition, and copying it to "/sdcard" through "dd" was necessary. Also "BoardConfig.mk" had to be edited, to get the partition sizes of the device, and some df, proc/partitions, dev/block/platform/*/by-name were necessary to be inspected to get the values, given proc/mtd was not available. The recovery.fstab seemed fine. Any ways, although the recovery image was built, as mentioned, once flashed, no recovery shows up when rebooting into recovery. I had to install the CM recovery image (which is not a CWM one) to get a recovery image back... That one doesn't allow to flash the device BTW. So, though the recovery image is getting built, it's useless. If someone has done it before, sharing the experience will help a lot. This might be offtopic, since the Arch part seems overcome, however I'm still unable to generate the CWM recovery image I attempt to build... Thanks, -- Javier [1] http://forum.xda-developers.com/showthread.php?t=2259929 [2] http://xda-university.com/as-a-developer/porting-clockworkmod-recovery-to-a-... [3] http://forum.xda-developers.com/showthread.php?t=1866545 [4] https://wiki.cyanogenmod.org/w/Install_CM_for_g620_a2
On Mon, Jan 25, 2016 at 1:25 AM, Javier Vasquez <j.e.vasquez.v@gmail.com> wrote:
Well, with the help of [1], [2], [3], and several others, plus of course the Arch wiki, I could build the CWM image, though it didn't work. After installing it through adb/fastboot, as on [4], actually the recovery image gets lost.
One thing to notice is that for this device (huawei snapto) the boot image couldn't be acquired through adb shell "dump_image", so finding the boot partition, and copying it to "/sdcard" through "dd" was necessary. Also "BoardConfig.mk" had to be edited, to get the partition sizes of the device, and some df, proc/partitions, dev/block/platform/*/by-name were necessary to be inspected to get the values, given proc/mtd was not available. The recovery.fstab seemed fine.
Any ways, although the recovery image was built, as mentioned, once flashed, no recovery shows up when rebooting into recovery. I had to install the CM recovery image (which is not a CWM one) to get a recovery image back... That one doesn't allow to flash the device BTW.
So, though the recovery image is getting built, it's useless. If someone has done it before, sharing the experience will help a lot. This might be offtopic, since the Arch part seems overcome, however I'm still unable to generate the CWM recovery image I attempt to build...
Thanks,
-- Javier
[1] http://forum.xda-developers.com/showthread.php?t=2259929 [2] http://xda-university.com/as-a-developer/porting-clockworkmod-recovery-to-a-... [3] http://forum.xda-developers.com/showthread.php?t=1866545 [4] https://wiki.cyanogenmod.org/w/Install_CM_for_g620_a2
Well, at the end, I couldn't generate a working CWM, but it didn't matter. The wiki instructions I was following to flash CM on Huawei SnapTo were misleading, in the sense they only indicated how to do it with a CWM/TWRP recovery image, but the CM recovery image was well suited for the task, :-) So no need to build a CWM/TWRP image after all. BTW, great work on Arch for all android components, the flows work pretty much out of the box, :-) Thanks, -- Javier
participants (2)
-
Javier Vasquez
-
Joan Figueras