r/linuxhardware • • 11h ago

Guide I spent weeks investigating and fixing Realtek RTL8723DE Wi-Fi and Bluetooth problems on Linux

42 Upvotes

I've been working on fixing recurring Wi-Fi and Bluetooth problems with the Realtek RTL8723DE combo adapter (10ec:d723 Wi-Fi / 0bda:b009 Bluetooth).

This adapter has been particularly frustrating on Linux. The problems I investigated included:

Wi-Fi and Bluetooth becoming unavailable after a warm reboot.

Bluetooth USB initialization failures (-71).

Wi-Fi failing to initialize with -16 errors.

Wi-Fi degradation and potential coexistence-related problems.

Rather than relying on random workarounds, I decided to investigate what was actually happening inside the Linux kernel drivers.

I eventually developed two separate projects.

1. Driver-level patch (main project)

https://github.com/sudo-WearTherinG/linux-rtl8723de-driver-patch

This is the main project. It addresses driver shutdown and power-state handling rather than relying on userspace scripts.

The investigation went beyond ordinary troubleshooting. I traced execution paths through the Linux kernel's rtw88 Wi-Fi and btusb Bluetooth drivers, examined their shutdown and initialization sequences, and tracked how power-state transitions affect the shared hardware.

Some of the areas I investigated:

Code-path analysis: Tracing driver execution flow during initialization, shutdown, and reboot.

PCIe power management: Investigating Wi-Fi adapter power-state transitions, including PCI_D3hot.

USB runtime autosuspend: Examining Bluetooth USB power-management behavior.

Firmware and MAC state: Investigating whether the Wi-Fi MAC and firmware were properly shut down before reboot.

Bluetooth coexistence: Examining how Wi-Fi and Bluetooth coordinate through the shared hardware.

Register-level debugging: Investigating hardware register behavior, including REG_APS_FSMCO and initialization timeouts.

Reproducibility testing: Testing different Wi-Fi and Bluetooth power-state combinations across repeated reboot cycles.

I performed 200+ reboot tests on my HP 15-da0xxx laptop running Omarchy Linux.

The driver-level changes resolved the reboot-related failures in my testing.

Upstream kernel submission

I also submitted a Wi-Fi shutdown patch to the Linux kernel mailing list.

The patch received review feedback from Ping-Ke Shih, the rtw88 maintainer. He suggested using the existing rtw_enter_ips() function instead of manually handling the Wi-Fi power-off sequence.

I tested that approach, revised the patch accordingly, and submitted a v2:

[PATCH v2] wifi: rtw88: pci: Enter IPS before PCI_D3hot on shutdown

The revised patch is awaiting further upstream review. It has not yet been reviewed yet due to their work holiday.

2. Warm-reboot workaround

https://github.com/sudo-WearTherinG/rtl8723de_warm_reboot_fix

This was my first solution, before I identified the underlying driver-level problem.

It uses a systemd service to unload the Bluetooth and Wi-Fi modules before shutdown or reboot.

It is intended for users experiencing reboot-related problems who want a workaround without modifying or rebuilding kernel drivers.

Testing limitations

I only have one laptop with this particular adapter, so I cannot claim that the patches work across every RTL8723DE implementation or laptop.

The testing was extensive on my hardware, but broader testing from other users would be valuable.

Both repositories contain the investigation, patches, testing details, and instructions. The main repository also includes HTML documentation explaining the technical findings.

I'm sharing this because I suspect other Linux users have been dealing with these problems for years without knowing what causes them.

If you own an RTL8723DE-based laptop and have experienced similar issues, I'd be interested in hearing about your experience.

In total I found 4 ways to make this card behave.

::: Here are the tracking links for upstream status: :::

I've submitted fixes for both the Wi-Fi and Bluetooth sides of the issue to the upstream Linux kernel mailing lists.

You can follow the submissions, maintainer feedback, and any future revisions here:

Wi-Fi (rtw88):
https://lore-kernel.gnuweeb.org/linux-wireless/20261127083729.7030-1-shindeswapnil028%40gmail.com/T/

Bluetooth (btusb):
https://lore-kernel.gnuweeb.org/linux-bluetooth/20261127004644.8363-1-shindeswapnil028%40gmail.com/T/

