3 # Run this script after a package install and pre uninstall
6 echo "Usage: $0 <root_dir> <create|remove>"
10 if [ $# -ne 2 ]; then usage; fi
11 if [ ! -d $1 ]; then usage; fi
13 NAME=$(basename "$0" .sh)
15 FILELIST="$(dirname $ROOT_DIR)/$NAME.filelist"
18 EXCLUDE="\(share\|include\|src\)"
20 # Create filelist for Intel(R) Xeon Phi(TM) infrastructure
21 for i in $(rpm -ql $NAME | grep $ROOT_DIR | grep -v $EXCLUDE); do
22 find $ROOT_DIR -path $i -type f -printf "file /%P $(basename $ROOT_DIR)/%P %#m 0 0\n"
24 while [ "$dir" != "$ROOT_DIR" ]; do
25 echo "dir $dir 0755 0 0" | sed -e "s#$ROOT_DIR##"
28 # Link scripts for autorun after boot (NOT READY YET)
29 #if [ -n "$(echo $i | grep '/init.d/')" ]; then
30 # echo "slink /etc/rc3.d/S31$(basename $i) ../init.d/$(basename $i) 0755 0 0"
32 done | sort -u > $FILELIST
34 mkdir -p /etc/sysconfig/mic/conf.d
35 echo "Overlay $(dirname $ROOT_DIR) $FILELIST" > /etc/sysconfig/mic/conf.d/$NAME.conf
39 rm -f /etc/sysconfig/mic/conf.d/$NAME.conf