Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build.sh -b fails on Kali 5 #1

Closed
aciidic opened this issue Aug 6, 2019 · 4 comments
Closed

build.sh -b fails on Kali 5 #1

aciidic opened this issue Aug 6, 2019 · 4 comments

Comments

@aciidic
Copy link

aciidic commented Aug 6, 2019

Hi, thanks for this but I'm unable to install the backports driver for RTL8187.

I've also tried newer versions at https://mirrors.edge.kernel.org/pub/linux/kernel/projects/backports/stable/ without any luck, it fails on drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c

Hoping you can help please?

root@kali:~/backports-rtl8187# uname -r
4.19.0-kali5-amd64

Here's the output:


root@kali:~/backports-rtl8187# ./build.sh -b
--2019-08-06 12:01:02--  https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v4.14-rc2/backports-4.14-rc2-1.tar.xz
Resolving www.kernel.org (www.kernel.org)... 136.144.49.103, 2604:1380:40b0:1a00::1
Connecting to www.kernel.org (www.kernel.org)|136.144.49.103|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://mirrors.edge.kernel.org/pub/linux/kernel/projects/backports/stable/v4.14-rc2/backports-4.14-rc2-1.tar.xz [following]
--2019-08-06 12:01:02--  https://mirrors.edge.kernel.org/pub/linux/kernel/projects/backports/stable/v4.14-rc2/backports-4.14-rc2-1.tar.xz
Resolving mirrors.edge.kernel.org (mirrors.edge.kernel.org)... 147.75.101.1, 2604:1380:2001:3900::1
Connecting to mirrors.edge.kernel.org (mirrors.edge.kernel.org)|147.75.101.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5388800 (5.1M) [application/x-xz]
Saving to: ‘backports.tar.xz’

backports.tar.xz              100%[===============================================>]   5.14M   843KB/s    in 6.5s    

2019-08-06 12:01:09 (807 KB/s) - ‘backports.tar.xz’ saved [5388800/5388800]

checking file drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
checking file defconfigs/rtl8187
patching file drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
patching file defconfigs/rtl8187
checking file net/mac80211/cfg.c
Hunk #1 succeeded at 747 (offset 167 lines).
checking file net/mac80211/tx.c
Hunk #1 succeeded at 802 (offset 7 lines).
Hunk #2 succeeded at 1925 (offset 258 lines).
checking file net/wireless/chan.c
Hunk #1 succeeded at 976 (offset 119 lines).
checking file drivers/net/wireless/zydas/zd1211rw/zd_mac.c
Hunk #2 succeeded at 1061 (offset -1 lines).
Hunk #3 succeeded at 1405 (offset -1 lines).
checking file drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
patching file net/mac80211/cfg.c
Hunk #1 succeeded at 747 (offset 167 lines).
patching file net/mac80211/tx.c
Hunk #1 succeeded at 802 (offset 7 lines).
Hunk #2 succeeded at 1925 (offset 258 lines).
patching file net/wireless/chan.c
Hunk #1 succeeded at 976 (offset 119 lines).
patching file drivers/net/wireless/zydas/zd1211rw/zd_mac.c
Hunk #2 succeeded at 1061 (offset -1 lines).
Hunk #3 succeeded at 1405 (offset -1 lines).
patching file drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
Generating local configuration database from kernel ... done.
cc -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer   -c -o conf.o conf.c
cc -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer   -c -o zconf.tab.o zconf.tab.c
In file included from zconf.tab.c:2576:
confdata.c: In function ‘conf_write’:
confdata.c:773:19: warning: ‘%s’ directive writing likely 7 or more bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
  sprintf(newname, "%s%s", dirname, basename);
                   ^~~~~~
confdata.c:773:19: note: assuming directive output of 7 bytes
confdata.c:773:2: note: ‘sprintf’ output 1 or more bytes (assuming 4104) into a destination of size 4097
  sprintf(newname, "%s%s", dirname, basename);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
confdata.c:776:20: warning: ‘.tmpconfig.’ directive writing 11 bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
   sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
                    ^~~~~~~~~~~~~~~~~
