<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    
    <title>Charlz&apos; Realm</title>
    
    
    <description>Just some random thoughts, experiments and discoveries</description>
    
    <link>https://www.charlz.net/</link>
    <atom:link href="https://www.charlz.net/feed.xml" rel="self" type="application/rss+xml" />
    
    
      <item>
        <title>How to Build an Incus Buster Image</title>
        <description>
          
          &lt;p&gt;It’s always nice to have container images of Debian releases to test things,
run applications or explore a bit without polluting your host machine. From
some Brazilian friends (you know who you are ;-), I’ve learned the best way to
debug a problem or test a fix is spinning up an incus container, getting to it
and finding the minimum reproducer. So the combination incus + Debian is
something that I’m very used to, but the problem is there are no images for
Debian ELTS and testing security fixes to see if they actually fix the
vulnerability and don’t break anything else is very important.&lt;/p&gt;

&lt;p&gt;Well, the regular images don’t materialize out of thin air, right? So we can
learn how they are made and try to generate ELTS images in the same way -
shouldn’t be that difficult, right? Well, kinda ;-)&lt;/p&gt;

&lt;p&gt;The images available by default in incus come from
&lt;a href=&quot;https://images.linuxcontainers.org/&quot;&gt;images.linuxcontainers.org&lt;/a&gt; and are built
by Jenkins using distrobuilder. If you follow the links, you will find the
repository containing the yaml image definitions used by distrobuilder at
&lt;a href=&quot;https://github.com/lxc/lxc-ci&quot;&gt;github.com/lxc/lxc-ci&lt;/a&gt;. With a bit of
investigation work, a &lt;a href=&quot;https://github.com/charles2910/lxc-ci&quot;&gt;fork&lt;/a&gt;, an incus
VM with distrobuilder installed and some magic (also called trial and error) I
was able to build a buster image! Whooray, but VM and stretch images are still
work in progress.&lt;/p&gt;

&lt;p&gt;Anyway, I wanted to share how you can build your images and document this
process so I don’t forget, so here we are…&lt;/p&gt;

&lt;h2 id=&quot;building-instructions&quot;&gt;Building Instructions&lt;/h2&gt;

&lt;p&gt;We will use an incus trixie VM to perform the build so we don’t clutter our own
machine.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;incus launch images:debian/trixie &amp;lt;instance-name&amp;gt; &lt;span class=&quot;nt&quot;&gt;--vm&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then let’s hop into the machine and install the dependencies.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;incus shell &amp;lt;instance-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And…&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;git distrobuilder
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Let’s clone the repository with the yaml definition to build a buster
container.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone &lt;span class=&quot;nt&quot;&gt;--branch&lt;/span&gt; support-debian-buster https://github.com/charles2910/lxc-ci.git
&lt;span class=&quot;c&quot;&gt;# and cd into it&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;lxc-ci
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then all we need is to pass the correct arguments to distrobuilder so it can build
the image. It can output the image in the current directory or in a pre-defined
place, so let’s create an easy place for the images.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; /tmp/images/buster/container
&lt;span class=&quot;c&quot;&gt;# and perform the build&lt;/span&gt;
distrobuilder build-incus images/debian.yaml /tmp/images/buster/container/ &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; image.architecture&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;amd64 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; image.release&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;buster &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; image.variant&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;default  &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; source.url&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;http://archive.debian.org/debian&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It requires a build definition written in yaml format to perform the build. If
you are curious, check the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;images/&lt;/code&gt; subdir.&lt;/p&gt;

&lt;p&gt;If all worked correctly, you should have two files in your pre-defined target
directory. In our case, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmp/images/buster/container/&lt;/code&gt; contains:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;incus.tar.xz  rootfs.squashfs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Let’s copy it to our host so we can add the image to our incus server.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;incus file pull &amp;lt;instance-name&amp;gt;/tmp/images/buster/container/incus.tar.xz &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
incus file pull &amp;lt;instance-name&amp;gt;/tmp/images/buster/container/rootfs.squashfs &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# and import it as debian/10&lt;/span&gt;
incus image import incus.tar.xz rootfs.squashfs &lt;span class=&quot;nt&quot;&gt;--alias&lt;/span&gt; debian/10
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If we are lucky, we can run our Debian buster container now!&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;incus launch &lt;span class=&quot;nb&quot;&gt;local&lt;/span&gt;:debian/10 &amp;lt;debian-buster-instance&amp;gt;
incus shell &amp;lt;debian-buster-instance&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Well, now all that is left is to &lt;a href=&quot;https://www.freexian.com/lts/extended/docs/how-to-use-extended-lts/&quot;&gt;install Freexian’s ELTS package
repository&lt;/a&gt;
and update the image to get a lot of CVE fixes.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apt &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--assume-yes&lt;/span&gt; wget
wget https://deb.freexian.com/extended-lts/archive-key.gpg &lt;span class=&quot;nt&quot;&gt;-O&lt;/span&gt; /etc/apt/trusted.gpg.d/freexian-archive-extended-lts.gpg
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt; &amp;gt;/etc/apt/sources.list.d/extended-lts.list
deb http://deb.freexian.com/extended-lts buster-lts main contrib non-free
&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;EOF
&lt;/span&gt;apt update
apt &lt;span class=&quot;nt&quot;&gt;--assume-yes&lt;/span&gt; upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

        </description>
        <pubDate>Thu, 09 Oct 2025 00:01:09 -0300</pubDate>
        <link>https://www.charlz.net/2025-10-09-buster-incus-image/</link>
        <guid isPermaLink="true">https://www.charlz.net/2025-10-09-buster-incus-image/</guid>
      </item>
    
      <item>
        <title>Making KGB less noisy</title>
        <description>
          
          &lt;p&gt;This past month I did setup KGB to send notifications to #debian-lts when new
merge requests were created in the LTS website’s repo and I learned a couple
cool things. I’ve been trying to document things more so I don’t have to
research the same topic months later, hence the blog seemed like a good idea,
specially since many debianites have KGB set on their favorite IRC channel
and this post will go to planet.debian.org.&lt;/p&gt;

&lt;h2 id=&quot;selecting-what-goes-to-irc&quot;&gt;Selecting What Goes to IRC&lt;/h2&gt;

&lt;p&gt;Salsa (Debian’s GitLab instance) can &lt;a href=&quot;https://docs.gitlab.com/user/project/integrations/webhook_events/&quot;&gt;generate a lot of
events&lt;/a&gt; for
things that happen on a repository and a lot of them can be &lt;a href=&quot;https://salsa.debian.org/kgb-team/kgb/-/wikis/usage&quot;&gt;pushed to KGB via
webhooks&lt;/a&gt;. Generally I
prefer a minimal set enabled otherwise it’s too much clutter on the IRC side,
but it’s important to go through each option to see what makes sense or not.
From the experience I had, the following ones are the most useful to have it
on:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Push events&lt;/li&gt;
  &lt;li&gt;Tag push events&lt;/li&gt;
  &lt;li&gt;Comments&lt;/li&gt;
  &lt;li&gt;Issue events&lt;/li&gt;
  &lt;li&gt;Merge request events&lt;/li&gt;
  &lt;li&gt;Pipeline events&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;reducing-the-noise&quot;&gt;Reducing the Noise&lt;/h2&gt;

&lt;p&gt;For Debian packaging, one may find it useful to add a pattern filter so only
the packaging branch updates go to IRC. If you are using
&lt;a href=&quot;https://dep-team.pages.debian.net/deps/dep14/&quot;&gt;DEP-14&lt;/a&gt;, that’s pretty easy,
“debian/*” will do the job.&lt;/p&gt;

&lt;p&gt;Notably, “Job events” are left out. Basically it’s just too much info, you get
one alert when a job is scheduled, then when it’s started and another one when
it’s completed. Well, each pipeline has at least a few of them, multiply by
three and you can understand my point.&lt;/p&gt;

&lt;p&gt;Besides that, pipelines also generate the same amount of events as jobs, so it
might be a problem too. Well, KGB comes to the rescue. It allows you to filter
pipeline events, because you really only care about the pipeline when it fails
;-) To do just that, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pipeline_only_status=failed&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Another interesting option is limiting the commits shown when the push event
has too many of them. One can do that with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;squash_threshold=3&lt;/code&gt;. Remember I
want less clutter?! Three commits is my limit here.&lt;/p&gt;

&lt;h2 id=&quot;final-result&quot;&gt;Final Result&lt;/h2&gt;

&lt;p&gt;The final URL for me looks like this (newlines added for clarity):&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;http://kgb.debian.net:9418/webhook/?channel=debian-&amp;lt;your_preferred_channel&amp;gt;&amp;amp;
                                    network=oftc&amp;amp;
                                    private=1&amp;amp;
                                    use_color=1&amp;amp;
                                    use_irc_notices=1&amp;amp;
                                    squash_threshold=3&amp;amp;
                                    pipeline_only_status=failed
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can see there are more options than the ones I described earlier, well, now
it’s your time to go through &lt;a href=&quot;https://salsa.debian.org/kgb-team/kgb/-/wikis/usage&quot;&gt;KGB’s
documentation&lt;/a&gt; and learn a
thing or two ;-)&lt;/p&gt;

        </description>
        <pubDate>Mon, 01 Sep 2025 21:18:09 -0300</pubDate>
        <link>https://www.charlz.net/2025-09-01-kgb-tips/</link>
        <guid isPermaLink="true">https://www.charlz.net/2025-09-01-kgb-tips/</guid>
      </item>
    
      <item>
        <title>Hello World</title>
        <description>
          Or how it took more than a year for me to set up this website - 
          &lt;p&gt;As the computer science tradition demands, we must start with a &lt;strong&gt;Hello World&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Though I have to say this hello world took quite a long time to reach the
internet. I’ve been thinking about setting up this website for way over a year,
but there are always too many things to decide - what Static Site Generator
will I use? Where should I get a domain from? Which registrar would be better
now? What if I want to set up a mail server, is it good enough? Oh, and what
about the theme, which one to choose? Can I get one simple enough to not fetch
javascript or css from external sources?&lt;/p&gt;

&lt;p&gt;This was taking so long that even my friends were saying “Please, just share
your screen and let’s do it &lt;strong&gt;now&lt;/strong&gt;!”. Well, rejoice friends, now it’s done!&lt;/p&gt;

        </description>
        <pubDate>Sun, 01 Dec 2024 23:18:09 -0300</pubDate>
        <link>https://www.charlz.net/2024-12-01-hello-world/</link>
        <guid isPermaLink="true">https://www.charlz.net/2024-12-01-hello-world/</guid>
      </item>
    
  </channel>
</rss>
