@@ -1,77 +1,80 | |||||
1 | # |
|
1 | # | |
2 | # Build and Setup nexmon with monitor mode patch |
|
2 | # Build and Setup nexmon with monitor mode patch | |
3 | # |
|
3 | # | |
4 |
|
4 | |||
5 | # Load utility functions |
|
5 | # Load utility functions | |
6 | . ./functions.sh |
|
6 | . ./functions.sh | |
7 |
|
7 | |||
8 | if [ "$ENABLE_NEXMON" = true ] && [ "$ENABLE_WIRELESS" = true ]; then |
|
8 | if [ "$ENABLE_NEXMON" = true ] && [ "$ENABLE_WIRELESS" = true ]; then | |
9 |
|
9 | |||
10 | # Create temporary directory for nexmon sources |
|
10 | # Create temporary directory for nexmon sources | |
11 | temp_dir=$(as_nobody mktemp -d) |
|
11 | temp_dir=$(as_nobody mktemp -d) | |
12 |
|
12 | |||
13 | # Fetch nexmon sources |
|
13 | # Fetch nexmon sources | |
14 | as_nobody git -C "${temp_dir}" clone "${NEXMON_URL}" |
|
14 | as_nobody git -C "${temp_dir}" clone "${NEXMON_URL}" | |
15 |
|
15 | |||
16 | # Copy downloaded nexmon sources |
|
16 | # Copy downloaded nexmon sources | |
17 | mv "${temp_dir}/nexmon" "${R}"/tmp/ |
|
17 | mv "${temp_dir}/nexmon" "${R}"/tmp/ | |
18 |
|
18 | |||
19 | # Set permissions of the nexmon sources |
|
19 | # Set permissions of the nexmon sources | |
20 | chown -R root:root "${R}"/tmp/nexmon |
|
20 | chown -R root:root "${R}"/tmp/nexmon | |
21 |
|
21 | |||
22 | # Set script Root |
|
22 | # Set script Root | |
23 | NEXMON_ROOT="${R}"/tmp/nexmon |
|
23 | NEXMON_ROOT="${R}"/tmp/nexmon | |
24 |
|
24 | |||
25 | # Remove temporary directory for nexmon sources |
|
25 | # Remove temporary directory for nexmon sources | |
26 | rm -fr "${temp_dir}" |
|
26 | rm -fr "${temp_dir}" | |
27 |
|
27 | |||
28 | # Build nexmon firmware outside the build system, if we can. |
|
28 | # Build nexmon firmware outside the build system, if we can. | |
29 | cd "${NEXMON_ROOT}" |
|
29 | cd "${NEXMON_ROOT}" | |
30 |
|
30 | |||
31 | # Disable statistics |
|
31 | # Disable statistics | |
32 | touch DISABLE_STATISTICS |
|
32 | touch DISABLE_STATISTICS | |
33 |
|
33 | |||
34 | # Setup Enviroment: see https://github.com/NoobieDog/nexmon/blob/master/setup_env.sh |
|
34 | # Setup Enviroment: see https://github.com/NoobieDog/nexmon/blob/master/setup_env.sh | |
35 | ARCH="${KERNEL_ARCH}" |
|
35 | #ARCH="${KERNEL_ARCH}" | |
36 | SUBARCH="${KERNEL_ARCH}" |
|
36 | #SUBARCH="${KERNEL_ARCH}" | |
37 | KERNEL="${KERNEL_IMAGE}" |
|
37 | #KERNEL="${KERNEL_IMAGE}" | |
38 | CC="${NEXMON_ROOT}"/buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/bin/arm-none-eabi- |
|
38 | #CC="${NEXMON_ROOT}"/buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/bin/arm-none-eabi- | |
39 | CCPLUGIN="${NEXMON_ROOT}"/buildtools/gcc-nexmon-plugin/nexmon.so |
|
39 | #CCPLUGIN="${NEXMON_ROOT}"/buildtools/gcc-nexmon-plugin/nexmon.so | |
40 | ZLIBFLATE="zlib-flate -compress" |
|
40 | #ZLIBFLATE="zlib-flate -compress" | |
41 | Q=@ |
|
41 | #Q=@ | |
42 | NEXMON_SETUP_ENV=1 |
|
42 | #NEXMON_SETUP_ENV=1 | |
|
43 | source setup_env.sh | |||
43 |
|
44 | |||
44 | # Make nexmon |
|
45 | # Make nexmon | |
45 | make |
|
46 | make | |
46 |
|
47 | |||
47 | # Make ancient isl build |
|
48 | # Make ancient isl build | |
48 | cd buildtools/isl-0.10 |
|
49 | cd buildtools/isl-0.10 | |
49 | CC=$CCgcc |
|
50 | CC=$CCgcc | |
50 | ./configure |
|
51 | ./configure | |
51 | make |
|
52 | make | |
52 |
|
53 | |||
53 | # build patches |
|
54 | # build patches | |
54 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] ; then |
|
55 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] ; then | |
55 | cd ${NEXMON_ROOT}/patches/bcm43430a1/7_45_41_46/nexmon |
|
56 | cd ${NEXMON_ROOT}/patches/bcm43430a1/7_45_41_46/nexmon | |
56 | make clean |
|
57 | make clean | |
57 |
|
58 | |||
58 | # We do this so we don't have to install the ancient isl version into /usr/local/lib on systems. |
|
59 | # We do this so we don't have to install the ancient isl version into /usr/local/lib on systems. | |
59 | LD_LIBRARY_PATH=${NEXMON_ROOT}/buildtools/isl-0.10/.libs make ARCH="${KERNEL_ARCH}" CC=${NEXMON_ROOT}/buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/bin/arm-none-eabi- |
|
60 | LD_LIBRARY_PATH=${NEXMON_ROOT}/buildtools/isl-0.10/.libs make ARCH="${KERNEL_ARCH}" CC=${NEXMON_ROOT}/buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/bin/arm-none-eabi- | |
60 |
|
61 | |||
61 | # copy RPi0W & RPi3 firmware |
|
62 | # copy RPi0W & RPi3 firmware | |
|
63 | mv "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.org.bin | |||
62 |
|
|
64 | cp ${NEXMON_ROOT}/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.nexmon.bin | |
63 | cp -f ${NEXMON_ROOT}/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.bin |
|
65 | cp -f ${NEXMON_ROOT}/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.bin | |
64 | fi |
|
66 | fi | |
65 |
|
67 | |||
66 | if [ "$RPI_MODEL" = 3P ] ; then |
|
68 | if [ "$RPI_MODEL" = 3P ] ; then | |
67 | cd ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon |
|
69 | cd ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon | |
68 | make clean |
|
70 | make clean | |
69 |
|
71 | |||
70 | # We do this so we don't have to install the ancient isl version into /usr/local/lib on systems. |
|
72 | # We do this so we don't have to install the ancient isl version into /usr/local/lib on systems. | |
71 | LD_LIBRARY_PATH=${NEXMON_ROOT}/buildtools/isl-0.10/.libs make ARCH="${KERNEL_ARCH}" CC=${NEXMON_ROOT}/buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/bin/arm-none-eabi- |
|
73 | LD_LIBRARY_PATH=${NEXMON_ROOT}/buildtools/isl-0.10/.libs make ARCH="${KERNEL_ARCH}" CC=${NEXMON_ROOT}/buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/bin/arm-none-eabi- | |
72 |
|
74 | |||
73 | # RPi3B+ firmware |
|
75 | # RPi3B+ firmware | |
|
76 | mv "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.org.bin | |||
74 |
|
|
77 | cp ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon/brcmfmac43455-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.nexmon.bin | |
75 | cp -f ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon/brcmfmac43455-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.bin |
|
78 | cp -f ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon/brcmfmac43455-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.bin | |
76 | fi |
|
79 | fi | |
77 | fi |
|
80 | fi |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant