MiCode / patchrom

Use disassemble/assemble technology to porting miui to misc android devices
http://micode.net/forum-55-1.html
490 stars 370 forks source link

ROM doesn't boot up #119

Open rorre opened 7 years ago

rorre commented 7 years ago

Hi~ i already tried this 5 times, and also already fix the rejects. but the rom doesn't boot, and adb didn't recognize the phone. already tried many ways, but adb still didn't recognize the phone.

MT6580, kernel 3.18.xx Infinix Hot 2

here are the reject files. reject.zip

imFaa commented 7 years ago

you have to edit your boot.img manually.and SElinux should be permissive

rorre commented 7 years ago

Already did that. Copying from angler patch_bootimg.sh and do some modification.

imFaa commented 7 years ago

upload modified patch.bootimg.sh let me see

rorre commented 7 years ago

Here it is.


#!/bin/bash

BOOTIMG=$1

rm -rf $TARGET_BOOT_DIR
mkdir -p $TARGET_BOOT_DIR
$UNPACKBOOTIMG -i $BOOTIMG -o $TARGET_BOOT_DIR > /dev/null
gunzip $TARGET_BOOT_DIR/boot.img-ramdisk.gz
mkdir -p $TARGET_BOOT_DIR/ramdisk
cd $TARGET_BOOT_DIR/ramdisk
cpio -i < ../boot.img-ramdisk
cd - > /dev/null
if [ ! -f $TARGET_BOOT_DIR/ramdisk/init_vendor ];then
mv $TARGET_BOOT_DIR/ramdisk/init $TARGET_BOOT_DIR/ramdisk/init_vendor
fi
cp -f $PREBUILT_BOOT_DIR/$TARGET_BIT/init $TARGET_BOOT_DIR/ramdisk/init
$MKBOOTFS $TARGET_BOOT_DIR/ramdisk | gzip > $TARGET_BOOT_DIR/ramdisk.gz

OLDCMDLINE=$(cat $TARGET_BOOT_DIR/boot.img-cmdline)
NEWCMDLINE="bootopt=64S3,32S1,32S1 androidboot.selinux=permissive"
for prop in $OLDCMDLINE
do
    echo $prop | grep "androidboot.selinux=" > /dev/null
    if [ $? -eq 0 ];then
        continue
    fi
    NEWCMDLINE="$NEWCMDLINE $prop"
done

echo "NEWCMDLINE: $NEWCMDLINE"

BASEADDR=$(cat $TARGET_BOOT_DIR/boot.img-base)
PAGESIZE=$(cat $TARGET_BOOT_DIR/boot.img-pagesize)
RAMDISKOFFSET=$(cat $TARGET_BOOT_DIR/boot.img-ramdisk_offset)
TAGSOFFSET=$(cat $TARGET_BOOT_DIR/boot.img-tags_offset)

$MKBOOTIMG --kernel $TARGET_BOOT_DIR/boot.img-zImage --ramdisk $TARGET_BOOT_DIR/ramdisk.gz --dt $TARGET_BOOT_DIR/boot.img-dt --base "$BASEADDR" --pagesize "$PAGESIZE" --ramdisk_offset "$RAMDISKOFFSET" --tags_offset "$TAGSOFFSET" --cmdline "$NEWCMDLINE" -o $BOOTIMG
imFaa commented 7 years ago

https://github.com/wuxianlin/MIUI_patchrom_Find5/tree/marshmallow/overlay/boot/ramdisk

try comparing ramdisk with this

rorre commented 7 years ago

Ok.

Pada tanggal 19 Des 2016 18.08, "Farooque" notifications@github.com menulis:

https://github.com/wuxianlin/MIUI_patchrom_Find5/tree/ marshmallow/overlay/boot/ramdisk

try comparing ramdisk with this

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MiCode/patchrom/issues/119#issuecomment-267938953, or mute the thread https://github.com/notifications/unsubscribe-auth/AGPQhcT4K-GeTm6kT7MG3tvrVn61qvTyks5rJmWPgaJpZM4LQgrr .

imFaa commented 7 years ago

