Build own kernel and stuck on LG logo - G2 Q&A, Help & Troubleshooting

Hi,
if i try to build my own kernel for d802, i have a little problem. it should be for cm-11.0 and i tried the stock cm-11.0 kernel to test it.
i use:
./dtbTool -s 2048 -o dt.img -p cm11/scripts/dtc/ cm11/arch/arm/boot/
to get my dt.img
and:
./mkbootimg --kernel cm11/arch/arm/boot/zImage --ramdisk ramdisk.gz --cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=g2 user_debug=31 msm_rtb.filter=0x0" --base 0x00000000 --offset 0x05000000 --tags-addr 0x04800000 --pagesize 2048 --dt dt.img -o boot.img
to build the boot.img (ramdisk extracted from cm11).
i put it into a loki-fied .zip to install it and the installation works, but if i try to boot it stuck on lg logo. can anyone help me? is there a problem with my lines above?

AuxXxilium said:
Hi,
if i try to build my own kernel for d802, i have a little problem. it should be for cm-11.0 and i tried the stock cm-11.0 kernel to test it.
i use:
./dtbTool -s 2048 -o dt.img -p cm11/scripts/dtc/ cm11/arch/arm/boot/
to get my dt.img
and:
./mkbootimg --kernel cm11/arch/arm/boot/zImage --ramdisk ramdisk.gz --cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=g2 user_debug=31 msm_rtb.filter=0x0" --base 0x00000000 --offset 0x05000000 --tags-addr 0x04800000 --pagesize 2048 --dt dt.img -o boot.img
to build the boot.img (ramdisk extracted from cm11).
i put it into a loki-fied .zip to install it and the installation works, but if i try to boot it stuck on lg logo. can anyone help me? is there a problem with my lines above?
Click to expand...
Click to collapse
hey .. that looks correct to me. what rom are you trying to boot your boot.img with? i know if u using the latest CM11 branch it adds alot of commits that require new blobs .. unless that rom has those new blobs it won't boot.

houstonn said:
hey .. that looks correct to me. what rom are you trying to boot your boot.img with? i know if u using the latest CM11 branch it adds alot of commits that require new blobs .. unless that rom has those new blobs it won't boot.
Click to expand...
Click to collapse
i tried on a your rom but it didn't boot. i'll try it on cm11 to confirm it. thx for your help.

Related

[Q] SM-G900F build custom boot.img

Hi
I am used to rebuild boot images with unkmbootimg/mkbootimg on my S4 mini. When I repack a G900F a working stock boot.img and flash it with Odin, the device boots into download mode. I didn't made any changes in the ramfs, the sources are binary the same, but when I repack it to the boot.img it's different to the stock.
Is my bootloader locked? Do I need a special mkbootimg to enable SEAndroid enforcing? It does not matter if I disable it in the ramfs. Do I have to modify the kernel too?
Regards
It seems, that not the boot image is the problem but the cpio initramfs.
I can use the command
Code:
abootimg -u boot.img -r initrd.img
to replace the ramdisk in a working boot image. This works only if a replace the current initramfs with the original initramfs. If I unpack the initramfs too and repack the exact same sources, it won't boot. The sources are binary the same, but the packed initramfs is totally different.
I use the following command to repack my initramfs:
Code:
find . | cpio -o -H newc | gzip > ../initrd.img
cloooned said:
It seems, that not the boot image is the problem but the cpio initramfs.
I can use the command
Code:
abootimg -u boot.img -r initrd.img
to replace the ramdisk in a working boot image. This works only if a replace the current initramfs with the original initramfs. If I unpack the initramfs too and repack the exact same sources, it won't boot. The sources are binary the same, but the packed initramfs is totally different.
I use the following command to repack my initramfs:
Code:
find . | cpio -o -H newc | gzip > ../initrd.img
Click to expand...
Click to collapse
I don't know if this is still relevant to you, but I have found that so far the only tool that repacks s5 kernel properly is the Osm0sis kernel kitchen. I am working on linux and I was able to pack my compiled zimage and modified ramdisk using his tool. You can read more on his original thread here .
I hope thos help you.

