@@ -1,105 +1,104 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | # |
|
3 | 3 | # Build and Setup nexmon with monitor mode patch |
|
4 | 4 | # |
|
5 | 5 | |
|
6 | 6 | # Load utility functions |
|
7 | 7 | . ./functions.sh |
|
8 | 8 | |
|
9 | 9 | if [ "$ENABLE_NEXMON" = true ] && [ "$ENABLE_WIRELESS" = true ]; then |
|
10 | 10 | # Copy existing nexmon sources into chroot directory |
|
11 | 11 | if [ -n "$NEXMONSRC_DIR" ] && [ -d "$NEXMONSRC_DIR" ] ; then |
|
12 | 12 | # Copy local U-Boot sources |
|
13 | 13 | cp -r "${NEXMONSRC_DIR}" "${R}/tmp" |
|
14 | 14 | else |
|
15 | 15 | # Create temporary directory for nexmon sources |
|
16 | 16 | temp_dir=$(as_nobody mktemp -d) |
|
17 | 17 | |
|
18 | 18 | # Fetch nexmon sources |
|
19 | 19 | as_nobody git -C "${temp_dir}" clone "${NEXMON_URL}" |
|
20 | 20 | |
|
21 | 21 | # Copy downloaded nexmon sources |
|
22 | 22 | mv "${temp_dir}/nexmon" "${R}"/tmp/ |
|
23 | 23 | |
|
24 | 24 | # Set permissions of the nexmon sources |
|
25 | 25 | chown -R root:root "${R}"/tmp/nexmon |
|
26 | 26 | |
|
27 | 27 | # Remove temporary directory for nexmon sources |
|
28 | 28 | rm -fr "${temp_dir}" |
|
29 | 29 | fi |
|
30 | 30 | |
|
31 | 31 | # Set script Root |
|
32 | 32 | export NEXMON_ROOT="${R}"/tmp/nexmon |
|
33 | 33 | |
|
34 | 34 | # Build nexmon firmware outside the build system, if we can. |
|
35 | 35 | cd "${NEXMON_ROOT}" || exit |
|
36 | 36 | |
|
37 | 37 | # Make ancient isl build |
|
38 | export CC="${NEXMON_ROOT}"/buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/bin/arm-none-eabi- | |
|
39 | export CC="${CC}"gcc | |
|
40 | 38 | cd buildtools/isl-0.10 || exit |
|
41 | 39 | ./configure |
|
42 | 40 | make |
|
43 | 41 | cd ../.. || exit |
|
44 | 42 | |
|
45 | 43 | # Disable statistics |
|
46 | 44 | touch DISABLE_STATISTICS |
|
47 | 45 | |
|
48 | 46 | # Setup Enviroment: see https://github.com/NoobieDog/nexmon/blob/master/setup_env.sh |
|
49 | 47 | #ARCH="${KERNEL_ARCH}" |
|
50 | 48 | #SUBARCH="${KERNEL_ARCH}" |
|
51 | 49 | export KERNEL="${KERNEL_IMAGE}" |
|
52 | 50 | export ARCH=arm |
|
53 | 51 | export SUBARCH=arm |
|
54 | ||
|
52 | export CC="${NEXMON_ROOT}"/buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/bin/arm-none-eabi- | |
|
53 | export CC="${CC}"gcc | |
|
55 | 54 | export CCPLUGIN="${NEXMON_ROOT}"/buildtools/gcc-nexmon-plugin/nexmon.so |
|
56 | 55 | export ZLIBFLATE="zlib-flate -compress" |
|
57 | 56 | export Q=@ |
|
58 | 57 | export NEXMON_SETUP_ENV=1 |
|
59 | 58 | export HOSTUNAME=$(uname -s) |
|
60 | 59 | export PLATFORMUNAME=$(uname -m) |
|
61 | 60 | #. ./setup_env.sh |
|
62 | 61 | |
|
63 | 62 | # Make nexmon |
|
64 | 63 | make |
|
65 | 64 | |
|
66 | 65 | # Backup stock broadcom wlan driver - "${LIB_DIR}"/modules/${KERNEL_VERSION}/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko |
|
67 | 66 | #brcmfmac_path=$(modinfo brcmfmac | grep -m 1 -oP "^filename:(\s*?)(.*)$" | sed -e 's/^filename:\(\s*\)\(.*\)$/\2/g') |
|
68 | 67 | #brcmfmac_path="${LIB_DIR}"/modules/"${KERNEL_VERSION}"/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko |
|
69 | 68 | #mv "${brcmfmac_path}" "${brcmfmac_path}".orig |
|
70 | 69 | |
|
71 | 70 | # |
|
72 | 71 | |
|
73 | 72 | # build patches |
|
74 | 73 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] ; then |
|
75 | 74 | cd "${NEXMON_ROOT}"/patches/bcm43430a1/7_45_41_46/nexmon || exit |
|
76 | 75 | make clean |
|
77 | 76 | |
|
78 | 77 | # We do this so we don't have to install the ancient isl version into /usr/local/lib on systems. |
|
79 | 78 | 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- |
|
80 | 79 | |
|
81 | 80 | # copy RPi0W & RPi3 firmware |
|
82 | 81 | mv "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.org.bin |
|
83 | 82 | cp "${NEXMON_ROOT}"/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.nexmon.bin |
|
84 | 83 | cp -f "${NEXMON_ROOT}"/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.bin |
|
85 | 84 | |
|
86 | 85 | cp "${NEXMON_ROOT}"/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac_4.14.y-nexmon/brcmfmac.ko "${brcmfmac_path}" |
|
87 | 86 | fi |
|
88 | 87 | |
|
89 | 88 | if [ "$RPI_MODEL" = 3P ] ; then |
|
90 | 89 | cd "${NEXMON_ROOT}"/patches/bcm43455c0/7_45_154/nexmon || exit |
|
91 | 90 | make clean |
|
92 | 91 | |
|
93 | 92 | # We do this so we don't have to install the ancient isl version into /usr/local/lib on systems. |
|
94 | 93 | 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- |
|
95 | 94 | |
|
96 | 95 | # RPi3B+ firmware |
|
97 | 96 | mv "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.org.bin |
|
98 | 97 | cp "${NEXMON_ROOT}"/patches/bcm43455c0/7_45_154/nexmon/brcmfmac43455-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.nexmon.bin |
|
99 | 98 | cp -f "${NEXMON_ROOT}"/patches/bcm43455c0/7_45_154/nexmon/brcmfmac43455-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.bin |
|
100 | 99 | fi |
|
101 | 100 | |
|
102 | 101 | #Revert to previous directory |
|
103 | 102 | cd "${WORKDIR}" || exit |
|
104 | 103 | |
|
105 | 104 | fi |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant