diff --git a/build_deb.sh b/build_deb.sh index 08c6da8..b946e88 100755 --- a/build_deb.sh +++ b/build_deb.sh @@ -75,7 +75,7 @@ make_deb () { if [ "x${DTBS}" != "x" ] ; then echo "make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE=\"${CC}\" ${CONFIG_DEBUG_SECTION} dtbs" make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" ${CONFIG_DEBUG_SECTION} dtbs - ls arch/arm/boot/* | grep dtb || unset DTBS + ls arch/arm/boot/* | grep dtb >/dev/null 2>&1 || unset DTBS fi KERNEL_UTS=$(cat ${DIR}/KERNEL/include/generated/utsrelease.h | awk '{print $3}' | sed 's/\"//g' ) @@ -90,6 +90,11 @@ make_firmware_pkg () { echo "Building Firmware Archive" echo "-----------------------------" + deployfile="-firmware.tar.gz" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + fi + if [ -d ${DIR}/deploy/tmp ] ; then rm -rf ${DIR}/deploy/tmp || true fi @@ -99,12 +104,19 @@ make_firmware_pkg () { cd ${DIR}/deploy/tmp echo "-----------------------------" - echo "Building ${KERNEL_UTS}-firmware.tar.gz" - tar czf ../${KERNEL_UTS}-firmware.tar.gz * + echo "Building ${KERNEL_UTS}${deployfile}" + tar czf ../${KERNEL_UTS}${deployfile} * echo "-----------------------------" cd ${DIR}/ rm -rf ${DIR}/deploy/tmp || true + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } make_dtbs_pkg () { @@ -114,6 +126,11 @@ make_dtbs_pkg () { echo "Building DTBS Archive" echo "-----------------------------" + deployfile="-dtbs.tar.gz" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + fi + if [ -d ${DIR}/deploy/tmp ] ; then rm -rf ${DIR}/deploy/tmp || true fi @@ -123,18 +140,50 @@ make_dtbs_pkg () { cd ${DIR}/deploy/tmp echo "-----------------------------" - echo "Building ${KERNEL_UTS}-dtbs.tar.gz" - tar czf ../${KERNEL_UTS}-dtbs.tar.gz * + echo "Building ${KERNEL_UTS}${deployfile}" + tar czf ../${KERNEL_UTS}${deployfile} * echo "-----------------------------" cd ${DIR}/ rm -rf ${DIR}/deploy/tmp || true + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } /bin/sh -e ${DIR}/tools/host_det.sh || { exit 1 ; } if [ ! -f ${DIR}/system.sh ] ; then cp ${DIR}/system.sh.sample ${DIR}/system.sh +else + #fixes for bash -> sh conversion... + sed -i 's/bash/sh/g' ${DIR}/system.sh + sed -i 's/==/=/g' ${DIR}/system.sh +fi + +if [ -f "${DIR}/branches.list" ] ; then + echo "-----------------------------" + echo "Please checkout one of the active branches:" + echo "-----------------------------" + cat ${DIR}/branches.list | grep -v INACTIVE + echo "-----------------------------" + exit +fi + +if [ -f "${DIR}/branch.expired" ] ; then + echo "-----------------------------" + echo "Support for this branch has expired." + unset response + echo -n "Do you wish to bypass this warning and support your self: (y/n)? " + read response + if [ "x${response}" != "xy" ] ; then + exit + fi + echo "-----------------------------" fi unset CC diff --git a/build_kernel.sh b/build_kernel.sh index 66a927e..76a79c9 100755 --- a/build_kernel.sh +++ b/build_kernel.sh @@ -74,19 +74,31 @@ make_kernel () { if [ "x${DTBS}" != "x" ] ; then echo "make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE=\"${CC}\" ${CONFIG_DEBUG_SECTION} dtbs" make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" ${CONFIG_DEBUG_SECTION} dtbs - ls arch/arm/boot/* | grep dtb || unset DTBS + ls arch/arm/boot/* | grep dtb >/dev/null 2>&1 || unset DTBS fi KERNEL_UTS=$(cat ${DIR}/KERNEL/include/generated/utsrelease.h | awk '{print $3}' | sed 's/\"//g' ) + + deployfile=".zImage" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + rm -rf "${DIR}/deploy/${KERNEL_UTS}.config" || true + fi + if [ -f ./arch/arm/boot/zImage ] ; then - cp arch/arm/boot/zImage ${DIR}/deploy/${KERNEL_UTS}.zImage - cp .config ${DIR}/deploy/${KERNEL_UTS}.config - else echo "-----------------------------" - echo "Error: make zImage modules failed" - exit + cp -v arch/arm/boot/zImage "${DIR}/deploy/${KERNEL_UTS}.zImage" + cp -v .config "${DIR}/deploy/${KERNEL_UTS}.config" fi + cd ${DIR}/ + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } make_modules_pkg () { @@ -96,6 +108,11 @@ make_modules_pkg () { echo "Building Module Archive" echo "-----------------------------" + deployfile="-modules.tar.gz" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + fi + if [ -d ${DIR}/deploy/tmp ] ; then rm -rf ${DIR}/deploy/tmp || true fi @@ -105,12 +122,19 @@ make_modules_pkg () { cd ${DIR}/deploy/tmp echo "-----------------------------" - echo "Building ${KERNEL_UTS}-modules.tar.gz" - tar czf ../${KERNEL_UTS}-modules.tar.gz * + echo "Building ${KERNEL_UTS}${deployfile}" + tar czf ../${KERNEL_UTS}${deployfile} * echo "-----------------------------" cd ${DIR}/ rm -rf ${DIR}/deploy/tmp || true + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } make_firmware_pkg () { @@ -120,6 +144,11 @@ make_firmware_pkg () { echo "Building Firmware Archive" echo "-----------------------------" + deployfile="-firmware.tar.gz" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + fi + if [ -d ${DIR}/deploy/tmp ] ; then rm -rf ${DIR}/deploy/tmp || true fi @@ -129,12 +158,19 @@ make_firmware_pkg () { cd ${DIR}/deploy/tmp echo "-----------------------------" - echo "Building ${KERNEL_UTS}-firmware.tar.gz" - tar czf ../${KERNEL_UTS}-firmware.tar.gz * + echo "Building ${KERNEL_UTS}${deployfile}" + tar czf ../${KERNEL_UTS}${deployfile} * echo "-----------------------------" cd ${DIR}/ rm -rf ${DIR}/deploy/tmp || true + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } make_dtbs_pkg () { @@ -144,6 +180,11 @@ make_dtbs_pkg () { echo "Building DTBS Archive" echo "-----------------------------" + deployfile="-dtbs.tar.gz" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + fi + if [ -d ${DIR}/deploy/tmp ] ; then rm -rf ${DIR}/deploy/tmp || true fi @@ -153,31 +194,41 @@ make_dtbs_pkg () { cd ${DIR}/deploy/tmp echo "-----------------------------" - echo "Building ${KERNEL_UTS}-dtbs.tar.gz" - tar czf ../${KERNEL_UTS}-dtbs.tar.gz * + echo "Building ${KERNEL_UTS}${deployfile}" + tar czf ../${KERNEL_UTS}${deployfile} * echo "-----------------------------" cd ${DIR}/ rm -rf ${DIR}/deploy/tmp || true + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } /bin/sh -e ${DIR}/tools/host_det.sh || { exit 1 ; } if [ ! -f ${DIR}/system.sh ] ; then cp ${DIR}/system.sh.sample ${DIR}/system.sh +else + #fixes for bash -> sh conversion... + sed -i 's/bash/sh/g' ${DIR}/system.sh + sed -i 's/==/=/g' ${DIR}/system.sh fi -unset CC -unset DEBUG_SECTION -unset LINUX_GIT -unset LOCAL_PATCH_DIR -. ${DIR}/system.sh -/bin/sh -e "${DIR}/scripts/gcc.sh" || { exit 1 ; } -. ${DIR}/.CC -echo "debug: CC=${CC}" +if [ -f "${DIR}/branches.list" ] ; then + echo "-----------------------------" + echo "Please checkout one of the active branches:" + echo "-----------------------------" + cat ${DIR}/branches.list | grep -v INACTIVE + echo "-----------------------------" + exit +fi -. ${DIR}/version.sh -if [ "${EXPIRED_BRANCH}" ] ; then +if [ -f "${DIR}/branch.expired" ] ; then echo "-----------------------------" echo "Support for this branch has expired." unset response @@ -188,6 +239,17 @@ if [ "${EXPIRED_BRANCH}" ] ; then fi echo "-----------------------------" fi + +unset CC +unset DEBUG_SECTION +unset LINUX_GIT +unset LOCAL_PATCH_DIR +. ${DIR}/system.sh +/bin/sh -e "${DIR}/scripts/gcc.sh" || { exit 1 ; } +. ${DIR}/.CC +echo "debug: CC=${CC}" + +. ${DIR}/version.sh export LINUX_GIT unset CONFIG_DEBUG_SECTION diff --git a/scripts/error.sh b/scripts/error.sh new file mode 100755 index 0000000..8302010 --- /dev/null +++ b/scripts/error.sh @@ -0,0 +1,69 @@ +#!/bin/sh -e +# +# Copyright (c) 2013 Robert Nelson +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +DIR=$PWD + +#Yuck, this error script can be called two directories... +offset="/" +if [ -f ${DIR}/../version.sh ] ; then + . ${DIR}/../version.sh + offset="../" +fi +if [ -f ${DIR}/../../version.sh ] ; then + . ${DIR}/../../version.sh + offset="../../" +fi + +echo "-----------------------------" +echo "Script Error: please cut and paste the following into an email to: bugs@rcn-ee.com" +echo "**********************************************************" +echo "Error: [${ERROR_MSG}]" + +if [ -f "${DIR}/${offset}.git/config" ] ; then + gitrepo=$(cat "${DIR}/${offset}.git/config" | grep url | awk '{print $3}') + gitwhatchanged=$(cd ${offset} ; git whatchanged -1) + echo "git repo: [${gitrepo}]" + echo "-----------------------------" + echo "${gitwhatchanged}" + echo "-----------------------------" +else + if [ "${BRANCH}" ] ; then + echo "nongit: [${BRANCH}]" + else + echo "nongit: [master]" + fi +fi + +if [ ! "${KERNEL_SHA}" ] ; then + echo "kernel: [v${KERNEL_TAG}-${BUILD}]" +else + echo "kernel: [v${KERNEL_TAG}-${BUILD}] + [${KERNEL_SHA}]" +fi + +echo "uname -m" +uname -m +if [ $(which lsb_release) ] ; then + echo "lsb_release -a" + lsb_release -a +fi +echo "**********************************************************" + diff --git a/scripts/git.sh b/scripts/git.sh index 4919a22..096f5ef 100755 --- a/scripts/git.sh +++ b/scripts/git.sh @@ -47,12 +47,12 @@ check_and_or_clone () { if [ ! "${LINUX_GIT}" ]; then if [ -f "${DIR}/ignore/linux-src/.git/config" ] ; then echo "-----------------------------" - echo "scripts/git: Warning: LINUX_GIT not defined in system.sh" + echo "scripts/git: LINUX_GIT not defined in system.sh" echo "using default location: ${DIR}/ignore/linux-src/" else echo "-----------------------------" - echo "scripts/git: Warning: LINUX_GIT not defined in system.sh" - echo "cloning ${torvalds_linux} to default location: ${DIR}/ignore/linux-src" + echo "scripts/git: LINUX_GIT not defined in system.sh" + echo "cloning ${torvalds_linux} into default location: ${DIR}/ignore/linux-src" git clone ${torvalds_linux} ${DIR}/ignore/linux-src fi LINUX_GIT="${DIR}/ignore/linux-src" @@ -153,6 +153,25 @@ git_kernel () { . ${DIR}/version.sh . ${DIR}/system.sh +unset git_config_user_email +git_config_user_email=$(git config -l | grep user.email || true) + +unset git_config_user_name +git_config_user_name=$(git config -l | grep user.name || true) + +if [ ! "${git_config_user_email}" ] || [ ! "${git_config_user_name}" ] ; then + echo "-----------------------------" + echo "This script relies heavily on git, and will fail if user.email/user.name are not defined." + echo "-----------------------------" + echo "See: https://help.github.com/articles/setting-your-email-in-git" + echo "git config --global user.email \"me@here.com\"" + echo "-----------------------------" + echo "See: https://help.github.com/articles/setting-your-username-in-git" + echo "git config --global user.name \"Billy Everyteen\"" + echo "-----------------------------" + exit 1 +fi + if [ "${GIT_OVER_HTTP}" ] ; then torvalds_linux="http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git" linux_stable="http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" @@ -161,18 +180,4 @@ else linux_stable="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" fi -unset ON_MASTER -if [ "${DISABLE_MASTER_BRANCH}" ] ; then - git branch | grep "*" | grep master >/dev/null 2>&1 && ON_MASTER=1 -fi - -if [ ! "${ON_MASTER}" ] ; then - git_kernel -else - echo "-----------------------------" - echo "Please checkout one of the active branches, building from the master branch has been disabled..." - echo "-----------------------------" - cat ${DIR}/branches.list | grep -v INACTIVE - echo "-----------------------------" - exit 1 -fi +git_kernel diff --git a/tools/host_det.sh b/tools/host_det.sh index facc5a5..af081c2 100755 --- a/tools/host_det.sh +++ b/tools/host_det.sh @@ -102,23 +102,41 @@ debian_regs () { fi fi - #Linux Mint: - #maya=precise=12.04 - #nadia=quantal=12.10 - unset warn_dpkg_ia32 unset warn_eol_distro #lsb_release might not be installed... if [ $(which lsb_release) ] ; then deb_distro=$(lsb_release -cs) + #Linux Mint: Compatibility Matrix + case "${deb_distro}" in + maya) + deb_distro="precise" + ;; + nadia) + deb_distro="quantal" + ;; + debian) + #http://www.linuxmint.com/download_lmde.php + #lsb_release -a + #No LSB modules are available. + #Distributor ID: LinuxMint + #Description: Linux Mint Debian Edition + #Release: 1 + #Codename: debian + # + #why? 'debian' for Codename? + deb_distro="jessie" + ;; + esac + unset error_unknown_deb_distro #mkimage case "${deb_distro}" in squeeze|lucid) dpkg -l | grep uboot-mkimage >/dev/null || deb_pkgs="${deb_pkgs}uboot-mkimage" ;; - wheezy|jessie|natty|oneiric|maya|precise|nadia|quantal|raring|saucy) + wheezy|jessie|natty|oneiric|precise|quantal|raring|saucy) dpkg -l | grep u-boot-tools >/dev/null || deb_pkgs="${deb_pkgs}u-boot-tools" ;; maverick) @@ -133,10 +151,10 @@ debian_regs () { if [ "x${cpu_arch}" = "xx86_64" ] ; then unset dpkg_multiarch case "${deb_distro}" in - squeeze|lucid|natty|oneiric|maya|precise) + squeeze|lucid|natty|oneiric|precise) dpkg -l | grep ia32-libs >/dev/null || deb_pkgs="${deb_pkgs}ia32-libs " ;; - wheezy|jessie|nadia|quantal|raring|saucy) + wheezy|jessie|quantal|raring|saucy) dpkg -l | grep ia32-libs >/dev/null || deb_pkgs="${deb_pkgs}ia32-libs " dpkg -l | grep ia32-libs >/dev/null || dpkg_multiarch=1 ;; diff --git a/tools/rebuild.sh b/tools/rebuild.sh index a617ac6..9756f91 100755 --- a/tools/rebuild.sh +++ b/tools/rebuild.sh @@ -74,19 +74,31 @@ make_kernel () { if [ "x${DTBS}" != "x" ] ; then echo "make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE=\"${CC}\" ${CONFIG_DEBUG_SECTION} dtbs" make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" ${CONFIG_DEBUG_SECTION} dtbs - ls arch/arm/boot/* | grep dtb || unset DTBS + ls arch/arm/boot/* | grep dtb >/dev/null 2>&1 || unset DTBS fi KERNEL_UTS=$(cat ${DIR}/KERNEL/include/generated/utsrelease.h | awk '{print $3}' | sed 's/\"//g' ) + + deployfile=".zImage" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + rm -rf "${DIR}/deploy/${KERNEL_UTS}.config" || true + fi + if [ -f ./arch/arm/boot/zImage ] ; then - cp arch/arm/boot/zImage ${DIR}/deploy/${KERNEL_UTS}.zImage - cp .config ${DIR}/deploy/${KERNEL_UTS}.config - else echo "-----------------------------" - echo "Error: make zImage modules failed" - exit + cp -v arch/arm/boot/zImage "${DIR}/deploy/${KERNEL_UTS}.zImage" + cp -v .config "${DIR}/deploy/${KERNEL_UTS}.config" fi + cd ${DIR}/ + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } make_modules_pkg () { @@ -96,6 +108,11 @@ make_modules_pkg () { echo "Building Module Archive" echo "-----------------------------" + deployfile="-modules.tar.gz" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + fi + if [ -d ${DIR}/deploy/tmp ] ; then rm -rf ${DIR}/deploy/tmp || true fi @@ -105,12 +122,19 @@ make_modules_pkg () { cd ${DIR}/deploy/tmp echo "-----------------------------" - echo "Building ${KERNEL_UTS}-modules.tar.gz" - tar czf ../${KERNEL_UTS}-modules.tar.gz * + echo "Building ${KERNEL_UTS}${deployfile}" + tar czf ../${KERNEL_UTS}${deployfile} * echo "-----------------------------" cd ${DIR}/ rm -rf ${DIR}/deploy/tmp || true + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } make_firmware_pkg () { @@ -120,6 +144,11 @@ make_firmware_pkg () { echo "Building Firmware Archive" echo "-----------------------------" + deployfile="-firmware.tar.gz" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + fi + if [ -d ${DIR}/deploy/tmp ] ; then rm -rf ${DIR}/deploy/tmp || true fi @@ -129,12 +158,19 @@ make_firmware_pkg () { cd ${DIR}/deploy/tmp echo "-----------------------------" - echo "Building ${KERNEL_UTS}-firmware.tar.gz" - tar czf ../${KERNEL_UTS}-firmware.tar.gz * + echo "Building ${KERNEL_UTS}${deployfile}" + tar czf ../${KERNEL_UTS}${deployfile} * echo "-----------------------------" cd ${DIR}/ rm -rf ${DIR}/deploy/tmp || true + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } make_dtbs_pkg () { @@ -144,6 +180,11 @@ make_dtbs_pkg () { echo "Building DTBS Archive" echo "-----------------------------" + deployfile="-dtbs.tar.gz" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + fi + if [ -d ${DIR}/deploy/tmp ] ; then rm -rf ${DIR}/deploy/tmp || true fi @@ -153,18 +194,29 @@ make_dtbs_pkg () { cd ${DIR}/deploy/tmp echo "-----------------------------" - echo "Building ${KERNEL_UTS}-dtbs.tar.gz" - tar czf ../${KERNEL_UTS}-dtbs.tar.gz * + echo "Building ${KERNEL_UTS}${deployfile}" + tar czf ../${KERNEL_UTS}${deployfile} * echo "-----------------------------" cd ${DIR}/ rm -rf ${DIR}/deploy/tmp || true + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } /bin/sh -e ${DIR}/tools/host_det.sh || { exit 1 ; } if [ ! -f ${DIR}/system.sh ] ; then cp ${DIR}/system.sh.sample ${DIR}/system.sh +else + #fixes for bash -> sh conversion... + sed -i 's/bash/sh/g' ${DIR}/system.sh + sed -i 's/==/=/g' ${DIR}/system.sh fi unset CC diff --git a/tools/rebuild_deb.sh b/tools/rebuild_deb.sh index 61b7962..00bb365 100755 --- a/tools/rebuild_deb.sh +++ b/tools/rebuild_deb.sh @@ -75,7 +75,7 @@ make_deb () { if [ "x${DTBS}" != "x" ] ; then echo "make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE=\"${CC}\" ${CONFIG_DEBUG_SECTION} dtbs" make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" ${CONFIG_DEBUG_SECTION} dtbs - ls arch/arm/boot/* | grep dtb || unset DTBS + ls arch/arm/boot/* | grep dtb >/dev/null 2>&1 || unset DTBS fi KERNEL_UTS=$(cat ${DIR}/KERNEL/include/generated/utsrelease.h | awk '{print $3}' | sed 's/\"//g' ) @@ -90,6 +90,11 @@ make_firmware_pkg () { echo "Building Firmware Archive" echo "-----------------------------" + deployfile="-firmware.tar.gz" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + fi + if [ -d ${DIR}/deploy/tmp ] ; then rm -rf ${DIR}/deploy/tmp || true fi @@ -99,12 +104,19 @@ make_firmware_pkg () { cd ${DIR}/deploy/tmp echo "-----------------------------" - echo "Building ${KERNEL_UTS}-firmware.tar.gz" - tar czf ../${KERNEL_UTS}-firmware.tar.gz * + echo "Building ${KERNEL_UTS}${deployfile}" + tar czf ../${KERNEL_UTS}${deployfile} * echo "-----------------------------" cd ${DIR}/ rm -rf ${DIR}/deploy/tmp || true + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } make_dtbs_pkg () { @@ -114,6 +126,11 @@ make_dtbs_pkg () { echo "Building DTBS Archive" echo "-----------------------------" + deployfile="-dtbs.tar.gz" + if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true + fi + if [ -d ${DIR}/deploy/tmp ] ; then rm -rf ${DIR}/deploy/tmp || true fi @@ -123,18 +140,29 @@ make_dtbs_pkg () { cd ${DIR}/deploy/tmp echo "-----------------------------" - echo "Building ${KERNEL_UTS}-dtbs.tar.gz" - tar czf ../${KERNEL_UTS}-dtbs.tar.gz * + echo "Building ${KERNEL_UTS}${deployfile}" + tar czf ../${KERNEL_UTS}${deployfile} * echo "-----------------------------" cd ${DIR}/ rm -rf ${DIR}/deploy/tmp || true + + if [ ! -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then + export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" + /bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } + else + ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}" + fi } /bin/sh -e ${DIR}/tools/host_det.sh || { exit 1 ; } if [ ! -f ${DIR}/system.sh ] ; then cp ${DIR}/system.sh.sample ${DIR}/system.sh +else + #fixes for bash -> sh conversion... + sed -i 's/bash/sh/g' ${DIR}/system.sh + sed -i 's/==/=/g' ${DIR}/system.sh fi unset CC diff --git a/version.sh b/version.sh index f5c30fa..9c0de90 100644 --- a/version.sh +++ b/version.sh @@ -1,8 +1,6 @@ #!/bin/sh # ARCH=$(uname -m) -DISABLE_MASTER_BRANCH=1 -#EXPIRED_BRANCH=1 #Dual/Quad Core arms are now more prevalent, so don't just limit to x86: CORES=$(cat /proc/cpuinfo | grep processor | wc -l)