Generate a file+MD5 checksum filesystem manifest from packages?

Marius Gedminas marius at pov.lt
Fri Dec 2 09:17:15 UTC 2011


On Wed, Nov 30, 2011 at 04:06:25PM -0600, Matthew Braun wrote:
> I apologize if I'm posting to the wrong mailing list and I'd be thankful
> for pointers in the right direction, as I am very new to getting under the
> hood of my systems in the way that I'm asking about.
> 
> I want to come up with a programatic way to construct a "reference"
> manifest of a filesystem. In other words, "System Foo has xxxx packages
> installed. For each package installed, "dpkg --contents" each .deb (for
> now, I'm assuming they're cached locally) and list the directories it would
> create as well as the files (conffiles included) it would install or
> generate. For all files, store the MD5 checksums."

You may want to look at debsums (http://packages.ubuntu.com/debsums)

> When all is said and done, I should have a complete directory structure of
> the system with MD5 checksums. But I see two problems:
>      1) It seems like multiple packages may create the same directory (i.e.
> the first one in handles it, the rest just skip over it). This is fine, but
> I could see a case where the permissions might be different. I could, of
> course, just flag it and move on.

This is where I'm a bit fuzzy, but perhaps /var/lib/dpkg/statoverride
has something to do with this?  At least for the very special
files/directories (e.g. suid/sgid).

>       2) MD5 sums for conffiles don't appear to be stored in the
> /var/lib/dpkg/info/*.md5sums files but perhaps can be calculated on the fly.

They're stored in /var/lib/dpkg/status (grep for "Conffiles:").

> So, I was wondering if there were any suggestions for dry-running an entire
> system install (and post install) to get a filesystem list with checksums?

A chroot or a virtual machine might help here.

Marius Gedminas
-- 
"Actually, the Singularity seems rather useful in the entire work avoidance
field. "I _could_ write up that report now but if I put it off, I may well
become a weakly godlike entity, at which point not only will I be able to
type faster but my comments will be more on-target."        - James Nicoll 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20111202/b02eff55/attachment.sig>


More information about the ubuntu-users mailing list