#!/bin/sh # # nodumprpm - Mark all nonconfig files in an rpm with ext2 "nodump" # flag, since they're recoverable from the rpm file. # # # Usage: # nodumprpm MODULE # - Mark all nonconfig files in MODULE (an installed module). # nodumprpm -p FILE # - Mark all nonconfig files in FILE (a .rpm file). # nodumprpm -a # - Mark all nonconfig files in all installed modules. # # Note: # If a full restore is needed, you need some way to determine which # packages need reloading. trap "rm /tmp/nodumprpm.$$ /tmp/nodumprpm.config.$$" EXIT # We must remove directories, since +d for a directory is inherited by files # created in the future rpm -ql $* \ | xargs ls -ld \ | grep -v '^d' \ | sed -e 's=^[^/]*==' -e 's/ -> .*//' \ | cat >/tmp/nodumprpm.$$ rpm -qc $* | sort -o /tmp/nodumprpm.config.$$ comm -23 /tmp/nodumprpm.$$ /tmp/nodumprpm.config.$$ \ | xargs chattr +d