installed ports library audit?
Gary Aitken
freebsd at dreamchaser.org
Mon Mar 1 16:18:20 UTC 2021
On 3/1/21 8:38 AM, Matthew Seaman wrote:
> On 01/03/2021 15:36, Matthew Seaman wrote:
>> On 01/03/2021 03:43, Gary Aitken wrote:
>>> I just mostly recovered from a system crash where /usr was corrupted and
>>> had to be recovered using fsck; couldn't completely recover using the
>>> journal.
>>>
>>> I suspect the trashed files are in one of a few libraries. I'm wondering
>>> if there's an easy way to audit all files installed by given ports,
>>> i.e. do an sha256 or something like that on each and compare with the known
>>> good if it's available somewhere?
...
> Dammit. `pkg check -s -x .`
>
> `-r` is exactly what you don't want, as that will make pkg(8) believe the corrupted files are actually correct.
uh-oh.
The problem appeared to be in a linux compat lib:
linux-c7-libaio-0.3.109: checksum mismatch for /compat/linux/usr/lib/libaio.so.1
linux-c7-libaio-0.3.109: checksum mismatch for /compat/linux/usr/lib64/libaio.so.1
But de-installing didn't work.
This may be (can't remember) if it was installed as part of the base system
install? Is there a way to run bsdinstall and retrieve what options were
set? I didn't see anything in the man page.
# pkg delete -f linux-c7-libaio
...
Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling linux-c7-libaio-0.3.109...
[1/1] Deleting files for linux-c7-libaio-0.3.109: 100%
ELF binary type "3" not known.
/bin/sh: /compat/linux/sbin/ldconfig: Exec format error
pkg: POST-DEINSTALL script failed
Gary
More information about the freebsd-questions
mailing list