Or this http://forum.xda-developers.com/showpost.php?p=69191801&postcount=1234

rorre commented 7 years ago

I think that's for manual porting.

Pada tanggal 19 Des 2016 18.23, "Farooque" notifications@github.com menulis:

Or this http://forum.xda-developers.com/showpost.php?p=69191801&postcount=1234

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MiCode/patchrom/issues/119#issuecomment-267941764, or mute the thread https://github.com/notifications/unsubscribe-auth/AGPQhapyUlxXIh1w7GWJRPa4kjWReI7Yks5rJmk9gaJpZM4LQgrr .

imFaa commented 7 years ago

only see in boot.img and compare stuff

rorre commented 7 years ago

Alright.

Pada tanggal 19 Des 2016 18.50, "Farooque" notifications@github.com menulis:

only see in boot.img and compare stuff

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MiCode/patchrom/issues/119#issuecomment-267946270, or mute the thread https://github.com/notifications/unsubscribe-auth/AGPQhd96Xl7v9N4npYKcPPTvCN21Xf_Wks5rJm99gaJpZM4LQgrr .

imFaa commented 7 years ago

if you succeed please let us know and I need your help please send me build.prop here as i am getting build.prop error so have to compare whats wrong `Traceback (most recent call last): File "/home/faa/bin/patchrom/tools/releasetools/sign_target_files_apks", line 354, in main(sys.argv[1:]) File "/home/faa/bin/patchrom/tools/releasetools/sign_target_files_apks", line 341, in main SignApks(input_zip, output_zip, apk_key_map, key_passwords) File "/home/faa/bin/patchrom/tools/releasetools/sign_target_files_apks", line 162, in SignApks new_data = RewriteProps(data) File "/home/faa/bin/patchrom/tools/releasetools/sign_target_files_apks", line 194, in RewriteProps assert len(pieces) == 5 AssertionError Build full ota package: /home/faa/bin/patchrom/onyx/out/fullota.zip unzipping target target-files... Warning: could not find SYSTEM/build.prop in

ERROR: couldn't find ro.build.fingerprint in build.prop

/home/faa/bin/patchrom/build/porting.mk:314: recipe for target 'fullota' failed make: *** [fullota] Error 1`

rorre commented 7 years ago

Just copy ro.build.fingerprint line from your stock rom. You can't use other device fingerprint.

Pada tanggal 19 Des 2016 18.54, "Farooque" notifications@github.com menulis:

if you succeed please let us know and I need your help please send me build.prop here as i am getting build.prop error so have to compare whats wrong `Traceback (most recent call last): File "/home/faa/bin/patchrom/tools/releasetools/sign_target_files_apks", line 354, in main(sys.argv[1:]) File "/home/faa/bin/patchrom/tools/releasetools/sign_target_files_apks", line 341, in main SignApks(input_zip, output_zip, apk_key_map, key_passwords) File "/home/faa/bin/patchrom/tools/releasetools/sign_target_files_apks", line 162, in SignApks new_data = RewriteProps(data) File "/home/faa/bin/patchrom/tools/releasetools/sign_target_files_apks", line 194, in RewriteProps assert len(pieces) == 5 AssertionError Build full ota package: /home/faa/bin/patchrom/onyx/out/fullota.zip unzipping target target-files... Warning: could not find SYSTEM/build.prop in

ERROR: couldn't find ro.build.fingerprint in build.prop

/home/faa/bin/patchrom/build/porting.mk:314: recipe for target 'fullota' failed make: *** [fullota] Error 1`

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MiCode/patchrom/issues/119#issuecomment-267947023, or mute the thread https://github.com/notifications/unsubscribe-auth/AGPQhVzNnXc6ZvTFuWkKU-YOA-UZN8Ojks5rJnCMgaJpZM4LQgrr .

imFaa commented 7 years ago

i will not use it just want to check structure..and the fingerprint is there in all files i.e in target_files,target_files.zip,stockrom.zip but unfortunately its getting failed.

shadow25 commented 7 years ago

Hi, have you resolve? My phone don't boot too, also applying the changes posted just above (wuxianlin).

