# Grandma
A guide and configuration files for setting up an operating system for Grandma.
# Prerequisits
A USB or CD drive with Void Linux Glibc x86\_64 written to it. The ISO image can be found here: https://voidlinux.org/download/

The computer that the OS is being installed needs to have a CPU architacture of x86\_64. If it is not, you are on your own. 

A resonable amount of skill and experience relivent to this guide.
# Overview
The operating system that will be set up, is intended to be minimal, and strieghtfowerward for Grandma to use. It will hopefully be stable and reliable. If you have issues, please file an [issue](https://git.disroot.org/oink/Grandma/issues/new).
Here is a list of features/specifications that the system will have:
* distro - Void Linux Glibc
    * I chose Void Linux, because it is a minimal, lightweight, stable, rolling-release disto. The rollig release cycle is prefered because this system will be using newer packages.
* window manager/compositor - LabWC
    * I chose Wayland as the display server protocal because it generally preforms better that Xorg. LabWC is the window manager because it is floating, lightweight, and minimal. It would be rediculous to expect Grandma to use a tiling window manager.
* application launcher/status bar - SFWBar and Lavalaunchers
    * I chose these bar options because they are designed to do exactly what I need them to do. These two bars will provide an XFCE-like interface, which is the easiest to operate with. 
* login manager - GreetD and TUIgreet
    * I chose a terminal solution so that all Grandma has to do is type in her username and password. She does not have to deal with the mouse.
* search engine - https://paulgo.io
    * I use this search engine daily. It is fast, and gets me good results. It is private, and open source.
* www client - Floorp
    * I have never tried this browser, but I assume that it is an improved version of FF.
* File manager - Dolphin
    * Easiest to use file manager.
* Office - Libre Office
    * Best office application. The other option is Only Office. IDK. 
* Crond - Scron
    * A simple version of cron
* Notifications - ~~Wayherb/tiramisu~~ Sway Notification Center
    * ~~A simple notification solution. You can use the sway one if your Grandma needs that.~~
    * Sway Notification Center has more features, and a better interface. Personally, I prefer a more minimal approach.
* Media Player - Haruna
    * Haruna is easy to use, and looks good. It's UI, and features are very user-friendly.
* Image Viewer - Probably Gwenview
    * For consistency purposes, mainly. It should be easy to use, and have easy fullscreen/slideshow mode. For a lighter-weight alternative, check out Ristretto. 
* Wallpaper selector - SWWW and Waypaper
    * Waypaper is a GUI frontend for SWWW or SwayBG. SWWW has smoth animations.
* Bluetooth manager - Blueman
    * Blueman is an actively maintained GUI for bluetooth.
* Audio Daemon - Pipewire
    * Pipewire works well, and is actively maintained.
* Screenshot utility - Flameshot
    * Smooth selection + easy to use GUI.
* Screen lock - Swaylock
    * Swaylock is easy to use and simple.
* Caulculator - Kcalc
    * Picked for ease of use and consistency with the rest of the system.
* Unit Conversion - Convertall version 1
    * Simple GUI for unit conversion.
# Installation
## Login
When prompted, log in as root. If you get stuck, press **Ctrl** + **d** to get a new prompt.
```
void-live login: root
Password: voidlinux
```
You will now be greated with a `# ` root prompt.
## Change the Keyboard Layout
To switch to Dvorak, run:
```
loadkeys dvorak
```
If you are using a different keymap, then replace `dvorak` with that keymap.
## SSH
If you would like install over SSH, do the following:

Start the Bash shell, so that you can edit the command if you made a mistake (press **Up**).
```sh
bash
```
You will need to connect to the network with `wpa_supplicant`, or `void-installer` in the **Network** section.

Determin the IP address
```sh
ip addr | grep -e wlp -e wlan -e enp -e eth[[:digit:]] | grep inet | head -1 | awk '{print $2}' | awk -F/ '{print $1}'
```
Keep in mind that this command will favor ethernet connections.

On another system, run:
```sh
ssh anon@<ip address>
```
Replace **\<ip address\>** with the actual ip address.

Say "yes."
```
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
```
The password is `voidlinux`.

Now login as root.
```
su root
Password: voidlinux
```
Start `bash`
```sh
bash
```
Set the `$TERM` vairiable
```sh
TERM=xterm
```
## Gathering Important Information
### Determining the Proper Disk to Install to
First, it is crutial to determine the proper device to install to. Run `lsblk`.
```sh
lsblk
```
Determine the proper drive to install to based on the size, type, and name. The drive should be one of the largest in size, the type *disk*, and named `/dev/sdX` or `/dev/nvmeX`, where **X** is a wildcard for additional numbers and letters. Keep in mind that drives may have partitions within them. To get a visual representation of that, run:
```sh
lsblk -T
```
The disk name will be important later on.
### Determining If the System is UEFI or Legacy BIOS
If you are not familiar with manual partitioning, then you are in for a real treat. The first step is to determine whether your machine is UEFI or Legacy BIOS.

The easiest way to check that is to run:
```sh
[ -d "/sys/firmware/efi" ] && echo "UEFI" || echo "Legacy BIOS"
```
You will need to know this for disk partitioning later on.

From now on, follow the CLI or GUI installation guide. 
## CLI
### Partitioning the Disk
#### UEFI
Recall the name of the disk that you want to install to, and run:
```
fdisk <disk name>
```
Replace **\<disk name\>** with the actual name of the drive; eg. `/dev/sda`.

You should now be greeted with some information, and a prompt that looks like this: `Command (m for help): `.

Type **p**, and press **Enter**. This will print out the information about the disk that you are writing to:
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 21AAD8CF-DB67-0F43-9374-416C7A4E31EA

<!--T:194-->
Device        Start      End    Sectors  Size Type
/dev/sda1      2048   2099199   2097152     1G EFI System
/dev/sda2   2099200  10487807   8388608     4G Linux swap
/dev/sda3  10487808  60549119  50061311  23.9G Linux filesystem
```
*Example outputs may be copied from the* [Gentoo wiki](https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks)*.*

Run this periodically throughout the partitioning process, especially before writing changes.

If the GPT disklabel already exists (as seen in the example output of **p**), repeatedly run **d** to delete the existing partitions.

If the disklabel does not exist, run **g** to create the GPT disklabel. *For Legacy BIOS you would create the MBR disklabel.*
```
Created a new GPT disklabel (GUID: 87EA4497-2722-DF43-A954-368E46AE5C5F).
```
Create the ESP partition which stands for EFI System Partition. This is where the boot loader and other UEFI firmware is loaded during the bootstrapping process. The partition should be small (200 MiB - 1 GiB). I recommend 512 MiB, to be safe. Press **n**, **Enter**, **Enter**, **Enter**, **+512M**, **Enter** to create a new partition.
```
Command (m for help): n
Partition number (1-128, default 1): 1
First sector (2048-60549086, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-60549086, default 60549086): +512M
 
Created a new partition 1 of type 'Linux filesystem' and of size 512 MiB.
```
Now would be a good time to run **p**, and print the changes. Keep in mind that the disk wont be touched until the changes are writen. 

Now make the partition an ESP (**t**, **1**, **1**):
``` 
Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 1
Changed type of partition 'Linux filesystem' to 'EFI System'.
```
Next, create a SWAP partition. I recommend making it 4 GiB. Here is a [chart](https://docs.voidlinux.org/installation/live-images/partitions.html#swap-partitions) explaining the amount of SWAP that should be added based on the amount of RAM that the system has. If you don't know how much RAM the system has, just guess. If the system is slow, you should probably do 8 GiB of SWAP.
```
Command (m for help): n
Partition number (2-128, default 2): 
First sector (526336-60549086, default 526336): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (526336-60549086, default 60549086): +4G
 
Created a new partition 2 of type 'Linux filesystem' and of size 4 GiB.
```
And now make it a SWAP partition (**t**, **2**, **19**):
```
Command (m for help): t
Partition number (1,2, default 2): 2
Partition type (type L to list all types): 19
 
Changed type of partition 'Linux filesystem' to 'Linux swap'.
```
Finally, make a root partition. This will take up the rest of the disk.
```
Command (m for help): n
Partition number (3-128, default 3): 3
First sector (10487808-60549086, default 10487808):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (10487808-60549086, default 60549086):

Created a new partition 3 of type 'Linux filesystem' and of size 23.9 GiB.
```
It is a good idea to change the type of the partition.
```
Command(m for help): t
Partition number (1-3, default 3): 3
Partition type or alias (type L to list all): 23

Changed type of partition 'Linux filesystem' to 'Linux root (x86-64)'
```
Print the changes. It should look something like this (the sizes will not be exactly the same):
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 87EA4497-2722-DF43-A954-368E46AE5C5F
 
Device       Start      End  Sectors  Size Type
/dev/sda1     2048   526335   524288    1G EFI System
/dev/sda2   526336  8914943  8388608    4G Linux swap
/dev/sda3  8914944 60549086 51634143 24.6G Linux root (x86-64)
```
When you are ready, write the changes, and you will be regreeted with the `# `.
```
Command (m for help): w
```
Once again, I recommend refering to the linked Gentoo Wiki page, if you want to well understand the partitioning process. If you followed this section, skip the Legacy BIOS section.
#### Legacy BIOS
Recall the name of the disk that you want to install to, and run:
```
fdisk <disk name>
```
Replace **\<disk name\>** with the actual name of the drive; eg. `/dev/sda`.

You should now be greeted with some information, and a prompt that looks like this: `Command (m for help): `.

Type **p**, and press **Enter**. This will print out the information about the disk that you are writing to:
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 21AAD8CF-DB67-0F43-9374-416C7A4E31EA
 
Device        Start      End  Sectors  Size Type
/dev/sda1      2048   526335   524288    1G EFI System
/dev/sda2    526336  2623487  2097152    1G Linux swap
/dev/sda3   2623488 19400703 16777216    8G Linux filesystem
/dev/sda4  19400704 60549086 41148383 19.6G Linux filesystem
```
*Example outputs may be copied from the* [Gentoo wiki](https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks)*.*

Run this periodically throughout the partitioning process, especially before writing changes.

If the MBR disklabel already exists (look at the `Disklabel type:` section of your last output), repeatedly run **d** to delete the existing partitions.

If it is not MBR, or does not yet exist, enter **o** to create the MBR (also known as DOS) disklabel. *UEFI generally uses GPT.*
```
Command (m for help): o
Created a new DOS disklabel with disk identifier 0xe04e67c4.
The device contains 'gpt' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.
```
Create the boot partition. The partition should be small (200 MiB - 1 GiB MiB). I recommend 512 MiB, to be safe. Press **n**, **Enter**, **Enter**, **Enter**, **+512M**, **Enter** to create a new partition.

Next create a SWAP partition. I recommend making it 4 GiB. Here is a [chart](https://docs.voidlinux.org/installation/live-images/partitions.html#swap-partitions) explaining the amount of SWAP that should be added based on the amount of RAM that the system has. If you don't know how much RAM the system has, just guess. If the system is slow, you should probably do 8 GiB of SWAP.

Press **n**, **Enter**, **Enter**, **+4G**:
```
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-60549119, default 0): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-60549119, default 60549119): +4G
 
