diff options
author | Maxim Grigoriev <maxim2405@gmail.com> | 2009-07-24 02:31:34 +0200 |
---|---|---|
committer | Peter Korsgaard <jacmet@sunsite.dk> | 2009-07-24 02:31:34 +0200 |
commit | ebb049593653f51475ca255445058a70a373fb62 (patch) | |
tree | 170ba1d5555d7f296e98fa4e40ee62d3eb36136d /toolchain | |
parent | 58050c286baebf14fa59d6ad90b61a594c57f9fd (diff) |
toolchain/patch-kernel.sh: xtensa directory overlay support
Part of #163.
Signed-off-by: Maxim Grigoriev <maxim2405@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'toolchain')
-rwxr-xr-x | toolchain/patch-kernel.sh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/toolchain/patch-kernel.sh b/toolchain/patch-kernel.sh index e2e89486d..76cb9f753 100755 --- a/toolchain/patch-kernel.sh +++ b/toolchain/patch-kernel.sh @@ -21,7 +21,14 @@ if [ ! -d "${patchdir}" ] ; then fi for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do - case "$i" in + apply="patch -p1 -E -d" + uncomp_parm="" + if [ -d "${patchdir}/$i" ] ; then + type="directory overlay" + uncomp="tar cf - --exclude=.svn --no-anchored -C" + uncomp_parm="." + apply="tar xvf - -C" + else case "$i" in *.gz) type="gzip"; uncomp="gunzip -dc"; ;; *.bz) @@ -32,13 +39,17 @@ for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do type="zip"; uncomp="unzip -d"; ;; *.Z) type="compress"; uncomp="uncompress -c"; ;; + *.tgz) + type="tar gzip"; uncomp="gunzip -dc"; apply="tar xvf - -C"; ;; + *.tar) + type="tar"; uncomp="cat"; apply="tar xvf - -C"; ;; *) type="plaintext"; uncomp="cat"; ;; - esac + esac fi echo "" echo "Applying ${i} using ${type}: " echo ${i} | cat >> ${targetdir}/.applied_patches_list - ${uncomp} ${patchdir}/${i} | patch -p1 -E -d ${targetdir} + ${uncomp} ${patchdir}/${i} ${uncomp_parm} | ${apply} ${targetdir} if [ $? != 0 ] ; then echo "Patch failed! Please fix $i!" exit 1 |