Code:
FILENAME=`date +%Y.%m.%d-%H.%M.%S`
export CCOMPILER=~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
export KERN_DIR=~/mydroid/kernel
export DROID_ARCH=arm
export JCOUNT=`cat /proc/cpuinfo | grep processor | wc -l`
echo "Cleaning"
cd $KERN_DIR
make clean
echo "**Building Kernel**"
#make ARCH=$DROID_ARCH CROSS_COMPILE=$CCOMPILER -j${JCOUNT}
make ARCH=$DROID_ARCH CROSS_COMPILE=$CCOMPILER
mv $KERN_DIR/arch/arm/boot/zImage ~/droidtmp/${FILENAME}_zImage
echo "**Building WLAN**"
#make clean
cd ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32
make ARCH=$DROID_ARCH CROSS_COMPILE=$CCOMPILER KERNEL_DIR=$KERN_DIR
#mv ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko ~/droidtmp/build/system/lib/modules/wlan.ko
cp ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko ~/droidtmp/${FILENAME}_wlan.ko
echo "**Building boot.img**"
~/mydroid/out/host/linux-x86/bin/mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel ~/droidtmp/${FILENAME}_zImage --ramdisk ~/droidtmp/ramdisk-new.gz -o ~/droidtmp/${FILENAME}_boot.img
#echo "**Adding boot.img to base**"
#TODO
#echo "**Signing zip**"
#TODO
Code:
#!/bin/sh
export KERNEL_DIR=/home/chris/cm-kernel
export TOOLCHAIN=/home/chris/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
cd $KERNEL_DIR
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN
echo ---Finished building kernel!
rm -r out/*
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN INSTALL_MOD_PATH=./out/modules/ modules_install
echo ---Finished building modules tree!
cd out/modules
mksquashfs . ../modules.sqf -noappend
cd ../../
echo ---Finished building module squish!
cd ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN KERNEL_DIR=$KERNEL_DIR
echo ---Finished building wlan.ko!
cd ~/32A
cp $KERNEL_DIR/arch/arm/boot/zImage kernel
cp $KERNEL_DIR/out/modules.sqf update/system/modules/modules.sqf
cp ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko ~/32A/update/system/lib/modules/wlan.ko
/home/chris/bin/mkbootimg --cmdline "no_console_suspend=1 console=null" --kernel kernel --ramdisk ramdisk -o boot.img
echo ---Finished making boot image!
echo ---Preparing flashable update
cp boot.img update/
cd update
rm *.zip
zip -r update.zip boot.img system/ META-INF/
mv update.zip ../sign
echo ---Signing update
cd ../sign
java -jar signapk.jar testkey.x509.pem testkey.pk8 update.zip update_s.zip
mv update_s.zip update.zip
mv update.zip ~/32A/
echo ---Done - image is in ~/32A!
Here is what I had to do to get both JNI code and multi-touch events to live together.
NDK could not compile better than android-4 in default.properties
and SDK could not compile multi touch with less than android-5 in default.properties
Please let me know if anyone has found a cleaner way of doing this.
Code:
#
# remove installed apk
#
adb shell rm /data/app/org.giovino.*
#
# cross compile native code
#
cd ~/efb/src/umfd
make
ret=$?
echo "**** make returned "$ret
if [ $ret != 0 ]; then
echo failed
exit 1
fi
#
# compile JNI interface
#
cd ~/android/ndk
tail -1 apps/Try/project/default.properties
sed -i "s/android-5/android-4/g" apps/Try/project/default.properties
tail -1 apps/Try/project/default.properties
rm `find . -name libTry.so -print`
make APP=Try V=1
ret=$?
echo "**** make returned "$?
if [ $ret != 0 ]; then
echo failed
exit 1
fi
#
# compile apk android framework
#
cd apps/Try/project
tail -1 default.properties
sed -i "s/android-4/android-5/g" default.properties
tail -1 default.properties
ant debug
ret=$?
echo "**** ANT returned "$ret
if [ $ret != 0 ]; then
echo failed
exit 1
fi
#
# install apk application framework
#
adb install bin/Try-debug.apk
ret=$?
echo "**** adb returned "$ret
Hi,
I downloaded the Tiamat 3.0.5 for Motolora Xoom. But when building the kernel under Ubuntu 11.10 64bit, I got some error like:
make tegra_android_defconfig
make -j2
Click to expand...
Click to collapse
arch/arm/mach-tegra/board-ventana.c:36:41: fatal error: linux/usb/android_composite.h: No such file or directory
Click to expand...
Click to collapse
Shall I use some build script for this?
Thanks
Code:
#!/bin/bash
export DATE=$(date +%Y-%m-%d_%H_%M)
export AKPATH=/home/bigrushdog/repos/tiamat_projects/tiamat/anykernel
export CONFIGPATH=/arch/arm/configs
export ICSCCOMPILER=/home/bigrushdog/tiamat_aosp/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
export REPOPATH=/home/bigrushdog/repos/tiamat_projects/eos/tiamat-xoom
cd $REPOPATH
cp $REPOPATH/$CONFIGPATH/$PRODUCT_CONFIG_FILE .config
make ARCH=arm CROSS_COMPILE=$ICSCCOMPILER menuconfig
make ARCH=arm -j16 CROSS_COMPILE=$ICSCCOMPILER
if [ -e $REPOPATH/arch/arm/boot/zImage ]; then
echo "Kernel compiled successfully"
else
echo "Kernel failed to compile"
exit 1
fi
echo "Packaging Kernel Zip"
cd $AKPATH
cp -R $AKPATH $REPOPATH >/dev/null 2>&1
rm -rf $REPOPATH/anykernel/.git
rm $REPOPATH/anykernel/system/lib/modules/* >/dev/null 2>&1
rm $REPOPATH/anykernel/kernel/zImage >/dev/null 2>&1
mv $REPOPATH/anykernel $REPOPATH/out
find $REPOPATH -name "*.ko" -exec cp {} $REPOPATH/out/system/lib/modules/ \; >/dev/null 2>&1
cp $REPOPATH/arch/arm/boot/zImage $REPOPATH/out/kernel
zip -r $ZIPNAME kernel META-INF system
mv $ZIPNAME ${HOME}/repos
rm -rf $REPOPATH/out
cd ${HOME}/repos
echo "$PRODUCT built at "${HOME}/repos""
Modify accordingly for your build environment. Merry Christmas
I found many files under arch/arm/configs, I think it might be
tegra_android_defconfig or tegra_defconfig
Click to expand...
Click to collapse
Which one is for Xoom? Thanks
This is how I build the kernel.
Code:
make clean
ARCH=arm make stingray_defconfig
ARCH=arm CROSS_COMPILE=<PATH TO TOOLCHAIN> make
My Cross_compile environment variable is ~/android-dev/eos-aosp/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi
solarnz said:
This is how I build the kernel.
Code:
make clean
ARCH=arm make stingray_defconfig
ARCH=arm CROSS_COMPILE=<PATH TO TOOLCHAIN> make
My Cross_compile environment variable is ~/android-dev/eos-aosp/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi
Click to expand...
Click to collapse
Always gotta oversimplify Or do I overcomplicate?
since i'm a flashaholic and a great fan of sultan's cm13, i'm trying my hands on android rom development and i thought the first step would be to learn how to compile a rom from source and the best choice was cm13 by sultan.
i'm using google's cloud platform for vm instance and using ubuntu 14.04.
i've used @akhilnarang script (link to his github:github.com/akhilnarang/scripts ) to setup the build environment and followed these commands to build the rom.
Code:
~$ repo init -u git://github.com/CyanogenMod/android.git -b stable/cm-13.0-ZNH2K
~$ mkdir .repo/local_manifests
~$ curl https://raw.githubusercontent.com/sultanxda/android/master/bacon/cm-13.0-stable/local_manifest.xml > .repo/local_manifests/local_manifest.xml
~$ repo sync -c -j10
~$ ./patcher/patcher.sh
~$ make clobber
~$ . build/envsetup.sh
~$ lunch cm_bacon-user
~$ time mka bacon -j8
but after 1h or so the compiler spilled these errors
Code:
Package OTA: /home/arjunmanoj1995/out/target/product/bacon/cm_bacon-ota-f59d4b6456.zip
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files", line 1782, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 1674, in main
], extra_option_handler=option_handler)
File "/home/arjunmanoj1995/build/tools/releasetools/common.py", line 826, in ParseOptions
if extra_option_handler is None or not extra_option_handler(o, a):
File "./build/tools/releasetools/ota_from_target_files", line 1644, in option_handler
from backports import lzma
ImportError: No module named backports
make: *** [/home/arjunmanoj1995/out/target/product/bacon/cm_bacon-ota-f59d4b6456.zip] Error 1
make: Leaving directory `/home/arjunmanoj1995'
#### make failed to build some targets (01:07:57 (hh:mm:ss)) ####
can someone plz help me resolve this error.
baconxda said:
since i'm a flashaholic and a great fan of sultan's cm13, i'm trying my hands on android rom development and i thought the first step would be to learn how to compile a rom from source and the best choice was cm13 by sultan.
i'm using google's cloud platform for vm instance and using ubuntu 14.04.
i've used @akhilnarang script (link to his github:github.com/akhilnarang/scripts ) to setup the build environment and followed these commands to build the rom.
Code:
~$ repo init -u git://github.com/CyanogenMod/android.git -b stable/cm-13.0-ZNH2K
~$ mkdir .repo/local_manifests
~$ curl https://raw.githubusercontent.com/sultanxda/android/master/bacon/cm-13.0-stable/local_manifest.xml > .repo/local_manifests/local_manifest.xml
~$ repo sync -c -j10
~$ ./patcher/patcher.sh
~$ make clobber
~$ . build/envsetup.sh
~$ lunch cm_bacon-user
~$ time mka bacon -j8
but after 1h or so the compiler spilled these errors
Code:
Package OTA: /home/arjunmanoj1995/out/target/product/bacon/cm_bacon-ota-f59d4b6456.zip
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files", line 1782, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 1674, in main
], extra_option_handler=option_handler)
File "/home/arjunmanoj1995/build/tools/releasetools/common.py", line 826, in ParseOptions
if extra_option_handler is None or not extra_option_handler(o, a):
File "./build/tools/releasetools/ota_from_target_files", line 1644, in option_handler
from backports import lzma
ImportError: No module named backports
make: *** [/home/arjunmanoj1995/out/target/product/bacon/cm_bacon-ota-f59d4b6456.zip] Error 1
make: Leaving directory `/home/arjunmanoj1995'
#### make failed to build some targets (01:07:57 (hh:mm:ss)) ####
can someone plz help me resolve this error.
Click to expand...
Click to collapse
It seems like your missing the backports module to build certain parts of the rom. As i looked at the prepare script you used I noticed an commented piece of code in there refering exectly to your error regarding lzma backports:
Code:
#echo Cloning LZMA repo
#git clone https://github.com/peterjc/backports.lzma /tmp/backports.lzma
#cd /tmp/backports.lzma
#sudo python2 setup.py install
#python2 test/test_lzma.py
#rm -rf /tmp/backports.lzma
#echo LZMA compression for ROMs enabled
#echo "WITH_LZMA_OTA=true" >> ~/.bashrc
Running this, or running the prepare script again with this uncommented might acctualy fix your import problem
gs-crash-24-7 said:
It seems like your missing the backports module to build certain parts of the rom. As i looked at the prepare script you used I noticed an commented piece of code in there refering exectly to your error regarding lzma backports:
Code:
#echo Cloning LZMA repo
#git clone https://github.com/peterjc/backports.lzma /tmp/backports.lzma
#cd /tmp/backports.lzma
#sudo python2 setup.py install
#python2 test/test_lzma.py
#rm -rf /tmp/backports.lzma
#echo LZMA compression for ROMs enabled
#echo "WITH_LZMA_OTA=true" >> ~/.bashrc
Running this, or running the prepare script again with this uncommented might acctualy fix your import problem
Click to expand...
Click to collapse
thanks mate, i'll give this a try and report back
edit: thanks .... it worked...:good:
I can't install the backports thing... I can't use the script to setup the build environment. How did you do it @baconxda? I uncommented those lines and it says that it doesn't have the lzma.h thing.
gs-crash-24-7 said:
It seems like your missing the backports module to build certain parts of the rom. As i looked at the prepare script you used I noticed an commented piece of code in there refering exectly to your error regarding lzma backports:
Code:
#echo Cloning LZMA repo
#git clone https://github.com/peterjc/backports.lzma /tmp/backports.lzma
#cd /tmp/backports.lzma
#sudo python2 setup.py install
#python2 test/test_lzma.py
#rm -rf /tmp/backports.lzma
#echo LZMA compression for ROMs enabled
#echo "WITH_LZMA_OTA=true" >> ~/.bashrc
Running this, or running the prepare script again with this uncommented might acctualy fix your import problem
Click to expand...
Click to collapse
Cesaragus said:
I can't install the backports thing... I can't use the script to setup the build environment. How did you do it @baconxda? I uncommented those lines and it says that it doesn't have the lzma.h thing.
Click to expand...
Click to collapse
just run the script then run those commands quoted above, thats it.
@baconxda Any idea if this ROM could be built for any other device?
Has.007 said:
@baconxda Any idea if this ROM could be built for any other device?
Click to expand...
Click to collapse
only for devices supported by @Sultanxda.
Hi
I am evaluating SM-S908E_12_Opensource provided by Samsung opensource site
The parameters in the build.sh provided by the opensource configure the vendor_dlkm.img to EXT4.
However, the original firmware's vendor_dlkm.img is F2FS
Could someone advise what are the modifications need to be made in the build.sh to configure the vendor_dlkm to F2FS
The following is code snipplet of build.sh:
:
local vendor_dlkm_props_file
if [ -z "${VENDOR_DLKM_PROPS}" ]; then
vendor_dlkm_props_file="$(mktemp)"
echo -e "vendor_dlkm_fs_type=ext4\n" >> ${vendor_dlkm_props_file}
echo -e "use_dynamic_partition_size=true\n" >> ${vendor_dlkm_props_file}
echo -e "ext_mkuserimg=mkuserimg_mke2fs\n" >> ${vendor_dlkm_props_file}
echo -e "ext4_share_dup_blocks=true\n" >> ${vendor_dlkm_props_file}
else
vendor_dlkm_props_file="${VENDOR_DLKM_PROPS}"
if [[ -f "${ROOT_DIR}/${vendor_dlkm_props_file}" ]]; then
vendor_dlkm_props_file="${ROOT_DIR}/${vendor_dlkm_props_file}"
elif [[ "${vendor_dlkm_props_file}" != /* ]]; then
echo "VENDOR_DLKM_PROPS must be an absolute path or relative to ${ROOT_DIR}: ${vendor_dlkm_props_file}"
exit 1
:
:
I had tried to amending vendor_dlkm_fs_type=f2fs which end the build with the following error:
:
extra/test/mmrm_test_module.ko
========================================================
Trimming unused modules
2022-07-15 08:00:53 - build_image.py - ERROR : Failed to build /home/cara/Downloads/SM-S908E_12_Opensource/K2/Kernel/out/msm-waipio-waipio-gki/dist/vendor_dlkm.img from /home/cara/Downloads/SM-S908E_12_Opensource/K2/Kernel/out/msm-waipio-waipio-gki/staging/vendor_dlkm_staging
:
KeyError: 'partition_size'
Could someone advise what are the modifications need to be made in the build.sh to configure the vendor_dlkm to F2FS
Thanks
regards
MHC