Skip to content

Instantly share code, notes, and snippets.

@Raymo111
Last active January 5, 2022 04:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raymo111/c26766022c73132b53cbc8a4cbd436ef to your computer and use it in GitHub Desktop.
Save Raymo111/c26766022c73132b53cbc8a4cbd436ef to your computer and use it in GitHub Desktop.
How to install Arch Linux on an MSI Bravo A4DDR

How to Install Arch Linux on an MSI Bravo A4DDR

By Raymo111

Last updated 29 July 2021

Disclaimer: I have personally tested every step of this. However, I'm not responsible for anything you do.

There's a Reddit thread for this laptop.

Pre-install

  1. Setup Windows. I kid you not. This is required (for EC updates) unless you know what you are doing. (Spoiler: if you did you wouldn't be here.) It also gives you the opportunity to test that everything with the hardware is working and verify you got the correct chips and amount of storage/RAM before you destroy the factory state. It's very hard to get your retailer to accept a laptop you've already installed Arch on for a refund. Also the laptop comes with a pretty cool wallpaper and this utility to check everything MSI.
  2. Go to https://www.msi.com/Laptop/support/Bravo-15-A4DDR and get BIOS and EC. Install the EC using the bat file.
  3. Unzip the BIOS to a USB and press shutdown while holding shift. (To disable fast bootup and other nasty stuff).
  4. Plug in your USB and power on the laptop, holding the DEL key. Find the place to flash bios and do it. Make sure that you actually flash once it reboots into recovery mode (it's right there on the screen, took me a while to figure out).
  5. Verify that your BIOS and EC are the latest version from the System Info section in BIOS.
  6. Enable advanced BIOS using this secret key combo: R_Shift + R_Ctrl + L_Alt + F2 (Thanks to u/toazd for the tip!)
  7. Disable secure boot in BIOS (or you won't even be able to boot the live image)
  8. Get the Arch ISO flashed onto your live USB. I recommend using Etcher
  9. Boot the laptop, holding down the F11 key, and select your USB drive to boot from it

Install Arch!

See:

  1. Plug in ethernet (RJ45). This is easier than using Wi-Fi.
  2. Check your internet connectivity ping 1.1.1.1
  3. Verify on UEFI ls /sys/firmware/efi/efivars
  4. Update your system clock's time timedatectl set-ntp true
  5. Check with timedatectl status
  6. Partition disks cfdisk /dev/nvme0n1 The following is what I did; it may not be what you want:
    • Delete existing partitions
    • 16G Linux swap first
    • 512M EFI System second
    • 300G Linux x86-64 root third
    • Write and quit
  7. Format and mount partitions
    mkfs.fat -F32 /dev/nvme0n1p2
    mkfs.ext4 /dev/nvme0n1p3 #(will take a minute or two)
    mkswap /dev/nvme0n1p1
    mount /dev/nvme0n1p3 /mnt
    swapon /dev/nvme0n1p1
    
  8. Get the fastest mirror to install your system and packages
    • Sync repos pacman -Syy
    • Install reflector pacman -S reflector
    • Backup mirrorlist cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
    • Run reflector directly on mirrorlist reflector -c "CA" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist #(replace CA with your country)
    • Include multilib for 32-bit wine :) nano /etc/pacman.conf
    • Uncomment the following lines:
       [multilib]
       Include = /etc/pacman.d/mirrorlist`
      
  9. Install Arch pacstrap /mnt base base-devel linux linux-firmware nano git #(add any other packages you want installed here)
  10. Mount your partitions on boot automatically genfstab -U /mnt >> /mnt/etc/fstab
  11. Verify that cat /mnt/etc/fstab includes ext4 and swap
  12. Chroot into your system arch-chroot /mnt
  13. Setup timezone
    timedatectl list-timezones
    timedatectl set-timezone America/Toronto # replace America/Toronto with your location
    
  14. Set hw clock to UTC hwclock --systohc --utc
  15. Localization: nano /etc/locale.gen and uncomment desired locales (i.e. en_CA.UTF-8 UTF-8, en_US.UTF-8 UTF-8, fr_CA.UTF-8 UTF-8, zh_CN.UTF-8 UTF-8)
    locale-gen
    echo LANG=en_CA.UTF-8 > /etc/locale.conf
    export LANG=en_CA.UTF-8
    
  16. Set your hostname echo myarch > /etc/hostname #(replace `myarch` with your preferred hostname)
  17. nano /etc/hosts and add:
    127.0.0.1 localhost
    ::1	   localhost
    127.0.1.1 myarch
    
    Make sure to replace myarch with your hostname!
  18. Update your freshly-installed system pacman -Syu
  19. Set your preferred root password passwd
  20. Install sudo pacman -S sudo
  21. Create your user
    export NEWUSR=raymo #(replace `raymo` with your username)
    useradd -mg users -G wheel,storage,power -s /bin/bash $NEWUSR
    
    • Set your user's password passwd $NEWUSR
    • Give your user root permissions sudo EDITOR=nano visudo Add a line with raymo ALL=(ALL) ALL or raymo ALL=(ALL) NOPASSWD:ALL #if you want sudo without password prompt
  22. Install Grub pacman -S grub efibootmgr dosfstools os-prober mtools
  23. Setup EFI mkdir /boot/efi
  24. Mount the EFI system partition mount /dev/nvme0n1p2 /boot/efi
  25. Setup Grub grub-install --target=x86_64-efi --bootloader-id=grub_uefi --efi-directory=/boot/efi --recheck
  26. Create the config file for Grub grub-mkconfig -o /boot/grub/grub.cfg
  27. Install and enable DHCPCD pacman -S dhcpcd && systemctl enable dhcpcd
  28. Install and enable NetworkManager pacman -S networkmanager && systemctl enable NetworkManager
  29. Install KDE (or whatever other DE/WM you want, i.e. Gnome, i3, XFCE, LXDE, MATE, etc.) pacman -S xorg xorg-xinit sddm plasma kde-applications
    • I didn't want the following for plasma (^5,^11,^20-21, etc.):
      • drkonqi, kgamma5, kwayland*, oxygen, plasma-sdk, plasma-vault
    • and only installed the kde-apps that I wanted (the AUR group page contains descriptions of every package)
    • I went with 2, vlc, and cronie for the dependencies
  30. Install Mesa pacman -S lib32-mesa mesa mesa-demos
  31. Install AMD video drivers xf86-video-amdgpu
  32. Enable SDDM (or whatever greeter you want) so that you don't see a shell when you boot up systemctl enable sddm
  33. Set make-flags for makepkg to use more cores:
    vim /etc/makepkg.conf
    
    Replace the MAKEFLAGS="-j 2" line with:
    MAKEFLAGS="-j $(nproc --ignore=2)" # 2 less than num of total threads
    
  34. Install yay - this will help you a lot but isn't exactly required. It's an AUR helper.
    su $NEWUSR
    git clone https://aur.archlinux.org/yay.git
    cd yay
    makepkg -si
    exit # or Ctrl+D
    

Cleanup

  1. Exit chroot with Ctrl+D or exit
  2. Shutdown shutdown now Once it's shut down you can unplug the live USB
  3. Set the boot order in BIOS (hold DEL on startup), and add an admin password if you want
  4. Boot and login with your username and password
  5. Open the KDE menu and type konsole to get a terminal. Run yay -S neofetch to test yay and get neofetch. Run neofetch, and flex Arch to all your friends. And also pat yourself on the back - you did it! Welcome to the best distro ever.

#btwiusearch

(obviously)

@Raymo111
Copy link
Author

Haha, well I mean could it be resuming after suspend-to-disk. The last time I installed Ubuntu on Bravo 15, with some tweaks , it was working well until I close the laptop, it was never resuming.

Oh you mean during the installation process. I'm not sure. It's designed for you to go through in one sitting, and it never takes me more than 20 minutes to do a full install.

@nqd
Copy link

nqd commented Sep 12, 2021

No. After the installation. This issue also be mentioned at this end of this thread

However, there still is a problem with resuming after suspend-to-disk.

Because of the cannot wakeup, I went back to Windows + WSL2. Still hope to use Linux fully one day.

@Raymo111
Copy link
Author

Oh I don't use suspend to disk, only suspend to RAM, so I'm not sure. Did you face an issue with suspending to disk?

@nqd
Copy link

nqd commented Sep 13, 2021

Well, cannot resume. The keyboard light was on, but the screen was dark. No ssh response. The only way to bring it back was to power off

@Raymo111
Copy link
Author

Well, cannot resume. The keyboard light was on, but the screen was dark. No ssh response. The only way to bring it back was to power off

Did you not allocate enough swap?

@nqd
Copy link

nqd commented Sep 14, 2021

well, I didn't check. anw it's good to know that suspend work, will check next time for hibernating. Thank Raymond

@onyasumi
Copy link

onyasumi commented Jan 4, 2022

Might wanna point out that makepkg won't run as root (so you have to su username before you try to install it). Also might be nice to have something about uncommenting that -j2 flag in /etc/makepkg.conf and change it appropriately so that you can makepkg with all cores

@Raymo111
Copy link
Author

Raymo111 commented Jan 5, 2022

@kugelblitz2 thanks for the suggestions, I've updated the Gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment