post your build scripts - myTouch 3G, Magic Android Development

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!

Related

[9001] Kernel - Extracting initrd.img from zImage and package again

Disclaimer: Do only use this information if you know what you're doing!
PATH=$PATH:/home/markus/android/sdk/platform-tools
Get kernel from phone:
adb shell
su
dd if=/dev/block/mmcblk0p8 of=/sdcard/external_sd/stockboot.img
Exit adb shell
adb pull /sdcard/external_sd/stockboot.img
Separate the zImage from the ramdisk (see below for abootimg):
abootimg -x stockboot.img
unpacks the archive and copies contents to working directory:
gunzip -c initrd.img | cpio -i
Do your edits, e.g. default.prop, add:
debug.performance.tuning=1
video.accelerate.hw=1
windowsmgr.max_events_per_sec=150
--> move all files to new folder, cd into this folder:
repacks files from working directory into an archive (MAKE SURE NO OTHER FILES ARE IN THE WORKING DIRECTORY!!)
find . | cpio -o -H newc | gzip > ../myinitrd.img
New boot.img:
./mkbootimg --kernel zImage --ramdisk myinitrd.img --cmdline "console=null androidboot.hardware=qcom androidboot.emmc=true hw=6" -o myBuiltBoot.img --base 0x00400000 --pagesize 4096
You can also use abootimg to create your new .img file, it has an easier syntax as it exports the commandline to a .cfg file and you can use that while creating the package.
Push your new kernel.img to the phone:
adb push myBuiltBoot.img /sdcard/external_sd/myBuiltBoot.img
Write kernel to kernel-partition in phone:
adb shell
su
dd if=/sdcard/external_sd/myBuiltBoot.img of=/dev/block/mmcblk0p8
adb reboot
< pray >
Sources:
http://forums.androidcentral.com/lg...ense-back-up-your-phone-without-nandroid.html
http://forum.xda-developers.com/showthread.php?t=1227269
http://forum.xda-developers.com/showthread.php?t=1292557
Also quite handy: http://packages.debian.org/de/sid/abootimg
wouldnt just editing build.prop in /system without touching kernel do the same job? ^_^
Yep. I just wanted to describe the whole process of extracting and packing the needed files. The edit was just an example. And in fact, i made a typo, it's called default.prop.

[Q] Build Script for Tiamat 3.0.5

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?

[Q] I'm trying to boot my Nexus 10 with your linux-kvm-arm kernel version 3.13...

Hello to everyone,
I'm trying to boot my Nexus 10 with another kind of kernel version,because I'm not interested to use the Android kernel,but the Ubuntu pure kernel. I've chosen to use the linux-kvm-arm kernel version 3.13 :
These are the commands that I have used :
git clone git://github.com/virtualopensystems/linux-kvm-arm.git
cd linux-kvm-arm
git checkout origin/chromebook-3.13 -b chromebook-3.13
curl http://www.virtualopensystems.com/downloads/guides/kvm_on_chromebook/config > .config
and then I've added these lines to the .config file :
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ASHMEM=y
CONFIG_ANDROID_LOGGER=y
CONFIG_ANDROID_PERSISTENT_RAM=y
CONFIG_ANDROID_RAM_CONSOLE=y
CONFIG_ANDROID_TIMED_OUTPUT=y
CONFIG_ANDROID_TIMED_GPIO is not set
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
CONFIG_ANDROID_SWITCH is not set
CONFIG_ANDROID_INTF_ALARM is not set
CONFIG_FB_TILEBLITTING=y
CONFIG_PHONE is not set
CONFIG_USB_WPAN_HCD is not set
CONFIG_WIMAX_GDM72XX is not set
CONFIG_ARM_PLATFORM_DEVICES=y
CONFIG_ARM_CHROMEOS_FIRMWARE=y
CONFIG_CHROMEOS=y
CONFIG_CHROMEOS_VBC_BLK=y
CONFIG_CHROMEOS_VBC_EC=y
CONFIG_CHROMEOS_RAMOOPS_RAM_START=0x41f00000
CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE=0x00100000
CONFIG_CHROMEOS_RAMOOPS_RECORD_SIZE=0x00020000
CONFIG_CHROMEOS_RAMOOPS_DUMP_OOPS=0x1
CONFIG_CLKDEV_LOOKUP=y
and then I did :
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make uImage dtbs
from here I've followed the tutorial that I've found here :
http://forum.xda-developers.com/showthread.php?t=1981788
and here :
http://forum.xda-developers.com/showthread.php?t=1981788&page=2
mkdir -p newkernel
cd newkernel
wget -c https://dl.google.com/dl/android/aosp/mantaray-kot49h-factory-174ba74f.tgz
tar xvzf mantaray-kot49h-factory-174ba74f.tgz
cd mantaray-kot49h
unzip image-mantaray-kot49h.zip
wget -c http://android-serialport-api.googlecode.com/files/getramdisk.py
chmod +x getramdisk.py
./getramdisk.py boot.img --> ramdisk.img
wget -c http://android-serialport-api.googlecode.com/files/android_bootimg_tools.tar.gz
tar xvf android_bootimg_tools.tar.gz
./mkbootimg --kernel ../../linux-kvm-arm/arch/arm/boot/zImage --ramdisk ramdisk.img --cmdline bootimg.cfg -o new-boot.img
fastboot flash boot new-boot.img
I think that something is wrong here,because it is not able to boot....I see a black screen and nothing else happens...any ideas ?

