#!/bin/sh

dir=$1
kernel_files=$2

files=`tar tf $kernel_files | tr '\n' ' '`

if [ $? != 0 ]; then
	echo "$kernel_files cannot be untarred."
	exit 1
fi

outfile="$dir/mos_uninstall.log"
rm -f "$outfile"
touch "$outfile"

for i in $files
do
	echo "$i" >> "$outfile"
	[ ! -f "$i" ] && continue
	[ -f "$i.pre_mosix" ] && continue
	cp "$i" "$i.pre_mosix"
done
