1 #!/bin/bash 2 3 LOGDIR=$1 4 DIR=$PWD 5 TMPDIR=/tmp/logs 6 7 if [ -e $TMPDIR ]; then 8 echo "$TMPDIR exists - cannot prepare build trees" 9 exit 1 10 fi 11 mkdir $TMPDIR 12 echo "Preparing separate build trees for hostapd/wpa_supplicant" 13 cd ../../.. 14 git archive --format=tar --prefix=hostap/ HEAD > $TMPDIR/hostap.tar 15 cd $DIR 16 cat ../../../wpa_supplicant/.config > $TMPDIR/wpa_supplicant.config 17 echo "CONFIG_CODE_COVERAGE=y" >> $TMPDIR/wpa_supplicant.config 18 cat ../../../hostapd/.config > $TMPDIR/hostapd.config 19 echo "CONFIG_CODE_COVERAGE=y" >> $TMPDIR/hostapd.config 20 21 cd $TMPDIR 22 tar xf hostap.tar 23 mv hostap alt-wpa_supplicant 24 mv wpa_supplicant.config alt-wpa_supplicant/wpa_supplicant/.config 25 tar xf hostap.tar 26 mv hostap alt-hostapd 27 cp hostapd.config alt-hostapd/hostapd/.config 28 tar xf hostap.tar 29 mv hostap alt-hostapd-as 30 cp hostapd.config alt-hostapd-as/hostapd/.config 31 tar xf hostap.tar 32 mv hostap alt-hlr_auc_gw 33 mv hostapd.config alt-hlr_auc_gw/hostapd/.config 34 rm hostap.tar 35 36 cd $TMPDIR/alt-wpa_supplicant/wpa_supplicant 37 echo "Building wpa_supplicant" 38 make -j8 > /dev/null 39 40 cd $TMPDIR/alt-hostapd/hostapd 41 echo "Building hostapd" 42 make -j8 hostapd hostapd_cli > /dev/null 43 44 cd $TMPDIR/alt-hostapd-as/hostapd 45 echo "Building hostapd (AS)" 46 make -j8 hostapd hostapd_cli > /dev/null 47 48 cd $TMPDIR/alt-hlr_auc_gw/hostapd 49 echo "Building hlr_auc_gw" 50 make -j8 hlr_auc_gw > /dev/null 51 52 cd $DIR 53 54 mv $TMPDIR/alt-wpa_supplicant $LOGDIR 55 mv $TMPDIR/alt-hostapd $LOGDIR 56 mv $TMPDIR/alt-hostapd-as $LOGDIR 57 mv $TMPDIR/alt-hlr_auc_gw $LOGDIR 58