ahmar16

build_hostpad.sh

May 7th, 2021
712
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ################################################## hostapd and wpa_supplicant download and compilation
  2. ## Linux 4.15.0-130-generic #134-Ubuntu SMP Tue Jan 5 20:46:26 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  3.  
  4. MAIN_DIR=/home/ahmar/dev-system
  5. OPENWRT_DIR=/home/ahmar/dev-system/openwrt
  6.  
  7. cd $MAIN_DIR
  8.  
  9. if ! [ -d hostapd-devel-mtlk ]
  10. then
  11.     git clone https://github.com/benjaminlevine/hostapd-devel-mtlk
  12. else    
  13.     echo 'hostapd directory found, skipping download'
  14. fi
  15.  
  16.  
  17. export STAGING_DIR=$(find $OPENWRT_DIR/staging_dir/ -maxdepth 1 -type d -name 'target*' -print -quit)
  18.  
  19. cd hostapd-devel-mtlk
  20. for dir in hostapd wpa_supplicant; do
  21.     cd $dir
  22.     echo " ..... Starting $dir building procedure ...."
  23.     if [ -f Makefile.bkp ]
  24.     then
  25.         cp Makefile.bkp Makefile
  26.     else
  27.         cp Makefile Makefile.bkp
  28.     fi
  29.  
  30.     sed -i "s|home/benjamin/router|$(echo $MAIN_DIR)|" Makefile
  31.     sed -i "s/linux-4.4.14/$(basename $(find $OPENWRT_DIR/build_dir/ -type d -name 'linux-4*' -print -quit))/" Makefile
  32.     sed -i "s/target-mips_34kc+dsp_musl-1.1.16/$(basename $STAGING_DIR)/" Makefile
  33.     sed -i "s/toolchain-mips_34kc+dsp_gcc-5.3.0_musl-1.1.16/$(basename $( find $OPENWRT_DIR/staging_dir/ -maxdepth 1 -type d -name 'toolchain-mips*' -print -quit))/" Makefile
  34.    
  35.     make clean && make
  36.     cd ..
  37. done
  38. cd ..
  39. echo ....
  40. echo .... complete
  41. echo ....
  42. echo cp config.conf and the following two files to your router,
  43. ls $MAIN_DIR/hostapd-devel-mtlk/hostapd/hostapd -phl
  44. ls $MAIN_DIR/hostapd-devel-mtlk/wpa_supplicant/wpa_supplicant -phl
  45. echo then rn hostapd to mtlk-ap
  46. echo and execute ./mtlk-ap config.conf
  47.  
  48. #sound test
RAW Paste Data