All my compiled kernels cause bootloops - Android Q&A, Help & Troubleshooting

I have been trying unsuccessfully to build the GoogyMax3 and Alucard kernels for my CM11 Samsung Galaxy S4 (I9505). I've tried many different toolchains and followed all the tutorials and threads I can find. I also tried two separate Linux boxes as my compilation machine in case the first had an issue.
The kernel will compile and the .zip is created, but they never work when I flash them with TWRP. So I suspect I'm doing something fundamentally wrong or missing an important step. Is there any way to identify what architecture a kernel has been compiled for? Do toolchains (such as the Christopher83 Linaro ones) require any configuration after git cloning? I think my environment is not correct.
Ultimately I'd just like to compile some additional modules and this is taking me far too much effort without any progress.

I'm having EXACTLY the same problem.
I have tried EVERY tute and guide I can find.
Iv tried different toolchains on different source code, most building fine, but flashing in fastboot or installing a .zip in TWRP results in bootloop, never getting past the splash screen.
I thought it was my install method, I tried varying methods of any kernel, compiling my on boot.img, different zip signing tools, Nothing gets me past the bootloop.
NOTE: Attempting to build Kangaroo Kernel for htc-m7. The best guide for me so far has been http://pete.akeo.ie/2013/10/compiling-and-running-your-own-android.html?m=1 especially after the heading "Crafting an Android Boot.img" where the author supplies a new unmkboot tool that gives you the full set of parameters for compiling your custom boot. img.
Good luck man, if you figure it out let me know, I'll do likewise for you.

I've worked out what I was doing wrong. My ramdisk was invalid. I cloned https://github.com/Alucard24/Ramdisk into the folder the build script for the Alucard kernel was expecting to use and rebuilt the kernel with the 2015.02 Cortex A7-optimised toolchain. This time it worked. So you should be investigating that your ramdisk is correct.

Hmm. Got my ramdisk from (1st time) extracting the boot.img from the .zip file of my rom and (2nd time) a backup of boot. img from my phone using TWRP. I know the parameters I set when re joining ramdisk to my zImage are correct, but it never gets past the splash screen i.e the kernel isn't loading, which suggests to me it is as you say the ramdisk.
I'm wondering if I need to alter the Makefile of my kernel for Christopher's tool chain in any way.??
Thanks for letting me know.

Joeisgood99 said:
Hmm. Got my ramdisk from (1st time) extracting the boot.img from the .zip file of my rom and (2nd time) a backup of boot. img from my phone using TWRP. I know the parameters I set when re joining ramdisk to my zImage are correct, but it never gets past the splash screen i.e the kernel isn't loading, which suggests to me it is as you say the ramdisk.
I'm wondering if I need to alter the Makefile of my kernel for Christopher's tool chain in any way.??
Thanks for letting me know.
Click to expand...
Click to collapse
I didn't have to modify anything for the toolchain. I download and extracted it and then updated the build script. The Alucard script creates the image with this:
./mkbootimg --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3' --kernel $PACKAGEDIR/zImage --ramdisk $PACKAGEDIR/ramdisk.gz --base 0x80200000 --pagesize 2048 --ramdisk_offset 0x02000000 --output $PACKAGEDIR/boot.img

I have the same problem,
Im learning for making custom kernels and I use for a try working kernel without anychange - only compiling from working source - and... after compiling flash and bootloop - always , flash ziped by another person - works .....

Related

[ROM] Build Your Own Dell Venue Rom > Froyo > Gingerbread > Ice Cream

I wish to open New Thread for enable focus into developing custom rom for dell venue and expecting get some suggestion, comment, help from other members of this forum :
I have wrote brief guide to prepare build environment and build kernel & rom for dell venue HERE
I do test to emulator and device all build result before posting to this thread, but need other user/member willing to test the build and post any suggestion, comment etc.
Starting by building froyo base rom, to test and ensure the buiild process is correct and exepcting to build further base i.e gingerbread and ice cream sandwich
since I'm terrible noob in android development, help, guide, suggestions are very welcome
-update-
Kernel Build
I have been succesfully "build" a kernel HERE
I splited 408-kernel to "borrow" the ramdisk (To make it easy I renamed file boot.img of 408-kernel into boot408.img.
Code:
[[email protected] venimg-1]$ split_bootimg.pl boot408.img
Page size: 2048 (0x00000800)
Kernel size: 3092536 (0x002f3038)
Ramdisk size: 168270 (0x0002914e)
Second size: 0 (0x00000000)
Board name:
Command line: androidboot.hardware=venue
Writing boot408.img-kernel ... complete.
Writing boot408.img-ramdisk.gz ... complete.
extracted ramdisk
Code:
[[email protected] ramdisk]$ gzip -dc ../boot408.img-ramdisk.gz | cpio -i
561 blocks
edited ro.secure=1 to re.secure=0
recreate cpio archive
Code:
$ mkbootfs ./ramdisk | gzip > ramdisk-408-2.gz
recreate boot image by using new build kernel named zImage-05
Code:
$ mkbootimg --cmdline 'androidboot.hardware=venue console=null' --kernel zImage-05 --ramdisk ramdisk-408-2.gz -o boot408-2.img
flash boot408-2.img > NO LUCKS > NOT BOOTING .. I'm clueless. Anybody give an idea ?
-update-
My failed to make "succesfull build kernel" to "boot" is the absent of info : BOARD_KERNEL_BASE (address) for dell venue. Someone can appoint me where I can get this info?
please test
changkho1908 said:
please test
Click to expand...
Click to collapse
this is very early stage of development build with available source. As I found HERE available ICS Chocolate Branch Manifest for msm7627. I will personally do experiment to build this ICS branch for dell venue.
I still need help from someone to understand and appoint a clue to this information at the end of build process :
Code:
.....
APK certs list: out/target/product/msm7627_surf/obj/PACKAGING/apkcerts_intermediates/msm7627_surf-apkcerts-eng.x.txt
Package target files: out/target/product/msm7627_surf/obj/PACKAGING/target_files_intermediates/msm7627_surf-target_files-eng.x.zip
Package OTA: out/target/product/msm7627_surf/update.zip
./build/tools/releasetools/ota_from_target_files:63: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import sha
unzipping target target-files...
using device-specific extensions in device/qcom/common
[B][I][COLOR="Red"]unable to load device-specific module; assuming none[/COLOR][/I][/B]
done.
sysmtem is alive but boot (kenel) is still NON BOOTABLE ... I believed by working together we will have "something" for this device
The 40x roms are based off of the MSM8x60 branches, as they dont implicitly list 8260 they likely used 8660 as their base.
I dont know if the 8x60 is closer to the 8x50 then the 7627, but just pointing it out.
You might be better off at least getting 2.2/2.3 to boot first, you may very well need to deal with the drivers and at least 2.2/2.3 have working binary-only drivers.
TheManii said:
The 40x roms are based off of the MSM8x60 branches, as they dont implicitly list 8260 they likely used 8660 as their base.
I dont know if the 8x60 is closer to the 8x50 then the 7627, but just pointing it out.
You might be better off at least getting 2.2/2.3 to boot first, you may very well need to deal with the drivers and at least 2.2/2.3 have working binary-only drivers.
Click to expand...
Click to collapse
Dear TheManii,
I believed you are one who having well understanding on this funky smart phone. please let me know qsd8x50 : is the name of processor isnt it > qualcom snap dragon (qsd) and how about MSM8x60 <-- this is name of BOARD of Name or Processor. When coming into building kernel I need to have correct understanding. So far I know only the ARCH. Is there any wiki or site page to refer. This is example when I was on old time with gentoo linux on compiling kernel for PC > Safe Cflags. Board understanding will help in configure config file, processor understanding will help in overclocking or set best and safe for building kernel.
binary only available driver will always make head-ache in open source community. Hopefully vendor releasing the driver copy sorry for the question, I'm really new to this embedded device
Snapdragon is the device family, 8250 is the specific SOC used in the venue.
Like I stated earlier, dell used the 8x60 branch as their base as qualcomm/CAF no longer supports 8x50 devices. I dont know if it's better or worse as the group that makes the roms pretty much does a terrible job at it, the venue has only a fraction of the issues of the streak 5 (due mainly to drivers), but there's not much you can say to defend them when it takes over a year to release GB (in fact it was just days after ICS was released) for the venue.
Dell cant and wont release the drivers to any of their devices, most of them except the streak 5 arent unusual anyway. The reason ICS has a beta for the S7 is this very fact.
You can likely base it on the nexus one/passion as it's likely not terribly different from it.
I dont expect the GB drivers to simply work in ICS, and since we dont have them you'd pretty much need to rewrite/port from a similar device using the same hardware.
At least with the current drivers, you could theoretically build the rest of the system and drop in the current ones. I've never had the time to try so myself but this is pretty much how cyanogen is ported to some devices.
That's pretty much ALL the info for the venue, as I'm the closest to a dev for it (at least on xda, there's other devs but they dont speak english much/visit xda much so it doesnt really make much of a difference in the end) and that's about as much as I can offer.
I cant really offer much more as I've never attempted to build android itself. Most I've done is build the makefiles to compile CWM. The makefiles for android is a lot more complex then merely porting CWM
dear all,
can someone appoint me out to have correct GB manifest on codeaurora ? I tried
Code:
[email protected]:~/dell-venue$ gingerbread_rel -m M7630AABBQMLZA404020.xml ^C
[email protected]:~/dell-venue$ repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread_rel -m M7630AABBQMLZA404020.xml --repo-url=git://codeaurora.org/tools/repo.git
.repo/manifests/: manifest switched gingerbread_chocolate...gingerbread_rel
.repo/manifests/: discarding 70 commits removed from upstream
fatal: manifest 'M7630AABBQMLZA404020.xml' not available
fatal: cannot link manifest M7630AABBQMLZA404020.xml
I did many googling, still No lucks I agree to Guru TheManii advise to make GB kernel booting first then investigate to port ICS into dell venue.
***dell venue make me very currious (and also fustating)***
x1123 said:
dear all,
can someone appoint me out to have correct GB manifest on codeaurora ? I tried
Code:
[email protected]:~/dell-venue$ gingerbread_rel -m M7630AABBQMLZA404020.xml ^C
[email protected]:~/dell-venue$ repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread_rel -m M7630AABBQMLZA404020.xml --repo-url=git://codeaurora.org/tools/repo.git
.repo/manifests/: manifest switched gingerbread_chocolate...gingerbread_rel
.repo/manifests/: discarding 70 commits removed from upstream
fatal: manifest 'M7630AABBQMLZA404020.xml' not available
fatal: cannot link manifest M7630AABBQMLZA404020.xml
I did many googling, still No lucks I agree to Guru TheManii advise to make GB kernel booting first then investigate to port ICS into dell venue.
***dell venue make me very currious (and also fustating)***
Click to expand...
Click to collapse
good luck for you, we are always support you
changkho1908 said:
good luck for you, we are always support you
Click to expand...
Click to collapse
cũng chỉ biết good luck for you àh
nguyen_vh said:
cũng chỉ biết good luck for you àh
Click to expand...
Click to collapse
đệt, chú muốn thế nào nữa
I tested to build android and using three source : codeaurora, cyanogen, aosp. To build GB on codeaurora I just can not find correct manifest. On cyanogen just wont build (for certain device) without proper propreitary binary drivers. On aosp ... well, build is easier. From TheManii advise I build GB aosp > passion and will not boot to be flashed to dell venue. I change the kernel with 408, rom is alive on device, but No wireless functionality work, either gsm or wifi. Anyone can give a clue where to get radio.img for dell venue? to build booting customs android kernel for venue still no lucks for me.
if someone want to take a look please download passion build packed with 408 kernel HERE flashable via cwm recovery. This will not brick your device.
To turn back device into normal android usage just flash TheManii StreakDroid4-250 without wipe anything. I put StreakDroid4-250 file also HERE just for make easier to download from my region (Indonesia).
split / unpack / repack boot.img
Hi Guys,
My biggest problem to determine how to pack kernel into boot image is solved. I optimistic to have booting kernel and pack into boot image. I cant determine the board kernel base address. Now I found out the base address is 0x20000000 (twenty million). I have test the coomand line and work well. This is the test procedure > download live boot.img (mean its proved bootable). I toke 408-boot image from many Streakdriod4 rom ... thanks to TheManii :
Code:
$ split_bootimage.pl 408boot.img
(I renamed boot.img to 408boot.img for easy remember)
output
Code:
Page size: 2048 (0x00000800)
Kernel size: 3092536 (0x002f3038)
Ramdisk size: 168270 (0x0002914e)
Second size: 0 (0x00000000)
Board name:
Command line: androidboot.hardware=venue
Writing 408boot.img-kernel ... complete.
Writing 408boot.img-ramdisk.gz ... complete.
...
Now I have in the folder > 3 files : 408boot.img 408boot.img-kernel 408boot.img-rakdisk.gz. We test our command line > to repack kernel and ramdisk into boot image and must be flashable to device and booting :
Code:
$ mkbootimg --kernel 408boot.img-kernel --ramdisk 408boot.img-ramdisk.gz --pagesize 2048 --cmdline "androidboot.hardware=venue" --board venue --base 0x20000000 -o new408boot.img <ENTER>
You should have new408boot.img bootable into our venue viat fastboot > test >
Code:
$sudo fastboot earse boot (to ensure existing boot is clean)
$sudo fastboot flash boot new408boot.img
$sudo fastboot reboot
...
Mu dell venue with TheManii rom booting properly.
But we need to ensure everything work well. Let us utilize second procedure well known in the world
Code:
$rm 408boot.img-kernel 408boot.img-ramdisk.gz new408boot.img [B][COLOR="Red"](to clean the folder).[/COLOR][/B]
$unpack-bootimg.pl 408boot.img [ENTER]
OUTPUT WILL BE
Code:
kernel written to 408boot.img-kernel.gz
ramdisk written to 408boot.img-ramdisk.cpio.gz
561 blocks
extracted ramdisk contents to directory 408boot.img-ramdisk/
By using UNPACK method we will have THREE file (four including 408boot.img) in folder
408boot.img 408boot.img-ramdisk 408boot-ramdisk.cpio.gz 408boot.img-kernel.gz
I choose unpack method since I wanna to test all command line available in internet is working properly. I change initlogo.rle with one I download from internet and edit default.prop file.
Code:
$nano -w 408boot.img-ramdisk/default.prop
EDIT THE text > ro.secure=1 TO ro.secure=0.
change initlogo.rle with other FILENAME.rle (You can download from internet)
Now we have ramdisk file (folder) with different default.prop file and initlogo.rle file (different image .. default is dell logo)
Create new ramdisk file to enable us create bootable image
Code:
$mkbootfs 408boot.img-ramdisk | gzip > new408-ramdisk [ENTER]
we should have file named new408-ramdisk gziped
Now repack kernel and new ramdisk >
Code:
$mkbootimg --kernel 408boot.img-kernel.gz --ramdisk new408-ramdisk --pagesize 2048 --board venue --cmdline "androidboot.hardware=venue --base 0x20000000 -o realynewboot.img [ENTER]
...
flash realynewboot.img via fastboot my boot splash changed into image attached ...
for step by step ... i put on MY BLOG
I share this to have someone try together to compile a kernel and convert into bootable image. with this kernel proble tackled ... build ROM is easier
Booting kernel
Hi Folks,
attached is booting kernel for dell venue. I tried on GB Rom (TheManii Rom) Steakdroid4-2.5.0.
Build info :
- Build from source tree : DJSteve-StreakKernel-92bf64f
- using 408config > extracted from 408boot.img
- switched off back cover awareness (I dont know what exact name) feature
- ramdisk > splitted ramdisk from 408-boot image.
- flashable via fastboot
- download atachement
- boot to fastboot
-$ sudo fastboot erase boot
-$ sudo fastboot flash boot djsteveboot.img
-$ sudo fastboot reboot
NOTE
This is development stage kernel. so please only try if you can tackle all problem. Good news flash the boot WILL NOT brick Your device
share here the result
x1123 said:
- switched off back cover awareness (I dont know what exact name) feature
Click to expand...
Click to collapse
It's redundant on the V at least, as it has no door sensor/doesnt care if the back cover is off. I do that all the time to hot swap memory cards.
Even the stock kernel will allow you to remove the door and not complain
Hi, I built a kernel too but based on Venue (4.06) sources.
http://forum.xda-developers.com/showthread.php?p=23544539#post23544539
You can check my sources here :
https://github.com/adridu59/dell-venue-kernel
The Venue codename is 'toucan'.
There are Venue-specific files and I do not know whether they are present in the Streak source you used.
I am developing a CM7 build myself. In fact, things are OK except the fact that the kernel is still stock 408 (things about setting up the working environment is here: http://forum.xda-developers.com/showthread.php?t=1687679).
After being able to build CM7 myself, I will turn back with the kernel issue for 2.3.x. Then, proceed to Android 4 ICS. God bless all of us!

[Q] Porting CyanogenMod on MSM8610 Handset.

Hi Team,
Was trying to port CyanogenMod 11 || CAF 8610 KK on MSM8610 handset.
I have a partial kernel source for the device, but am unable to compile the dt.img from it.
Using the dt.img from the Stock Boot.img gives me display, but using my created dt.img gives me no display.
When i try to create a DT.IMG using the mkbootimg_tools i get :-
DTB combiner:
Input directory: './arch/arm/boot/'
Output file: 'dt.img'
=> Found 0 unique DTB(s)
I want to know how to create the dt.img from the kernel. Tried various dtbTools with the same result. Am wondering if there is something else wrong.
Any help would be greatly appreciated.
adityaxavier said:
Hi Team,
Was trying to port CyanogenMod 11 || CAF 8610 KK on MSM8610 handset.
I have a partial kernel source for the device, but am unable to compile the dt.img from it.
Using the dt.img from the Stock Boot.img gives me display, but using my created dt.img gives me no display.
When i try to create a DT.IMG using the mkbootimg_tools i get :-
DTB combiner:
Input directory: './arch/arm/boot/'
Output file: 'dt.img'
=> Found 0 unique DTB(s)
I want to know how to create the dt.img from the kernel. Tried various dtbTools with the same result. Am wondering if there is something else wrong.
Any help would be greatly appreciated.
Click to expand...
Click to collapse
Guys !?
like this
if u see a bunch of .dtb files in arch/arm/boot
then
./dtbToolCM -s 2048 -o arch/arm/boot/dt.img -p scripts/dtc/ arch/arm/boot/
Yeah, I made the mistake of doing it before compiling the zimage.
Got the DT.IMG. but there is a problem.
Compiled zimage + compile DT.IMG = no display, no adb.
Compiled zimage + stock DT.IMG = display and adb
As far as I understand the problem might be because the compiled DT.IMG is not having the right dtb.
My device has otm9608c qhd display.
adityaxavier said:
Yeah, I made the mistake of doing it before compiling the zimage.
Got the DT.IMG. but there is a problem.
Compiled zimage + compile DT.IMG = no display, no adb.
Compiled zimage + stock DT.IMG = display and adb
As far as I understand the problem might be because the compiled DT.IMG is not having the right dtb.
My device has otm9608c qhd display.
Click to expand...
Click to collapse
maybe , try make clean , and again build , actually dtbToolCM finds the right dtb files from scripts/dtc , it shouldnt go wrong unless u did it wrong or if ur source has problems

[HOW-TO] A Guide to KEXEC and HARDBOOT for ARMv7a Boards

What is Kexec?
"Kexec", which is short for 'Kernel Execution' is derived from the Linux Kernel call "exec". It allows the "live" booting of a new kernel "over" the currently booted kernel without taking the device down for a reboot. This is extremely useful on locked bootloader devices, as a user with root authentication can boot a custom kernel without rebooting, and undergoing the security checks enforced by the bootloader. On unlocked devices, it can be used to "multi-boot" kernels on a device without requiring the kernels to be installed to the /boot partition.
Whilst Kexec is extremely useful, it also can be extremely hard to implement, as it needs to take all devices down, and bring them back up along with the new kernel, this can lead to some serious bugs, like devices not working after soft-boot, kernel corruption, device hangs, etc. This make it very device specific, and hard to get fully working, as it requires retrieving kernel crash logs, (often) UART serial output, and a ton of debugging.
What about this whole "Hardboot" thing?
The solution to this was written (initially) by Mike Kassick, who had the idea to "Hardboot" a kernel. Which is when a kernel is loaded into memory, a flag is set, the device is taken down for a full reboot, then the flag is read out by the primary kernel very early in the boot sequence, at which point, the "primary" kernel directly loads the new "secondary" kernel/ramdisk/passes arguements/etc.
This is much easier to implement than the normal Kexec SysCall, as it jumps to the new kernel before most devices are initiated, and in doing this, we allow the secondary kernel to initialize all the devices on its own, and not have to worry about taking them down.
Many people unknowingly make use of Kexec in the form of MultiROM, so, today, I thought I would do a write up on how to use it in practice.
Necessary Components:
* Boot.img (alternatively, the zImage-dtb/ramdisk you want to use)
* Unmkbootimg
* Kexec Binary (can be found in your specific devices MultiROM zip)
* Kexec Hardboot enabled Kernel installed (most custom kernels have it)
* Root Access
Downloads:
All the Binaries I've cross compiled/found can be downloaded here: https://www.dropbox.com/sh/7g5jcofv8j2gwg9/AAA-2b-wLiHq2z0nCMIHSHooa?dl=0
All the Linux Binaries you'll want/need are here: https://www.dropbox.com/sh/qcho8bhaoi8cdkc/AACGvmIQlb_3I9OQtNMqIQwva?dl=0
If you use Windows/Mac, just find the binaries equivalents for your platform.
How to use it?
1. Take the aforementioned Kexec Binary, and place it in /system/bin using ADB or A File Explorer, granting it permissions drwxdr-xdr-x (or chmod 0755 it)
2. Over on your desktop, make sure you have Unmkbootimg in an Executable location, and that you've blessed them as executable (chmod 0755 filename). Then run
Code:
unmkbootimg /path/to/your/boot.img
This will dump a zImage (rename it to zImage-dtb now, for semantics sake), and a ramdisk, labeled initramfs.cpio.gz (Initial RAM File System, in the form of a cpio.gz archive).
Now, put the kernel and ramdisk in a folder on your SD Card via MTP/ADB Push, I called mine "kexecstuffs".
3. Now open a mobile terminal, or an ADB Shell, and run
Code:
su
cd /sdcard/PathToYourFolder/
kexec --load-hardboot zImage-dtb –initrd=initramfs.cpio.gz --mem-min=0x20000000 --command-line="$(cat /proc/cmdline)" --boardname=shamu –dtb
Now, lets dissect the different arguments we are passing to Kexec:
--load-hardboot = Tells Kexec to make use of the Kexec Hardboot kernel function, and take the device down for a full reboot as opposed to soft-booting, like that used in the standard Kexec Linux SysCall
zImage-dtb = Name of your kernel file
--initrd = Points to the ramdisk to be used when booting the new kernel, if not set, the current ramdisk in the /boot partition. Most archive types are supported.
--mem-min = A reasonable value in memory where the kernel is loaded, serves as space for Kexec to do its work
--command-line = What arguments are passed to the new kernel, using "$(cat /proc/cmdline)" allows you to pass the currently booted kernel's arguments to the new kernel, which is what we want in the case of Shamu
--dtb = Defines that the board makes use of an Appended Device Tree, can be passed without a value (which will rely on Tasssdar's “boardname” value), or can have a compressed DTB image as its value
--boardname = Tasssdar's way to handle different DTB styles, we just need to pass “shamu” to it, and it'll use our DTB style
Now that we have successfully loaded the kernel into memory, lets execute it!
4. In that same Mobile Terminal/ADB Shell, run:
Code:
kexec -e
Although this guide is for the Nexus 6 (shamu), it should work all devices supported bu MultiROM, or on any device with a kernel that supports Kexec/Kexec Hardboot.
I hope this helped you to better understand what Kexec is/how to use it.

Kernel compiled from Sony sources won't boot...help

I'm not an active developer but I'm also not a *total* noob -- I've successfully compiled usable kernels for Nexus 4, Moto G, HP TouchPad -- but I'm not making much headway on my Z5C kernel.
I want to run an otherwise stock Sony ROM on my phone, but make a couple of minor tweaks to the kernel. With that in view, I downloaded the source tree from Sony's dev site for the kernel that matches the one that shipped with the ROM I am currently running (at the moment, for Reasons, it's a Lollipop one, and I'm not really interested in debating that point anyway), and then I started by building a kernel with ZERO changes applied first. But it will not boot. Instead, with my first attempt at a kernel compiled from scratch, after the Sony Xperia boot logo and before the boot animation would normally kick in, the screen goes black and the notification LED blinks red 4 times, and then it reboots and starts over (bootloop).
I'm not sure what I am supposed to do to diagnose the problem since the screen doesn't display anything and it never gets far along enough in the boot process to where the USB port is initialized. And, yes, the bootloader is unlocked (I can flash a stock kernel to the phone with the DRM fix applied, and that boots and works just fine).
Here is what I have done so far:
Downloaded the kernel sources that match my ROM's kernel at https://developer.sonymobile.com/do...rchives/open-source-archive-for-32-0-a-6-200/
Downloaded the GCC 4.9 for ARM64 cross-compiler / toolchain from https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/
Applied kitakami_defconfig and suzuran_diffconfig, and built the kernel. It compiled cleanly without any errors.
Extracted kernel.elf from my ROM's kernel.sin, and then unpacked the binary image, initramfs, and device tree blob from that.
Re-packaged a new kernel into .img format for Fastboot flash by substituting in my kernel image binary for the official Sony one, but keeping the original ramdisk and DTB.
Flashed image to boot partition with Fastboot == bootloop
Flashed original kernel back == works fine
Decided to try creating a new DTB instead of reusing the one from the original kernel...but dtbTool spits out this:
Code:
Found file: msm8994-v2.0-kitakami_suzuran_generic.dtb ... skip, failed to scan for 'qcom,msm-id = <' tag
Found file: msm8994-v2.1-kitakami_suzuran_generic.dtb ... skip, failed to scan for 'qcom,msm-id = <' tag
Grabbed dtbToolCM from https://github.com/xiaolu/mkbootimg_tools instead, which seems to work.
Substituted in the new DTB image for the original Sony one, repackaged up a new boot.img, flashed that == bootloop
Tested my mkbootimg and the parameters I was using by extracting kernel, ramdisk, and DTB from original kernel.elf, then repackaging them all together into a boot.img and flashing that to the phone with Fastboot == works just fine
Hypothesized that perhaps my kernel didn't like the Sony kernel modules on the system partition because of version magic mismatch, so I changed CONFIG_LOCALVERSION from "-perf" to "-perf-g75e6207" in .config and rebuilt kernel, repackaged, reflashed with Fastboot == bootloop ... ARGH
So at this point, I'm at a loss. I've proven that it's not the way I am packaging up the boot image because if I repack the original Sony kernel binary up with the original ramdisk and DTB and then flash that file to the boot partition, that has no problem booting the phone. Is there some modification that I need to make to the contents of the ramdisk? I'd think I should just be able to use the stock Sony ramdisk unmodified, especially if the kernel itself doesn't differ at all (same sources, same .config) from the one Sony compiled, but...?
Any leads that any experienced Xperia Z-series kernel hackers out there can supply before I end up tearing my hair out would be greatly appreciated.
Thanks so so so much,
-- Nathan
[UPDATE]: Just tried assembling with mkqcdtbootimg instead. No go. Also unpacked the image made by that utility and verified that everything (e.g. offsets, etc.) looked sane. GARGH.
Oh, good grief...I answered my own question.
The version of the compiler has to match EXACTLY with what was used to build the rest of the system. I'm guessing because the compiler version has to match between kernel and kernel modules.
The git repo on googlesource.com that contains the prebuilt arm64 x-chain has been updated since the release of 32.0.A.6.200. Version string for gcc of most recent pull was "4.9.x-google 20150123 (prerelease)", but original kernel binary built by Sony had been compiled by gcc version "4.9.x-google 20140827 (prerelease)".
I finally found a version I could roll back to that contained that version string (commit hash 4b341df712969ca2ac0c3cf6294260d406b9d9be), and it worked.
Hopefully this helps someone else out someday,
-- Nathan
nlra said:
Oh, good grief...I answered my own question.
The version of the compiler has to match EXACTLY with what was used to build the rest of the system. I'm guessing because the compiler version has to match between kernel and kernel modules.
The git repo on googlesource.com that contains the prebuilt arm64 x-chain has been updated since the release of 32.0.A.6.200. Version string for gcc of most recent pull was "4.9.x-google 20150123 (prerelease)", but original kernel binary built by Sony had been compiled by gcc version "4.9.x-google 20140827 (prerelease)".
I finally found a version I could roll back to that contained that version string (commit hash 4b341df712969ca2ac0c3cf6294260d406b9d9be), and it worked.
Hopefully this helps someone else out someday,
-- Nathan
Click to expand...
Click to collapse
I think that cannot be possible. There are lots of kernels out there compiled with toolchains different than the stock one (e.g. Androplus kernel is compiled with UBERTC 4.9)
I am in the same situation as you, but with the Xperia X Compact:
-Untouched copyleft source code
-Untouched ramdisk
-Using AOSP mkbootimg (the new one written in Python: https://android.googlesource.com/platform/system/core/+/nougat-release/mkbootimg/mkbootimg) with arguments specified in README_Xperia (https://github.com/bamsbamx/BMSBMX_kernel_kugo/blob/master/README_Xperia)
And still no boot... I am about to give up on this as I cannot find any other solution...
You can see my build script here for reference: https://github.com/bamsbamx/BMSBMX_kernel_kugo/blob/master/utils/build.sh
bamsbamx said:
I think that cannot be possible.
Click to expand...
Click to collapse
*shrug* I don't know what to tell you. All I know is that I changed one variable at a time, and then when I finally changed the version of the compiler I was using, eureka.
That's not to say that there couldn't have been more than one variable in the equation, and that I happened to knock each pin down one at a time without knowing it. For example, I can tell you that the size of the DTB varied slightly between what dtbToolCM came up with, and what mkqcdbootimg generated, and that the DTB that was generated by mkqcdbootimg was EXACTLY the same size as the one in Sony's official kernel image while dtbToolCM's was not. But changing to mkqcdbootimg alone did not fix my issue.
My theory in the end -- which could be completely wrong -- was that maybe the kernel module version magic includes either part or all of the compiler version string, so until I found the compiler that matched the one that Sony used, the kernel modules that Sony built were unable to load when my kernel was booting. If that wasn't the problem, then maybe there was some other reason the kernel modules couldn't load...maybe a subtle GCC bug that was fixed between the version Sony used and the latest binaries on Google's git server that ended up generating code that is slightly incompatible between binaries produced by the two versions. Or maybe I'm completely cold and it had nothing to do with the kernel modules at all. I guess we will never know unless someone else feels like soldering serial console leads on their Z5's system board, 'cause I sure ain't gonna...
I can tell you that, in the end, I retained all of the following changes, and that with my build environment I no longer have problems producing kernels that will boot a stock Sony ROM:
- I still use what I believe to be the same compiler Sony used
- I still build kernels with CONFIG_LOCALVERSION set to match the exact version string that the stock Sony kernel for my ROM has
- I still continue to use mkqcdbootimg to assemble my DTB + my final image instead of any version of mkbootimg and dtbTool
I haven't tried changing out things other than the GCC version to see if that ends up breaking things again. If I manage to find some spare time to kill in the future, I may do so in order to satisfy my curiosity. If I ever get around to doing that, I'll be sure to update this thread with my results.
FWIW, the Z5 boot image is assembled slightly differently than it appears the X Compact's is for whatever reason. I can tell you, for example, that the Z5's bootloader (at least the stock one...I hear that there is an updated version obtainable through Sony's AOSP program) does not support gzipped kernels. Also, the DTB is assembled and kept separately from the kernel up until the final mkbootimg stage, whereas it appears that the DTB and kernel are concatenated together somehow during the build for the X Compact. The fact that differences like these exist may mean that none of my findings or experiences are necessarily applicable to you and your situation.
I also will note that although you said you are using the Python mkbootimg utility, your build script that you linked to claims otherwise...
Good luck, and if you happen to figure out what the problem ended up being in your case, I'd be very interested to get an update from you!
-- Nathan
nlra said:
*shrug* I don't know what to tell you. All I know is that I changed one variable at a time, and then when I finally changed the version of the compiler I was using, eureka.
That's not to say that there couldn't have been more than one variable in the equation, and that I happened to knock each pin down one at a time without knowing it. For example, I can tell you that the size of the DTB varied slightly between what dtbToolCM came up with, and what mkqcdbootimg generated, and that the DTB that was generated by mkqcdbootimg was EXACTLY the same size as the one in Sony's official kernel image while dtbToolCM's was not. But changing to mkqcdbootimg alone did not fix my issue.
My theory in the end -- which could be completely wrong -- was that maybe the kernel module version magic includes either part or all of the compiler version string, so until I found the compiler that matched the one that Sony used, the kernel modules that Sony built were unable to load when my kernel was booting. If that wasn't the problem, then maybe there was some other reason the kernel modules couldn't load...maybe a subtle GCC bug that was fixed between the version Sony used and the latest binaries on Google's git server that ended up generating code that is slightly incompatible between binaries produced by the two versions. Or maybe I'm completely cold and it had nothing to do with the kernel modules at all. I guess we will never know unless someone else feels like soldering serial console leads on their Z5's system board, 'cause I sure ain't gonna...
I can tell you that, in the end, I retained all of the following changes, and that with my build environment I no longer have problems producing kernels that will boot a stock Sony ROM:
- I still use what I believe to be the same compiler Sony used
- I still build kernels with CONFIG_LOCALVERSION set to match the exact version string that the stock Sony kernel for my ROM has
- I still continue to use mkqcdbootimg to assemble my DTB + my final image instead of any version of mkbootimg and dtbTool
I haven't tried changing out things other than the GCC version to see if that ends up breaking things again. If I manage to find some spare time to kill in the future, I may do so in order to satisfy my curiosity. If I ever get around to doing that, I'll be sure to update this thread with my results.
FWIW, the Z5 boot image is assembled slightly differently than it appears the X Compact's is for whatever reason. I can tell you, for example, that the Z5's bootloader (at least the stock one...I hear that there is an updated version obtainable through Sony's AOSP program) does not support gzipped kernels. Also, the DTB is assembled and kept separately from the kernel up until the final mkbootimg stage, whereas it appears that the DTB and kernel are concatenated together somehow during the build for the X Compact. The fact that differences like these exist may mean that none of my findings or experiences are necessarily applicable to you and your situation.
I also will note that although you said you are using the Python mkbootimg utility, your build script that you linked to claims otherwise...
Good luck, and if you happen to figure out what the problem ended up being in your case, I'd be very interested to get an update from you!
-- Nathan
Click to expand...
Click to collapse
Yeah, sorry about that, I didnt push the new commits to Github yet because of the kernel not booting, the current script I am using is this one:
Code:
#!/bin/bash
RED=1
GREEN=2
BLUE=4
colorPrint() {
tput setaf $2
echo $1
tput sgr0
}
colorPrint "Initializing workspace..." $BLUE
#Device config
device=kugo
#Workspace directories
workdir="$(pwd)"
outputfolder=${workdir}/OUTPUT
outputdir=${outputfolder}/${device}
toolchains=${workdir}/toolchains
ramdisk=${workdir}/ramdisks/${device}/ramdisk
export ARCH=arm64
export CROSS_COMPILE=${toolchains}/aarch64-linux-android-4.9-kernel/bin/aarch64-linux-android-
export KBUILD_DIFFCONFIG=kugo_diffconfig
colorPrint "Cleaning previous builds..." $BLUE
rm -rf $outputdir
mkdir -p $outputdir
colorPrint "Configuring kernel..." $BLUE
make msm-perf_defconfig O=$outputdir
colorPrint "Building kernel..." $BLUE
time make -j8 O=$outputdir 2>&1
if [ ! -f $outputdir/arch/arm64/boot/Image.gz-dtb ]; then
colorPrint "ERROR: kernel image not found. Kernel build failed" $RED
exit 1
fi
if [ ! -e $outputdir/ramdisk.cpio.gz ]; then
colorPrint "ERROR: ramdisk image file not found. Compression failed" $RED
exit 1
fi
colorPrint "Packaging boot image file" $BLUE
${workdir}/utils/mkbootimg \
--kernel $outputdir/arch/arm64/boot/Image.gz-dtb \
--ramdisk $outputdir/ramdisk.cpio.gz \
--base 0x20000000 \
--ramdisk_offset 0x02000000 \
--pagesize 2048 \
--tags_offset 0x01E00000 \
--cmdline "androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 zram.backend=z3fold earlyprintk" \
--output $outputdir/boot.img
if [ ! -f $outputdir/boot.img ]; then
colorPrint "ERROR: boot image file not found. boot packaging failed" $RED
exit 1
fi
colorPrint "DONE" $GREEN
colorPrint "boot image file can be found at ${outputdir}/boot.img" $GREEN
This one is for the build 34.3.A.0.217... However, I already had managed to boot copyleft kernel builds in other versions (such as 34.2.A.0.XXX) using the Github script, the UBERTC 4.9 Toolchain and not changing the GCC version, although I had to set # CONFIG_MODULE_SIG_FORCE is not set There must be something strange here
I think there must be something with kernel files permissions, or... maybe this? https://forum.xda-developers.com/an...signing-boot-images-android-verified-t3600606
@bamsbamx as usual, you have dm verity and sony RIC / security disabled, right ?
also hackery is possible to block modules from loading but since it comes at a later stage that most likely is not responsible for the kernel not booting
As alternative you could try https://github.com/sonyxperiadev/mkqcdtbootimg
Usually the instructions don't work with the copyleft kernel source, some fixes or adjustments are normally needed (at least my experience)
zacharias.maladroit said:
@bamsbamx as usual, you have dm verity and sony RIC / security disabled, right ?
also hackery is possible to block modules from loading but since it comes at a later stage that most likely is not responsible for the kernel not booting
As alternative you could try https://github.com/sonyxperiadev/mkqcdtbootimg
Usually the instructions don't work with the copyleft kernel source, some fixes or adjustments are normally needed (at least my experience)
Click to expand...
Click to collapse
Hi,
Nope, I didnt disable RIC neither dm-verity, the only thing I changed was CONFIG_MODULE_SIG_FORCE to 'is not set'. But I guess that wasnt the cause of kernel not booting since my /system partition is untouched. I tried both with mkqcdtbootimg and mkbootimg but still nothing
Hey @nlra, I figured out the problem (finally). The ramdisk I was using had been extracted from a .elf file (obtained via Flashtool through an .ftf file's kernel.sin). Somehow the extraction from the kernel.elf file is broken (resulting in a 7.0MB ramdisk.cpio.gz file)
I managed to pull up the boot.img from the device (via dd if=/dev/block/mmcplk0p33 of=/sdcard/boot.img) and then extract the ramdisk from it, resulting in a 11.4MB file
Then, I was able to boot it BOTH USING mkqcdtbootimg file and mkbootimg python script from AOSP nougat-release branch
Thats it
bamsbamx said:
The ramdisk I was using had been extracted from a .elf file (obtained via Flashtool through an .ftf file's kernel.sin). Somehow the extraction from the kernel.elf file is broken
Click to expand...
Click to collapse
Nice! Glad you figured out what was going on in your case, and thanks for confirming that both mkqcdbootimg and mkbootimg both work for building the X Compact boot image.
-- Nathan

[GUIDE][OREO][8.x] How to modify Oreo kernels to support DualBoot Patcher

The Problem
TLDR: In Oreo ROMs, i.e. Android 8.0/8.1, DualBoot Patcher no longer works, as patched ROMs/kernels will get stuck on Android logo screen(for the Axon 7, it's the 'ZTE, POWERED BY android' screen), and never boot up.
In Oreo(Android 8.0/8.1), Google introduced a new function to fstab, which is early mounting specific partitions. The purpose was so that Android can boot up faster, by ensuring that essential partitions like /system and /vendor are mounted first and the boot process will not be held back by delays in non-essential things like setting up apps. More details can be found here. So the important changes that affect DualBoot Patcher are: 1) There's an important file 'fstab.qcom', which lists all the partitions that Android can use, that got shifted from the '/' directory(the root partition/ramdisk, Android 7.x and below) to the '/system/vendor/etc' directory(in Android 8.x) 2) In addition, another file 'init.qcom.rc', once found in the '/' directory too(in Android 7.x and below), is now shifted to '/system/vendor/etc/init/hw' directory(in Android 8.x) 3) Because of 1), 'init.qcom.rc' now believes that 'fstab.qcom' is in '/system/vendor/etc' and not '/', and so it asks Android to read 'fstab.qcom' from '/system/vendor/etc' 4) In the 'fstab.qcom' file, there are entries for all partitions except /system(and /vendor for Treble devices). For these 2 partitions, they are now found in the dtb(short for Device Tree Binary). How does this affect DualBoot Patcher? 1) DualBoot Patcher expects that 'fstab.qcom' is still in '/' directory(correct me if I'm wrong), so it fails to find this file in Android 8.x ROMs/kernels 2) DualBoot Patcher expects that '/system' is still defined in 'fstab.qcom', which is not the case. Below are the exact changes that Google made(in the case of our Axon 7), note the red parts(the changes):
fstab.qcom(the strike means those lines are now removed/gone)
Code:
/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults
[STRIKE][COLOR="red"]/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard wait[/COLOR][/STRIKE]
init.qcom.rc
Code:
on fs
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
mount_all [COLOR="Red"]/vendor/etc/fstab.qcom[/COLOR]
dtb(converted into dts with dtc)
Code:
fstab {
compatible = "android,fstab";
vendor {
compatible = "android,vendor";
dev = "/dev/block/platform/soc/7464900.sdhci/by-name/vendor";
type = "ext4";
mnt_flags = "ro,barrier=1,discard";
fsmgr_flags = "wait";
status = "disabled";
};
[COLOR="red"]system {
compatible = "android,system";
dev = "/dev/block/platform/soc/624000.ufshc/by-name/system";
type = "ext4";
mnt_flags = "ro,barrier=1,discard";
fsmgr_flags = "wait";
status = "ok";
};[/COLOR]
};
The Solution
There are 3 changes to make for each ROM/kernel: 1) Edit fstab.qcom, dtb and init.qcom.rc 2) Add fstab.qcom and init.qcom.rc back into the ramdisk(i.e. edit the ramdisk) 3) Delete '/system/vendor/etc/fstab.qcom' and '/system/vendor/etc/init/hw/init.qcom.rc'. There are 2 ways you can do this, either manually, or with my script(Work in progress, my sincere apologies)
Method 1: Manually modify ROM and kernel
Files you will need:
Note: the 'files.zip' attached below contains 'dtc', 'magiskboot', 'mkbootimg', 'unpackbootimg'. Extract it to get these files. Feel free to scan them for viruses, I assure you they are clean and not viruses for sure
- boot.img you want to patch
- init.qcom.rc, fstab.qcom from the ROM you are patching
- magiskboot binary(found in /data/magisk or /data/adb/magisk if you installed magisk, otherwise download the one attached below)
- dtc binary(download the one attached below)
If you are patching Hellsgate or Schwifty, you also need:
- unpackbootimg, mkbootimg(attached below)
- Image.gz-dtb(from the flashable zip of the kernel)
Note: You also need a boot.img, but this will be from the ROM you are flashing/have flashed(extract from the ROM zip)
Preliminary step: Prepare the files
- Before you start, I would recommend copying all the files into a directory where you can chmod/execute binaries. I personally recommend '/data/local/tmp', or '/cache'(anywhere in /cache is fine). The guide below assumes that all these files are in the same directory. Also, chmod all the binaries, for example, do this in your working directory:
Code:
chmod 0755 *
- Also, I would recommend backing up 'fstab.qcom' and 'init.qcom.rc'
Additional Step: If you wish to patch kernels like Hellsgate and Schwifty
- First, unpack your ROM's stock kernel:
Code:
./unpackbootimg -i boot.img
- Then, repack the kernel as a Hellsgate/Schwifty kernel:
Code:
./mkbootimg --kernel Image.gz-dtb --ramdisk boot.img-ramdisk.gz --cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 [email protected] androidboot.selinux=permissive buildvariant=userdebug" --base 80000000 --pagesize 4096 --kernel_offset 00008000 --ramdisk_offset 01000000 --second_offset 00f00000 --tags_offset 00000100 --os_version 8.1.0 --os_patch_level [COLOR="red"]2018-06[/COLOR] --hash sha1 --output ./boot-new.img
- Note: For the red part in the above command, adjust for the month that your desired kernel is released. E.g. If your desired kernel was released in 2018 June, you put '2018-06', while if it was released in 2018 July, you put '2018-07', and so on.
- From now on, take note that everytime I mention 'boot.img', for you, it will be 'boot-new.img'(I'll bold each one that you have to change to 'boot-new.img')
Step 1: Unpack the boot.img
Code:
./magiskboot --unpack [COLOR="red"]boot.img[/COLOR]
- Now you get 3 additional files: 1) kernel(not editing this) 2) ramdisk.cpio(gonna edit this) 3) dtb(also editing this)
Step 2: Decompile the dtb
Note: dtb is a BINARY so don't open it with a text editor
Code:
./dtc -I dtb -O dts -o dt.txt dtb
- Another note: It will probably give you a lot of warnings, but it's harmless so just ignore them(I've edited multiple kernels and tested them myself, no bugs so far)
Step 3: Edit the decompiled dts
- Open the created 'dt.txt' with a root text editor(I use Simple Explorer, you can use FX file explorer, or ES file explorer)
- Search for this word:
Code:
/system
. You should find this line:
Code:
dev = "/dev/block/platform/soc/624000.ufshc/by-name/system";
- Remove the entire chunk quoted below:
Code:
system {
compatible = "android,system";
dev = "/dev/block/platform/soc/624000.ufshc/by-name/system";
type = "ext4";
mnt_flags = "ro,barrier=1,discard";
fsmgr_flags = "wait";
status = "ok";
};
- Take note that you will have to remove 1 '};'(at the bottom of the above quote), nothing more, nothing less
Step 4: Recompile the dtb
Code:
./dtc -I dts -O dtb -o dtb1 dt.txt
- Again, it might give you a lot of warnings but just ignore them
- Also, rename the new dtb so that magiskboot will compile this new dtb into your modified kernel:
Code:
mv dtb dtb.bak
Code:
mv dtb1 dtb
Step 5: Edit fstab.qcom
- Open 'fstab.qcom' file with a root text editor
- Add the following red line, below the line about '/recovery', above the line about '/data':
Code:
/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults
[COLOR="red"]/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard wait[/COLOR]
/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,nodiratime,data_flush wait,check,encryptable=/dev/block/bootdevice/by-name/cryptkey,quota,formattable[/CODE]
- Save the 'fstab.qcom' file
Step 6: Edit init.qcom.rc
- Open 'init.qcom.rc' with a root text editor
- Look for this line:
Code:
mount_all /vendor/etc/fstab.qcom
- Change it into this line:
Code:
mount_all [COLOR="red"]/fstab.qcom[/COLOR]
- Save the 'init.qcom.rc' file
Step 7: Modify kernel ramdisk
-First do:
Code:
./magiskboot --cpio ramdisk.cpio 'add 0640 fstab.qcom fstab.qcom'
- Then do:
Code:
./magiskboot --cpio ramdisk.cpio 'add 0750 init.qcom.rc init.qcom.rc'
Step 8: Create a new, DBP-compatible boot.img
Code:
./magiskboot --repack [COLOR="red"]boot.img[/COLOR]
- You will get a new boot.img, named 'new-boot.img'
Step 9: Install the modified kernel
- First, flash the boot.img(using TWRP or Flashify or another tool)
- Then, delete these 2 files:
Code:
/system/vendor/etc/fstab.qcom
and
Code:
/system/vendor/etc/init/hw/init.qcom.rc
- Note: Make sure you do not reboot after installing boot.img and before deleting the above 2 files
That's it! If you completed all the steps above properly, you should have a working DBP-compatible boot.img that you can put in a flashable zip and patch with DualBoot Patcher
if you don't know how to make a flashable zip to install your modified boot.img, you can use the one I attached below(named 'flashable-kernel-template.zip'). What you have to do is download it, then extract it and make a new zip containing your modified boot.img(basically, create a new zip with the 'META-INF' folder from my zip and your 'boot.img'. The zip automatically deletes
Code:
/system/vendor/etc/fstab.qcom
and
Code:
/system/vendor/etc/init/hw/init.qcom.rc
so you won't need to do this yourself
Note: If you are using my flashable zip, note that you have to rename your modified 'new-boot.img' to 'boot.img' before you compress it into a new flashable zip. Otherwise you will get an error when flashing in recovery
Note 2: Avoid using the flashable zip template for non-modified kernels, it can render your ROM unable to boot!
Method 2: Work in Progress
Method 2: Use my automated script
Please do leave feedback on whether this guide is clear, and also if any of the steps are not working for you! Happy Dualbooting
Sources:
Github Problem Discussion
Problem Solution
Reserved 1
Reserved 2
This is going to be useful. Personally I just want to run custom O as primary and N as a secondary. Mainly because O doesn't have properly working Daydream and for a couple of games that aren't compatible anymore with O. If I'm only trying to attach LOS14.1 as secondary I wouldn't need to patch anything extra O from this guide? Though I can't install the patched ROM it gives an error.
Edit: Oops missed reading from the old guide the primary ROM needs to be stock. I guess I need to patch then. Do I need Linux to do all the editing?
Infy_AsiX said:
This is going to be useful. Personally I just want to run custom O as primary and N as a secondary. Mainly because O doesn't have properly working Daydream and for a couple of games that aren't compatible anymore with O. If I'm only trying to attach LOS14.1 as secondary I wouldn't need to patch anything extra O from this guide? Though I can't install the patched ROM it gives an error.
Edit: Oops missed reading from the old guide the primary ROM needs to be stock. I guess I need to patch then. Do I need Linux to do all the editing?
Click to expand...
Click to collapse
Actually yeah, if your custom O is primary you don't need to patch it(the kernel, I mean)! You still need to patch the ROM so that it doesn't wipe /system when you OTA update your custom O, which means you need an unpatched custom O stock kernel flsshable zip(sorry for the mouthful). But if you don't OTA update then no need The last I tried, using stock ROM as secondary worked for me though? Didn't find any issues. But I might just be lucky, be careful if you try that.
As for your last question, nope all these commands are meant for Terminal Emulator app on an Android phone! Just use the binaries in the attached files.zip, they are all compiled for Android and do not work on Linux desktops. All the best If you need help just ask here!
haoyangw said:
Actually yeah, if your custom O is primary you don't need to patch it(the kernel, I mean)! You still need to patch the ROM so that it doesn't wipe /system when you OTA update your custom O, which means you need an unpatched custom O stock kernel flsshable zip(sorry for the mouthful). But if you don't OTA update then no need The last I tried, using stock ROM as secondary worked for me though? Didn't find any issues. But I might just be lucky, be careful if you try that.
As for your last question, nope all these commands are meant for Terminal Emulator app on an Android phone! Just use the binaries in the attached files.zip, they are all compiled for Android and do not work on Linux desktops. All the best If you need help just ask here!
Click to expand...
Click to collapse
Figured out the error after dual boot patch on LOS14.1 was my mistake in modifying the update-script incorrectly. Nothing to do with N/O/this guide. However now I tried installing it to data slot so dirty flashing and restoring the system partition won't be complicated. The issue is trying to boot primary it vibrates five times at ZTE logo and goes to recovery. Trying to switch to primary in dualbootutilities gives an error something like (from memory) data/media/0/boot.img cannot be found. I guess DBP installed even on data changes the structure of boot and primary on O doesn't fit so can't boot. Just want your advice, it probably means patching O when O is primary is necessary then?
Infy_AsiX said:
Figured out the error after dual boot patch on LOS14.1 was my mistake in modifying the update-script incorrectly. Nothing to do with N/O/this guide. However now I tried installing it to data slot so dirty flashing and restoring the system partition won't be complicated. The issue is trying to boot primary it vibrates five times at ZTE logo and goes to recovery. Trying to switch to primary in dualbootutilities gives an error something like (from memory) data/media/0/boot.img cannot be found. I guess DBP installed even on data changes the structure of boot and primary on O doesn't fit so can't boot. Just want your advice, it probably means patching O when O is primary is necessary then?
Click to expand...
Click to collapse
Oh you mean you flashed custom O, and after that you flashed you N data slot ROM? You're partially right, if you flash your data slot ROM after a non-patched ROM, you'll have the data slot kernel installed i.e. the LOS 14.1 stock kernel, which cannot boot an O ROM. This is because DBP works by storing multiple kernels on your /data/media/0/Multiboot folder, when you 'switch ROMs' actually what happens is DBP flashes the kernel of the ROM you're switching to. Obviously a N kernel cannot boot an O ROM so you cannot boot. Unfortunately, DBP only stores kernels that you flash with patched zips(i.e. if you flash a DBP-patched ROM/kernel zip, only then will DBP store the kernel in its custom Multiboot folder). So because you didn't patch your O primary ROM, its kernel is not saved and you cannot use DBPUtilities. What you can do is either make your own non-patched kernel zip file for your O ROM's stock kernel that you flash everytime you want to switch to primary, or you patch your primary ROM and then you can use DBPUtilities. However B01 kernel has a slightly different precedure for adding DBP support that this guide doesn't explain(I'm sorry) I'll update it when I find time. Don't follow this guide to patch B01! It won't boot, I tried But I know what changes to make when modifying a B01 kernel don't worry
lost this post when I pressed reply. This RR-O Kranoner 20180511 has the fstab.qcom and init.qcom.rc still on root / directory. But patching only DBP patching hellsgate kernel after having LOS14.1 on data slot 1 still has the same issue. Alternatively installing the mod boot.img allows primary to boot but after using DBP utilities to switch to data slot 1 (onscreen says success) the data slot 1 gets stuck on ZTE logo with 5 vibrates instead. Even tried flashing the final Beastmode 14.1 kernel DBP patched to data slot 1 after switched, five vibrates to recovery.
Lost Magisk install after step nine. Just reinstalling it is fine. Did you forget the flashable zip template by the way?
Infy_AsiX said:
lost this post when I pressed reply. This RR-O Kranoner 20180511 has the fstab.qcom and init.qcom.rc still on root / directory. But patching only DBP patching hellsgate kernel after having LOS14.1 on data slot 1 still has the same issue. Alternatively installing the mod boot.img allows primary to boot but after using DBP utilities to switch to data slot 1 (onscreen says success) the data slot 1 gets stuck on ZTE logo with 5 vibrates instead. Even tried flashing the final Beastmode 14.1 kernel DBP patched to data slot 1 after switched, five vibrates to recovery.
Lost Magisk install after step nine. Just reinstalling it is fine. Did you forget the flashable zip template by the way?
Click to expand...
Click to collapse
Oh hmm did you install the right version of Hellsgate for your data slot 1? I think LOS 14.1 needs a very old version(R2.1? I think). I'm not sure about beastmode kernel though, I'm sorry And thanks for the reminder about the zip template, o dear I forgot about it I'll upload it now!
haoyangw said:
Oh hmm did you install the right version of Hellsgate for your data slot 1? I think LOS 14.1 needs a very old version(R2.1? I think). I'm not sure about beastmode kernel though, I'm sorry And thanks for the reminder about the zip template, o dear I forgot about it I'll upload it now!
Click to expand...
Click to collapse
Sorry that post was worded poorly due to rushed recalling. I meant RR-O primary had Hellsgate kernel patched by this guide, which shouldn't be necessary as the two issue ROM files are still on root directory (patching with DBP instead didn't work as I posted before)? Still had to install the mod boot.img to manage to boot but then data slot 1 LOS14.1 won't boot. I was going to try patching with this guide the kernel I intend for LOS14.1 but it's lacking the image.gz-dtb file, I'd only patched it with DBP and that should be enough as it's an N ROM. I guess I could use an older hellsgate suited to N but Beastmode was updated til a little later so I'd prefer it.
Thanks for the zip template. Just checking, it's not actually needed if I can just install the modded boot.img directly in TWRP anyway?
Infy_AsiX said:
Sorry that post was worded poorly due to rushed recalling. I meant RR-O primary had Hellsgate kernel patched by this guide, which shouldn't be necessary as the two issue ROM files are still on root directory (patching with DBP instead didn't work as I posted before)? Still had to install the mod boot.img to manage to boot but then data slot 1 LOS14.1 won't boot. I was going to try patching with this guide the kernel I intend for LOS14.1 but it's lacking the image.gz-dtb file, I'd only patched it with DBP and that should be enough as it's an N ROM. I guess I could use an older hellsgate suited to N but Beastmode was updated til a little later so I'd prefer it.
Thanks for the zip template. Just checking, it's not actually needed if I can just install the modded boot.img directly in TWRP anyway?
Click to expand...
Click to collapse
Oh you're right, if the 2 files are still present you don't have to patch using this guide. Just checking, what version of hellsgate are you using for primary? And yes you're right! N ROMs/kernels don't have to be patched with this guide for DBP I'm not very sure why you can't boot and get the 5 led flashes though
As for your last question, you're right no need this zip in you install using TWRP.
haoyangw said:
Oh you're right, if the 2 files are still present you don't have to patch using this guide. Just checking, what version of hellsgate are you using for primary? And yes you're right! N ROMs/kernels don't have to be patched with this guide for DBP I'm not very sure why you can't boot and get the 5 led flashes though
As for your last question, you're right no need this zip in you install using TWRP.
Click to expand...
Click to collapse
The last B32+10 hellsgate v3.0. Dunno but the guide did manage to allow primary to boot whereas it wouldn't before. Both N hellsgate and beastmode are lacking the image.gz-dtb so I can't patch them. I guess I'll try stock next, I really wanted KCAL to use on Daydream tho ::crying:. If that fails I might try stock N as primary when I'm about to clean flash update O.
Infy_AsiX said:
The last B32+10 hellsgate v3.0. Dunno but the guide did manage to allow primary to boot whereas it wouldn't before. Both N hellsgate and beastmode are lacking the image.gz-dtb so I can't patch them. I guess I'll try stock next, I really wanted KCAL to use on Daydream tho ::crying:. If that fails I might try stock N as primary when I'm about to clean flash update O.
Click to expand...
Click to collapse
Oh dear I'm sorry to hear Just checking are you using LOS 14.1 builds from 2018? I might know what's wrong
haoyangw said:
Oh dear I'm sorry to hear Just checking are you using LOS 14.1 builds from 2018? I might know what's wrong
Click to expand...
Click to collapse
yeah latest official
Sent from my Xperia Z3C using XDA Labs
Infy_AsiX said:
yeah latest official
Click to expand...
Click to collapse
Oh I probably should add this in the OP, Nougat builds with 2018 Security patch level behaves the same way as Oreo ROMs, they also have the init.qcom.rc and fstab.qcom in /system. So I would believe that latest LOS 14.1 also needs the exact same patching method as Oreo(if you can check and confirm this that'll be great). I haven't analysed the Nougat hellsgate and beastmode kernels so I'm not sure how to patch them, I'll let you know asap when I find out something. Sorry about the mistake, I didn't realise there's still a Nougat ROM being regularly updated
Great thanks for the guide and mods. Sorry for the late follow up, it did take awhile to get working. After some confusion and trouble with figuring out how some O ROMs still don't use the early mount method. While N ROM and kernels don't in fact need patching by this guide. Also B12 can't be dual booted with any N ROMs due to bootstack incompatibility (flashing bootstack after a DBP install doesn't seem to take effect to help). My target kernel was Hellsgate 3 for B32+10, which oddly needed fstab.qcom modded per guide but not init.qcom.rc all despite the kernel being for non early mount ROMs. Yes really, after all of that figured out, I got it working!
I'm glad to report it works as intended with the right setup. Now with B12 ROMs currently all affected by the wired audio cpu extra 50% load bug, using B32+10 is a working fallback. The trade off being apparently dual-sim issues (reported by some as present, some not), no GCam HDR support and improper hi-res audio support (though hi-fi DAC was already working and hi-res is debatably useless). In any case if dual booting O with N is desired B32+10 is the latest supported available with above stated differences. This is the only way presently for using a stable-ish O ROM and N's fully functioning Daydream and a couple of AAA games deprecated after N such as Fahrenheit: Indigo Prophecy and Jade Empire. Now I can also play around testing Kranoner's N Vertex EAS supported ROM and kernel.
I've attached the B32+10 Hellsgate 3 modded per this guide using Kranoner's 180511 RR-O for anyone interested in getting it straight working without the mess. A few pointers. The zip still needs needs to be patched to primary/secondary/whatever chosen slot before use. Magisk has to be reinstalled after installing the modified kernel, primary Magisk zip does not need DB patching. Using secondary slot, to fill up like huge wasted space 6GB system partition is smart if you're not installing many apps.
Sent from my ZTE Axon 7 using XDA Labs
////[removed]////
Tried this with my device and it didn't work. Alcatel Tetra with 8.1 Stock. Runs GSI images up to 10. MT6739 SOC. Doesn't boot if you simply remove the entry. Couldn't even change ro to rw and have it boot. I was able to remove verify and that was about it. I was able to get the fstab and init file migrated back to ramdisk and it booted once i modified the init file to point to the right locations. I got DBP supporting my treble device properly. The last step is to figure out how to disable/remove the system early mount. This topic seems dead but I figure it's worth a try. I've been working on this Project on and off for 2+ months now and would really like to hit paydirt.
you do realize this is an Axon7 thread , yes?
mrrocketdog said:
you do realize this is an Axon7 thread , yes?
Click to expand...
Click to collapse
I'm Sure he's not lost .
U realize this is a place Dev's take ideas from each other and try to port it to other devices Right?

Categories

Resources