[G3 Android Development] Eliminater74:
Note:

I noticed alot more people have been using MultiRom, So I decided to make a really simple basic How to guide for people who pretty much already know what they are doing.

Step #1, you need the omni source tree, I use Omni-lp5.1.1, But to use that, you will need to make some changes to your device tree, like g3-common and qcomm_common,

Only thing you will be doing to those to device tree sections, in g3-common you will remove the "liblight" directory. and in the qcomm_common Dir, you will remove The "power" Directory.

reason for that, because its already defined in hardware.. The above is only if you decide to use Omni LP trees.

If you use the Normal Omni KitKat 4.4.4, Then you dont have to remove anything.. should work right out of the box.

If using Omni 4.4.4, you can use your device from: https://github.com/TeamWin,

if your using Omni LP you can use your own device tree that works with LP..

Ok now for the code part:

open your BoardConfig.mk

and enter this at the bottom:

# Edited for TWRP Recovery
DEVICE_RESOLUTION := 1440x2560
RECOVERY_GRAPHICS_USE_LINELENGTH := true
TW_NO_USB_STORAGE := true
TW_INCLUDE_JB_CRYPTO := true
TW_INCLUDE_CRYPTO := true
BOARD_SUPPRESS_SECURE_ERASE := true
RECOVERY_SDCARD_ON_DATA := true
BOARD_HAS_NO_REAL_SDCARD := true
TW_BRIGHTNESS_PATH := "/sys/devices/mdp.0/qcom\x2cmdss_fb_primary.175/leds/lcd-backlight/brightness"
TW_MAX_BRIGHTNESS := 255
TW_SCREEN_BLANK_ON_BOOT := true
# TW_NO_SCREEN_TIMEOUT := false

# MultiROM
MR_INPUT_TYPE := type_b
MR_INIT_DEVICES := device/lge/d851/multirom/mr_init_devices.c
MR_RD_ADDR := 0x2200000
MR_DPI := xhdpi
MR_DPI_MUL := 1.5
MR_FSTAB := device/lge/d851/twrp.fstab
MR_KEXEC_MEM_MIN := 0x0ff00000
MR_KEXEC_DTB := true
MR_USE_MROM_FSTAB := true
MR_DPI_FONT := 420
MR_DEFAULT_BRIGHTNESS := 80
#MR_CONTINUOUS_FB_UPDATE := true

#MultiRom Hooks, So that we can run stock roms as secondary
MR_DEVICE_HOOKS := device/lge/d851/mr_hooks.c
MR_DEVICE_HOOKS_VER := 4

Of course change your device name and locations.

You will need to make changes to omni_(your device).mk (AKA cm_(your device).mk

and add this to it:

# Copy needed files to make everything work for recovery
PRODUCT_COPY_FILES += \
# device/lge/d851/kernel:kernel \
device/lge/d851/img_info:img_info \
device/lge/d851/postrecoveryboot.sh:recovery/root/sbin/postrecoveryboot.sh \
device/lge/d851/sign:recovery/root/res/sign

PRODUCT_COPY_FILES += device/lge/d851/fstab.g3:recovery/root/fstab.g3
PRODUCT_COPY_FILES += device/lge/d851/twrp.fstab:recovery/root/etc/twrp.fstab

PRODUCT_NAME := omni_d851
PRODUCT_DEVICE := d851
PRODUCT_BRAND := LG
PRODUCT_MODEL := G3
PRODUCT_MANUFACTURER := LG

Im not going to tell you how to get your own fstab. you should already know that.

You will need this for your hooks file: mr_hooks.c

I am sure you can see the location that it will go into, you can change it to meet your device spec.

Now read this for the rest of the way: https://github.com/Tasssadar/multirom/wiki/Porting-MultiROM

I already created a patch that works very well with the latest MultiRom: D851-CM_hardboot_kexec_kernel.patch

Yes the patch says D851, but its for the G3 kernel which all models use. And yes, it will work with CM based and stock based. If anything you will have to change the config file settings

to match the ones for your device config. This one is set for the d851_defconfig.. So just point it to your config when it asks.

Command to run patch from terminal: patch --verbose -p1 < patch/D851-CM_hardboot_kexec_kernel.patch

Yes when you copy it over, place it in its own dir called patch from your kernel tree.

or if you rather take an already patched kernel: 777Kernel-patched Branch "Testing"

Above kernel was patched by me with pemish from [MENTION=4794976]777jon[/MENTION], I did remove his patch created by [MENTION=2174433]Skin1980[/MENTION] since it didnt work well with todays MultiRom

and I added in mine.. I also made some changes to allow Sabermod 5.1 and 6.0 to compile it.

Ok this is it for me, I told you it was a quick guide for people that already know what they are doing. I am no good at teaching. I wrote this really quick so that others

can have the ability to get MultiRom running on their device (Developers)..

I will only answer questions from Developers that plan on porting to thier device and make it public.