<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>example.com</title>
<subtitle>Posts from example.com</subtitle>
<id>https://example.com/</id>
<link rel="alternate" href="https://example.com/"/>
<link rel="self" href="https://example.com/posts/index.xml"/>
<updated>2026-09-20T04:04:29Z</updated>
<entry>
<title>Alpine Linux 'diskless' install | kris.sh</title>
<id>https://example.com/posts/alpine-diskless-install/</id>
<link rel="alternate" href="https://example.com/posts/alpine-diskless-install/"/>
<updated>2026-04-12T05:27:24-05:00</updated>
<content type="html">&lt;p&gt;Alpine Linux is an interesting distribution- it&amp;#39;s incredibly small, uses a solid software stack, and I seem to be unable to stop making posts about it.&lt;/p&gt;
&lt;p&gt;One interesting thing that can be done with Alpine is a "diskless" installation- that being an installation where the system is loaded into RAM on startup, and runs there until the system shuts down.&lt;/p&gt;
&lt;p&gt;In addition, by default, none of the changes made to this in-RAM system will be saved to the actual disk on the system, making it "amnesic." This is particularly useful for applications where one may &lt;em&gt;not&lt;/em&gt; want changes&amp;#47;logs&amp;#47;etc to be saved to the disk (such as for a VPN gateway&amp;#47;host). Of course, changes can be explicitly committed to the disk- otherwise, it would be pretty much impossible to make a useful system out of this.&lt;/p&gt;
&lt;p&gt;In my case, I have acquired a Dell Wyse 3040 N10D thin client- a system that has 8G of soldered EMMC storage with no decent ways to expand. Given how notoriously fragile EMMC is, let alone how slow it is, running a system from the 2G of memory this system has suddenly looks extremely appealing in order to touch the EMMC &lt;strong&gt;as little as possible.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Precursory information as to why I&amp;#39;ve done this aside, here&amp;#39;s how this can be set up:&lt;/p&gt;
&lt;h1 id="diskless-alpine-installation"&gt;Diskless Alpine Installation&lt;/h1&gt;
&lt;p&gt;This guide assumes you&amp;#39;ve already written an Alpine live ISO to a flash drive&amp;#47;dvd&amp;#47;otherwise, and have booted it up.&lt;/p&gt;
&lt;p&gt;First, log into the installation media- we&amp;#39;re going to use the default Alpine ISO utilities to deploy the system.&lt;/p&gt;
&lt;p&gt;Once logged in, run the &lt;code&gt;setup-alpine&lt;/code&gt; script as per usual (I&amp;#39;m not going to cover this in the guide, it&amp;#39;s well documented external to this, including in other posts on my blog).&lt;/p&gt;
&lt;p&gt;Proceed through the installation process as per usual until you&amp;#39;ve chosen an &lt;code&gt;apk&lt;/code&gt; mirror, and hit &lt;code&gt;Ctrl+C&lt;/code&gt; to quit the installer- we will continue with that later. The point of this is to configure a few of the basics like networking in the live environment.&lt;/p&gt;
&lt;p&gt;Once you&amp;#39;ve exited the Alpine installer, we need to install a few utilities via: &lt;code&gt;apk add util-linux wipefs lsblk&lt;/code&gt;, &lt;code&gt;wipefs&lt;/code&gt; here is optional if the internal storage is already &lt;strong&gt;completely&lt;/strong&gt; blank, but it&amp;#39;s always best to make sure regardless. &lt;code&gt;util-linux&lt;/code&gt; will provide us with &lt;code&gt;fdisk&lt;/code&gt; so we can format the internal drive.&lt;/p&gt;
&lt;p&gt;Next, run &lt;code&gt;lsblk&lt;/code&gt; and figure out what disk you&amp;#39;re going to turn into your diskless boot drive- for this guide I am going to assume &lt;code&gt;&amp;#47;dev&amp;#47;vda&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In order to wipe the disk, you may run &lt;code&gt;wipefs --all &amp;#47;dev&amp;#47;vda&lt;/code&gt;. &lt;strong&gt;BE AWARE&lt;/strong&gt;, this will completely wipe the drive- back up anything on it you may want to keep beforehand (though, please try to avoid storing important data on EMMC if you can avoid it).&lt;/p&gt;
&lt;p&gt;Once your disk has been nuked, run &lt;code&gt;fdisk &amp;#47;dev&amp;#47;vda&lt;/code&gt; and create a partition table. After the partition table has been created, you may create a single FAT32 partition- this is where your boot files and configuration will live.&lt;/p&gt;
&lt;p&gt;The key combination I&amp;#39;ve used to do this is as follows: &lt;code&gt;o n p &amp;#60;enter&amp;#62; &amp;#60;enter&amp;#62; &amp;#60;enter&amp;#62; t b w&lt;/code&gt;, as shown below:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/fdisk-output.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;This key combination will create a partition table, a primary partition to hold your boot files, and set the type to W95 FAT32.&lt;/p&gt;
&lt;p&gt;After exiting &lt;code&gt;fdisk&lt;/code&gt;, we need to format the new partition- this can be done with: &lt;code&gt;mkfs.vfat &amp;#47;dev&amp;#47;vda1&lt;/code&gt;, again, adjusting for the drive&amp;#47;partition that applies to you.&lt;/p&gt;
&lt;p&gt;Next, we need to figure out where the installation media is mounted- you can find this information by running &lt;code&gt;df&lt;/code&gt; as shown below:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/df-output.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;In my case, the live media is &lt;code&gt;&amp;#47;media&amp;#47;cdrom&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now, to actually deploy the system to the "diskless" boot drive, we&amp;#39;re going to use Alpine&amp;#39;s &lt;code&gt;setup-bootable&lt;/code&gt; script. The syntax is as follows: &lt;code&gt;setup-bootable &amp;#60;live_system&amp;#62; &amp;#60;target&amp;#62;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;#60;target&amp;#62;&lt;/code&gt; in this case is the drive we want to deploy to, so in my case, the correct command would be: &lt;code&gt;setup-bootable &amp;#47;media&amp;#47;cdrom &amp;#47;dev&amp;#47;vda1&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Once you&amp;#39;ve done this, you&amp;#39;re free to shut the system down and pull your live media. The system should now start off of the "diskless" boot drive.&lt;/p&gt;
&lt;h1 id="configuring-a-new-diskless-alpine-installation"&gt;Configuring a new diskless Alpine installation&lt;/h1&gt;
&lt;p&gt;You may notice upon booting that the system is almost identical to the live media you just removed- because it pretty much is.&lt;/p&gt;
&lt;p&gt;Now that the system has started off of the "new" installation, run &lt;code&gt;setup-alpine&lt;/code&gt; again. This time, we will be going through it to completion as you would with a normal Alpine installation- but with a few important differences.&lt;/p&gt;
&lt;p&gt;Once making it to the point in the Alpine installer that you&amp;#39;re asked to select a disk, you should enter &lt;code&gt;none&lt;/code&gt;. After doing this, the installer will prompt us to enter locations for storing configs- one of these should be the disk we&amp;#39;ve just booted from, and one will be a directory on the same disk to store &lt;code&gt;apk&lt;/code&gt; cache.&lt;/p&gt;
&lt;p&gt;Configure as follows, replacing the values with ones that apply to your system:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/installer-output.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Ignore the error about &lt;code&gt;apk&lt;/code&gt; cache here, this will be solved when you run &lt;code&gt;apk update&lt;/code&gt; on the new system and commit that change.&lt;/p&gt;
&lt;p&gt;Once you&amp;#39;ve finished this, run &lt;code&gt;lbu commit&lt;/code&gt; to make your configuration save to disk to be loaded on the next startup. This command should be kept in mind- if you make any changes to the new system, they will not persist across boots unless you commit them to the disk like this.&lt;/p&gt;
&lt;p&gt;Congrats your new diskless Alpine install!&lt;/p&gt;
&lt;h1 id="notes-on-lbu-and-disk-commits"&gt;Notes on lbu and disk commits&lt;/h1&gt;
&lt;p&gt;By default, there are some directories that aren&amp;#39;t tracked by &lt;code&gt;lbu&lt;/code&gt;, namely &lt;code&gt;&amp;#47;home&lt;/code&gt; and &lt;code&gt;&amp;#47;root&lt;/code&gt;. Of course, this can be an issue if you set up a normal user- luckily this is very easy to fix.&lt;/p&gt;
&lt;p&gt;In order to add directories to be captured in your disk commits, run &lt;code&gt;lbu add &amp;#47;dir&lt;/code&gt;, replacing &lt;code&gt;&amp;#47;dir&lt;/code&gt; with the directory you would like to add, such as &lt;code&gt;&amp;#47;home&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Important configuration directories such as &lt;code&gt;&amp;#47;etc&lt;/code&gt; should be captured in your disk commits by default.&lt;/p&gt;
&lt;h1 id="editing-kernel-parameters"&gt;Editing kernel parameters&lt;/h1&gt;
&lt;p&gt;In order to configure kernel parameters on your new system, you&amp;#39;ll have to mount the disk as read&amp;#47;write as opposed to read-only. To do this, you can simply run &lt;code&gt;mount -o remount,rw &amp;#47;media&amp;#47;vda1&lt;/code&gt;, replacing &lt;code&gt;vda1&lt;/code&gt; with your partition. Once you&amp;#39;ve done this, you can open up &lt;code&gt;&amp;#47;media&amp;#47;vda1&amp;#47;boot&amp;#47;grub&amp;#47;grub.cfg&lt;/code&gt; in a text editor and configure your kernel parameters to your heart&amp;#39;s content (Alpine includes &lt;code&gt;vi&lt;/code&gt; by default).&lt;/p&gt;
&lt;p&gt;After editing, simply run: &lt;code&gt;sync &amp;#38;&amp;#38; mount -o remount,ro &amp;#47;media&amp;#47;vda1&lt;/code&gt; to put things back how they were, and then reboot the system to see them applied as per usual.&lt;/p&gt;
&lt;h1 id="closing-thoughts"&gt;Closing thoughts&lt;/h1&gt;
&lt;p&gt;I don&amp;#39;t have any, but this section seems to always exist. Have fun with your new install.&lt;/p&gt;
</content>
</entry>
<entry>
<title>What Linux distro should I use? | kris.sh</title>
<id>https://example.com/posts/what-distro/</id>
<link rel="alternate" href="https://example.com/posts/what-distro/"/>
<updated>2025-07-30T09:57:13-05:00</updated>
<content type="html">&lt;p&gt;This has become an incredibly difficult or impossible question to answer.&lt;/p&gt;
&lt;p&gt;This post is inclined to be somewhat based on opinion, You have been warned.&lt;/p&gt;
&lt;p&gt;If you want the short answer, pick something that looks interesting to you, try it out, and if you hate it? There are practically an infinite number of distros out there to try out next. (Though, I don&amp;#39;t want to create a distrohopping addiction via this post.)&lt;/p&gt;
&lt;p&gt;Everything sucks in one way or another? (foreshadowing) Well, you could always create your own or find something like &lt;a href="https://kisscommunity.bvnf.space/"&gt;kiss linux&lt;/a&gt; to base off of and bootstrap your own thing, though I do think this is (slightly) unreasonable to expect from a new user.&lt;/p&gt;
&lt;h2 id="some-basic-criteria-for-a-new-user"&gt;Some basic criteria for a new user&lt;/h2&gt;
&lt;h1 id="display-server"&gt;Display server&lt;/h1&gt;
&lt;p&gt;First and foremost, there are a lot of people with fairly "unusual" (these quotes are quite load-bearing) display setups, and despite whatever illogical thought process would lead one to disagree with this- Wayland support for a new user is going to be incredibly important.&lt;/p&gt;
&lt;p&gt;In the context of distributions that are typically recommended to new users, &lt;a href="https://linuxmint.com/"&gt;Linux Mint&lt;/a&gt; for example is one that usually comes up in the discussion, and with no hostility towards Linux Mint whatsoever, there is no stable&amp;#47;established Wayland support with any of their default desktop environment options.&lt;/p&gt;
&lt;p&gt;Problems that may arise from X11 only environments would primarily include lack of support for mixed refresh rate displays without horrifically hacky workarounds that at best result in major amounts of screen tearing, due to the fact that both displays are more or less treated as one- running the higher refresh rate display at the framerate corresponding to the lower one, or vice versa (hence hacky workaround). This is a problem I personally fought with for years via my high (170&amp;#47;240hz) and low (60hz) refresh rate displays until I bought an AMD graphics card years ago and was finally able to move to Wayland permanently.&lt;/p&gt;
&lt;p&gt;Another notable issue that does not matter much &lt;em&gt;to me&lt;/em&gt; personally, with X11 you are unable to use freesync at all if you have more than one display connected- even if they&amp;#39;re identical.&lt;/p&gt;
&lt;p&gt;Of course, scaling on X11 can also be a problem, among issues with modern display features in general.&lt;/p&gt;
&lt;p&gt;The solution? Ask some questions about the hardware someone is using before making a suggestion- or just recommend something that provides a Wayland option that is relatively stable and established- such as an option that provides KDE or GNOME.&lt;/p&gt;
&lt;p&gt;The primary concern here is that a user is going to install this, spend a bit trying to figure out why their monitors don&amp;#39;t work correctly, and then bounce to something else or just flee back to Windows.&lt;/p&gt;
&lt;h1 id="sensibly-up-to-date-software"&gt;Sensibly up to date software&lt;/h1&gt;
&lt;p&gt;When I suggest something "sensible" in this context- what I mean is generally not outdated enough to be a problem with newer hardware- which immediately rules out certain things that are (unreasonably) highly outdated- Debian for example, unless one chooses to use Debian Testing or pull specific things from backports so one is able to use newer hardware.&lt;/p&gt;
&lt;p&gt;I think there&amp;#39;s a happy medium here- my personal general distribution of choice, &lt;a href="https://voidlinux.org/"&gt;Void&lt;/a&gt;, &lt;em&gt;typically&lt;/em&gt; does not roll out "bleeding edge" software, but is also not generally "outdated." I tend to also be a fan of distributions that roll out a new release every 6 months or so, an example of a distro that does this (or sometimes, roughly this) would be &lt;a href="https://fedoraproject.org/"&gt;Fedora&lt;/a&gt;, though for various reasons (moderately annoying to pull Nvidia graphics drivers, weirdness around codecs, heavy-handed corporate involvement regardless of what people may suggest), I find it difficult to recommend. &lt;a href="https://alpinelinux.org/"&gt;Alpine&lt;/a&gt; is another distribution that roughly does this, though quite difficult to recommend to newer users.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://archlinux.org/"&gt;Arch&lt;/a&gt; would be a distro with &lt;strong&gt;relatively&lt;/strong&gt; sanely up to date software, though I am personally not a fan of the "update just because there&amp;#39;s an update" mentality around bleeding edge distributions.&lt;/p&gt;
&lt;h1 id="software-availability"&gt;Software availability&lt;/h1&gt;
&lt;p&gt;While less of a concern compared to the days of old due to awesome solutions like &lt;a href="https://flatpak.org/"&gt;flatpak&lt;/a&gt;, software availability does matter in certain contexts. I imagine most users are allergic to packaging the things they need themselves, and should find something that has a lot of packages (preferably of decent quality) available.&lt;/p&gt;
&lt;p&gt;I really seem to be talking about Arch a lot for someone who isn&amp;#39;t a big fan, but I do think it is appropriate for newer users these days who aren&amp;#39;t quite sure what they want.&lt;/p&gt;
&lt;p&gt;Arch is pretty good at this due to the &lt;a href="https://aur.archlinux.org/"&gt;AUR&lt;/a&gt;, or Arch User Repository. The problem here is that random things on the AUR &lt;strong&gt;cannot&lt;/strong&gt; be trusted. At minimum, you should be seeking packages that have a positive reputation and good comments, and preferably actually auditing packages you install yourself. There have been &lt;strong&gt;many&lt;/strong&gt; cases of something malicious being uploaded to the AUR, and really the responsibility for that falls on the user being conscious of what they&amp;#39;re doing.&lt;/p&gt;
&lt;p&gt;Also, just to hammer that in, for all intents and purposes the AUR should be treated like a &lt;strong&gt;public torrent tracker&lt;/strong&gt;, just with generic Arch packages as opposed to torrents. Oh, the days of keygen music and 12 toolbars suddenly appearing in Internet Explorer, along with the search engine changing on its own! Seriously though, &lt;em&gt;most&lt;/em&gt; packages are inclined to be fine but please be careful.&lt;/p&gt;
&lt;h2 id="being-responsible-with-recommending-a-distribution"&gt;Being responsible with recommending a distribution&lt;/h2&gt;
&lt;p&gt;The point I am more or less trying to make here is that there isn&amp;#39;t a good recommendation, and if you&amp;#39;re asking the question of "What Linux distro should I use?" then generally, it probably doesn&amp;#39;t matter much as you&amp;#39;ve yet to reach the point of developing opinions about certain software, but try not to deploy something that is going to be predictably problematic in one way or another. The key here is up to date software and a choice of what higher level software (desktop environments and the like) you interact with.&lt;/p&gt;
&lt;p&gt;If suggesting distributions, try to keep in mind the experience a newer user may have with the thing you recommend &lt;strong&gt;in their case, with their hardware and level of experience&lt;/strong&gt; may completely tarnish their opinion of the Linux ecosystem in general (though personally, I think modern Linux is a bit of a nightmare, blanket statement.)&lt;/p&gt;
&lt;p&gt;More or less what I mean here is that new users are not going to stick around if they&amp;#39;re dropped into the deep end immediately. Though, there is some value to this- given someone chooses to stick around and &lt;em&gt;actually&lt;/em&gt; learn Linux, they&amp;#39;re bound to be a higher quality member of the community in general.&lt;/p&gt;
&lt;h1 id="so-what-distributions-do-you-like-then"&gt;So what distributions do YOU like, then?&lt;/h1&gt;
&lt;p&gt;I get the sense that answering this question may lead to the (incredibly few) readers of this article interpreting my answer as a distro recommendation- &lt;strong&gt;it isn&amp;#39;t.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Though, I know an answer is probably expected here, and reasonably so, so with the above in mind:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://voidlinux.org/"&gt;Void&lt;/a&gt; - Has been my daily driver on both server and desktop for nearing 4 years as of the time of writing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://kisscommunity.bvnf.space/"&gt;Kiss&lt;/a&gt; - Uses a software stack I agree with by default assuming one uses the musl branch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://crux.nu/"&gt;Crux&lt;/a&gt; - I like the packaging system, and may only get slightly irritated with glibc.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Importantly, there are certain bits of software that I fundamentally disagree with- such as systemd. I definitely do not want spark some sort of illogical and ill-willed argument about systemd, the "religious" haters tend to completely miss the mark here. Fundamentally, if I don&amp;#39;t want to use a specific piece of software (or in the case of systemd, a massive metapackage of random things), I should not have to. Opinions like this are what influence &lt;em&gt;my own&lt;/em&gt; distribution choices. And again because I know someone will ask- runit is my preferred init system &amp;#47; service manager, and a bunch of random other software to fill in the minor gaps for things that require systemd-isms- because that&amp;#39;s sadly where the ecosystem has landed.&lt;/p&gt;
&lt;p&gt;The above minor example of an opinion about what software goes into creating a Linux operating system is the type of opinion that will generally be developed over time via exposure, I wouldn&amp;#39;t get &lt;em&gt;too&lt;/em&gt; caught up on specific details like this until you&amp;#39;ve gained some experience.&lt;/p&gt;
&lt;h1 id="should-your-opinions-influence-my-own"&gt;Should your opinions influence my own?&lt;/h1&gt;
&lt;p&gt;No. Your own opinions are realistically the only ones that should matter to you. I am merely trying to bring up issues with the various approaches here.&lt;/p&gt;
&lt;h2 id="so-what-distro-do-you-recommend-i-use"&gt;So what distro do you recommend I use?&lt;/h2&gt;
&lt;p&gt;This is the place this conversation usually leads to, and I know you are expecting some form of direct answer. In short- I have absolutely &lt;strong&gt;no&lt;/strong&gt; idea. I do not know you, nor how you use your computer, nor what kind of hardware you have, nor your philosophical views which may influence your choice.&lt;/p&gt;
&lt;p&gt;At best, I may be able to provide moderately random shots in the dark that may or may not stick, but do see the above "Being responsible with recommending a distribution."&lt;/p&gt;
&lt;p&gt;Depending on someones level of experience with computers in general, I have a knack for recommending Arch installed via &lt;a href="https://wiki.archlinux.org/title/Archinstall"&gt;archinstall&lt;/a&gt;, as one of these "shots in the dark."&lt;/p&gt;
&lt;p&gt;Despite the numerous issues with archinstall (mostly in terms of stability and questionable defaults), and despite the fact that it&amp;#39;s not recommended by the Arch team (despite the fact that it&amp;#39;s included in the official ISO by default? hello???), it may be a very quick and easy way for someone to get a system up that has up to date software, assuming they have someone to bounce questions off of while running the installer, and a practically endless level of software support, though I personally do not like Arch very much myself.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://endeavouros.com/"&gt;EndeavourOS&lt;/a&gt; seems to be a valid shout, as it&amp;#39;s relatively close to the Arch upstream and changes very few things that are bound to be minor adjustments to most users. The target here in my opinion would be people who look at a command line application (such as archinstall) and immediately decide it&amp;#39;s too difficult. More or less, this will theoretically provide an Arch experience with "less effort."&lt;/p&gt;
&lt;h2 id="what-distros-or-type-of-distros-do-you-not-recommend-i-use"&gt;What distros (or type of distros) do you NOT recommend I use?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Things that don&amp;#39;t have much of a reason to exist, generally. There are &lt;strong&gt;tons&lt;/strong&gt; of Arch based distributions for example that do absolutely nothing notable, and at most just ship a desktop environment by default that may or may not have a preconfigured "rice." Most distros like this are pointless.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are also various distros with an incredibly negative history, things like &lt;a href="https://manjaro.org/"&gt;Manjaro&lt;/a&gt; for example, do see &lt;a href="https://manjarno.pages.dev/"&gt;manjarno&lt;/a&gt; for information about that specifically- it would be redundant for me to type out all of this information here.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Incredibly small&amp;#47;niche distributions are sometimes really cool and are fine to use, and other times they&amp;#39;re not. Before &lt;a href="https://getsol.us/"&gt;Solus&lt;/a&gt; had died out, it was my absolute favorite "This just works out of the box!" type distribution, as it was also not the most bloated thing on earth. Nowadays, Solus &lt;em&gt;is&lt;/em&gt; apparently back, but the point here is that you may find yourself in a situation of needing to distrohop because the distro you chose has randomly ceased to exist, or it&amp;#39;s no longer maintained very well or at all.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Somewhat included in the above bullet point, things that are poorly maintained. &lt;a href="https://system76.com/pop/"&gt;PopOS&lt;/a&gt; used to be the generic youtuber type suggestion, and at the time that may have been valid, but these days it is quite outdated and quite poorly maintained, as the effort has moved over to developing the Cosmic desktop environment for the time being. Even with major distributions like this, sometimes there are problems that are the same as or adjacent to the above bullet point.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id="arch-is-difficult-to-use-muh-elitism-im-so-good-at-computer-because-i-installed-arch"&gt;Arch is difficult to use! Muh elitism! I&amp;#39;m so good at computer because I installed Arch!&lt;/h1&gt;
&lt;p&gt;Stop. This is idiotic and intended to exclude people in a baseless manner. Once Arch has been installed, I personally refute the idea that it is somehow substantially more difficult to use than something else- install your software, use your software, update your system fairly regularly, ask questions, and I promise you&amp;#39;ll have things figured out in no time. There is absolutely zero shame in asking questions- just don&amp;#39;t be a &lt;a href="https://meta.stackoverflow.com/a/258208"&gt;help vampire&lt;/a&gt;, try to respect the nature of receiving free support at the expense of someone elses time in a chatroom on IRC or Discord, a forum somewhere, or whatever you may be using.&lt;/p&gt;
&lt;h1 id="all-distributions-are-pretty-much-the-same-thing-anyway-why-does-it-matter"&gt;All distributions are pretty much the same thing anyway, why does it matter?&lt;/h1&gt;
&lt;p&gt;Quit it, or I&amp;#39;ll get out the rolled up newspaper. This is highly incorrect- and may just seem this way if you only interact with Firefox and Steam on a daily basis and not much else.&lt;/p&gt;
</content>
</entry>
<entry>
<title>DIY Mesh Router | kris.sh</title>
<id>https://example.com/posts/diy-mesh-router/</id>
<link rel="alternate" href="https://example.com/posts/diy-mesh-router/"/>
<updated>2024-02-16T20:51:42-06:00</updated>
<content type="html">&lt;p&gt;A while back, I wrote a script to set up a WiFi to Ethernet bridge device, and I have been using this for my connection at home for a while now. In this post, I will be describing the process of manually setting this up.&lt;/p&gt;
&lt;p&gt;If you just want to get your network up without reading further or performing a manual setup, the script can be found on my GitHub &lt;a href="https://github.com/kkrruumm/wireless-eth-bridge"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I purchased a Dell Optiplex 3040 Micro for ~$100 USD on eBay a bit ago specifically for this purpose due to its awesome WiFi antenna, and have been using this to provide my devices with a connection for roughly a week as of the time of writing.&lt;/p&gt;
&lt;p&gt;For the price, this machine wasn&amp;#39;t a bad buy (aside from the UEFI implementation being worse than MSIs) with an i5 6500t, 8gb of 1600mhz DDR3, and a 256gb TeamGroup Vulcan Z SSD that magically only had 1 power on hour and 27 power cycles according to S.M.A.R.T data. This machine is completely inaudible, even when under load.&lt;/p&gt;
&lt;p&gt;Now, I&amp;#39;m sure you&amp;#39;re thinking "Why didn&amp;#39;t you just run an Ethernet cable or use MOCA?"&lt;/p&gt;
&lt;p&gt;Well, I do not have Coaxial cables ran for MOCA, and I did not want to run an Ethernet cable up my stairs or drill a hole in the ceiling to route the cable through, nor did I want to get WiFi cards for each of my machines as I would prefer to keep my LAN transfers on Ethernet, so this machine connected to a switch is a good solution.&lt;/p&gt;
&lt;h1 id="necessary-software"&gt;Necessary software&lt;/h1&gt;
&lt;p&gt;To achieve this setup, we will be using nftables for our NAT (Network Address Translation), dnsmasq for our DHCP server to provide devices with IP addresses, and iproute or ifupdown to configure our interfaces.&lt;/p&gt;
&lt;p&gt;ifupdown is really preferred here, as with iproute we will be creating services to run our commands, while ifupdown is an actual process rather than just a CLI tool. However, some Linux distributions do not use or package ifupdown.&lt;/p&gt;
&lt;p&gt;Regardless of the Linux distribution you choose to use here, they should have nftables and dnsmasq packaged. For iproute or ifupdown, consult your distributions documentation and choose the appropriate one.&lt;/p&gt;
&lt;p&gt;In my case, I will be using Alpine Linux which uses ifupdown.&lt;/p&gt;
&lt;h1 id="ifupdown-setup"&gt;ifupdown setup&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If your distribution does not package ifupdown, you should skip to the iproute setup section instead of following ifupdown instructions.&lt;/p&gt;
&lt;p&gt;The goal is to assign a static IP address to this interface, as the IP address of this interface should not be changing.&lt;/p&gt;
&lt;p&gt;To set up ifupdown, the following needs to be added to &lt;code&gt;&amp;#47;etc&amp;#47;network&amp;#47;interfaces&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;auto &amp;#60;ethernet-interface&amp;#62; 
allow-hotplug &amp;#60;ethernet-interface&amp;#62;
iface &amp;#60;ethernet-interface&amp;#62; inet static
    address &amp;#60;ethernet-interface-ip&amp;#62; 
    gateway &amp;#60;ethernet-interface-ip&amp;#62;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;&amp;#60;ethernet-interface&amp;#62;&lt;/code&gt; in the &lt;code&gt;auto&lt;/code&gt;, &lt;code&gt;allow-hotplug&lt;/code&gt;, and &lt;code&gt;iface&lt;/code&gt; lines should be replaced with the ethernet interface you intend to use for connecting other devices you&amp;#39;d like to provide with internet, such as &lt;code&gt;eth0&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;#60;ethernet-interface-ip&amp;#62;&lt;/code&gt; in the &lt;code&gt;address&lt;/code&gt; line should be replaced with the IP address you want to give this interface, I typically put &lt;code&gt;10.0.1.1&amp;#47;24&lt;/code&gt; here because I use &lt;code&gt;10.0.0.X&lt;/code&gt; on my normal networks.
&lt;code&gt;&amp;#47;24&lt;/code&gt; here specifies the subnet mask via CIDR notation.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;#60;ethernet-interface-ip&amp;#62;&lt;/code&gt; in the &lt;code&gt;gateway&lt;/code&gt; line should specify the gateway, you can enter the same value as the &lt;code&gt;address&lt;/code&gt; line, so &lt;code&gt;10.0.1.1&amp;#47;24&lt;/code&gt; for this example.&lt;/p&gt;
&lt;p&gt;Once you&amp;#39;ve done this, your Ethernet interface has been fully configured and you can continue to the nftables setup.&lt;/p&gt;
&lt;h1 id="iproute-setup"&gt;iproute setup&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If your distribution packages ifupdown, you should go back to the ifupdown section instead of using iproute commands.&lt;/p&gt;
&lt;p&gt;Unlike ifupdown, iproute is just a CLI tool to configure an interface.&lt;/p&gt;
&lt;p&gt;In order to achieve what we&amp;#39;re trying to do here, it&amp;#39;s necessary to have these commands run on every boot, so the most straightforward option is to use SystemD&amp;#47;OpenRC services.&lt;/p&gt;
&lt;p&gt;The goal is to assign a static IP address to this interface, as the IP address of this interface should not be changing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;OpenRC:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Create a file in &lt;code&gt;&amp;#47;etc&amp;#47;init.d&lt;/code&gt; to be your service, you can name this anything you want to, however I will call mine "wirelessebridge"&lt;/p&gt;
&lt;p&gt;Contents of &lt;code&gt;&amp;#47;etc&amp;#47;init.d&amp;#47;wirelessebridge&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;#!&amp;#47;sbin&amp;#47;openrc-run
command="ip addr add &amp;#60;ethernet-interface-ip&amp;#62; dev &amp;#60;ethernet-interface&amp;#62; &amp;#38;&amp;#38; \
ip link set &amp;#60;ethernet-interface&amp;#62; up &amp;#38;&amp;#38; \
rc-service dnsmasq restart" 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;SystemD:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Create a file in &lt;code&gt;&amp;#47;etc&amp;#47;systemd&amp;#47;system&lt;/code&gt; to be your service, you can name this anything you want to, however I will call mine "wirelessebridge.service"&lt;/p&gt;
&lt;p&gt;Contents of &lt;code&gt;&amp;#47;etc&amp;#47;systemd&amp;#47;system&amp;#47;wirelessebridge.service&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;Description=Configure wireless eth bridge interface

[Service]
Type=oneshot
ExecStart=&amp;#47;bin&amp;#47;sh -c "ip addr add &amp;#60;ethernet-interface-ip&amp;#62; dev &amp;#60;ethernet-interface&amp;#62; &amp;#38;&amp;#38; \
ip link set &amp;#60;ethernet-interface&amp;#62; up &amp;#38;&amp;#38; \
systemctl restart dnsmasq"

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For both of these setups, &lt;code&gt;&amp;#60;ethernet-interface&amp;#62;&lt;/code&gt; should be replaced with the Ethernet interface you intend to use for connecting other devices you&amp;#39;d like to provide with internet, such as &lt;code&gt;eth0&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;#60;ethernet-interface-ip&amp;#62;&lt;/code&gt; should be replaced with the IP address you want to give this interface, I typically put &lt;code&gt;10.0.1.1&amp;#47;24&lt;/code&gt; here because I use &lt;code&gt;10.0.0.X&lt;/code&gt; on my normal networks.
&lt;code&gt;&amp;#47;24&lt;/code&gt; here specifies the subnet mask via CIDR notation.&lt;/p&gt;
&lt;p&gt;Once you&amp;#39;ve set this up for the init system you are using, your Ethernet interface has been fully configured and you can continue to the nftables setup.&lt;/p&gt;
&lt;h1 id="nftables-setup"&gt;nftables setup&lt;/h1&gt;
&lt;p&gt;After you have set up ifupdown &lt;strong&gt;OR&lt;/strong&gt; iproute services, it&amp;#39;s time to begin setting up our NAT with nftables.&lt;/p&gt;
&lt;p&gt;The role of NAT (Network Address Translation) is at the core of how this functions, as NAT provides us with a way to route traffic to another IP address, such as from our wireless interface to our Ethernet interface.&lt;/p&gt;
&lt;p&gt;To get started, we need to create a NAT table with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nft add table ip nat&lt;/code&gt;, the type &lt;code&gt;ip&lt;/code&gt; here does specify IPv4 addresses.&lt;/p&gt;
&lt;p&gt;Once we&amp;#39;ve created our table to store our chains, it&amp;#39;s time to create the postrouting chain in the NAT table with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nft add chain ip nat postrouting &amp;#39;{type nat hook postrouting priority 100; policy accept;}&amp;#39;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Postrouting allows us to alter packets after they have exited the output chain.&lt;/p&gt;
&lt;p&gt;Next, we need to add a rule to our postrouting chain with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nft add rule ip nat postrouting oifname &amp;#60;wireless-interface&amp;#62; masquerade&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;#60;wireless-interface&amp;#62;&lt;/code&gt; here should be replaced with the name of the wireless interface on the system, such as wlan0.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;oifname&lt;/code&gt; here specifies the &lt;em&gt;output interface.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;masquerade&lt;/code&gt; is a Linux networking concept that allows us to translate an IP address (or multiple IP addresses) to a different single IP address.&lt;/p&gt;
&lt;p&gt;If you have a &lt;code&gt;filter&lt;/code&gt; table in your nftables config, you need to allow forwarding via:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nft add chain inet filter forward &amp;#39;{type filter hook forward priority 0; policy accept;}&amp;#39;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You should also allow input from the Ethernet interface:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nft add rule inet filter input iifname &amp;#60;ethernet-interface&amp;#62; accept&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Similar to &lt;code&gt;oifname&lt;/code&gt; for the wireless interface, &lt;code&gt;iifname&lt;/code&gt; here specifies the &lt;em&gt;input interface.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;After you&amp;#39;ve completed these steps, do save your nftables config via:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nft list ruleset &amp;#62; &amp;#47;etc&amp;#47;nftables.conf&lt;/code&gt; or potentially &lt;code&gt;nft list ruleset &amp;#62; &amp;#47;etc&amp;#47;nftables.nft&lt;/code&gt;, depending on where this config should exist for your distro of choice. On Alpine Linux, this file exists at &lt;code&gt;&amp;#47;etc&amp;#47;nftables.nft&lt;/code&gt;.&lt;/p&gt;
&lt;h1 id="enabling-ipv4-forwarding"&gt;Enabling IPv4 forwarding&lt;/h1&gt;
&lt;p&gt;Enabling IPv4 forwarding should be the same process on all Linux distros, just adding a line to the &lt;code&gt;&amp;#47;etc&amp;#47;sysctl.conf&lt;/code&gt; file with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;echo "net.ipv4.ip_forward=1" &amp;#62;&amp;#62; &amp;#47;etc&amp;#47;sysctl.conf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If this line already exists in this file, uncomment it instead of adding a new line.&lt;/p&gt;
&lt;h1 id="dnsmasq-setup"&gt;dnsmasq setup&lt;/h1&gt;
&lt;p&gt;Finally, we need to set up dnsmasq for our DHCP server.&lt;/p&gt;
&lt;p&gt;Add the following contents to &lt;code&gt;&amp;#47;etc&amp;#47;dnsmasq.d&amp;#47;ethbridge.conf&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;interface=&amp;#60;ethernet-interface&amp;#62;
bind-interfaces
server=&amp;#60;dns-server&amp;#62;
domain-needed
bogus-priv
dhcp-range=&amp;#60;dhcp-range&amp;#62;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Replace &lt;code&gt;&amp;#60;ethernet-interface&amp;#62;&lt;/code&gt; here with the name of the same Ethernet interface we specified earlier, such as &lt;code&gt;eth0&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Replace &lt;code&gt;&amp;#60;dns-server&amp;#62;&lt;/code&gt; here with the IP address of your preferred upstream DNS server, since I prefer Quad9, I use &lt;code&gt;9.9.9.9&lt;/code&gt; for this value.&lt;/p&gt;
&lt;p&gt;Replace &lt;code&gt;&amp;#60;dhcp-range&amp;#62;&lt;/code&gt; with your desired range of IP addresses and their lease time, since I use &lt;code&gt;10.0.1.X&lt;/code&gt; addresses for this, I will use &lt;code&gt;10.0.1.2,10.0.1.254,24h&lt;/code&gt; for this value. This specifies a range of &lt;code&gt;10.0.1.2&lt;/code&gt; through &lt;code&gt;10.0.1.254&lt;/code&gt; with a lease time of 24 hours, starting at &lt;code&gt;10.0.1.2&lt;/code&gt; because &lt;code&gt;10.0.1.1&lt;/code&gt; belongs to the Ethernet interface on this device.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bind-interfaces&lt;/code&gt; here tells dnsmasq to bind only the interfaces it is listening on, instead of binding the wildcard address.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;domain-needed&lt;/code&gt; here tells dnsmasq to never forward plain names. (Names without a dot or domain part)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bogus-priv&lt;/code&gt; here tells dnsmasq to never forward addresses in the non-routed address spaces.&lt;/p&gt;
&lt;p&gt;According to the dnsmasq example config file, the last two options (&lt;code&gt;domain-needed&lt;/code&gt; and &lt;code&gt;bogus-priv&lt;/code&gt;) filter out queries which the public DNS cannot answer, and which load the servers unnecessarily.&lt;/p&gt;
&lt;p&gt;Once you have completed this, assuming you&amp;#39;ve also completed your nftables and ifupdown or iproute setup, you should be able to reboot this machine and get an IP address and internet from the Ethernet port on this device! (Assuming it&amp;#39;s connected to WiFi.)&lt;/p&gt;
&lt;h1 id="closing-thoughts"&gt;Closing thoughts&lt;/h1&gt;
&lt;p&gt;While this is a somewhat lengthy process to complete manually, my goal here was to explain a bit about the technology that goes into a setup like this. However, if you just went for the script to set this up automatically, that&amp;#39;s still awesome!&lt;/p&gt;
&lt;p&gt;If you found this script or blogpost useful, I would appreciate a star on the Github repository for this script!&lt;/p&gt;
</content>
</entry>
<entry>
<title>MSI Motherboard Woes | kris.sh</title>
<id>https://example.com/posts/msi-motherboard-woes/</id>
<link rel="alternate" href="https://example.com/posts/msi-motherboard-woes/"/>
<updated>2024-02-04T14:59:53-06:00</updated>
<content type="html">&lt;p&gt;I just can&amp;#39;t get enough UEFI, huh?&lt;/p&gt;
&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;I have had my fair share of problems related to MSI motherboards, and I thought it may be reasonable to briefly talk about some of these issues and provide the workarounds I&amp;#39;ve discovered for them.&lt;/p&gt;
&lt;h1 id="uefi-standards-compliance"&gt;UEFI Standards Compliance&lt;/h1&gt;
&lt;p&gt;Unfortunately, we live in a world where not all UEFI implementations are ideal or correct.&lt;/p&gt;
&lt;p&gt;According to the &lt;a href="https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html#boot-manager-programming"&gt;UEFI specifications&lt;/a&gt;, &lt;code&gt;"The firmware should not, under normal operation, automatically remove any correctly formed Boot#### variable currently referenced by the BootOrder or BootNext variables. Such removal should be limited to scenarios where the firmware is guided by direct user interaction."&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;It seems to be a trend with MSI motherboards to directly violate this. This issue can be discovered when one chooses to pursue a somewhat abnormal setup, such as booting from a UKI (Unified Kernel Image) or by using efistub, but also with run-of-the-mill setups when installing GRUB normally via the &lt;code&gt;grub-install&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;After running &lt;code&gt;grub-install&lt;/code&gt;, or using &lt;code&gt;efibootmgr&lt;/code&gt; to create the boot entry, it&amp;#39;s possible to list the current boot entries by running &lt;code&gt;efibootmgr&lt;/code&gt; without any additional arguments. There, the boot entry should be visible until you reboot. Once rebooted, you may notice that you&amp;#39;ve not booted into your freshly installed Linux distribution at all, and after booting back into the live Linux system to investigate, running &lt;code&gt;efibootmgr&lt;/code&gt; shows your boot entry has magically gone missing.&lt;/p&gt;
&lt;p&gt;So what now?&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re using the GRUB bootloader, this problem can be worked around by adding the &lt;code&gt;--removable&lt;/code&gt; flag to your &lt;code&gt;grub-install&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;Otherwise, if you don&amp;#39;t want to do that OR are running without a bootloader for an efistub or a UKI setup, it&amp;#39;s possible to create an empty file in the expected location to kind of trick the motherboard into not removing your boot entries.&lt;/p&gt;
&lt;p&gt;I have achieved this by running &lt;code&gt;mkdir -p &amp;#47;boot&amp;#47;EFI&amp;#47;BOOT&lt;/code&gt; and then just creating an empty file there with &lt;code&gt;touch &amp;#47;boot&amp;#47;EFI&amp;#47;BOOT&amp;#47;BOOTX64.EFI&lt;/code&gt;, which should work for basically all boot setups.&lt;/p&gt;
&lt;p&gt;This behavior has been observed on both my MSI Z490 MAG TOMAHAWK as well as a friend&amp;#39;s MSI MPG Z690 EDGE WIFI DDR5.&lt;/p&gt;
&lt;p&gt;Do note that if you&amp;#39;re using Secure Boot, you&amp;#39;ll want to change the boot order on your system so you don&amp;#39;t receive a Secure Boot violation when you attempt to boot your system because this empty file isn&amp;#39;t signed.&lt;/p&gt;
&lt;h1 id="not-so-secure-boot"&gt;Not-so-Secure Boot&lt;/h1&gt;
&lt;p&gt;By default, a &lt;strong&gt;ton&lt;/strong&gt; of MSI motherboards have extremely insecure Secure Boot defaults, and my Z490 MAG TOMAHAWK is no exception.&lt;/p&gt;
&lt;p&gt;Tucked away in a submenu of the Secure Boot menu that may not be immediately obvious, there&amp;#39;s another section called "Image Execution Policy" that determines how it will handle Secure Boot violations, and on a lot of boards, the default is "Always Execute."&lt;/p&gt;
&lt;p&gt;"Always Execute" here is an absolutely terrible default, given that if a user were to enable Secure Boot and not check this menu, they will have enabled a feature that does exactly nothing due to it always executing on violation.&lt;/p&gt;
&lt;p&gt;Documentation of this behavior and a list of impacted motherboards exists on &lt;a href="https://github.com/Foxboron/sbctl/issues/181"&gt;sbctl&amp;#39;s issue tracker&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To solve this issue, if you&amp;#39;re using secure boot, do change the "Removable Media" and "Fixed Media" options to "Deny Execute"&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Absolutely do not set these to "Always Deny" unless you are aware of what you&amp;#39;re doing.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Changing Option ROM to "Deny Execute" can also be a little bit touchy, do be careful if you choose to do so.&lt;/p&gt;
&lt;p&gt;Of course, having a security setting that doesn&amp;#39;t do what it claims to do by default is worse than just not having said security feature.&lt;/p&gt;
&lt;p&gt;There are quite a few other security issues with MSI motherboards that have been well explained on &lt;a href="https://dawidpotocki.com/en/2023/02/26/msi-insecure-boot-part-2/#msis-other-security-issues"&gt;Dawid Potocki&amp;#39;s blog&lt;/a&gt;, so I won&amp;#39;t go into those here.&lt;/p&gt;
&lt;h1 id="closing-thoughts"&gt;Closing thoughts&lt;/h1&gt;
&lt;p&gt;It is quite unfortunate that these issues exist, given that MSI motherboards have some of the best hardware and they tend to be quite reliable.&lt;/p&gt;
&lt;p&gt;Hopefully these issues will be solved at some point in the future.&lt;/p&gt;
</content>
</entry>
<entry>
<title>Alpine Linux encrypted UKI install | kris.sh</title>
<id>https://example.com/posts/alpine-encrypted-uki/</id>
<link rel="alternate" href="https://example.com/posts/alpine-encrypted-uki/"/>
<updated>2024-01-24T10:24:59-06:00</updated>
<content type="html">&lt;p&gt;Continuing with my trend of discussing UEFI related topics, today we will be setting up Alpine Linux with encryption and a UKI.&lt;/p&gt;
&lt;p&gt;UKI stands for Unified Kernel Image, and it is a single file that will contain our initramfs (which will include CPU microcode if applicable), kernel, kernel parameters, and our os-release information.&lt;/p&gt;
&lt;p&gt;This gives us a &lt;em&gt;single&lt;/em&gt; file to sign for secure boot, and provides better security compared to running a normal efistub setup with secure boot.&lt;/p&gt;
&lt;p&gt;To begin, I assume you&amp;#39;ve already booted into an Alpine Linux live system via a USB flash drive, CD, or otherwise.&lt;/p&gt;
&lt;h1 id="modifying-the-alpine-installer"&gt;Modifying the Alpine installer&lt;/h1&gt;
&lt;p&gt;By default, Alpine deploys a typical bootloader, but we can set a variable in the install script to skip installing a bootloader and then chroot into the new system to configure our UKI and boot entry.&lt;/p&gt;
&lt;p&gt;Open the &lt;code&gt;&amp;#47;sbin&amp;#47;setup-disk&lt;/code&gt; script in a text editor such as &lt;code&gt;vi&lt;/code&gt; and add &lt;code&gt;BOOTLOADER&lt;/code&gt;"none"= like so:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/setup-disk-image.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;After this, save the file and continue installing Alpine Linux as you normally would, with the &lt;code&gt;setup-alpine&lt;/code&gt; command. Be sure to configure the disk with encryption and LVM.&lt;/p&gt;
&lt;h1 id="mounting-partitions"&gt;Mounting partitions&lt;/h1&gt;
&lt;p&gt;After installing, we need to mount the root partition to &lt;code&gt;&amp;#47;mnt&lt;/code&gt; so that we can chroot into it before first boot.&lt;/p&gt;
&lt;p&gt;On the live Alpine system, I&amp;#39;m going to install &lt;code&gt;lsblk&lt;/code&gt; to get a list of disks and partitions with &lt;code&gt;apk add lsblk&lt;/code&gt;.
After this, run &lt;code&gt;lsblk&lt;/code&gt; to see a list of disks and partitions, in my case:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/lsblk-output-image1.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;We need to unlock our new encrypted partition, to do so run &lt;code&gt;cryptsetup luksOpen &amp;#47;dev&amp;#47;vda2 cryptroot&lt;/code&gt;, replacing &lt;code&gt;&amp;#47;dev&amp;#47;vda2&lt;/code&gt; with your drives encrypted partition and &lt;code&gt;cryptroot&lt;/code&gt; with what you would like to name it, and then enter your encryption passphrase.&lt;/p&gt;
&lt;p&gt;Next, run &lt;code&gt;vgchange -ay&lt;/code&gt; to activate logical volumes. Then, after running &lt;code&gt;lsblk&lt;/code&gt; again, we can see our logical volumes containing the root and swap:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/lsblk-output-image2.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;We now need to mount our &lt;code&gt;lv_root&lt;/code&gt; to &lt;code&gt;&amp;#47;mnt&lt;/code&gt;. To do so, run &lt;code&gt;mount &amp;#47;dev&amp;#47;mapper&amp;#47;vg0-lv_root &amp;#47;mnt&lt;/code&gt;.
We also need to mount our boot partition, &lt;code&gt;mount &amp;#47;dev&amp;#47;vda1 &amp;#47;mnt&amp;#47;boot&lt;/code&gt; in my case.&lt;/p&gt;
&lt;p&gt;There are a few more directories that should be mounted before we do anything, condensed into a one-line command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;for dir in dev proc sys run; do mkdir -p &amp;#47;mnt&amp;#47;$dir ; mount --rbind &amp;#47;$dir &amp;#47;mnt&amp;#47;$dir ; mount --make-rslave &amp;#47;mnt&amp;#47;$dir ; done&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;After that, we can chroot into our new system with &lt;code&gt;chroot &amp;#47;mnt&lt;/code&gt; and begin building our initramfs.&lt;/p&gt;
&lt;h1 id="building-the-new-initramfs"&gt;Building the new initramfs&lt;/h1&gt;
&lt;p&gt;If you do not want to include CPU microcode, feel free to skip this section.&lt;/p&gt;
&lt;p&gt;Install the &lt;code&gt;intel-ucode&lt;/code&gt;, &lt;code&gt;amd-ucode&lt;/code&gt;, or otherwise applicable CPU microcode package with &lt;code&gt;apk add cpu-ucode&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To build our new initramfs that includes our CPU microcode, run the following:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;cat &amp;#47;boot&amp;#47;intel-ucode.img &amp;#47;boot&amp;#47;initramfs-lts &amp;#62; &amp;#47;tmp&amp;#47;initramfs-lts&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Replacing &lt;code&gt;intel-ucode.img&lt;/code&gt; as necessary (amd-ucode.img for AMD CPUs).&lt;/p&gt;
&lt;h1 id="kernel-parameters"&gt;Kernel parameters&lt;/h1&gt;
&lt;p&gt;We need to put our kernel parameters into a file to later give our UKI. I&amp;#39;m going to place mine at &lt;code&gt;&amp;#47;root&amp;#47;kernelparams&lt;/code&gt;, so run &lt;code&gt;vi &amp;#47;root&amp;#47;kernelparams&lt;/code&gt; and begin adding kernel parameters.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Your kernel parameters should not include an initrd parameter.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I am going to include the following:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;cryptroot=UUID=&amp;#60;UUID&amp;#62; cryptdm=cryptroot root=&amp;#47;dev&amp;#47;mapper&amp;#47;vg0-lv_root rootfstype=ext4 rw&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;#60;UUID&amp;#62;&lt;/code&gt; in the &lt;code&gt;cryptroot=UUID=&lt;/code&gt; line should be replaced by the UUID of the encrypted root partition. One way of getting the disks UUID is by running &lt;code&gt;blkid -o value -s UUID &amp;#47;dev&amp;#47;vda2&lt;/code&gt; in my case, do replace &lt;code&gt;&amp;#47;dev&amp;#47;vda2&lt;/code&gt; according to your setup.&lt;/p&gt;
&lt;p&gt;Replace &lt;code&gt;cryptroot&lt;/code&gt; in the &lt;code&gt;cryptdm=cryptroot&lt;/code&gt; line with what you would like to name this. I used &lt;code&gt;cryptroot&lt;/code&gt; earlier when we opened our LUKS partition, and I will go with that again here.&lt;/p&gt;
&lt;p&gt;If you are using another filesystem, such as xfs, be sure to change &lt;code&gt;rootfstype=ext4&lt;/code&gt; accordingly, such as to &lt;code&gt;rootfstype=xfs&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you would like a quiet output on boot, add &lt;code&gt;loglevel=4&lt;/code&gt; to your kernel parameters.&lt;/p&gt;
&lt;p&gt;Save and exit this file.&lt;/p&gt;
&lt;h1 id="building-the-uki"&gt;Building the UKI&lt;/h1&gt;
&lt;p&gt;The necessary packages for this are &lt;code&gt;binutils&lt;/code&gt; and &lt;code&gt;gummiboot-efistub&lt;/code&gt;. &lt;code&gt;binutils&lt;/code&gt; will provide &lt;code&gt;objcopy&lt;/code&gt;, which we will be using to build our UKI, and &lt;code&gt;gummiboot-efistub&lt;/code&gt; will provide our stub (don&amp;#39;t worry, only this file, not the whole bootloader). These can be installed by running &lt;code&gt;apk add binutils gummiboot-efistub&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Create a script with &lt;code&gt;vi build-uki.sh&lt;/code&gt; and give it the following contents:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;#!&amp;#47;bin&amp;#47;sh

objcopy \
    --add-section .osrel="&amp;#47;etc&amp;#47;os-release" --change-section-vma .osrel=0x20000 \
    --add-section .cmdline="&amp;#47;root&amp;#47;kernelparams" --change-section-vma .cmdline=0x30000 \
    --add-section .linux="&amp;#47;boot&amp;#47;vmlinuz-lts" --change-section-vma .linux=0x40000 \
    --add-section .initrd="&amp;#47;tmp&amp;#47;initramfs-lts" --change-section-vma .initrd=0x3000000 \
    &amp;#47;usr&amp;#47;lib&amp;#47;gummiboot&amp;#47;linuxx64.efi.stub &amp;#47;boot&amp;#47;alpine.efi
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This script will build our UKI with all of the necessary contents. If you placed your kernel parameter file elsewhere, do change the &lt;code&gt;.cmdline&lt;/code&gt;"&amp;#47;root&amp;#47;kernelparams"= line to point at your kernel parameter file.&lt;/p&gt;
&lt;p&gt;If you chose not to include CPU microcode in your initramfs, point at the normal &lt;code&gt;&amp;#47;boot&amp;#47;initramfs-lts&lt;/code&gt; file here instead of the one that would have been placed in &lt;code&gt;&amp;#47;tmp&amp;#47;initramfs-lts&lt;/code&gt; if you included CPU microcode earlier.&lt;/p&gt;
&lt;p&gt;To make this script executable, run &lt;code&gt;chmod +x build-uki.sh&lt;/code&gt; and execute it with &lt;code&gt;.&amp;#47;build-uki.sh&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Once the UKI has been generated, we can create a boot entry that points at it with &lt;code&gt;efibootmgr&lt;/code&gt;.&lt;/p&gt;
&lt;h1 id="creating-the-boot-entry"&gt;Creating the boot entry&lt;/h1&gt;
&lt;p&gt;Install &lt;code&gt;efibootmgr&lt;/code&gt; with &lt;code&gt;apk add efibootmgr&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To create the boot entry, run the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;efibootmgr --create --label "Alpine Linux" --disk &amp;#47;dev&amp;#47;vda --part 1 --loader "\alpine.efi"&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Be sure to replace &lt;code&gt;&amp;#47;dev&amp;#47;vda&lt;/code&gt; according to your setup.&lt;/p&gt;
&lt;h1 id="finalizing"&gt;Finalizing&lt;/h1&gt;
&lt;p&gt;Assuming all went well, you should be able to boot into the new Alpine Linux install via the UKI.&lt;/p&gt;
&lt;p&gt;If you would like to use secure boot, follow the instructions on my &lt;a href="/posts/sbctl-secure-boot/index.html"&gt;Secure Boot on Linux with sbctl&lt;/a&gt; post, signing &lt;strong&gt;only&lt;/strong&gt; the UKI file we created in this post (&lt;code&gt;&amp;#47;boot&amp;#47;alpine.efi&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;If you would like, place all of the commands ran here into a single script to simplify this process.&lt;/p&gt;
</content>
</entry>
<entry>
<title>Secure Boot on Linux with sbctl | kris.sh</title>
<id>https://example.com/posts/sbctl-secure-boot/</id>
<link rel="alternate" href="https://example.com/posts/sbctl-secure-boot/"/>
<updated>2024-01-17T17:35:10-06:00</updated>
<content type="html">&lt;p&gt;Secure boot on Linux has always been a bit of a challenge, however Arch Linux developer Foxboron has created a very useful program called &amp;#39;sbctl&amp;#39; which makes setting up secure boot extremely simple, boiling the process down to just a few commands.&lt;/p&gt;
&lt;p&gt;The GitHub repository for sbctl can be found &lt;a href="https://github.com/Foxboron/sbctl"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id="preparing-the-system"&gt;Preparing the system&lt;/h1&gt;
&lt;p&gt;To begin, I assume you have a Linux distribution already set up and ready to use.&lt;/p&gt;
&lt;p&gt;If you are using the GRUB bootloader, you will have to add the options &lt;code&gt;--modules="tpm"&lt;/code&gt; and &lt;code&gt;--disable-shim-lock&lt;/code&gt; to your &lt;code&gt;grub-install&lt;/code&gt; command for this to work properly. Do consult GRUB documentation if you are unfamiliar with &lt;code&gt;grub-install&lt;/code&gt; before continuing.&lt;/p&gt;
&lt;p&gt;If you are using efistub, such as guided by my &lt;a href="/posts/alpine-efistub-encryption/index.html"&gt;Alpine Linux with efistub and encryption&lt;/a&gt; post, no further configuration on the bootloader side of things is necessary.&lt;/p&gt;
&lt;p&gt;Our system should have secure boot disabled and should be rebooted into setup mode. The process of rebooting into setup mode
does vary by motherboard, so do consult your motherboards manual or look around in your UEFI BIOS for an option to reboot the system into setup mode.&lt;/p&gt;
&lt;p&gt;Once you have rebooted the system into setup mode, install the &lt;code&gt;sbctl&lt;/code&gt; package according to your distribution of choice.&lt;/p&gt;
&lt;p&gt;After installing sbctl, make sure the system is running in setup mode by running the &lt;code&gt;sbctl status&lt;/code&gt; command, like so:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/setupmode.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;After verifying your system is in setup mode, we can begin setting up secure boot.&lt;/p&gt;
&lt;h1 id="creating-and-enrolling-secure-boot-keys"&gt;Creating and enrolling secure boot keys&lt;/h1&gt;
&lt;p&gt;Begin by running &lt;code&gt;sbctl create-keys&lt;/code&gt; to create your secure boot keys. This process may take a moment.&lt;/p&gt;
&lt;p&gt;Once this has completed, run &lt;code&gt;sbctl enroll-keys&lt;/code&gt; to enroll your secure boot keys. If you are prompted with red text saying Option ROM is present, there are a few options to continue.&lt;/p&gt;
&lt;p&gt;The safest option to continue is to enroll using the Microsoft CA, though I have had great success by enabling TPM on my systems and using checksums from the TPM eventlog. &lt;strong&gt;Do be very cautious here&lt;/strong&gt;, as there is a potential to soft-brick your hardware in the event that your GPU Option ROM cannot load, and due to this, you are unable to disable secure boot due to lack of a display output. Having a system with an iGPU could come in handy if this problem arises.&lt;/p&gt;
&lt;p&gt;Regardless, once you have enrolled your secure boot keys, we need to make sure that all of the necessary files are signed using the &lt;code&gt;sbctl verify&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;If you recieve the error &lt;code&gt;failed to find EFI system partition&lt;/code&gt;, the path to your EFI partition can be specified manually by setting the &lt;code&gt;$ESP_PATH&lt;/code&gt; variable. In my case, this error is solved by running &lt;code&gt;export ESP_PATH=&amp;#47;boot&lt;/code&gt; as the root user.&lt;/p&gt;
&lt;p&gt;If there are any unsigned files listed by this command, they can be signed manually by running &lt;code&gt;sbctl sign -s &amp;#47;path&amp;#47;to&amp;#47;unsigned&amp;#47;file&lt;/code&gt; like so:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/sign.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Once all necessary files are signed, it&amp;#39;s time to reboot and enable secure boot.&lt;/p&gt;
&lt;h1 id="finalizing"&gt;Finalizing&lt;/h1&gt;
&lt;p&gt;After rebooting with secure boot enabled, you can verify everything is correct by running &lt;code&gt;sbctl status&lt;/code&gt;, and making sure that &lt;code&gt;Setup Mode&lt;/code&gt; is disabled and &lt;code&gt;Secure Boot&lt;/code&gt; is enabled like so:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/enabled.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;If everything looks good, you&amp;#39;re all set. Do remember to sign files again if necessary after system updates.&lt;/p&gt;
&lt;p&gt;It may be worth looking into creating a UKI (Unified Kernel Image) if you&amp;#39;re using an efistub setup.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re using GRUB, it may be worth looking into hardening GRUB itself to secure your boot process more.&lt;/p&gt;
</content>
</entry>
<entry>
<title>Alpine Linux with efistub and encryption | kris.sh</title>
<id>https://example.com/posts/alpine-efistub-encryption/</id>
<link rel="alternate" href="https://example.com/posts/alpine-efistub-encryption/"/>
<updated>2024-01-01T19:01:33-06:00</updated>
<content type="html">&lt;p&gt;The Linux kernel can be booted directly by the UEFI firmware, making a traditional bootloader like GRUB not necessary in many cases.&lt;/p&gt;
&lt;p&gt;In this post, we&amp;#39;re going to set up an Alpine Linux system that uses both efistub and LVM on LUKS.&lt;/p&gt;
&lt;p&gt;To begin, I assume you&amp;#39;ve already booted into an Alpine Linux live system via a USB flash drive, CD, or otherwise.&lt;/p&gt;
&lt;h1 id="modifying-the-alpine-installer"&gt;Modifying the Alpine installer&lt;/h1&gt;
&lt;p&gt;By default, Alpine deploys a typical bootloader, but we can set a variable in the install script to skip installing a bootloader and then chroot into the new system to configure efistub.&lt;/p&gt;
&lt;p&gt;Open the &lt;code&gt;&amp;#47;sbin&amp;#47;setup-disk&lt;/code&gt; script in a text editor such as &lt;code&gt;vi&lt;/code&gt; and add &lt;code&gt;BOOTLOADER&lt;/code&gt;"none"= like so:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/setup-disk-image.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;After this, save the file and continue installing Alpine Linux as you normally would, with the &lt;code&gt;setup-alpine&lt;/code&gt; command. Be sure to configure the disk with encryption and LVM.&lt;/p&gt;
&lt;h1 id="mounting-partitions"&gt;Mounting partitions&lt;/h1&gt;
&lt;p&gt;After installing, we need to mount the root partition to &lt;code&gt;&amp;#47;mnt&lt;/code&gt; so that we can chroot into it before first boot.&lt;/p&gt;
&lt;p&gt;On the live Alpine system, I&amp;#39;m going to install &lt;code&gt;lsblk&lt;/code&gt; to get a list of disks and partitions with &lt;code&gt;apk add lsblk&lt;/code&gt;.
After this, run &lt;code&gt;lsblk&lt;/code&gt; to see a list of disks and partitions, in my case:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/lsblk-output-image1.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;We need to unlock our new encrypted partition, to do so run &lt;code&gt;cryptsetup luksOpen &amp;#47;dev&amp;#47;vda2 cryptroot&lt;/code&gt;, replacing &lt;code&gt;&amp;#47;dev&amp;#47;vda2&lt;/code&gt; with your drives encrypted partition and &lt;code&gt;cryptroot&lt;/code&gt; with what you would like to name it, and then enter your encryption passphrase.&lt;/p&gt;
&lt;p&gt;Next, run &lt;code&gt;vgchange -ay&lt;/code&gt; to activate logical volumes. Then, after running &lt;code&gt;lsblk&lt;/code&gt; again, we can see our logical volumes containing the root and swap:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/lsblk-output-image2.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;We now need to mount our &lt;code&gt;lv_root&lt;/code&gt; to &lt;code&gt;&amp;#47;mnt&lt;/code&gt;. To do so, run &lt;code&gt;mount &amp;#47;dev&amp;#47;mapper&amp;#47;vg0-lv_root &amp;#47;mnt&lt;/code&gt;.
We also need to mount our boot partition, &lt;code&gt;mount &amp;#47;dev&amp;#47;vda1 &amp;#47;mnt&amp;#47;boot&lt;/code&gt; in my case.&lt;/p&gt;
&lt;p&gt;There are a few more directories that should be mounted before we do anything, condensed into a one-line command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;for dir in dev proc sys run; do mkdir -p &amp;#47;mnt&amp;#47;$dir ; mount --rbind &amp;#47;$dir &amp;#47;mnt&amp;#47;$dir ; mount --make-rslave &amp;#47;mnt&amp;#47;$dir ; done&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;After that, we can chroot into our new system with &lt;code&gt;chroot &amp;#47;mnt&lt;/code&gt; and begin setting up efistub.&lt;/p&gt;
&lt;h1 id="creating-the-efistub-boot-entry"&gt;Creating the efistub boot entry&lt;/h1&gt;
&lt;p&gt;For this, we&amp;#39;re going to need our encrypted partitions UUID to create a robust boot entry.&lt;/p&gt;
&lt;p&gt;One way of accomplishing this is running &lt;code&gt;blkid -o value -s UUID &amp;#47;dev&amp;#47;vda2&lt;/code&gt; and noting down its output. Do change the &lt;code&gt;&amp;#47;dev&amp;#47;vda2&lt;/code&gt; part of this command according to your setup.&lt;/p&gt;
&lt;p&gt;To create the efistub boot entry, we will create a script to generate it for us.&lt;/p&gt;
&lt;p&gt;First, we need to install the &lt;code&gt;efibootmgr&lt;/code&gt; package. Run &lt;code&gt;apk add efibootmgr&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Then, change directories with &lt;code&gt;cd &amp;#47;root&lt;/code&gt;, and then &lt;code&gt;vi setup-bootentry.sh&lt;/code&gt; to begin creating this script. Do feel free to replace &lt;code&gt;vi&lt;/code&gt; with another text editor if you prefer.&lt;/p&gt;
&lt;p&gt;Contents of the script:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;#!&amp;#47;bin&amp;#47;sh

params="cryptroot=UUID=&amp;#60;UUID&amp;#62; cryptdm=cryptroot \
    root=&amp;#47;dev&amp;#47;mapper&amp;#47;vg0-lv_root rootfstype=ext4 rw \
    initrd=\intel-ucode.img \
    initrd=\initramfs-lts"

efibootmgr --create --label "Alpine Linux" \
    --disk &amp;#47;dev&amp;#47;vda --part 1 \
    --loader &amp;#47;vmlinuz-lts \
    --unicode "${params}" \
    --verbose
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;params&lt;/code&gt; is our list of kernel parameters, while the &lt;code&gt;efibootmgr&lt;/code&gt; command is what creates our boot entry.&lt;/p&gt;
&lt;p&gt;Replace &lt;code&gt;&amp;#60;uuid&amp;#62;&lt;/code&gt; in the &lt;code&gt;cryptroot=UUID=&amp;#60;uuid&amp;#62;&lt;/code&gt; line with the UUID of the partition we got earlier from the &lt;code&gt;blkid&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;Replace &lt;code&gt;cryptroot&lt;/code&gt; in the &lt;code&gt;cryptdm=cryptroot&lt;/code&gt; line with what you would like to name this. I used &lt;code&gt;cryptroot&lt;/code&gt; earlier when we opened our LUKS partition, and I will go with that again here.&lt;/p&gt;
&lt;p&gt;Change &lt;code&gt;initrd=\intel-ucode.img&lt;/code&gt; according to what kind of CPU you have, if you would like. You may also remove this line.&lt;/p&gt;
&lt;p&gt;Change &lt;code&gt;--disk &amp;#47;dev&amp;#47;vda&lt;/code&gt; according to your setup, pointing at the disk that contains our &lt;code&gt;&amp;#47;boot&lt;/code&gt; partition and our LUKS encrypted partition.&lt;/p&gt;
&lt;p&gt;If you are using another filesystem, such as xfs, be sure to change &lt;code&gt;rootfstype=ext4&lt;/code&gt; accordingly, such as to &lt;code&gt;rootfstype=xfs&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Once finished creating the script, save the file. We need to mark the script as executable by running &lt;code&gt;chmod +x setup-bootentry.sh&lt;/code&gt;, and then we can execute it with &lt;code&gt;.&amp;#47;setup-bootentry.sh&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Now, if we run &lt;code&gt;efibootmgr&lt;/code&gt;, we should see a new boot entry with the label defined in our script, &lt;code&gt;Alpine Linux&lt;/code&gt;.&lt;/p&gt;
&lt;h1 id="finalizing"&gt;Finalizing&lt;/h1&gt;
&lt;p&gt;To exit the chroot, run &lt;code&gt;exit&lt;/code&gt;. We can now reboot the system with &lt;code&gt;reboot now&lt;/code&gt;, be sure to remove any live media so you don&amp;#39;t boot into the wrong system.&lt;/p&gt;
&lt;p&gt;If all went well, our system should begin booting (with a lot of noise) and prompt us for our encryption passphrase:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/password-prompt.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;After entering the encryption passphrase, we should be booted into the new Alpine system.&lt;/p&gt;
&lt;p&gt;If you would like to quiet down the logs during boot, we can add the &lt;code&gt;loglevel=4&lt;/code&gt; kernel parameter to our script at &lt;code&gt;&amp;#47;root&amp;#47;setup-bootentry.sh&lt;/code&gt;, adding another backslash after the previous parameter:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/kernel-parameter.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;And then creating another boot entry.&lt;/p&gt;
&lt;p&gt;Before executing the script again, remove the old boot entry with &lt;code&gt;efibootmgr -b 0004 -B&lt;/code&gt;, replacing &lt;code&gt;0004&lt;/code&gt; with the number of the old boot entry. The current boot entries can once again be listed by running &lt;code&gt;efibootmgr&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Then, execute the script again with &lt;code&gt;.&amp;#47;setup-bootentry.sh&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;After rebooting, we can see that the output is much quieter:&lt;/p&gt;
&lt;p&gt;&lt;img src="images/quiet-output.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s it!&lt;/p&gt;
</content>
</entry>
</feed>