Created a new partition 1 of type 'Linux' and of size 4 GiB.
```
And now make it a SWAP partition (**t**, **2**, **82**):
```
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 82

<!--T:179-->
Changed type of partition 'Linux' to 'Linux swap / Solaris'.
```
Next, make a root partition. This will take up the rest of the disk.
```
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (8390656-60549086, default 8390656):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (8390656-60549086, default 60549086):

Created a new partition 2 of type 'Linux' and of size 23.9 GiB.
```
Print the changes. It should look something like this (the sizes will not be exactly the same):
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe04e67c4
 
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda2          2048  8390654  8388606    4G 82 Linux
/dev/sda3       8390655 60549119 52158464 25.6G 83 Linux 
```
When you are ready, write the changes, and you will be regreeted with the `# `.
```
Command (m for help): w
```
Once again, I recommend refering to the linked Gentoo Wiki page, if you want to well understand the partitioning process. If you followed this section, skip the Legacy BIOS section.
### Creating the filesystems
#### UEFI
The boot partition should be vfat, the swap partition should be swap, and the root partition should be a linux filesystem.

Set the filesystem to vfat on the boot partition.
```sh
mkfs.vfat <boot partition>
```
Replace **\<boot partition\>** with the name of the boot partition (ie. `/dev/sda1`).

Set the filesystem to xfs on the root partition.
```sh
mkfs.xfs <root partition>
```
Replace **\<root partition\>** with the name of the root partition (ie. `/dev/sda3`).

Now initialize the swap parititon.
```sh
mkswap <swap partition>
```
Replace **\<swap partition\>** with the name of the root partition (ie. `/dev/sda2`).
#### Legacy BIOS
Set the filesystem to xfs on the root partition.
```sh
mkfs.xfs <root partition>
```
Replace **\<root partition\>** with the name of the root partition (ie. `/dev/sda2`).

Now initialize the swap parititon.
```sh
mkswap <swap partition>
```
Replace **\<swap partition\>** with the name of the root partition (ie. `/dev/sda1`).
### Mount for Installation
Mount the filesystem.
```sh
mount <root partition> /mnt
```
Replace **\<root partition\>** with the root partition (ie. `/dev/sda3`).

