0

After a fresh installation of Debian 13 my next task was to download, build and install the driver rtl8852au* for my USB WiFi adapter. A driver for this adapter is unfortunately not included in the Debian repositories. Building the driver works as expected but when running make install I get the error

cp: cannot create regular file '/usr/lib/systemd/system-sleep/.': No such file or directory
make: *** [Makefile:651: install] Error 1

In Debian 12 I built and installed this driver with no problems so apparently the system-sleep directory was present in Debian 12 but not in Debian 13. Has this directory been deprecated or is it created upon installation of a systemd package which I should apt get?

*https://github.com/lwfinger/rtl8852au

4
  • 1
    by the way, are you sure you need the external driver? A quick search through the linux kernel shows me that there's drivers for 8852au included in modern Linux. And looking at the software quality of that git repo, ahem, maybe if you can avoid it? Commented Aug 14 at 12:05
  • @MarcusMüller The WiFi interface didn't show up in the output from ip link. Debian 13 currently uses kernel version 6.12. Do you mean I should just be able to use the adapter directly after connecting it to the computer with no additional installation or configuration? Commented Aug 15 at 12:27
  • you might need to install the firmware package, but other than that, that would seem possible at least. Commented Aug 15 at 15:05
  • @MarcusMüller It seem like only the bluetooth driver 8852au is available in the repositories. After installing the package firmware-realtek the command find /lib/firmware/ -iname '*8852au*' finds two files in /lib/firmware/rtl_bt but not in /lib/firmware/rtlwifi. I also tried uninstalling the github driver and restarting the computer but then no WiFi interface showed up when running ip link. Commented Aug 15 at 16:41

1 Answer 1

3

It's a bit of a "fallback" mechanism in systemd, and so few upstream packages (if any) make use of that directory, and in any case, the first one to use it would be the one to create it.

That's pretty standard in installation scripts. The Makefile from that out-of-kernel module actually does that for the module directory, but forgoes to do it for the system-sleep directory. Well. So, go into your Makefile and change

install:
    @mkdir -p $(MODDESTDIR)realtek/rtw89/
    install -p -m 644 $(MODULE_NAME).ko  $(MODDESTDIR)realtek/rtw89/
    /sbin/depmod -a ${KVER}
    @cp suspend_rtw8852au /usr/lib/systemd/system-sleep/.

uninstall:
    rm -f $(MODDESTDIR)realtek/rtw89/$(MODULE_NAME).ko
    /sbin/depmod -a ${KVER}

to

# Bad style:
# should require the module to be built first
# and should update if you change the suspend script
install: $(MODULE_NAME).ko suspend_rtw8852au
    @mkdir -p $(MODDESTDIR)realtek/rtw89/
    install -p -m 644 $(MODULE_NAME).ko  $(MODDESTDIR)realtek/rtw89/
    /sbin/depmod -a ${KVER}
    @mkdir -p /usr/lib/systemd/system-sleep
    install -m 644 suspend_rtw8852au /usr/lib/systemd/system-sleep/.

# Forgot to uninstall the suspend script
uninstall:
    rm -f $(MODDESTDIR)realtek/rtw89/$(MODULE_NAME).ko 
    /sbin/depmod -a ${KVER}
    rm -f /usr/lib/systemd/system-sleep/suspend_rtw8852au

(when changing, make sure to use Tabs, not spaces, for the indents here – make is very particular on these. It has to be tabulator indents!)

(There's more things that aren't good about that Makefile – it's incorrect about the targets that are phony etc., the actual build targets don't depend on the source files, and whatever the developer thought when he wrote the clean: target – but let's not fix these in a Stack Exchange post.)

3
  • 1
    Oh, that clean target is something special… Commented Aug 14 at 11:52
  • @Kusalananda and it's 4 years old, so "spat out by an LLM and I didn't really care" doesn't work, either. Commented Aug 14 at 12:01
  • OK, thanks for the explanation. I simply created the system-sleep directory as a workaround. Commented Aug 15 at 12:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.