User:Newbyte/Mainlining Notes

Can't find default configuration "arch/arm/configs/msm8916_defconfig"!
If you get this error when working with envkernel.sh, it likely means that you have the wrong architecture or device selected in pmbootstrap. Do  again and make sure you have the right device selected.

mkdir: can't create directory '.tmp_XXXXX': Permission denied
I'm not sure why this happens, but generally you can fix it by running  in your Linux kernel tree. You will probably need to use sudo. Also, make sure to  after doing this.

Kernel configuration keeps restarting or being cleaned up even though you've copied one to .output/.config
This can be for multiple reasons.

Ensure:


 * 1) pmbootstrap is set to the right device (an architecture mismatch can cause this for instance)
 * 2) you've copied it to .output/.config and not .config

Using envkernel.sh with linux-postmarketos-exynos4
linux-postmarketos-exynos4 has a "unique" setup where it does some magic to work around quirks in the Samsung bootloader. Due to this, you will likely find that the kernel fails to build with  if you try to build it with envkernel.sh. To resolve this, copy initramfs.list and init from the linux-postmarketos-exynos4 package into .output/usr in your Linux source directory. You also need to get a copy of busybox.static for armv7 in there (the executable, not the package).

Get current slot
fastboot getvar current-slot

Set current slot
fastboot set_active 

Working with device trees
On modern devices, the easiest way to get a full dtb for your particular device is likely by coping  from a running Android device (or TWRP).

Decompilation of a dtb can be done like so:

Device trees
Downstream reserved-memory bindings docs: https://android.googlesource.com/kernel/msm/+/android-msm-bullhead-3.10-marshmallow-dr/Documentation/devicetree/bindings/memory.txt

Mainline reserved-memory bindings docs: https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml

Introduction to device trees: https://www.nxp.com/docs/en/application-note/AN5125.pdf

U8500 modem stuff
http://lkml.iu.edu/hypermail/linux/kernel/1207.3/02878.html

http://lkml.iu.edu/hypermail/linux/kernel/1207.3/02879.html

http://lkml.iu.edu/hypermail/linux/kernel/1207.3/02881.html

i2c stuff
https://ansari.sh/posts/finding_sensors_i2c