These are the actual upstream discussions. You can check for new replies and see whether the patches are reviewed, revised, accepted, or rejected.

Neither patch has been merged into the upstream kernel yet. I'm waiting for further maintainer feedback and review, hopefully starting Monday.


r/linux_on_mac • • 10h ago

MacBook and linux

Thumbnail
1 Upvotes

r/buildalinuxpc • • Oct 14 '26

Help

2 Upvotes

I can't get passed a black screen on linux I have an amd ryzen 5 3500, 32gb ram, 1tb nvme ssd, and Intel arc b580


r/linux_devices • • Mar 31 '24

Breaking News: Liber8 Proxy has released Anti-Detect Virtual Machines with Anti-Detect & Residential Proxies. OS Windows & Kali, enabling users to create multiple users on their Clouds, each User with Unique Device Fingerprints, Unlimited Residential Proxies (Zip Code Targeting) and RDP/VNC Access.

Thumbnail
self.Proxy_VPN
0 Upvotes

r/AMD_Linux • • Jan 04 '20

Build my data center under linux: question APU+motherboard

5 Upvotes

Hi! I would like to build my own data center. Therefore I consider buying an athlon 3000G. I know it s compatible AM4 like every other Apu CPU of the last 3 years and so compatible with series 300, 400, 500 motherboard.

Question is: Does the oldest motherboard need the bios update when I buy them or the constructor is doing it by default now ?

I don't have any other older AMD part to do the update :/

Of if you have an other better idea on what components should I put inside. I try to build it, as inexpensive as possible, to seed , ddl torrent, and share files with my family. And able to stream 4k out of it.


r/tuxrate • • Dec 03 '17

2012 macbook air

1 Upvotes

I install Debain [stretch] [mate] [yep], works like a charm.

Issues I had

-1 The temperature sensors didn't want to work properly -or at all I should say. But after a quick google search, all was good.

-2 When first installed wifi doesn't work but you can easily fix it without having to buy a usb to ethernet adapter. I think I just googled it on another machine then transfered the file over & installed like a boss.

-3 Realizing that I am more of a hipster than normal macbook users being that I am using a macbook but am too good to use macos.

& that's pretty it dudes. Have fun.


r/linux_on_mac • • 1d ago

Forked b43 as a dkms with support for AC and improved support for HT

5 Upvotes

Hello guys,

I have a lot of routers with early Broadcom AC wifi chips (bcm4352, bcm4360), so I spent 5 months improving b43 to fully support AC and it seems to work. Now, since I just wasted those 5 months anyway, I figured I could make a dkms for users wishing to free themselves from proprietary wl.

Some improved support for HT was added along the way.

So if you feel lucky and wish to be a tester, you can just try my driver: https://github.com/aleferri/b43-next (you need to compile it yourself)


r/linux_on_mac • • 1d ago

Got a 2012 MacBook Air for $30. What's the most Mac-looking Linux distro I can put on it?

Thumbnail gallery
18 Upvotes

Just picked up a 13" MacBook Air (Mid 2012) on a Japanese auction site for 4,300 yen with a coupon, so about $30. It's the 2GHz Core i7 model with 8GB of RAM and a 512GB SSD. There are a few scuffs, but it boots fine and the battery still holds a decent charge.
Apple stopped supporting this thing years ago, so Linux it is. Honestly, my whole plan is to sit in Starbucks with a coffee looking smug, so I want something that looks and feels like macOS (a dock, a global menu bar, all that) and still runs smoothly on old hardware.
What would you put on it? Extra points if Wi-Fi and the brightness and volume keys work without a fight.


r/linuxhardware • • 15h ago

News Linux Fan Control for the Alchemist Series and XMX.

Thumbnail
0 Upvotes

r/linux_on_mac • • 1d ago

From Toaster to Scalpel Upgrade: My 12-inch MacBook running Debian 13, a few months later

5 Upvotes

