Hello everyone.
Now I know this question has been posted before but I didn't get enough help from that so...
Let me explain what I've done...
I appreciate all of the work that the Devs have done, however, I would
love to help them.
I decided to try and build my own ROM. Unfortunately, I'm getting stuck and
am not sure how to proceed.
That is why I am here. I was hoping the wise devs here on XDA could help me
along this path I'm taking.
Here's my goal.
Build a 2.1 rom from source. No modifications at first.
Run this on an Emulator to see how it runs.
Then run it on my phone.
Here are the steps I've taken:
- Installed Ubuntu
- Installed jdk1.5
#sudo gedit /etc/apt/sources.list
-Add these lines
deb http://archive.ubuntu.com/ubuntu/ jaunty multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
-Save and exit
#sudo apt-get update
#sudo apt-get install sun-java5-jdk
#sudo update-java-alternatives -s java-1.5.0-sun
-Install the dev tools
# sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind
# cd ~
# mkdir bin
# curl xxxx://android.git.kernel.org/repo >~/bin/repo
# chmod a+x ~/bin/repo
-Get the android source
# cd ~
# mkdir mydroid
# cd mydroid
# repo init -u git://android.git.kernel.org/platform/manifest.git -b android-2.1_r2
# repo sync
-Download the samsung files from opensource.samsung.com
-Search for SGH-I897 and download the tar
# cd ~/Downloads
# mkdir samsung_files
# mv SGH-I897_OpenSource.tar.gz samsung_files/
# cd samsung_files
# tar xzvf SGH-I897_OpenSource.tar.gz
# tar xvf Platform.tar
-Merge the files together
# cd ~/Downloads/samsung_files/Captivate_eclair
# rsync -a --stats --progress dalvik/ ~/mydroid/dalvik/
# rsync -a --stats --progress external/ ~/mydroid/external/
# rsync -a --stats --progress prebuilt/ ~/mydroid/prebuilt/
# rsync -a --stats --progress vendor/ ~/mydroid/vendor/
-Modify the BoardConfig.mk
# sudo gedit ~/mydroid/build/target/board/generic/BoardConfig.mk
-Add these lines
BOARD_HAVE_BLUETOOTH := true
BT_USE_BTL_IF := true
BT_ALT_STACK := true
BRCM_BTL_INCLUDE_A2DP := true
BRCM_BT_USE_BTL_IF := true
-Compile the ROM
# cd ~/mydroid
# make update-api
# make
Now I browsed through the out directory after the Make was complete
and found some .img files:
ramdisk.img
system.img
userdata.img
userdata-qemu.img
I don't have anything for a Kernel and am confused as to how to
take these files and make a .zip that I can flash through CWM
Any direction from here would be greatly appreciated.
i.e.
How to make this run on an emulator.
How to turn this in to a .zip to flash through CWM
Also some tips on modifying the ROM would be nice
i always assumed it was some sort of magic or wizardry.....but all that **** you just said sounds pretty important, too.
Hi guys,
just shameless ripped from the jenkins build script from the wiki and adapted it to our build environment, for 1 device:
build.sh
Code:
#!/bin/bash
export USE_CCACHE=1
################# Your device here:
DEVICE=n7100
################################
cd ~/android/omni
. build/envsetup.sh
repo sync -j4
rm -rf out/target
brunch $DEVICE
make it executeable:
Code:
chmod +x build.sh
Pretty simple, but works for my private nightlies - and maybe as a cron job.
TODO / IDEAS:
Checking if build did work (exit codes? checking for if zip exists?)
Moving the flashable ZIP to a safe (public?) place
purging old builds (tmpwatch?)
check for changes before building
notify on finished builds (notify my android?)
check for changes before building
notify on finished builds (notify my android?)
cb5264 said:
Hi guys,
just shameless ripped from the jenkins build script from the wiki and adapted it to our build environment, for 1 device:
build.sh
Code:
#!/bin/bash
export USE_CCACHE=1
Click to expand...
Click to collapse
This is incomplete. It could be good enough for Jerkins™, but for your desktop rig it should be
Code:
export USE_CCACHE=1
prebuilts/misc/linux-x86/ccache/ccache -M 50G <---- whatever you can spare, I use 50Gbs
cb5264 said:
repo sync -j4
Click to expand...
Click to collapse
Also unnecessary, because the default is -j4.
Code:
repo sync
would suffice.
Keep in mind that we don't have nightlies ready yet as none of the devices are ready yet (nightly builds for us are meant to be stable) but we will have some ready soon
Sent from my SM-N900T using XDA Premium 4 mobile app
Regarding ccache, why should we need to set up the ccache size every compile?
It's a set once value...
Gesendet von meinem GT-N7100 mit Tapatalk
You dont need to. You might add a 'ccache -s' afterwards though - to see how useful ccache was for the build.
If you build OmniROM (when its ready), for yourself, you will want to cherry-pick changes from the Gerrit review, or add changes of your own, to make your build different from that on Jenkins. So it might be better not to have 'repo sync' in your script -- that will wipe out all your changes.
HippyTed said:
You dont need to. You might add a 'ccache -s' afterwards though - to see how useful ccache was for the build.
If you build OmniROM (when its ready), for yourself, you will want to cherry-pick changes from the Gerrit review, or add changes of your own, to make your build different from that on Jenkins. So it might be better not to have 'repo sync' in your script -- that will wipe out all your changes.
Click to expand...
Click to collapse
regarding ccache, as far as I know data that needs to be computed more than once but doesn't change is put into a cache so it will be generated once and then read from the cache, in that case if I delete the cache every time i lose the advantage of a cache...
regarding cherry picks, I would put the cherry picks after the repo sync command to have the best of both worlds (updated core and cherry picks)
regards
Steven
NemesisRE said:
regarding ccache, as far as I know data that needs to be computed more than once but doesn't change is put into a cache so it will be generated once and then read from the cache, in that case if I delete the cache every time i lose the advantage of a cache...
Click to expand...
Click to collapse
Check man pages for ccache - '-C' clears it, '-z' zeroes stats, '-s' shows stats.
regarding cherry picks, I would put the cherry picks after the repo sync command to have the best of both worlds (updated core and cherry picks)
Click to expand...
Click to collapse
Ok.
HippyTed said:
Check man pages for ccache - '-C' clears it, '-z' zeroes stats, '-s' shows stats.
Ok.
Click to expand...
Click to collapse
this doesn't disprove my assertion...
NemesisRE said:
this doesn't disprove my assertion...
Click to expand...
Click to collapse
True. Maybe I misunderstood your reason for making the assertion.
HippyTed said:
True. Maybe I misunderstood your reason for making the assertion.
Click to expand...
Click to collapse
I think so ^^ the reason was to say that rebuilding the cache on every run would be dumb
cb5264 said:
Hi guys,
just shameless ripped from the jenkins build script from the wiki and adapted it to our build environment, for 1 device:
build.sh
Code:
rm -rf out/target
brunch $DEVICE
Click to expand...
Click to collapse
for personal use I don't remove the /out folder but maybe once every few weeks. You're essentially doing a make clobber but leaving your out/host folder so that's good but, even so, it isn't necessary to flush out the target folder every time unless your compiling is pooping out. I suppose it depends whether you're making it a cron job in which case I'd do what you're doing.
---------- Post added at 12:16 AM ---------- Previous post was at 12:14 AM ----------
... what I do think would be nice is to set up a delta update mechanism like cyandelta so we could update on mobile data without killing our data plans.
cd omni
rm -rf out
repo sync -j 16
time brunch n7100
that's what I use
Seems I have the most Advances
Code:
#!/bin/bash
cd ~/
clear
export USE_CCACHE=1
export CCACHE_DIR=~/.ccache
prebuilts/misc/linux-x86/ccache/ccache -M 50G
DATE=$(date -u +%Y%m%d)
OMNIBUILDTODEL=`expr $DATE - 5`
DEVICE=$*
. build/envsetup.sh
rm -f out/target/product/$DEVICE/obj/KERNEL_OBJ/.version
rm -f out/target/product/$DEVICE/system/build.prop
rm -f out/target/product/$DEVICE/system/app/*.odex
rm -f out/target/product/$DEVICE/omni*.zip
rm -f out/target/product/$DEVICE/omni*.zip.md5sum
rm -f out/target/product/$DEVICE/system/framework/*.odex
brunch omni_$DEVICE-userdebug -j12
sftp {-p PORT#} {USER-NAME}@xxx.xxx.xxx.xxx << EOF
cd /var/www/mithun46/hammerhead/omni/
put out/target/product/$DEVICE/omni-4.4-$DATE-$DEVICE-HOMEMADE.zip
put out/target/product/$DEVICE/omni-4.4-$DATE-$DEVICE-HOMEMADE.zip.md5sum
rm omni-4.4-$OMNIBUILDTODEL-$DEVICE-HOMEMADE.zip
rm omni-4.4-$OMNIBUILDTODEL-$DEVICE-HOMEMADE.zip.md5sum
EOF
This:
Uses 50 gigs of ccache
Uploads to my personal server [zip+md5]
Deletes 5 days old builds and their md5sum
This is not clean builds [i clean manually] [is kinda clean though]
Is in the smallest form possible
mithun46 said:
#!/bin/{SHELL}
...
sftp {-p PORT#} {USER-NAME}@xxx.xxx.xxx.xxx
cd /var/www/{what/should/possibly/be/an/obscured/path/to}/omni/
Click to expand...
Click to collapse
You also just provided me with:
1) Verification of an operable {SHELL} compatible shell.
2) Your server's IP.
3) A good indicator that your server accepts SSH AND SFTP connections at the port {PORT#}.
4) Verification that your SSH server accepts "{USER-NAME}" logins.
5) Pretty solid evidence of, and possibly even an otherwise inaccessible path on, a web server
Please edit your post. Ive already made my post as vague as possible without failing to make my point, i hope.
Also, please consider SSH's known_hosts or at the least shell aliases/functions so you don't have to hardcode IP addresses and user-names in random shell scripts.
-Mike
* While it's possible that... EDIT: *REDACTED* no problem, Mithun. I said it for myself as much as I did you; nobody likes a botnet. Well, maybe very few like a botnet.
mithun46 said:
Code:
...
sftp {-p PORT#} {USER-NAME}@xxx.xxx.xxx.xxx << EOF
cd /var/www/mithun46/hammerhead/omni/
put out/target/product/$DEVICE/omni-4.4-$DATE-$DEVICE-HOMEMADE.zip
put out/target/product/$DEVICE/omni-4.4-$DATE-$DEVICE-HOMEMADE.zip.md5sum
rm omni-4.4-$OMNIBUILDTODEL-$DEVICE-HOMEMADE.zip
rm omni-4.4-$OMNIBUILDTODEL-$DEVICE-HOMEMADE.zip.md5sum
EOF
[/LIST]
Click to expand...
Click to collapse
That part got a disturbing 'issue' imho - it doesn't check for a build being successful. I'd work that out with an if-clause checking if the file exists...
cb5264 said:
That part got a disturbing 'issue' imho - it doesn't check for a build being successful. I'd work that out with an if-clause checking if the file exists...
Click to expand...
Click to collapse
If no file exists it shows errors while trying to upload the file in sftp
This is my try, it´s not perfect and for the most people too much... but it`s mine ^^
https://gist.github.com/NemesisRE/7518954
EDIT: Will update the gist until i think it is all ok, but the code here will stay as it is
Code:
#!/bin/bash
##################################################
#
# vim: ai ts=4 sw=4 noet sts=4 ft=sh
#
# Copyright 2013, Steven Koeberich ([email protected])
#
# Title: dinner.sh
# Author: Steven "NemesisRE" Koeberich
# Date: 20131117
# Version: 1.1
# Description: Builds Roms automatically
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License at (http://www.gnu.org/licenses/) for
# more details.
#set -e #do not enable otherwise brunch will fail
#set -x
#For compatibility set Language to en_US.UTF8 and timezone to UTC
export LANGUAGE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export TZ="/usr/share/zoneinfo/UTC"
#Make us of CCACHE
export USE_CCACHE=1
# Define global variables
REPO_DIR="${HOME}/android/omni"
MAIL_BIN=$(which mail)
LOG_DIR="${HOME}/logs"
SHOW_VERBOSE="> /dev/null 2>&1"
CONVERT_TO_HTML="| ansi2html" # install package kbtin to use this feature
#Set initial exitcodes
SYNC_REPO_EXIT_CODE="0"
GET_BREAKFAST_VARIABLES_EXIT_CODE="0"
BRUNCH_DEVICE_EXIT_CODE="0"
MOVE_BUILD_EXIT_CODE="0"
RUN_COMMAND_EXIT_CODE="0"
CLEAN_OLD_BUILDS_EXIT_CODE="0"
SEND_MAIL_EXIT_CODE="0"
# This variables can be overwritten by command line parameters
MAIL='' # set this if you want always an email
ADMIN_MAIL='' # set this if you want always an email (with logs)
TARGET_DIR='' # set this if you want always move your build to the given directorie
CLEANUP_OLDER_THEN="" # set this if you want always automatic cleanup
DOWNLOAD_LINK='' # set this if you want always a download link
RUN_COMMAND='' # set this if you want always run a command after a build was successful
BUILD_FOR_DEVICE="" # set this if you want always build for the given device/s
#Source envsetup
. ${REPO_DIR}/build/envsetup.sh > /dev/null 2>&1
######################
#
# function _usage
#
#
function _usage() {
echo $"Usage: ${0} [-n \"[email protected]\"] [-t \'/var/www/awsome-download-dir\'] [-r \'scp \$\{OUTPUT_FILE\} example.com:\' ][-l \"http://example.com/download/omnirom\"] [-c 7] [-v] [-- i9300 mako ]"
cat<<EOF
Options:
-n Send notification to given Mail-Adress
-t Move files into given Directorie
-r Run command on successful build
-l If you choose a target dir you may want put
a download link into the mail message
-c Cleanup builds older then N days
-v Verbose Output
-h See this Message
EOF
}
function _e_notice () {
echo -e "NOTICE: ${1}"
}
function _e_warning () {
echo -e "WARNING:Something went wrong ${1} (${2})"
}
function _e_error () {
echo -e "ERROR: ${1}"
}
function _check_prerequisites () {
if [ ! -x $(which ansi2html) ]; then
CONVERT_TO_HTML=""
fi
if [ ${TARGET_DIR} ]; then
TARGET_DIR=$(echo "${TARGET_DIR}"|sed 's/\/$//g')
fi
if [ ${LOG_DIR} ]; then
LOG_DIR=$(echo "${LOG_DIR}"|sed 's/\/$//g')
fi
if [ -z ${BUILD_FOR_DEVICE} ]; then
echo "ERROR: No Device given! Stopping..."
_usage
exit 1
fi
if [ ! -d ${LOG_DIR} ]; then
mkdir -p ${LOG_DIR}
fi
}
function _sync_repo () {
_e_notice "Running repo sync..."
eval "repo sync ${SHOW_VERBOSE}"
SYNC_REPO_EXIT_CODE=$?
if [ ${SYNC_REPO_EXIT_CODE} != 0 ]; then
_e_warning "while doing repo sync" "${SYNC_REPO_EXIT_CODE}"
fi
}
function _get_breakfast_variables () {
for VARIABLE in `breakfast ${DEVICE} | sed -e 's/^=.*//' -e 's/[ ^I]*$//' -e '/^$/ d'`; do
eval ${VARIABLE}
done
GET_BREAKFAST_VARIABLES_EXIT_CODE=$?
if [ ${GET_BREAKFAST_VARIABLES_EXIT_CODE} != 0 ]; then
_e_warning "while getting breakfast variables" "${GET_BREAKFAST_VARIABLES_EXIT_CODE}"
fi
}
function _brunch_device () {
_e_notice "Running brunch for ${DEVICE} with version ${PLATFORM_VERSION} ..."
eval "brunch ${DEVICE} 2>&1 | tee ${LOG_DIR}/brunch_${DEVICE}.log ${SHOW_VERBOSE}"
BRUNCH_DEVICE_EXIT_CODE=$?
BRUNCH_RUN_TIME=$(tail ${LOG_DIR}/brunch_${DEVICE}.log | grep "real" | awk '{print $2}')
if [ ${BRUNCH_DEVICE_EXIT_CODE} != 0 ]; then
_e_warning "while brunch the ${DEVICE}, see logfile for more information" "${BRUNCH_DEVICE_EXIT_CODE}"
fi
}
function _move_build () {
_e_notice "Moving files to target directory..."
mv ${OUTPUT_FILE}* ${TARGET_DIR}/
MOVE_BUILD_EXIT_CODE=$?
if [ ${MOVE_BUILD_EXIT_CODE} != 0 ]; then
_e_warning "while moving the build" "${MOVE_BUILD_EXIT_CODE}"
fi
}
function _run_command () {
_e_notice "Run command..."
eval ${RUN_COMMAND}
RUN_COMMAND_EXIT_CODE=$?
if [ ${RUN_COMMAND_EXIT_CODE} != 0 ]; then
_e_warning "while running your command" "${RUN_COMMAND_EXIT_CODE}"
fi
}
function _clean_old_builds () {
_e_notice "Running cleanup of old builds..."
if [ ${TARGET_DIR} ]; then
CLEANED_FILES=$(find ${TARGET_DIR}/ -name "omni-${PLATFORM_VERSION}-*-${DEVICE}-HOMEMADE.zip*" -type f -mtime +${CLEANUP_OLDER_THEN}d -delete)
else
CLEANED_FILES=$(find `dirname ${OUTPUT_FILE}` -name "omni-${PLATFORM_VERSION}-*-${DEVICE}-HOMEMADE.zip*" -type f -mtime +${CLEANUP_OLDER_THEN}d -delete)
fi
CLEAN_OLD_BUILDS_EXIT_CODE=$?
if [ ! ${CLEANED_FILES} ]; then
CLEANED_FILES="Nothing to clean up."
fi
_e_notice "${CLEANED_FILES}"
if [ ${CLEAN_OLD_BUILDS_EXIT_CODE} != 0 ]; then
_e_warning "while cleaning builds" "${CLEAN_OLD_BUILDS_EXIT_CODE}"
fi
}
function _send_mail () {
_e_notice "Sending status mail..."
MAIL_MESSAGE="Build Status:\n\n"
ADMIN_MAIL_MESSAGE=""
if ${BUILD_SUCCESSFUL}; then
MAIL_MESSAGE+="Build for ${DEVICE} was successfull finished after ${BRUNCH_RUN_TIME}\n"
if [ ${DOWNLOAD_LINK} ]; then
MAIL_MESSAGE+="You can download your Build at ${DOWNLOAD_LINK}\n\n"
fi
if [ ${CLEANED_FILES} ]; then
ADMIN_MAIL_MESSAGE+="Removed the following files:\n"
ADMIN_MAIL_MESSAGE+=${CLEANED_FILES}
fi
else
MAIL_MESSAGE+="Build was not successfull ran ${BRUNCH_RUN_TIME}.\n\n"
ADMIN_MAIL_MESSAGE+="Logfile:"
ADMIN_MAIL_MESSAGE+=$(cat ${HOME}/brunch_${DEVICE}.log ${CONVERT_TO_HTML})
fi
if [ ${MAIL} ]; then
echo -e "${MAIL_MESSAGE}" | ${MAIL_BIN} -s "Finished dinner." "${MAIL}"
fi
if [ ${ADMIN_MAIL} ]; then
echo -e "${MAIL_MESSAGE}${ADMIN_MAIL_MESSAGE}" | ${MAIL_BIN} -s "Finished dinner." "${ADMIN_MAIL}"
fi
SEND_MAIL_EXIT_CODE=$?
if [ ${SEND_MAIL_EXIT_CODE} != 0 ]; then
_e_warning "while sending E-Mail" "${SEND_MAIL_EXIT_CODE}"
fi
}
function _check_build () {
OUT_FILE_SECONDS_SINCE_CREATION=$(/bin/date -d "now - $( /usr/bin/stat -c "%Y" ${OUTPUT_FILE} ) seconds" +%s)
if [ -f ${OUTPUT_FILE} ] && [ "${OUT_FILE_SECONDS_SINCE_CREATION}" -lt "120" ] ; then
BUILD_SUCCESSFUL=true
else
BUILD_SUCCESSFUL=false
fi
}
######################
#
# function _main
#
#
function _main() {
_check_prerequisites
cd ${REPO_DIR}
_sync_repo
for DEVICE in ${BUILD_FOR_DEVICE}; do
_get_breakfast_variables
_brunch_device
OUTPUT_FILE="${OUT_DIR}/target/product/${DEVICE}/omni-${PLATFORM_VERSION}-$(date +%Y%m%d)-${DEVICE}-HOMEMADE.zip"
_check_build
if ${BUILD_SUCCESSFUL} && [ ${TARGET_DIR} ]; then
eval TARGET_DIR=${TARGET_DIR}
_move_build
fi
if ${BUILD_SUCCESSFUL} && [ ${CLEANUP_OLDER_THEN} ]; then
_clean_old_builds
fi
if [ ${MAIL} ] || [ ${ADMIN_MAIL} ]; then
eval MAIL=${MAIL}
eval ADMIN_MAIL=${ADMIN_MAIL}
_send_mail
fi
done
OVERALL_EXIT_CODE=$((${SYNC_REPO_EXIT_CODE}+${GET_BREAKFAST_VARIABLES_EXIT_CODE}+${BRUNCH_DEVICE_EXIT_CODE}+${MOVE_BUILD_EXIT_CODE}+${CLEAN_OLD_BUILDS_EXIT_CODE}+${SEND_MAIL_EXIT_CODE}))
if ! ${BUILD_SUCCESSFUL} && [ ${OVERALL_EXIT_CODE} -gt 0 ]; then
_e_warning "buildcheck failed and Overall exit code is higher then 0 will exit with 1" "${OVERALL_EXIT_CODE}"
exit 1
elif ${BUILD_SUCCESSFUL} && [ ${OVERALL_EXIT_CODE} -gt 0 ]; then
_e_warning "buildcheck was successful but Overall exit code is higher then 0 will exit with 1" "${OVERALL_EXIT_CODE}"
exit 1
else
_e_notice "All jobs finished successfully."
fi
}
## Parameter handling
while getopts ":n:t:l:c:vh" opt; do
case ${opt} in
"n")
MAIL='${OPTARG}'
;;
"t")
TARGET_DIR='${OPTARG}'
;;
"r")
RUN_COMMAND='${OPTARG}'
;;
"l")
DOWNLOAD_LINK='${OPTARG}'
;;
"c")
CLEANUP_OLDER_THEN="${OPTARG}"
;;
"v")
SHOW_VERBOSE=""
;;
"h")
_usage
exit 0
;;
\?)
echo "Invalid option: -${OPTARG}"
_usage
exit 1
;;
:)
echo "Option -${OPTARG} requires an argument."
_usage
exit 1
;;
esac
done
shift $((${OPTIND}-1))
if [ ${@} ]; then
BUILD_FOR_DEVICE=${@}
fi
_main
exit 0
Cheers
Steven
No more gist
The script is now called Dinner, more information at http://forum.xda-developers.com/showthread.php?t=2690995
First let me give you some background information before we start. I know there are guides out there but I found them all to be incomplete either missing a step here or there that is why I am posting this guide. After a lot of trial and error I tried to make the process as simple as it can be. This guide is for Ubuntu 14.04 64bit Desktop or Server version. This guide might work on other distros but I cannot guarantee it. This guide is designed to build the AOSP rom from Google source jellybean to lollipop. I highly recommend doing this on a remote server, like a vps or dedicated box. This guide is for root users if your not root then you may need to use "sudo" on many of the commands.
## Disclaimer I am not responsible for anything that happens to your device this is a guide only. I am not a master developer or linux guru if you have questions I will try to answer them best I can. ##
Most important command if your on a remote machine this will keep the process going if you get disconnected.
screen
## Establishing a Build Environment ##
# Java Install
apt-get update
apt-get upgrade (upgrades all the packages installed on system that have updates)
apt-get install openjdk-7-jdk (Lollipop)
apt-get install openjdk-6-jdk (KitKat or older)
# Optionally, update the default Java version by running:
update-alternatives --config java
update-alternatives --config javac
# Check if JAVA is Installed
java -version
# You should see something like this depending on the version you installed.
java version "1.7.0_91"
OpenJDK Runtime Environment (IcedTea 2.6.3) (7u91-2.6.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
# Installing required packages
apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip python-networkx libswitch-perl schedtool
## Downloading the Source ##
# To install Repo:
Make sure you have a bin/ directory in your home directory and that it is included in your path:
mkdir ~/bin
PATH=~/bin:$PATH
# Download the Repo tool and ensure that it is executable:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
# Initializing a Repo client
# After installing Repo, set up your client to access the Android source repository:
# Create an empty directory to hold your working files. Give it any name you like:
mkdir WORK
cd WORK
git config --global user.email "useyourrealemail"
git config --global user.name "usearealname"
repo init -u https://android.googlesource.com/platform/manifest
To check out a branch other than "master", specify it with -b. For a list of branches, see Source Code Tags and Builds.
repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r1 ( To build only Lollipop. I suggest this option for most)
## Downloading the Android Source Tree ##
# To pull down the Android source tree to your working directory from the repositories as specified in the default manifest, run
repo sync -j4
# The Android source files will be located in your working directory under their project names. This takes anywhere from 15 minutes to a few hours depending on your internet connection. (Thats why I recommend building on a remote machine)
## Binaries ##
# Extracting the proprietary binaries
# Each set of binaries comes as a self-extracting script in a compressed archive. After uncompressing each archive, run the included self-extracting script from the root of the source tree, confirm that you agree to the terms of the enclosed license agreement, and the binaries and their matching makefiles will get installed in the vendor/ hierarchy of the source tree.
https://developers.google.com/android/nexus/drivers
# Nexus 7 (Wi-Fi) binaries for Android 4.1.2
Code:
wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-jzo54k-26240daf.tgz && wget -c wget -c https://dl.google.com/dl/android/aosp/elan-grouper-jzo54k-c889b8f4.tgz && wget -c wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-jzo54k-aae1cd0c.tgz && wget -c wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-jzo54k-56de148f.tgz && wget -c wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-jzo54k-4bfb1fb6.tgz && wget -c wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-jzo54k-aca0e725.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.2/4.2.1
Code:
wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-jop40c-1bf6a3d7.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-jop40c-3c485b17.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-jop40c-9f366366.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-jop40c-1a641dd0.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-jop40c-e072af0d.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-jop40c-ef747ec3.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.2.2
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-jdq39-b6907aa5.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-jdq39-4a9b93a2.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-jdq39-82c8d127.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-jdq39-28df082f.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-jdq39-738059f9.tgz && wget -c ]https://dl.google.com/dl/android/aosp/nxp-grouper-jdq39-28a5fe9a.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-jdq39-73fc49a2.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.3
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-jwr66y-d9ad928d.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-jwr66y-af694cc9.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-jwr66y-2ece01e1.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-jwr66y-f21f0c49.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-jwr66y-b3b0003e.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-jwr66y-f5d295e4.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-jwr66y-a0b9cafc.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.4
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-krt16s-286ffbbf.tgz&& wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-krt16s-2461febe.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-krt16s-4b37aa74.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-krt16s-d5bdd039.tgz&& wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-krt16s-2e8efaff.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-krt16s-fe4b53e1.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-krt16s-68751697.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.4.2
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-kot49h-2567c00c.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-kot49h-45c0c43a.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-kot49h-d3cda89d.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-kot49h-2f4def27.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-kot49h-73d2765c.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-kot49h-6d4f389b.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-kot49h-51d2ed4b.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.4.3
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-ktu84l-8dde86d9.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-ktu84l-079650ef.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-ktu84l-caa1c219.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-ktu84l-fae837a0.tgz&& wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-ktu84l-22d95d44.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-ktu84l-ece658d1.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-ktu84l-f3760dae.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 4.4.4
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-ktu84p-b12ce5f7.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-ktu84p-646d5a68.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-ktu84p-742223b3.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-ktu84p-724c855a.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-ktu84p-e6d581dc.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-ktu84p-27abae08.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-ktu84p-57b01f77.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 5.0
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-lrx21p-896ccd01.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-lrx21p-1220d525.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-lrx21p-a53f697e.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-lrx21p-4a1a3ab1.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-lrx21p-c4905f19.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-lrx21p-d0465c3c.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-lrx21p-78877346.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 5.0.2
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-lrx22g-aec33ad2.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-lrx22g-c7f54ba9.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-lrx22g-580da07a.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-lrx22g-fd3690aa.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-lrx22g-1d3281e3.tgz && wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-lrx22g-93aec176.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-lrx22g-179aea10.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 5.1.0
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-1743759-83e8c08c.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-1743759-48f4fdc9.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-1743759-9f5eb659.tgz && wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-1743759-744cc938.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-1743759-a1088a38.tgz&& wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-1743759-1d7e8bba.tgz && wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-1743759-d6f899eb.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Nexus 7 (Wi-Fi) binaries for Android 5.1.1
Code:
wget -c https://dl.google.com/dl/android/aosp/asus-grouper-lmy47v-f395a331.tgz && wget -c https://dl.google.com/dl/android/aosp/broadcom-grouper-lmy47v-5671ab27.tgz && wget -c https://dl.google.com/dl/android/aosp/elan-grouper-lmy47v-6a10e8f3.tgz&& wget -c https://dl.google.com/dl/android/aosp/invensense-grouper-lmy47v-ccd43018.tgz && wget -c https://dl.google.com/dl/android/aosp/nvidia-grouper-lmy47v-c9005750.tgz&& wget -c https://dl.google.com/dl/android/aosp/nxp-grouper-lmy47v-18820f9b.tgz&& wget -c https://dl.google.com/dl/android/aosp/widevine-grouper-lmy47v-e570494f.tgz
for f in *.tgz; do tar xzf $f; done
for extractor_script in *.sh; do bash $extractor_script; done
Please ACCEPT each one by typing I ACCEPT
# Now that is done you should of seen several files being extracted in certain directories.
source build/envsetup.sh
lunch (Pick the grouper-userdebug}
#To make a Fastboot flash image
make -j4
# If you get the following error on make
************************************************************
You are attempting to build with an unsupported JDK.
You use OpenJDK but only Sun/Oracle JDK is supported.
Please follow the machine setup instructions at
************************************************************
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java7-installer (Lollipop)
apt-get install oracle-java6-installer (KitKat or older)
update-alternatives --config java
The rerun command (make -j4)
#Flashable Zip
make -j4 otapackage
# If you get the following error on make
************************************************************
You are attempting to build with an unsupported JDK.
You use OpenJDK but only Sun/Oracle JDK is supported.
Please follow the machine setup instructions at
************************************************************
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java7-installer (Lollipop)
apt-get install oracle-java6-installer (KitKat or older)
update-alternatives --config java
The rerun command (make -j4 otapackage)
CREDITS and THANKS to:
AOSP/Google and Google Search
reserved for future use
another one
can i build cyanogenmod 13 using this method? im a total noob but i want to make a rom D;
---------- Post added at 12:20 PM ---------- Previous post was at 12:12 PM ----------
also, when you say that this guide is for rooted user, do you mean that the phone has to be rooted? (again im a noob xD)
supertiger1234 said:
can i build cyanogenmod 13 using this method? im a total noob but i want to make a rom D;
---------- Post added at 12:20 PM ---------- Previous post was at 12:12 PM ----------
also, when you say that this guide is for rooted user, do you mean that the phone has to be rooted? (again im a noob xD)
Click to expand...
Click to collapse
I would not recommend this guide for anything above lollipop.
ezbncs said:
I would not recommend this guide for anything above lollipop.
Click to expand...
Click to collapse
ah okay. is there any other guide to port cm 13? i cant find it anywhare.
supertiger1234 said:
ah okay. is there any other guide to port cm 13? i cant find it anywhare.
Click to expand...
Click to collapse
Im not sure you will have to search the forums or google.
AOSP built just fine for me with OpenJDK... and Google's documentation page seems to say OpenJDK is the right JDK for building under Ubuntu. So the build script seems to be incorrect. I got past the error you reported by tweaking the check.
In build/core/main.mk line 195 (the line which ends with "grep -i openjdk),)") I changed "ifneq" to "ifeq" and then it built fine for me. Probably not the right change, but it let me proceed. I was building aosp6 on Ubuntu 15.10 with java-8-openjdk-64.
aaopt said:
AOSP built just fine for me with OpenJDK... and Google's documentation page seems to say OpenJDK is the right JDK for building under Ubuntu. So the build script seems to be incorrect. I got past the error you reported by tweaking the check.
In build/core/main.mk line 195 (the line which ends with "grep -i openjdk),)") I changed "ifneq" to "ifeq" and then it built fine for me. Probably not the right change, but it let me proceed. I was building aosp6 on Ubuntu 15.10 with java-8-openjdk-64.
Click to expand...
Click to collapse
I mainly got the error when building diffrent versions of 4.1.2 to 4.4.4. I never got the error when doing lollipop so I included the oracle fix just to be safe incase others incounter the same problem. Thank you for the possible fix I will be testing it out soon.
Hello guys,
I need some help here, I want to add Ethernet driver to my XSP, but I don't know what to do
Currently my XSP ROM is AICP (still on old version, Lollipop), with Helium kernel
I already built the asix.ko module, using this guide, and DooMLoRD' Android Toolchain
When I tried to "insmod asix.ko" on my XSP terminal, it returns error
Code:
init_module failed (Exec format error)
And this is my makefile on ASIX driver
Code:
CURRENT = $(shell uname -r)
TARGET = asix
OBJS = asix.o
MDIR = drivers/net/usb
KDIR = /home/smankusors/Projects/XSP_ASIX_Driver/helium_kernel
SUBLEVEL= $(shell uname -r | cut -d '.' -f 3 | cut -d '.' -f 1 | cut -d '-' -f 1 | cut -d '_' -f 1)
ifneq (,$(filter $(SUBLEVEL),14 15 16 17 18 19 20 21))
MDIR = drivers/usb/net
endif
EXTRA_CFLAGS = -DEXPORT_SYMTAB
PWD = $(shell pwd)
DEST = /lib/modules/$(CURRENT)/kernel/$(MDIR)
obj-m := $(TARGET).o
default:
make ARCH=arm CROSS_COMPILE=/home/smankusors/Projects/XSP_ASIX_Driver/android_prebuilt_toolchains/arm-linux-androideabi-4.7/bin/arm-linux-androideabi- -C $(KDIR) SUBDIRS=$(PWD) modules
$(TARGET).o: $(OBJS)
$(LD) $(LD_RFLAG) -r -o [email protected] $(OBJS)
install:
su -c "cp -v $(TARGET).ko $(DEST) && /sbin/depmod -a"
clean:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
.PHONY: modules clean
-include $(KDIR)/Rules.make
What I exactly do :
1. Download the android prebuilt toolchains, kernel sourcecode, asix sourcecode
2. Modify the makefile from ASIX sourcecode
3. Make from it
4. Flash to my XSP along with the helium kernel
5. Error.
Is there anything wrong? :crying:
Bash:
git config --global your_acc
git config --global [email protected]
#git clone https://github.com/android-rpi/local_manifests
git clone https://github.com/android-rpi/local_manifests .repo/local_manifests -b arpi-12
~/bin/repo init -u https://android.googlesource.com/platform/manifest # Download Android source with local_manifests # Refer to http://source.android.com/source/downloading.html
repo init -u https://android.googlesource.com/platform/manifest -b android-s-beta-2
repo sync
repo sync --force-sync frameworks/av # overwriting
repo sync --force-sync external/mesa3d # dito
lunch # choose some device such as a raspberry Pi
# tapas # tool
m # build Android now
now watch those eerie error messages...
backlink
#### failed to build some targets (39 seconds) ####