#!/bin/bash # A simple script to make patching a single file easier # $1: kernel version # $2: tag for patch # $3: directory # $4: filename set -x if [ -d linux-$1-$2 ] then echo "Target exists" exit fi newtree linux-$1 linux-$1-$2 cd linux-$1-$2/$3 rm $4 cp /usr/src/linux-$1/$3/$4 . emacs $4 cd /usr/src makepatch linux-$1 linux-$1-$2 > /home/httpd/html/linux/patches/$1/$2