rorre commented 7 years ago

I still didn't test. Since its use CM13 as base, so then i use CM13 too, even through there is some error in some script, i need to fix that. So, it finally builded and i still didn't test it, maybe about this weekend.

Pada tanggal 20 Des 2016 16.58, "shadow25" notifications@github.com menulis:

Hi, have you resolve? My phone don't boot too, also applying the changes posted just above (wuxianlin).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MiCode/patchrom/issues/119#issuecomment-268202162, or mute the thread https://github.com/notifications/unsubscribe-auth/AGPQhYXKGSxtQBuB1ZmaKw6ZRZGkb31pks5rJ6aqgaJpZM4LQgrr .

shadow25 commented 7 years ago

I'm using like base the CM13 (official) but also making these changes the smartphone does not boot. I'll try to do some other proof, if I've done something wrong.

shadow25 commented 7 years ago

Finally I'm able to boot but the phone go into bootloop. If anyone can give me a hand, I will post the logcat.

rorre commented 7 years ago

Just post the logcat :)

Pada tanggal 21 Des 2016 3.46 AM, "shadow25" notifications@github.com menulis:

Finally I'm able to boot but the phone go into bootloop. If anyone can give me a hand, I will post the logcat.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MiCode/patchrom/issues/119#issuecomment-268354861, or mute the thread https://github.com/notifications/unsubscribe-auth/AGPQhVX2jcfcjrNFPadqKKV_SpGHRxkgks5rKD6GgaJpZM4LQgrr .

VishwaKumaran commented 7 years ago

I build a MIUI ROM too but I stuck at the Samsung logo, did you know how to fix it ?

Phone : Samsung Galaxy S4 Active ROM : CM13 Boot.img extracted ; http://www.mediafire.com/file/nhez8jccrprmzwd/bootextracted.zip patchbootimg.sh : http://www.mediafire.com/file/z2a7d0wxiww99mm/patch_bootimg.sh

shadow25 commented 7 years ago

In the archive there is the logcat and the dmesg @Rendyindo thanks for your help :) bootloop.zip

shadow25 commented 7 years ago

@VishwaKumaran you need to edit the boot.img manually and then flash via fastboot command. Seems like the update-script don't do it (I think another error of the patchrom). See the patchrom of wuxianlin post before and reproduce to your boot.img, naturally change the values for your phone.

VishwaKumaran commented 7 years ago

Therefore I can't flash this ROM via recovery ? Is necessary to flash via fastboot command ?

rorre commented 7 years ago

Use dd command or use the image flash option on TWRP lol

Pada tanggal 21 Des 2016 16.06, "VishwaKumaran" notifications@github.com menulis:

Therefore I can't flash this ROM via recovery ? Is necessary to flash via fastboot command ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MiCode/patchrom/issues/119#issuecomment-268472045, or mute the thread https://github.com/notifications/unsubscribe-auth/AGPQhVSy8TpwRqnhVFjXEKPh0GujbWJqks5rKOv7gaJpZM4LQgrr .

shadow25 commented 7 years ago

@VishwaKumaran no, only modified boot.img need to be flashed via fastboot command, you can flash the fullota.zip via TWRP. The steps are: flash fullota.zip, reboot into bootloader and flash modified boot.img, rum fastboot reboot command and the phone will boot.

VishwaKumaran commented 7 years ago

If I put the modified boot.img in my fullota can I just flashed via TWRP ?

shadow25 commented 7 years ago

I have do it but seems like the boot.img isn't flashed. You can try and if don't boot, flash the modified boot.img manually via fastboot command.

VishwaKumaran commented 7 years ago

I try many times but they didn't boot. I will try your method

Hugomm commented 7 years ago

@shadow25 @VishwaKumaran

There is a way to flash img files directly from the TWPR. http://www.droidviews.com/now-flash-image-files-using-twrp-2-8-4-0/ So just place the edited boot.img and flash it that way.

shadow25 commented 7 years ago

@Hugomm the problem isn't flash boot.img (anyway, thanks for this trick ;) ), but the bootloop...

rorre commented 7 years ago

