\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[a4paper, margin=0.75in]{geometry}

% set up hyperlink coloring
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,
    urlcolor=cyan
}

\setlength{\parindent}{0pt} % no indentation

% checkbox list: https://tex.stackexchange.com/questions/247681/how-to-create-checkbox-todo-list
\usepackage{enumitem,amssymb}
\newlist{boxlist}{itemize}{2}
\setlist[boxlist]{label=$\square$}

\renewcommand{\familydefault}{\sfdefault} % default to sans serif

%%%%%%%%%%%%%%%%
\begin{document}

\title{Advanced Exercises Set 1\\Setting Up a Highly Customizable Linux Distro}
\author{EECS 201 Winter 2020}
\date{}
\maketitle

\section*{Submission Instructions}
To receive credit for this assignment you will need to stop by someone's office hours,
demo your running code/system, and answer some questions.
\textbf{Extra credit is given for early turn-ins of advanced exercises. These details can be found on the website under the advanced homework grading policy.}

\section{Set Up an Arch Linux Virtual Machine (10 pts)}
Arch Linux is a GNU/Linux distribution with a rolling-release model,
where its package repository keeps up with the latest stable updates.
Unlike many distributions which try to be user-friendly,
Arch strives to be simple and minimalist upon installation,
allowing the user to pick and choose exactly what packages they want.
For example, after a typical Ubuntu installation you will have a graphical environment,
office software, and other utilities,
whereas after a baseline Arch installation you will be greeted with a non-graphical command line and a handful of core \*nix utilities,
notwithstanding the highly involved installation process.
With this minimal install process, however, comes a great deal of customizability.
You can read more about the Arch Linux philosophy on its \href{https://wiki.archlinux.org/index.php/Arch_Linux}{ArchWiki}.
\\\\
For this advanced assignment, I want you to install Arch Linux on another VirtualBox VM.
The idea behind this is to introduce you to all the bits and pieces that go into Linux systems that most people take for granted when using more user-friendly distributions.
\\\\
Follow the \href{https://wiki.archlinux.org/index.php/Installation_guide}{Installation Guide}.
\textbf{Do not follow online tutorials for this as they tend to be outdated. The ArchWiki's installation guide is the canonical way to install Arch.}
When you go through the installation process, be mindful of times the guide offers suggestions:
I may ask about your decisions during checkout.
When in doubt, follow the links in the installation guide and \textbf{read}.

\begin{enumerate}
    \item Create a new VirtualBox VM. Arch Linux has lower baseline system requirements than Ubuntu,
          but you can still go with the guidelines from Homework 1.
    \item By default VirtualBox VMs use a typical BIOS (i.e. they aren't UEFI).
          When you encounter instructions that differ based on BIOS vs UEFI,
          go with the BIOS instructions (if you do choose to go UEFI, follow the UEFI instructions).
    \item You don't have to really bother with checking the signature of the ISO or setting the keyboard layout
    \item With VirtualBox, the internet should work out of the box; configuring the network connection should not be necessary.
    \item Partitioning a disk involves dividing a disk into independent sections.
          A disk is exposed as a device such as \texttt{/dev/sda},
          with its partitions being exposed as \texttt{/dev/sda1}, \texttt{/dev/sda2}, etc.
          There are two partition table layouts which hold the partitioning information on a disk.
          MBR is the older table used by MS-DOS with several quirks (such as having a max of 4 partitions)
          while GPT is a newer table. For more details see \url{https://wiki.archlinux.org/index.php/Partitioning}.
          Note that "MBR" is also referred to as "DOS" when it comes to partition tables.
          For this assignment, MBR is probably the easiest to work with BIOS.
    \item As for partitioning scheme, you can set aside paritions to be for directories such as \texttt{/var}.
          However a single root partition can suffice.
          See \url{https://wiki.archlinux.org/index.php/Partitioning#Partition\_scheme} for advice.
          I would advise against having a \texttt{swap} partitions as you can use a \texttt{swapfile} instead.
    \item After partitioning the disk, you'll have to \textit{format} the partitions.
          Partitioning splits a disk into independent sections, but we still need a system to perform book-keeping
          for files. This is where a \textit{file system} comes into play. Formatting a disk sets up all the structures
          and metadata needed to track files and directories. Windows uses NTFS, mac OS uses APFS, while Linux has many options,
          with ext4 often being the "default".
    \item Mounting a partition puts it into the directory tree, allowing it to be accessed via \texttt{cd} and the like.
    \item When selecting mirrors by editing a file, \texttt{nano} and \texttt{vim} are available editors.
    \item After all this disk business, you are ready to perform the installation proper.
          I suggest adding \texttt{base-devel} (for tools like \texttt{gcc} and \texttt{make})
          and your preferred text editor (\texttt{nano}, \texttt{vim}, etc.) to the \texttt{pacstrap} invocation.
          You can also add whatever other packages you want to be installed from the get-go.
    \item The next several steps are fairly straightforward. When it comes to the timezone, our region is "America",
          and our closest city is "Detroit".
          \textbf{Make sure to configure your network connectivity, lest you be unable to connect to the internet after you reboot.
          \texttt{dhcpcd} (which will have to be installed) is a decent choice on VirtualBox}.
    \item The boot loader step offers a bunch of choices depending on whether you're using BIOS or UEFI.
          If you are using BIOS, I recommend GRUB.
          Do note that GRUB has different instructions depending on if you're using BIOS/UEFI and MBR/GPT.
          If you are using UEFI, \texttt{systemd-boot} can suffice.
    \item Once you've reached post-installation, you should create a user for yourself,
          as logging in only as root is rather insecure.
          If you don't have any users created, you can log in as "root", using the root password set during installation,
          to perform this step. \textbf{The user you create should have sudo privileges.}
          For info on user administration see \url{https://wiki.archlinux.org/index.php/Users\_and\_groups#User\_management}.
    \item A note on \texttt{visudo}: by default it will try to use \texttt{vi}, which may or may not be installed.
          You can change it by setting the \texttt{\$EDITOR} environment variable to \texttt{nano} or your preferred editor.
    \item Hooray! You now have a bare-bones Linux distro! Note that the package manager is called \texttt{pacman} (how quaint).
    \item Remember to remove the installation ISO after you're done.
\end{enumerate}

\subsection*{Submission Checkoff:}
\begin{boxlist}
    \item What sort of partitioning scheme did you use and why?
    \item What filesystem did you use and why?
    \item What does \texttt{pacstrap} do?
    \item Demonstrate that you run \texttt{sudo} as your user.
    \item How did you like the installation process compared to Ubuntu's?
\end{boxlist}


\section{Let There Be Light (5 pts)}
Being stuck in a purely command line environment is a bit of a drag.
Let's make the installation more home-y by getting a graphical user interface (GUI) going.

\begin{enumerate}
    \item You can find some info about this in \href{https://wiki.archlinux.org/index.php/General\_recommendations\#Graphical\_user\_interface}{General Recommendations}.
    \item The backbone of graphics on *nix systems is a display server.
          X11 is probably the most popular one, though Wayland is also an option.
          In either case, you'll have to install a display server before anything else,
          though often-times the GUI you install already has this as a dependency that
          \texttt{pacman} will resolve.
    \item Install your preferred GUI, be it a full on desktop environment or minimalist window manager.
          GNOME and KDE Plasma are popular, fully featured options.
          \\{\footnotesize{}By the way, I used to use KDE Plasma but have since moved onto i3 window manager.}
    \item There's various different ways to access the GUI.
          Choose and set up an option that suits your fancy (e.g. display manager, xinit, etc.).
    \item Install a terminal emulator, which is a graphical program that presents a terminal.
          One might have been already installed if you went for a fully featured desktop environment.
          Here is a list of terminal emulators: \url{https://wiki.archlinux.org/index.php/List\_of\_applications/Utilities#Terminal\_emulators}
          \\{\footnotesize{}My daily driver is \texttt{urxvt}.}
    \item You can also install the \href{https://wiki.archlinux.org/index.php/VirtualBox\#Install\_the\_Guest\_Additions}{VirtualBox Guest Additions} if you want.
\end{enumerate}
\subsection*{Submission Checkoff:}
\begin{boxlist}
    \item What graphical user interface did you pick and why?
    \item Demonstrate you can access the graphical user interface.
    \item Open your preferred terminal emulator.
\end{boxlist}

If you've completed these exercises, pat yourself on the back! Installing Arch is no easy feat!

\end{document}
