diff --git a/yocto-poky/scripts/combo-layer b/yocto-poky/scripts/combo-layer
index 7435a17..9127041 100755
--- a/yocto-poky/scripts/combo-layer
+++ b/yocto-poky/scripts/combo-layer
@@ -73,7 +73,7 @@
                 else:
                     # Apply special type transformations for some properties.
                     # Type matches the RawConfigParser.get*() methods.
-                    types = {'signoff': 'boolean'}
+                    types = {'signoff': 'boolean', 'update': 'boolean'}
                     if name in types:
                         value = getattr(parser, 'get' + types[name])(section, name)
                     self.repos[repo][name] = value
@@ -380,7 +380,7 @@
                             if not parent:
                                 parent = '.'
                             # May run outside of the current directory, so do not assume that .git exists.
-                            filter_branch.extend(['--tree-filter', 'mkdir -p .git/tmptree && mv $(ls -1 -a | grep -v -e ^.git$ -e ^.$ -e ^..$) .git/tmptree && mkdir -p %s && mv .git/tmptree %s' % (parent, dest_dir)])
+                            filter_branch.extend(['--tree-filter', 'mkdir -p .git/tmptree && find . -mindepth 1 -maxdepth 1 ! -name .git -print0 | xargs -0 -I SOURCE mv SOURCE .git/tmptree && mkdir -p %s && mv .git/tmptree %s' % (parent, dest_dir)])
                         filter_branch.append('HEAD')
                         runcmd(filter_branch)
                         runcmd('git update-ref -d refs/original/refs/heads/%s' % name)
@@ -567,7 +567,7 @@
             sys.exit(1)
 
     if not repos:
-        repos = conf.repos
+        repos = [ repo for repo in conf.repos if conf.repos[repo].get("update", True) ]
 
     return repos
 
@@ -662,7 +662,14 @@
             patch_cmd_range = "%s..%s" % (repo['last_revision'], top_revision)
             rev_cmd_range = patch_cmd_range
 
-        file_filter = repo.get('file_filter',"")
+        file_filter = repo.get('file_filter',".")
+
+        # Filter out unwanted files
+        exclude = repo.get('file_exclude', '')
+        if exclude:
+            for path in exclude.split():
+                p = "%s/%s" % (dest_dir, path) if dest_dir != '.' else path
+                file_filter += " ':!%s'" % p
 
         patch_cmd = "git format-patch -N %s --output-directory %s %s -- %s" % \
             (prefix,repo_patch_dir, patch_cmd_range, file_filter)
@@ -681,38 +688,6 @@
                 runcmd("%s %s %s %s" % (repo['hook'], patch, revlist[count], name))
                 count=count-1
 
-        # Step 3a: Filter out unwanted files and patches.
-        exclude = repo.get('file_exclude', '')
-        if exclude:
-            filter = ['filterdiff', '-p1']
-            for path in exclude.split():
-                filter.append('-x')
-                filter.append('%s/%s' % (dest_dir, path) if dest_dir != '.' else path)
-            for patch in patchlist[:]:
-                filtered = patch + '.tmp'
-                with open(filtered, 'w') as f:
-                    runcmd(filter + [patch], out=f)
-                # Now check for empty patches.
-                if runcmd(['filterdiff', '--list', filtered]):
-                    # Possibly modified.
-                    os.unlink(patch)
-                    os.rename(filtered, patch)
-                else:
-                    # Empty, ignore it. Must also remove from revlist.
-                    with open(patch, 'r') as f:
-                        fromline = f.readline()
-                    if not fromline:
-                        # Patch must have been empty to start with. No need
-                        # to remove it.
-                        continue
-                    m = re.match(r'''^From ([0-9a-fA-F]+) .*\n''', fromline)
-                    rev = m.group(1)
-                    logger.debug('skipping empty patch %s = %s' % (patch, rev))
-                    os.unlink(patch)
-                    os.unlink(filtered)
-                    patchlist.remove(patch)
-                    revlist.remove(rev)
-
         # Step 4: write patch list and revision list to file, for user to edit later
         patchlist_file = os.path.join(os.getcwd(), patch_dir, "patchlist-%s" % name)
         repo['patchlist'] = patchlist_file
@@ -945,5 +920,5 @@
     except Exception:
         ret = 1
         import traceback
-        traceback.print_exc(5)
+        traceback.print_exc()
     sys.exit(ret)
