├── 2022-04-27_14-43.png ├── README.md └── xorg.conf /2022-04-27_14-43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamDaaEpic/ArchLinuxMacBookPro2008/0c9f39bca842127d57dbf2a48b376df96def7c46/2022-04-27_14-43.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ArchLinuxMacBookPro2008 2 | How to install Arch Linux on MacBook Pro 2008 with nvidia proprietary drivers. 3 | 4 | 5 | ## Sample Screenshot 6 | 7 | ![alt text](https://github.com/SamDaaEpic/ArchLinuxMacBookPro2008/blob/e99f339f8d8a962336245764fd58296831a3aaae/2022-04-27_14-43.png) 8 | ## Getting Ready 9 | 10 | Download the ArchLinux iso: https://archlinux.org/download 11 | 12 | Boot into the archlinux iso by pluging in the usb drive (to which you have flashed the arch iso) into the macbook and holding down the Option key on the keyboard 13 | 14 | ## Disable Annoying Kernel Messages 15 | To Disable the annoying kernel messages you get while in the TTY, do this 16 | ``` 17 | setterm -msg off 18 | ``` 19 | 20 | ## Connect to WIFI 21 | 22 | First of all unload all the other wifi drivers 23 | 24 | ``` 25 | rmmod b43 bcma ssb wl 26 | ``` 27 | 28 | Load the wifi driver for the macbook 29 | 30 | ``` 31 | modprobe wl 32 | ``` 33 | 34 | restart iwd (so it can recognize the wifi card) 35 | 36 | ``` 37 | systemctl restart iwd 38 | ``` 39 | 40 | Connect to wifi with iwctl (type the station commands in the iwctl shell) 41 | 42 | ``` 43 | iwctl 44 | station wlan0 get-networks 45 | station wlan0 connect "" 46 | ``` 47 | 48 | ## Setup the partitions 49 | 50 | **This is only for if you dont have macos installed** 51 | 52 | Create 3 partitions of **2GB** for swap, **512MB** for boot efi partition and **xxxGB** for the root partition 53 | 54 | ``` 55 | cfdisk 56 | ``` 57 | Now create the filesystems on the partitions you've created (change the partition letter according to your letters) 58 | 59 | ``` 60 | lsblk 61 | ├─sda1 8:4 0 2.1G 0 part 62 | ├─sda2 8:5 0 512M 0 part 63 | ├─sda3 8:6 0 51.3G 0 part 64 | ``` 65 | 66 | ``` 67 | mkswap /dev/sda1 68 | mkfs.fat -F 32 /dev/sda2 69 | mkfs.ext4 /dev/sda3 70 | ``` 71 | 72 | ## Mount the partitions and install the base packages 73 | 74 | Mount the partitions to /mnt (again, replace the partition letters according to your hard drive partition letters) 75 | 76 | ``` 77 | lsblk 78 | ├─sda1 8:4 0 2.1G 0 part 79 | ├─sda2 8:5 0 512M 0 part 80 | ├─sda3 8:6 0 51.3G 0 part 81 | ``` 82 | 83 | ``` 84 | mount /dev/sda3 /mnt 85 | mkdir /mnt/boot 86 | mkdir /mnt/boot/efi 87 | mount /dev/sda2 /mnt/boot/efi 88 | swapon /dev/sda1 89 | ``` 90 | 91 | Install the base packages to /mnt (you can choose any linux kernel but personally i prefer linux-lts since the latest kernel breaks in every 1 week on these old macbooks) 92 | 93 | ``` 94 | pacstrap /mnt base linux-lts linux-lts-headers linux-firmware intel-ucode nano 95 | ``` 96 | 97 | Generate the fstab So the partitons gets mounted every time your system boots up 98 | 99 | ``` 100 | genfstab -U /mnt >> /mnt/etc/fstab 101 | ``` 102 | 103 | ## Chroot into /mnt 104 | 105 | Chroot into /mnt 106 | 107 | ``` 108 | arch-chroot /mnt 109 | ``` 110 | 111 | ## Setup the TimeZone 112 | 113 | create a hardlink of our timezone to /etc/localtime (type in your region and city in the correct place) 114 | 115 | ``` 116 | ln -sf /usr/share/zoneinfo/Region/City /etc/localtime 117 | ``` 118 | 119 | Example of region Asia and city Kolkata 120 | 121 | ``` 122 | ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime 123 | ``` 124 | 125 | generate /etc/adjtime 126 | 127 | ``` 128 | hwclock --systohc 129 | ``` 130 | 131 | Make Sure The Clock Is Syncronized 132 | 133 | ``` 134 | timedatectl set-ntp true 135 | ``` 136 | 137 | ## Generate Locale 138 | 139 | comment out your locale (for me it is en_US.UTF-8 UTF-8) 140 | 141 | ``` 142 | nano /etc/locale.gen 143 | ``` 144 | 145 | Comment out this line in the /etc/locale.gen file 146 | 147 | ``` 148 | en_US.UTF-8 UTF-8 149 | ``` 150 | 151 | 152 | Generate the locale you've commented out 153 | 154 | ``` 155 | locale-gen 156 | ``` 157 | 158 | create /etc/locale.conf file (so that your system can know what locale you're using) 159 | 160 | ``` 161 | nano /etc/locale.conf 162 | ``` 163 | 164 | type in /etc/locale.conf (for en_US) 165 | 166 | ``` 167 | LANG=en_US.UTF-8 168 | ``` 169 | 170 | ## Configure Hostname 171 | 172 | ``` 173 | nano /etc/hostname 174 | ``` 175 | 176 | ``` 177 | 178 | ``` 179 | 180 | ## Set the Root Password 181 | 182 | ``` 183 | passwd 184 | ``` 185 | 186 | ## Setup /etc/hosts 187 | 188 | ``` 189 | nano /etc/hosts 190 | ``` 191 | 192 | type in /etc/hosts 193 | 194 | ``` 195 | 127.0.0.1 localhost 196 | ``` 197 | 198 | ## Create a User 199 | 200 | ``` 201 | useradd -m --badname 202 | ``` 203 | 204 | Add the user to the wheel group and video and audio group 205 | 206 | ``` 207 | usermod -aG wheel,video,audio 208 | ``` 209 | 210 | Set the user password 211 | 212 | ``` 213 | passwd 214 | 215 | ``` 216 | 217 | ## Install basic packages Including xfce and xorg 218 | 219 | ``` 220 | pacman -Sy efibootmgr networkmanager network-manager-applet dialog wpa_supplicant mtools dosfstools base-devel git reflector bluez bluez-utils pulseaudio pulseaudio-bluetooth alsa-utils xdg-utils xdg-user-dirs broadcom-wl-dkms xorg xfce4 xfce4-goodies lightdm 221 | ``` 222 | 223 | ## Enable Wheel Group for Sudo privileges 224 | edit the /etc/sudoers file and uncomment the following line near the end of the file. 225 | 226 | ``` 227 | nano /etc/sudoers 228 | ``` 229 | /etc/sudoers 230 | ``` 231 | %wheel ALL=(ALL:ALL) ALL # Remove The Hashtag in front of it 232 | ``` 233 | 234 | ## Install and Configure GRUB 235 | 236 | Install grub 237 | 238 | ``` 239 | pacman -S grub 240 | ``` 241 | 242 | Install grub to /boot/efi 243 | 244 | ``` 245 | grub-install --target=x86_64-efi --efi-directory=/boot/efi 246 | ``` 247 | 248 | **This step is very important, if you dont do this you will not see the archlinux in the macbook startup manager** 249 | 250 | copy the efi files to the correct directory so that your macbook can detect archlinux 251 | 252 | 253 | ``` 254 | mkdir /boot/efi/EFI/boot 255 | cp /boot/efi/EFI/arch/grubx64.efi /boot/efi/EFI/boot/bootx64.efi 256 | ``` 257 | 258 | Now generate the grub configuration 259 | 260 | ``` 261 | grub-mkconfig -o /boot/grub/grub.cfg 262 | ``` 263 | 264 | ## Enable needeed systemd services 265 | 266 | ``` 267 | systemctl enable bluetooth 268 | systemctl enable NetworkManager #The Network manager MUST have the "N" and "M" capital 269 | systemctl enable lightdm 270 | ``` 271 | 272 | **Now your Installation is Done and You can reboot and follow the steps on how to install the nvidia proprietary drivers** 273 | 274 | 275 | ## Install the nVidia Proprietary drivers 276 | 277 | First of all go into the tty and stop lightdm (because the gui will crash while installing nvidia drivers and we dont want that, we will do everything in tty) 278 | 279 | Press **FN+Ctrl+Alt+F2** to go into tty and login with your username and password (dont login as root) 280 | 281 | install yay 282 | 283 | ``` 284 | git clone https://aur/archlinux.org/yay.git 285 | cd yay 286 | makepkg -si 287 | ``` 288 | Enable MultiLib repo to install the lib32 packages for Nvidia 289 | edit the /etc/pacman.conf 290 | ``` 291 | nano /etc/pacman.conf 292 | ``` 293 | 294 | in /etc/pacman.conf comment out this line by removing the **#** (You can find it close to the end of the file) 295 | ``` 296 | [multilib] 297 | Include = /etc/pacman.d/mirrorlist 298 | ``` 299 | 300 | After yay has installed and Multilib is enabled, install nvidia drivers with yay 301 | 302 | ``` 303 | yay -Sy nvidia-340xx-lts-dkms nvidia-340xx-utils lib32-nvidia-340xx-utils 304 | ``` 305 | 306 | After nvidia drivers are done installing blacklist the nouveau driver so it dosent get loaded on boot 307 | 308 | ``` 309 | sudo nano /etc/modprobe.d/blacklist-nouveau.conf 310 | ``` 311 | 312 | type this in /etc/modprobe.d/blacklist-nouveau.conf 313 | 314 | ``` 315 | blacklist nouveau 316 | ``` 317 | 318 | now regenerate the initramfs 319 | 320 | ``` 321 | sudo mkinitcpio -P 322 | ``` 323 | 324 | ## If you dont want to fiddle around with xorg.conf you can just use my xorg.conf in this git repo, to do that follow these steps 325 | 326 | ``` 327 | sudo wget https://raw.githubusercontent.com/SamDaaEpic/ArchLinuxMacBookPro2008/main/xorg.conf 328 | sudo cp xorg.conf /etc/X11/xorg.conf 329 | ``` 330 | **Now after doing this just reboot and nvidia proprietary drivers should work** 331 | 332 | ## Manual method of setting up the xorg.conf 333 | 334 | ``` 335 | sudo nvidia-xconfig 336 | ``` 337 | 338 | Check your gpu PCID with lspci 339 | 340 | ``` 341 | lspci 342 | 00:00.0 Host bridge: NVIDIA Corporation MCP79 Host Bridge (rev b1) 343 | 00:00.1 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1) 344 | 00:03.0 ISA bridge: NVIDIA Corporation MCP79 LPC Bridge (rev b2) 345 | 00:03.1 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1) 346 | 00:03.2 SMBus: NVIDIA Corporation MCP79 SMBus (rev b1) 347 | 00:03.3 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1) 348 | 00:03.4 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1) 349 | 00:03.5 Co-processor: NVIDIA Corporation MCP79 Co-processor (rev b1) 350 | 00:04.0 USB controller: NVIDIA Corporation MCP79 OHCI USB 1.1 Controller (rev b1) 351 | 00:04.1 USB controller: NVIDIA Corporation MCP79 EHCI USB 2.0 Controller (rev b1) 352 | 00:06.0 USB controller: NVIDIA Corporation MCP79 OHCI USB 1.1 Controller (rev b1) 353 | 00:06.1 USB controller: NVIDIA Corporation MCP79 EHCI USB 2.0 Controller (rev b1) 354 | 00:08.0 Audio device: NVIDIA Corporation MCP79 High Definition Audio (rev b1) 355 | 00:09.0 PCI bridge: NVIDIA Corporation MCP79 PCI Bridge (rev b1) 356 | 00:0a.0 Ethernet controller: NVIDIA Corporation MCP79 Ethernet (rev b1) 357 | 00:0b.0 SATA controller: NVIDIA Corporation MCP79 AHCI Controller (rev b1) 358 | 00:0c.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1) 359 | 00:10.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1) 360 | 00:15.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1) 361 | 00:16.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1) 362 | 00:17.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1) 363 | 02:00.0 VGA compatible controller: NVIDIA Corporation G96CM [GeForce 9600M GT] (rev a1) 364 | 03:00.0 VGA compatible controller: NVIDIA Corporation C79 [GeForce 9400M] (rev b1) 365 | 04:00.0 Network controller: Broadcom Inc. and subsidiaries BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01) 366 | 05:00.0 FireWire (IEEE 1394): LSI Corporation FW643 [TrueFire] PCIe 1394b Controller (rev 06) 367 | 368 | ``` 369 | 370 | you can only use the GeForce 9400M as display for your machine, if you use the GeForce 9600M GT it will show a black screen 371 | 372 | Now configure /etc/X11/xorg.conf so that you wont get a black screen 373 | 374 | ``` 375 | sudo nano /etc/X11/xorg.conf 376 | ``` 377 | 378 | Your config should look something like this 379 | 380 | ``` 381 | # nvidia-xconfig: X configuration file generated by nvidia-xconfig 382 | # nvidia-xconfig: version 340.108 (buildmeister@swio-display-x64-rhel04-01) Wed Dec 11 15:13:33 PST 2019 383 | 384 | # nvidia-settings: X configuration file generated by nvidia-settings 385 | # nvidia-settings: version 340.108 (buildmeister@swio-display-x64-rhel04-01) Wed Dec 11 15:13:22 PST 2019 386 | 387 | Section "ServerLayout" 388 | Identifier "Layout0" 389 | Screen 0 "Screen0" 0 0 390 | InputDevice "Keyboard0" "CoreKeyboard" 391 | InputDevice "Mouse0" "CorePointer" 392 | Option "Xinerama" "0" 393 | EndSection 394 | 395 | Section "Files" 396 | ModulePath "/usr/lib64/nvidia/xorg" 397 | ModulePath "/usr/lib64/xorg/modules" 398 | EndSection 399 | 400 | Section "ServerFlags" 401 | Option "IgnoreABI" "1" 402 | EndSection 403 | 404 | Section "InputDevice" 405 | 406 | # generated from default 407 | Identifier "Mouse0" 408 | Driver "mouse" 409 | Option "Protocol" "auto" 410 | Option "Device" "/dev/psaux" 411 | Option "Emulate3Buttons" "no" 412 | Option "ZAxisMapping" "4 5" 413 | EndSection 414 | 415 | Section "InputDevice" 416 | 417 | # generated from default 418 | Identifier "Keyboard0" 419 | Driver "kbd" 420 | EndSection 421 | 422 | Section "Monitor" 423 | Identifier "Monitor0" 424 | VendorName "Unknown" 425 | ModelName "Apple" 426 | HorizSync 30.0 - 75.0 427 | VertRefresh 59.9 428 | Option "DPMS" 429 | EndSection 430 | 431 | Section "Device" 432 | Identifier "Device0" 433 | Driver "nvidia" 434 | VendorName "NVIDIA Corporation" 435 | EndSection 436 | 437 | Section "Screen" 438 | Identifier "Screen0" 439 | Device "Device0" 440 | Monitor "Monitor0" 441 | DefaultDepth 24 442 | Option "Stereo" "0" 443 | Option "metamodes" "nvidia-auto-select +0+0" 444 | Option "NoLogo" "true" 445 | Option "MultiGPU" "true" 446 | Option "BaseMosaic" "off" 447 | Option "SLI" "true" 448 | Option "Coolbits" "13" 449 | SubSection "Display" 450 | Depth 24 451 | EndSubSection 452 | EndSection 453 | 454 | ``` 455 | **Change it to this by adding ignore abi option and adding the gpu pcid** 456 | 457 | ``` 458 | # nvidia-xconfig: X configuration file generated by nvidia-xconfig 459 | # nvidia-xconfig: version 340.108 (buildmeister@swio-display-x64-rhel04-01) Wed Dec 11 15:13:33 PST 2019 460 | 461 | # nvidia-settings: X configuration file generated by nvidia-settings 462 | # nvidia-settings: version 340.108 (buildmeister@swio-display-x64-rhel04-01) Wed Dec 11 15:13:22 PST 2019 463 | 464 | Section "ServerLayout" 465 | Identifier "Layout0" 466 | Screen 0 "Screen0" 0 0 467 | InputDevice "Keyboard0" "CoreKeyboard" 468 | InputDevice "Mouse0" "CorePointer" 469 | Option "Xinerama" "0" 470 | EndSection 471 | 472 | Section "Files" 473 | ModulePath "/usr/lib64/nvidia/xorg" 474 | ModulePath "/usr/lib64/xorg/modules" 475 | EndSection 476 | 477 | Section "ServerFlags" ## This is the new line added 478 | Option "IgnoreABI" "1" ## This is the new line added 479 | EndSection ## This is the new line added 480 | 481 | Section "InputDevice" 482 | 483 | # generated from default 484 | Identifier "Mouse0" 485 | Driver "mouse" 486 | Option "Protocol" "auto" 487 | Option "Device" "/dev/psaux" 488 | Option "Emulate3Buttons" "no" 489 | Option "ZAxisMapping" "4 5" 490 | EndSection 491 | 492 | Section "InputDevice" 493 | 494 | # generated from default 495 | Identifier "Keyboard0" 496 | Driver "kbd" 497 | EndSection 498 | 499 | Section "Monitor" 500 | Identifier "Monitor0" 501 | VendorName "Unknown" 502 | ModelName "Apple" 503 | HorizSync 30.0 - 75.0 504 | VertRefresh 59.9 505 | Option "DPMS" 506 | EndSection 507 | 508 | Section "Device" 509 | Identifier "Device0" 510 | Driver "nvidia" 511 | VendorName "NVIDIA Corporation" 512 | BoardName "GeForce 9400M" ## This is the new line added 513 | BusID "PCI:3:0:0" ## This is the new line added 514 | EndSection 515 | 516 | Section "Screen" 517 | Identifier "Screen0" 518 | Device "Device0" 519 | Monitor "Monitor0" 520 | DefaultDepth 24 521 | Option "Stereo" "0" 522 | Option "metamodes" "nvidia-auto-select +0+0" 523 | Option "NoLogo" "true" 524 | Option "MultiGPU" "true" 525 | Option "BaseMosaic" "off" 526 | Option "SLI" "true" 527 | Option "Coolbits" "13" 528 | SubSection "Display" 529 | Depth 24 530 | EndSubSection 531 | EndSection 532 | 533 | ``` 534 | 535 | ## Nvidia proprietary drivers installtion is done you can now reboot and start using ARCHLINUX 536 | 537 | 538 | # If you have dual booted and want grub to show the option to boot into macos Follow these steps. 539 | 540 | ``` 541 | sudo nano /etc/grub.d/40_custom 542 | ``` 543 | 544 | Type this in /etc/grub.d/40_custom 545 | 546 | ``` 547 | menuentry "MacOSX" --class "macosx" { 548 | # Search the root device for Mac OS X's loader. 549 | search --file --no-floppy --set=root /usr/standalone/i386/boot.efi 550 | # chainload the loader, pass parameters like -v directly 551 | chainloader (${root})/usr/standalone/i386/boot.efi #-v 552 | } 553 | 554 | ``` 555 | 556 | After that just update your grub config and macos should appear in grub 557 | 558 | ``` 559 | sudo grub-mkconfig -o /boot/grub/grub.cfg 560 | ``` 561 | -------------------------------------------------------------------------------- /xorg.conf: -------------------------------------------------------------------------------- 1 | # nvidia-xconfig: X configuration file generated by nvidia-xconfig 2 | # nvidia-xconfig: version 340.108 (buildmeister@swio-display-x64-rhel04-01) Wed Dec 11 15:13:33 PST 2019 3 | 4 | # nvidia-settings: X configuration file generated by nvidia-settings 5 | # nvidia-settings: version 340.108 (buildmeister@swio-display-x64-rhel04-01) Wed Dec 11 15:13:22 PST 2019 6 | 7 | Section "ServerLayout" 8 | Identifier "Layout0" 9 | Screen 0 "Screen0" 0 0 10 | InputDevice "Keyboard0" "CoreKeyboard" 11 | InputDevice "Mouse0" "CorePointer" 12 | Option "Xinerama" "0" 13 | EndSection 14 | 15 | Section "Files" 16 | ModulePath "/usr/lib64/nvidia/xorg" 17 | ModulePath "/usr/lib64/xorg/modules" 18 | EndSection 19 | 20 | Section "ServerFlags" 21 | Option "IgnoreABI" "1" 22 | EndSection 23 | 24 | Section "InputDevice" 25 | 26 | # generated from default 27 | Identifier "Mouse0" 28 | Driver "mouse" 29 | Option "Protocol" "auto" 30 | Option "Device" "/dev/psaux" 31 | Option "Emulate3Buttons" "no" 32 | Option "ZAxisMapping" "4 5" 33 | EndSection 34 | 35 | Section "InputDevice" 36 | 37 | # generated from default 38 | Identifier "Keyboard0" 39 | Driver "kbd" 40 | EndSection 41 | 42 | Section "Monitor" 43 | Identifier "Monitor0" 44 | VendorName "Unknown" 45 | ModelName "Apple" 46 | HorizSync 30.0 - 75.0 47 | VertRefresh 59.9 48 | Option "DPMS" 49 | EndSection 50 | 51 | Section "Device" 52 | Identifier "Device0" 53 | Driver "nvidia" 54 | VendorName "NVIDIA Corporation" 55 | BoardName "GeForce 9400M" 56 | BusID "PCI:3:0:0" 57 | EndSection 58 | 59 | Section "Device" 60 | Identifier "Device1" 61 | Driver "nvidia" 62 | VendorName "NVIDIA Corporation" 63 | BoardName "GeForce 9600M GT" 64 | BusID "PCI:2:0:0" 65 | EndSection 66 | 67 | Section "Screen" 68 | Identifier "Screen0" 69 | Device "Device0" 70 | Monitor "Monitor0" 71 | DefaultDepth 24 72 | Option "Stereo" "0" 73 | Option "metamodes" "nvidia-auto-select +0+0" 74 | Option "NoLogo" "true" 75 | Option "MultiGPU" "true" 76 | Option "BaseMosaic" "off" 77 | SubSection "Display" 78 | Depth 24 79 | EndSubSection 80 | EndSection 81 | 82 | --------------------------------------------------------------------------------