Commit Graph

193 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
898835da98 Create rpm Requires generator
The generator will generate a Requires on filesystem(unmerged-sbin-symlinks),
i.e. effectively on a new-enough version of _this_ package. This is needed to
solve the following problem:

  as packages are rebuilt in a merged-sbin environment, their payload paths
  change from /usr/sbin to /usr/bin. In all the cases where there were other
  packages that dependended on the old paths via explicit Requires, compat
  Provides on the old path was added along with
  Requires:filesystem(unmerged-sbin-symlinks). This means that those packages
  will not be installed with an older filesystem.rpm. But for packages that
  didn't need this special treatment, no dependency is generated. When they
  are installed into an upgraded environment which still has split-sbin and
  has an older copy of filesystem, the file is moved without the compat
  symlink being created. Thus, any scripts, or systemd service files, etc.,
  referring to the old path are now broken. We need to require a new-enough
  filesystem.rpm to be installed so avoid breakage on such partially upgraded
  systems.
2024-09-10 18:07:19 +02:00
Zbigniew Jędrzejewski-Szmek
644bd3496d Add virtual Provides:filesystem(merged-sbin)
This is borne out of the discussion in
https://gitlab.com/fedora/bootc/tracker/-/issues/29. The general
idea is that the ostree builds would set up the fs structure properly
but need a clear indicator of what is desired. This is better than
hardcoding a version comparison.
2024-07-23 10:01:22 +00:00
Martin Osvald
d5a963934a Add ownership of /etc/default
Ref: https://issues.redhat.com/browse/RHEL-35327
2024-07-23 09:59:53 +00:00
Zbigniew Jędrzejewski-Szmek
c874ad66ba Disable sbin-merge changes
%bcond merged_sbin is added, with a default of 0.

