Skip to content

Simple script that allows to create and use Systemd extensions easily for Fedora

Notifications You must be signed in to change notification settings

Zeglius/dnf5-sysext.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 

Repository files navigation

Simple script that allows to create and use Systemd extensions with specified packages for Fedora (>=41, dnf5 required), avoiding to deal with Fedora Atomic rpm-ostree layering.

Requirements

This script relies on Nushell, which can be easly installed with brew:

$ brew install nushell

Warning

  • THIS SCRIPT IS IN EARLY STAGES. Use at your own risk
  • Do not deactivate systemd extensions if its being used by critical programs installed in it (Desktop Enviroments, databases, etc).

Quick start

We will install Docker in an extension as an example.

First we download dnf5-sysext.nu and add execution permissions.

$ git clone https://github.com/Zeglius/dnf5-sysext.sh.git
$ cd dnf5-sysext.sh
$ chmod +x ./dnf5-sysext.nu

Try to execute it to see if is working

./dnf5-sysext.nu --help

We copy docker repo file into /etc/yum.repos.d

$ curl "https://download.docker.com/linux/fedora/docker-ce.repo" | sudo tee /etc/yum.repos.d/docker.repo

And now, we create the systemd extension, and install in it docker-ce packages

$ ./dnf5-sysext.nu install \
    docker-ce \
    docker-ce-cli \
    containerd.io \
    docker-buildx-plugin \
    docker-compose-plugin

Should show a prompt to confirm whenever start the extension.

Afterwards, all left is enabling docker.

$ systemctl enable --now docker

Troubleshoot guide

As its experimental state implies, this script can render your PC inoperable. Here is a quick guide to fix it:

  1. Boot into grub, press e to edit the kernel parameters, and append systemd.mask=systemd-sysext.service this to the penultimate line, Ctrl + x to boot.

  2. Once logged in, remove the contents of /var/lib/extensions/WHATEVER_EXT_NAME, by default being /var/lib/extensions/dnf5_sysext

sudo rm -rf /var/lib/extensions/dnf5_sysext

About

Simple script that allows to create and use Systemd extensions easily for Fedora

Topics

Resources

Stars

Watchers

Forks