Files
lotherkandClaude Opus 5.5 33dcd9a72b mcde: McdeSys knows the disks, and the permissions the system should have
mcde_sys_disks lists the drives, each with its partitions: size, model,
file system, label, removable, the system's (/, /usr, /var, /home, swap),
where mounted and how full.  NetBSD: hw.disknames, dkctl getgeometry and
listwedges, atactl identify, getmntinfo, swapctl -l; Linux: lsblk -P -b.
mcde_sys_disk_mount (/media/LABEL; Linux through udisksctl),
_unmount, _check (fsck -n) and _erase (root; a drive with a system
partition or a mounted one is refused): NetBSD gpt destroy/create/add,
dkctl makewedges, newfs -O 2 or newfs_msdos -F 32; Linux sfdisk and
mkfs.ext4/vfat.  docs/reference/disks.txt.

mcde_sys_permissions compares owner, group and mode of the system's files
with the specification sysinst keeps for every installed set,
/etc/mtree/set.* (set.makronix too), and repairs them as root (mtree -e
-U).  mtree -k did not stop it from comparing sizes and checksums, so the
specification is narrowed to type, uname, gname, mode and link first.
Linux keeps no such list: not supported there.
docs/reference/permissions.txt.

Measured: on the Linux host the NVMe drive and its three partitions, all
the system's; erasing as a user refused.  In the build VM as root,
listing only: wd0 (QEMU HARDDISK, 68.7 GB) with dk0 on / and dk1 swap, cd0;
verifying the permissions reported 207 differences, all under /usr/pkg,
which that VM built itself instead of unpacking the set.  Nothing was
mounted, erased or repaired.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:12:14 +00:00

72 lines
2.2 KiB
Plaintext

Repair permissions: NetBSD's mtree(8) against the specification of each installed set (/etc/mtree/set.NAME, written by sysinst; set.makronix too). Collected 2026-11-11.
== src/usr.sbin/mtree/mtree.8:152 (-e)
.It Fl e
Don't complain about files that are in the file hierarchy, but not in the
specification.
.
.It Fl F Ar flavor
Set the compatibility flavor of the
.Nm
utility.
The
.Ar flavor
== src/usr.sbin/mtree/mtree.8:180 (-f)
.It Fl f Ar spec
Read the specification from the file
.Ar spec ,
instead of from the standard input.
.Pp
If this option is specified twice, the two specifications are compared
to each other rather than to the file hierarchy.
The specifications will be sorted like output generated using
.Fl c .
The output format in this case is somewhat reminiscent of
== src/usr.sbin/mtree/mtree.8:244 (-k)
.It Fl k Ar keywords
Use the mandatory
.Sy type
keyword plus the specified (whitespace or comma separated)
.Ar keywords
to replace the current set of keywords.
If
.Ql all
is specified, use all of the available keywords.
.
== src/usr.sbin/mtree/mtree.8:322 (-p)
.It Fl p Ar path
Use the file hierarchy rooted in
.Ar path ,
instead of the current directory.
.
.It Fl q
Quiet mode.
Do not complain when a
.Dq missing
directory cannot be created because it already exists.
== src/usr.sbin/mtree/mtree.8:386 (-U)
.It Fl U
Same as
.Fl u
except that a mismatch is not considered to be an error if it was corrected.
.
.It Fl u
Modify the owner, group, permissions, and flags of existing files,
the device type of devices, and symbolic link targets,
to match the specification.
Create any missing directories, devices or symbolic links.
== src/usr.sbin/mtree/mtree.8:391 (-u)
.It Fl u
Modify the owner, group, permissions, and flags of existing files,
the device type of devices, and symbolic link targets,
to match the specification.
Create any missing directories, devices or symbolic links.
User, group, and permissions must all be specified for missing directories
to be created.
Note that unless the
.Fl i
option is given, the schg and sappnd flags will not be set, even if
== a line of /etc/mtree/set.base in the build VM (2026-11-11)
./bin/cat type=file uname=root gname=wheel mode=0555 size=22016 sha256=5cf9...