Skip to content

Commit

Permalink
Improve build.sh and update the Makefile for drivers/gpu/pvr to deal …
Browse files Browse the repository at this point in the history
…with an issue that occurs when building under GCC 4.7.0
  • Loading branch information
goulderb committed Jul 11, 2012
1 parent ad69588 commit 8421e31
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 49 deletions.
114 changes: 67 additions & 47 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,92 @@
#
#

export DEVICE="strat"

# setup
WORK=`pwd`
DATE=$(date +%m%d)
export WORK=`pwd`
export DATE=$(date +%m%d)


# Edit This for your Toolchain Dir
TOOLCHAIN=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-
# Declare TOOLCHAIN in the environment: TOOLCHAIN="/blah" sh build.sh
if [ -z "$TOOLCHAIN" ]; then
export TOOLCHAIN=arm-eabi-
fi


# execution!
cd ..

# check for device we're building for
DEVICE="strat"
cd "$DEVICE"_initramfs

# Move out the .git so we dont have a huge kernel and we dont boot :)
mv .git ../.git_ramfs


# Ensure the initramfs exists for our device.
if [ -d "${DEVICE}_initramfs" ]; then
cd "${DEVICE}_initramfs"

# Move out the .git so we dont have a huge kernel and we dont boot :)
if [ -d ".git" ]; then
mv .git ../.git_ramfs
fi

# build the kernel
cd $WORK
echo "***** Building for $DEVICE *****"
# Build the kernel
cd $WORK
echo "***** Building for $DEVICE *****"

# Make Clean and remove everything
make ARCH=arm CROSS_COMPILE="$TOOLCHAIN" mrproper
# Use make mrproper to clean up the directory.
make ARCH=arm CROSS_COMPILE="$TOOLCHAIN" mrproper

# Clean the update.zip area
rm -f update/*.zip update/kernel_update/zImage
# Clean the update.zip area
rm -f update/*.zip update/kernel_update/zImage

# Move out the .git for the kenrel
# Thanks Imnuts for the idea
mv .git ../.git_kernel
# Move out the .git for the kenrel
# Thanks Imnuts for the idea
if [ -d ".git" ]; then
mv .git ../.git_kernel
fi

make ARCH=arm CROSS_COMPILE="$TOOLCHAIN" stratosphere_defconfig
make ARCH=arm CROSS_COMPILE="$TOOLCHAIN" -j16
if [ $? != 0 ]; then
make ARCH=arm CROSS_COMPILE="$TOOLCHAIN" stratosphere_defconfig
make ARCH=arm CROSS_COMPILE="$TOOLCHAIN" -j16
if [ $? != 0 ]; then
echo -e "FAIL!\n\n"
cd ..
mv .git_ramfs "$DEVICE"_initramfs/.git
mv .git_kernel "$WORK"/.git
if [ -d ".git_ramfs" ]; then
mv .git_ramfs "$DEVICE"_initramfs/.git
fi

if [ -d ".git_kernel" ]; then
mv .git_kernel "$WORK"/.git
fi

exit 1
else
echo -e "Success!\n"
rm -f "$WORK"/*log.txt
fi
fi

# Build a recovery odin file
cp arch/arm/boot/zImage recovery.bin
tar -c recovery.bin > "${DATE}_${DEVICE}_recovery.tar"
md5sum -t "${DATE}_${DEVICE}_recovery.tar" >> "${DATE}_${DEVICE}_recovery.tar"
mv "${DATE}_${DEVICE}_recovery.tar" "${DATE}_${DEVICE}_recovery.tar.md5"
rm recovery.bin

# Make the CWM Zip
cp arch/arm/boot/zImage update/kernel_update/zImage
cd update
zip -r -q ../"${DATE}_${DEVICE}.zip" .

# Finish up
cd ../../

# Build a recovery odin file
cp arch/arm/boot/zImage recovery.bin
tar -c recovery.bin > "$DATE"_"$DEVICE"_recovery.tar
md5sum -t "$DATE"_"$DEVICE"_recovery.tar >> "$DATE"_"$DEVICE"_recovery.tar
mv "$DATE"_"$DEVICE"_recovery.tar "$DATE"_"$DEVICE"_recovery.tar.md5
rm recovery.bin

# Make the CWM Zip
cp arch/arm/boot/zImage update/kernel_update/zImage
cd update
zip -r -q kernel_update.zip .
mv kernel_update.zip ../"$DATE"_"$DEVICE".zip

# Finish up
cd ../../
mv .git_ramfs "$DEVICE"_initramfs/.git
mv .git_kernel "$WORK"/.git
cd $WORK
echo -e "***** Successfully compiled for $DEVICE *****\n"
if [ -d ".git_ramfs" ]; then
mv .git_ramfs "$DEVICE"_initramfs/.git
fi

if [ -d ".git_kernel" ]; then
mv .git_kernel "$WORK"/.git
fi

cd $WORK
echo -e "***** Successfully compiled for $DEVICE *****\n"
else
echo "No initramfs found! Aborting."
exit 1
fi
1 change: 0 additions & 1 deletion drivers/gpu/pvr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ ccflags-y := \
-Wstrict-prototypes\
-Wno-unused-parameter\
-Wno-sign-compare\
-Werror\
-fno-strict-aliasing\
-Wno-pointer-arith\
-Os
Expand Down
2 changes: 1 addition & 1 deletion update/META-INF/com/google/android/updater-script
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
show_progress(0.5, 0);
show_progress(0.5, 40);
ui_print("It's PeanutButta Jelly Time!!");
ui_print("RHCP/BAG Kernel for the Stratosphere");
ui_print("Copying files...");
run_program("/sbin/mount", "-t", "rfs", "-ollw,check=no,nosuid,nodev", "/dev/block/stl10", "/system");
package_extract_dir("system", "/system");
Expand Down

0 comments on commit 8421e31

Please sign in to comment.