|
@@
-5,7
+5,7
|
|
5
|
# Load utility functions
|
|
5
|
# Load utility functions
|
|
6
|
. ./functions.sh
|
|
6
|
. ./functions.sh
|
|
7
|
|
|
7
|
|
|
8
|
if [ "$ENABLE_NEXMON" = 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)
|
|
@@
-18,49
+18,60
if [ "$ENABLE_NEXMON" = true ] ; then
|
|
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
|
|
|
|
|
|
22
|
# Set script Root
|
|
|
|
|
23
|
NEXMON_ROOT="${R}"/tmp/nexmon
|
|
21
|
|
|
24
|
|
|
22
|
# Remove temporary directory for nexmon sources
|
|
25
|
# Remove temporary directory for nexmon sources
|
|
23
|
rm -fr "${temp_dir}"
|
|
26
|
rm -fr "${temp_dir}"
|
|
24
|
fi
|
|
|
|
|
25
|
# Build nexmon firmware outside the build system, if we can.
|
|
|
|
|
26
|
cd "${R}"/tmp/nexmon
|
|
|
|
|
27
|
# Disable statistics
|
|
|
|
|
28
|
touch DISABLE_STATISTICS
|
|
|
|
|
29
|
# Setup Enviroment
|
|
|
|
|
30
|
source setup_env.sh
|
|
|
|
|
31
|
# Make nexmon
|
|
|
|
|
32
|
make
|
|
|
|
|
33
|
|
|
27
|
|
|
34
|
# Make ancient isl build
|
|
28
|
# Build nexmon firmware outside the build system, if we can.
|
|
35
|
cd buildtools/isl-0.10
|
|
29
|
cd "${NEXMON_ROOT}"
|
|
36
|
CC="$CROSS_COMPILE"
|
|
30
|
|
|
37
|
./configure
|
|
31
|
# Disable statistics
|
|
38
|
make
|
|
32
|
touch DISABLE_STATISTICS
|
|
|
|
|
33
|
|
|
|
|
|
34
|
# Setup Enviroment: see https://github.com/NoobieDog/nexmon/blob/master/setup_env.sh
|
|
|
|
|
35
|
ARCH="${KERNEL_ARCH}"
|
|
|
|
|
36
|
SUBARCH="${KERNEL_ARCH}"
|
|
|
|
|
37
|
KERNEL="${KERNEL_IMAGE}"
|
|
|
|
|
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
|
|
|
|
|
40
|
ZLIBFLATE="zlib-flate -compress"
|
|
|
|
|
41
|
Q=@
|
|
|
|
|
42
|
NEXMON_SETUP_ENV=1
|
|
|
|
|
43
|
|
|
|
|
|
44
|
# Make nexmon
|
|
|
|
|
45
|
make
|
|
|
|
|
46
|
|
|
|
|
|
47
|
# Make ancient isl build
|
|
|
|
|
48
|
cd buildtools/isl-0.10
|
|
|
|
|
49
|
CC=$CCgcc
|
|
|
|
|
50
|
./configure
|
|
|
|
|
51
|
make
|
|
39
|
|
|
52
|
|
|
40
|
# build patches
|
|
53
|
# build patches
|
|
41
|
cd ${NEXMON_ROOT}/patches/bcm43430a1/7_45_41_46/nexmon
|
|
54
|
if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] ; then
|
|
42
|
# Make sure we use the cross compiler to build the firmware.
|
|
55
|
cd ${NEXMON_ROOT}/patches/bcm43430a1/7_45_41_46/nexmon
|
|
43
|
# We use the x86 cross compiler because we're building on amd64
|
|
56
|
make clean
|
|
44
|
#unset CROSS_COMPILE
|
|
57
|
|
|
45
|
#export CROSS_COMPILE=${NEXMON_ROOT}/buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/bin/arm-none-eabi-
|
|
58
|
# We do this so we don't have to install the ancient isl version into /usr/local/lib on systems.
|
|
46
|
make clean
|
|
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-
|
|
47
|
# We do this so we don't have to install the ancient isl version into /usr/local/lib on systems.
|
|
60
|
|
|
48
|
LD_LIBRARY_PATH=${NEXMON_ROOT}/buildtools/isl-0.10/.libs make ARCH=arm CC="$CROSS_COMPILE"
|
|
61
|
# copy RPi0W & RPi3 firmware
|
|
49
|
cd ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon
|
|
62
|
cp ${NEXMON_ROOT}/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.nexmon.bin
|
|
50
|
make clean
|
|
63
|
cp -f ${NEXMON_ROOT}/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.bin
|
|
51
|
LD_LIBRARY_PATH=${NEXMON_ROOT}/buildtools/isl-0.10/.libs make ARCH=arm CC="$CROSS_COMPILE"
|
|
64
|
fi
|
|
52
|
# RPi0w->3B firmware
|
|
65
|
|
|
53
|
mkdir -p "${basedir}"/kali-${architecture}/lib/firmware/brcm
|
|
66
|
if [ "$RPI_MODEL" = 3P ] ; then
|
|
54
|
cp ${NEXMON_ROOT}/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin "${basedir}"/kali-${architecture}/lib/firmware/brcm/brcmfmac43430-sdio.nexmon.bin
|
|
67
|
cd ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon
|
|
55
|
cp ${NEXMON_ROOT}/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin "${basedir}"/kali-${architecture}/lib/firmware/brcm/brcmfmac43430-sdio.bin
|
|
68
|
make clean
|
|
56
|
#wget https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm/brcmfmac43430-sdio.txt -O "${basedir}"/kali-${architecture}/lib/firmware/brcm/brcmfmac43430-sdio.txt
|
|
69
|
|
|
57
|
# RPi3B+ firmware
|
|
70
|
# We do this so we don't have to install the ancient isl version into /usr/local/lib on systems.
|
|
58
|
cp ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon/brcmfmac43455-sdio.bin "${basedir}"/kali-${architecture}/lib/firmware/brcm/brcmfmac43455-sdio.nexmon.bin
|
|
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-
|
|
59
|
cp ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon/brcmfmac43455-sdio.bin "${basedir}"/kali-${architecture}/lib/firmware/brcm/brcmfmac43455-sdio.bin
|
|
72
|
|
|
60
|
#wget https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm/brcmfmac43455-sdio.txt -O "${basedir}"/kali-${architecture}/lib/firmware/brcm/brcmfmac43455-sdio.txt
|
|
73
|
# RPi3B+ firmware
|
|
61
|
# Make a backup copy of the rpi firmware in case people don't want to use the nexmon firmware.
|
|
74
|
cp ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon/brcmfmac43455-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.nexmon.bin
|
|
62
|
# The firmware used on the RPi is not the same firmware that is in the firmware-brcm package which is why we do this.
|
|
75
|
cp -f ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon/brcmfmac43455-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.bin
|
|
63
|
#wget https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm/brcmfmac43430-sdio.bin -O "${basedir}"/kali-${architecture}/lib/firmware/brcm/brcmfmac43430-sdio.rpi.bin
|
|
76
|
fi
|
|
64
|
#wget https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm/brcmfmac43455-sdio.bin -O "${basedir}"/kali-${architecture}/lib/firmware/brcm/brcmfmac43455-sdio.rpi.bin
|
|
77
|
fi
|
|
65
|
# This is required for any wifi to work on the RPi 3B+
|
|
|
|
|
66
|
#wget https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm/brcmfmac43455-sdio.clm_blob -O "${basedir}"/kali-${architecture}/lib/firmware/brcm/brcmfmac43455-sdio.clm_blob
|
|
|
|