In order to root a new device, I try to follow the tutorial to port CWM for an unrooted device. When I do
dump_image boot/sdcard/boot.img I got
dump_image: permission denied. How can I resolve this? does it means I need to root it first before I can dump the boot image?
What is your final goal? You can try to root it using towelroot (its an apk that just roots the device). Or something else. Exploit roots are nice, as they are not changing your boot partition and let you clone the original one later on.
I never used the command you mentioned, i always used dd.
adb shell su dd if=/dev/block/platform/..../by-name/boot of=/data/local/tmp/oboot.img chmod 777 /data/local/tmp/oboot.img exit exit adb pull /data/local/tmp/oboot.img
There is another option: Download the official firmware from the net, unzip and untar it and you will have all your partition images ready. This is an example for Samsung devices: http://samsung-updates.com/
If you would tell us more about the device you are using, we could help you much better. (device name, hardware tag/number like gt-i9505, android and firmware version)
Just root your device and type su and but the dump_image binary to any of these /cache/create new folder,/data/create new folder,or /system/create new folder hope it helps.