From 17a59b052c062876ec2f9dfeea43124ef503fc08 2018-11-26 01:24:05 From: Unknown Date: 2018-11-26 01:24:05 Subject: [PATCH] a --- diff --git a/README.md b/README.md index b62ede0..567ae57 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ Enable onboard Bluetooth interface on the RPi0/3/3P. See: https://spellfoundry.c Enable Bluetooth to use this. Adds overlay to swap UART0 with UART1. Enabling (slower) Bluetooth and full speed serial console. - RPI `0` `3` `3P` have a fast `hardware UART0` (ttyAMA0) and a `mini UART1` (ttyS0)! RPI `1` `1P` `2` only have a `hardware UART0`. `UART0` is considered better, because is faster and more stable than `mini UART1`. By default the Bluetooth modem is mapped to the `hardware UART0` and `mini UART` is used for console. The `mini UART` is a problem for the serial console, because its baudrate depends on the cpu frequency, which is changing on runtime. Resulting in a volatile baudrate and thus in an unusable serial console. ##### `ENABLE_TURBO`=false -Enable Turbo mode. This setting locks cpu at highest frequency. As setting ENABLE_CONSOLE=true locks RPI to lowest CPU speed, this is can be used additionally to lock cpu hat max speed. Need a good power supply and probably cooling for the Raspberry PI. +VOIDS WARRANTY! Enable Turbo mode - NO overclocking. This setting locks cpu at highest frequency. As setting ENABLE_CONSOLE=true locks RPI to lowest CPU speed, this is can be used additionally to lock cpu hat max speed. Need a good power supply and probably cooling for the Raspberry PI. ##### `ENABLE_I2C`=false Enable I2C interface on the RPi2/3. Please check the [RPi2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins. diff --git a/bootstrap.d/13-kernel.sh b/bootstrap.d/13-kernel.sh index feea104..cb1930b 100644 --- a/bootstrap.d/13-kernel.sh +++ b/bootstrap.d/13-kernel.sh @@ -113,6 +113,7 @@ if [ "$BUILD_KERNEL" = true ] ; then set_kernel_config CONFIG_IP_NF_TARGET_SYNPROXY m set_kernel_config CONFIG_NETFILTER_XT_MATCH_CGROUP m set_kernel_config CONFIG_NETFILTER_XT_MATCH_IPCOMP m + set_kernel_config CONFIG_NETFILTER_XT_MATCH_SOCKET m set_kernel_config CONFIG_NFT_FIB_INET m set_kernel_config CONFIG_NFT_FIB_IPV4 m set_kernel_config CONFIG_NFT_FIB_IPV6 m @@ -120,7 +121,7 @@ if [ "$BUILD_KERNEL" = true ] ; then set_kernel_config CONFIG_NFT_OBJREF m set_kernel_config CONFIG_NFT_RT m set_kernel_config CONFIG_NFT_SET_BITMAP m - set_kernel_config CONFIG_NF_CONNTRACK_TIMEOUT m + set_kernel_config CONFIG_NF_CONNTRACK_TIMEOUT y set_kernel_config CONFIG_NF_LOG_ARP m set_kernel_config CONFIG_NF_SOCKET_IPV4 m set_kernel_config CONFIG_NF_SOCKET_IPV6 m diff --git a/bootstrap.d/15-rpi-config.sh b/bootstrap.d/15-rpi-config.sh index 9a646c3..9e8d9ed 100644 --- a/bootstrap.d/15-rpi-config.sh +++ b/bootstrap.d/15-rpi-config.sh @@ -67,6 +67,9 @@ fi #locks cpu at max frequency if [ "$ENABLE_TURBO" = true ] ; then echo "force_turbo=1" >> "${BOOT_DIR}/config.txt" + # helps to avoid sdcard corruption when force_turbo is enabled. + echo "boot_delay=1" >> "${BOOT_DIR}/config.txt" + fi if [ "$ENABLE_PRINTK" = true ] ; then diff --git a/bootstrap.d/44-nexmon_monitor_patch.sh b/bootstrap.d/44-nexmon_monitor_patch.sh index 8488acf..2be503a 100644 --- a/bootstrap.d/44-nexmon_monitor_patch.sh +++ b/bootstrap.d/44-nexmon_monitor_patch.sh @@ -21,7 +21,7 @@ if [ "$ENABLE_NEXMON" = true ] && [ "$ENABLE_WIRELESS" = true ]; then chown -R root:root "${R}"/tmp/nexmon # Set script Root - NEXMON_ROOT="${R}"/tmp/nexmon + export NEXMON_ROOT="${R}"/tmp/nexmon # Remove temporary directory for nexmon sources rm -fr "${temp_dir}" @@ -35,14 +35,16 @@ if [ "$ENABLE_NEXMON" = true ] && [ "$ENABLE_WIRELESS" = true ]; then # Setup Enviroment: see https://github.com/NoobieDog/nexmon/blob/master/setup_env.sh #ARCH="${KERNEL_ARCH}" #SUBARCH="${KERNEL_ARCH}" - KERNEL="${KERNEL_IMAGE}" - ARCH=arm - SUBARCH=arm - CC="${NEXMON_ROOT}"/buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/bin/arm-none-eabi- - CCPLUGIN="${NEXMON_ROOT}"/buildtools/gcc-nexmon-plugin/nexmon.so - ZLIBFLATE="zlib-flate -compress" - Q=@ - NEXMON_SETUP_ENV=1 + export KERNEL="${KERNEL_IMAGE}" + export ARCH=arm + export SUBARCH=arm + export CC="${NEXMON_ROOT}"/buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/bin/arm-none-eabi- + export CCPLUGIN="${NEXMON_ROOT}"/buildtools/gcc-nexmon-plugin/nexmon.so + export ZLIBFLATE="zlib-flate -compress" + export Q=@ + export NEXMON_SETUP_ENV=1 + export HOSTUNAME=$(uname -s) + export PLATFORMUNAME=$(uname -m) #. ./setup_env.sh # Make nexmon @@ -81,7 +83,25 @@ if [ "$ENABLE_NEXMON" = true ] && [ "$ENABLE_WIRELESS" = true ]; then cp -f "${NEXMON_ROOT}"/patches/bcm43455c0/7_45_154/nexmon/brcmfmac43455-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43455-sdio.bin fi + # Install kernel module + "${LIB_DIR}"/modules/${KERNEL_VERSION}/ + #Revert to previous directory cd "${WORKDIR}" || exit fi + +## To make the RPi load the modified driver after reboot +# Find the path of the default driver at reboot +# e.g. '/lib/modules/4.14.71-v7+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko' +PATH_OF_DEFAULT_DRIVER_AT_REBOOT=$(modinfo brcmfmac | grep -m 1 -oP "^filename:(\s*?)(.*)$" | sed -e 's/^filename:\(\s*\)\(.*\)$/\2/g') +# Backup the original driver +mv $PATH_OF_DEFAULT_DRIVER_AT_REBOOT "$PATH_OF_DEFAULT_DRIVER_AT_REBOOT.orig" +# Copy the modified driver (Kernel 4.14) +if is_pizero ; then + cp ./patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac_4.14.y-nexmon/brcmfmac.ko $PATH_OF_DEFAULT_DRIVER_AT_REBOOT +else + cp ./patches/bcm43455c0/7_45_154/nexmon/brcmfmac_4.14.y-nexmon/brcmfmac.ko $PATH_OF_DEFAULT_DRIVER_AT_REBOOT +fi +# Probe all modules and generate new dependency +depmod -a \ No newline at end of file diff --git a/functions.sh b/functions.sh index ce74b4e..38ac23a 100644 --- a/functions.sh +++ b/functions.sh @@ -80,7 +80,7 @@ chroot_remove_cc() { #https://github.com/sakaki-/bcmrpi3-kernel-bis/blob/master/conform_config.sh set_kernel_config() { # flag as $1, value to set as $2, config must exist at "./.config" - TGT="${1}" + TGT="CONFIG_${1#CONFIG_}" REP="${2}" if grep -q "^${TGT}[^_]" .config; then sed -i "s/^\(${TGT}=.*\|# ${TGT} is not set\)/${TGT}=${REP}/" .config