aboutsummaryrefslogtreecommitdiffstats
path: root/devel/util-linux/files/patch-Makefile.am
diff options
context:
space:
mode:
authorMatthias Andree <mandree@FreeBSD.org>2025-09-30 00:30:47 +0200
committerMatthias Andree <mandree@FreeBSD.org>2025-09-30 01:09:52 +0200
commitfd46b8c7f0d78952a1a60e56aacccbdccdc76dc1 (patch)
tree5d6ec03a43dcfe95376c76a87ced188e99d9a334 /devel/util-linux/files/patch-Makefile.am
parent4aea75ddb74a4dee0c57f43687151ff8a6892cb4 (diff)
filesystems/libblkid: fix odd reads and fdisk
TL;DR: This fixes "invalid argument" in util-linux's fdisk. libblkid assumes buffered block devices, skipping most character devices (unless their name starts with "ubi") and failing because it tries reads that aren't a multiple of the underlying I/O size. Detail: util-linux assumes a Linux-like behavior and naming of devices, and assumes it's looking at buffered block devices, which FreeBSD has not been provided for many major releases. It also requires specific layouts of procfs, sysfs, devfs, which FreeBSD or its Linuxulator does not provide. So we specifically need to patch the read_buffer function to make sure it rounds up its read size to the io_size (often 512) and not attempt to read 36, 256, 548 or other strange sizes and emulate a buffered disk character device; we also need to patch many of the S_ISCHR checks so they accept our character devices. This patching is apparently enough to fix the "invalid argument" (EINVAL, errno==22) errors from the util-linux fdisk tools. This patch set is not complete, but is sufficient to get the util-linux fdisk/cfdisk/sfdisk back up to their feet so we can nuke the dangerous linuxfdisk port now and for good. Note that many uses will require sysctl to allow foot-shooting by setting kern.geom.debugflags=16. blkid can not yet enumerate disk character devices if run without argument. Approved by: portmgr@ (blanket just-fix it) Could the port maintainer please check with the upstream what their stance on supporting non-GNU userspaces and non-Linux kernels is? Can we work with them to get such fixes upstreamed or will they turn us down because the tools are specifically called "util-linux"?
Diffstat (limited to 'devel/util-linux/files/patch-Makefile.am')
0 files changed, 0 insertions, 0 deletions