<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0">

<channel>
	<title>StarBlog</title>
	<atom:link href="https://my.stargazer.at/feed/" rel="self" type="application/rss+xml"/>
	<link>https://my.stargazer.at</link>
	<description>my two cents on life - including taxes and duties...</description>
	<lastBuildDate>Wed, 02 Aug 2023 13:50:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<xhtml:meta content="noindex" name="robots" xmlns:xhtml="http://www.w3.org/1999/xhtml"/><item>
		<title>Settling  the AdGuard vs PiHole debate for good</title>
		<link>https://my.stargazer.at/2023/08/02/settling-the-adguard-vs-pihole-debate-for-good/?pk_campaign=feed&amp;pk_kwd=settling-the-adguard-vs-pihole-debate-for-good</link>
					<comments>https://my.stargazer.at/2023/08/02/settling-the-adguard-vs-pihole-debate-for-good/?pk_campaign=feed&amp;pk_kwd=settling-the-adguard-vs-pihole-debate-for-good#comments</comments>
		
		<dc:creator><![CDATA[ToeiRei]]></dc:creator>
		<pubDate>Wed, 02 Aug 2023 13:50:50 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://my.stargazer.at/?p=1907</guid>

					<description><![CDATA[There is no way of keeping your sanity while surfing the web without adblocking. Seriously. Ads everywhere and it&#8217;s just plain annoying &#8211; and sometimes even eating up your bandwidth. On a PC there are loads of tools to block ads like browser extensions; but sometimes you cannot make use of those &#8211; this is why many people [&#8230;]<img src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2023%2F08%2F02%2Fsettling-the-adguard-vs-pihole-debate-for-good%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dsettling-the-adguard-vs-pihole-debate-for-good&amp;action_name=Settling%20%20the%20AdGuard%20vs%20PiHole%20debate%20for%20good&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[<p>There is no way of keeping your sanity while surfing the web without adblocking. Seriously. Ads everywhere and it&#8217;s just plain annoying &#8211; and sometimes even eating up your bandwidth. On a PC there are loads of tools to block ads like browser extensions; but sometimes you cannot make use of those &#8211; this is why many people believe in DNS blocking as a feature which works &#8211; as the name implies by intentionally not finding hosts that serve ads or trackers.</p>
<p>To give you an example on how effective it was in freeing up some bandwidth, I implemented it as a DNS server in a students home as a &#8216;last effort&#8217; to fight against the weak line available at that location. As soon as the clients picked up the new DNS server on the network, I was able to use a remote desktop connection again without going completely insane &#8211; mostly because of the vast amount of video ads back then just playing. A big win in my books.</p>
<p>Now there is this endless discussion going on about if <a href="https://adguard.com/en/adguard-home/overview.html">AdGuard Home</a> or <a href="https://pi-hole.net/">PiHole</a> is the better solution. I mean, AdGuard does a fairly good job at poking at piHole and I decided to give it a fair shot in my environment. A side by side comparison in my homelab, which sports an AMD EPYC 7282 16-Core Processor where I spun up coreOS as a docker host and pulled both containers and set them up on the same host &#8211; side by side.</p>
<p>At the first glance both candidates are open-source with a community, a lot of (additional) blocklists to implement and that&#8217;s basically all you need on your local network. AdGuard Home also incorporates DoH as well as DoT which are not really needed on a local network to be honest, as long as I trust my own environment. On top of that, AdGuard may also enforce safe-search which could be interesting if you have kids in your house &#8211; which I haven&#8217;t. But to even the playingfield regarding encryption I set up traefik on piHole &#8211; and yes, there may be some more knowledge required. Adguard takes the price home for an easier setup whereas I could configure piHole using a docker-compose file without having to run through a wizard asking me questions.</p>
<p>Setting up the DNS blocker &#8211; at least to me &#8211; is something I tend to do only once. That&#8217;s why it doesn&#8217;t really matter much to me for this test. So let&#8217;s get down to usage.</p>
<p>I added the same blocklists to PiHole as well as AdGuard Home which I fetched from firehol.net &#8211; and adding them in bulk is where piHole clearly takes the lead whereas AdGuard Home, sporting the more pleasing looking WebUI, lacks import functionality. So that&#8217;s definitely a win on PiHole if you change your lists a lot, which I do at least once a month with some scripting.</p>
<p>Resource-wise I let adGuard Home warm up a bit and I&#8217;ve seen its RAM usage increase quite a bit to 250 MB<br />
<img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-1909" src="https://my.stargazer.at/wp-content/uploads/2023/08/adguard-portainer.png" alt="" width="2226" height="531" srcset="https://my.stargazer.at/wp-content/uploads/2023/08/adguard-portainer.png 2226w, https://my.stargazer.at/wp-content/uploads/2023/08/adguard-portainer-300x72.png 300w, https://my.stargazer.at/wp-content/uploads/2023/08/adguard-portainer-1024x244.png 1024w, https://my.stargazer.at/wp-content/uploads/2023/08/adguard-portainer-150x36.png 150w, https://my.stargazer.at/wp-content/uploads/2023/08/adguard-portainer-768x183.png 768w, https://my.stargazer.at/wp-content/uploads/2023/08/adguard-portainer-1536x366.png 1536w, https://my.stargazer.at/wp-content/uploads/2023/08/adguard-portainer-2048x489.png 2048w" sizes="(max-width: 2226px) 100vw, 2226px" /></p>
<p>PiHole was already running on my system for a while, so it&#8217;s fair to use the end value of 100 MB of RAM<br />
<img decoding="async" class="alignnone size-full wp-image-1910" src="https://my.stargazer.at/wp-content/uploads/2023/08/pihole-portainer.png" alt="" width="2228" height="528" srcset="https://my.stargazer.at/wp-content/uploads/2023/08/pihole-portainer.png 2228w, https://my.stargazer.at/wp-content/uploads/2023/08/pihole-portainer-300x71.png 300w, https://my.stargazer.at/wp-content/uploads/2023/08/pihole-portainer-1024x243.png 1024w, https://my.stargazer.at/wp-content/uploads/2023/08/pihole-portainer-150x36.png 150w, https://my.stargazer.at/wp-content/uploads/2023/08/pihole-portainer-768x182.png 768w, https://my.stargazer.at/wp-content/uploads/2023/08/pihole-portainer-1536x364.png 1536w, https://my.stargazer.at/wp-content/uploads/2023/08/pihole-portainer-2048x485.png 2048w" sizes="(max-width: 2228px) 100vw, 2228px" /></p>
<p>Despite rumors of people telling me that piHole needs more RAM, I could not recreate that on my test.</p>
<p>The next thing I wanted to test is latency &#8211; that&#8217;s how fast I can get a reply from the DNS to my client. I decided to &#8216;dig&#8217; for &#8216;google.de&#8217; twice and took the &#8216;time&#8217; (command). To get started, I took a baseline measurement on the infamous 8.8.8.8 DNS from Google. Asking twice is for getting the result into the cache, eliminating the need to ask an external DNS. Not that it would matter on the google dns, but I wanted to make sure it&#8217;s the same procedure for every candidate.</p>
<pre>
vbauer@ts ~ $ time dig google.de @8.8.8.8

; <<>> DiG 9.16.41 <<>> google.de @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55953
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.de.                     IN      A

;; ANSWER SECTION:
google.de.              299     IN      A       142.250.180.227

;; Query time: 64 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Wed Aug 02 15:00:37 CEST 2023
;; MSG SIZE  rcvd: 54


real    0m0.078s
user    0m0.004s
sys     0m0.004s
</pre>
<p>Now the interesting part here is the 'real' time which is the actual stopwatch here, clocking in at 78ms which is still quite impressive. Next up was my internal bind9 server clocking in at 43ms for my internal domain. Not really a slowpoke considering that it runs with an LDAP backend. Clearly the faster response time is due to it being in my local network. But it doesn't do DNS blocking at all.<br />
PiHole came in straight with 18ms while AdGuard Home went for the 21ms mark. So performance wise, those 3ms don't really matter at all. What matters is how you like it. So my tip is setting up both and keeping the one you like more and provides the features you need.</p>
<img decoding="async" src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2023%2F08%2F02%2Fsettling-the-adguard-vs-pihole-debate-for-good%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dsettling-the-adguard-vs-pihole-debate-for-good&amp;action_name=Settling%20%20the%20AdGuard%20vs%20PiHole%20debate%20for%20good&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
					<wfw:commentRss>https://my.stargazer.at/2023/08/02/settling-the-adguard-vs-pihole-debate-for-good/?pk_campaign=feed&amp;pk_kwd=settling-the-adguard-vs-pihole-debate-for-good/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Matrix vs Ntfy – detective work</title>
		<link>https://my.stargazer.at/2023/03/30/matrix-vs-ntfy-detective-work/?pk_campaign=feed&amp;pk_kwd=matrix-vs-ntfy-detective-work</link>
					<comments>https://my.stargazer.at/2023/03/30/matrix-vs-ntfy-detective-work/?pk_campaign=feed&amp;pk_kwd=matrix-vs-ntfy-detective-work#respond</comments>
		
		<dc:creator><![CDATA[ToeiRei]]></dc:creator>
		<pubDate>Thu, 30 Mar 2023 18:55:55 +0000</pubDate>
				<category><![CDATA[IT Related stuff]]></category>
		<category><![CDATA[container]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[matrix]]></category>
		<guid isPermaLink="false">https://my.stargazer.at/?p=1901</guid>

					<description><![CDATA[I&#8217;m running my own Matrix homeserver for a number of reasons &#8211; one of them is simply economical as &#8216;disk space&#8217; on a mobile phone is way more expensive than on a server. You can easily slap a few TB into a server without any problems whereas phones still do have a long way to go. Long story [&#8230;]<img src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2023%2F03%2F30%2Fmatrix-vs-ntfy-detective-work%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dmatrix-vs-ntfy-detective-work&amp;action_name=Matrix%20vs%20Ntfy%20%26%238211%3B%20detective%20work&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m running my own Matrix homeserver for a number of reasons &#8211; one of them is simply economical as &#8216;disk space&#8217; on a mobile phone is way more expensive than on a server. You can easily slap a few TB into a server without any problems whereas phones still do have a long way to go.</p>
<p>Long story short, I set up my homeserver and started to expand it &#8211; even by adding my own push service as I didn&#8217;t want to mess with building my own client app to register with the Google Push Service and everything looked fine &#8211; except for the push service never actually waking the matrix client but working fine with me pushing alerts to my phone. At first I didn&#8217;t notice and enjoyed the silence of not being bugged by messages, but it also got me the feeling that &#8216;something is off&#8217; and so I started looking at the logfiles where I was greeted with a message that was confusing as hell to me:</p>
<p><code><br />
Mar 18 23:30:14 matrix matrix-synapse[2213]: 2023-03-18 22:30:14,267 - synapse.push.httppusher - 432 - WARNING - httppush.process-17 - Failed to push event $bLGuzRj3t4p6Z6h16aTmfw9YA5gEhZZ0fZOebFToL04 to @user:domain/im.vector.app.android/https://ntfy.domain/upv5aFQWe5uAHe?up=1: <class 'twisted.internet.error.DNSLookupError'> DNS lookup failed: no results for hostname lookup: ntfy.domain.</code></p>
<p>Glancing over the message, I thought my DNS was done for &#8211; or something in the docker network went haywire. My first step of debugging this mystery was attaching a shell to the synapse container, who was responsible for this message. To add salt to injury &#8211; or should I say &#8216;for security reasons&#8217;, the container was kept pretty slim and didn&#8217;t include ping or any nslookup alike. Luckily there was a curl binary in it, so I could test push messages and&#8230; success?</p>
<p>Alrighty: It was not the systems DNS messing up. But it looks like, synapse did something pretty wrong &#8211; or did it?</p>
<p>The synapse server is written in python, using the twisted framework. So I quickly grabbed a <a href="https://docs.twistedmatrix.com/en/twisted-16.1.1/_downloads/testdns.py" rel="noopener" target="_blank">DNS testing script written in that framework</a> to verify that and nuke my theory of twisted being the issue. Oh boy! This is getting fun as it turns out the error message isn&#8217;t really about DNS at all. I felt defeated, grabbed some tea and started digging into the synapse federation service and config where I finally &#8211; after hours of reading code &#8211; found this:</p>
<p><code><br />
# Prevent outgoing requests from being sent to the following blacklisted IP address<br />
# CIDR ranges. If this option is not specified then it defaults to private IP<br />
# address ranges (see the example below).<br />
#<br />
# The blacklist applies to the outbound requests for federation, identity servers,<br />
# push servers, and for checking key validity for third-party invite events.<br />
#<br />
# (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly<br />
# listed here, since they correspond to unroutable addresses.)<br />
#<br />
# This option replaces federation_ip_range_blacklist in Synapse v1.25.0.<br />
#<br />
# Note: The value is ignored when an HTTP proxy is in use<br />
#<br />
#ip_range_blacklist:<br />
#  - '127.0.0.0/8'<br />
#  - '10.0.0.0/8'<br />
#  - '172.16.0.0/12'<br />
#  - '192.168.0.0/16'<br />
#  - '100.64.0.0/10'<br />
#  - '192.0.0.0/24'<br />
#  - '169.254.0.0/16'<br />
#  - '192.88.99.0/24'<br />
#  - '198.18.0.0/15'<br />
#  - '192.0.2.0/24'<br />
#  - '198.51.100.0/24'<br />
#  - '203.0.113.0/24'<br />
#  - '224.0.0.0/4'<br />
#  - '::1/128'<br />
#  - 'fe80::/10'<br />
#  - 'fc00::/7'<br />
#  - '2001:db8::/32'<br />
#  - 'ff00::/8'<br />
#  - 'fec0::/10'</p>
<p># List of IP address CIDR ranges that should be allowed for federation,<br />
# identity servers, push servers, and for checking key validity for<br />
# third-party invite events. This is useful for specifying exceptions to<br />
# wide-ranging blacklisted target IP ranges - e.g. for communication with<br />
# a push server only visible in your network.<br />
#<br />
# This whitelist overrides ip_range_blacklist and defaults to an empty<br />
# list.<br />
#<br />
#ip_range_whitelist:<br />
#   - '192.168.1.1'<br />
</code></p>
<p>As my ntfy service was exposed in my DMZ network as it was used by my other services as well, it was being blocked by those default configurations. Simply whitelisting it did the trick and made me feel like a boss as I solved that mystery. Did I regret enabling push messages in the end? Sometimes.</p>
<img loading="lazy" decoding="async" src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2023%2F03%2F30%2Fmatrix-vs-ntfy-detective-work%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dmatrix-vs-ntfy-detective-work&amp;action_name=Matrix%20vs%20Ntfy%20%26%238211%3B%20detective%20work&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
					<wfw:commentRss>https://my.stargazer.at/2023/03/30/matrix-vs-ntfy-detective-work/?pk_campaign=feed&amp;pk_kwd=matrix-vs-ntfy-detective-work/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What’s in my PC?</title>
		<link>https://my.stargazer.at/2022/06/07/whats-in-my-pc/?pk_campaign=feed&amp;pk_kwd=whats-in-my-pc</link>
					<comments>https://my.stargazer.at/2022/06/07/whats-in-my-pc/?pk_campaign=feed&amp;pk_kwd=whats-in-my-pc#respond</comments>
		
		<dc:creator><![CDATA[ToeiRei]]></dc:creator>
		<pubDate>Tue, 07 Jun 2022 11:50:31 +0000</pubDate>
				<category><![CDATA[IT Related stuff]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[YouTube]]></category>
		<guid isPermaLink="false">https://my.stargazer.at/?p=1885</guid>

					<description><![CDATA[<img src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2022%2F06%2F07%2Fwhats-in-my-pc%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dwhats-in-my-pc&amp;action_name=What%26%238217%3Bs%20in%20my%20PC%3F&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[<p><iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/XRPTF_rTG4U" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p>
<img loading="lazy" decoding="async" src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2022%2F06%2F07%2Fwhats-in-my-pc%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dwhats-in-my-pc&amp;action_name=What%26%238217%3Bs%20in%20my%20PC%3F&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
					<wfw:commentRss>https://my.stargazer.at/2022/06/07/whats-in-my-pc/?pk_campaign=feed&amp;pk_kwd=whats-in-my-pc/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Building the kernel with clang: messing around</title>
		<link>https://my.stargazer.at/2021/09/24/building-the-kernel-with-clang-messing-around/?pk_campaign=feed&amp;pk_kwd=building-the-kernel-with-clang-messing-around</link>
					<comments>https://my.stargazer.at/2021/09/24/building-the-kernel-with-clang-messing-around/?pk_campaign=feed&amp;pk_kwd=building-the-kernel-with-clang-messing-around#respond</comments>
		
		<dc:creator><![CDATA[ToeiRei]]></dc:creator>
		<pubDate>Thu, 23 Sep 2021 22:02:31 +0000</pubDate>
				<category><![CDATA[IT Related stuff]]></category>
		<category><![CDATA[clang]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[llvm]]></category>
		<guid isPermaLink="false">https://my.stargazer.at/?p=1867</guid>

					<description><![CDATA[The Linux kernel is an ingenious piece of software and I&#8217;m pretty confident in compiling it by myself since quite a while &#8211; so I was trying to step up the game by doing debian packages. But now as the Kernel supports LTO, it&#8217;s time for me to give it a spin. But to be honest, useful documentation [&#8230;]<img src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F09%2F24%2Fbuilding-the-kernel-with-clang-messing-around%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dbuilding-the-kernel-with-clang-messing-around&amp;action_name=Building%20the%20kernel%20with%20clang%3A%20messing%20around&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[<p>The Linux kernel is an ingenious piece of software and I&#8217;m pretty confident in compiling it by myself since quite a while &#8211; so I was trying to step up the game by doing debian packages. But now as the Kernel supports LTO, it&#8217;s time for me to give it a spin. But to be honest, useful documentation is sparse &#8211; so here are my notes. The kernel config needs to have the following CONFIG-options to work with LTO enabled &#8211; or even give you the option</p>
<pre># CONFIG_STACKPROTECTOR is not set
CONFIG_LTO=y
CONFIG_LTO_CLANG=y
CONFIG_ARCH_SUPPORTS_LTO_CLANG=y
CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y
CONFIG_HAS_LTO_CLANG=y
# CONFIG_LTO_NONE is not set
CONFIG_LTO_CLANG_FULL=y
# CONFIG_LTO_CLANG_THIN is not set</pre>
<p>Compiling itself is pretty much straight forward as soon as you get the clang-11 binaries (default debian 11) linked to their base name without the version. Update-alternatives takes care of that</p>
<pre>update-alternatives \
        --verbose \
        --install /usr/bin/llvm-config       llvm-config      /usr/bin/llvm-config-11 100 \
        --slave   /usr/bin/llvm-ar           llvm-ar          /usr/bin/llvm-ar-11 \
        --slave   /usr/bin/llvm-as           llvm-as          /usr/bin/llvm-as-11 \
        --slave   /usr/bin/llvm-bcanalyzer   llvm-bcanalyzer  /usr/bin/llvm-bcanalyzer-11 \
        --slave   /usr/bin/llvm-cov          llvm-cov         /usr/bin/llvm-cov-11 \
        --slave   /usr/bin/llvm-diff         llvm-diff        /usr/bin/llvm-diff-11 \
        --slave   /usr/bin/llvm-dis          llvm-dis         /usr/bin/llvm-dis-11 \
        --slave   /usr/bin/llvm-dwarfdump    llvm-dwarfdump   /usr/bin/llvm-dwarfdump-11 \
        --slave   /usr/bin/llvm-extract      llvm-extract     /usr/bin/llvm-extract-11 \
        --slave   /usr/bin/llvm-link         llvm-link        /usr/bin/llvm-link-11 \
        --slave   /usr/bin/llvm-mc           llvm-mc          /usr/bin/llvm-mc-11 \
        --slave   /usr/bin/llvm-nm           llvm-nm          /usr/bin/llvm-nm-11 \
        --slave   /usr/bin/llvm-objdump      llvm-objdump     /usr/bin/llvm-objdump-11 \
        --slave   /usr/bin/llvm-ranlib       llvm-ranlib      /usr/bin/llvm-ranlib-11 \
        --slave   /usr/bin/llvm-readobj      llvm-readobj     /usr/bin/llvm-readobj-11 \
        --slave   /usr/bin/llvm-rtdyld       llvm-rtdyld      /usr/bin/llvm-rtdyld-11 \
        --slave   /usr/bin/llvm-size         llvm-size        /usr/bin/llvm-size-11 \
        --slave   /usr/bin/llvm-stress       llvm-stress      /usr/bin/llvm-stress-11 \
        --slave   /usr/bin/llvm-symbolizer   llvm-symbolizer  /usr/bin/llvm-symbolizer-11 \
        --slave   /usr/bin/llvm-tblgen       llvm-tblgen      /usr/bin/llvm-tblgen-11 \
        --slave   /usr/bin/llvm-objcopy      llvm-objcopy     /usr/bin/llvm-objcopy-11 \
        --slave   /usr/bin/llvm-strip        llvm-strip       /usr/bin/llvm-strip-11

update-alternatives \
        --verbose \
        --install /usr/bin/clang                 clang                 /usr/bin/clang-11 100 \
        --slave   /usr/bin/clang++               clang++               /usr/bin/clang++-11  \
        --slave   /usr/bin/asan_symbolize        asan_symbolize        /usr/bin/asan_symbolize-11 \
        --slave   /usr/bin/clang-cpp             clang-cpp             /usr/bin/clang-cpp-11 \
        --slave   /usr/bin/ld.lld                ld.lld                /usr/bin/ld.lld-11
</pre>
<p>As this is finally taken care of, we can finally try compiling with <code>make LLVM=1 LLVM_IAS=1 CC=clang HOSTCC=clang LD=ld.lld -j5 deb-pkg</code> &#8211; but be aware: LTO needs quite some RAM to get its stuff done. About the results and the speed, I still need to do some tests to see how those kernels act &#8211; especially if I can</p>
<img loading="lazy" decoding="async" src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F09%2F24%2Fbuilding-the-kernel-with-clang-messing-around%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dbuilding-the-kernel-with-clang-messing-around&amp;action_name=Building%20the%20kernel%20with%20clang%3A%20messing%20around&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
					<wfw:commentRss>https://my.stargazer.at/2021/09/24/building-the-kernel-with-clang-messing-around/?pk_campaign=feed&amp;pk_kwd=building-the-kernel-with-clang-messing-around/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Working my way to automatic kernel builds</title>
		<link>https://my.stargazer.at/2021/06/28/working-my-way-to-automatic-kernel-builds/?pk_campaign=feed&amp;pk_kwd=working-my-way-to-automatic-kernel-builds</link>
					<comments>https://my.stargazer.at/2021/06/28/working-my-way-to-automatic-kernel-builds/?pk_campaign=feed&amp;pk_kwd=working-my-way-to-automatic-kernel-builds#comments</comments>
		
		<dc:creator><![CDATA[ToeiRei]]></dc:creator>
		<pubDate>Mon, 28 Jun 2021 10:23:24 +0000</pubDate>
				<category><![CDATA[IT Related stuff]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[script]]></category>
		<guid isPermaLink="false">https://my.stargazer.at/?p=1834</guid>

					<description><![CDATA[It&#8217;s pretty obvious, that me maintaining the debian kernel repository which I announced in this post is a lot of work as I offer up to 4 flavors &#8211; which are &#8216;vanilla&#8217;, &#8216;vm&#8217; and both for the gentoo patchset, I had to improve my setup. First of all, the introduction of ccache did shave off a few seconds [&#8230;]<img src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F06%2F28%2Fworking-my-way-to-automatic-kernel-builds%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dworking-my-way-to-automatic-kernel-builds&amp;action_name=Working%20my%20way%20to%20automatic%20kernel%20builds&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[<p>It&#8217;s pretty obvious, that me maintaining the <a href="https://github.com/ToeiRei/kernel-deb">debian kernel repository</a> which I announced in <a href="https://my.stargazer.at/2020/10/30/building-a-gentoo-linux-kernel-on-debian/">this post</a> is a lot of work as I offer up to 4 flavors &#8211; which are &#8216;vanilla&#8217;, &#8216;vm&#8217; and both for the gentoo patchset, I had to improve my setup. First of all, the <a href="https://my.stargazer.at/2021/01/27/ccache-on-kernels/">introduction of ccache</a> did shave off a few seconds on compiling (the cache hits are still not crazily high around 12-15%) &#8211; but it wasn&#8217;t all great.</p>
<p>Second, I created a script to build the kernel I wanted to, to shave off some time as I didn&#8217;t want the system to wait for my input during the whole build process. It wasn&#8217;t magic at first, but it was sufficient to run all the commands I needed. This way of doing things works well as long as there are no errors and all goes like plan as in a perfect world which we sadly don&#8217;t have and it went well for one way of building it.</p>
<p>Now it was time to improve the script:</p>
<p>The first thing I did was introducing some kind of config management to keep the configs consistent over my builds without dropping important modules or any unwanted changes. Git did a great job and the configs are even backed up on github and everywhere I mirrored my repo. Sweet.</p>
<p>Next I had to do a &#8216;one for all&#8217; solution &#8211; merging my four &#8220;flavor&#8221; scripts into one and break it up into a lot of functions for every step I want the script to perform. While I was at it, I threw in a couple of IFs to act differently per kernel as required. Still not perfect, but another big step into the right direction.</p>
<p>Still, the script itself wasn&#8217;t what I needed. For me, the biggest issue was a broken patch or anything that messes my builds up. As I had it all broken down into functions, it was easy to grab them one by one and add failure conditions like patches not applying cleanly or the compiler suddenly dying on which we just exit without saving the config back into the repo. This step was crucial for my build as it saved me a lot of rollbacks on broken builds.</p>
<p>But the script was still a bit too clunky for me. I wanted some more comfort in it as I do not want to look up the exact version number of the kernel as it&#8217;s sufficient to know that it is &#8216;new&#8217;. A little bit of grep magic did that for me &#8211; which allowed me to be more relaxed about that point too.</p>
<pre>KERNEL_VERSION=`curl -s https://www.kernel.org | grep -A1 latest_link | tail -n1 | egrep -o '&gt;[^&lt;]+' | egrep -o '[^&gt;]+'`</pre>
<p>A quick reminder here: This script is pure bash for the sake of keeping it simple and easy to maintain. Compiling it into C code wouldn&#8217;t give me any benefit here as I would have to run a lot of shell-exec calls anyways and recompiling it for testing and fixing bugs is all way too much for the CPU cycles saved.</p>
<p>The script itself now worked for now, but it led me to some issues when I wanted to give it to a friend for looking over it to check for stuff I could improve on. My credentials were still in there and I do not want to pass them on &#8211; even to another trusted person. So I had to deal with an external config file which is part of <a href="https://my.stargazer.at/2021/05/28/bash-files-vs-configuration/">another blog post here</a> to keep this post slim and on topic.</p>
<p>&nbsp;</p>
<img loading="lazy" decoding="async" src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F06%2F28%2Fworking-my-way-to-automatic-kernel-builds%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dworking-my-way-to-automatic-kernel-builds&amp;action_name=Working%20my%20way%20to%20automatic%20kernel%20builds&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
					<wfw:commentRss>https://my.stargazer.at/2021/06/28/working-my-way-to-automatic-kernel-builds/?pk_campaign=feed&amp;pk_kwd=working-my-way-to-automatic-kernel-builds/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Bash files vs configuration</title>
		<link>https://my.stargazer.at/2021/05/28/bash-files-vs-configuration/?pk_campaign=feed&amp;pk_kwd=bash-files-vs-configuration</link>
					<comments>https://my.stargazer.at/2021/05/28/bash-files-vs-configuration/?pk_campaign=feed&amp;pk_kwd=bash-files-vs-configuration#respond</comments>
		
		<dc:creator><![CDATA[ToeiRei]]></dc:creator>
		<pubDate>Fri, 28 May 2021 11:38:05 +0000</pubDate>
				<category><![CDATA[IT Related stuff]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[script]]></category>
		<guid isPermaLink="false">https://my.stargazer.at/?p=1836</guid>

					<description><![CDATA[You guys know me, I do script a lot of stuff to make my life easier. Starting from my (smart)home to my server maintenance &#8211; it just saves too much time. And today I would like to share some ideas on how (not?) to work with configuration stuff in bash. First of all: Configuration on some scripts may [&#8230;]<img src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F05%2F28%2Fbash-files-vs-configuration%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dbash-files-vs-configuration&amp;action_name=Bash%20files%20vs%20configuration&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[<p>You guys know me, I do script a lot of stuff to make my life easier. Starting from my (smart)home to my server maintenance &#8211; it just saves too much time. And today I would like to share some ideas on how (not?) to work with configuration stuff in bash.</p>
<p>First of all: Configuration on some scripts may be needed. If it&#8217;s for uploading stuff onto a remote repository, FTP server or whatever &#8211; you need to have at least the remote host specified somewhere. In case of you&#8217;re making your script public, it&#8217;s for sure no good idea to share that information as other folks may try their luck and snoop around using their findings.</p>
<p>So what&#8217;s the solution to that? At first I decided to move all of my config stuff into variables at the beginning of the file to save me some headache on changing configuration to solve the mistakes we described in the previous step. Nothing big, but it works.</p>
<p>Next would be reading the configuration from an external file. In bash it can be as simple as just including another script like</p>
<pre>source /home/myuser/test/config</pre>
<p>But that&#8217;s where I want to think about what this line does. Sourcing another script is executing it. In other words, source is not secure as it will execute arbitrary code. This may not be a concern for you, but if file permissions are incorrect, it may be possible for an attacker with filesystem access to execute code as a privileged user by injecting code into a config file loaded by an otherwise-secured script such as an init script.</p>
<p>But what&#8217;s the solution? Mine was parsing the configuration instead of executing it. As json is simple, I decided to put it to good use here as the program &#8216;jq&#8217; is a nifty little shell parser for that. If you&#8217;re more into xml, I&#8217;m sure the XML starlet has you covered.</p>
<p>Now let&#8217;s do an example &#8211; shall we? Let&#8217;s try with a very simple config that I would use:</p>
<pre>{ 
"username": "username-or-email",
"password": "the-password" 
}</pre>
<p>Now for our main script I can fetch the data using jq:</p>
<pre>USERNAME="$( jq -r '.username' "$config_file" )"</pre>
<p>The moral of the story: parse your config, do not execute it.</p>
<img loading="lazy" decoding="async" src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F05%2F28%2Fbash-files-vs-configuration%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dbash-files-vs-configuration&amp;action_name=Bash%20files%20vs%20configuration&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
					<wfw:commentRss>https://my.stargazer.at/2021/05/28/bash-files-vs-configuration/?pk_campaign=feed&amp;pk_kwd=bash-files-vs-configuration/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Yubikey for system auth</title>
		<link>https://my.stargazer.at/2021/05/15/yubikey-for-system-auth/?pk_campaign=feed&amp;pk_kwd=yubikey-for-system-auth</link>
					<comments>https://my.stargazer.at/2021/05/15/yubikey-for-system-auth/?pk_campaign=feed&amp;pk_kwd=yubikey-for-system-auth#respond</comments>
		
		<dc:creator><![CDATA[ToeiRei]]></dc:creator>
		<pubDate>Sat, 15 May 2021 09:56:10 +0000</pubDate>
				<category><![CDATA[IT Related stuff]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pam]]></category>
		<category><![CDATA[yubikey]]></category>
		<guid isPermaLink="false">https://my.stargazer.at/?p=1832</guid>

					<description><![CDATA[Linux is a beautiful system that can be customized in very many ways &#8211; it amazes me everytime how easy or which features I can add to my system for making life easier for me. Today: Login using the Yubikey. System Authentication is pretty easy on Linux system if we stick to PAM, which allows us to mix [&#8230;]<img src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F05%2F15%2Fyubikey-for-system-auth%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dyubikey-for-system-auth&amp;action_name=Yubikey%20for%20system%20auth&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[<p>Linux is a beautiful system that can be customized in very many ways &#8211; it amazes me everytime how easy or which features I can add to my system for making life easier for me. Today: Login using the Yubikey.</p>
<p>System Authentication is pretty easy on Linux system if we stick to PAM, which allows us to mix and match authentication methods as we want to. In my case I wanted to tackle &#8216;su&#8217; or &#8216;sudo&#8217; to save me entering my passwords over and over again. Our savior is the U2F module named <a href="https://github.com/Yubico/pam-u2f.git">pam_u2f.so</a> which may be in your distro&#8217;s repository &#8211; I was lucky for Debian and Gentoo.</p>
<p>Configuration is shockingly simple:</p>
<p>In /etc/pam.d/ are the config files for every service &#8211; some of those are symlinks, but that doesn&#8217;t change things. You should be able to see which config goes for what service. I did go for &#8216;su&#8217; as I need that on my local workstation way too often.</p>
<p>Let&#8217;s have a look at the gentoo default config for &#8216;su&#8217;:</p>
<pre>auth            sufficient      pam_rootok.so 
auth            required        pam_wheel.so use_uid 
auth            include         system-auth 
account         include         system-auth 
password        include         system-auth 
session         include         system-auth 
session         required        pam_env.so 
session         optional        pam_xauth.so
</pre>
<p>In this file you find entries from &#8216;sufficient&#8217; up to &#8216;required&#8217; for defining the rules for the PAM modules noted in the 3rd column. So to spice up my config, I added this to my &#8216;auth&#8217; section:</p>
<pre>auth            sufficient      pam_u2f.so cue</pre>
<p>By using this line, I tell PAM that it&#8217;s &#8216;sufficient&#8217; if I authenticate using my Yubikey and its PIN. If I would use &#8216;required&#8217; instead of &#8216;sufficient&#8217; I&#8217;d make it a requirement to authenticate successfully using the Yubikey on top of the password. I seriously do not advise for using &#8216;required&#8217; on the first test run to make sure you do not lock yourself out of the system!</p>
<p>The parameter &#8216;cue&#8217; tells the PAM module to merrily print a message to &#8216;touch the device&#8217;. All other parameters are documented on https://developers.yubico.com/pam-u2f/</p>
<p>Sadly we&#8217;re not finished yet as we just told PAM that it should use the Yubikey. The system also needs some identification of each Yubikey used and some mapping to their users. That&#8217;s done either globally in /etc/u2f_mappings or per user in ~/.ssh/u2f_keys</p>
<p>No matter which way you choose, those files look the same and are set up like this:</p>
<pre>&lt;username1&gt;:&lt;KeyHandle1&gt;,&lt;UserKey1&gt;,&lt;Options1&gt;:&lt;KeyHandle2&gt;,&lt;UserKey2&gt;,&lt;Options2&gt;:...
&lt;username2&gt;:&lt;KeyHandle1&gt;,&lt;UserKey1&gt;,&lt;Options1&gt;:&lt;KeyHandle2&gt;,&lt;UserKey2&gt;,&lt;Options2&gt;:...</pre>
<p>The key handles are acquired using the following command:</p>
<pre>pamu2fcfg -uusername -opam://myorigin -ipam://myappid</pre>
<p>Now you can assign the keys to the user.</p>
<p>For testing out the system, there&#8217;s no need to reboot or reload anything as PAM reads those files on the fly.</p>
<img loading="lazy" decoding="async" src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F05%2F15%2Fyubikey-for-system-auth%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dyubikey-for-system-auth&amp;action_name=Yubikey%20for%20system%20auth&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
					<wfw:commentRss>https://my.stargazer.at/2021/05/15/yubikey-for-system-auth/?pk_campaign=feed&amp;pk_kwd=yubikey-for-system-auth/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Central logging vs dns targets</title>
		<link>https://my.stargazer.at/2021/02/19/central-logging-vs-dns-targets/?pk_campaign=feed&amp;pk_kwd=central-logging-vs-dns-targets</link>
					<comments>https://my.stargazer.at/2021/02/19/central-logging-vs-dns-targets/?pk_campaign=feed&amp;pk_kwd=central-logging-vs-dns-targets#respond</comments>
		
		<dc:creator><![CDATA[ToeiRei]]></dc:creator>
		<pubDate>Fri, 19 Feb 2021 22:45:13 +0000</pubDate>
				<category><![CDATA[IT Related stuff]]></category>
		<category><![CDATA[graylog]]></category>
		<category><![CDATA[syslog]]></category>
		<guid isPermaLink="false">https://my.stargazer.at/?p=1824</guid>

					<description><![CDATA[Oh boy &#8211; I was not ready for a hit like that. But let me start with the whole picture, shall we? I do run a central syslog using graylog and I tend to ship my logs to that device for easier searching and poking around in those. No big deal until I looked at my DNS traffic [&#8230;]<img src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F02%2F19%2Fcentral-logging-vs-dns-targets%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dcentral-logging-vs-dns-targets&amp;action_name=Central%20logging%20vs%20dns%20targets&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[<p>Oh boy &#8211; I was not ready for a hit like that. But let me start with the whole picture, shall we?</p>
<p>I do run a central syslog using <a href="https://www.graylog.org/" target="_blank" rel="noopener">graylog</a> and I tend to ship my logs to that device for easier searching and poking around in those. No big deal until I looked at my DNS traffic which was stupidly high. To be exact, more than 3000 DNS requests in less than 10 minutes. Turns out it was the log server being addressed using a dns name instead of its IP address which lead to that problem of my Access Points resolving their log target on every line.</p>
<p>I would have hoped for them to have at least some caching or anything like that implemented &#8211; but that wasn&#8217;t the case. Lesson learned: Use the IP for syslog servers.</p>
<img loading="lazy" decoding="async" src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F02%2F19%2Fcentral-logging-vs-dns-targets%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dcentral-logging-vs-dns-targets&amp;action_name=Central%20logging%20vs%20dns%20targets&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
					<wfw:commentRss>https://my.stargazer.at/2021/02/19/central-logging-vs-dns-targets/?pk_campaign=feed&amp;pk_kwd=central-logging-vs-dns-targets/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ccache on kernels</title>
		<link>https://my.stargazer.at/2021/01/27/ccache-on-kernels/?pk_campaign=feed&amp;pk_kwd=ccache-on-kernels</link>
					<comments>https://my.stargazer.at/2021/01/27/ccache-on-kernels/?pk_campaign=feed&amp;pk_kwd=ccache-on-kernels#respond</comments>
		
		<dc:creator><![CDATA[ToeiRei]]></dc:creator>
		<pubDate>Wed, 27 Jan 2021 20:23:53 +0000</pubDate>
				<category><![CDATA[IT Related stuff]]></category>
		<category><![CDATA[ccache]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://my.stargazer.at/?p=1821</guid>

					<description><![CDATA[As I am building debian packages of recent kernels, I have to build the same thing over and over again &#8211; pretty much three times to be exact. Once for &#8216;vanilla&#8217;, second time for virtual machines and third time for gameservers using the gentoo patchset. If you check back on my post about ccache on gentoo you might [&#8230;]<img src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F01%2F27%2Fccache-on-kernels%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dccache-on-kernels&amp;action_name=ccache%20on%20kernels&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[<p>As I am building <a href="https://toei.stargazer.at/2020/12/15/kernel-kernel-am-system/" target="_blank" rel="noopener">debian packages</a> of recent <a href="https://my.stargazer.at/2020/10/30/building-a-gentoo-linux-kernel-on-debian/">kernels</a>, I have to build the same thing over and over again &#8211; pretty much three times to be exact. Once for &#8216;vanilla&#8217;, second time for virtual machines and third time for gameservers using the <a href="https://my.stargazer.at/2020/10/30/building-a-gentoo-linux-kernel-on-debian/">gentoo patchset</a>.</p>
<p>If you check back on my post about <a href="https://my.stargazer.at/2014/11/24/ccache-more-speed/">ccache on gentoo</a> you might remember that a cache is only good for if you build the same thing over and over again as we do in this case compared to a regular gentoo system. Implementation itself was pretty cheap as I just had to add <em>CC=&#8221;ccache gcc&#8221;</em> to my make command. To give you some numbers on how this works, here are the stats with a cold cache after a build time of about an hour:</p>
<pre>
cache hit (direct)                     0
cache hit (preprocessed)               0
cache miss                         15556
cache hit rate                      0.00 %
called for link                       29
called for preprocessing            2857
unsupported code directive             4
no input file                        682
cleanups performed                     0
files in cache                     46654
cache size                           7.2 GB
max cache size                      10.0 GB
</pre>
<p>As you see &#8211; no cache hits. After building a second kernel, you can see ccache shaving off some compile time:</p>
<pre>
cache hit (direct)                    34
cache hit (preprocessed)             774
cache miss                          7318
cache hit rate                      9.94 %
called for link                       28
called for preprocessing            1964
unsupported code directive             4
no input file                        682
cleanups performed                    17
files in cache                     53763
cache size                           8.8 GB
max cache size                      10.0 GB
</pre>
<p>The next big thing to get things going faster would be using distcc by extending our CC variable to CC=&#8217;ccache distcc gcc&#8217; although I would consider this unpractical due to the toolchain having to be the exact same version on the machines involved plus some advanced networking which goes beyond of what I have at my disposal.</p>
<img loading="lazy" decoding="async" src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2021%2F01%2F27%2Fccache-on-kernels%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dccache-on-kernels&amp;action_name=ccache%20on%20kernels&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
					<wfw:commentRss>https://my.stargazer.at/2021/01/27/ccache-on-kernels/?pk_campaign=feed&amp;pk_kwd=ccache-on-kernels/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>My own kernel repo</title>
		<link>https://my.stargazer.at/2020/11/24/my-own-kernel-repo/?pk_campaign=feed&amp;pk_kwd=my-own-kernel-repo</link>
					<comments>https://my.stargazer.at/2020/11/24/my-own-kernel-repo/?pk_campaign=feed&amp;pk_kwd=my-own-kernel-repo#respond</comments>
		
		<dc:creator><![CDATA[ToeiRei]]></dc:creator>
		<pubDate>Tue, 24 Nov 2020 11:44:12 +0000</pubDate>
				<category><![CDATA[IT Related stuff]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://my.stargazer.at/?p=1814</guid>

					<description><![CDATA[Debian is awesome. Really. I love Debian &#8211; but sometimes the well-aged kernel is a tad too old for me. Currently it&#8217;s about fstrim and as I&#8217;m already doing my own Gentoo-Kernel for Debian, I had to do it properly and build an upstream &#8216;vanilla&#8217; kernel too. What I dislike about my current setup is having to install [&#8230;]<img src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2020%2F11%2F24%2Fmy-own-kernel-repo%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dmy-own-kernel-repo&amp;action_name=My%20own%20kernel%20repo&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[<p>Debian is awesome. Really. I love Debian &#8211; but sometimes the well-aged kernel is a tad too old for me. Currently it&#8217;s about fstrim and as I&#8217;m already doing my own <a href="https://my.stargazer.at/2020/10/30/building-a-gentoo-linux-kernel-on-debian/">Gentoo-Kernel for Debian</a>, I had to do it properly and build an upstream &#8216;vanilla&#8217; kernel too. What I dislike about my current setup is having to install the deb-files manually.</p>
<p>To put an end to this manual installation I had to do a meta-package &#8211;  a debian package that is just dependencies. To do so, I used a program called &#8216;equivs&#8217;, which is installed by the following command:</p>
<pre>apt install equivs</pre>
<p>As the package is there, it&#8217;s time to generate the initial config for our package</p>
<pre>equivs-control my-kernel-package</pre>
<p>This command gives us a template file that&#8217;s to be edited to fit our needs. Pay attention to the line saying &#8220;Depends:&#8221; as that&#8217;s where we add our Debian packages. As of writing this, the current config looks like that:</p>
<pre>### Commented entries have reasonable defaults.
### Uncomment to edit them.
# Source: &lt;source package name; defaults to package name&gt;
Section: misc
Priority: optional
# Homepage: &lt;enter URL here; no default&gt;
Standards-Version: 5.9.10

Package: vanilla-kernel
Version: 5.9.10
Maintainer: Viktoria Rei Bauer &lt;debian@example.com&gt;
# Pre-Depends: &lt;comma-separated list of packages&gt;
Depends: linux-image-5.9.10,linux-headers-5.9.10,linux-libc-dev
# Recommends: &lt;comma-separated list of packages&gt;
# Suggests: &lt;comma-separated list of packages&gt;
# Provides: &lt;comma-separated list of packages&gt;
# Replaces: &lt;comma-separated list of packages&gt;
Architecture: amd64
# Multi-Arch: &lt;one of: foreign|same|allowed&gt;
# Copyright: &lt;copyright file; defaults to GPL2&gt;
# Changelog: &lt;changelog file; defaults to a generic changelog&gt;
# Readme: &lt;README.Debian file; defaults to a generic one&gt;
# Extra-Files: &lt;comma-separated list of additional files for the doc directory&gt;
# Links: &lt;pair of space-separated paths; First is path symlink points at, second is filename of link&gt;
# Files: &lt;pair of space-separated paths; First is file to include, second is destination&gt;
# &lt;more pairs, if there's more than one file to include. Notice the starting space&gt;
Description: &lt;short description; defaults to some wise words&gt;
Meta-Package for vanilla kernel built based on debian .config</pre>
<p>Now it&#8217;s time to build the actual package by calling</p>
<pre>equivs-build my-kernel-package</pre>
<p>The result is a slick deb-file that can be imported in your repository. I use Sonatype Nexus.</p>
<p>Clients just need to add the repository to their sources.list and add the PGP key and we are ready to roll.</p>
<img loading="lazy" decoding="async" src="http://stats.stargazer.at/piwik.php?idsite=2&amp;rec=1&amp;url=https%3A%2F%2Fmy.stargazer.at%2F2020%2F11%2F24%2Fmy-own-kernel-repo%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dmy-own-kernel-repo&amp;action_name=My%20own%20kernel%20repo&amp;urlref=https%3A%2F%2Fmy.stargazer.at%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
					<wfw:commentRss>https://my.stargazer.at/2020/11/24/my-own-kernel-repo/?pk_campaign=feed&amp;pk_kwd=my-own-kernel-repo/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>