Commit 95776391852147ea5c2e8ac01613a20c6583bc33

Authored by Tom Rini

Merge branch 'sandbox' of git://git.denx.de/u-boot-x86

Showing 7 changed files Side-by-side Diff

arch/sandbox/config.mk
... ... @@ -5,10 +5,16 @@
5 5 PLATFORM_CPPFLAGS += -DCONFIG_ARCH_MAP_SYSMEM -DCONFIG_SYS_GENERIC_BOARD
6 6 PLATFORM_LIBS += -lrt
7 7  
  8 +# Define this to avoid linking with SDL, which requires SDL libraries
  9 +# This can solve 'sdl-config: Command not found' errors
  10 +ifneq ($(NO_SDL),)
  11 +PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL
  12 +else
8 13 ifdef CONFIG_SANDBOX_SDL
9 14 PLATFORM_LIBS += $(shell sdl-config --libs)
10 15 PLATFORM_CPPFLAGS += $(shell sdl-config --cflags)
11 16 endif
  17 +endif
12 18  
13 19 # Support generic board on sandbox
14 20 __HAVE_ARCH_GENERIC_BOARD := y
... ... @@ -18,10 +24,4 @@
18 24 $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map
19 25  
20 26 CONFIG_ARCH_DEVICE_TREE := sandbox
21   -
22   -# Define this to avoid linking with SDL, which requires SDL libraries
23   -# This can solve 'sdl-config: Command not found' errors
24   -ifneq ($(NO_SDL),)
25   -PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL
26   -endif
arch/sandbox/cpu/start.c
... ... @@ -78,11 +78,13 @@
78 78  
79 79 /* Execute command if required */
80 80 if (state->cmd) {
  81 + int retval;
  82 +
81 83 cli_init();
82 84  
83   - run_command_list(state->cmd, -1, 0);
  85 + retval = run_command_list(state->cmd, -1, 0);
84 86 if (!state->interactive)
85   - os_exit(state->exit_type);
  87 + os_exit(retval);
86 88 }
87 89  
88 90 return 0;
arch/sandbox/cpu/state.c
... ... @@ -13,11 +13,6 @@
13 13 static struct sandbox_state main_state;
14 14 static struct sandbox_state *state; /* Pointer to current state record */
15 15  
16   -void state_record_exit(enum exit_type_id exit_type)
17   -{
18   - state->exit_type = exit_type;
19   -}
20   -
21 16 static int state_ensure_space(int extra_size)
22 17 {
23 18 void *blob = state->state_fdt;
arch/sandbox/include/asm/state.h
... ... @@ -10,13 +10,6 @@
10 10 #include <stdbool.h>
11 11 #include <linux/stringify.h>
12 12  
13   -/* How we exited U-Boot */
14   -enum exit_type_id {
15   - STATE_EXIT_NORMAL,
16   - STATE_EXIT_COLD_REBOOT,
17   - STATE_EXIT_POWER_OFF,
18   -};
19   -
20 13 /**
21 14 * Selects the behavior of the serial terminal.
22 15 *
... ... @@ -50,7 +43,6 @@
50 43 const char *cmd; /* Command to execute */
51 44 bool interactive; /* Enable cmdline after execute */
52 45 const char *fdt_fname; /* Filename of FDT binary */
53   - enum exit_type_id exit_type; /* How we exited U-Boot */
54 46 const char *parse_err; /* Error to report from parsing */
55 47 int argc; /* Program arguments */
56 48 char **argv; /* Command line arguments */
... ... @@ -137,13 +129,6 @@
137 129 .write = _write, \
138 130 .compat = _compat, \
139 131 }
140   -
141   -/**
142   - * Record the exit type to be reported by the test program.
143   - *
144   - * @param exit_type Exit type to record
145   - */
146   -void state_record_exit(enum exit_type_id exit_type);
147 132  
148 133 /**
149 134 * Gets a pointer to the current state.
tools/buildman/toolchain.py
... ... @@ -197,13 +197,14 @@
197 197 Returns:
198 198 Filename of C compiler if found, else None
199 199 """
  200 + fnames = []
200 201 for subdir in ['.', 'bin', 'usr/bin']:
201 202 dirname = os.path.join(path, subdir)
202 203 if verbose: print " - looking in '%s'" % dirname
203 204 for fname in glob.glob(dirname + '/*gcc'):
204 205 if verbose: print " - found '%s'" % fname
205   - return fname
206   - return None
  206 + fnames.append(fname)
  207 + return fnames
207 208  
208 209  
209 210 def Scan(self, verbose):
... ... @@ -219,8 +220,8 @@
219 220 if verbose: print 'Scanning for tool chains'
220 221 for path in self.paths:
221 222 if verbose: print " - scanning path '%s'" % path
222   - fname = self.ScanPath(path, verbose)
223   - if fname:
  223 + fnames = self.ScanPath(path, verbose)
  224 + for fname in fnames:
224 225 self.Add(fname, True, verbose)
225 226  
226 227 def List(self):
tools/patman/gitutil.py
... ... @@ -129,7 +129,7 @@
129 129 return upstream, msg
130 130  
131 131 if remote == '.':
132   - return merge
  132 + return merge, None
133 133 elif remote and merge:
134 134 leaf = merge.split('/')[-1]
135 135 return '%s/%s' % (remote, leaf), None
tools/patman/settings.py
... ... @@ -235,6 +235,31 @@
235 235 else:
236 236 print "WARNING: Unknown setting %s" % name
237 237  
  238 +def _ReadAliasFile(fname):
  239 + """Read in the U-Boot git alias file if it exists.
  240 +
  241 + Args:
  242 + fname: Filename to read.
  243 + """
  244 + if os.path.exists(fname):
  245 + bad_line = None
  246 + with open(fname) as fd:
  247 + linenum = 0
  248 + for line in fd:
  249 + linenum += 1
  250 + line = line.strip()
  251 + if not line or line.startswith('#'):
  252 + continue
  253 + words = line.split(' ', 2)
  254 + if len(words) < 3 or words[0] != 'alias':
  255 + if not bad_line:
  256 + bad_line = "%s:%d:Invalid line '%s'" % (fname, linenum,
  257 + line)
  258 + continue
  259 + alias[words[1]] = [s.strip() for s in words[2].split(',')]
  260 + if bad_line:
  261 + print bad_line
  262 +
238 263 def Setup(parser, project_name, config_fname=''):
239 264 """Set up the settings module by reading config files.
240 265  
... ... @@ -244,6 +269,8 @@
244 269 for sections named "project_section" as well.
245 270 config_fname: Config filename to read ('' for default)
246 271 """
  272 + # First read the git alias file if available
  273 + _ReadAliasFile('doc/git-mailrc')
247 274 config = _ProjectConfigParser(project_name)
248 275 if config_fname == '':
249 276 config_fname = '%s/.patman' % os.getenv('HOME')