Mkbootimg Repacking - Proper command?

I have unpacked some boot.img files and wanted to repack them after editing the ramdisk. Does anyone know the proper command to repack for the LG G2?
I am currently using:
./bins/mkbootimg --kernel $kernel --ramdisk $ramdisk \
--cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=g2 user_debug=31 msm_rtb.filter=0x0 mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_g2_lgd_cmd" \
--base 0x00000000 --pagesize 2048 --tags-addr 0x4800000 --offset 0x5000000 \
--dt ./bins/dt_g2.img --output new_boot.img
(From a script I modified)
It builds the correct addresses but the phone goes into a bootloop. Before I got the addresses right, I got fastboot. If tried the above command (which I modified). I've also tried using the command the unpack tool said to use. In addition, if tried the command in the script used to build the bootimg when omnirom is compiling. I've tried varying combos.
Yes, I am using the custom mkbootimg. I fished it out of the kernel objects directory after a successful recovery compile.
Thanks!

[KERNEL INFO] Solving Kernel boot problems / Blackscreen and Red blinking LED issue

This should go to especially the kernel devs here who does do kernels for our Z5 Premium
It seems Sony messed up something on their kernel so compilation of kernel is kinda more difficult for Z5P than for Z5
With this thread I want to explain what you need to know if you compile a kernel and packing it for the Z5 Premium
At first: The Kernel compilation
For the Z5P you need to use Google's stock Toolchain, I tried with UBERTC4.9 and didn't worked, Linaro isn't tested yet
Link to the Google Toolchain: https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/
Second: The packing of the kernel
On Z5P you need a special type of mkbootimg or it don't work, this tool is called mkqcdtbootimg
Here you have the already compiled one:
https://github.com/BlackSoulxxx/XerXes/mkqcdtbootimg
Credits to for the tool @BlackSoulxxx
If you want the source of this tool:
https://github.com/sonyxperiadev/mkqcdtbootimg
Then you have to keep attention: Kernel compression doesn't work properly so Image.gz and Image.gz-dtb doesn't work so you have to pack the kernel with the Image file only (Kernel file without any compression)
Then the command to pack the kernel:
Code:
mkqcdtbootimg --cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3 dwc3_msm.prop_chg_detect=Y coherent_pool=2M dwc3_msm.hvdcp_max_current=1500 androidboot.selinux=permissive enforcing=0" --base 0x00000000 --kernel arch/arm64/boot/Image --ramdisk <Path to your Ramdisk> --ramdisk_offset 0x02000000 --pagesize 4096 --dt_dir arch/arm64/boot/dts/qcom/ -o <Output destination path> --tags_offset 0x01E00000
(for making SELinux on enforcing remove androidboot.selinux=permissive enforcing=0 from cmdline)
This is tested on SunKernel made by @zacharias.maladroit (could be helpful for you)
Tested on my Z5P Dual E6833
I hope this can help someone
Your PDesire
PDesire said:
Then the command to pack the kernel:
Code:
mkqcdtbootimg --cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3 dwc3_msm.prop_chg_detect=Y coherent_pool=2M dwc3_msm.hvdcp_max_current=1500 androidboot.selinux=permissive enforcing=0" --base 0x00000000 --kernel arch/arm64/boot/Image --ramdisk <Path to your Ramdisk> --ramdisk_offset 0x02000000 --pagesize 4096 --dt_dir arch/arm64/boot/dts/qcom/ -o <Output destination path> --tags_offset 0x01E00000
Click to expand...
Click to collapse
I'm hoping this will help me because I have been having a non-booting kernel since r24 of 7.0 and r8 of 7.1.1! I also have a question about the Ramdisk since it wasn't exactly explained in the kernel guide Sony gives us. Is this the ramdisk.img from the out folder in the AOSP build?
Also would adding mkqcdtbootimg to the Boardconfig.mk file like it says on the sony github work so I can compile the whole thing in using the:
Code:
make -j#
command in the AOSP build guide? Or should I build the kernel separately?

Can't repack boot image

