summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5a27c73)
This will ensure that the order of the defconfig entries will always
match that of the Kconfig files. After one slightly painful (but
still early in the process) pass over all boards, this should keep
the defconfigs clean from here on.
Users must edit the Kconfig first to add the menu entries and then run
moveconfig.py to update the defconfig files and the include configs.
As such, moveconfig.py cannot compare against the '.config' contents.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
CONFIG_CMD_USB bool n
CONFIG_SYS_TEXT_BASE hex 0x00000000
CONFIG_CMD_USB bool n
CONFIG_SYS_TEXT_BASE hex 0x00000000
+Next you must edit the Kconfig to add the menu entries for the configs
+you are moving.
+
And then run this tool giving the file name of the recipe
$ tools/moveconfig.py recipe
And then run this tool giving the file name of the recipe
$ tools/moveconfig.py recipe
STATE_IDLE = 0
STATE_DEFCONFIG = 1
STATE_AUTOCONF = 2
STATE_IDLE = 0
STATE_DEFCONFIG = 1
STATE_AUTOCONF = 2
ACTION_MOVE = 0
ACTION_DEFAULT_VALUE = 1
ACTION_MOVE = 0
ACTION_DEFAULT_VALUE = 1
return CROSS_COMPILE.get(arch, '')
return CROSS_COMPILE.get(arch, '')
- def parse_one_config(self, config_attr, defconfig_lines,
- dotconfig_lines, autoconf_lines):
+ def parse_one_config(self, config_attr, defconfig_lines, autoconf_lines):
"""Parse .config, defconfig, include/autoconf.mk for one config.
This function looks for the config options in the lines from
"""Parse .config, defconfig, include/autoconf.mk for one config.
This function looks for the config options in the lines from
config_attr: A dictionary including the name, the type,
and the default value of the target config.
defconfig_lines: lines from the original defconfig file.
config_attr: A dictionary including the name, the type,
and the default value of the target config.
defconfig_lines: lines from the original defconfig file.
- dotconfig_lines: lines from the .config file.
autoconf_lines: lines from the include/autoconf.mk file.
Returns:
autoconf_lines: lines from the include/autoconf.mk file.
Returns:
else:
default = config + '=' + config_attr['default']
else:
default = config + '=' + config_attr['default']
- for line in defconfig_lines + dotconfig_lines:
+ for line in defconfig_lines:
line = line.rstrip()
if line.startswith(config + '=') or line == not_set:
return (ACTION_ALREADY_EXIST, line)
line = line.rstrip()
if line.startswith(config + '=') or line == not_set:
return (ACTION_ALREADY_EXIST, line)
with open(defconfig_path) as f:
defconfig_lines = f.readlines()
with open(defconfig_path) as f:
defconfig_lines = f.readlines()
- with open(dotconfig_path) as f:
- dotconfig_lines = f.readlines()
-
with open(autoconf_path) as f:
autoconf_lines = f.readlines()
for config_attr in self.config_attrs:
result = self.parse_one_config(config_attr, defconfig_lines,
with open(autoconf_path) as f:
autoconf_lines = f.readlines()
for config_attr in self.config_attrs:
result = self.parse_one_config(config_attr, defconfig_lines,
- dotconfig_lines, autoconf_lines)
results.append(result)
log = ''
results.append(result)
log = ''
print log,
if not self.options.dry_run:
print log,
if not self.options.dry_run:
- with open(defconfig_path, 'a') as f:
+ with open(dotconfig_path, 'a') as f:
for (action, value) in results:
if action == ACTION_MOVE:
f.write(value + '\n')
for (action, value) in results:
if action == ACTION_MOVE:
f.write(value + '\n')
if self.state == STATE_AUTOCONF:
self.parser.update_defconfig(self.defconfig)
if self.state == STATE_AUTOCONF:
self.parser.update_defconfig(self.defconfig)
+
+ """Save off the defconfig in a consistent way"""
+ cmd = list(self.make_cmd)
+ cmd.append('savedefconfig')
+ self.ps = subprocess.Popen(cmd, stdout=self.devnull,
+ stderr=self.devnull)
+ self.state = STATE_SAVEDEFCONFIG
+ return False
+
+ if self.state == STATE_SAVEDEFCONFIG:
+ defconfig_path = os.path.join(self.build_dir, 'defconfig')
+ shutil.move(defconfig_path,
+ os.path.join('configs', self.defconfig))
self.state = STATE_IDLE
return True
self.state = STATE_IDLE
return True