[LG Optimus 4X HD] Fluoxetine:
Additions, Edits, Other stuff that doesn't fit anywhere else really haha

Okay so what about the other types of cool things you can do to make this maybe a little bit easier? Well even like you guys probably are i am also still learning how to properly use git, and linux etc. so here i will be adding any of the cool things i learn. This will be great as a reference for me to look back at resources and recollect any information that may filter out of my brain, but may also be useful for you to learn at the same rate as i do! So check it out ;)​

Okay so today (18.02.14) i found a cool little trick using .sh files to help with the whole setting up malarcky and can make it easier if you plan to build the same rom on a weekly/nightly basis.

Okay, so what you can do whilst in the terminal is to add a file on a text basis, you can do this by running

$ pico setup.sh

This will open up the text editor on a blank document in which you can edit yourself, this is what you need, to begin with you should probably aim to write something for on screen guide/a type of ui just to let you know whats happening, this will work like a build script does, infact the same method can be applied there. Okay so whatneeds to go into it? First you want the print, this is displayed using a command known as echo.

echo 'Whatever you want to write'

This will displayed when you execute the script. So what next? Well you can choose to have it run a ui print after each action or just once at the start and then leave it to default ui to guide you. So how do you set the actions you want to do? Simply just start writing the commands!

echo 'setting up'
mkdir -p kernel/<MANUFACTURER> && git clone <KERNEL_CLONE_LINK> <CODENAME> && cd ~/<ROMNAME>/vendor && git clone <VENDOR_CLONE_LINK>
<MANUFACTURER> && cd ~/<ROMNAME> && mkdir <MANUFACTURER> && cd <MANUFACTURER> && git clone <DEVICE_CLONE_LINK> <CODENAME> && cd
~/<ROMNAME>/vendor/cm && sh get-prebuilts && cd ~/<ROMNAME> && . build/envsetup.sh && breakfast <CODENAME> && brunch <CODENAME> -j7 && cd
~/<ROMNAME>/out/target/product/<CODENAME>/

This will set up the kernel, vendor, and device and start building the rom, you may want to remove/add steps but that is how you can do it if you want to build multiple times, this can take a while to ammend for each different rom you use but it works like a dependencies file. To add UI after each one just add it after each step (short version example to follow)

echo 'setting up'
Mkdir -p kernel/<MANUFACTURER>
echo 'Cloning Kernel now'

Save this file with ctrl +w and save as a .sh file. Once this is done and in your root, working directory you can simply do:

. setup.sh

Or whichever you set it as!

NOTE

This may not always work, but it is a good way to set up quickly and efficiently, if a step goes wrong it is best to continue manually rather then re-executing the file, for those with GUI, you can just double click the sh file, this does include the prebuilts from CM, you cann a step by using the && command or create multiple scripts to run one after the other to do a separate job. This does require default branches on github to be the ones you are going to be using. The one i use as an example for carbon is as follows

echo "Setting up Kernel, Vendor, and Device ready to build Carbon Rom"

mkdir -p kernel/lge && cd kernel/lge && git clone https://github.com/P880-dev/android_kernel_lge_x3.git x3 && cd ~/carbon/vendor && git clone https://github.com/P880-dev/proprietary_vendor_lge.git lge && cd ~/carbon/device && mkdir lge && cd lge && git clone https://github.com/Fluoxetine/android_device_lge_p880.git p880 && cd ~/carbon && . build/envsetup.sh && lunch p880 && make carbon -j30 && cd out/target/product/p880/