All pastes #1016972 Raw Edit

kextcompare

public text v1 · immutable
#1016972 ·published 2008-05-13 15:54 UTC
rendered paste body
#!/bin/bash

#
# kextcompare
#
# Compares Kernel Extensions in two Extension dirs
# Compares only the binary, not the plists etc.
#
# Written 20080513 by Crazor
#

# Change this
KEXTDIR1="/System/Library/Extensions"
KEXTDIR2="/Volumes/Mac OS X Install DVD/System/Library/Extensions"

# Probably change as needed
KEXTLIST1=/tmp/kextlist1
KEXTLIST2=/tmp/kextlist2

### do not change below ###

# Note that grep "MacOS/" is not perfect for matching the binaries, should have used a test, but this would destroy the beauty of pipes. So ignore errors
cd "${KEXTDIR1}"
find .| grep "MacOS/" | xargs -I X md5 "X" | sed 's/(//g' | sed 's/)//g' | awk '{printf "%s %s\n", $2, $4}' | sed 's$[a-zA-Z0-9._]*/$$g' | sort > ${KEXTLIST1}
echo "${KEXTDIR1}" >> ${KEXTLIST1}

cd "${KEXTDIR2}"
find .| grep "MacOS/" | xargs -I X md5 "X" | sed 's/(//g' | sed 's/)//g' | awk '{printf "%s %s\n", $2, $4}' | sed 's$[a-zA-Z0-9._]*/$$g' | sort > ${KEXTLIST2} 
echo "${KEXTDIR2}" >> ${KEXTLIST2}


diff -y --suppress-common-lines ${KEXTLIST1} ${KEXTLIST2}

rm "${KEXTLIST1}" "${KEXTLIST2}"