If you are using UEFI, mount the boot partition.
```sh
mkdir -p /mnt/boot/efi/
mount <boot partiton> /mnt/boot/efi/
```
Replace **\<boot partition\>** with the boot partition (ie. `/dev/sda1`).
### Installing the Base System
Choose the XPBS meathod or the ROOTFS meathod.
#### XBPS Meathod
Select a mirror from [xmirror.voidlinux.org](https://xmirror.voidlinux.org/). Favor teir 1 mirrors. They are official. If you must visit the site through the terminal, intsall `elinks`.

The mirrors can also be viewed in `xmirror`'s mirror list file..
```
cat /usr/share/xmirror/mirrors.lst
```
Now set the mirror as a shell variable.
```sh
REPO=<mirror>/current
```
Replace **\<mirror\>** with the mirror (ie. `https://mirrors.servercentral.com/voidlinux/`).

Copy the RSA keys into the system.
```sh
mkdir -p /mnt/var/db/xbps/keys
cp /var/db/xbps/keys/* /mnt/var/db/xbps/keys/
```
Use XBPS to install the base system.
```
XBPS_ARCH=x86_64 xbps-install -S -r /mnt -R "$REPO" base-system
```
#### ROOTFS Meathod
Select a mirror from [xmirror.voidlinux.org](https://xmirror.voidlinux.org/). Favor teir 1 mirrors. They are official. If you must visit the site through the terminal, intsall `elinks`.

The mirrors can also be viewed in `xmirror`'s mirror list file..
```
cat /usr/share/xmirror/mirrors.lst
```
Now set the mirror as a shell variable.
```sh
REPO=<mirror>/current
```
Replace **\<mirror\>** with the mirror (ie. `https://mirrors.servercentral.com/voidlinux`).

The Void Linux installation medium provides no way to download files from the web without running a long sring of commands. So I recommend installing `wget` to do so. If you must visit the site through the terminal, intsall `elinks` instead and use that to download.

Update the package manager.
```sh
xbps-install -R $REPO -u xbps
```
Install `wget`.
```sh
xbps-install -S -R $REPO wget
```
Visit the [Download](https://voidlinux.org/download/) page. Locate the link to the ROOTFS tarball for glibc. 

If using `wget`, then view/copy the link, and run:
```sh
wget <link>
```
Replace **\<link\>** with the link to the ROOTFS tarball.

Install the nessessary tool for unpacking tarballs
```sh
xbps-install -S -R $REPO xz
```
Now unpack it.
```sh
tar xvf void-*-ROOTFS*.tar.xz -C /mnt
```
Make sure you only download one ROOTFS tarball, or the wildcard will select more than one.
### Setting the XBPS mirror
Set the XBPS mirror.
```
xmirror -r /mnt -s $REPO
```
### Changing Root
To change root, you can use `xchroot` in the CLI installation. I tried to use `xchroot` after installing using the GUI meathod, and it did not work.

Chroot into the sytem.
```sh
xchroot /mnt /bin/bash
```
### Updating System
If you followed the XBPS meathod, skip this section.

Update the system:
```sh
xbps-install -Su xbps
xbps-install -u
xbps-install base-system
xbps-remove base-voidstrap
```
### Setting a Hostname
Set the hostname (the name of the computer).
```sh
echo <hostname> > /etc/hostname
```
Replace **\<hostname\>** with the the hostname (ie. `SewingMachine`). This should not have spaces in it.
### Setting the timezone
A list of available timezones are found in `/usr/share/zoneinfo`
```sh
ls /usr/share/zoneinfo
ls /usr/share/zoneinfo/<region>
```
Replace **\<region\>** with the region found in the output of `ls /usr/share/zoneinfo`.

Now set the timezone.
```sh
ln -sf /usr/share/zoneinfo/<region>/<timezone> /etc/localtime
```
Replace **\<region\>** with the region found in the output of `ls /usr/share/zoneinfo`, and **\<timezone\>** with timezone found in the output of `ls /usr/share/zoneinfo/<region>`, where of course **\<region\>** was replaced with the region found in the output of `ls /usr/share/zoneinfo`. (ie. `America`; `Chicago`).
### Installing a Terminal Text Editor
Install a terminal text editor of choice
```sh
xbps-install -S vis
```
### Setting he keyboard layout
Edit `/etc/rc.conf`.
```sh
vis /etc/rc.conf
```
Replace this
```sh
# Keymap to load, see loadkeys(8).
#KEYMAP="es"
```
with this
```sh
# Keymap to load, see loadkeys(8).
KEYMAP="<keyboard layout>"
```
where **\<keyboard layout\>** is replaced with the keyboard layout that you use (ie. `dvorak`). The keyboard layouts are listed in `/usr/share/kbd/keymaps`. The keyboard layout will be changed back to Grandma's keymap later.
```sh
ls /usr/share/kbd/keymaps/i386/  
```
### Setting the Locale
Edit `/etc/default/libc-locales`.
```sh
vis /etc/default/libc-locales
```
Uncomment the desired locales (remove the `#` at the beginning of the line).
```sh
en_US.UTF-8 UTF-8
```
Now reconfigure the locales.
```sh
xbps-reconfigure -f glibc-locales
```
### Enabling services
Enable DHCPCD.
```
ln -s /etc/sv/dhcpcd /etc/runit/runsvdir/default/
```
Enable SSHD.
```
ln -s /etc/sv/sshd /etc/runit/runsvdir/default/
```
### Setting the Root Password
Set the root password.
```
passwd
New password: 
Retype new password: 
```
Make it strong.
### Configuring fstab
Generate `/etc/fstab`.
```sh
cp /proc/mounts /etc/fstab
echo "$(grep -v proc /etc/fstab | grep -v sys | grep -v devtmpfs | grep -v pts)" > /etc/fstab
echo "<swap partition> swap swap rw,noatime,discard 0 0" >> /etc/fstab
```
Replace **\<swap partition\>** with the swap partition (ie. `/dev/sda2`).

Now run `blkid` to see the UUID of each partition.
```sh
blkid | sed 's/"//g'
```
Replace `/dev/*` (all refrences to a partition) with their UUID.
```
UUID=66dfcdb5-0ec7-4c90-8e3a-7f13cc65698d / xfs rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota 0 0
UUID=E8F6-20BF /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,noexec,inode64 0 0
LiveOS_rootfs /etc/resolv.conf overlay rw,relatime,lowerdir=/run/rootfsbase,upperdir=/run/overlayfs,workdir=/run/ovlwork 0 0
UUID=de4a6878-d346-4f66-9a38-78bcbe4866c9 swap swap rw,noatime,discard 0 0
```
### Installing a Bootloader
Follow the directions for Grub, EFI stub, or LILO.
#### Grub
If you have issues, please refer to the [official docummentation](https://docs.voidlinux.org/installation/guides/chroot.html#troubleshooting-grub-installation).
##### UEFI
Install Grub
```sh
xbps-install grub-x86_64-efi
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id="Void"
```
##### Legacy BIOS
Install Grub
```sh
xbps-install grub
grub-install <disk to install to>
```
Replace **\<disk to install to\>** with the disk that the system wis installed to. 
### Reconfiguring
Reconfigure for good measure
```sh
xbps-reconfigure -fa
```
### Rebooting
Exit, unmount, and reboot.
```sh
exit
umount -R /mnt
shutdown -r now
```
## GUI
### Running the installer
Running the installer is simple.
```sh
void-installer
```
![image of void-installer](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/void-installer.png)

Now select **Keyboard**.<br /> 
![image of "select Keyboard"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-keyboard.png)

Now select the keyboard layout that you use (not the one that Grandma uses). There will be a lot of typing afterword. I will show you how to change the keyboard layout back afterword.<br />
![image of the layout you use](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/the-layout-you-use.png)

Now select **Network**.<br />
![image of "select Network"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-network.png)

Select your device, then enter the SSID, and passphrase if required.<br />
![image of your device](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/your-device.png)  

I would say "yes" to this.<br />
![image of DHCP](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/DHCP.png)

Now select **Source**.<br />
![image of "select Source"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-source.png)

Select either option. I'd pick **Local** if you couldn't get network working, or it is a slow connection.<br />
![image of selecting a source](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/selecting-a-source.png)

Select **Mirror**.<br />
![image of "select Mirror"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-mirror.png)

Teir 1 mirrors are maintained by the Void Linux. Teir 2 mirrors are not managed by Void. Favor teir 1.<br />
![image of favoring tier 1](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/favor-teir-1.png)

Select your region.<br />
![image of your region](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/your-region.png)

Select the closest mirror. Favor tier 1. If Grandma lives near Chicago, then this would be a great mirror to use.<br />
![image of great mirror](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/great-mirror.png)

Select **Hostname**.<br />
![image of "select Hostname"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-hostname.png)

Type in the name of Grandma's computer.<br />
![image of name of grandma's cumputer](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/name-of-grandmas-computer.png)

Now select **Locale**.<br />
![image of "select Locale"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-locale.png)

Select your locale.<br />
![image of your locale](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/your-locale.png)

Now select **Timezone**.<br />
![image of "select Timezone"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-timezone.png) 

Select your country.<br />
![image of your country](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/your-country.png) 

Now select your timezone.<br />
![image of your country](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/your-timezone.png) 

Now select **RootPassword**.<br />
![image of "select Timezone"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-rootpassword.png) 

Create a strong passphrase. Make sure that you write it down, put it in a password manager, or don't forget it. If you can't type this password, then you have to chroot into the system to fix it.<br />
![image of strong passphrase](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/strong-passphrase.png) 

Now enter the root password again.<br />
![image of root password again](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/root-password-again.png) 

Now select **UserAccount**.<br />
![image of "select UserAccount"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-useraccount.png) 


Type in the first name of Grandma in lowercase letters.<br />
![image of first-name](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/first-name.png) 

Next, type the first and last name of Grandma with capitol letters (where needed) and spaces.<br />
![image of display name](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/display-name.png)

Enter the password that Grandma will be using to sign in. This should be short and easy to remember (like a 4-number PIN).<br />
![image of short password](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/short-password.png)

Now enter the password again.<br />
![image of user password again](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/user-password-again.png)

The default groups are good, for now.<br />
![image of groups](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/groups.png)

Now select **BootLoader**.<br />
![image of "select BootLoader"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-bootloader.png)

You have two options. You can select the disk that you would like to install the operating system to if you want to install GRUB as the bootloader, or you can select **none**, and install a different bootloader. In this guide, I will give instructions on how to install a different bootloader. I recommend you choose to install a different bootloader. The guide covers how to install EFIstub for UEFI systems, and LILO on BIOS systems.<br /> 
![image of choosing a bootloader](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/choosing-a-bootloader.png)

It will ask you if you want to use a graphical terminal for the grub bootloader. This means it will display the void logo in the bootloader. It's a pretty nice feature. Disabling it might give you a slightly faster boot time. If you are not installing grub, then so "No."<br />
![image of graphical terminal](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/graphical-terminal.png)

Now select **Partition**.<br />
![image of "select Partition"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-partition.png)

Now select the disk that you want to partition. This is the disk that you are going to install to.<br />
![image of the disk to partition](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/the-disk-to-partition.png)

Now select **fdisk**. This guide provides instructions on how to use `fdisk`. If you are familiar with partitioning, then you can use `cfdisk`.<br />
![image of the "select fdisk"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-fdisk.png)
### Partitioning the Disks
Here is additional information on partitioning: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks 

From the rest of this section, follow the instructions for firmware type UEFI or Legacy BIOS.
#### UEFI
You should now be greeted with some information, and a prompt that looks like this: `Command (m for help): `.

Type **p**, and press **Enter**. This will print out the information about the disk that you are writing to:
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 21AAD8CF-DB67-0F43-9374-416C7A4E31EA

<!--T:194-->
Device        Start      End    Sectors  Size Type
/dev/sda1      2048   2099199   2097152     1G EFI System
/dev/sda2   2099200  10487807   8388608     4G Linux swap
/dev/sda3  10487808  60549119  50061311  23.9G Linux filesystem
```
*Example outputs may be copied from the* [Gentoo wiki](https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks)*.*

Run this periodically throughout the partitioning process, especially before writing changes.

If the GPT disklabel already exists (as seen in the example output of **p**), repeatedly run **d** to delete the existing partitions.

If the disklabel does not exist, run **g** to create the GPT disklabel. *For Legacy BIOS you would create the MBR disklabel.*
```
Created a new GPT disklabel (GUID: 87EA4497-2722-DF43-A954-368E46AE5C5F).
```
Create the ESP partition which stands for EFI System Partition. This is where the boot loader and other UEFI firmware is loaded during the bootstrapping process. The partition should be small (200 MiB - 1 GiB). I recommend 512 MiB, to be safe. Press **n**, **Enter**, **Enter**, **Enter**, **+512M**, **Enter** to create a new partition.
```
Command (m for help): n
Partition number (1-128, default 1): 1
First sector (2048-60549086, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-60549086, default 60549086): +512M
 
Created a new partition 1 of type 'Linux filesystem' and of size 512 MiB.
```
Now would be a good time to run **p**, and print the changes. Keep in mind that the disk wont be touched until the changes are writen. 

Now make the partition an ESP (**t**, **1**, **1**):
``` 
Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 1
Changed type of partition 'Linux filesystem' to 'EFI System'.
```
Next, create a SWAP partition. I recommend making it 4 GiB. Here is a [chart](https://docs.voidlinux.org/installation/live-images/partitions.html#swap-partitions) explaining the amount of SWAP that should be added based on the amount of RAM that the system has. If you don't know how much RAM the system has, just guess. If the system is slow, you should probably do 8 GiB of SWAP.
```
Command (m for help): n
Partition number (2-128, default 2): 
First sector (526336-60549086, default 526336): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (526336-60549086, default 60549086): +4G
 
Created a new partition 2 of type 'Linux filesystem' and of size 4 GiB.
```
And now make it a SWAP partition (**t**, **2**, **19**):
```
Command (m for help): t
Partition number (1,2, default 2): 2
Partition type (type L to list all types): 19
 
Changed type of partition 'Linux filesystem' to 'Linux swap'.
```
Finally, make a root partition. This will take up the rest of the disk.
```
Command (m for help): n
Partition number (3-128, default 3): 3
First sector (10487808-60549086, default 10487808):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (10487808-60549086, default 60549086):

Created a new partition 3 of type 'Linux filesystem' and of size 23.9 GiB.
```
It is a good idea to change the type of the partition.
```
Command(m for help): t
Partition number (1-3, default 3): 3
Partition type or alias (type L to list all): 23

Changed type of partition 'Linux filesystem' to 'Linux root (x86-64)'
```
Print the changes. It should look something like this (the sizes will not be exactly the same):
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 87EA4497-2722-DF43-A954-368E46AE5C5F
 
Device       Start      End  Sectors  Size Type
/dev/sda1     2048   526335   524288    1G EFI System
/dev/sda2   526336  8914943  8388608    4G Linux swap
/dev/sda3  8914944 60549086 51634143 24.6G Linux root (x86-64)
```
When you are ready, write the changes, and you will be regreeted with the `# `.
```
Command (m for help): w
```
Once again, I recommend refering to the linked Gentoo Wiki page, if you want to well understand the partitioning process. If you followed this section, skip the Legacy BIOS section.
#### Legacy BIOS
Recall the name of the disk that you want to install to, and run:
```
fdisk <disk name>
```
Replace **\<disk name\>** with the actual name of the drive; eg. `/dev/sda`.

You should now be greeted with some information, and a prompt that looks like this: `Command (m for help): `.

Type **p**, and press **Enter**. This will print out the information about the disk that you are writing to:
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 21AAD8CF-DB67-0F43-9374-416C7A4E31EA
 
Device        Start      End  Sectors  Size Type
/dev/sda1      2048   526335   524288    1G EFI System
/dev/sda2    526336  2623487  2097152    1G Linux swap
/dev/sda3   2623488 19400703 16777216    8G Linux filesystem
/dev/sda4  19400704 60549086 41148383 19.6G Linux filesystem
```
*Example outputs may be copied from the* [Gentoo wiki](https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks)*.*

Run this periodically throughout the partitioning process, especially before writing changes.

If the MBR disklabel already exists (look at the `Disklabel type:` section of your last output), repeatedly run **d** to delete the existing partitions.

If it is not MBR, or does not yet exist, enter **o** to create the MBR (also known as DOS) disklabel. *UEFI generally uses GPT.*
```
Command (m for help): o
Created a new DOS disklabel with disk identifier 0xe04e67c4.
The device contains 'gpt' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.
```
Create the boot partition. The partition should be small (200 MiB - 1 GiB MiB). I recommend 512 MiB, to be safe. Press **n**, **Enter**, **Enter**, **Enter**, **+512M**, **Enter** to create a new partition.

Next create a SWAP partition. I recommend making it 4 GiB. Here is a [chart](https://docs.voidlinux.org/installation/live-images/partitions.html#swap-partitions) explaining the amount of SWAP that should be added based on the amount of RAM that the system has. If you don't know how much RAM the system has, just guess. If the system is slow, you should probably do 8 GiB of SWAP.

Press **n**, **Enter**, **Enter**, **+4G**:
```
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-60549119, default 0): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-60549119, default 60549119): +4G
 
Created a new partition 1 of type 'Linux' and of size 4 GiB.
```
And now make it a SWAP partition (**t**, **2**, **82**):
```
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 82

<!--T:179-->
Changed type of partition 'Linux' to 'Linux swap / Solaris'.
```
Next, make a root partition. This will take up the rest of the disk.
```
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (8390656-60549086, default 8390656):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (8390656-60549086, default 60549086):

Created a new partition 2 of type 'Linux' and of size 23.9 GiB.
```
Print the changes. It should look something like this (the sizes will not be exactly the same):
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe04e67c4
 
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda2          2048  8390654  8388606    4G 82 Linux
/dev/sda3       8390655 60549119 52158464 25.6G 83 Linux 
```
When you are ready, write the changes, and you will be regreeted with the `# `.
```
Command (m for help): w
```
Once again, I recommend refering to the linked Gentoo Wiki page, if you want to well understand the partitioning process. If you followed this section, skip the Legacy BIOS section.
### Creating the filesystems
#### UEFI
The boot partition should be vfat, the swap partition should be swap, and the root partition should be a linux filesystem.

Set the filesystem to vfat on the boot partition.
```sh
mkfs.vfat <boot partition>
```
Replace **\<boot partition\>** with the name of the boot partition (ie. `/dev/sda1`).

Set the filesystem to xfs on the root partition.
```sh
mkfs.xfs <root partition>
```
Replace **\<root partition\>** with the name of the root partition (ie. `/dev/sda3`).

Now initialize the swap parititon.
```sh
mkswap <swap partition>
```
Replace **\<swap partition\>** with the name of the root partition (ie. `/dev/sda2`).
#### Legacy BIOS
Set the filesystem to xfs on the root partition.
```sh
mkfs.xfs <root partition>
```
Replace **\<root partition\>** with the name of the root partition (ie. `/dev/sda2`).

Now initialize the swap parititon.
```sh
mkswap <swap partition>
```
Replace **\<swap partition\>** with the name of the root partition (ie. `/dev/sda1`).
### Setting the keybord layout
```sh
sed -i 's/us/dvorak/g' /etc/rc.conf
```
The keymaps are listed in `/usr/share/kbd/keymaps`. If you are using a different keymap, then replace `dvorak` with that keymap. The keymap will be changed back to Gradma's keymap later.
### Mounting filesystems
Mount the filesystem.
```sh
mount <root partition> /mnt
```
Replace **\<root partition\>** with the root partition (ie. `/dev/sda3`).

If you are using UEFI, mount the boot partition.
```sh
mkdir -p /mnt/boot/efi/
mount <boot partiton> /mnt/boot/efi/
```
Replace **\<boot partition\>** with the boot partition (ie. `/dev/sda1`).

Now prepare for `chroot`.
```sh
mount -t proc none /mnt/proc
mount -t sysfs none /mnt/sys
mount --rbind /dev /mnt/dev
mount --rbind /run /mnt/run
```
Copy over network files.
```sh
cp /etc/resolv.conf /etc/hosts /mnt/
```
Now `chroot`.
```sh
chroot /mnt /bin/bash
```
## GUI
### Running the installer
Running the installer is simple.
```sh
void-installer
```
![image of void-installer](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/void-installer.png)

Now select **Keyboard**.<br /> 
![image of "select Keyboard"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-keyboard.png)

Now select the keyboard layout that you use (not the one that Grandma uses). There will be a lot of typing afterword. I will show you how to change the keyboard layout back afterword.<br />
![image of the layout you use](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/the-layout-you-use.png)

Now select **Network**.<br />
![image of "select Network"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-network.png)

Select your device, then enter the SSID, and passphrase if required.<br />
![image of your device](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/your-device.png)  

I would say "yes" to this.<br />
![image of DHCP](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/DHCP.png)

Now select **Source**.<br />
![image of "select Source"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-source.png)

Select either option. I'd pick **Local** if you couldn't get network working, or it is a slow connection.<br />
![image of selecting a source](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/selecting-a-source.png)

Select **Mirror**.<br />
![image of "select Mirror"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-mirror.png)

Teir 1 mirrors are maintained by the Void Linux. Teir 2 mirrors are not managed by Void. Favor teir 1.<br />
![image of favoring tier 1](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/favor-teir-1.png)

Select your region.<br />
![image of your region](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/your-region.png)

Select the closest mirror. Favor tier 1. If Grandma lives near Chicago, then this would be a great mirror to use.<br />
![image of great mirror](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/great-mirror.png)

Select **Hostname**.<br />
![image of "select Hostname"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-hostname.png)

Type in the name of Grandma's computer.<br />
![image of name of grandma's cumputer](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/name-of-grandmas-computer.png)

Now select **Locale**.<br />
![image of "select Locale"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-locale.png)

Select your locale.<br />
![image of your locale](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/your-locale.png)

Now select **Timezone**.<br />
![image of "select Timezone"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-timezone.png) 

Select your country.<br />
![image of your country](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/your-country.png) 

Now select your timezone.<br />
![image of your country](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/your-timezone.png) 

Now select **RootPassword**.<br />
![image of "select Timezone"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-rootpassword.png) 

Create a strong passphrase. Make sure that you write it down, put it in a password manager, or don't forget it. If you can't type this password, then you have to chroot into the system to fix it.<br />
![image of strong passphrase](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/strong-passphrase.png) 

Now enter the root password again.<br />
![image of root password again](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/root-password-again.png) 

Now select **UserAccount**.<br />
![image of "select UserAccount"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-useraccount.png) 


Type in the first name of Grandma in lowercase letters.<br />
![image of first-name](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/first-name.png) 

Next, type the first and last name of Grandma with capitol letters (where needed) and spaces.<br />
![image of display name](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/display-name.png)

Enter the password that Grandma will be using to sign in. This should be short and easy to remember (like a 4-number PIN).<br />
![image of short password](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/short-password.png)

Now enter the password again.<br />
![image of user password again](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/user-password-again.png)

The default groups are good, for now.<br />
![image of groups](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/groups.png)

Now select **BootLoader**.<br />
![image of "select BootLoader"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-bootloader.png)

You have two options. You can select the disk that you would like to install the operating system to if you want to install GRUB as the bootloader, or you can select **none**, and install a different bootloader. In this guide, I will give instructions on how to install a different bootloader. I recommend you choose to install a different bootloader. The guide covers how to install EFIstub for UEFI systems, and LILO on BIOS systems.<br /> 
![image of choosing a bootloader](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/choosing-a-bootloader.png)

It will ask you if you want to use a graphical terminal for the grub bootloader. This means it will display the void logo in the bootloader. It's a pretty nice feature. Disabling it might give you a slightly faster boot time. If you are not installing grub, then so "No."<br />
![image of graphical terminal](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/graphical-terminal.png)

Now select **Partition**.<br />
![image of "select Partition"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-partition.png)

Now select the disk that you want to partition. This is the disk that you are going to install to.<br />
![image of the disk to partition](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/the-disk-to-partition.png)

Now select **fdisk**. This guide provides instructions on how to use `fdisk`. If you are familiar with partitioning, then you can use `cfdisk`.<br />
![image of the "select fdisk"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-fdisk.png)
### Partitioning the Disks
Here is additional information on partitioning: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks 

From the rest of this section, follow the instructions for firmware type UEFI or Legacy BIOS.
#### UEFI
You should now be greeted with some information, and a prompt that looks like this: `Command (m for help): `.

Type **p**, and press **Enter**. This will print out the information about the disk that you are writing to:
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 21AAD8CF-DB67-0F43-9374-416C7A4E31EA

<!--T:194-->
Device        Start      End    Sectors  Size Type
/dev/sda1      2048   2099199   2097152     1G EFI System
/dev/sda2   2099200  10487807   8388608     4G Linux swap
/dev/sda3  10487808  60549119  50061311  23.9G Linux filesystem
```
*Example outputs may be copied from the* [Gentoo wiki](https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks)*.*

Run this periodically throughout the partitioning process, especially before writing changes.

If the GPT disklabel already exists (as seen in the example output of **p**), repeatedly run **d** to delete the existing partitions.

If the disklabel does not exist, run **g** to create the GPT disklabel. *For Legacy BIOS you would create the MBR disklabel.*
```
Created a new GPT disklabel (GUID: 87EA4497-2722-DF43-A954-368E46AE5C5F).
```
Create the ESP partition which stands for EFI System Partition. This is where the boot loader and other UEFI firmware is loaded during the bootstrapping process. The partition should be small (200 MiB - 1 GiB). I recommend 512 MiB, to be safe. Press **n**, **Enter**, **Enter**, **Enter**, **+512M**, **Enter** to create a new partition.
```
Command (m for help): n
Partition number (1-128, default 1): 1
First sector (2048-60549086, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-60549086, default 60549086): +512M
 
Created a new partition 1 of type 'Linux filesystem' and of size 512 MiB.
```
Now would be a good time to run **p**, and print the changes. Keep in mind that the disk wont be touched until the changes are writen. 

I have done testing and you do not have to set the partition type. It is not the end of the world if you do.

Next, create a SWAP partition. I recommend making it 4 GiB. Here is a [chart](https://docs.voidlinux.org/installation/live-images/partitions.html#swap-partitions) explaining the amount of SWAP that should be added based on the amount of RAM that the system has. If you don't know how much RAM the system has, just guess. If the system is slow, you should probably do 8 GiB of SWAP.
```
Command (m for help): n
Partition number (2-128, default 2): 
First sector (526336-60549086, default 526336): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (526336-60549086, default 60549086): +4G
 
Created a new partition 2 of type 'Linux filesystem' and of size 4 GiB.
```
Finally, make a root partition. This will take up the rest of the disk.
```
Command (m for help): n
Partition number (3-128, default 3): 3
First sector (10487808-60549086, default 10487808):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (10487808-60549086, default 60549086):

Created a new partition 3 of type 'Linux filesystem' and of size 23.9 GiB.
```
Print the changes. It should look something like this (the sizes will not be exactly the same):
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 87EA4497-2722-DF43-A954-368E46AE5C5F
 
Device       Start      End  Sectors  Size Type
/dev/sda1     2048   526335   524288    1G Linux 
/dev/sda2   526336  8914943  8388608    4G Linux
/dev/sda3  8914944 60549086 51634143 24.6G Linux
```
When you are ready, write the changes.
```
Command (m for help): w
```
Once again, I recommend refering to the linked Gentoo Wiki page, if you want to well understand the partitioning process. If you followed this section, skip the Legacy BIOS section.
#### Legacy BIOS
You should now be greeted with some information, and a prompt that looks like this: `Command (m for help): `.

Type **p**, and press **Enter**. This will print out the information about the disk that you are writing to:
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 21AAD8CF-DB67-0F43-9374-416C7A4E31EA
 
Device        Start      End  Sectors  Size Type
/dev/sda1      2048   526335   524288    1G EFI System
/dev/sda2    526336  2623487  2097152    1G Linux 
/dev/sda3   2623488 19400703 16777216    8G Linux
/dev/sda4  19400704 60549086 41148383 19.6G Linux
```
*Example outputs may be copied from the* [Gentoo wiki](https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks)*.*

Run this periodically throughout the partitioning process, especially before writing changes.

If the MBR disklabel already exists (look at the `Disklabel type:` section of your last output), repeatedly run **d** to delete the existing partitions.

If it is not MBR, or does not yet exist, enter **o** to create the MBR (also known as DOS) disklabel. *UEFI generally uses GPT.*
```
Command (m for help): o
Created a new DOS disklabel with disk identifier 0xe04e67c4.
The device contains 'gpt' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.
```
We do not need to create a boot partition on BIOS MBR.

First, create a SWAP partition. I recommend making it 4 GiB. Here is a [chart](https://docs.voidlinux.org/installation/live-images/partitions.html#swap-partitions) explaining the amount of SWAP that should be added based on the amount of RAM that the system has. If you don't know how much RAM the system has, just guess. If the system is slow, you should probably do 8 GiB of SWAP.

Press **n**, **Enter**, **Enter**, **+4G**:
```
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-60549119, default 0): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-60549119, default 60549119): +4G
 
Created a new partition 1 of type 'Linux' and of size 4 GiB.
```

Next, make a root partition. This will take up the rest of the disk.
```
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (8390656-60549086, default 8390656):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (8390656-60549086, default 60549086):

Created a new partition 2 of type 'Linux' and of size 23.9 GiB.
```
Print the changes. It should look something like this (the sizes will not be exactly the same):
```
Command (m for help): p
Disk /dev/sda: 28.89 GiB, 31001149440 bytes, 60549120 sectors
Disk model: DataTraveler 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe04e67c4
 
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda2          2048  8390654  8388606    4G 82 Linux
/dev/sda3       8390655 60549119 52158464 25.6G 83 Linux 
```
When you are ready, write the changes.
```
Command (m for help): w
```
Once again, I recommend refering to the linked Gentoo Wiki page, if you want to well understand the partitioning process. If you followed this section, skip the Legacy BIOS section.
### Back to the GUI 
Next step is to create the file systems.

Now select **FileSystems**.<br />
![image of "select FileSystems"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-filesystems.png)

Now create the filesystems. Follow the directions dedicated to your firmware (UEFI/LegacyBIOS).
#### UEFI
For UEFI, the first partition, should be vfat, the second partition should be SWAP, and the third partition should be some sort of Linux file system.

Select the first partition.<br />
![image of the first partition](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/first-uefi-partition.png)

Select **vfat**.<br />
![image of vfat](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/uefi-vfat.png)

Type `/boot/efi` as the mountpoint.<br />
![image of /boot/efi](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/boot-mountpoint.png)

Say "yes."<br />
![image of new filesystem](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/new-filesystem.png)

Now select the second partition.<br />
![image of the second partition](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/second-uefi-partition.png)

Now select **swap**.<br />
![image of swap](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/uefi-swap.png)

Now select the third partition.<br />
![image of the third partition](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/third-uefi-partition.png)

Now select any Linux filesystem. This could be Ext4, BTRFS, or XFS. It doesn't really matter which one you pick.<br />
![image of Linux filesystem](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/uefi-linux-filesystem.png)

Type `/` as the mountpoint.<br />
![image of /](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/root-mountpoint.png)
#### Legacy BIOS
Select the second partition.<br />
![image of second partition](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/second-legacy-bios-partition.png)

Now select **swap**.<br />
![image of swap](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/legacy-bios-swap.png)

Say "yes."<br />
![image of new filesystem](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/new-legacy-bios-filesystem.png)

Now select the second partition.<br />
![image of the second partition](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/second-legacy-bios-partition.png)

Now select any Linux filesystem. This could be Ext4, BTRFS, or XFS. It doesn't really matter which one you pick.<br />
![image of Linux filesystem](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/legacy-bios-linux-filesystem.png)

Type `/` as the mountpoint.<br />
![image of /](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/legacy-bois-root-mountpoint.png)
#### UEFI and BIOS
Select **Install**.<br />
![image of "select Install"](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/select-install.png)

While the process is running check tty8 to see a verbose output (**Ctrl** + **Alt** + **8**). To return to the GUI, press (**Ctrl** + **Alt** + **1**) to go back to tty1.

**Do not reboot**, unless you chose the grub bootloader. If you chose the grub bootloader, reboot, and skip the next section.<br />
![image of reboot](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/reboot.png)
### Installing a Different Bootloader 
If you are installing a different bootloader, say "no" to the reboot prompt.<br />
![image of don't reboot](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/dont-reboot.png)

Now select **Exit**.<br />
![image of Exit](https://git.disroot.org/oink/Grandma/raw/branch/main/Assests/Images/exit.png)

Mount the filesystem.
```sh
mount <root partition> /mnt
```
Replace **\<root partition\>** with the root partition (ie. `/dev/sda3`).

If you are using UEFI, mount the boot partition.
```sh
mkdir -p /mnt/boot/efi/
mount <boot partiton> /mnt/boot/efi/
```
Replace **\<boot partition\>** with the boot partition (ie. `/dev/sda1`).

Now prepare for `chroot`.
```sh
mount -t proc none /mnt/proc
mount -t sysfs none /mnt/sys
mount --rbind /dev /mnt/dev
mount --rbind /run /mnt/run
```
Copy over network files.
```sh
cp /etc/resolv.conf /etc/hosts /mnt/
```
Now `chroot`.
```sh
chroot /mnt /bin/bash
```
Update the package manager.
```sh
xbps-install -u xbps
```
#### UEFI
Install a terminal text editor of choice
```sh
xbps-install -S vis
```
Replace `vis` with the terminal text of your choice.

Edit `/etc/default/efiboomgr-kernel-hook`
```sh
vis /etc/default/efiboomgr-kernel-hook
```
Replace `vis` with the text editor that was installed
```sh
DIFY_EFI_ENTRIES="1"
DISK="<disk name>"
PART="<boot partition number>"
```
Replace **\<disk name\>** with the name of the disk that the system was installed on (ie. `/dev/sda`). Replace **\<boot partition number\>** with the number of the boot partion (probably 1).
Reconfigure the kernel.
```sh
xbps-reconfigure linux$(uname -r | awk -F. 'OFS="." {print $1,$2}')
```
Now reboot.
```
reboot
```
#### Legacy BIOS
Now install Git and LILO.
```sh
xbps-install -S git lilo
```
Enter the home directory of the regular user.
```sh
cd /home/<user>/
```
Replace **\<user\>** weth the name of the user.

Now create the `.Git` directory. This is where Git repos will be stored. Make sure you get the capitolization correct, or programs might mistake the home folder as a git repo.
```
mkdir .Git
```
Now enter that directory
```sh
cd .Git
```
Now clone the Git repo containing the configs that will be used throughout the guide.
```sh
git clone https://git.disroot.org/oink/Grandma.git
```
Copy the LILO config to `/etc/`
```sh
cp Grandma/Config/lilo/lilo.conf /etc/   
```
Install a terminal text editor of choice
```sh
xbps-install -S vis
```
List the contents of the `/boot` directory.
```
ls /boot
```
The file you are looking for should look something like `vmlinuz-6.3.12_1`. Remember that filename.

Now edit the `lilo.conf`
```sh
vis /etc/lilo.conf 
```
Change the the disk to the one that Void was installed on.
```sh
# Defines the boot device.  This is where Lilo installs its boot
# block.  It can be either a partition, or the raw device, in which
# case it installs in the MBR, and will overwrite the current MBR.
# With newer kernel you should use the ID of the boot device, which
# can be found here: /dev/disks/by-id/ata*.
boot = /dev/sda
```
Change the partition to the root partition.
```sh
# Defines the partition which is the root partition. This partition
# will be mounted at first from the kernel. With newer kernel you
# should use the UUID (UUID="...") of the root device, which can be
# found here: /dev/disks/by-uuid/*.
root = /dev/sda2
```
If you are testing in a VM, uncomment the last two lines of this snippet of the file.
```sh
# Defines non-standard parameters for the specified disk.
# Uncomment if using a virtual machine.
#disk = /dev/vda
#	max-partitions=7
```
Change the partition to the root partition. Change the image to the file that you found in the `ls` output (ie. `/boot/vmlinuz-6.3.12_1`).
```sh
# Void Linux
image = /boot/vmlinuz-6.3.12_1
        label = "Void Linux"
        root = /dev/sda2
        read-only
        append = "quiet"
Reconfigure the kernel.
```
Now enable LILO.
```
lilo
```
# Setting Up a GUI
## Logging in
Login as root with the root password.

## Installing the Package Manager
To install the package manager, run:
```sh
xbps-install -S xbps
```
The `-S` flag updates the repositories.
## Installing a Terminal Text Editor
Install a terminal text editor of choice
```sh
xbps-install -S vis
```
## Configuring/Installing sudo/opendoas
sudo is the default tool that runs commands as other users. doas (opendoas) is another option, that I prefer because it is more minimal.
### sudo
sudo is already installed. 

Edit the sudoers file:
```sh
EDITOR=vis visudo 
```
Replace `vis` with your prefered text editor.

Locate the line that says
```sh
# %wheel ALL=(ALL:ALL) ALL
```
Remove the `# ` from the beginning of the line.

After this snippet:
```sh
## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL:ALL) ALL 

```
Add this snippet:
```sh
## Uncomment to allow user _greeter to execute poweroff and reboot commands without a password
_greeter ALL=NOPASSWD: /usr/bin/poweroff, /usr/bin/reboot

```
Now remove `/etc/sudoers.d/wheel`:
```
rm /etc/sudoers.d/wheel
```
### doas

## Installing a Window Manager
To install LabWC, run:
```sh
xbps-install -S dbus libudev pam_rundir seatd xorg-server-xwayland xorg-fonts labwc
```
Now edit `/etc/pam.d/system-login`:
```nd
vis /etc/pam.d/system-login
```
Add `-session   optional   pam_rundir.so` to the end of the file.

Enable the seatd service
```sh
ln -s /etc/sv/seatd /var/service/
```
Check that the service is running
```sh
sv status seatd
```
If it is not running, start it
```sh
sv start seatd
```
Enable the dbus service
```sh
ln -s /etc/sv/dbus /var/service/
```
Add the user to the `_seatd` group
```sh
usermod -aG _seatd <username>
```
Remember to replace **\<username\>** with the regular user's username.
## Installing a Terminal
To install Foot, run: 
```sh
xbps-install -S foot
```
## Testing the GUI
Log out of root with **Ctrl** + **d**, and log back in with the username for the regular user.

To start LabWC, run:
```sh
labwc -s foot
```
## Setting Up the Display Manager
Logout of the regular user, and log back in as root.

Install `greetd` and `tuigreet`:
```sh
xbps-install -S greetd tuigreet
```
Now enable the service
```sh
ln -s /etc/sv/greetd /var/service/
```
Configure greetd to use tuigreet, and start labwc
```sh
vis /etc/greetd/config.toml 
```
The login manager, and desktop will be started in tty7. to change tty(s), press **Ctrl** + **Alt** + ***n***, where ***n*** is the number of the tty.

The login manager will start LabWC with `dbus-run-session labwc`.

If you mess it up that command, and the display manager cannot start a GUI, then remember the tty keybind to change to a tty CLI.

Here is what the file should look like after changing it:
```toml
[terminal]
# The VT to run the greeter on. Can be "next", "current", or a number
# designating the VT
vt = 7

# The default session, also known as the greeter.
[defaut_session]

# `agetty` is the bundled agetty/login-lookalike. You can replace `/bin/sh`
# with whatever you want such as `sway`.
command = "tuigreet --power-shutdown 'sudo poweroff' --power-reboot 'sudo reboot'"

# The user to run the command as. The privlages this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "_greeter" 
```
The only line you should have had to change was this one:
```toml
command = "tuigreet --power-shutdown 'sudo shutdown now' --power-reboot 'sudo reboot'"
```
Ignore the lines starting with `#`. Those are comments.

Reboot the system to test it out.
```sh
reboot
```
Log in as your regular user at the prompt.
# Setting Up the Filesystem
Right click on the screen and click **Exit**. Then press **Ctrl** + **Alt** + **F1** to go to tty1.

Log in as your regular user at the prompt.

Install `git`.
```sh
sudo xbps-install git
```
Create directories.
```sh
mkdir -p .local/share/themes .config/labwc .Git/catppccin Desktop Backup Documents/PDF Documents/Emails Downloads Misc Music Pictures/Screenshots Videos/Movies 
```
Enter the `.Git` directory. Remain in this directory from now on.
```sh
cd .Git
```
Clone the repo with the configuration files used in this guide.
```sh
git clone https://git.disroot.org/oink/Grandma
```
# Configuring LabWC
Copy the LabWC configuration files into the configuration directory.
```sh
cp Grandma/labwc/* ~/.config/labwc/
```
Now clone the Openbox themes Git repo.
```
git clone https://github.com/catppuccin/openbox catppuccin/openbox
```
Copy the themes to the `themes` directory:
```
cp -r catppuccin/openbox/Catppuccin-Macchiato/ ~/.local/share/themes/
```
Change the keyboard layout.
```
vis ~/.config/labwc/environment
```
Replace these line
```
# XKB_DEFAULT_LAYOUT=se
```
With this
```
XKB_DEFAULT_LAYOUT=<layout>
XKB_DEFAULT_VARIANT=<variant>
```
Replace **\<layout\>** with the keyboard layout (ie. `us`), and **\<variant\>**, with the variant (ie. `dvorak`).
# Configuring Foot
Copy the config directory into `~/.config`.
```
cp Grandma/Config/foot/ ~/.config/
```
*Credit* [Catppuccin](https://github.com/catppuccin/foot)

Create the `fonts` directory.
```
mkdir -p ~/.local/share/fonts
```
Change to that directory.
```
cd ~/.local/share/fonts
```
Now install the nerd font:
```
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/Mononoki.zip
```
Install `unzip`.
```
sudo xbps-install unzip
```
Unpack the zip file.
```
unzip Mononoki.zip
```
Remove the `LICENCE.txt` and `README.md`.
```
rm LICENSE.txt README.md
```
Ruturn to the previous directory.
```
cd -
```
# Changing the Themes
Install the icon theme.
```
sudo xbps-install papirus-icon-theme
```
Copy the `gtk-3.0` config directory into `~/.config`.
```
cp Grandma/Config/gtk-3.0/ ~/.config/
```
# ZSH
Install ZSH.
```sh
sudo xbps-install -S zsh
```
Create a directory for plugins.
```sh
mkdir -p ~/.config/zsh/Plugins
```
Install Starship
```sh
sudo xbps-install starship
```
Clone the Git repo containing the starship config.
```sh
git clone https://github.com/catppuccin/starship catppuccin/starship
```
Copy the starship config into `~/.config`.
```sh
cp catppuccin/starship/starship.toml ~/.config
```
Now change to the `Plugins` directory.
```sh
cd ~/.config/zsh/Plugins
```
Clone the plugins.
```sh
git clone https://github.com/z-shell/F-Sy-H
git clone https://github.com/zsh-users/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-history-substring-search
```
Copy the ZSH config into `$HOME`.
```
cp ~/.Git/Grandma/Config/zsh/.zshrc ~/
```
Make ZSH the default shell
```sh
chsh -s /usr/bin/zsh
```
# Wallpaper
Create the wallpapers directory.
```sh
mkdir -p ~/.local/share/wallpapers
```
Copy the wallpaper over
```sh
cp ~/.Git/Grandma/Config/Wallpapers/* ~/.local/share/wallpapers
```
## Swww
Now clone the swww repo.
```
git clone https://github.com/LGFae/swww
```
Change to the directory.
```
cd swww
```
Now install cargo.
```
sudo xbps-install cargo
```
Now install the dependencies.
```
sudo xbps-install lz4 scdoc 
```
Build with Cargo.
```
cargo build --release
```
Put the binaries in the `$PATH`.
```
sudo cp target/release/swww target/release/swww-daemon /usr/local/bin
```
Generate the man pages.
```
./doc/gen.sh
```
Put the man pages in the manpath.
```
sudo cp doc/generated/* /usr/local/share/man/man1
```
# Audio
Install Pipewire.
```sh
sudo xbps-install -S pipewire
```
Create the config.
```
: "${XDG_CONFIG_HOME:=${HOME}/.config}"
mkdir -p "${XDG_CONFIG_HOME}/pipewire/pipewire.conf.d"
ln -s /usr/share/examples/wireplumber/10-wireplumber.conf "${XDG_CONFIG_HOME}/pipewire/pipewire.conf.d/"
ln -s /usr/share/examples/pipewire/20-pipewire-pulse.conf "${XDG_CONFIG_HOME}/pipewire/pipewire.conf.d/"
```
# Bars
