Bug 2363206 - Review Request: dracut-sshd - OpenSSH dracut initramfs integration
Summary: Review Request: dracut-sshd - OpenSSH dracut initramfs integration
Keywords:
Status: RELEASE_PENDING
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Neal Gompa
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/gsauthof/dracut-sshd
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-04-30 21:13 UTC by Georg Sauthoff
Modified: 2025-05-28 21:59 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:
ngompa13: fedora-review+


Attachments (Terms of Use)
The .spec file difference from Copr build 8984924 to 9077342 (1.26 KB, patch)
2025-05-24 16:04 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 9077342 to 9093734 (694 bytes, patch)
2025-05-27 22:07 UTC, Fedora Review Service
no flags Details | Diff

Description Georg Sauthoff 2025-04-30 21:13:27 UTC
Spec URL: https://raw.githubusercontent.com/gsauthof/dracut-sshd-spec/9aec7c53b89be245b5ab839e4a32662d56d13266/dracut-sshd.spec
SRPM URL: https://georg.so/pub/dracut-sshd-0.7.0-1.fc41.src.rpm
Description: dracut-sshd provides SSH access to initramfs early user space.

It allows for remote unlocking of a fully encrypted root filesystem and remote
access to the Dracut emergency shell (i.e. early userspace).
Fedora Account System Username: gsauthof

Comment 1 Fedora Review Service 2025-04-30 21:16:47 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/8984924
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2363206-dracut-sshd/fedora-rawhide-x86_64/08984924-dracut-sshd/fedora-review/review.txt

Found issues:

- %config(noreplace) /usr/lib/dracut/modules.d/46sshd/sshd_config
  Read more: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_configuration_files

Please know that there can be false-positives.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 2 Neal Gompa 2025-05-01 17:40:34 UTC
Taking this review.

Comment 3 Georg Sauthoff 2025-05-15 22:06:44 UTC
Neal, did you have a look at this package, yet?

Comment 4 Neal Gompa 2025-05-16 04:17:59 UTC
Spec review:

> %config(noreplace) %{_prefix}/lib/dracut/modules.d/46sshd/sshd_config

%config for stuff in /usr is not allowed. Instead, you may want to make the module look at some path in /etc/ for an admin override sshd_config(5) file to include in the initramfs.

Comment 5 Neal Gompa 2025-05-16 04:20:51 UTC
This also needs "Requires: openssh-server" too.

Comment 6 Georg Sauthoff 2025-05-24 16:00:28 UTC
Ok, added the dependency and added a patch that prefers /etc/dracut-sshd/sshd_config over the modules provided one,
for local changes. (such that I could remove that %config)

Updated files:
Spec URL: https://raw.githubusercontent.com/gsauthof/dracut-sshd-spec/f49baaf45bdd1d1ef018e205cfb0fc8ba1b7b4a0/dracut-sshd.spec
SRPM URL: https://georg.so/pub/dracut-sshd-0.7.0-1.fc41.src.rpm

Comment 7 Fedora Review Service 2025-05-24 16:04:35 UTC
Created attachment 2091380 [details]
The .spec file difference from Copr build 8984924 to 9077342

Comment 8 Fedora Review Service 2025-05-24 16:04:37 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/9077342
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2363206-dracut-sshd/fedora-rawhide-x86_64/09077342-dracut-sshd/fedora-review/review.txt

Please take a look if any issues were found.


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 9 Neal Gompa 2025-05-26 08:18:30 UTC
You should add the following to %install:

mkdir -p %{buildroot}%{_sysconfdir}/dracut-sshd
touch %{buildroot}%{_sysconfdir}/dracut-sshd/sshd_config

And for %files:

%dir %{_sysconfdir}/dracut-sshd
%ghost %config(noreplace) %{_sysconfdir}/dracut-sshd/sshd_config

Comment 10 Georg Sauthoff 2025-05-26 21:26:28 UTC
Regarding ghost files - I'm not sure how useful it is to mark such an optional file as ghost.

My expectation is that 99.9 % of users are fine with the default sshd_config from /usr/lib/dracut/modules.d/46sshd/.

I don't find anything about ghost macro usage in the fedora packaging guide.

Also, the disadvantage I see with ghost is the interaction with `rpm --verify` and `rpm -f` then,
i.e. users are easily misled that a present ghost file was installed by a package.


