From owner-freebsd-questions@freebsd.org Mon Mar 1 16:18:20 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 996B756307C for ; Mon, 1 Mar 2021 16:18:20 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from nightmare.dreamchaser.org (ns.dreamchaser.org [66.109.141.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dreamchaser.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dq5642k7kz4sxP; Mon, 1 Mar 2021 16:18:20 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from breakaway.dreamchaser.org (breakaway [192.168.151.122]) by nightmare.dreamchaser.org (8.15.2/8.15.2) with ESMTP id 121GIIL9073181; Mon, 1 Mar 2021 09:18:18 -0700 (MST) (envelope-from freebsd@dreamchaser.org) Reply-To: freebsd@dreamchaser.org Subject: Re: installed ports library audit? To: Matthew Seaman , FreeBSD Mailing List References: <97db8511-c5e0-26cc-5e56-4dfa976d7d12@FreeBSD.org> <0935eab6-d458-2c3e-3f8a-a6879fe27363@FreeBSD.org> From: Gary Aitken Message-ID: Date: Mon, 1 Mar 2021 09:13:10 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <0935eab6-d458-2c3e-3f8a-a6879fe27363@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (nightmare.dreamchaser.org [192.168.151.101]); Mon, 01 Mar 2021 09:18:18 -0700 (MST) X-Rspamd-Queue-Id: 4Dq5642k7kz4sxP X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 16:18:20 -0000 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