TWRP recovery image with my porting kernel for Xiaomi Redmi 3S

Test only!
Don't flash to phone.
Try with "fastboot boot recovery.img".
Pure TWRP:
https://github.com/yangyangnau/andr....0.2-with-linux-3.18.20-g39aa441-for-redmi-3s
TWRP with cofface‘s patch:
https://github.com/yangyangnau/andr...face-with-linux-3.18.20-g39aa441-for-redmi-3s
Please rename to recovery.img after download.
If you want remove dm-verity, you can cook twrp yourself or look here http://en.miui.com/thread-310923-1-1.html.
I'm porting kernel for redmi 3s.
https://github.com/yangyangnau/android_kernel_xiaomi_msm8937
http://forum.xda-developers.com/redmi-3/development/port-linux-kernel-source-xiaomi-redmi3s-t3469965
get stock ROM adb root shell for kernel testing
boot.img from stock ROM.
kernel wlan.ko from your kernel.
twrp-recovery.img from TWRP.
mkboot script from https://github.com/xiaolu/mkbootimg_tools.
Code:
#!/bin/sh
[ -f boot.img ] || exit 0
[ -f kernel ] || exit 0
[ -f wlan.ko ] || exit 0
[ -f twrp-recovery.img ] || exit 0
mkboot boot.img myboot
cp -a kernel myboot/
sed -i -e '/ro.adb.secure=/s+1+0+' \
-e '/ro.secure=/s+1+0+' \
-e '/security.perf_harden=/s+1+0+' \
-e '/ro.allow.mock.location=/s+0+1+' \
-e '/ro.debuggable/s+0+1+' \
-e '/persist.sys.usb.config=/s+none+adb+' \
-e '/ro.secureboot.devicelock/s/^/#/' myboot/ramdisk/default.prop
#echo 'persist.service.adb.enable=1' >> myboot/ramdisk/default.prop
#echo 'persist.service.debuggable=1' >> myboot/ramdisk/default.prop
cat ~/.android/adbkey.pub >> myboot/ramdisk/bin/adb_keys
sed -i "/cmd_line=/s/'$/ androidboot.selinux=permissive'/" myboot/img_info
sed -i -e 's+,verify++g' \
-e 's+forceencrypt+encryptable+g' myboot/ramdisk/fstab.qcom
mkboot myboot myboot.img
fastboot flash boot myboot.img
mkboot twrp-recovery.img twrp-recovery
cp -a twrp-recovery/ramdisk/supersu/su .
fastboot boot twrp-recovery.img
sleep 10s
adb shell mount /system
adb push su /system/bin/su
adb push su /system/xbin/su
adb shell mv /system/lib/modules/wlan.ko{,-}
adb push wlan.ko /system/lib/modules/wlan.ko
adb shell mv /system/bin/install-recovery.sh{,-}
adb shell umount /system
rm -rf myboot twrp-recovery
#adb push ~/.android/adbkey.pub /data/misc/adb/adb_keys
get adb root shell
Code:
adb shell
su -
Someone had tested? Its ok?
plz port Radon kernal for redmi 3s
how to boot into recovery? is it same twrp by flour_mo
Tried to boot the both versions. It boots, but wants some password to encrypt data. TWRP I have installed can decrypt data without wanting me to enter password (and I don't know what password should it be)
Plz bring custom kernel for land # devs
Good news. We finally booted a 4.9 on land

How to edit boot.img for SM-T585?

I want to edit the boot.img for SM-T585, but I can't edit initrd.img. I'm using abootimg and I tested that it works by unpacking and repacking the boot.img without doing any thing to the initrd.img:
Code:
abootimg -x boot.img
abootimg --create newboot.img -k zImage -r initrd.img -f bootimg.cng
and this image can be flashed and the device boot normally, but when I try to modify the initrd.img:
Code:
mkdir initrd_folder && cd initrd_folder
# extract the [B]initrd.img[/B]
zcat ../initrd.img | cpio -idmv
# pack it again
find . | cpio --create --format='newc' | gzip -9 > ../newinitrd.img
From: How To Modify initrd.img
and then create the new boot.img with the new initrd.img
Code:
abootimg --create newboot.img -k zImage -r newinitrd.img -f bootimg.cfg
This new boot.img doesn't make the device boot and it only shows the Samsung logo and then reboots

Categories

Resources