Skip to content

Instantly share code, notes, and snippets.

@valyakuttan
Last active March 30, 2019 12:26
Show Gist options
  • Save valyakuttan/cd06c4bad906d4de8af962d70eb26111 to your computer and use it in GitHub Desktop.
Save valyakuttan/cd06c4bad906d4de8af962d70eb26111 to your computer and use it in GitHub Desktop.
How to install Arch Linux on a Fujitsu Lifebook A514

Pre-installation

Download and verify Arch Linux image

After downloading the image and PGP Signature verify it's integrity with sha1sum and gpg

$ echo '<SHA1SUM> archlinux-x.x.x-x86_64.iso' | sha1sum -c -
archlinux-x.x.x-x86_64.iso:OK
$ gpg --verify archlinux-x.x.x-x86_64.iso.sig archlinux-x.x.x-x86_64.iso
should yield good signature

Create an Arch Linux Installer USB drive(UEFI bootable)

$ sudo dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync

where /dev/sdx is the device name of usb. This can be found by dmesg.

Note: To restore the USB drive as an empty, usable storage device after using the Arch ISO image, the iso9660 filesystem signature needs to be removed by running wipefs --all /dev/sdx as root, before repartitioning and reformating the USB drive.

Boot from the USB drive

Boot from the installer disk

Verify EFI mode

# efivar -l
it will spits out a list of uefi varibales if EFI mode is enabled

Enable wi-fi and check internet connectivity

# wifi-menu
follow the menu and choose access point
  
# ping -c 3 archlinux.org

Setup Arch repository mirrorlist

Keep closest mirrors at the top by editing /etc/pacman.d/mirrorlist

Update the system clock

Ensure the system clock is accurate

# timedatectl set-ntp true

Partition the disk(128GB SSD)

Identify the disk

# lsblk -f

Partition 128GB SSD into 512MB ESP, and the rest for root partition

# cgdisk /dev/sda
TYPE Size HEX CODE NAME
ESP 100MiB ef00 boot
[SWAP] 512MiB 8200
Linux rest 8300 root

Format the partitions

Format the partitions for appropriate file systems

assuming /dev/sda1 is the boot partition
# mkfs.fat -F32 /dev/sda1
 
assuming /dev/sda3 is the root partition
# mkfs.ext4 /dev/sda3

Mount the file systems

Mount the file system on the root partition to /mnt

# mount /dev/sda3 /mnt

# mkdir /mnt/boot
# mount /dev/sda1 /mnt/boot

Create and initialize swap

# mkswap /dev/sda2
# swapon /dev/sda2

Installation

Install the base packages

Install Arch base files and development files

# pacstrap /mnt base

Configure the system

Fstab

Generate an fstab file

# genfstab -U /mnt >> /mnt/etc/fstab

Chroot

Change root into the new system

# arch-chroot /mnt

Time zone

Set the time zone

# ln -sf /usr/share/zoneinfo/Region/City /etc/localtime

Run hwclock to generate /etc/adjtime

# hwclock --systohc --utc

Locale

Uncomment en_US.UTF-8 UTF-8 in /etc/locale.gen, and generate them with

# locale-gen

Set the LANG variable in locale.conf(5)

# echo LANG=en_US.UTF-8 > /etc/locale.conf

# echo LANGUAGE=en_US >> /etc/locale.conf

# export LANG=en_US.UTF-8

# export LANGUAGE=en_US

Hostname

Create the hostname file

# echo myhostname > /etc/hostname

Create hosts file

Add following lines to /etc/hosts

#/etc/hosts

127.0.0.1	localhost
127.0.1.1	myhostname

# The following lines are desirable for IPv6 capable hosts
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

Network configuration

Install packages

# pacman -S iw wpa_supplicant networkmanager

Find wireless devices

# ip link

Anything starting with wlp is a wireless device

Disable netctl on any wireless devices

assuming device name is wlp1s0

# systemctl disable netctl-auto@wlp1s0.service

Enable network manager

# systemctl enable NetworkManager.service

Root password

Set the root password

# passwd

Add a default user

Add a user and set password

# useradd -m -g users -G wheel,storage,power -s /bin/bash username

# passwd username

Setup sudoers

# pacman -S sudo

# EDITOR=nano visudo

Uncomment the line

# %wheel ALL=(ALL) ALL

Install Boot loader

Check to see if our EFI variables have already been mounted

# mount -t efivarfs efivarfs /sys/firmware/efi/efivars

Install systemd-boot

# bootctl install

Enabling Intel microcode updates

Install the intel-ucode package

# pacman -S intel-ucode

Create Initramfs

Usually this step is not required, since mkinitcpio was run on installation of the linux package with pacstrap

# mkinitcpio -p linux

Configure boot loader

Determine the PARTUUID of the root partition

assuming /dev/sda3 is our root partition
# blkid -s PARTUUID -o value /dev/sda3

Create a configuration file /boot/loader/entries/arch.conf

# nano /boot/loader/entries/arch.conf

Add following entries to /boot/loader/entries/arch.conf. Substitute with the value obtained

# /boot/loader/entries/arch.conf

title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=PARTUUID=<partuid> rw

Reboot the system

Exit new system and go into the cd shell

# exit

Unmount all partitions

# umount -R /mnt

Switch off swap

# swapoff /dev/sda2

Reboot into the new system, don't forget to remove the cd/usb

# reboot

Post Installation

Connect to a wifi netwrok

to get a list of available wifi networks
$ nmcli dev wifi list

to connect to a wpa2 network
$ sudo nmcli dev wifi connect <SSID> password <password>

Modify /boot/loader/entries/arch.conf for touchpad detection

Add i8042.notimeout i8042.nomux to the end of line starting with options

Install bash completion

Install bash-completion

$ sudo pacman -S bash-completion

Enable TRIM service for SSD

$ sudo systemctl enable fstrim.timer

Install Gnome

$ sudo pacman -S gnome
# select required packages

$ sudo systemctl enable gdm.service

Enable power management

Install powertop

$ sudo pacman -S powertop

Create a service file /etc/systemd/system/powertop.service with contents

[Unit]
Description=Powertop tunings

[Service]
ExecStart=/usr/bin/powertop --auto-tune
RemainAfterExit=true

[Install]
WantedBy=multi-user.target

Enable the service by

$ sudo systmctl enable powertop.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment