Skip to content

Commit

Permalink
Add WSL2 installation instructions (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
secmancer authored Aug 18, 2021
1 parent c426843 commit bf42462
Show file tree
Hide file tree
Showing 7 changed files with 364 additions and 173 deletions.
65 changes: 65 additions & 0 deletions bootstrap/archlinux/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content=
"A page providing the necessary tools to begin programming in C++ on Arch Linux">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Developer bootstrap - FRC Team 3512</title>
<link rel="stylesheet" type="text/css" href="../../main.css">
<link rel="shortcut icon" type="image/ico" href="../../favicon.ico">
</head>
<body>
<header id="navbar">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../admin/">Admin</a>
</li>
<li>
<a href="../" class="active">Developer Bootstrap</a>
</li>
<li>
<a href="../../vpn/">VPN Setup</a>
</li>
<li>
<a href="../../ci/">Curriculum</a>
</li>
<li>
<a href="../../fll/">FLL</a>
</li>
<li>
<a href="../../archives/">Archives</a>
</li>
</ul>
</header>
<div class="body">
<h1 id="Arch_Linux_bootstrap">Arch Linux bootstrap</h1>
<h2 id="Dual-booting_Arch_Linux_on_a_PC">Dual-booting Arch Linux on a
PC</h2>
<p>Tutorial for this coming soon. For now, refer to <a href=
"https://wiki.archlinux.org/title/Installation_guide">here</a>,</p>
<h2 id="Tools_installation">Tools installation</h2>
<h3>Visual Studio Code</h3>
<p>Follow the installation guide from <a href=
"https://docs.wpilib.org/en/latest/docs/zero-to-robot/step-2/wpilib-setup.html">
WPILib Docs</a>.</p>
<p>To build robot projects in a terminal, run the following command to set
JAVA_HOME in <code>~/.bashrc</code>:</p><code>echo 'export
JAVA_HOME=~/wpilib/2021/jdk' &gt;&gt; ~/.bashrc</code>
<h3>GCC</h3><code>sudo pacman -S gcc</code>
<h3>Git</h3><code>sudo pacman -S git</code>
<h3>Formatter</h3>
<p>This requires a package from the AUR. Use either the manual installation
method (shown below) or an AUR helper.</p>
<pre>
sudo pacman -S python
cd /tmp
git clone https://aur.archlinux.org/python-wpiformat-git
makepkg -si</pre>
<h3 id="CMake">CMake</h3><code>sudo pacman -S cmake</code>
</div>
</body>
</html>
190 changes: 17 additions & 173 deletions bootstrap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,82 +49,20 @@ <h1 id="Developer_bootstrap">Developer bootstrap</h1>
highly recommended to back up all of your valuable data to a seperate
location to avoid data loss.
</blockquote>
<h2 id="Dual-booting_Ubuntu_on_a_PC">Dual-booting Ubuntu on a PC</h2>
<p>The first thing to do is to make space for your Ubuntu installation.
Most of the time, the best way of achieving this is to shrink your existing
OS partition (In this tutorial, we will be dealing with dual-booting with
Windows. If you are a Mac user, please use the tutorial on dual-booting for
a Mac.)</p>
<p>Windows has its own built-in partition creator. Here is a really simple
tutorial on dummies.com that can help you with that. The link is <a href=
"https://www.dummies.com/computers/pcs/how-to-shrink-a-hard-drive-volume-in-windows/">
here</a>.</p>
<p>To begin the creation of your USB, grab an empty USB stick and download
an Ubuntu .iso file (you have a choice between the stable and lastest
releases. Stable versions are recommended.) at the <a href=
"https://ubuntu.com/">official Ubuntu website</a>.</p>
<p>Next, you need to install a "USB creator" to help create your bootable
USB stick. Some USB creators include <a href=
"https://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/">Universal
USB Installer (or UUI)</a> and <a href=
"https://www.balena.io/etcher/">Balena Etcher</a>. Instructions are
provided on both of the websites on how to use each individual creator.</p>
<p>After doing so, you can then close the installer once it states that the
bootable USB is ready. At this point, you can restart your PC enable to
start the installation process.</p>
<p>To boot off your newly-created USB, you would need to access your
computer's BIOS. This can be access by pressing a certain key(s) when you
first boot up. Your BIOS keys depend on your PC's manufacturer, which can
usually be found with a quick Google search.</p>
<p>After you have successfully accessed your BIOS, press your appropriate
key to open up your boot options. Select your USB device that with the
Ubuntu installer installed onto it. Once you see the Ubuntu start up
screen, all you have to do is to follow onscreen instructions. When Ubuntu
asks for where you would like to have the Ubuntu OS installed, click
"Something Else". Only select this option, as the others may mess up your
existing Windows installation. It would then ask you to select an empty
partition for you to install on. Select the empty partition that you
created using the Windows shrinking tool and select next. After that,
installation is pretty straight forward.</p>
<p>Congrats! You now have Ubuntu and Windows at the same time!</p>
<h2 id="Dual-booting_Ubuntu_on_a_Macbook">Dual-booting Ubuntu on a
Macbook</h2>
<p>Dual-booting any Linux distro on a Macbook requires you to get your
hands more dirty. For this tutorial, I'll be referencing this article by
Chris Hoffman on HowToGeek.com on how to do this. The website is <a href=
"https://www.howtogeek.com/187410/how-to-install-and-dual-boot-linux-on-a-mac/">
here</a>.</p>
<p>Before doing anything, make sure that you have full-disk encryption
disabled. Otherwise, you may come across some weird issues when setting up
the necessary tools to start the dual-boot process.</p>
<p>First, you need to install rEFInd onto your Macbook, which allows you to
boot onto many other operating systems installed onto your
machine.</p><a href="https://sourceforge.net/projects/refind/">Download it
here</a>. Select the .zip file of the latest, stable build. Open a terminal
window, drag the install.sh file on to the window, and press enter to begin
the installation process. It may require your password (or admin password
if you are not the admin) to allow this action, so have that handy. Once it
is done, restart your Mac and you should see the boot manager menu.
<p>Next, we need to shrink the existing Mac OS space to make some space for
Ubuntu. This can be achieved by using the Disk Utility tool preinstalled
onto your Mac. Just open the tool and shrink your current storage amount
for the Mac OSX. Although the minimum storage limit for Ubuntu is 5GB, it
is recommended allow storage greater than 5GBs. Most recommend 20GB to
30GB, but it depends on what you want. Just leave adequate amount of room
for OSX is you plan on continuing to add data to your machine. Don't create
a partition, just leave the empty storage alone.</p>
<p>Create your USB creator as usual (software is compatable with Mac).
After creation, simply restart your computer and you will approach the boot
menu for rEFInd. Select the inserted USB stick with the Ubuntu installer
installed to boot into the boot launcher. From there, installation is the
same as what is descibed in the Windows tutorial. After the installation,
your Mac will boot into the same menu at startup always. From there, you
can change between booting into Mac and booting into Ubuntu.</p>
<p>That is all you have to do! You can also follow the article I used (link
at top) to do this tutorial as well.</p>
<h2 id="Dual-booting_Arch_Linux">Dual-booting Arch Linux</h2>
<p>Tutorial for this coming soon. For now, refer to <a href=
"https://wiki.archlinux.org/title/Installation_guide">here</a>,</p>
<ul>
<li>
<a href="windows/">Windows bootstrap</a>
</li>
<li>
<a href="ubuntu/">Ubuntu bootstrap</a>
</li>
<li>
<a href="archlinux/">Arch Linux bootstrap</a>
</li>
<li>
<a href="macos/">macOS bootstrap</a>
</li>
</ul>
<h2 id="The_tools">The tools</h2>
<h3 id="Visual_Studio_Code">Visual Studio Code</h3>
<p>Visual Studio Code is an integrated development environment which makes
Expand All @@ -139,7 +77,7 @@ <h3 id="Visual_Studio_Code">Visual Studio Code</h3>
the executable was built successfully.</p>
<h3 id="GCC_compiler">GCC compiler</h3>
<p>This is the compiler gradle or CMake will use to build the programs you
write. MSYS2 provides a Linux-like environment with this compiler.</p>
write.</p>
<h3>CMake</h3>
<p>CMake will be used to build your personal projects. For better
integration with VS Code, download the "CMake Tools" extension under VS
Expand All @@ -151,8 +89,8 @@ <h3 id="Gradle">Gradle</h3>
more.</p>
<h3 id="Git">Git</h3>
<p>Git is a version control system used to manage the code you write. See
<a href="../ci/intro-to-git/index.html">Intro to Git</a> for more
information and detailed setup.</p>
<a href="../ci/intro-to-git/">Intro to Git</a> for more information and
detailed setup.</p>
<h3 id="GitHub">GitHub</h3>
<p>GitHub provides web based code review and repository management for the
Git version control system. Our GitHub organization is <a href=
Expand All @@ -169,100 +107,6 @@ <h3 id="Formatter">Formatter</h3>
practice to be familiar with the enforced style guide and be able to
write code in that style directly.
</blockquote>
<h2 id="Tools_installation_on_Ubuntu">Tools installation on Ubuntu</h2>
<p>The command blocks below should be run in a terminal, where each line is
entered separately and followed by the Enter key.</p>
<h3>Visual Studio Code</h3>
<p>Follow the installation guide from <a href=
"https://docs.wpilib.org/en/latest/docs/zero-to-robot/step-2/wpilib-setup.html">
WPILib Docs</a>.</p>
<p>To build robot projects in a terminal, run the following command to set
JAVA_HOME in <code>~/.bashrc</code>:</p>
<p><code>echo 'export JAVA_HOME=~/wpilib/2021/jdk' &gt;&gt;
~/.bashrc</code></p>
<h3>GCC</h3><code>sudo apt-get install gcc</code>
<h3>Git</h3><code>sudo apt-get install git</code>
<h3>Formatter</h3>
<pre>
sudo apt-get install clang-format python3-pip
pip3 install --user wpiformat</pre>
<h3>CMake</h3><code>sudo apt-get install cmake</code>
<h2 id="Tools_installation_on_Arch_Linux">Tools installation on Arch
Linux</h2>
<h3>Visual Studio Code</h3>
<p>Follow the installation guide from <a href=
"https://docs.wpilib.org/en/latest/docs/zero-to-robot/step-2/wpilib-setup.html">
WPILib Docs</a>.</p>
<p>To build robot projects in a terminal, run the following command to set
JAVA_HOME in <code>~/.bashrc</code>:</p><code>echo 'export
JAVA_HOME=~/wpilib/2021/jdk' &gt;&gt; ~/.bashrc</code>
<h3>GCC</h3><code>sudo pacman -S gcc</code>
<h3>Git</h3><code>sudo pacman -S git</code>
<h3>Formatter</h3>
<p>This requires a package from the AUR. Use either the manual installation
method (shown below) or an AUR helper.</p>
<pre>
sudo pacman -S python
cd /tmp
git clone https://aur.archlinux.org/python-wpiformat-git
makepkg -si</pre>
<h3 id="CMake">CMake</h3><code>sudo pacman -S cmake</code>
<h2 id="Tools_installation_on_Windows">Tools installation on Windows</h2>
<h3>Visual Studio Code</h3>
<p>Follow the installation guide from <a href=
"https://docs.wpilib.org/en/latest/docs/zero-to-robot/step-2/wpilib-setup.html">
WPILib Docs</a>.</p>
<h3>GCC Compiler</h3>
<ol>
<li>Download the MSYS2 installer from <a href=
"https://www.msys2.org/">here</a> and run it. Use the default
installation directory.
</li>
<li><code>pacman -Syu</code>, then close all terminals when directed to
do so.</li>
<li><code>pacman -Su</code></li>
<li>Add MSYS2 to your system-wide PATH environment variable.
<ul>
<li>32-bit path: "C:\msys32\usr\bin"</li>
<li>64-bit path: "C:\msys64\usr\bin"</li>
</ul>
</li>
<li>Create a desktop shortcut for "MSYS2 MSYS" if desired.</li>
<li><code>pacman -S --needed base-devel gcc</code>, then when prompted
for which packages in the base-devel group to install, press Enter to
select the default option (all of them).</li>
</ol>
<h3>Git</h3><code>pacman -S git</code>
<h3>Formatter</h3>
<p>Download the latest version of LLVM from <a href=
"https://releases.llvm.org/download.html">here</a> under "Pre-Built
Binaries" and run it. The default installation options are fine. Don't
worry if you see the following; it's irrelevant to our use.</p>
<pre>Installing MSVC integration...
Failed to find MSBuild toolsets directory.
MSVC integration install failed.</pre>
<p>MSYS2 keeps a separate PATH environment variable from the operating
system. Run the following command to add the LLVM installation to it.</p>
<p><code>echo 'export PATH=$PATH:/c/Program\ Files/LLVM/bin' &gt;&gt;
~/.bashrc</code></p>
<p>The following commands install Python and pip, then use pip to install
wpiformat.</p>
<pre>
pacman -S python
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install wpiformat</pre>
<p>After those commands complete, close and reopen the terminal so the PATH
environment variable change from earlier takes effect.</p>
<h3>CMake</h3>
<p>Download the CMake installer from <a href=
"https://cmake.org/download/">here</a> under "Latest Release". When running
the installer, make sure to add CMake to the PATH environment variable
(either for all users or just one). Any existing terminals will need to be
closed and reopened to receive the PATH update.</p>
<h2>What to do now?</h2>
<p>Once you have setup your computer, you can now learn more about <a href=
"../ci/index.html">programming</a>!</p>
</div>
</body>
</html>
46 changes: 46 additions & 0 deletions bootstrap/macos/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content=
"A page providing the necessary tools to begin programming in C++ on macOS">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Developer bootstrap - FRC Team 3512</title>
<link rel="stylesheet" type="text/css" href="../../main.css">
<link rel="shortcut icon" type="image/ico" href="../../favicon.ico">
</head>
<body>
<header id="navbar">
<ul>
<li>
<a href="../../">Home</a>
</li>
<li>
<a href="../../admin/">Admin</a>
</li>
<li>
<a href="../" class="active">Developer Bootstrap</a>
</li>
<li>
<a href="../../vpn/">VPN Setup</a>
</li>
<li>
<a href="../../ci/">Curriculum</a>
</li>
<li>
<a href="../../fll/">FLL</a>
</li>
<li>
<a href="../../archives/">Archives</a>
</li>
</ul>
</header>
<div class="body">
<h1 id="macOS_bootstrap">macOS bootstrap</h1>
<h2 id="Native_setup">Native setup</h2>
<p>TODO</p>
<h2 id="Tools_installation">Tools installation</h2>
<p>TODO: via homebrew</p>
</div>
</body>
</html>
Loading

0 comments on commit bf42462

Please sign in to comment.