With the default state, the spec file should behave identically to the version
before any changes related to the sbin merge we started. (In the pretrans
scriptlet, the order of mkdirs is different, but that shouldn't matter.)
2024-07-17 09:29:50 +02:00
Zbigniew Jędrzejewski-Szmek
9a7998077e Restore /usr/local/bin directory
It was ommitted by mistake in fd11b5b9be.
2024-07-17 09:03:17 +02:00
Zbigniew Jędrzejewski-Szmek
99c0e57347 Move sbin filenames out to a file
This should result in no change to behaviour. It's easier to update
the list or change it in the future.
2024-07-13 18:23:22 +02:00
Zbigniew Jędrzejewski-Szmek
071b336a75 Create compat symlinks for more files
This time, I used "dnf5 repoquery -l '*' | grep '/sbin'" to generate the list
of names. I hope the list is complete now. The list is sorted using
"sorted(…, key=lambda x: x.lower())" in Python.
2024-07-13 08:51:02 +02:00
Zbigniew Jędrzejewski-Szmek
6e21007605 Also create compat symlink for rndc-confgen
Not sure why I missed that file previously. Not a good sign.
2024-07-11 11:45:34 +02:00
Zbigniew Jędrzejewski-Szmek
c6b64acaef Symlink /usr/sbin to /usr/bin if possible
/usr/local/sbin is also symlinked to /usr/local/bin if possible.

'return 0' is dropped because that causes issues with rpm:
https://github.com/rpm-software-management/rpm/issues/3029
2024-07-09 12:10:15 +02:00
Zbigniew Jędrzejewski-Szmek
8681f7a4f3 Symlink bin filenames to sbin for compatibility
When packages are rebuilt in a merged buildroot and their contents migrate
from /usr/sbin to /usr/bin, we want to provide compat symlinks so that the old
names still work.

This scriptlet covers all packages that have files in /usr/sbin in F40. We
have just one scriptlet in filesystem because that's easier than having
separate scriptlets in each package.

When the package for which we created a symlink is removed, we remove the
symlink.

The list of filenames was initially created using 'dnf repoquery', but it
seems that this is unreliable. Additional files were generated using:
  (ls -1 /usr/sbin/|sort -g|sed 's/.*/  "\0",/'; sed -n -e '/^  "acme/,/^  "zramctl"/p' <filesystem.spec)|sort|uniq|xsel

We need to also trigger on /sbin, because some packages have files in /sbin
(not just /usr/sbin). In particular, this affects glibc, which (still) has
/sbin/ldconfig.
2024-06-19 11:02:42 +02:00
Zbigniew Jędrzejewski-Szmek
fd11b5b9be Merge /usr/sbin and /usr/bin
https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin

/usr/sbin is now created via a scriptlet. In a pristine installation, we'll end
up with merged sbin. On upgrades, symlink creation will fail and the existing
/usr/sbin directory will remain.

The updated package means that if we build packages, they'll see merged sbin in
the filesystem. If additionally rpm defines %{_sbindir} as /usr/sbin, those
packages will get files in the merged location. A separate pull request will be
filed for rpm.

For building rpms, the change in rpm is more important, because what really
matters is the path specified in %files, so even if the buildroot has
merged-sbin, if %_sbindir says otherwise, package will use the unmerged path.
For installation on disk, the change here is more important, because even if
packages specify unmerged paths, if the directory on disk is a symlink, that
symlink will be followed, so the installation will end up with merged sbin.

We want to build packages in a chroot where /usr/sbin is a symlink to /usr/bin,
so that packages get files in the merged location. But on user systems,
especially when the transition is in progress, we will have packages with files
in /usr/sbin, so we accept that /usr/sbin in a separate directory.
2024-06-19 11:02:12 +02:00
Zbigniew Jędrzejewski-Szmek
e50217a268 Fix build with rpm-4.20 2024-06-19 10:56:10 +02:00
Zbigniew Jędrzejewski-Szmek
0eed9f616a Convert to %autorelease and %autochangelog
[skip changelog]
2024-06-19 10:55:55 +02:00
Orion Poplawski
5cbb39caaa Add /usr/share/modulefiles for environment modules 2024-04-10 19:16:02 -06:00
Fedora Release Engineering
63c7510dc1 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-24 11:33:52 +00:00
Fedora Release Engineering
7abdc06879 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 19:18:43 +00:00
Peter Robinson
02f4c34c92 Add /etc/keys for initrd/kernel related keys 2023-07-21 16:24:58 +01:00
Fedora Release Engineering
18c72e9ad1 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 19:41:36 +00:00
Than Ngo
621cdd1fba migrated to SPDX license 2023-02-21 18:23:52 +01:00
Fedora Release Engineering
42708aab28 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 03:26:11 +00:00
Martin Osvald
50fad43210 Filesystem has a dependency on /bin/sh (rhbz#1306489)
Fix wrong usage of posix.exec() and replace it with rpm.execute():

https://bugzilla.redhat.com/show_bug.cgi?id=1306489#c20
2022-08-09 15:22:29 +02:00
Martin Osvald
47d37ac941 Several distinct fixes
Filesystem has a dependency on /bin/sh (#1306489)
Add /usr/share/X11/fonts/ to default filesystem (#2107447)
Remove obsolete and forbidden Group tag
Own zsh and fish completions directories (rhbz#1312594)
Improve directory creation to avoid 'Argument list too long' error
2022-08-03 14:59:32 +02:00
Fedora Release Engineering
6e008c5d67 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 03:10:03 +00:00
Petr Menšík
7d4445fdaf Include systemd libraries for text file units
Many packages needs to put single *.service file or similar into those
directories, but otherwise does not need to depend on systemd. It would
leave those directories unowned. Avoid owning that directories by every
package.
2022-07-08 18:44:51 +02:00
Fedora Release Engineering
9da9faf49c - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 02:59:57 +00:00
Ondřej Vašík
287795dce0 Move /afs into main package, /proc and /sys now ghosted to make rootless container updatable 2021-09-22 11:44:27 +02:00
Fedora Release Engineering
565f46d224 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 22:57:39 +00:00
Pavel Zhukov
c5bdcc96b6 Do not add /afs into content subpackage 2021-07-07 11:50:34 +02:00
Fedora Release Engineering
6c02aa542b - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 05:32:03 +00:00
Pavel Raiskup
bceee1afe1 Make the /proc and /sys %ghost
When working in rootless container environment with user namespaces,
those directories are pre-populated by the container runtime as
bind-mounts from host.

Such bind-mounts though naturally inherit ownership/permissions from the
host's filesystem.rpm, and non-privileged "root" inside container can
not be allowed to touch files owned by host's UID=0.  Those directories
are then shown as owned by 'nobody:nobody'.

When filesystem.rpm holds those /proc and /sys in payload, rpm tries to
re-chown the file to root:root on every package update transaction.
This operation can not succeed because 'root:root' inside container maps
to some large UID/GID on host -- and so the RPM transaction fails.

As a workaround (there's no better way currently), remove /proc and /sys
from the packaged payload, mark those directories %ghost and create them
by scriptlet.

Resolves: rhbz#1548403
Version: 3.14-4
2020-08-10 07:55:50 +02:00
Fedora Release Engineering
b42fd207a1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 17:26:38 +00:00
Fedora Release Engineering
599c7663a9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-28 18:29:06 +00:00
Ondřej Vašík
ac9076608a do not restore context of /proc (#1722766) 2020-01-27 14:43:28 +01:00
Ondřej Vašík
6c94d78747 add ownership for eBPF bytecode files directories (#1781646) 2019-12-18 15:23:15 +01:00
Fedora Release Engineering
339ac8220c - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 00:33:33 +00:00
Ondřej Vašík
1afd3978f1 add new -afs supbackage for /afs directory (#FPC888,#1720232) 2019-06-20 15:54:13 +02:00
Ondřej Vašík
81449f5597 drop ownership for /usr/lib/sse2 (#1702329) 2019-04-29 14:48:25 +02:00
Ondřej Vašík
67576980c3 drop ownership for /etc/xinet.d (#1691146)drop ownership for %{_libdir}/tls, %{_libdir}/sse2 (#1702329) 2019-04-29 14:35:50 +02:00
Ondřej Vašík
af80b8db13 drop legacy /var/gopher (#1667231) 2019-02-11 14:35:22 +01:00
Fedora Release Engineering
49d82782da - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-01-31 19:42:08 +00:00
Igor Gnatenko
3b1809e40d Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:02 +01:00
Fedora Release Engineering
1a81a2b1b4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 00:33:41 +00:00
Ondřej Vašík
d7f1e0d076 add ownership of /etc/rwtab.d and /etc/statetab.d 2018-06-21 15:35:35 +02:00
Adam Jackson
89870bc4b8 own /etc/X11/xinit/{,{xinitrc,xinput}.d} 2018-02-20 12:25:24 -05:00
Igor Gnatenko
f04d7bf69f
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 07:12:43 +01:00
Fedora Release Engineering
9b405ab4d3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-07 09:38:45 +00:00
Ondřej Vašík
9c0a2199f2 drop the ownership of ghostscript dirs (#1533992) 2018-01-13 18:28:55 +01:00
David Kaspar [Dee'Kej]
c7f8e6ee7b Remove /usr/share/ghostscript/ & /usr/share/ghostscript/conf.d/ folders
The former is owned by ghostscript itself, and the latter is no longer
  needed in Fedora. All packages depending on the conf.d/ folder will be
  retired or dropped, starting with Fedora 28...
2018-01-12 18:27:45 +01:00
Ondřej Vašík
a9d98a7b5e own /usr/share/locale and /usr/lib/modules, improve filesystem content file to include symlinks and rootdir 2017-12-14 18:11:53 +01:00
Colin Walters
0028572766 Add /usr/lib/sysimage
This came out of upstream rpm-ecosystem discussion:
http://lists.rpm.org/pipermail/rpm-maint/2017-October/006681.html

While I'm not aware of anyone starting the push to move the rpmdb
in Fedora yet, I do plan to change rpm-ostree soon to use
`/usr/lib/sysimage/rpm-ostree-base-db` or so for its "base" rpmdb,
as distinct from the final one.
2017-12-12 09:41:33 -05:00