Page MenuHomeFreeBSD

OptionalObsoleteFiles: Add etc/zfs/compatibility.d
ClosedPublic

Authored by tembun_bk.ru on Sat, Jan 17, 2:42 PM.
Tags
Referenced Files
Unknown Object (File)
Wed, Feb 4, 8:28 AM
Unknown Object (File)
Wed, Feb 4, 4:47 AM
Unknown Object (File)
Fri, Jan 30, 1:14 AM
Unknown Object (File)
Sun, Jan 25, 1:32 AM
Unknown Object (File)
Wed, Jan 21, 1:16 AM
Unknown Object (File)
Sun, Jan 18, 10:51 PM
Unknown Object (File)
Sun, Jan 18, 9:19 AM
Unknown Object (File)
Sun, Jan 18, 6:33 AM
Subscribers

Details

Summary

If the world is built and installed with WITHOUT_ZFS, then make -DBATCH_DELETE_OLD_FILES delete-old-dirs will give the error:

rmdir: /etc/zfs: Directory not empty

because /etc/zfs/compatibility.d is still there.

I'm not sure if this patch is the correct way to resolve the problem, since in my case /etc/zfs/compatibility.d is an empty directory (and thus can be safely removed with rmdir(1)), but I'm not sure if this will always be the case.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I')l plan on landing this later today if nobody else beats me to it. I don't believe we expect anything on the system to populate it, but failing to remove this part of the tree if the sysadmin has would be the expected behavior IMO -- we do the helpful thing in the common case, and the safe thing otherwise.

tools/build/mk/OptionalObsoleteFiles.inc
9255

This should probably technically be sorted alphabetically (one line up), but I see we did a not-so-great job in some spots.

This revision is now accepted and ready to land.Tue, Feb 3, 11:02 AM

I was looking over this again- I think its' technically incomplete because we're missing its complement over in /usr/share for the system-distributed files: http://people.freebsd.org/~kevans/zfscompat.diff -- I haven't had a chance (machine) to test it, but it'd probably be good to land these together if you can confirm.

I was looking over this again- I think its' technically incomplete because we're missing its complement over in /usr/share for the system-distributed files: http://people.freebsd.org/~kevans/zfscompat.diff -- I haven't had a chance (machine) to test it, but it'd probably be good to land these together if you can confirm.

I tested your patch (added on top of this one) on 16-CURRENT and 15-STABLE, in both cases all the files and directories are found and deleted correctly. Here's the snippet from make -DBATCH_DELETE_OLD_FILES delete-old on 15-STABLE:

/usr/share/zfs/compatibility.d/2018
/usr/share/zfs/compatibility.d/2019
/usr/share/zfs/compatibility.d/2020
/usr/share/zfs/compatibility.d/2021
/usr/share/zfs/compatibility.d/compat-2018
/usr/share/zfs/compatibility.d/compat-2019
/usr/share/zfs/compatibility.d/compat-2020
/usr/share/zfs/compatibility.d/compat-2021
/usr/share/zfs/compatibility.d/freebsd-11.0
/usr/share/zfs/compatibility.d/freebsd-11.1
/usr/share/zfs/compatibility.d/freebsd-11.2
/usr/share/zfs/compatibility.d/freebsd-11.3
/usr/share/zfs/compatibility.d/freebsd-11.4
/usr/share/zfs/compatibility.d/freebsd-12.0
/usr/share/zfs/compatibility.d/freebsd-12.1
/usr/share/zfs/compatibility.d/freebsd-12.2
/usr/share/zfs/compatibility.d/freebsd-12.3
/usr/share/zfs/compatibility.d/freebsd-12.4
/usr/share/zfs/compatibility.d/freenas-11.0
/usr/share/zfs/compatibility.d/freenas-11.1
/usr/share/zfs/compatibility.d/freenas-11.2
/usr/share/zfs/compatibility.d/freenas-11.3
/usr/share/zfs/compatibility.d/freenas-9.10.2
/usr/share/zfs/compatibility.d/grub2
/usr/share/zfs/compatibility.d/openzfs-2.0-freebsd
/usr/share/zfs/compatibility.d/openzfs-2.0-linux
/usr/share/zfs/compatibility.d/openzfs-2.1-freebsd
/usr/share/zfs/compatibility.d/openzfs-2.1-linux
/usr/share/zfs/compatibility.d/openzfs-2.2
/usr/share/zfs/compatibility.d/openzfs-2.2-freebsd
/usr/share/zfs/compatibility.d/openzfs-2.2-linux
/usr/share/zfs/compatibility.d/openzfsonosx-1.7.0
/usr/share/zfs/compatibility.d/openzfsonosx-1.8.1
/usr/share/zfs/compatibility.d/openzfsonosx-1.9.3
/usr/share/zfs/compatibility.d/openzfsonosx-1.9.4
/usr/share/zfs/compatibility.d/truenas-12.0
/usr/share/zfs/compatibility.d/ubuntu-18.04
/usr/share/zfs/compatibility.d/ubuntu-20.04
/usr/share/zfs/compatibility.d/ubuntu-22.04
/usr/share/zfs/compatibility.d/zol-0.6.1
/usr/share/zfs/compatibility.d/zol-0.6.4
/usr/share/zfs/compatibility.d/zol-0.6.5
/usr/share/zfs/compatibility.d/zol-0.7
/usr/share/zfs/compatibility.d/zol-0.8
>>> Old files removed
>>> Removing old directories
/usr/share/zfs/compatibility.d
/usr/share/zfs
...
/etc/zfs/compatibility.d
/etc/zfs

So, if I understand correctly, I should add your patch on top of mine as part of this revision?

Perfect, thanks! I'll just smash them together pre-commit since you've tested the end result.

This revision was automatically updated to reflect the committed changes.