# Need Help Porting CWM (Error)



## Jmoney4769

Hey guys,

I am trying to port CWM to my OG droid on my x86 Ubuntu 10.10 machine(just for the experience) and I can't seem to be able to get past a roadblock. I have been following this to build it. At the step "*build/tools/device/mkvendor.sh device_manufacturer_name device_name /your/path/to/the/boot.img," *I type "build/tools/device/mkvendor.sh motorola sholes boot.img" (boot.img is in my current directory). When I do I get the error "unpackbootimg not found. Is your android build environment set up and have the host tools been built?" After a little looking around, I found that typing "make -j4 out/host/linux-x86/bin/unpackbootimg" would solve it, however, when I do this, it does not solve the issue. Does anybody have any idea what else I should try?

Thanks a bunch


----------



## Jmoney4769

Alright, I got past that. I did it by copying this file into /usr/bin. Now when I type "lunch full_sholes-eng," I get "No such file: full_sholes-eng." Does anyone know what to do now? I can't seem to find anything on this..... Please?


----------



## b16

Bump*


----------



## Snow02

If you run lunch without arguments you should be presented with a menu. What are your options on that menu?


----------



## Jmoney4769

I got it (almost)! Thank you to @bigxie on twitter. What I needed to do was run ". build/envsetup.sh" I was forgetting the '.' when I ran the script. Now there is just one problem left: when I put the recovery.img on my sd card and run "adb shell su" then "flash_image recovery recovery.img," it hung there for over a half an hour. I cancelled it, and tried the commands (without the "adb shell" of course) in a terminal emulator on the phone. When I did this, I got an error saying ""failed with error -1 can't find recovert partition#." Anybody know what this means or what I can do to fix the error? Thanks everyone

Also, not sure if this is related, but I can no longer access the recovery on the phone, even when I flashed CWM from Rom Manager. I'm going to try RZRecovery, but this is an interesting issue.

EDIT: After flashing RZRecovery, which worked, and back to CWM, recovery works again. I wonder what I did to cause it to go away....


----------



## Snow02

Try adding the path.

Flash_image recovery /sdcard/recovery.img


----------



## Jmoney4769

Snow02 said:


> Try adding the path.
> 
> Flash_image recovery /sdcard/recovery.img


I think that worked, but now I have a different error: I have a bunch of error messages saying "mtd: re-read error at <number thing with zeros and an x> (Out of memory)."

