This article derives from this article - where typical x86-64 Arch Linux Installation is described. The procedure is a bit simillar, a bit different - if the original article is revised, the changes may also be applied to this article.
This guide is based on Arch Linux ARM on Odroid XU3-Lite board: I cannot gurantee that same orders apply to other boards.
This guide describes how to install Arch Linux ARM with simillar steps when installing Arch Linux on regular x86-64 system - and also with external HDD.
Disclaimer: This guide is for personal archival and referencing purposes; it is not written as to inform general public, and may have vague and unfriendly steps. Follow on your own responsibillity.z
THIS GUIDE ASSUMES THAT YOU HAVE FAIR KNOWLEDGE ABOUT THE SUBJECT IN TOTAL - THE AUTHOR HOLDS NO RESPONSIBILLITY ON WHAT HAPPENS TO YOUR SITUATION. FOLLOW ON YOUR OWN RISK: DO NOT BLINDLY COPY-AND-PASTE THE STEPS, YOU HAVE TO READ THE INSTRUCTIONS THROUGHLY AND MODIFY WHAT YOU HAVE TO DO ON YOUR BEHALF.
- Odroid-XU3 (Lite) board
- MicroSD card larger than 1GB - I recommend having two of these.
- USB External HDD
- Preferably with USB 3.0 support, SATA3(6G) and UASP for maximum performance.
-
This step is different from the original article! With instructions here, install the first pass of ALARM (which will be discarded) on the SD Card.
-
Boot.
-
Load keymap. Typically it will be:
loadkeys us
but it should be already loaded for you on boot.
-
This step is different from the original article! With the external hdd plugged in, partition it.
cfdisk /dev/sdX
Making a
swap
partition is not recommended. -
Format.
mkfs.FORMAT /dev/sdXn
Recommended
FORMAT
isext4
. -
Mount the partition under
/mnt
.mount /dev/sdXn /mnt
-
This step is different from the original article! Install arch-install-scripts to get tools for installation.
pacman -S arch-install-scripts
-
Edit the
/etc/pacman.d/mirrorlist
: put your preferred mirror at top. JAIST was the best in my circumstances. In order to edit easily, you might want to installvim
. You would also userankmirrors
. Refer to this page. -
This step is different from the original article! Install the base packages into your partition.
pacstrap /mnt base base-devel curl git openssh screen tmux vim wget zsh zsh-completions
Note that you don't have to install
grub
, it does not work with our board. -
When it's done, generate
fstab
.genfstab -p /mnt >> /mnt/etc/fstab
-
chroot
into the partition.arch-chroot /mnt
-
Write your hostname.
echo HOSTNAME >> /etc/hostname
-
Symlink local time zone.
ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
-
Uncomment locale of your liking from
/etc/locale.gen
. Typically it would been_US.UTF-8
. -
Generate your locales.
locale-gen
-
Set locale preferences.
locale > /etc/locale.conf
-
Set console keymap and font preferences. In
/etc/vconsole.conf
:# /etc/vconsole.conf KEYMAP=us FONT=lat2-16
Steps are different from the original article from here!
-
Install linux firmware and bootloader(uboot).
pacman -S linux-firmware linux-odroid-xu3 uboot-odroid-xu3
When the pacman tells you that you have to flash the mmcblk0 device, go ahead and flash it.
-
Edit
/boot/boot.ini
:setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=/dev/sda1 rootwait rw"
Notice that
root=
parameter is set to your root partition.*Steps are same with the original article from here, you can go on.
-
Set a root password with
passwd
.
Enable and start services you would run. All of these commands should be run
as root
.
```shell
sudo systemctl enable sshd
sudo systemctl start sshd
```
This step is different from the original article!
First, exit
the chroot.
Then, with the same changes, edit /boot/boot.ini
.
If you forget this step, you cannot boot into your new system.
When you're done, go ahead and reboot.
```shell
umount -R /mnt
reboot
```
-
Make sure that you successfully booted into your newly installed system on your HDD, and that your SD Card is not mounted.
df -h
If you cannot find /dev/mmcblkN here, you're safe to go.
-
Pop the card out and pop in another one. You can skip this step, but if something goes wrong, you may have to re-create your installation pass of system.
-
Partition and format the SD Card with dos (MBR) partition table and ext4.
-
Mount it on
/mnt
and copy /boot into/mnt
, including the directory. -
cd
to /mnt and run `./sd_fusing.sh /dev/mmcblk0'. It is normal to take some time.You can reboot from now. Remember that you have to mount and flash bootloader on SD Card again when new uboot update is shipped. Also, you have to copy and overwrite your /boot folder to SD Card when new kernel update is done since your kernel is at /boot/zImage, which is not used for actual boot sequence.
Configure your network. I personally prefer systemd-networkd
. All of these
commands should be run as root
.
- Configure
/etc/systemd/network/PROFILE_NAME.network
(you should have one every NIC).
- for static IP:
[Match]
Name=INTERFACE_NAME
[Network]
Address=YOUR.IP.ADDRESS.HERE/CIDR
Address=ANOTHER.IP.ADDRESS.HERE/CIDR
Gateway=GATEWAY.IP.ADDRESS.HERE
- for DHCP:
[Match]
Name=INTERFACE_NAME
[Network]
DHCP=yes
;uncomment this section if you want to *not* use received from the DHCP server as the transient hostname.
;[DHCPv4]
;UseHostname=false
-
Start
systemd-resolvd
and linkresolv.conf
for DNS resolution from DHCP, or if DNS is defined in network files.sudo systemctl enable systemd-resolved sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf sudo systemctl start systemd-resolved
-
Enable and start
systemd-networkd
.sudo systemctl enable systemd-networkd sudo systemctl start systemd-networkd
-
Check network status.
ip addr ping -c3 google.com
-
Create a new user for typical use. Using root for everyday chores are EVIL.
useradd -m -G wheel -s /bin/bash USERNAME
-
Edit sudoers. Before editing, I recommend you to edit your
vimrc
for easy editing, or install sensible.vim.EDITOR=vim sudo visudo
# visudo USERNAME ALL=(ALL) NOPASSWD: ALL
If you enabled sshd
and configured network, you can use ssh to
work from now on.
I recommend you use a swap file instead of a swap partition because it is
easier to modify. All of these commands should be run as root
.
-
Create file for use as swap file.
sudo fallocate -l 1024M /swapfile # allocate file for swapfile sudo chmod 600 /swapfile # set proper permissions sudo mkswap /swapfile # format swapfile as swap sudo swapon /swapfile # enable swap
-
Edit
/etc/fstab
and add an entry for the swapfile:# /etc/fstab /swapfile none swap default 0 0
In case you want to remove swapfile:
sudo swapoff /swapfile
sudo rm -f /swapfile
and remove the entry from /etc/fstab
.
If you want to resize swapfile, just remove it and regenerate it without removing the fstab entry.
When removing or resizing swapfile, note that swap is managed by systemd and will be re-enabled by it after some time.
Because we installed zsh
on system install, we do not have to install the
package. However, I will install oh-my-zsh
for ease of configuration
and themes.
-
Install oh-my-zsh.
curl -L http://install.ohmyz.sh | sh
-
Automatic chsh is likely to fail, so you have to do it for yourself.
chsh # authorize and type zsh on prompt
-
Edit
~/.zshrc
and change oh-my-zsh theme. I prefer agnoster, which is flavored with powerline-patched fonts and solarized colors. I recommend you to install powerline-patched fonts such as Source Code Powerline if you are going to use agnoster.# ~/.zshrc ZSH_THEME="agnoster" # it should be residing on top, you should modify it.
-
Editing
~/.zshrc
, change your$EDITOR
environmental variable and alias:# ~/.zshrc export EDITOR="vim" alias vi="vim"
-
Editing
~/.zshrc
, enable keypad by appending:# ~/.zshrc # Keypad # 0 . Enter bindkey -s "^[Op" "0" bindkey -s "^[Ol" "." bindkey -s "^[OM" "^M" # 1 2 3 bindkey -s "^[Oq" "1" bindkey -s "^[Or" "2" bindkey -s "^[Os" "3" # 4 5 6 bindkey -s "^[Ot" "4" bindkey -s "^[Ou" "5" bindkey -s "^[Ov" "6" # 7 8 9 bindkey -s "^[Ow" "7" bindkey -s "^[Ox" "8" bindkey -s "^[Oy" "9" # + - * / bindkey -s "^[Ok" "+" bindkey -s "^[Om" "-" bindkey -s "^[Oj" "*" bindkey -s "^[Oo" "/"
-
Change into zsh by:
exec zsh
You now have installed Arch Linux, tkistic style. Now go on and install other stuff you would use, such as:
- Edit vimrc.
- Edit .tmux.conf.
- Install rvm.
- Install pyenv.
- Install mkvirtualenv.
- Install powerline.
- and many other geeky things!