#!/bin/sh BBB_IP=192.168.1.4 BUILDBASE=/root/build/linux-dev BUILDTARGET=${BUILDBASE}/BBB DATESTAMP=`date +%Y%m%d-%H%M%S` CROSS_COMPILE="ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi-" PREVIOUS_PACKED=${BUILDBASE}/`uname -r`.`cat .version` #CROSS_COMPILE="ARCH=arm" MAKEOPTS="" LOADADDR=0x80008000 PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/android/sdk/platform-tools:/root/bin:/root/android/sdk/platform-tools:/root/beaglebone/build/buildroot/output/host/usr/bin:/root/beaglebone/build/buildroot/output/build/uboot-2013.04/tools export LOADADDR export PATH mkdir -p ${BUILDTARGET} mkdir -p ${PREVIOUS_PACKED} mv build.log{,.old} mv -v ${BUILDBASE}/kernel-{aux,new}.tar.bz2 ${PREVIOUS_PACKED} rm -vfr /var/lib/tftpboot/uImage-BBB ${BUILDTARGET}/* #make ${CROSS_COMPILE} beaglebone_defconfig ${MAKEOPTS} 2>&1 | tee build.log && make ${CROSS_COMPILE} menuconfig && make ${CROSS_COMPILE} LOADADDR=${LOADADDR} uImage dtbs ${MAKEOPTS} 2>&1 | tee -a build.log && make ${CROSS_COMPILE} modules ${MAKEOPTS} 2>&1 | tee -a build.log && { # make ${CROSS_COMPILE} uImage ${MAKEOPTS} 2>&1 | tee -a build.log VERSION=`cat .version` TARGETVERSION=`mkimage -l arch/arm/boot/uImage | grep 'Image Name' | cut -f2 -d: | sed -e 's@Linux-@@g'` TARGETVERSION=`echo ${TARGETVERSION}` THUMBPRINT=kernel-new.${VERSION}.${DATESTAMP}.${TARGETVERSION}.config echo "Installing modules" make ${CROSS_COMPILE} modules_install 2>&1 | tee -a build.log make ${CROSS_COMPILE} firmware_install 2>&1 | tee -a build.log cp arch/arm/boot/uImage /boot/uImage-${TARGETVERSION} cp .config ${BUILDTARGET}/boot/config-${TARGETVERSION} cp .config /etc/kernel.config [ -z ${BUILDTARGET} ] || { make ${CROSS_COMPILE} INSTALL_MOD_PATH=${BUILDTARGET} modules_install 2>&1 | tee -a build.log mkdir -p ${BUILDTARGET}/boot cp arch/arm/boot/uImage ${BUILDTARGET}/boot/uImage-${TARGETVERSION} cp arch/arm/boot/dts/am335x-bone*.dtb ${BUILDTARGET}/boot/ cp .config ${BUILDTARGET}/boot/config-${TARGETVERSION} cp .config ${BUILDTARGET}/${THUMBPRINT} pushd ${BUILDTARGET} tar -P -vcjf ${BUILDBASE}/kernel-aux.tar.bz2 lib/modules/${TARGETVERSION}/{build,source} rm -fr lib/modules/${TARGETVERSION}/{build,source} tar -P -vcjf ${BUILDBASE}/kernel-new.tar.bz2 boot/uImage-${TARGETVERSION} boot/am335x-boneblack.dtb boot/config-${TARGETVERSION} lib ${THUMBPRINT} popd rm -fr ${BUILDTARGET} PREVIOUS_PACKED=${BUILDBASE}/`uname -r`.`cat .version` mkdir -p ${PREVIOUS_PACKED} mv -v ${BUILDBASE}/kernel-{aux,new}.tar.bz2 ${PREVIOUS_PACKED} } md5sum ${PREVIOUS_PACKED}/kernel-{aux,new}.tar.bz2 rm -f ../current-config ln .config ../current-config # svn commit -m "Build revision ${TARGETVERSION} `cat .version`" ../current-config ../build.sh cat << EOF scp ${BUILDBASE}/kernel-new.tar.bz2 root@${BBB_IP} echo 0 > /proc/sys/kernel/printk alias ls='ls --color' alias systemctl='systemctl --no-legend --no-pager --full' cat /proc/config.gz | gunzip -dc - > kernel.config opkg install bind bind-utils dhcp-server-{,config,systemd} subversion screen EOF }