<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Raspberry Pi 4 on mhemeryck</title><link>https://mhemeryck.xyz/tags/raspberry-pi-4/</link><description>Recent content in Raspberry Pi 4 on mhemeryck</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sun, 21 Feb 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://mhemeryck.xyz/tags/raspberry-pi-4/index.xml" rel="self" type="application/rss+xml"/><item><title>Bootstrapping a pi4</title><link>https://mhemeryck.xyz/posts/2021-02-21-bootstrapping/</link><pubDate>Sun, 21 Feb 2021 00:00:00 +0000</pubDate><guid>https://mhemeryck.xyz/posts/2021-02-21-bootstrapping/</guid><description>&lt;p&gt;I&amp;rsquo;ve recently bought myself a &lt;a href="https://www.raspberrypi.com/products/raspberry-pi-400/"&gt;raspberry pi 400&lt;/a&gt;, a small form factor keyboard with a &lt;em&gt;raspberry pi 4 4GB RAM&lt;/em&gt; built into it.
In hindsight, there are probably very few scenarios in which such a computer makes actually makes sense to me, but it still looks quite nice.
I first took it for a spin using the raspberry pi OS that was on the SD card that came along with the set, but while I can acknowledge that it works quite OK out of the box, it just looks so ugly.
Henceforth, I did decide on installing &lt;a href="https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4"&gt;arch for ARM&lt;/a&gt; on it.
Since I did notice that I need to rethink every time again what are the best tools to install on a fresh install, this is a write-up of the most important tools I would always install.&lt;/p&gt;</description><content:encoded>&lt;p&gt;I&amp;rsquo;ve recently bought myself a &lt;a href="https://www.raspberrypi.com/products/raspberry-pi-400/"&gt;raspberry pi 400&lt;/a&gt;, a small form factor keyboard with a &lt;em&gt;raspberry pi 4 4GB RAM&lt;/em&gt; built into it.
In hindsight, there are probably very few scenarios in which such a computer makes actually makes sense to me, but it still looks quite nice.
I first took it for a spin using the raspberry pi OS that was on the SD card that came along with the set, but while I can acknowledge that it works quite OK out of the box, it just looks so ugly.
Henceforth, I did decide on installing &lt;a href="https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4"&gt;arch for ARM&lt;/a&gt; on it.
Since I did notice that I need to rethink every time again what are the best tools to install on a fresh install, this is a write-up of the most important tools I would always install.&lt;/p&gt;
&lt;p&gt;The key 2 tools are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.passwordstore.org/"&gt;pass&lt;/a&gt; password manager&lt;/li&gt;
&lt;li&gt;&lt;a href="https://yadm.io/"&gt;yadm&lt;/a&gt; yet-another-dotfile-manager&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The rationale behind it is the following: I use &lt;code&gt;pass&lt;/code&gt; to be able to get easy access to all my passwords and logins, &lt;code&gt;yadm&lt;/code&gt; manages all the other dotfiles for me.&lt;/p&gt;
&lt;h2 id="arch"&gt;Arch&lt;/h2&gt;
&lt;p&gt;For a &amp;ldquo;regular&amp;rdquo; arch install, see the &lt;a href="https://wiki.archlinux.org/index.php/installation_guide"&gt;arch installation guide&lt;/a&gt;.
In this case, the installation was a bit atypical since it was for an ARM platform, see &lt;a href="https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4"&gt;arch for ARM&lt;/a&gt; for this (I did use the ARMv7 installation guide).&lt;/p&gt;
&lt;p&gt;Other noteworthy steps in the installation &amp;hellip;&lt;/p&gt;
&lt;h2 id="arch-linux-arm-noisy-boot"&gt;arch linux arm: noisy boot&lt;/h2&gt;
&lt;p&gt;Terminal would show all of the kernel audit messages; add &lt;code&gt;audit=0&lt;/code&gt; to command line options &lt;code&gt;/boot/cmdline.txt&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Remove noisy welcome message&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rm /etc/motd
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="helpers"&gt;Helpers&lt;/h2&gt;
&lt;p&gt;Some helpers to install with the subsequent steps:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pacman -Syu --noconfirm zsh sudo which vim git openssh libfido2
pacman -S --noconfirm --needed base-devel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="add-a-user"&gt;Add a user&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;touch /etc/skel/.zshrc
groupadd sudo
useradd -m $USER -g $GROUP -G sudo -s /usr/bin/zsh
echo &amp;quot;%sudo ALL=(ALL) NOPASSWD: ALL&amp;quot; &amp;gt; /etc/sudoers.d/$USER
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Update password&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;passwd $USER
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="install-pikaur"&gt;Install &lt;code&gt;pikaur&lt;/code&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;git clone https://aur.archlinux.org/pikaur.git
cd pikaur
makepkg -fsri
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="some-more-helpers"&gt;Some more helpers&lt;/h2&gt;
&lt;p&gt;Some more helpers I&amp;rsquo;d always like to keep around&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pikaur -S --noconfirm ctags oh-my-zsh-git ripgrep fzf bat tmux
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="git-default-config"&gt;git default config&lt;/h2&gt;
&lt;p&gt;Since we&amp;rsquo;ll be using &lt;code&gt;git&lt;/code&gt;, you&amp;rsquo;ll need to define some initial config&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git config --global user.email &amp;lt;email&amp;gt;
git config --global user.name &amp;quot;&amp;lt;name&amp;gt;&amp;quot;
git config --global init.defaultBranch master
git config --global pull.rebase true
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="gpg"&gt;&lt;code&gt;gpg&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Import stubs from yubikey&lt;/p&gt;
&lt;p&gt;Install and enable smart card reader:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pikaur -S ccid
systemctl enable pcscd
systemctl start pcscd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Fetch keys from card&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gpg --edit-card
&amp;gt; fetch
&amp;gt; quit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Get the key id&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;KEYID=$(gpg --with-colons --fingerprint | awk -F: '$1 == &amp;quot;fpr&amp;quot; {print $10;}' | head -n1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Update the trust of the key&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gpg --edit-key $KEYID
&amp;gt; trust
&amp;gt; 5
&amp;gt; quit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Enable ssh-agent using gpg-agent (temporarily; the final &lt;code&gt;zshrc&lt;/code&gt; file will contain the proper setup)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export SSH_AUTH_SOCK=&amp;quot;$(gpgconf --list-dirs agent-ssh-socket)&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Tell the gpg-agent to prompt on the current TTY:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gpg-connect-agent updatestartuptty /bye
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="pass"&gt;&lt;code&gt;pass&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Install pass&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pikaur -S pass
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Init pass&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pass init $KEYID
pass git remote add origin git@gitlab.com:&amp;lt;repo&amp;gt;
pass git pull
pass git reset --hard origin/master
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="yadm"&gt;&lt;code&gt;yadm&lt;/code&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;pikaur -S yadm
yadm clone git@gitlab.com:&amp;lt;repo&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At this point, I have all the minimum tools I would use for my daily work.&lt;/p&gt;
&lt;h2 id="ui"&gt;UI&lt;/h2&gt;
&lt;p&gt;Even though I would spend most of my life on the command line, I also a graphical environment to work in.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not going to delve to deeply into that, since I mostly prefer vanilla &lt;a href="https://www.gnome.org"&gt;gnome3&lt;/a&gt; for that, combined with &lt;a href="https://wiki.gnome.org/Projects/GDM"&gt;&lt;code&gt;gdm&lt;/code&gt;&lt;/a&gt; for a login manager.&lt;/p&gt;
&lt;h2 id="closing-thoughts"&gt;Closing thoughts&lt;/h2&gt;
&lt;p&gt;My initial goal was to find a way of completely automating my initial installs, but in the end I figured this wasn&amp;rsquo;t what I really needed, because:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;distro-specific: I don&amp;rsquo;t always run on the same distro, so not everything is portable&lt;/li&gt;
&lt;li&gt;other requirements: for unattended installs (servers), I don&amp;rsquo;t want / need to copy all my secrets on there (albeit encrypted or not)&lt;/li&gt;
&lt;li&gt;outdated: for my daily driver install, I have no need to often keep on reprovisioning my install. By the time I would have a need to reprovision, a lot of the setup has probably changed, so it makes more sense to (vaguely) document some of the &lt;em&gt;basic&lt;/em&gt; steps instead of a fully automated machine image.&lt;/li&gt;
&lt;/ol&gt;</content:encoded></item></channel></rss>