public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jeremy Cline <jeremycline@linux.microsoft.com>
To: git-commits@fedoraproject.org
Subject: [rpms/fedora-release] f45: Add a WSL variant
Date: Mon, 10 Aug 2026 09:36:43 GMT [thread overview]
Message-ID: <178635460357.1.14922722787060496777.rpms-fedora-release-c1cc4369b69d@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/fedora-release
Branch : f45
Commit : c1cc4369b69d575147e7d9d1a479f5d470adfafb
Author : Jeremy Cline <jeremycline@linux.microsoft.com>
Date : 2025-01-21T22:49:23+00:00
Stats : +110/-0 in 4 file(s)
URL : https://src.fedoraproject.org/rpms/fedora-release/c/c1cc4369b69d575147e7d9d1a479f5d470adfafb?branch=f45
Log:
Add a WSL variant
Introduce a new WSL release for Windows Subsystem for Linux images. This
includes the distribution configuration and first-time setup script, as
well.
See https://bugzilla.redhat.com/show_bug.cgi?id=2338441
---
diff --git a/fedora-release.spec b/fedora-release.spec
index d378fd7..a49294e 100644
--- a/fedora-release.spec
+++ b/fedora-release.spec
@@ -58,6 +58,7 @@
%bcond miraclewm_atomic %[%{undefined eln}]
%bcond cosmic %[%{undefined eln}]
%bcond cosmic_atomic %[%{undefined eln}]
+%bcond wsl %[%{undefined eln}]
%if %{with silverblue} || %{with kinoite} || %{with kinoite_mobile} || %{with sway_atomic} || %{with budgie_atomic} || %{with miraclewm_atomic} || %{with cosmic_atomic}
%global with_ostree_desktop 1
@@ -107,6 +108,9 @@ Source33: plasma-mobile.conf
Source34: 80-kde-mobile.preset
Source35: fedora-miraclewm.conf
Source36: fedora-cosmic.conf
+Source37: wsl.conf
+Source38: wsl-distribution.conf
+Source39: wsl-oobe.sh
BuildArch: noarch
@@ -1447,6 +1451,42 @@ Provides the necessary files for a Fedora installation that is identifying
itself as Fedora COSMIC Atomic.
%endif
+%if %{with wsl}
+%package wsl
+Summary: Base package for Fedora WSL specific default configurations
+
+RemovePathPostfixes: .wsl
+Provides: fedora-release = %{version}-%{release}
+Provides: fedora-release-variant = %{version}-%{release}
+Provides: system-release
+Provides: system-release(%{version})
+Requires: fedora-release-common = %{version}-%{release}
+
+# fedora-release-common Requires: fedora-release-identity, so at least one
+# package must provide it. This Recommends: pulls in
+# fedora-release-identity-wsl if nothing else is already doing so.
+Recommends: fedora-release-identity-wsl
+
+
+%description wsl
+Provides a base package for Fedora WSL specific configuration files to
+depend on as well as WSL system defaults.
+
+
+%package identity-wsl
+Summary: Package providing the identity for Fedora WSL.
+
+RemovePathPostfixes: .wsl
+Provides: fedora-release-identity = %{version}-%{release}
+Conflicts: fedora-release-identity
+Requires(meta): fedora-release-container = %{version}-%{release}
+
+
+%description identity-wsl
+Provides the necessary files for a Fedora installation that is identifying
+itself as Fedora WSL.
+%endif
+
%prep
mkdir -p licenses
sed 's|@@VERSION@@|%{dist_version}|g' %{SOURCE2} >licenses/Fedora-Legal-README.txt
@@ -1949,6 +1989,16 @@ sed -i -e 's|BUG_REPORT_URL=.*|BUG_REPORT_URL="https://pagure.io/fedora-cosmic/S
sed -e "s#\$version#%{bug_version}#g" -e 's/$edition/COSMICAtomic/;s/<!--.*-->//;/^$/d' %{SOURCE20} > %{buildroot}%{_swidtagdir}/org.fedoraproject.Fedora-edition.swidtag.cosmic-atomic
%endif
+%if %{with wsl}
+install -pm0644 -t %{buildroot}%{_sysconfdir}/ %{SOURCE37} %{SOURCE38}
+install -Dpm0755 -T %{SOURCE39} %{buildroot}%{_libexecdir}/wsl/oobe.sh
+cp -p os-release %{buildroot}%{_prefix}/lib/os-release.wsl
+echo "VARIANT=\"WSL\"" >> %{buildroot}%{_prefix}/lib/os-release.wsl
+echo "VARIANT_ID=wsl" >> %{buildroot}%{_prefix}/lib/os-release.wsl
+sed -i -e "s|(%{release_name}%{?prerelease})|(WSL%{?prerelease})|g" %{buildroot}%{_prefix}/lib/os-release.wsl
+sed -e "s#\$version#%{bug_version}#g" -e 's/$edition/WSL/;s/<!--.*-->//;/^$/d' %{SOURCE20} > %{buildroot}%{_swidtagdir}/org.fedoraproject.Fedora-edition.swidtag.wsl
+%endif
+
# Create the symlink for /etc/os-release
ln -s ../usr/lib/os-release %{buildroot}%{_sysconfdir}/os-release
@@ -2340,6 +2390,16 @@ install -Dm0644 %{SOURCE31} -t %{buildroot}%{_prefix}/share/dnf5/libdnf.conf.d/
%{_prefix}/lib/systemd/system-preset/81-desktop.preset
%endif
+%if %{with wsl}
+%files wsl
+%{_sysconfdir}/wsl.conf
+%{_sysconfdir}/wsl-distribution.conf
+%{_libexecdir}/wsl/oobe.sh
+%files identity-wsl
+%{_prefix}/lib/os-release.wsl
+%attr(0644,root,root) %{_swidtagdir}/org.fedoraproject.Fedora-edition.swidtag.wsl
+%endif
+
%changelog
%autochangelog
diff --git a/wsl-distribution.conf b/wsl-distribution.conf
new file mode 100644
index 0000000..d071d33
--- /dev/null
+++ b/wsl-distribution.conf
@@ -0,0 +1,16 @@
+# The /etc/wsl-distribution.conf configuration file.
+#
+# Available configuration options are documented at
+# https://learn.microsoft.com/en-us/windows/wsl/build-custom-distro
+
+[oobe]
+# Command run the first time the user opens an interactive shell.
+# If the command returns non-zero, it is considered unsuccessful and the
+# user won't be able to open a shell.
+command = /usr/libexec/wsl/oobe.sh
+# Default UID for user the distribution starts with.
+defaultUid = 1000
+# Default name the distribution is registered under.
+# This is used when the user double-clicks to install, or uses
+# wsl --install --from-file ./Fedora.wsl
+defaultName = Fedora
diff --git a/wsl-oobe.sh b/wsl-oobe.sh
new file mode 100644
index 0000000..a14b79f
--- /dev/null
+++ b/wsl-oobe.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# The Fedora WSL out of box experience script.
+#
+# This command runs the first time the user opens an interactive shell.
+#
+# A non-zero exit code indicates to WSL that setup failed.
+
+set -ueo pipefail
+
+DEFAULT_USER_ID=1000
+
+echo 'Please create a default Fedora user account. The username does not need to match your Windows username.'
+echo 'For more information visit: https://aka.ms/wslusers'
+
+if getent passwd $DEFAULT_USER_ID > /dev/null ; then
+ echo 'User account already exists, skipping creation'
+ exit 0
+fi
+
+# Prompt from the username
+read -r -p 'Enter new UNIX username: ' username
+
+# Create the user
+/usr/sbin/useradd -m -G wheel --uid $DEFAULT_USER_ID "$username"
+
+cat > /etc/sudoers.d/wsluser << EOF
+# Ensure the WSL initial user can use sudo
+$username ALL=(ALL) NOPASSWD: ALL
+EOF
diff --git a/wsl.conf b/wsl.conf
new file mode 100644
index 0000000..1a92e7c
--- /dev/null
+++ b/wsl.conf
@@ -0,0 +1,4 @@
+# Refer to https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconf
+# for the full set of configuration options.
+[boot]
+systemd=true
reply other threads:[~2026-08-10 9:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178635460357.1.14922722787060496777.rpms-fedora-release-c1cc4369b69d@fedoraproject.org \
--to=jeremycline@linux.microsoft.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox