From 71edbe5cdaf1516f070cf6c0910910b3240b0bf5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 29 Jan 2015 11:35:16 -0700 Subject: buildman: Fix incorrect arguemnt in GetUpstream() This causes an error when trying to build a local branch which has a local branch as its upstream. Signed-off-by: Simon Glass Reported-by: Masahiro Yamada diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index c593070..4c2c35b 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -129,7 +129,7 @@ def GetUpstream(git_dir, branch): return upstream, msg if remote == '.': - return merge + return merge, None elif remote and merge: leaf = merge.split('/')[-1] return '%s/%s' % (remote, leaf), None -- cgit v0.10.2 From 8895b3e16c7a2aab4275d52be19e485605dc5c7b Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 29 Jan 2015 11:35:17 -0700 Subject: patman: Read in the git-mailrc alias file We should read this file to obtain a set of aliases. This reduces the need to create them in the ~/.patman file. This feature did exist in some version of patman, and is mentioned in the help but it did not find its way upstream. Reported-by: Graeme Russ Signed-off-by: Simon Glass diff --git a/tools/patman/settings.py b/tools/patman/settings.py index 122e8fd..ba2a68f 100644 --- a/tools/patman/settings.py +++ b/tools/patman/settings.py @@ -235,6 +235,31 @@ def _UpdateDefaults(parser, config): else: print "WARNING: Unknown setting %s" % name +def _ReadAliasFile(fname): + """Read in the U-Boot git alias file if it exists. + + Args: + fname: Filename to read. + """ + if os.path.exists(fname): + bad_line = None + with open(fname) as fd: + linenum = 0 + for line in fd: + linenum += 1 + line = line.strip() + if not line or line.startswith('#'): + continue + words = line.split(' ', 2) + if len(words) < 3 or words[0] != 'alias': + if not bad_line: + bad_line = "%s:%d:Invalid line '%s'" % (fname, linenum, + line) + continue + alias[words[1]] = [s.strip() for s in words[2].split(',')] + if bad_line: + print bad_line + def Setup(parser, project_name, config_fname=''): """Set up the settings module by reading config files. @@ -244,6 +269,8 @@ def Setup(parser, project_name, config_fname=''): for sections named "project_section" as well. config_fname: Config filename to read ('' for default) """ + # First read the git alias file if available + _ReadAliasFile('doc/git-mailrc') config = _ProjectConfigParser(project_name) if config_fname == '': config_fname = '%s/.patman' % os.getenv('HOME') -- cgit v0.10.2 From d908898333b22fb2345a7a165ff837fa6b947b0b Mon Sep 17 00:00:00 2001 From: Albert ARIBAUD Date: Sun, 1 Feb 2015 00:12:44 +0100 Subject: buildman: allow multiple toolchains in a single path When buildman scans a toolchain path, it stops at the first toolchain found. However, a single path can contains several toolchains, each with its own prefix. This patch lets buildman scan all toolchains in the path. Signed-off-by: Albert ARIBAUD Acked-by: Simon Glass diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index d4c5d4a..537797a 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -197,13 +197,14 @@ class Toolchains: Returns: Filename of C compiler if found, else None """ + fnames = [] for subdir in ['.', 'bin', 'usr/bin']: dirname = os.path.join(path, subdir) if verbose: print " - looking in '%s'" % dirname for fname in glob.glob(dirname + '/*gcc'): if verbose: print " - found '%s'" % fname - return fname - return None + fnames.append(fname) + return fnames def Scan(self, verbose): @@ -219,8 +220,8 @@ class Toolchains: if verbose: print 'Scanning for tool chains' for path in self.paths: if verbose: print " - scanning path '%s'" % path - fname = self.ScanPath(path, verbose) - if fname: + fnames = self.ScanPath(path, verbose) + for fname in fnames: self.Add(fname, True, verbose) def List(self): -- cgit v0.10.2 From 88539e4431cd6a596da316f81b644c4df606dbd9 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 6 Feb 2015 15:37:31 -0600 Subject: sandbox: Return '-c command' exit value as sandbox exit code When a command is passed into sandbox using the '-c' argument the command is run directly. This is most helpful when running tests (such as test-dm.sh). Previously the exit code was an unused enum. Change it to be the actual return code from the command so that the script calling sandbox can know if the command succeeded (tests passed). Also remove the now completely unused "exit_state" in sandbox. Signed-off-by: Joe Hershberger Acked-by: Simon Glass diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 097f29a..ec01040 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -78,11 +78,13 @@ int sandbox_main_loop_init(void) /* Execute command if required */ if (state->cmd) { + int retval; + cli_init(); - run_command_list(state->cmd, -1, 0); + retval = run_command_list(state->cmd, -1, 0); if (!state->interactive) - os_exit(state->exit_type); + os_exit(retval); } return 0; diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index ba73b7e..033958c 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -13,11 +13,6 @@ static struct sandbox_state main_state; static struct sandbox_state *state; /* Pointer to current state record */ -void state_record_exit(enum exit_type_id exit_type) -{ - state->exit_type = exit_type; -} - static int state_ensure_space(int extra_size) { void *blob = state->state_fdt; diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index 32d55cc..a0c24ba 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -10,13 +10,6 @@ #include #include -/* How we exited U-Boot */ -enum exit_type_id { - STATE_EXIT_NORMAL, - STATE_EXIT_COLD_REBOOT, - STATE_EXIT_POWER_OFF, -}; - /** * Selects the behavior of the serial terminal. * @@ -50,7 +43,6 @@ struct sandbox_state { const char *cmd; /* Command to execute */ bool interactive; /* Enable cmdline after execute */ const char *fdt_fname; /* Filename of FDT binary */ - enum exit_type_id exit_type; /* How we exited U-Boot */ const char *parse_err; /* Error to report from parsing */ int argc; /* Program arguments */ char **argv; /* Command line arguments */ @@ -139,13 +131,6 @@ struct sandbox_state_io { } /** - * Record the exit type to be reported by the test program. - * - * @param exit_type Exit type to record - */ -void state_record_exit(enum exit_type_id exit_type); - -/** * Gets a pointer to the current state. * * @return pointer to state -- cgit v0.10.2 From e50ab22984ce90ffcc47bc620ed2caac0bcc02f7 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 10 Feb 2015 18:52:35 -0700 Subject: sandbox: Adjust the order of the NO_SDL check An option is provided to avoid using SDL in U-Boot sandbox (and drop support for the LCD). However the check in the Makefile is too late and warnings are printed even if NO_SDL=y is given. Adjust the order to avoid this warning. Signed-off-by: Simon Glass Acked-by: Jeroen Hofstee diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk index e38a44b..7b84f02 100644 --- a/arch/sandbox/config.mk +++ b/arch/sandbox/config.mk @@ -5,10 +5,16 @@ PLATFORM_CPPFLAGS += -D__SANDBOX__ -U_FORTIFY_SOURCE PLATFORM_CPPFLAGS += -DCONFIG_ARCH_MAP_SYSMEM -DCONFIG_SYS_GENERIC_BOARD PLATFORM_LIBS += -lrt +# Define this to avoid linking with SDL, which requires SDL libraries +# This can solve 'sdl-config: Command not found' errors +ifneq ($(NO_SDL),) +PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL +else ifdef CONFIG_SANDBOX_SDL PLATFORM_LIBS += $(shell sdl-config --libs) PLATFORM_CPPFLAGS += $(shell sdl-config --cflags) endif +endif # Support generic board on sandbox __HAVE_ARCH_GENERIC_BOARD := y @@ -18,9 +24,3 @@ cmd_u-boot__ = $(CC) -o $@ -T u-boot.lds \ $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map CONFIG_ARCH_DEVICE_TREE := sandbox - -# Define this to avoid linking with SDL, which requires SDL libraries -# This can solve 'sdl-config: Command not found' errors -ifneq ($(NO_SDL),) -PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL -endif -- cgit v0.10.2