/etc/dracut-sshd/sshd_config is an optional overwrite that shadows /usr/lib/dracut/modules.d/46sshd/sshd_config, if present.

This overwrite mechanism is similar to what is used in systemd and other software packages.

Looking at my system I see a few ghost files for systemd config files (such as /etc/systemd/journald.conf) but not for every service.


I understand that the touched file isn't really installed, because of the ghost marking.
But I'm not sure about the directory.
If it's unconditionally created I see that as suboptimal, because, again, I expect most people to leave it empty then.

---

FWIW, regarding configuration under /usr - the relevant section from the packaging guide:

> Don’t use %config or %config(noreplace) under /usr. /usr is deemed to not contain configuration files in Fedora.

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_configuration_files

From that I don't get whether this is a hard rule ('must') or merely a recommendation.

FWIW, on my main workstation I have quite a few config-marked files under /usr originating from the Fedora 41 repository:

rpm -qac | grep '^/usr' -c
39

Comment 11 Neal Gompa 2025-05-26 21:59:29 UTC
(In reply to Georg Sauthoff from comment #10)
> Regarding ghost files - I'm not sure how useful it is to mark such an
> optional file as ghost.
> 
> My expectation is that 99.9 % of users are fine with the default sshd_config
> from /usr/lib/dracut/modules.d/46sshd/.
> 
> I don't find anything about ghost macro usage in the fedora packaging guide.
> 
> Also, the disadvantage I see with ghost is the interaction with `rpm
> --verify` and `rpm -f` then,
> i.e. users are easily misled that a present ghost file was installed by a
> package.
> 
> 
> /etc/dracut-sshd/sshd_config is an optional overwrite that shadows
> /usr/lib/dracut/modules.d/46sshd/sshd_config, if present.
> 
> This overwrite mechanism is similar to what is used in systemd and other
> software packages.
> 
> Looking at my system I see a few ghost files for systemd config files (such
> as /etc/systemd/journald.conf) but not for every service.
> 
> 
> I understand that the touched file isn't really installed, because of the
> ghost marking.
> But I'm not sure about the directory.
> If it's unconditionally created I see that as suboptimal, because, again, I
> expect most people to leave it empty then.
> 

The problem with not declaring it is that if it is uninstalled, it won't get cleaned up if a user does use the mechanism. That's why I asked for it to be handled.

> ---
> 
> FWIW, regarding configuration under /usr - the relevant section from the
> packaging guide:
> 
> > Don’t use %config or %config(noreplace) under /usr. /usr is deemed to not contain configuration files in Fedora.
> 
> https://docs.fedoraproject.org/en-US/packaging-guidelines/
> #_configuration_files
> 
> From that I don't get whether this is a hard rule ('must') or merely a
> recommendation.
> 
> FWIW, on my main workstation I have quite a few config-marked files under
> /usr originating from the Fedora 41 repository:
> 
> rpm -qac | grep '^/usr' -c
> 39


Those are all packaging bugs, there should be zero of those. It's effectively MUST NOT.

Comment 12 Georg Sauthoff 2025-05-27 22:04:00 UTC
Ok, I've added the ghost file:

Spec URL: https://raw.githubusercontent.com/gsauthof/dracut-sshd-spec/9b06a8249235e7f0b21c5004a58ec4bba21f9346/dracut-sshd.spec
SRPM URL: https://georg.so/pub/dracut-sshd-0.7.0-1.fc41.src.rpm


I guess it depends a bit on your philosophy how you see ghost files.
From my point of view I say: if you added a custom configuration file then you are also responsible to remove it,
when you remove the package.

But I understand how the implicit removal through the ghost mechanism can be seen as a convenience by some users.

Stuff like this still irritates me:

Looks like package installs/installed /etc/dracut-sshd/sshd_config:

rpm -ql dracut-sshd | grep etc
/etc/dracut-sshd
/etc/dracut-sshd/sshd_config

But directory is empty (arguably some more clutter in /etc ...):
find /etc/dracut-sshd -ls
    45717      0 drwxr-xr-x   1 root     root            0 May 27 00:00 /etc/dracut-sshd

While dump also includes it:

rpm -q --dump dracut-sshd | grep etc | column -t
/etc/dracut-sshd              0  1748304000  0000000000000000000000000000000000000000000000000000000000000000  040755   root  root  0  0  0  X
/etc/dracut-sshd/sshd_config  0  1748304000  0000000000000000000000000000000000000000000000000000000000000000  0100644  root  root  1  0  0  X

However, verify says that everything is complete:

$ rpm -q --verify dracut-sshd
$

IOW, I wouldn't mind if rpm would even remove this feature.

Anyhow, I can live with that ghost marking.

---

> Those are all packaging bugs, there should be zero of those. It's effectively MUST NOT.

Ok, then perhaps it makes sense to use 'MUST NOT' language in the fedora packaging guide.
Technically, one could even check for this in bodhi and fail builds when violations are detected; but this feels way too extreme.

Also wouldn't hurt if the guide includes some guidance on ghost files.

Comment 13 Fedora Review Service 2025-05-27 22:07:47 UTC
Created attachment 2091797 [details]
The .spec file difference from Copr build 9077342 to 9093734

Comment 14 Fedora Review Service 2025-05-27 22:07:49 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/9093734
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2363206-dracut-sshd/fedora-rawhide-x86_64/09093734-dracut-sshd/fedora-review/review.txt

Please take a look if any issues were found.


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 15 Neal Gompa 2025-05-28 06:17:37 UTC
Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated



===== MUST items =====

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "*No copyright* GNU General Public
     License, Version 3". 22 files have unknown license. Detailed output of
     licensecheck in /home/ngompa/2363206-dracut-sshd/licensecheck.txt
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 27484 bytes in 3 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: The License field must be a valid SPDX expression.
[x]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: dracut-sshd-0.7.0-1.fc43.noarch.rpm
          dracut-sshd-0.7.0-1.fc43.src.rpm
============================ rpmlint session starts ============================
rpmlint: 2.7.0
configuration:
    /usr/lib/python3.13/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
rpmlintrc: [PosixPath('/tmp/tmp1a8dlcqg')]
checks: 32, packages: 2

dracut-sshd.noarch: W: only-non-binary-in-usr-lib
dracut-sshd.spec: W: no-%check-section
 2 packages and 0 specfiles checked; 0 errors, 2 warnings, 21 filtered, 0 badness; has taken 0.2 s 




Rpmlint (installed packages)
----------------------------
============================ rpmlint session starts ============================
rpmlint: 2.7.0
configuration:
    /usr/lib/python3.13/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 32, packages: 1

dracut-sshd.noarch: W: only-non-binary-in-usr-lib
 1 packages and 0 specfiles checked; 0 errors, 1 warnings, 9 filtered, 0 badness; has taken 0.1 s 



Source checksums
----------------
https://github.com/gsauthof/dracut-sshd/archive/0.7.0/dracut-sshd-0.7.0.tar.gz :
  CHECKSUM(SHA256) this package     : 1dd6daec504ddf0901fc53bdee4877e3489645c63dc486f92cec68c8fd6e83f0
  CHECKSUM(SHA256) upstream package : 1dd6daec504ddf0901fc53bdee4877e3489645c63dc486f92cec68c8fd6e83f0


Requires
--------
dracut-sshd (rpmlib, GLIBC filtered):
    /usr/bin/bash
    config(dracut-sshd)
    dracut
    openssh-server



Provides
--------
dracut-sshd:
    config(dracut-sshd)
    dracut-sshd



Generated by fedora-review 0.10.0 (e79b66b) last change: 2023-07-24
Command line :/usr/bin/fedora-review -b 2363206 -m fedora-rawhide-x86_64
Buildroot used: fedora-rawhide-x86_64
Active plugins: Shell-api, Generic
Disabled plugins: SugarActivity, Perl, Java, Python, Ocaml, R, Haskell, C/C++, PHP, fonts
Disabled flags: EXARCH, EPEL6, EPEL7, DISTTAG, BATCH

Comment 16 Neal Gompa 2025-05-28 06:17:59 UTC
At this point, the package looks good to me, so...

PACKAGE APPROVED.

Comment 17 Fedora Admin user for bugzilla script actions 2025-05-28 21:59:52 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/dracut-sshd


Note You need to log in before you can comment on or make changes to this bug.