18 while [ ${#*} -gt 1 ]; do
29 die "unknown argument $1"
36 [ -z "$TREE" -o -z "$SERIES" ] && die "I need a tree and series:\n\t$0 -t kernel_dir -s series_name"
37 [ ! -d $TREE ] && die "kernel tree '$TREE' isn't a directory"
38 SERIES=$(basename $SERIES)
39 [ ! -f $MYDIR/series/$SERIES ] && die "no series file '$SERIES'"
44 # patch scripts wants a relative path from the linux tree to
47 MY=$(echo $MYDIR | sed -e 's_^/__')
48 TR=$(echo $TREE | sed -e 's_^/__')
51 M=$(echo $MY | cut -d/ -f 1)
52 T=$(echo $TR | cut -d/ -f 1)
58 MY=$(echo $MY | cut -d/ -f 2-)
59 TR=$(echo $TR | cut -d/ -f 2-)
62 [ $MY == $MYDIR ] && die "bad! $MY == $MYDIR"
64 REVERSE=$(revpath $TR)${MY}
65 ABSINO=$(stat $MYDIR | awk '($3 == "Inode:") {print $4}')
66 REVINO=`(cd $TREE ; stat $REVERSE | awk '($3 == "Inode:") {print $4}')`
68 [ $ABSINO != $REVINO ] && die "inodes differ, my reverse path is bad?"
70 echo export PATCHSCRIPTS_LIBDIR=$REVERSE
73 ln -sf $REVERSE/series/$SERIES series
75 PATH_ELEMENTS=$(echo $PATH | sed -e 's/:/ /g')
77 NEW_PATH=$MYDIR/scripts
79 for p in $PATH_ELEMENTS; do
80 if echo $p | grep kernel_patches/scripts > /dev/null 2>&1 ; then
83 NEW_PATH="$NEW_PATH:$p"
86 echo export PATH=$NEW_PATH
88 echo "'$TREE' successfully setup" >&2