Hello,
I am trying to edit the boot.img (modified to not force encrypt the userdata) of my device.
I extracted the boot image with umkbootimage and then I extracted the initramfs with the following command:
Code:
gunzip -c ../initramfs.cpio.gz | cpio -i
Then i repacked the ramfs with the command (without changing nothing):
Code:
find . | cpio -o -H newc | gzip > ../new-ramdisk.cpio.gz
Finally, I repacked the boot image with mkbootimg and the following arguments:
Code:
mkbootimg --kernel zImage --ramdisk new-ramdisk.cpio.gz --base 0x0 --ramdisk_offset 0x002000000 --tags_offset 0x01e00000 --cmdline 'androidboot.hardware=angler androidboot.console=ttyHSL0 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3' --pagesize 4096 -o new_boot.img
The new boot image won't boot up. When I use the original initramfs to create the boot image, everything works great.
Another issue is that after the repacking the size of the initramfs changed.
Someone have any idea what should I do?
@batman1010 you need that

How to repack boot.img

Hi.
I have successfully rooted SM-T725 device and installed twrp. After booting in twrp I get boot.img.
Code:
dd if=/dev/block/by-name/boot of=/data/media/0/Download/boot.img
I unpack boot.img with tool from github /osm0sis/pxa-mkbootimg.git with command
Code:
./pxa-unpackbootimg -i boot.img -o out
When I try to pack it again with command
Code:
./pxa-mkbootimg --kernel out/boot.img-zImage --dt out/boot.img-dt --base 0 --pagesize 4096 --board SRPRL03A001 --kernel_offset 0x00008000 --ramdisk_offset 0x02000000 --second_offset 0x00f00000 --tags_offset 0x00000001 --cmdline "console=null androidboot.hardware=qcom video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=1" --output boot-new.img
it makes file with different size then original boot.img
and after flashing to boot partition, the device boots in download mode with the following error:
"partition vbmeta
Reason vbmeta: Error verifying vbmeta image: O_O_INDIVLDVMT_EDRHS_IMTHSGAUEMSAC"
How can I fix this?
I solved it. I used wrong pxamkbootimg. You need to use mkbootimg, not pxamkbootimg.
I used all parameters that unpackbootimg shows when unpacking boot.img, so the correct command is
Code:
./mkbootimg --kernel out.boot/boot.img-zImage --ramdisk out.boot/boot.img-ramdisk.gz --output boot-new.img \
--board SRPRL03A001 --base 0 --pagesize 4096 --hash sha1 \
--os_version 9.0.0 --os_patch_level 2019-03 --header_version 1 \
--kernel_offset 00008000 --ramdisk_offset 02000000 --second_offset 00f00000 --tags_offset 01e00000 \
--cmdline "console=null androidboot.hardware=qcom video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=1"
Now my boot-new.img is working and tablet boots to android well.
Hi,
I just bought same model and like to know wich method you used.
i don't ask for a comlete guide as i know the amount of time and answer it comes with, but just know i you find a sm-t725 specific way or used a wifi version designed for.
Thx.
LtGarcia said:
Hi,
I just bought same model and like to know wich method you used.
i don't ask for a comlete guide as i know the amount of time and answer it comes with, but just know i you find a sm-t725 specific way or used a wifi version designed for.
Thx.
Click to expand...
Click to collapse
At first I got root, instruction is here https://forum.xda-developers.com/tab-s5e/how-to/galaxy-tab-s5e-sm-t720-root-t3947806
After that I found that twrp is ready and flashed it, but lost root. I think because twrp and magisk lives in recovery now. https://twrp.me/samsung/samsunggalaxytabs5ewifi.html
Then I rooted twrp and flashed it again and now I have my device with twrp and root.
I used twrp for wifi version and it works.
Thanks i rooted yesterday with this post thinking i can use sm-t720 method and you just confirmed me i can use sm-t720 twrp (for sm-t725) too. I will try to do same as you did. My final challenge will be to find a way to change my TVV csc into XEF as this tablet seems to be regionnaly locked.
Thanks again for your help.

Categories

Resources