Ok, i just tried, same result, bootloop But i found some interesting info. Sometimes, the dalvik-cache stucks at wifi-services.jar Or patchrom-core.jar or Core-.jar Or Patchrom-core.jar and core-.jar

*** means i forgot the word.

Pada tanggal 22 Des 2016 16.51, "shadow25" notifications@github.com menulis:

@Hugomm https://github.com/Hugomm the problem isn't flash boot.img (anyway, thanks for this trick ;) ), but the bootloop...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MiCode/patchrom/issues/119#issuecomment-268761652, or mute the thread https://github.com/notifications/unsubscribe-auth/AGPQheVYIDFVbos9JnnBvaGCcK-5znDbks5rKkgZgaJpZM4LQgrr .

imFaa commented 7 years ago

did you managed to boot?

shadow25 commented 7 years ago

Yes, of course

imFaa commented 7 years ago

@shadow25 your ROM booted up?

shadow25 commented 7 years ago

Yes but go into bootloop

imFaa commented 7 years ago

Bootloop means it booted to home screen and then rebooting right?

imFaa commented 7 years ago

Or just a Mi logo?

shadow25 commented 7 years ago

Only Mi logo

imFaa commented 7 years ago

That's not a bootloop bro...I reached there at first attempt without modifying anything..the big problem is that a good knowledge devs are not helping otherwise we all get a working miui ROM.here is my repo one dev told me to push everything on github then he will help me but till now no help.

https://github.com/farooque7508/Miui8_Onyx

shadow25 commented 7 years ago

Bootloop means "bootanimation loop" and this is what I have. I tried to not change anything in boot.img (except SELinux) but the device would stop to my smartphone logo. I'll try again and let you know. P.S. I have made your own modifications, including those of boot.img

imFaa commented 7 years ago

You are good...I am not a programmer don't even know how to make or edit scripts...I just ask everything too google and it answers everything...but how to get logs in this situation..one of patchrom dev asking for logs, and I can't even get that. do you know how to get logs in bootloop?

VishwaKumaran commented 7 years ago

To me it's didn't boot at all !! ( stuck on Samsung logo ). I try much times for no result. I try porting method, Xiaomi MI 2S have the same processor as my Galaxy S4 Active but not the same density pixel Xiaomi ~342 xhdpi and Galaxy S4 Active ~441 xxhdpi. But to make the porting method can I use also some patchrom folders ? If yes what's folders or files I should replace ? Moreover for the update-script can I use the update-script from patchrom ROM ?

imFaa commented 7 years ago

@VishwaKumaran give me your boot.img will do some work on it.

shadow25 commented 7 years ago

@farooque7508 Also I'm not a programmer but I'm learning through xda forum. To take logcat into bootloop you need to edit your default.prop file into ramdisk folder of boot.img for enable adb permission. After that you can use the terminal of your PC to take it (see this) @VishwaKumaran you need to edit manually your boot.img or you can't cross the boot logo

imFaa commented 7 years ago

@shadow sorry to bother but I can't find post related to default.config of ramdisk can you please tell me or can you please point me out to that specific post?

VishwaKumaran commented 7 years ago

Here is my boot.img : http://www.mediafire.com/?ud88lazjon84fnp Moreover when I flash the boot.img via fastboot the device can't be detected whereas I enable the adb permission in the default.prop

shadow25 commented 7 years ago

@farooque7508 sorry, my mistake, it's default.prop and from what I have see in your repositories, you have do yet the right changes to boot.img ;) now take the logcat bro @VishwaKumaran check if your device is recognized from your PC with adb devices command. If it's recognized, then there are problems with boot.img

VishwaKumaran commented 7 years ago

I will try it, however can you check the boot.img if I have do the right configuration ?

VishwaKumaran commented 7 years ago

Moreover if I do a mistake in the frameworks files, can I get this issue ?

imFaa commented 7 years ago

@VishwaKumaran if you do some mistake in framework the build process will never complete. Post your boot.img will see if you did a right config.

VishwaKumaran commented 7 years ago

Download the boot.img : http://www.mediafire.com/?ud88lazjon84fnp