Skip to content

Commit

Permalink
scripts: sync with master
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
  • Loading branch information
RobertCNelson committed Aug 1, 2013
1 parent f052c0d commit 19b8dab
Show file tree
Hide file tree
Showing 15 changed files with 278 additions and 355 deletions.
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2009-2013 Robert Nelson <robertcnelson@gmail.com>

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.
81 changes: 25 additions & 56 deletions build_deb.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ patch_kernel () {
git commit --allow-empty -a -m "${KERNEL_TAG}-${BUILD} patchset" git commit --allow-empty -a -m "${KERNEL_TAG}-${BUILD} patchset"
fi fi


#Test Patches:
#exit

if [ "${LOCAL_PATCH_DIR}" ] ; then
for i in ${LOCAL_PATCH_DIR}/*.patch ; do patch -s -p1 < $i ; done
BUILD="${BUILD}+"
fi

cd ${DIR}/ cd ${DIR}/
} }


Expand All @@ -65,16 +57,16 @@ make_menuconfig () {
make_deb () { make_deb () {
cd ${DIR}/KERNEL/ cd ${DIR}/KERNEL/
echo "-----------------------------" echo "-----------------------------"
echo "make -j${CORES} ARCH=arm KBUILD_DEBARCH=${DEBARCH} LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" KDEB_PKGVERSION=${BUILDREV}${DISTRO} ${CONFIG_DEBUG_SECTION} deb-pkg" echo "make -j${CORES} ARCH=arm KBUILD_DEBARCH=${DEBARCH} LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" KDEB_PKGVERSION=${BUILDREV}${DISTRO} deb-pkg"
echo "-----------------------------" echo "-----------------------------"
fakeroot make -j${CORES} ARCH=arm KBUILD_DEBARCH=${DEBARCH} LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" KDEB_PKGVERSION=${BUILDREV}${DISTRO} ${CONFIG_DEBUG_SECTION} deb-pkg fakeroot make -j${CORES} ARCH=arm KBUILD_DEBARCH=${DEBARCH} LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" KDEB_PKGVERSION=${BUILDREV}${DISTRO} deb-pkg
mv ${DIR}/*.deb ${DIR}/deploy/ mv ${DIR}/*.deb ${DIR}/deploy/


unset DTBS unset DTBS
cat ${DIR}/KERNEL/arch/arm/Makefile | grep "dtbs:" >/dev/null 2>&1 && DTBS=1 cat ${DIR}/KERNEL/arch/arm/Makefile | grep "dtbs:" >/dev/null 2>&1 && DTBS=1
if [ "x${DTBS}" != "x" ] ; then if [ "x${DTBS}" != "x" ] ; then
echo "make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE=\"${CC}\" ${CONFIG_DEBUG_SECTION} dtbs" echo "make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE=\"${CC}\" dtbs"
make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" ${CONFIG_DEBUG_SECTION} dtbs make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" dtbs
ls arch/arm/boot/* | grep dtb >/dev/null 2>&1 || unset DTBS ls arch/arm/boot/* | grep dtb >/dev/null 2>&1 || unset DTBS
fi fi


Expand All @@ -83,14 +75,14 @@ make_deb () {
cd ${DIR}/ cd ${DIR}/
} }


make_firmware_pkg () { make_pkg () {
cd ${DIR}/KERNEL/ cd ${DIR}/KERNEL/


echo "-----------------------------" echo "-----------------------------"
echo "Building Firmware Archive" echo "Building ${pkg} Archive"
echo "-----------------------------" echo "-----------------------------"


deployfile="-firmware.tar.gz" deployfile="-${pkg}.tar.gz"
if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then
rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true
fi fi
Expand All @@ -100,7 +92,17 @@ make_firmware_pkg () {
fi fi
mkdir -p ${DIR}/deploy/tmp mkdir -p ${DIR}/deploy/tmp


make ARCH=arm CROSS_COMPILE=${CC} firmware_install INSTALL_FW_PATH=${DIR}/deploy/tmp case "${pkg}" in
modules)
make ARCH=arm CROSS_COMPILE=${CC} modules_install INSTALL_MOD_PATH=${DIR}/deploy/tmp
;;
firmware)
make ARCH=arm CROSS_COMPILE=${CC} firmware_install INSTALL_FW_PATH=${DIR}/deploy/tmp
;;
dtbs)
find ./arch/arm/boot/ -iname "*.dtb" -exec cp -v '{}' ${DIR}/deploy/tmp/ \;
;;
esac


cd ${DIR}/deploy/tmp cd ${DIR}/deploy/tmp
echo "-----------------------------" echo "-----------------------------"
Expand All @@ -119,40 +121,14 @@ make_firmware_pkg () {
fi fi
} }


make_dtbs_pkg () { make_firmware_pkg () {
cd ${DIR}/KERNEL/ pkg="firmware"

make_pkg
echo "-----------------------------" }
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
mkdir -p ${DIR}/deploy/tmp

find ./arch/arm/boot/ -iname "*.dtb" -exec cp -v '{}' ${DIR}/deploy/tmp/ \;

cd ${DIR}/deploy/tmp
echo "-----------------------------"
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 make_dtbs_pkg () {
export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" pkg="dtbs"
/bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } make_pkg
else
ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}"
fi
} }


/bin/sh -e ${DIR}/tools/host_det.sh || { exit 1 ; } /bin/sh -e ${DIR}/tools/host_det.sh || { exit 1 ; }
Expand Down Expand Up @@ -187,9 +163,7 @@ if [ -f "${DIR}/branch.expired" ] ; then
fi fi


unset CC unset CC
unset DEBUG_SECTION
unset LINUX_GIT unset LINUX_GIT
unset LOCAL_PATCH_DIR
. ${DIR}/system.sh . ${DIR}/system.sh
/bin/sh -e "${DIR}/scripts/gcc.sh" || { exit 1 ; } /bin/sh -e "${DIR}/scripts/gcc.sh" || { exit 1 ; }
. ${DIR}/.CC . ${DIR}/.CC
Expand All @@ -198,11 +172,6 @@ echo "debug: CC=${CC}"
. ${DIR}/version.sh . ${DIR}/version.sh
export LINUX_GIT export LINUX_GIT


unset CONFIG_DEBUG_SECTION
if [ "${DEBUG_SECTION}" ] ; then
CONFIG_DEBUG_SECTION="CONFIG_DEBUG_SECTION_MISMATCH=y"
fi

#unset FULL_REBUILD #unset FULL_REBUILD
FULL_REBUILD=1 FULL_REBUILD=1
if [ "${FULL_REBUILD}" ] ; then if [ "${FULL_REBUILD}" ] ; then
Expand Down
116 changes: 27 additions & 89 deletions build_kernel.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ patch_kernel () {
git commit --allow-empty -a -m "${KERNEL_TAG}-${BUILD} patchset" git commit --allow-empty -a -m "${KERNEL_TAG}-${BUILD} patchset"
fi fi


#Test Patches:
#exit

if [ "${LOCAL_PATCH_DIR}" ] ; then
for i in ${LOCAL_PATCH_DIR}/*.patch ; do patch -s -p1 < $i ; done
BUILD="${BUILD}+"
fi

cd ${DIR}/ cd ${DIR}/
} }


Expand All @@ -65,15 +57,15 @@ make_menuconfig () {
make_kernel () { make_kernel () {
cd ${DIR}/KERNEL/ cd ${DIR}/KERNEL/
echo "-----------------------------" echo "-----------------------------"
echo "make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE=\"${CC}\" ${CONFIG_DEBUG_SECTION} zImage modules" echo "make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE=\"${CC}\" zImage modules"
echo "-----------------------------" echo "-----------------------------"
make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" ${CONFIG_DEBUG_SECTION} zImage modules make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" zImage modules


unset DTBS unset DTBS
cat ${DIR}/KERNEL/arch/arm/Makefile | grep "dtbs:" >/dev/null 2>&1 && DTBS=1 cat ${DIR}/KERNEL/arch/arm/Makefile | grep "dtbs:" >/dev/null 2>&1 && DTBS=1
if [ "x${DTBS}" != "x" ] ; then if [ "x${DTBS}" != "x" ] ; then
echo "make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE=\"${CC}\" ${CONFIG_DEBUG_SECTION} dtbs" echo "make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE=\"${CC}\" dtbs"
make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" ${CONFIG_DEBUG_SECTION} dtbs make -j${CORES} ARCH=arm LOCALVERSION=-${BUILD} CROSS_COMPILE="${CC}" dtbs
ls arch/arm/boot/* | grep dtb >/dev/null 2>&1 || unset DTBS ls arch/arm/boot/* | grep dtb >/dev/null 2>&1 || unset DTBS
fi fi


Expand Down Expand Up @@ -101,14 +93,14 @@ make_kernel () {
fi fi
} }


make_modules_pkg () { make_pkg () {
cd ${DIR}/KERNEL/ cd ${DIR}/KERNEL/


echo "-----------------------------" echo "-----------------------------"
echo "Building Module Archive" echo "Building ${pkg} Archive"
echo "-----------------------------" echo "-----------------------------"


deployfile="-modules.tar.gz" deployfile="-${pkg}.tar.gz"
if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then if [ -f "${DIR}/deploy/${KERNEL_UTS}${deployfile}" ] ; then
rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true rm -rf "${DIR}/deploy/${KERNEL_UTS}${deployfile}" || true
fi fi
Expand All @@ -118,7 +110,17 @@ make_modules_pkg () {
fi fi
mkdir -p ${DIR}/deploy/tmp mkdir -p ${DIR}/deploy/tmp


make ARCH=arm CROSS_COMPILE=${CC} modules_install INSTALL_MOD_PATH=${DIR}/deploy/tmp case "${pkg}" in
modules)
make ARCH=arm CROSS_COMPILE=${CC} modules_install INSTALL_MOD_PATH=${DIR}/deploy/tmp
;;
firmware)
make ARCH=arm CROSS_COMPILE=${CC} firmware_install INSTALL_FW_PATH=${DIR}/deploy/tmp
;;
dtbs)
find ./arch/arm/boot/ -iname "*.dtb" -exec cp -v '{}' ${DIR}/deploy/tmp/ \;
;;
esac


cd ${DIR}/deploy/tmp cd ${DIR}/deploy/tmp
echo "-----------------------------" echo "-----------------------------"
Expand All @@ -137,76 +139,19 @@ make_modules_pkg () {
fi fi
} }


make_firmware_pkg () { make_modules_pkg () {
cd ${DIR}/KERNEL/ pkg="modules"

make_pkg
echo "-----------------------------" }
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
mkdir -p ${DIR}/deploy/tmp

make ARCH=arm CROSS_COMPILE=${CC} firmware_install INSTALL_FW_PATH=${DIR}/deploy/tmp

cd ${DIR}/deploy/tmp
echo "-----------------------------"
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 make_firmware_pkg () {
export ERROR_MSG="File Generation Failure: [${KERNEL_UTS}${deployfile}]" pkg="firmware"
/bin/sh -e "${DIR}/scripts/error.sh" && { exit 1 ; } make_pkg
else
ls -lh "${DIR}/deploy/${KERNEL_UTS}${deployfile}"
fi
} }


make_dtbs_pkg () { make_dtbs_pkg () {
cd ${DIR}/KERNEL/ pkg="dtbs"

make_pkg
echo "-----------------------------"
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
mkdir -p ${DIR}/deploy/tmp

find ./arch/arm/boot/ -iname "*.dtb" -exec cp -v '{}' ${DIR}/deploy/tmp/ \;

cd ${DIR}/deploy/tmp
echo "-----------------------------"
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 ; } /bin/sh -e ${DIR}/tools/host_det.sh || { exit 1 ; }
Expand Down Expand Up @@ -241,9 +186,7 @@ if [ -f "${DIR}/branch.expired" ] ; then
fi fi


unset CC unset CC
unset DEBUG_SECTION
unset LINUX_GIT unset LINUX_GIT
unset LOCAL_PATCH_DIR
. ${DIR}/system.sh . ${DIR}/system.sh
/bin/sh -e "${DIR}/scripts/gcc.sh" || { exit 1 ; } /bin/sh -e "${DIR}/scripts/gcc.sh" || { exit 1 ; }
. ${DIR}/.CC . ${DIR}/.CC
Expand All @@ -252,11 +195,6 @@ echo "debug: CC=${CC}"
. ${DIR}/version.sh . ${DIR}/version.sh
export LINUX_GIT export LINUX_GIT


unset CONFIG_DEBUG_SECTION
if [ "${DEBUG_SECTION}" ] ; then
CONFIG_DEBUG_SECTION="CONFIG_DEBUG_SECTION_MISMATCH=y"
fi

#unset FULL_REBUILD #unset FULL_REBUILD
FULL_REBUILD=1 FULL_REBUILD=1
if [ "${FULL_REBUILD}" ] ; then if [ "${FULL_REBUILD}" ] ; then
Expand Down
4 changes: 3 additions & 1 deletion patch.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ start_cleanup () {
} }


cleanup () { cleanup () {
git format-patch -${number} -o ${DIR}/patches/ if [ "${number}" ] ; then
git format-patch -${number} -o ${DIR}/patches/
fi
exit exit
} }


Expand Down
22 changes: 22 additions & 0 deletions repo_maintenance/push-kernel-bump.sh
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh -e

DIR=$PWD

if [ -e ${DIR}/version.sh ]; then
unset BRANCH
unset KERNEL_TAG
. ${DIR}/version.sh

if [ ! "${BRANCH}" ] ; then
BRANCH="master"
fi

if [ ! "${KERNEL_TAG}" ] ; then
echo 'KERNEL_TAG undefined'
exit
fi

git commit -a -m "kernel bump: v${KERNEL_TAG}" -s
git push origin ${BRANCH}
fi

18 changes: 18 additions & 0 deletions repo_maintenance/push-merge-to-sha.sh
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh -e

DIR=$PWD
repo="https://github.com/RobertCNelson/linux/commit"

if [ -e ${DIR}/version.sh ]; then
unset BRANCH
unset KERNEL_SHA
. ${DIR}/version.sh

if [ ! "${BRANCH}" ] ; then
BRANCH="master"
fi

git commit -a -m "merge to: ${repo}/${KERNEL_SHA}" -s
git push origin ${BRANCH}
fi

File renamed without changes.
Loading

0 comments on commit 19b8dab

Please sign in to comment.