{"id":2686,"date":"2025-05-05T16:27:13","date_gmt":"2025-05-05T21:27:13","guid":{"rendered":"https:\/\/mrguitar.net\/?p=2686"},"modified":"2025-05-05T17:00:56","modified_gmt":"2025-05-05T22:00:56","slug":"adventures-with-bootc-upgrading-to-fedora-42","status":"publish","type":"post","link":"https:\/\/mrguitar.net\/?p=2686","title":{"rendered":"Adventures with bootc: Upgrading to Fedora 42"},"content":{"rendered":"\n<p>Twice a year, I eagerly await the new Fedora release and typically move to it on my systems during the beta phase. I was particularly excited about trying this with F42 because my setup *should* let me change the tag on my image to from :41 to :42 and then all of my &#8220;child images&#8221; should get automatically rebuilt, and then all upgraded. I&#8217;ve been a user of various rpm-ostree distros for many years now. I typically tell people that once you go through a major upgrade, that&#8217;s it &#8211; you&#8217;ll never go back. As you might imagine this post probably wouldn&#8217;t exist if everything was smooth sailing. Don&#8217;t get me wrong everything worked out fine, but I thought it might be helpful to others if I documented a few things about my experience.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"345\" src=\"https:\/\/mrguitar.net\/wp-content\/uploads\/2025\/05\/F42_release-816x345-1.jpg\" alt=\"\" class=\"wp-image-2688\" srcset=\"https:\/\/mrguitar.net\/wp-content\/uploads\/2025\/05\/F42_release-816x345-1.jpg 816w, https:\/\/mrguitar.net\/wp-content\/uploads\/2025\/05\/F42_release-816x345-1-300x127.jpg 300w, https:\/\/mrguitar.net\/wp-content\/uploads\/2025\/05\/F42_release-816x345-1-768x325.jpg 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">3rd Party Repos<\/h2>\n\n\n\n<p>The biggest blocker I faced was the lag with the NVIDIA repos: <a href=\"https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/\">https:\/\/developer.download.nvidia.com\/compute\/cuda\/repos\/<\/a> I wanted to use both the graphics and cuda drivers from this repo as that&#8217;s where they&#8217;re commonly pulled on the RHEL side of the house. I haven&#8217;t been watching them long enough to know how long the historic lag time is, but I can see some packages dated about ~30 days after F41 was released. That&#8217;s actually not bad, but for my main systems I really don&#8217;t want to be beholden to a 3rd party to update my OS. This reason is why the rpmfusion repos are so valuable. I&#8217;m glad I <a href=\"https:\/\/mrguitar.net\/?p=2664\" data-type=\"post\" data-id=\"2664\">documented the NVIDIA repos in my last blog<\/a>, as that should be valuable to RHEL users.<\/p>\n\n\n\n<p>The path forward for my fedora systems is to put cuda in containers &#8211; which is nice because it makes the base OS **huge**, and get graphics drivers from rpmfusion. This should make future upgrades that much smoother. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Kmods &amp; base images<\/h2>\n\n\n\n<p>My next challenge was around the base image content vs packages in the repo. Ultimately, base image builds are done frequently and are automated with CI. I don&#8217;t expect this to be a common issue for others, but here&#8217;s what I hit. When F42 was announced as GA, we had a gap in shipping a new base image and my build was picking up multiple kernels when installing kernel-devel and failing to build the kmods due to my script not being able to handle multiple kernels. This isn&#8217;t something you&#8217;ll hit if you try it today, but it was a minor hiccup. <\/p>\n\n\n\n<p>The akmod command fails with F42 hitting a permissions issue in \/var\/tmp. I didn&#8217;t have time to look into why this happens, and fortunately, it was super easy to just work around w\/ chmod. Also, the rpmfusion drivers use akmods, I so I commented out the dkms section.  Here is my updated script for building kmods with the container:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\nset -euox pipefail\n\nkver=$(cd \/usr\/lib\/modules &amp;&amp; echo *)\n\ncat &gt;\/tmp\/fake-uname &lt;&lt;EOF\n#!\/usr\/bin\/env bash\n\nif &#91; \"\\$1\" == \"-r\" ] ; then\n  echo ${kver}\n  exit 0\nfi\n\nexec \/usr\/bin\/uname \\$@\nEOF\ninstall -Dm0755 \/tmp\/fake-uname \/tmp\/bin\/uname\n\n#workaround for akmod permission issue\nchmod 777 \/var\/tmp\n\n#PATH=\/tmp\/bin:$PATH dkms autoinstall -k ${kver}\nPATH=\/tmp\/bin:$PATH akmods --force --kernels ${kver} \n\nchmod 755 \/var\/tmp\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Containerfiles<\/h2>\n\n\n\n<p>My standard operating environment, or &#8220;SOE&#8221;, base just adds a few global things I want for all my systems, and also streamlines some of the layer sharing and build process. This one *was* super simple to update and had the intended result for my home server &amp; work laptop layered images. I really only had to tweak w\/ desktop setup. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FROM quay.io\/fedora\/fedora-bootc:42\n\nCOPY etc etc\nCOPY usr usr\n\nRUN dnf install -y btop cockpit cockpit-podman cockpit-storaged cockpit-ws cockpit-machines cockpit-selinux bwm-ng firewalld git htop lm_sensors nss-mdns pcp pcp-selinux sysstat tree tuned wget vim-enhanced &amp;&amp; dnf clean all\n\nRUN systemctl enable fstrim.timer podman-auto-update.timer cockpit.socket\n\n#let's set the timezone\nRUN ln -s \/usr\/share\/zoneinfo\/America\/Chicago \/etc\/localtime &amp;&amp; \\\n\trm -rf \/var\/*\n\n#added linting to catch basic issues\nRUN bootc container lint\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Here&#8217;s my main daily driver Containerfile:<\/h2>\n\n\n\n<p><br>FROM [my_registry]\/fedora-soe-bootc:42<br><br>#copy configs<br>COPY etc etc<br>RUN mkdir -p \/var\/roothome \/data<br><br>#install packages, enable services, grab fonts<br>RUN\tdnf -y install https:\/\/mirrors.rpmfusion.org\/free\/fedora\/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https:\/\/mirrors.rpmfusion.org\/nonfree\/fedora\/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm &amp;&amp; dnf install -y rpmfusion-free-release-tainted &amp;&amp; \\<br>    dnf install -y gcc-c++ nvidia-container-toolkit &amp;&amp; \\<br>    dnf install -y akmod-nvidia xorg-x11-drv-nvidia &amp;&amp; \\<br>\tdnf group install -y kde-desktop virtualization &amp;&amp; \\<br>\tdnf install -y android-tools bcache-tools cups cups-browsed firefox fuse-exfat gamemode gdb guvcview gvfs input-leap kamera k3b kernel-headers libguestfs libvirt libvirt-daemon openrgb-udev-rules powertop qemu-kvm samba steam-devices subscription-manager thermald virt-install virt-manager vulkan-tools v4l2loopback v4l-utils xdpyinfo  &amp;&amp; \\<br>\tdnf clean all &amp;&amp; \\<br>\tdnf group install -y multimedia &#8211;setopt=&#8221;install_weak_deps=False&#8221; &#8211;exclude=PackageKit-gstreamer-plugin &amp;&amp; \\<br>\tdnf install -y ffmpeg libva-nvidia-driver nvidia-vaapi-driver libva-utils vdpauinfo &amp;&amp; \\<br>\tdnf swap -y mesa-va-drivers mesa-va-drivers-freeworld &amp;&amp; \\<br>\tdnf swap -y mesa-vdpau-drivers mesa-vdpau-drivers-freeworld &amp;&amp; \\<br>\tdnf remove -y &#8211;no-autoremove plasma-discover-offline-updates plasma-discover-packagekit tracker tracker-miners &amp;&amp; \\<br>\tdnf clean all &amp;&amp; \\<br>    systemctl enable lm_sensors sysstat tuned libvirtd.socket &amp;&amp; \\<br>    systemctl set-default graphical.target &amp;&amp; \\<br><br>    DOWNLOAD_URL=$(curl https:\/\/api.github.com\/repos\/githubnext\/monaspace\/releases\/latest | jq -r &#8216;.assets[] | select(.name| test(&#8220;.*.zip$&#8221;)).browser_download_url&#8217;) &amp;&amp; \\<br>    curl -Lo \/tmp\/monaspace-font.zip &#8220;$DOWNLOAD_URL&#8221; &amp;&amp; \\<br>    unzip -qo \/tmp\/monaspace-font.zip -d \/tmp\/monaspace-font &amp;&amp; \\<br>    mkdir -p \/usr\/share\/fonts\/monaspace &amp;&amp; \\<br>    mv \/tmp\/monaspace-font\/monaspace-v*\/fonts\/variable\/* \/usr\/share\/fonts\/monaspace\/ &amp;&amp; \\<br>    rm -rf \/tmp\/monaspace-font* &amp;&amp; \\<br>    fc-cache -f \/usr\/share\/fonts\/monaspace &amp;&amp; \\<br>    curl &#8211;output-dir \/tmp -LO https:\/\/github.com\/ryanoasis\/nerd-fonts\/releases\/download\/v3.2.1\/FiraCode.zip &amp;&amp; \\<br>    mkdir -p \/usr\/share\/fonts\/fira-nf &amp;&amp; \\<br>    unzip \/tmp\/FiraCode.zip -d \/usr\/share\/fonts\/fira-nf &amp;&amp; \\<br>    fc-cache -f \/usr\/share\/fonts\/fira-nf &amp;&amp; \\<br>    fc-cache -f \/usr\/share\/fonts\/ubuntu &amp;&amp; \\<br>    fc-cache -f \/usr\/share\/fonts\/inter<br><br>#Configure Default SDDM background<br>COPY usr usr<br><br>#Build kmods<br>COPY &#8211;chmod=755 kmod.sh \/tmp<br>RUN \/tmp\/kmod.sh <br><br>#workaround for selinux policy, clean \/var<br>RUN<br>rm -rf \/var\/*<br><br>#added linting to catch basic issues<br>RUN bootc container lint<br><\/p>\n\n\n\n<p>Anyway, it was ultimately a very smooth experience. I did have to iterate a few times on my main containerfile, but 1) it didn&#8217;t take very long 2) nothing interrupted my system from working 3) I very much appreciated I could rollback, but it wasn&#8217;t necessary this go around. A huge thanks to everyone who works on this wonderful distro and bootc technology. I love it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Twice a year, I eagerly await the new Fedora release and typically move to it on my systems during the beta phase. I was particularly excited about trying this with F42 because my setup *should* let me change the tag on my image to from :41 to :42 and then all of my &#8220;child images&#8221; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/mrguitar.net\/?p=2686\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Adventures with bootc: Upgrading to Fedora 42&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[126,32,125,130],"class_list":["post-2686","post","type-post","status-publish","format-standard","hentry","category-open-sourcenerd-stuff","tag-bootc","tag-fedora","tag-fedora-bootc","tag-image-mode"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/posts\/2686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mrguitar.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2686"}],"version-history":[{"count":3,"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/posts\/2686\/revisions"}],"predecessor-version":[{"id":2694,"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/posts\/2686\/revisions\/2694"}],"wp:attachment":[{"href":"https:\/\/mrguitar.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mrguitar.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mrguitar.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}