Shutdown Hangs with Kernel Panic on MacBook 4,1

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
smnbldwn
Level 1
Level 1
Posts: 7
Joined: Tue Mar 20, 2018 8:50 am

Shutdown Hangs with Kernel Panic on MacBook 4,1

Post by smnbldwn »

I recently installed Linux Mint on a 2008 MacBook 4,1. It mostly works well but the shutdown process sometimes gets stuck right at the end.
I have searched around for a solution and have so far increased the default shutdown limit from 10s to 100s and also blacklisted the USB2 drivers (USB ports still work fine using the USB3 drivers). The problem happens about half the time. I dual boot with Mac OS X 10.7.5 and use ReFind as a boot manager although I can also boot from Grub.
From neofetch:
OS: Linux Mint 20.2 x86_64
Host: MacBook4,1 1.0
Kernel: 5.4.0-81-generic
Packages: 2371 (dpkg), 5 (flatpak)
Shell: bash 5.0.17
Resolution: 1280x800
DE: Xfce
WM: Xfwm4
WM Theme: Mint-Y
Theme: Mint-Y [GTK2/3]
Icons: Mint-Y [GTK2/3]
Terminal: xfce4-terminal
Terminal Font: Monospace 12
CPU: Intel Core 2 Duo T8300 (2) @ 2.4 GHz
GPU: Intel Mobile GM965/GL960
Memory: 1431MiB / 3916MiB

I took two photos of the screen after it froze on two different occasions which might show what I need to do to fix it. I hope I posted in the right section.
Thanks in advance for any tips.
000-1630495068318.jpeg
Attachments
freeze2.jpeg
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reddog1
Level 7
Level 7
Posts: 1939
Joined: Wed Jun 01, 2011 2:12 pm

Re: Shutdown Hangs on MacBook 4,1

Post by Reddog1 »

I have the same laptop and I have the same problem. The old macbook is a machine I use everyday, and even though it's 13 years old it does the job, with 4mb memory and a 128mb ssd. It has occasionally failed shutdown for the 2 years I had Mint 18 on it, and for a year since I installed 19.3. I've traced it to the power management (it doesn't do it unless I've been charging the battery and the charge cycle is incomplete). I've come to the conclusion that it is Apple related and the only fix would be either in the kernel or in the way Mint handles power management, and that isn't happening with a machine this old. I just hard power down and don't worry about it. And a note, the error you see in the last line has nothing to do with this (usually an indication of a usb error). It is present even during complete shutdowns, as you might have noticed. Also, lines previous to that indicate poweroff cycle is complete. Reading shutdown logs show some superfluous sound system errors that won't stop a shutdown because they are always there, too. Nothing logged indicates a problem with my machine. My newer apples don't have the problem, only the old MacBook. Now, if somebody else could come up with an idea for a fix that I haven't tried, I'd like to know about it.
smnbldwn
Level 1
Level 1
Posts: 7
Joined: Tue Mar 20, 2018 8:50 am

Re: Shutdown Hangs on MacBook 4,1

Post by smnbldwn »

Good to know, thanks. I tried logging out first then shutting down which worked last time. Other than that very impressed with Mint XFCE on this old thing, still decent for normal use, I was using it with Teams today! Still on the old HDD for now until it goes...
smnbldwn
Level 1
Level 1
Posts: 7
Joined: Tue Mar 20, 2018 8:50 am

Re: Shutdown Hangs with Kernel Panic on MacBook 4,1

Post by smnbldwn »

I also asked this question on another forum and got a solution that has worked so far...

Edit /etc/default/grub e.g.

Code: Select all

sudo nano /etc/default/grub
Then add

Code: Select all

intel_idle.max_cstate=1
to the section in quotes after

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT
It works for me as long as I boot via Grub.
Reddog1
Level 7
Level 7
Posts: 1939
Joined: Wed Jun 01, 2011 2:12 pm

Re: Shutdown Hangs with Kernel Panic on MacBook 4,1

Post by Reddog1 »

editing /etc/default/grub had no effect on my system. My intermittent shutdown problem is still there. I'm running kernel 5.4
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: Shutdown Hangs with Kernel Panic on MacBook 4,1

Post by fabien85 »

smnbldwn wrote: Tue Sep 14, 2021 9:36 am Then add

Code: Select all

intel_idle.max_cstate=1
to the section in quotes after

Code: Select all

GRUB_CMDLINE_LINUX_DEFAULT
It works for me as long as I boot via Grub.
This is a kernel parameter. You can make it work also through refind :
Check if you have already installed refind through Mint's software manager (as opposed to installing it from MacOS).
- if you did not already install it through the software manager, then boot via grub (using the intel_blabla kernel parameter), then install refind
- if you already had refind installed, then boot via grub then run mkrlconf --force. This is a refind script that will create a /boot/refind_linux.conf file which tells refind how to boot your system. See the manual page here. The --force option will tell the script to overwrite any already existing /boot/refind_linux/conf ; that will add the kernel parameter intel_blabla, so that refind will pass it to the kernel when booting.
Another advantage of having refind installed through Mint's software manager is that you will get updates when it's updated.

Another method is to manually edit /boot/refind_linux.conf (assuming it already exists) and add the parameter there. The file usually looks like this :

Code: Select all

"Boot with standard options"  "ro root=UUID=blabla quiet splash"
"Boot with minimal options"  "ro root=UUID=blabla"
where blabla is a string of numbers and letters giving the uuid of the / partition. Just edit the file (with sudo nano), add intel_idle.max_cstate=1 next to quiet splash, save and exit.
Locked

Return to “Installation & Boot”