Add "Recommends: kmod(pcspkr.ko)"

We "recommend" the kernel driver and do not "require" it in order to
not break cases where beep is installed on systems other than
bare-metal PC hardware such as containers.

This assumes the people using the "beep" package can deal with a
"beep" invocation not producing a beep on those other systems.

The alternative would be to "require" the kernel driver which would
mean that you could not install beep inside a container, even if
that container is run in a priviledged way with access to the host's
pcspkr.ko.

While the kernel supports more speaker drivers, the only hardware
platforms with a speaker driver supported by Fedora use pcspkr.ko
(PCSPKR_PLATFORM in the kernel config).

Slightly (but not quite) similar packages would be floppy-support
and joystick-support which both "require" their respective kernel
drivers, but they make less sense inside containers.
This commit is contained in:
Hans Ulrich Niedermann 2021-03-25 00:43:55 +01:00
commit 2b9e64956b
3 changed files with 44 additions and 6 deletions

View file

@ -10,10 +10,15 @@ Content
1. Load the `pkspkr.ko` Kernel Driver Module (required)
-------------------------------------------------------
To have a working PC speaker beep on Fedora >= 12, you must load the
kernel driver module `pcspkr.ko` first.
To have a working PC speaker beep, the kernel driver module
`pcspkr.ko` must be loaded.
You can do this manually as root as follows:
On Fedora >= 32, you need to install the `kernel-modules-extra`
package first which contains the `pcspkr.ko` kernel driver module.
On Fedora >= 12, you need to explicitly make the kernel load the
driver module `pcspkr.ko`. You can do this manually as root as
follows:
[root@host ~]# modprobe pcspkr

View file

@ -1,7 +1,7 @@
Summary: Beep the PC speaker any number of ways
Name: beep
Version: 1.4.7
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv2+
URL: https://github.com/spkr-beep/beep/
@ -28,6 +28,23 @@ BuildRequires: glibc-kernheaders
BuildRequires: systemd
BuildRequires: make
# We "recommend" the kernel driver and do not "require" it in order to
# not break cases where beep is installed on systems other than
# bare-metal PC hardware such as containers.
#
# This assumes the people using the "beep" package can deal with a
# "beep" invocation not producing a beep on those other systems.
#
# The alternative would be to "require" the kernel driver which would
# mean that you could not install beep inside a container, even if
# that container is run in a priviledged way with access to the host's
# pcspkr.ko.
#
# While the kernel supports more speaker drivers, the only hardware
# platforms with a speaker driver supported by Fedora use pcspkr.ko
# (PCSPKR_PLATFORM in the kernel config).
Recommends: kmod(pcspkr.ko)
Requires(pre): shadow-utils
# /etc/modprobe.d/
@ -89,6 +106,9 @@ exit 0
%changelog
* Wed Mar 24 2021 Hans Ulrich Niedermann <hun@n-dimensional.de> - 1.4.7-5
- Add "Recommends: kmod(pcspkr.ko)" to install the driver if available (#1942670)
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

View file

@ -1,3 +1,16 @@
# Uncomment the following line to have the pcspkr.ko driver
# load automatically on boot
# Uncomment the alias line to have the pcspkr.ko driver load
# automatically on boot.
#
# The pcspkr.ko driver module is shipped in the kernel-modules-extra
# RPM package has probably been installed by default if it is
# possible, but you still might need to install it.
#
# Note that the kernel-modules-extra package and the pcspkr.ko module
# might not be available inside a container, while the hosts's actual
# pcspkr.ko API might or might not be available inside the container.
#
# So inside a container, the "beep" command might or might not produce
# sound depending on things entirely outside of the control of "beep"
# or even the container.
#
# alias platform:pcspkr pcspkr