confdata.c:776:3: note: ‘sprintf’ output between 13 and 4119 bytes into a destination of size 4097
   sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc   conf.o zconf.tab.o   -o conf
#
# configuration written to .config
#
make[5]: 'conf' is up to date.
#
# configuration written to .config
#
Building backport-include/backport/autoconf.h ... done.
  CC [M]  /root/backports-rtl8187/tmp/backports/compat/main.o
  LD [M]  /root/backports-rtl8187/tmp/backports/compat/compat.o
  CC [M]  /root/backports-rtl8187/tmp/backports/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.o
  CC [M]  /root/backports-rtl8187/tmp/backports/drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8225.o
  CC [M]  /root/backports-rtl8187/tmp/backports/drivers/net/wireless/realtek/rtl818x/rtl8187/leds.o
  CC [M]  /root/backports-rtl8187/tmp/backports/drivers/net/wireless/realtek/rtl818x/rtl8187/rfkill.o
  LD [M]  /root/backports-rtl8187/tmp/backports/drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8187.o
  CC [M]  /root/backports-rtl8187/tmp/backports/net/mac80211/main.o
In file included from /root/backports-rtl8187/tmp/backports/net/mac80211/sta_info.h:18,
                 from /root/backports-rtl8187/tmp/backports/net/mac80211/ieee80211_i.h:35,
                 from /root/backports-rtl8187/tmp/backports/net/mac80211/main.c:28:
/root/backports-rtl8187/tmp/backports/net/mac80211/sta_info.h: In function ‘ewma_mesh_fail_avg_add’:
/root/backports-rtl8187/tmp/backports/include/linux/average.h:51:28: error: implicit declaration of function ‘ACCESS_ONCE’; did you mean ‘READ_ONCE’? [-Werror=implicit-function-declaration]
   unsigned long internal = ACCESS_ONCE(e->internal); \
                            ^~~~~~~~~~~
/root/backports-rtl8187/tmp/backports/net/mac80211/sta_info.h:334:1: note: in expansion of macro ‘DECLARE_EWMA’
 DECLARE_EWMA(mesh_fail_avg, 20, 8)
 ^~~~~~~~~~~~
/root/backports-rtl8187/tmp/backports/include/linux/average.h:60:28: error: lvalue required as left operand of assignment
   ACCESS_ONCE(e->internal) = internal ?   \
                            ^
/root/backports-rtl8187/tmp/backports/net/mac80211/sta_info.h:334:1: note: in expansion of macro ‘DECLARE_EWMA’
 DECLARE_EWMA(mesh_fail_avg, 20, 8)
 ^~~~~~~~~~~~
/root/backports-rtl8187/tmp/backports/net/mac80211/sta_info.h: In function ‘ewma_signal_add’:
/root/backports-rtl8187/tmp/backports/include/linux/average.h:60:28: error: lvalue required as left operand of assignment
   ACCESS_ONCE(e->internal) = internal ?   \
                            ^
/root/backports-rtl8187/tmp/backports/net/mac80211/sta_info.h:384:1: note: in expansion of macro ‘DECLARE_EWMA’
 DECLARE_EWMA(signal, 10, 8)
 ^~~~~~~~~~~~
/root/backports-rtl8187/tmp/backports/net/mac80211/ieee80211_i.h: In function ‘ewma_beacon_signal_add’:
/root/backports-rtl8187/tmp/backports/include/linux/average.h:60:28: error: lvalue required as left operand of assignment
   ACCESS_ONCE(e->internal) = internal ?   \
                            ^
/root/backports-rtl8187/tmp/backports/net/mac80211/ieee80211_i.h:431:1: note: in expansion of macro ‘DECLARE_EWMA’
 DECLARE_EWMA(beacon_signal, 4, 4)
 ^~~~~~~~~~~~
/root/backports-rtl8187/tmp/backports/net/mac80211/main.c: In function ‘ieee80211_alloc_hw_nm’:
/root/backports-rtl8187/tmp/backports/net/mac80211/main.c:638:2: error: implicit declaration of function ‘setup_timer’; did you mean ‘sk_stop_timer’? [-Werror=implicit-function-declaration]
  setup_timer(&local->dynamic_ps_timer,
  ^~~~~~~~~~~
  sk_stop_timer
cc1: some warnings being treated as errors
make[8]: *** [/usr/src/linux-headers-4.19.0-kali5-common/scripts/Makefile.build:309: /root/backports-rtl8187/tmp/backports/net/mac80211/main.o] Error 1
make[7]: *** [/usr/src/linux-headers-4.19.0-kali5-common/scripts/Makefile.build:549: /root/backports-rtl8187/tmp/backports/net/mac80211] Error 2
make[6]: *** [/usr/src/linux-headers-4.19.0-kali5-common/Makefile:1539: _module_/root/backports-rtl8187/tmp/backports] Error 2
make[5]: *** [Makefile:146: sub-make] Error 2
make[4]: *** [Makefile:8: all] Error 2
make[3]: *** [Makefile.build:6: modules] Error 2
make[2]: *** [Makefile.real:88: modules] Error 2
make[1]: *** [Makefile:43: modules] Error 2
make: *** [Makefile:30: default] Error 2
! Failed to build rtl8187 wireless driver.
root@kali:~/backports-rtl8187# 

@aciidic aciidic changed the title install.sh -b fails on Kali 5 build.sh -b fails on Kali 5 Aug 6, 2019
@JumpOff7667
Copy link

You have kernel 4.19 and you can't build because it is made for an older kernel version and the API has changed since then (setup_timer is now timer_setup...).
I've made modifications to this project (working kernel 4.19), check out my fork: https://github.com/JumpOff7667/backports-rtl8187

@aciidic
Copy link
Author

aciidic commented Aug 18, 2019

You have kernel 4.19 and you can't build because it is made for an older kernel version and the API has changed since then (setup_timer is now timer_setup...).
I've made modifications to this project (working kernel 4.19), check out my fork: https://github.com/JumpOff7667/backports-rtl8187

Thank you, I thought I'd checked forks but apparently not. Your code worked after apt-get install bison flex. Much appreciated!

@matrix
Copy link
Owner

matrix commented Jan 18, 2020

Fixed in the last commit. Thanks

@Karigar4039
Copy link

CC [M] /root/backports-rtl8187/tmp/backports/net/wireless/util.o
In file included from /root/backports-rtl8187/tmp/backports/net/wireless/util.c:15:
/root/backports-rtl8187/tmp/backports/include/net/cfg80211.h: In function ‘wdev_address’:
/root/backports-rtl8187/tmp/backports/include/net/cfg80211.h:5328:36: warning: return discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
5328 | return wdev->netdev->dev_addr;
| ~~~~~~~~~~~~^~~~~~~~~~
/root/backports-rtl8187/tmp/backports/net/wireless/util.c: In function ‘cfg80211_send_layer2_update’:
/root/backports-rtl8187/tmp/backports/net/wireless/util.c:2121:9: error: implicit declaration of function ‘netif_rx_ni’; did you mean ‘netif_rx’? [-Werror=implicit-function-declaration]
2121 | netif_rx_ni(skb);
| ^~~~~~~~~~~
| netif_rx
cc1: some warnings being treated as errors
make[6]: *** [/usr/src/linux-headers-5.19.0-kali2-common/scripts/Makefile.build:254: /root/backports-rtl8187/tmp/backports/net/wireless/util.o] Error 1
make[5]: *** [/usr/src/linux-headers-5.19.0-kali2-common/scripts/Makefile.build:471: /root/backports-rtl8187/tmp/backports/net/wireless] Error 2
make[4]: *** [/usr/src/linux-headers-5.19.0-kali2-common/Makefile:1870: /root/backports-rtl8187/tmp/backports] Error 2
make[3]: *** [Makefile.build:13: modules] Error 2
make[2]: *** [Makefile.real:88: modules] Error 2
make[1]: *** [Makefile:43: modules] Error 2
make: *** [Makefile:30: default] Error 2
! Failed to build rtl8187 wireless driver.

Hello! by the way great effort.

but I am having difficulties. I have the following system details. host: Mac M1, guest: Kali Linux

Linux kali 5.19.0-kali2-arm64 #1 SMP Debian 5.19.11-1kali2 (2022-10-10) aarch64 GNU/Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants