Last active
June 28, 2023 21:49
-
-
Save Ujjwal0501/2b38127d0fd7d9c356f143e436811606 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
KEY_PATH="$HOME/localpairs" | |
# install necessary tools | |
sudo apt-get install git build-essential curl openssl mokutil -y | |
build_module () { | |
# pull `iwlwifi` repo, patch and build module | |
if ! [ -d "backport-iwlwifi" ]; then | |
git clone https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git | |
fi | |
cd backport-iwlwifi | |
git checkout 1a5d2ea7a5eb857214311dfd73aef2d4bc8bdca3 -f | |
# download the patch | |
if ! [ -f "v2-wifi-iwlwifi-pcie-add-device-id-51F1-for-killer-1675.diff" ]; then | |
curl -L https://gist.githubusercontent.com/Ujjwal0501/2b38127d0fd7d9c356f143e436811606/raw/760948b5f9d3d87869ee0afaabc1a37c75d114fc/v2-wifi-iwlwifi-pcie-add-device-id-51F1-for-killer-1675.diff --output v2-wifi-iwlwifi-pcie-add-device-id-51F1-for-killer-1675.diff | |
fi | |
git apply v2-wifi-iwlwifi-pcie-add-device-id-51F1-for-killer-1675.diff | |
make defconfig-iwlwifi-public | |
sed -i 's/CPTCFG_IWLMVM_VENDOR_CMDS=y/# CPTCFG_IWLMVM_VENDOR_CMDS is not set/' .config | |
make -j16 | |
} | |
create_mok () { | |
# create new key | |
if ! [ -f "$KEY_PATH/MOK.priv" ] || ! [ -f "$KEY_PATH/MOK.der" ] ; then | |
mkdir -p "$KEY_PATH" | |
openssl req -new -x509 -newkey rsa:2048 -nodes -days 36500 -outform DER -keyout "$KEY_PATH/MOK.priv" -out "$KEY_PATH/MOK.der" | |
sudo mokutil --import "$KEY_PATH/MOK.der" | |
fi | |
} | |
sign_module () { | |
# sign the built modules | |
find . -name '*.ko' | while IFS=" " read -r i; do echo ""; echo "Signing '$i' ..."; kmodsign sha512 "$KEY_PATH/MOK.priv" "$KEY_PATH/MOK.der" "$i"; hexdump -Cv "$i" | tail -n 5; done | |
} | |
install_module () { | |
sudo make install | |
} | |
load_module () { | |
# reload the installed module | |
sudo modprobe -r iwlwifi || sudo modprobe iwlwifi # reboot is required to install the new MOK | |
} | |
create_mok | |
build_module | |
sign_module | |
install_module | |
load_module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c | |
index 99768d6a6..34592d8cb 100644 | |
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c | |
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c | |
@@ -679,6 +679,8 @@ static const struct iwl_dev_info iwl_dev_info_table[] = { | |
IWL_DEV_INFO(0x2726, 0x1672, iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_killer_1675i_name), | |
IWL_DEV_INFO(0x51F0, 0x1671, iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_killer_1675s_name), | |
IWL_DEV_INFO(0x51F0, 0x1672, iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_killer_1675i_name), | |
+ IWL_DEV_INFO(0x51F1, 0x1671, iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_killer_1675s_name), | |
+ IWL_DEV_INFO(0x51F1, 0x1672, iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_killer_1675i_name), | |
IWL_DEV_INFO(0x54F0, 0x1671, iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_killer_1675s_name), | |
IWL_DEV_INFO(0x54F0, 0x1672, iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_killer_1675i_name), | |
IWL_DEV_INFO(0x7A70, 0x1671, iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_killer_1675s_name), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment