diff --git a/build_wl18xx.sh b/build_wl18xx.sh
index ee6143d9ca7f72c835279131237a4bd023f44568..7148484842a2a97ff4c0f4c398861497af3009bb 100755 (executable)
--- a/build_wl18xx.sh
+++ b/build_wl18xx.sh
echo "Usage : "
echo ""
echo "Building full package : "
- echo " ./wl18xx_build.sh init <head|TAG> [ Download and Update w/o build ] "
+ echo " ./build_wl18xx.sh init <head|TAG> [ Download and Update w/o build ] "
echo " update <head|TAG> [ Update to specific TAG & Build ] "
echo " clean [ Clean & Build ] "
echo " <empty> [ Build w/o update ] "
+ echo " check_updates [ Check for build script updates ] "
echo ""
echo "Building specific component :"
echo " hostapd [ Clean & Build hostapd ] "
function check_for_build_updates()
{
+ git fetch
count=`git status -uno | grep behind | wc -l`
if [ $count -ne 0 ]
then
[ -z $NO_CONFIG ] && cp `path configuration`/kernel_$KERNEL_VERSION.$KERNEL_PATCHLEVEL.config `repo_path kernel`/.config
[ -z $NO_CLEAN ] && make clean
[ -z $NO_CLEAN ] && assert_no_error
-
+
if [ "$KERNEL_VERSION" -eq 3 ] && [ "$KERNEL_PATCHLEVEL" -eq 2 ]
then
make -j${PROCESSORS_NUMBER} uImage
make -j${PROCESSORS_NUMBER} modules
INSTALL_MOD_PATH=`path filesystem` make -j${PROCESSORS_NUMBER} modules_install
cp `repo_path kernel`/arch/arm/boot/zImage `path tftp`/zImage
- cp `repo_path kernel`/arch/arm/boot/dts/*.dtb `path tftp`/
+ cp `repo_path kernel`/arch/arm/boot/dts/am335x-*.dtb `path tftp`/
else
LOADADDR=0x80008000 make -j${PROCESSORS_NUMBER} uImage.am335x-evm
cp `repo_path kernel`/arch/arm/boot/uImage.am335x-evm `path tftp`/uImage
}
function build_hostapd()
-{
+{
cd `repo_path hostap`/hostapd
[ -z $NO_CONFIG ] && cp android.config .config
[ -n "$UPNP_EN" ] && echo "Enable UPNP config" && sed -i "/#CONFIG_WPS_UPNP=y/ s/# *//" .config
tar cpjf `path outputs`/${tar_filesystem[0]} .
cd_back
- if [ "$KERNEL_VERSION" -eq 3 ] && [ "$KERNEL_PATCHLEVEL" -eq 2 ]
- then
- cp `path tftp`/uImage `path outputs`/uImage
- else
- if [ -z $NO_DTB ]
- then
- cp `path tftp`/zImage `path outputs`/zImage
- cp `path tftp`/*.dtb `path outputs`/
- else
- cp `path tftp`/uImage `path outputs`/uImage
- fi
- fi
+ # Copy kernel files only if default kernel is used(for now)
+ if [ "$DEFAULT_KERNEL" -eq 1 ]
+ then
+ if [ "$KERNEL_VERSION" -eq 3 ] && [ "$KERNEL_PATCHLEVEL" -eq 2 ]
+ then
+ cp `path tftp`/uImage `path outputs`/uImage
+ else
+ if [ -z $NO_DTB ]
+ then
+ cp `path tftp`/zImage `path outputs`/zImage
+ cp `path tftp`/*.dtb `path outputs`/*.dtb
+ else
+ cp `path tftp`/uImage `path outputs`/uImage
+ fi
+ fi
+ fi
fi
}
fi
}
+function verify_installs()
+{
+ apps_to_verify=(
+ libtool
+ python-m2crypto
+ bison
+ flex
+ )
+
+ i="0"
+ while [ $i -lt ${#apps_to_verify[@]} ]; do
+ if !( dpkg-query -s ${apps_to_verify[i]} 2>/dev/null | grep -q ^"Status: install ok installed"$ )then
+ echo "${apps_to_verify[i]} is missing"
+ echo "Please use 'sudo apt-get install ${apps_to_verify[i]}'"
+ read -p "Do you want to install it now [y/n] ? (requires sudo) " yn
+ case $yn in
+ [Yy]* ) sudo apt-get install ${apps_to_verify[i]} ;;
+ [Nn]* ) echo -e "${PURPLE}${apps_to_verify[i]} was not installed. leaving build. ${NORMAL} " ; exit 0 ;;
+ * ) echo "Please answer y or n.";;
+ esac
+ fi
+ i=$[$i + 1]
+ done
+}
+
function setup_workspace()
{
setup_directories
setup_repositories
setup_branches
+ verify_installs
#Download toolchain only if it was not set
[ DEFAULT_TOOLCHAIN ] && setup_toolchain
}
function main()
{
[[ "$1" == "-h" || "$1" == "--help" ]] && usage
- check_for_build_updates
setup_environment
setup_directories
read_kernel_version
'admin_tag')
admin_tag $2
;;
-
+
+ 'check_updates')
+ check_for_build_updates
+ ;;
+
'')
print_highlight " building all (No clean & no source code update) "
#clean_outputs