X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=patch-ker.sh;h=4393e8d01b95cdbe65a4b6d4eb1acb7d330d5497;hp=67e7a519487bcf891520ad9f3911990606245c82;hb=1996f7866c793b99020d2d204d522291609e9fbb;hpb=0333f489a25b05a4c0176258204eee1db9e8c9e0 diff --git a/patch-ker.sh b/patch-ker.sh index 67e7a51..4393e8d 100755 --- a/patch-ker.sh +++ b/patch-ker.sh @@ -12,7 +12,8 @@ # # Patch YAFFS into the kernel # -# args: kpath : Full path to kernel sources to be patched +# args: l/c : link or copy +# kpath : Full path to kernel sources to be patched # # Somewhat "inspired by" the mtd patchin script # @@ -21,15 +22,17 @@ VERSION=0 PATCHLEVEL=0 SUBLEVEL=0 COPYORLINK=$1 -LINUXDIR=$2 +MULTIORSINGLE=$2 +LINUXDIR=$3 # To be a Linux directory, it must have a Makefile # Display usage of this script usage () { - echo "usage: $0 c/l kernelpath" + echo "usage: $0 c/l m/s kernelpath" echo " if c/l is c, then copy. If l then link" + echo " if m/s is m, then use multi version code. If s then use single version code" exit 1 } @@ -49,6 +52,15 @@ else usage; fi +if [ $MULTIORSINGLE = m ]; then + VFSGLUE="yaffs_vfs_multi.c" +elif [ $MULTIORSINGLE = s ]; then + VFSGLUE="yaffs_vfs.c" +else + echo "unknown multi/single version selection" + usage; +fi + # Check if kerneldir contains a Makefile if [ ! -f $LINUXDIR/Makefile ] @@ -111,10 +123,14 @@ YAFFSDIR=$LINUXDIR/fs/yaffs2 if [ -e $YAFFSDIR ] then - echo "$YAFFSDIR exists, not patching" + echo "$YAFFSDIR exists, not patching." + echo "If you want to replace what is already there then delete $YAFFSDIR" + echo " eg. \"rm -rf $YAFFSDIR\" " else mkdir $LINUXDIR/fs/yaffs2 $CPY $PWD/Makefile.kernel $LINUXDIR/fs/yaffs2/Makefile $CPY $PWD/Kconfig $LINUXDIR/fs/yaffs2 $CPY $PWD/*.c $PWD/*.h $LINUXDIR/fs/yaffs2 + rm $LINUXDIR/fs/yaffs2/yaffs_vfs.c $LINUXDIR/fs/yaffs2/yaffs_vfs_multi.c + $CPY $PWD/$VFSGLUE $LINUXDIR/fs/yaffs2/yaffs_vfs_glue.c fi