You are not logged in.

#1 2025-01-05 23:11:49

dulinux
Member
Registered: 2023-08-19
Posts: 2

[SOLVED] How to enable auto boot after power failure on a Mac mini 4,1

Information

[root@macmini41 ~]$ cat /etc/os-release
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo

[root@macmini41 ~]# hostnamectl
Static hostname: macmini41
Icon name: computer-desktop
Chassis: desktop ?️
Machine ID: a2eba46d21bc4f908b460730a43cba58
Boot ID: d96394681eba4e99aed7e9df62af14d8
Product UUID: 88b65412-c2e4-fb58-90b6-f13bc5c4b344
Operating System: Arch Linux
Kernel: Linux 6.6.63-1-lts
Architecture: x86-64
Hardware Vendor: Apple Inc.
Hardware Model: Macmini4,1
Hardware Serial: C07F87PWDD6H
Firmware Version: 76.0.0.0.0
Firmware Date: Thu 2019-06-13
Firmware Age: 5y 6month 3w 4d

Auto boot after power failure

The 0x7b register (line 70: … 60 …) is set to 60 by default.

[root@macmini41 ~]# lspci -s 00:03.0 -vvvxxxx
00:03.0 ISA bridge: NVIDIA Corporation MCP89 LPC Bridge (rev a2)
       Subsystem: Apple Inc. Device cb89
       Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
       Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
       Latency: 0
       Region 0: I/O ports at 2100 [size=256]
00: de 10 80 0d 0f 00 a0 00 a2 00 01 06 00 00 80 00
10: 01 21 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 6b 10 89 cb
30: 00 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 00
40: 6b 10 89 cb 00 00 d0 fe 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 5a 62 02 00 00 00 05 ff 0b 3c 02
60: 00 00 00 00 00 00 00 00 00 00 00 00 18 01 01 00
70: 50 00 ff ff 4d 04 17 00 00 04 44 60 00 00 00 00 <<-----------------
80: 00 00 00 ff 00 00 00 00 00 00 40 07 ff 00 00 00
90: 00 7c 00 00 ff ff 0f 00 00 00 00 00 00 00 00 00
a0: 03 00 00 31 00 00 01 00 00 03 1f 03 00 07 ff 07
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: fd 00 00 00 00 00 00 00 f8 0c 00 fc 00 73 00 30
e0: 83 74 0b 29 ac 39 af 5a 09 00 c0 5c 00 00 00 00
f0: e8 02 00 fc fd 00 00 00 10 00 80 80 00 00 00 00

In order for auto boot to work, the register needs to be set to 19.

Use setpci to change the register:

[root@macmini41 ~]# setpci -s 00:03.0 0x7b.b=19

Check if it works

[root@macmini41 ~]# lspci -s 00:03.0 -vvvxxxx
00:03.0 ISA bridge: NVIDIA Corporation MCP89 LPC Bridge (rev a2)
        Subsystem: Apple Inc. Device cb89
        Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Region 0: I/O ports at 2100 [size=256]
00: de 10 80 0d 0f 00 a0 00 a2 00 01 06 00 00 80 00
10: 01 21 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 6b 10 89 cb
30: 00 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 00
40: 6b 10 89 cb 00 00 d0 fe 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 5a 62 02 00 00 00 05 ff 0b 3c 02
60: 00 00 00 00 00 00 00 00 00 00 00 00 18 01 01 00
70: 50 00 ff ff 4d 04 17 00 00 04 44 19 00 00 00 00 <<-----------------
80: 00 00 00 ff 00 00 00 00 00 00 40 07 ff 00 00 00
90: 00 7c 00 00 ff ff 0f 00 00 00 00 00 00 00 00 00
a0: 03 00 00 31 00 00 01 00 00 03 1f 03 00 07 ff 07
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: fd 00 00 00 00 00 00 00 f8 0c 00 fc 00 73 00 30
e0: 83 74 0b 29 ac 39 af 5a 09 00 c0 5c 00 00 00 00
f0: e8 02 00 fc fd 00 00 00 10 00 80 80 00 00 00 00

Create a systemd unit file so the the command runs on each boot.

[root@macmini41 ~]# cat /etc/systemd/system/autoboot.service

[Unit]
Description=Set the autoboot register on ISA bridge: NVIDIA Corporation MCP89 LPC Bridge (rev a2)

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/setpci -s 00:03.0 0x7b.b=19
ExecStop=/usr/bin/setpci -s 00:03.0 0x7b.b=60

[Install]
WantedBy=default.target

Enable it

systemctl daemon-reload

systemctl enable --now autoboot.service

Test it by unplugging the power cord and putting it back again.

References

https://ubuntuforums.org/archive/index. … 09576.html

https://williamlam.com/2013/02/enable-a … ilure.html

Last edited by dulinux (2025-01-05 23:13:18)

Offline

Board footer

Powered by FluxBB