|
|
|
Re: How To Compile Your Own Kernels, Modules, Tinboot (NAND boot), and More for Begin
Hey, natemcnutty
Need modify fullbuild.sh to fix this: Code:
./fullbuild.sh: 38: Syntax error: "fi" unexpected (expecting "then") Code:
36 if [ ! -d $ANDROID/androidupdate/data/modules 37 mkdir -p $ANDROID/androidupdate/data/modules 38 fi Code:
36 if [ ! -d $ANDROID/androidupdate/data/modules ]; then 37 mkdir -p $ANDROID/androidupdate/data/modules 38 fi Code:
39 if [ ! -d $ANDROID/androidupdate/system ]; then 40 mkdir -p $ANDROID/androidupdate/system 41 fi Code:
#!/bin/sh
#-------------------------------------------------------------------------
# Build Script for linux-msm-rhod-nand (Android on HTC) kernel, modules, XIP, and NBH
#-------------------------------------------------------------------------
#
# Set the following variables
# ANDROID -- Root director for Android files
ANDROID=~/android
# TINBOOT -- tinboot directory
TINBOOT=$ANDROID/tinboot-linux-msm
# KERNEL_PATH -- directory containing the linux-msm kernel source
KERNEL_PATH=$ANDROID/linux-msm-rhod-nand
# TOOLCHAIN_PATH -- directory containing the arm toolchain
TOOLCHAIN_PATH=$ANDROID/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi
# MODULES_PATH -- directory for modules
MODULES_PATH=$TINBOOT/modules
#-------------------------------------------------------------------------
# do some cleanup before building if zImage already exists
echo "Removing previous zImage"
if [ -f $TINBOOT/kernel/zImage ] ; then
rm $TINBOOT/kernel/zImage
fi
# build kernel and modules
#export ARCH=arm
cd $KERNEL_PATH
make clean
make ARCH=arm htc_msm_nand_defconfig
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN_PATH- INSTALL_MOD_PATH=$MODULES_PATH zImage modules modules_install
[ $? -eq 0 ] || fail "Kernel compilation failure"
# copy all drivers to single level directory for compression
cd $MODULES_PATH
KERNMODS=$(find -name "*.ko")
if [ ! -d $ANDROID/androidupdate/data/modules ]; then
mkdir -p $ANDROID/androidupdate/data/modules
fi
if [ ! -d $ANDROID/androidupdate/system ]; then
mkdir -p $ANDROID/androidupdate/system
fi
for i in $KERNMODS ; do
cp $i $ANDROID/androidupdate/data/modules
done
# compress modules to a tar.gz and move to output
echo "Outputting modules to Desktop"
cd $ANDROID/androidupdate
tar cvzf $ANDROID/androidupdate.tgz data system
rm -rf $ANDROID/androidupdate/data/modules
mkdir $ANDROID/androidupdate/data/modules
# clean up modules
rm -Rf $MODULES_PATH
mkdir $MODULES_PATH
rm -Rf $KERNEL_PATH/lib/modules
# move new kernel
mv $KERNEL_PATH/arch/arm/boot/zImage $TINBOOT/kernel
#-----start build XIP-----
# remove old XIP if it exists
cd $TINBOOT
if [ -f xip/rhod ]; then
rm xip/rhod
echo Deleting old XIP
fi
# make XIP folder if it does not exist
if [ ! -d "$TINBOOT/xip" ] ; then
mkdir $TINBOOT/xip
fi
# compile tinboot XIP
echo "Start compiling tinboot/xip for rhod....."
$TOOLCHAIN_PATH-as tinboot/tinboot2.S -o tinboot.o --defsym rhod=1 --defsym MTYPE=2292
$TOOLCHAIN_PATH-objcopy tinboot.o -O binary tinbootxip
mv tinbootxip xip/rhod
# cleanup tinboot
rm tinboot.o
# make sure XIP build was successful
if [ ! -f xip/rhod ] ; then
fail "XIP build failed. XIP file was not found."
fi
#-----start build NBH-----
# clean up previous log file
if [ -e "tools/log" ]; then
rm tools/log
fi
# compile tinboot
cp tools/rhod_payload2 os.nb.payload
echo "Inserting tinboot into payload"
wine tools/osnbtool -c os.nb.payload 1 xip/rhod >> tools/log
mv os.nb.payload.NEW os.nb.payload >> tools/log
echo "Inserting blank imgfs into payload"
wine tools/ImgfsToNb.exe tools/imgfs.bin os.nb.payload os-new.nb.payload >> tools/log
echo "Creating os.nb portion of nbh"
tools/nbmerge < os-new.nb.payload > os-new.nb
echo "Creating NBH"
wine tools/yang.exe -F RHODIMG.NBH -f os-new.nb -t 0x400 -s 64 -d RHOD****0 -c 11111111 -v Tinboot -l WWE >> tools/log
# clean up payloads
mv RHODIMG.NBH $ANDROID/RHODIMG.NBH
rm os.nb.payload
rm os-new.nb.payload
rm os-new.nb
# clean up tinboot directory
rm -rf xip
Best regard! Uoc Nguyen
__________________
No money, no honey!
--- Motoroi XT720 - MIUI 1.10.21-t2w - [OC 1Ghz very fast & smooth] - CM-7.1.0-11.10.12-ODEX-XT720-J.Y.Daddy |
|
||||
|
Re: How To Compile Your Own Kernels, Modules, Tinboot (NAND boot), and More for Begin
got compile working after glancing through tigers last post and noticing i was trying to makenbh with rhod_payload, not 2....
__________________
Rockin' The Official TouchPro 2 aka "The dopest phone with keyboard still":
F**k windows mobile, NAND flash to droid.... Last edited by MassStash; 03-20-2011 at 11:07 PM. |
|
||||
|
Re: How To Compile Your Own Kernels, Modules, Tinboot (NAND boot), and More for Begin
Yeah, sorry, Tinboot is definitely not very friendly in its current state. My script should have the right stuff in it though.
|
|
||||
|
Re: How To Compile Your Own Kernels, Modules, Tinboot (NAND boot), and More for Begin
Hey there, I was fun fullbuild script successfully but still got "not found rootfs", any suggestion? Am I missing something or something go wrong?
-- Best regard! Uoc Nguyen |
|
||||
|
Re: How To Compile Your Own Kernels, Modules, Tinboot (NAND boot), and More for Begin
Quote:
We no longer use rootfs on NAND. That is a Haret only thing now. |
| This post has been thanked 1 times. |
|
||||
|
Re: How To Compile Your Own Kernels, Modules, Tinboot (NAND boot), and More for Begin
Yeah, I already clone the bootenv repo, I think issue come from not clean build then my image still using old initrd from Haret. That thing caused it always lookup rootfs somewhere like Haret way
-- Best regard! Uoc Nguyen |
|
||||
|
Re: How To Compile Your Own Kernels, Modules, Tinboot (NAND boot), and More for Begin
OK, there are a few new changes that we are making, and I'm working on updating the scripts again. For NAND, we are now compressing the modules into a Squash file system and putting that under /system/lib/modules/'uname'.sqsh. For this, we need to install squashfs-tools and make a few minor adjustments to the script
Edit: And apparently we have to use a specific version of squashfs-tools, so v4 that installs through apt-get install squashfs-tools will not work. I'll have more details later. Last edited by natemcnutty; 03-28-2011 at 08:59 PM. |
|
||||
|
Re: How To Compile Your Own Kernels, Modules, Tinboot (NAND boot), and More for Begin
thought i used 3.4 squash properly, but perhaps not. anyone tell me what i'm doing wrong if i still get no modules directory? i my squash, or the init? i put the sqsh in the system and made respective directories right?
|
|
||||
|
Re: How To Compile Your Own Kernels, Modules, Tinboot (NAND boot), and More for Begin
Has anyone tried building under OSX? I found specific instructions here to build the default Android sources:
Building Android on Snow Leopard | Quietly Coding I have a Macbook for iPhone development, so I'd prefer using it instead of installing linux from scratch on my windows machine. As a side note, this thread really belongs in the new Android Development sub-forum. |
| This post has been thanked 1 times. |
![]() |
|
|
|