CN-PRO-0001 Arch Linux Setup and Basics
CN-PRO-0001 Arch Linux Setup and Basics
1
2
Contents
REVISION TABLE........................................................................................................... 5
INTRODUCTION ............................................................................................................. 6
BIOS Configuration....................................................................................................... 8
Dual Boot............................................................................................................. 11
Dual Boot............................................................................................................. 13
Dual Boot............................................................................................................. 16
Connection................................................................................................................... 18
Gitkraken ......................................................................................................................... 21
Electrical Automation...................................................................................................... 21
Required Packages....................................................................................................... 21
GMDL Creation............................................................................................................... 22
CF Card Creation............................................................................................................. 22
REVISION TABLE
REVISION DATE NAME COMMENTS
1.0.32 09/05/2024 Juniarto Update 32 bit
1.0.20 14/03/2024 Juniarto Update BR2301
1.0.8 29/01/2024 Juniarto Final Ver. 1
0.1.12 12/12/2023 Juniarto 2. Draft
0.0.1 24/11/2023 Juniarto Initial Draft
INTRODUCTION
This manual serves as a step-by-step guide on how to install Arch Linux on a new
x86_64 computer. This manual will also explain any software and setup required by the
control systems team.
3) Signature Verification
The verification steps require using powershell. To open powershell, type Powershell
into the search bar. An App called Windows Powershell should appear. Click on it so
you can continue the verification.
To view the files and folders in the current directory, type the following:
ls
To move to another folder, type the following:
cd .\<name of folder>\
To go back to the home directory, type the following:
cd ..
SHA1 Verification
Using Powershell, go to the directory where the .iso file is located. The following
command will create a code:
MD5 Verification
Using Powershell, go to the directory where the .iso file is located. The following
command will create a code:
Signature Verification
This method utilises an external program called GNUpg. This program can be
downloaded from the GNUpg website (https://www.gnupg.org/download/index.html).
Download the GnuPG Signature Program.
Once downloaded, click on the .exe file to run the program. The program is fairly
straight forward if the following steps are followed:
1) Choose the Arch Linux ISO Image for the Flash from File Section
As a general rule, when creating a bootable USB, make sure to use an empty USB with
at least 6GB of free space.
BIOS Configuration
Booting the USB may require changing the BIOS (Basic Input Output System) settings
of the computer. Depending on the make and model of computer, there will be different
ways of getting to the BIOS settings. On the Lenovo Thinkpad, the regular boot can be
interrupted by pressing shift as the computer turns on.
After navigating to the BIOS Boot Menu, choose the USB to boot into it. If that doesn’t
work, it means the BIOS settings need to be changed. The two things to change here
are:
After changing those two settings, the computer should be able to boot into the USB and
start the Arch Linux Installation. If the USB system is not booting, change the boot
order in the BIOS Boot Menu or manually boot into the USB by selecting it in the BIOS
Boot Menu.
ls /sys/firmware/efi/efivars
If the files and folders in that directory are shown and no errors come up, the system is
booted in UEFI mode.
Internet Connection
Connection to internet using wifi can be set up using the iwd package. This comes with
the .ISO image and doesn’t have to be installed.
iwctl
Type the following to determine the name of the wifi adapter in the computer:
device list
Type the following to search for local networks:
ping machinedata.framecad.com
If the connection is successful, it will show packets being sent and received.
System Clock
Type the following to update the system clock:
timedatectl status
Partition Setup
The installation instructions for single boot (Arch Linux will be installed as the only
OS) and dual boot (Arch Linux will be installed alongside another OS) differ in this
section.
SINGLE BOOT
Type the following to get the name of the disk:
fdisk -l
In order for Linux to work, two new partitions need to be created.
Type the following to open the interface for creating new partitions:
When creating the new partitions, make sure to write down the entry in the device
column for the Linux Filesystem Type partition and the EFI System partition, as these
will be used later. Once the partitions have been created, make sure to write these
changes to the disk and exit out of the interface.
DUAL BOOT
Type the following to view the partitions that are already there and to get the name of
the disk:
fdisk -l
In order for Linux to work, two new partitions need to be created alongside the existing
Windows and EFI Partitions.
Type the following to open the interface for creating new partitions:
Creating a new partition can be done by either creating the partitions using the free
space or shrinking the Microsoft partition and then creating the Linux partitions using
the free space.
When creating the new partitions, make sure to write down the entry in the device
column for the Linux Filesystem Type partition, the Linux Swap Type partition and the
EFI System partition, as these will be used later. Once the partitions have been created,
make sure to write these changes to the disk and exit out of the interface.
SINGLE BOOT
Type the following to format the EFI partition:
mkdir /mnt/efi
mount /dev/<EFI PARTITION> /mnt/efi
DUAL BOOT
Type the following to format the Linux Filesystem partition:
mkdir /mnt/efi
mount /dev/<EFI PARTITION> /mnt/efi
Package Installation
Type the following to install important packages for the Linux system:
System Configuration
Type the following:
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/NZ/
hwclock --systohc
nano /etc/locale.gen
In the opened file, search for en_NZ.UTF-8 and remove the hash tag from that line.
Write Out the changes and exit from the file.
locale-gen
Language Setup
Type the following to set up the language for the Arch Linux system:
nano /etc/locale.conf
This will open up the file which needs to be edited. The following needs to be added to
the top of the file:
LANG=en_NZ.UTF-8
Once the changes have been made, write out the changes and exit the file.
Network Configuration
Type the following to set up the name of the Arch Linux system on the network:
nano /etc/hostname
Add the chosen name of the Arch Linux system to the top of the file, write out the
changes and exit the file.
nano /etc/hosts
Edit the file so it looks like the figure below (where the maroon boxes should be
replaced with the computer name setup in /etc/hostname and the spaces are made using
the tab key once or twice):
Once the changes have been made, write out the changes and exit the file.
Root Password
Type the following to set up the password for the root user:
Passwd
GRUB Setup
SINGLE BOOT
Type the following to download GRUB, which will access to the windows partition and
linux partition:
mkdir /boot/efi
Type the following to view the partitions:
fdisk -l
Type the following to mount the EFI partition:
nano /etc/default/grub
Uncomment the following line from the file:
GRUB_DISABLE_OS_PROBER=false
Write out the changes and exit the file.
Desktop UI Setup
Type the following to download xorg and gnome, which are used to create an easy to
use interface similar to Windows or MacOS:
Enable Services
Type the following to enable services required when the Arch Linux system is started:
Boot Order
Once the necessary packages have been installed, type the following to leave the Arch
Linux system and restart the computer.
exit
reboot
If the system is dual boot, go to the BIOS Boot settings and move GRUB to the top of
the Boot order. This means that once it starts, grub will allow access to Arch Linux and
Windows.
passwd <USERNAME>
Connection
If the xorg and gnome installation and setup was done correctly, the user should be able
to connect to a wifi network using the GUI.
Additional Drivers
If any issues occur after the installation process, such as the wifi not connecting, the
hardware might require extra additional drivers to be installed. Searching online for
similar issues might be the only way to troubleshoot issues.
If important drivers are missing, the entire Arch Linux Setup installation process will
need to be repeated. These additional drivers will need to be installed prior to exiting the
Arch Linux system.
AUR Helpers
These are used to automate the usage of the Arch User Repository and make it easy to
find and install packages. Yay is a good AUR Helper to use because unlike Yaourt, it is
still being supported.
makepkg -si
Yay Usage
Type the following to search for packages with specific text in its name:
Linux Basics
Files + Directories
To view the files in a directory, type the following:
ls
To view the files in a directory with more information, type the following:
ls -la
To enter another directory, type the following:
cd <directory_name>
To go back one directory, type the following:
cd ..
To go back to the home directory, type the following:
cd --
To remove a file, type the following:
rm <file_name>
To copy a file, type the following:
cp <path>/<file_name> <destination_path>
Type the following to move files from one destination to another:
mv <file_location> <file_destination>
For example, if I was moving a file called “text.txt” from Downloads to Documents, I’d
type the following:
mv ~/Downloads/text.txt ~/Documents/
vim <file_name>
To insert into/edit a file with vim, type the following and then press enter:
:i
To save a file with vim, type the following and then press enter:
:w
To exit a file with vim, type the following and then press enter:
:q
To leave edit mode, press the escape button.
ip a
Gitkraken
Download the following package to get Gitkraken, a application which provides a user
interface for dealing with git files:
1) gitkraken
Electrical Automation
Required Packages
Download the following packages for the electrical automation to work:
1) texlive-core
2) texlive-bin
3) texlive-science
4) dpic
The texlive packages can be downloaded using yay, while dpic needs to be downloaded
from the website (http://www.ece.uwaterloo.ca/~aplevich/dpic/). Extract the package and follow the
instructions on the INSTALL sheet.
Clone the git repository using the information and steps in 2.5 from the Gitlab website
(https://git.framecad.com/electrical/f-series_drawings).
GMDL Creation
No packages are required for the GMDL Creation. The updates to the GMDL can be
done using any text editor. An example of a good text editor would be QtCreator.
CF Card Creation
Virtual Machine Setup
In order to build CF Cards, an Arch Linux Virtual Machine needs to be set up on the
Arch Linux partition. VirtualBox is a suitable program for the Arch Linux Virtual
Machine.
1) virtualbox
2) virtualbox-guest-iso
3) virtualbox-host-modules-arch
Get the extension pack for USB 3.0 functionality from the following link:
https://www.virtualbox.org/wiki/Downloads.
my.sharepoint.com/:u:/p/karlp/EQS8ByjJX9BOnJramDy7VOkBYl2iLC2iePxtX9Ep3o
Ls-w?e=OD7j9I)
1) Set Type to Linux and Version to Arch Linux(64-bit). The name of the VM is
not important
Once the VM is created, go into the settings. Delete the entry under Controller: SATA
and the entry under Controller: IDE. Then click the hard disk next to Controller: IDE
and select the downloaded .vdi file. If this step isn’t done, the VM will not work.
New Users
On the main computer’s terminal, type the following to allow a user to use virtualbox:
cd ~/sysdev/dfu-utils
Type the following commands to generate build system files, makefiles, executables and
manual pages:
./autogen.sh
./configure
make
make install
Download the print_controller.dfu file from the shared drive (Z:\FCS -
Manufacturing\Elec-Controls2021plus\Installs\Print Controller) and copy it to
~/sysdev/print_controller/.
pacman -S autoconf
Type the following to install usbutils:
pacman -S usbutils
Type the following to install yosys:
pacman -S yosys
Refer to CN-PRO-0007 for more information on print controller flashing and testing.
CX-Drive Setup
Copy the Cx-Drive_V3.00_EN folder from the shared drive (Z:\FCS -
Manufacturing\Elec-Controls2021plus\Installs\OMRON CX_DRIVE). Click the
Setup.exe to start the installation process. Refer to the License CX-Drive V3.0.0.txt for
the licensing information when prompted during the installation process.
TwinSAFE Setup
Start the TwinSAFE installation and setup by clicking the TC31-Full-
Setup.3.1.4024.32.exe file. This is the most recent version at the time of the writing of
this document. If a more recent version has been released, it may be worthwhile to
download that one.
Refer to CN-PRO-0011 for more information on setting up the TwinSAFE program and
testing on the machine.
Factory2 Setup
Download the Factory_2_extra_deps zip file from the shared drive (Z:\FCS -
Manufacturing\Elec-Controls2021plus\Installs\Factory2). Move pcan.h to /usr/include
and move all the rest of the files (including pcan.h) to /usr/lib.
1) qt5-base
2) qt5-tools
3) boost
4) etherlab-ethercat
5) etherlab-ethercat-tools
6) linux-headers
7) autoconf
8) automake
9) kyotocabinet
10) geoip
EtherCAT Setup
Use gitkraken to clone ethercat (https://git.framecad.com/factory/ethercat).
If an issue occurs where the EtherCat configuration doesn’t work, a redownload of linux
and redo of the grub installation will need to be done. Type the following to redo those
installations:
yay -S linux-lts
yay -S linux-lts-headers
grub-mkconfig -o /boot/grub/grub.cfg
The system will now need to be rebooted, otherwise the EtherCAT configurations will
still not work.