A few months ago, I posted here about my experience bringing an old 12-inch MacBook back to life with Debian 13. Some of you may remember the "From Toaster to Scalpel" post (https://www.reddit.com/r/linux_on_mac/comments/1wk58wt/from_toaster_to_scalpel_the_odyssey_of_reviving_a/).

Well, I'm still using it, and quite a few things have changed since then. Some of the solutions I was so excited about in my original post didn't survive everyday use.

First, a small correction: the machine is actually a 2017 model (MacBook10,1), not a 2016.

Closing the lid finally works!

Probably my biggest achievement since the original post.

Getting suspend and resume to work reliably on this particular MacBook was a nightmare. Eventually, I gave up on conventional suspend and decided to try hibernation instead.

Using the swap partition, a systemd sleep hook to unload the Broadcom Wi-Fi modules before hibernation, an ACPI lid event and a couple of custom scripts, I finally got the behaviour I wanted.

I close the lid, the machine hibernates. I open the lid, the MacBook powers itself on and restores my previous session.

No need to press the power button. My applications are still there and Wi-Fi reconnects automatically.

It took far too long to get something that sounds so simple working, but I'm pretty happy with the result.

Here is the work: https://www.reddit.com/r/debian/comments/1y5gk84/debian_13_on_a_2017_12inch_macbook_i_finally_got/

Goodbye Pantheon Files... after all those hours compiling it!

Yes, I know. I spent several hours compiling Pantheon Files for Debian 13 and even dedicated an entire section of my original post to it.

And now I'm back to Nautilus.

I found an extension called Nautilus My Computer that adds Miller columns, just like Finder on macOS. Although the project primarily targets Nautilus 50 and above, it's working on my Debian 13 installation with Nautilus 48.3.

Sometimes the simplest solution turns up after you've already spent hours building the complicated one.

The endless search for a decent email client

This one has been quite a journey.

In my original post, I was very happy with Vireo Mail, which later became Hylki. Unfortunately, performance with multiple accounts wasn't quite what I needed.

Since then, I've tried Hylki, Letter, Convey, Geary and Lookout. I even compiled Lookout from source and built a Debian package for it.

Guess where I ended up?

Thunderbird.

Yes, the same application I had originally dismissed.

The difference this time is Microsoft Graph support. I can now connect my Microsoft 365 Exchange account without relying on paid third-party extensions such as Owl.

Performance is noticeably better than what I previously experienced with OWA/EWS-based solutions.

I still prefer the simplicity of Apple Mail's interface, but at some point I have to stop testing email clients and actually answer my emails.

Some interesting new office applications

OnlyOffice was my choice in the original post, mainly because I work in a Microsoft Office environment and document compatibility matters to me.

I've recently started experimenting with three relatively new projects from ArtCraft:

  • WordCraft
  • GridCraft
  • DeckCraft

WordCraft and GridCraft have been pleasant surprises. Both are already quite usable for basic document and spreadsheet work.

DeckCraft, on the other hand, still needs quite a bit of work. It opens and edits PowerPoint files, but its functionality is limited, and I haven't even found a way to change the interface language from English.

I'm not ready to replace OnlyOffice with them, but they're definitely projects worth following.

Living with a customized GNOME desktop

I'm still running GNOME under Wayland, with pretty much the same macOS-inspired desktop I showed in my original post.

However, I recently replaced Dash to Dock with Dash2Dock. If you remember my original post, one of the things I missed was the macOS-style icon magnification effect.

Dash2Dock brings that back, making the dock feel much closer to the original macOS experience.

And this time, I managed to do it all by myself, without asking AI for help. LOL.

Antivirus on Linux?

Before anyone asks why, I use this machine in a corporate environment and regularly exchange files with Windows users.

I've installed ClamAV with ClamUI as a graphical frontend. Getting the frontend to communicate properly with the ClamAV daemon required a little extra configuration, but it's now working.

And yes, I prefer having a graphical interface rather than opening a terminal every time I want to scan a file.

So, was it worth it?

Absolutely.

Several months later, Debian 13 is still running on this little MacBook. It's still considerably cooler and more responsive than it was running newer versions of macOS through OCLP.

What I find particularly interesting is how my priorities have changed. At the beginning, I was obsessed with making Linux look and feel like macOS. These days, I'm much more interested in finding applications that actually work well for me.

It's no longer an experiment. It's a computer I use for actual work.

Apple stopped supporting it years ago. Apparently, nobody told Debian.

And yes, I still love this little fanless MacBook.

Loui.


r/linuxhardware • • 1d ago

News Manjaro is breathing some new life into my sisters unused toaster (I know there are lighter distros, but its working great) Any ideas on what to use it for

Post image
11 Upvotes

r/linuxhardware • • 1d ago

Question NVIDIA GEFORCE GT720M

2 Upvotes

Any driver support for debian 13? I'm sticking with it.


r/linuxhardware • • 23h ago

Question Advanced Optimus?

Thumbnail
1 Upvotes

r/linuxhardware • • 1d ago

Support how to get ahold of pine64 phones

4 Upvotes

I recently found out that PINE64 had discontinued manufacturing these, which is a bit unfortunate because I was hoping to experiment with one.

I'm interested in building an open-source assistant that can operate the entire phone through voice, natural language, and potentially other forms of interaction. I want to explore what becomes possible when you have full control over the hardware and software stack, rather than being constrained by shitty permission models and what kind of delta this would even enable.

I can root phones i currently have (which it seems like ill have to end up doing anyway) but i wanted to experiment with the PinePhone or PinePhone Pro as a starting point.

Does anyone know where I could get my hands on one? Also happy to buy a used device from someone who's no longer using theirs.


r/linuxhardware • • 1d ago

Product Announcement I made DockWatch — a live, ThinkPad-styled map of your dock and laptop ports

Post image
0 Upvotes

I wanted to see at a glance what's plugged in where on my ThinkPad L14 + Ultra Dock (40AJ), so I built a small app for it.

What it does:

• Draws the real port layout of the dock's rear panel and both sides of the laptop. Ports glow when something is plugged in.

• Per port: device name, USB speed, current draw, disk/network throughput with a tiny graph, and USB-C Power Delivery info.

• Detects phone modes (MTP/PTP/ADB), SD card, headphone jack and monitors (name from EDID).

• Header shows camera/mic state (and which app is using them), F1/F4 mute LEDs, keyboard backlight level, battery wear, Wi-Fi/Bluetooth.

• CPU/GPU/SSD temps and fan RPM under the vent grille, which glows red as the laptop heats up.

• Right-click a port to safely remove a drive. Notifications on plug/unplug, plus a "don't forget your flash drive" reminder when you undock.

• Can blink the red dot on the ThinkPad lid when something is plugged in.

• Tray icon, window, terminal UI and a Plasma 6 panel widget. UI in English, Ukrainian and Russian.

• Themes: ThinkPad, IBM (red/green/blue) and light. Also supports an HP EliteBook Folio 1040 G3 with its own HP theme.

It only reads /sys (no root), Python + PySide6.

Docks and laptops are plain JSON profiles, so adding your model is easy. Send a photo of the ports and your lsusb output and I'll add it.

GitHub: https://github.com/Watashik/DockWatch

Feedback and profiles for other docks and ThinkPads are very welcome!


r/linuxhardware • • 1d ago

Review I built a small GTK 4 / libadwaita utility to manage Tenda AIC 8800D80 USB Wi-Fi/Bluetooth adapters on Linux

1 Upvotes

Dual Wi-Fi and Bluetooth USB dongles based on the AIC8800D80 chipset (2604:001f) can be a bit annoying on laptops with built-in wireless adapters: duplicate Bluetooth controllers, NetworkManager juggling two Wi-Fi interfaces, and the need for manual udev/sysfs tweaks.

I built tenda-control, an unofficial desktop application written in Python using GTK 4 and libadwaita, to make managing these adapters easier.

Features:

  • Real-time status monitoring for the Tenda USB adapter, internal Wi-Fi, internal USB Bluetooth, and active IPv4 route.
  • Native libnm Wi-Fi network picker for the USB adapter, supporting WPA3, WPA2, open networks, and preconfigured 802.1X profiles.
  • One-click radio modes and manual toggles using pkexec, with automatic rollback on failure.
  • Persistent udev rules for plug-in behavior and power management.
  • Built-in, per-interface HTTPS speed tests using Cloudflare and LibreSpeed.

GitHub repository (MIT license):
https://github.com/AMorales22T/tenda-control

Feedback, bug reports, and pull requests are very welcome, especially contributions that extend support to additional AIC8800 USB device IDs!


r/linux_on_mac • • 2d ago

IT'S ALIVE! Debian Forky/Sid on 2013 Mac Pro 6,1 with Dual Radeon D700

Thumbnail gallery
13 Upvotes

r/linuxhardware • • 1d ago

Support Steam OS and wifi / bt adaptor

Thumbnail
1 Upvotes

r/linuxhardware • • 1d ago

News Tuxedo has now an official packages repository

4 Upvotes

Much probably already know, but Tuxedo has now an official packages repository: https://www.tuxedocomputers.com/en/Add-TUXEDO-software-package-sources.tuxedo

They have packages for multiple distributions.


r/linux_on_mac • • 2d ago

IT'S ALIVE! Debian Forky/Sid on 2013 Mac Pro 6,1 with Dual Radeon D700

Thumbnail gallery
3 Upvotes

r/linux_on_mac • • 2d ago

Debian 13 on a 2017 12-inch MacBook: I finally got hibernation working

17 Upvotes

I've been running Debian 13 on my 2017 12-inch Retina MacBook for a while now. Most things have been working pretty well, but there was one problem I had practically given up on: sleep and hibernation.

Every time I tried normal suspend, something would go wrong when the machine woke up. Sometimes the keyboard or trackpad wouldn't respond, and other times I had problems with the display or other hardware.

Eventually, I disabled suspend altogether. Closing the lid would turn off the screen, but Debian kept running in the background.

Not exactly ideal for a laptop.

A few days ago, I came across this Debian discussion and the accompanying MacBook8,1 sleep/hibernation guide.

That got me interested in trying again.

My MacBook is a different model, so I couldn't simply copy everything. After several tests, some mistakes, and a fair amount of troubleshooting, I finally have it working.

Here's what I did.

My hardware

  • Apple MacBook Retina 12-inch, 2017
  • Model identifier: MacBook10,1
  • Debian 13 (Trixie)
  • GNOME / Wayland
  • Kernel: 6.12.117+deb13-amd64
  • 8 GB RAM
  • 256 GB Apple SSD
  • Broadcom BCM4350/5 Wi-Fi (brcmfmac)
  • Apple SPI keyboard and trackpad (applespi)

One important difference from the 2015 MacBook8,1 is the SPI controller.

Mine uses:

0000:00:1e.3 Intel Sunrise Point-LP Serial IO SPI Controller
Kernel driver: intel-lpss
SPI device: spi-APP000D:00

I decided not to touch the SPI controller or modify the applespi driver.

Instead of trying to fix normal suspend, I wanted to see whether direct hibernation could avoid the whole problem.

1. Checking hibernation support

First, I checked what the kernel supported:

cat /sys/power/state
cat /sys/power/mem_sleep
cat /sys/power/disk

Results:

freeze mem disk
[s2idle] deep
[platform] shutdown reboot suspend test_resume

So hibernation was available.

My machine already had these kernel parameters from previous troubleshooting:

mem_sleep_default=s2idle i915.enable_psr=0

I left them unchanged. I haven't tested whether removing them affects hibernation.

2. Configuring the swap partition

My Debian installation already had two swap areas:

  • A dedicated swap partition, approximately 7.9 GiB.
  • An additional 8 GiB swap file.

The swap partition was /dev/nvme0n1p3.

I identified its UUID with:

sudo blkid /dev/nvme0n1p3

Then configured /etc/initramfs-tools/conf.d/resume:

RESUME=UUID=<YOUR-SWAP-PARTITION-UUID>

Obviously, replace the placeholder with the UUID of your own swap partition.

After that:

sudo update-initramfs -u -k "$(uname -r)"

For the initial tests, I disabled the additional swap file:

sudo swapoff /swapfile

This left the dedicated swap partition available for hibernation.

A word of caution: my swap partition is only slightly larger than my installed RAM. It worked during my tests, but it may not be sufficient under every memory workload.

3. Enabling hibernation in systemd

This was my first obstacle.

Some time ago, while trying to stop the suspend problems, I had masked the systemd sleep targets.

When I tried:

sudo systemctl hibernate

I got:

Call to Hibernate failed: Access denied

The journal explained why:

Unit hibernate.target is masked, refusing operation.

I fixed that with:

sudo systemctl unmask hibernate.target sleep.target
sudo systemctl mask suspend.target

This allowed hibernation while keeping conventional suspend disabled.

I tried again:

sudo systemctl hibernate

And it worked!

The MacBook powered off and restored my previous desktop session when I turned it back on.

Unfortunately, the built-in Wi-Fi had completely disappeared.

Restarting Debian brought it back, but that obviously wasn't a workable solution.

4. Getting Broadcom Wi-Fi back after hibernation

My wireless chipset uses brcmfmac, along with brcmfmac_wcc.

Initially, I tried unloading and reloading the driver manually, but got:

modprobe: FATAL: Module brcmfmac is in use.

Eventually, I created a systemd sleep hook to handle the driver automatically.

It stops NetworkManager before hibernation, attempts to unload the Broadcom modules, and starts everything again afterward.

First, create the directory:

sudo mkdir -p /usr/lib/systemd/system-sleep

Then create the script:

sudo tee /usr/lib/systemd/system-sleep/macbook-wifi >/dev/null <<'EOF'
#!/bin/bash

LOG=/var/log/macbook-wifi-hibernate.log

log() {
    echo "$(date '+%F %T') $*" >> "$LOG"
}

case "$1/$2" in
    pre/hibernate)
        log "PRE: preparing Broadcom"
        systemctl stop NetworkManager

        for i in {1..10}; do
            modprobe -r brcmfmac_wcc 2>>"$LOG"
            if modprobe -r brcmfmac 2>>"$LOG"; then
                log "PRE: Broadcom unloaded successfully"
                exit 0
            fi
            sleep 1
        done

        log "ERROR: unable to unload Broadcom"
        systemctl start NetworkManager
        exit 1
        ;;

    post/hibernate)
        log "POST: restoring Broadcom"
        modprobe brcmfmac >>"$LOG" 2>&1
        systemctl start NetworkManager
        log "POST: restoration finished"
        ;;
esac
EOF

sudo chmod +x /usr/lib/systemd/system-sleep/macbook-wifi

The script also creates a log at:

/var/log/macbook-wifi-hibernate.log

This was useful because whenever Wi-Fi disappeared, I had to restart the MacBook before I could continue investigating.

With this script installed, the internal Broadcom Wi-Fi started working again after hibernation.

I haven't tested the script with other Broadcom chipsets, so I wouldn't assume it works universally.

5. Another problem: Nautilus

During testing, one hibernation attempt failed with:

Freezing user space processes failed after 20.004 seconds
(5 tasks refusing to freeze)

Looking through the kernel journal, I found blocked processes belonging to Nautilus:

task:pool-38 state:D
task:nautilus state:D

My Debian setup uses GNOME Online Accounts, including Microsoft accounts, and GVFS exposes some remote volumes through Nautilus.

I suspect a remote filesystem operation may have been involved, but I couldn't establish the exact cause.

What I did was close Nautilus before requesting hibernation.

For manual hibernation, I created this small script:

sudo tee /usr/local/bin/macbook-hibernate >/dev/null <<'EOF'
#!/bin/bash

nautilus -q

sleep 2

exec sudo systemctl hibernate
EOF

sudo chmod +x /usr/local/bin/macbook-hibernate

I run it as my normal desktop user:

macbook-hibernate

An important detail: don't run this particular command with sudo. Nautilus needs the user's graphical session environment to close cleanly.

After adjusting that, manual hibernation worked, including restoration of the desktop session and Wi-Fi.

Closing Nautilus is a workaround in my configuration, not proof that Nautilus or GVFS is responsible for every hibernation failure.

6. Hibernating automatically when closing the lid

At this point, hibernation was working, but I still had to run a command.

I wanted the laptop to behave like a laptop again: close the lid, put it away, and continue working when I opened it.

I decided to use acpid.

First:

sudo apt install acpid

My /etc/systemd/logind.conf already contained these settings under [Login]:

HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore

I kept them because I didn't want systemd-logind to trigger conventional suspend when closing the lid.

Then I created the ACPI event:

sudo tee /etc/acpi/events/macbook-lid >/dev/null <<'EOF'
event=button/lid.*
action=/usr/local/sbin/macbook-lid-hibernate
EOF

And the script responsible for handling it:

sudo tee /usr/local/sbin/macbook-lid-hibernate >/dev/null <<'EOF'
#!/bin/bash

# Only act when the lid is closed
grep -qi closed /proc/acpi/button/lid/*/state || exit 0

# Avoid duplicate hibernation requests
exec 9>/run/macbook-lid-hibernate.lock
flock -n 9 || exit 0

# Close Nautilus
pkill -TERM -u 1000 -x nautilus 2>/dev/null || true

sleep 2

# Hibernate
/usr/bin/systemctl hibernate
EOF

sudo chmod +x /usr/local/sbin/macbook-lid-hibernate

The UID 1000 is my desktop user. Anyone adapting this should check their own UID with:

id -u

Finally, I enabled and restarted acpid:

sudo systemctl enable --now acpid
sudo systemctl restart acpid

That was it.

Now closing the lid triggers the hibernation procedure automatically.

One thing worth mentioning: my lid-close script uses pkill instead of nautilus -q, because the ACPI script runs outside the graphical session.

7. The result

After all that, I closed the lid and let the MacBook hibernate.

When I opened it again, it powered on and restored my previous GNOME session.

The keyboard worked. The trackpad worked. The display and audio worked. Even the internal Broadcom Wi-Fi came back.

And there's a nice detail about this particular MacBook: it automatically powers on when you open the lid. You don't need to press the power button.

That behavior works with my Debian installation too.

I also did a real overnight test. I finished working, closed the lid, and left the laptop until the following morning.

When I opened it, Debian restored everything as I had left it.

That's exactly what I wanted.

A few final notes

This isn't a fix for conventional Linux suspend. It's a direct hibernation setup that avoids the suspend/resume problems I experienced on this hardware.

I didn't modify applespi, recompile the kernel, or change the Intel LPSS SPI controller.

My internal audio already worked through a separate MacBook-specific CS4208 DKMS driver, which I left untouched.

My final setup uses three main pieces:

  • Debian's existing hibernation mechanism and swap resume configuration.
  • A systemd sleep hook to handle Broadcom Wi-Fi.
  • An ACPI lid-close handler to close Nautilus and request hibernation.

The scripts above reflect what I installed and tested. They are not a polished general-purpose package, and I would strongly recommend reviewing them before using them on another machine.

In particular, make sure your swap configuration is correct, your user ID matches, and your Wi-Fi uses the same driver. Save your work and have a backup before experimenting with hibernation.

If something fails, these commands can help:

sudo cat /var/log/macbook-wifi-hibernate.log
sudo journalctl -b -1 | grep -Ei 'hibernate|freez|failed|brcmfmac'

Previous-boot journal history needs to be available for the second command.

Finally, thanks to the author of the MacBook8,1 Debian guide for documenting the original investigation. Reading that work convinced me to revisit a problem I had already given up on.

I used ChatGPT to help interpret the logs and work through the configuration, but the installation and testing were done on my own MacBook.

Hopefully this is useful to other people trying to keep these little 12-inch MacBooks running Linux.

For now, I'm leaving mine exactly as it is. It finally works the way I wanted.


r/linuxhardware • • 1d ago

Discussion Milk-V Megrez RuyiFirmware (EDK2) boot openRuyi + RX 550

Thumbnail
youtube.com
2 Upvotes

r/linux_on_mac • • 2d ago

Turning a 2004 Macbook (Snowbook) into a writing station ( a work in progress).

Thumbnail knightwise.com
2 Upvotes

r/linuxhardware • • 2d ago

Discussion Which new x86 tablets work well with stock Debian 13?

11 Upvotes

I’m looking for a new x86 tablet or touchscreen 2-in-1 that I can buy in the EU for around €600. I’m happy to consider models with or without a keyboard. What matters to me is how well the device runs Debian.

I’d like to install Debian 13 with KDE Plasma from a USB stick and stick with the stock Debian kernel. Is anyone using a device like this regularly? If so, which exact model do you have, and how well do the touchscreen, auto-rotation, Wi-Fi and suspend/resume work? I’d also like to know if anything needed manual setup or still gives you trouble.


r/linux_on_mac • • 2d ago

2012 MBP I want to connect my laptop to a TV for watching DVDs what are my best options?

5 Upvotes

So I have a MBP2012 running lubuntu and want to figure out how I can get it to output to the TV. Should I try and use the mini DP to HDMI with an adapter or would I be better off just grabbing a usb A to HDMI output thingy?