How could I free up memory for this? Should I flash a less-heavy rom (I'm on CM7)? Or what else could I do to get more memory for this, it is my "dev device" so next to nothing is installed on it, I have no problem wiping anything?

Thank you again


----------



## Snow02

How are you going to wipe with no recovery?









But just try again. You could also try using a task killer to kill everything right before flashing.


----------



## Jmoney4769

Snow02 said:


> How are you going to wipe with no recovery?


That's a really good point. I got it to work after a reboot. However, after flashing, I cannot boot into the recovery, it just hangs there, and after a while, boots all the way up. Did I mess up building it?


----------



## Snow02

Possibly. But who knows. Hard to tell from here.


----------



## Snow02

Tried reboot recovery from terminal?


----------



## Snow02

Also, try flashing a known good recovery if that doesn't work. If the good recovery works, then you know it's something wrong with your build.


----------



## Jmoney4769

Snow02 said:


> Also, try flashing a known good recovery if that doesn't work. If the good recovery works, then you know it's something wrong with your build.


If I flash any recovery from Rom Manager, such as CWM or RZRecovery, it works great. However, "reboot recovery" (with su) doesn't work along with anything else. I will try the build again. Probably has to do with all of the errors I got while building it the first time. Thanks for all the help though!


----------



## Snow02

Jmoney4769 said:


> Probably has to do with all of the errors I got while building it the first time.


Hah. Yeah. Those error messages are there for a reason.


----------



## hong_anh_gau

hello, anyone help me fix this problem when port cwm for my devices:


Code:


[email protected]:~/android/system/build/tools/device$ ./mkvendor.sh pantech im_a650s ~/booteditor/boot.img<br />
Output will be in /home/ha/android/system/device/pantech/im_a650s<br />
./mkvendor.sh: line 62: /usr/bin/unpackbootimg: cannot execute binary file<br />


----------



## doug piston

I can't remember off the top of my head where "unpackbootimg" is but make sure you moved it /usr/bin. If it is there, make it executable.


----------



## hong_anh_gau

doug piston said:


> I can't remember off the top of my head where "unpackbootimg" is but make sure you moved it /usr/bin. If it is there, make it executable.


Please tell me how to make it executable ??? Thanks you


----------



## doug piston

Code:


<br />
sudo chmod a+x /usr/bin/unpackbootimg<br />


----------



## hong_anh_gau

doug piston said:


> Code:
> 
> 
> <br />
> sudo chmod a+x /usr/bin/unpackbootimg<br />


i have set chmod, but there are error, what step i was wrong?
out line:



Code:


<br />
[email protected]:/home/ha/android/system/build/tools/device# ./mkvendor.sh pantech im_a650s ~/booteditor/boot.img<br />
Output will be in /home/ha/android/system/device/pantech/im_a650s<br />
cp: cannot stat `/root/booteditor/boot.img': No such file or directory<br />
./mkvendor.sh: line 62: /usr/bin/unpackbootimg: cannot execute binary file<br />
gzip: ../boot.img-ramdisk.gz: No such file or directory<br />
cpio: premature end of archive<br />
cat: /tmp/bootimg/boot.img-base: No such file or directory<br />
cat: /tmp/bootimg/boot.img-cmdline: No such file or directory<br />
cat: /tmp/bootimg/boot.img-pagesize: No such file or directory<br />
cp: cannot stat `/tmp/bootimg/boot.img-zImage': No such file or directory<br />
Done!<br />
Use the following command to set up your build environment:<br />
  lunch full_im_a650s-eng<br />
And use the follwowing command to build a recovery:<br />
  . build/tools/device/makerecoveries.sh full_im_a650s-eng<br />
[email protected]:/home/ha/android/system/build/tools/device#


----------



## hong_anh_gau

Anyone help me, i'm a linux noob


----------



## doug piston

Are you sure you have the boot.img in ~/booteditor?


----------



## hong_anh_gau

doug piston said:


> Are you sure you have the boot.img in ~/booteditor?


Thank you so much, i fixed this error. i found other "unpackbootimg" in ~/android/system/out/host/linux-x86/bin. then i copy it to ~/usr/bin and set chmod.

However, i have an error when make recoveryImage. can you help me again ^^



> find: `out/target/common/docs/gen': No such file or directory
> find: `out/target/common/docs/gen': No such file or directory
> find: `out/target/common/docs/gen': No such file or directory
> find: `out/target/common/docs/gen': No such file or directory
> find: `out/target/common/docs/gen': No such file or directory
> make: *** No rule to make target `recoveryImage'. Stop.


----------



## doug piston

I haven't seen that error before. Are you sure you have the proper tools installed to do this stuff(gcc, g++ multilibs, etc.)? What OS are you using?


----------



## hong_anh_gau

doug piston said:


> I haven't seen that error before. Are you sure you have the proper tools installed to do this stuff(gcc, g++ multilibs, etc.)? What OS are you using?


i'm using Ubuntu 10.04 - 32bit, i've installed gcc, g++.







what is wrong step i did?


----------



## doug piston

Code:


sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool			<br />

I'll assume you already have Java installed.


----------



## hong_anh_gau

doug piston said:


> Code:
> 
> 
> sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool			<br />
> 
> I'll assume you already have Java installed.


Successful! i've made CWM recovery image for sky ima650s,Thanks you!
But there some graphic errors. 
They are :
1st Menu:









2nd view:when push volume down key,show more clockworks menu











3rd viewush volume down key again.









So when push volume down key,upper double menus line goes down. and push again it,lower double menus line goes down. and push again it,upper...
Sorry my bad english and explains. 
Thanks.


----------



## doug piston

I don't understand what you are saying here. Possibly a rephrase is in order?

Edit:

For what its worth you are using a very old source for your recovery. I'd highly suggest repo'ing CM's ICS source and build that. 3.xxx recovery I believe is GB. Clockwork is now on 5.xxx


----------



## saint_tim

Hello guys, I need some help. I want porting CWM to my device, but I have some errors. I make [background=transparent]*repo init -u git://github.com/CyanogenMod/android.git -b ics* , after this *. build/envsetup.sh*[/background]
[background=transparent]In terminal I see [/background]
including device/moto/wingray/vendorsetup.sh
including device/samsung/maguro/vendorsetup.sh
including device/semc/anzu/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including sdk/bash_completion/adb.bash

next I try to
*make -j4 otatools*

and I see some errors

[email protected]:~/Android$ make otatools
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.4
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IMM76D
============================================
system/core/toolbox/Android.mk:98: warning: overriding commands for target `out/target/product/generic/system/bin/lsof'
build/core/base_rules.mk:523: warning: ignoring old commands for target `out/target/product/generic/system/bin/lsof'
build/core/tasks/kernel.mk:53: **********************************************************
build/core/tasks/kernel.mk:54: * Kernel source found, but no configuration was defined *
build/core/tasks/kernel.mk:55: * Please add the TARGET_KERNEL_CONFIG variable to your *
build/core/tasks/kernel.mk:56: * AndroidBoard.mk file *
build/core/tasks/kernel.mk:57: **********************************************************
build/core/tasks/kernel.mk:58: *** "NO KERNEL CONFIG". Stop.
I use ubuntu 10.04 64 bit


----------



## doug piston

cd to your source dir, then run "make clobber" and then "make -j4 otatools". Don't run the ". build/envsetup.sh" command.


----------



## hong_anh_gau

Hello again!
First, thank you so much for support me!
I have been briked my phone 1month ago....


----------

