20160503

open putty from CMD

C:\Users\Admin>putty -ssh android@192.168.42.129 -pw changeme

#EXTRACT

.v20160503
http://source.android.com/source/initializing.html


sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y install linux-headers-$(uname -r) build-essential dkms && sudo apt-get -y install open-vm-tool* 

gsettings set com.canonical.desktop.interface scrollbar-mode normal 


#minimal CLI / Debian / LD: 
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y install linux-headers-$(uname -r) build-essential dkms

sudo apt-get -y install coreutils mc indicator-multiload htop \
nethogs traceroute netdiag meld gparted synaptic \
p7zip-rar p7zip-full unace unrar zip unzip sharutils rar \
uudeview mpack arj cabextract file-roller lbzip2 \
gnome-disk-utility ncdu default-jre inxi \
android-tools-adb android-tools-fastboot

#minimal CLI / Debian / LD:
sudo apt-get -y install coreutils mc htop \nethogs traceroute netdiag meld gparted synaptic \
p7zip-rar p7zip-full unace unrar zip unzip sharutils \
uudeview mpack arj cabextract file-roller lbzip2 \
gnome-disk-utility ncdu default-jre inxi

wget -S -O - http://source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules

sudo apt-get -y install openjdk-6-jdk && sudo apt-get -y install openjdk-7-jdk && sudo apt-get -y install openjdk-8-jdk

sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo apt-get -y install oracle-java6-installer 

#manual YES&YES 

sudo apt-get -y install oracle-java7-installer && sudo apt-get -y install oracle-java8-installer

sudo apt-get -y autoremove && sudo apt-get -y autoclean

# cleanUP disk for VMs (Ubuntu):

sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY


#Build essentials:

sudo apt-get -y install bison build-essential curl flex g++-multilib gcc-multilib \
git-core gnupg gperf lib32ncurses5-dev libreadline-gplv2-dev \
lib32z1-dev libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk3.0-dev \
libxml2 libxml2-utils lzop make pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev \
libc6-dev-i386 x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libswitch-perl clang

#set CCACHE 

ccache -M 20G

#check

ccache -s

sudo update-java-alternatives -l
ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar

#manual set: 

sudo update-alternatives --config java
sudo update-alternatives --config javac


#============
mkdir -p ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

chmod a+x ~/bin/repo
echo "export PATH=~/bin:$PATH" >> ~/.bashrc
echo "export USE_CCACHE=1" >> ~/.bashrc

git config --global user.email ubuntu.devma@gmail.com
git config --global user.name ubuntu-devma

#check
git config --global -l

#=================
#INITS:

#4.3:
repo init -u git://codeaurora.org/platform/manifest.git -b release -m LNX.LA.3.2.1.3-12000-8x10.0.xml --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable 2>&1 >> sync.log
#----------------------------------------------------
repo init -u git://codeaurora.org/platform/manifest.git -b release -m  LNX.LA.3.5.1-09810-8x10.0.xml --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable 2>&1 >> sync.log
------------------------------------------------------

#=======

repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.2_r2.0.1 | tee -a sync.log
#----------------------------

#CM: https://github.com/CyanogenMod/android

repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0 2>&1 | tee -a sync.log 

#----------------------------
#OMNI: https://github.com/omnirom/android

repo init -u https://github.com/omnirom/android.git -b android-6.0 2>&1 | tee -a sync.log

#-----
#a minimal tree for building TWRP

https://github.com/marduk191/recovery_manifest/tree/android-5.0
#----------------------------

#miui: https://github.com/MiCode/patchrom
 
repo init -u git://github.com/MiCode/patchrom.git -b miui-7 -m android-4.4.4.xml

#check
repo list
repo info -o
git --git-dir .repo/manifests/.git/ branch -a

#SYNC:
date && date >> sync.log && ifconfig >> sync.log && /usr/bin/time -f "Total time: %E" repo sync -j8 2>&1 | tee -a sync.log && date >> sync.log && ifconfig >> sync.log && date#
#==========
#ARCHIVING:
##RAW: -m0=LZMA2 -mmt=4(move .repo in another place before!):
CURR=`basename "$PWD"`;DATE=`date +%Y%m%d`;/usr/bin/time -f "Total time: %E" 7z a -t7z -m0=LZMA2 -mmt=4 $CURR.LZMA2.mmt4.raw.$DATE.7z * 2>&1 | tee -a $CURR.LZMA2.mmt4.raw.$DATE.7z.arch.log && 7z a -t7z $CURR.LZMA2.mmt4.raw.$DATE.7z.arch.log.7z $CURR.LZMA2.mmt4.raw.$DATE.7z.arch.log sync.log && rm $CURR.LZMA2.mmt4.raw.$DATE.7z.arch.log sync.log

##4DOT.REPO only:

CURR=`basename "$PWD"`;DATE=`date +%Y%m%d`;/usr/bin/time -f "Total time: %E" 7z a -t7z -m0=Copy -mx=0 $CURR.mx0.dot.repo.$DATE.7z .repo 2>&1 | tee -a $CURR.mx0.dot.repo.$DATE.arch.log

#++++++++++++++++++++

fc -ln -1 > command.txt

#======
#EXTRACT (.repo arhive expmple):

7z x -o/home/tusty/cm-11.0 cm11.mx0.dot.repo.7z

#======
#MAKE inztallable zip (on base of stock zip):

7z a c230wCWM6051RecoveryFlasher.zip -mx=0 ./*

#================================
#RUN compiling:

source ./build/envsetup.sh

lunch

#CAF: choosecombo

#lunch omni_C230w-eng

#bootimage
RUN=`date +%m%d%H%M%S` && date && date >> make.$RUN.log && /usr/bin/time -f "Total time: %E" make -j4 bootimage 2>&1 | tee -a make.$RUN.log && date >> make.$RUN.log && date

#recoveryimage  
RUN=`date +%H%M%S` && date && date >> make.$RUN.log && /usr/bin/time -f "Total time: %E" make -j4 recoveryimage 2>&1 | tee -a make.$RUN.log && date >> make.$RUN.log && date

#with DAY date +%m%d
RUN=`date +%m%d%H%M%S` && date && date >> make.$RUN.log && /usr/bin/time -f "Total time: %E" make -j4 recoveryimage 2>&1 | tee -a make.$RUN.log && date >> make.$RUN.log && date

###--------

make clean

# =======
#EXAMPLE: vendorsetup.sh

for i in eng userdebug user; do
add_lunch_combo cm_goldfish-${i}
done
--
for i in eng userdebug user; do
add_lunch_combo full_C230w-${i}
done

=====
#EXTRACT.v20160503

#EXTRACT4 ubuntu server

server 202011 #EXTRACT4: enable the “partner” repository: https://askubuntu.com/questions/14629/how-do-i-enable-the-partner-repository sud...