Commit a7ed8d1865337846241d2f7be4a7e6b87cf44681
1 parent
fc4035ec
rpi-eeprom-config: Pull in --edit fixes from rpi-eeprom repo
Showing
1 changed file
with
6 additions
and
2 deletions
tools/rpi-eeprom-config
| @@ -140,9 +140,13 @@ def apply_update(config, eeprom=None, config_src=None): | @@ -140,9 +140,13 @@ def apply_update(config, eeprom=None, config_src=None): | ||
| 140 | else: | 140 | else: |
| 141 | eeprom_image = get_latest_eeprom() | 141 | eeprom_image = get_latest_eeprom() |
| 142 | create_tempdir() | 142 | create_tempdir() |
| 143 | + | ||
| 144 | + # Replace the contents of bootconf.txt with the contents of the config file | ||
| 143 | tmp_update = os.path.join(TEMP_DIR, 'pieeprom.upd') | 145 | tmp_update = os.path.join(TEMP_DIR, 'pieeprom.upd') |
| 144 | image = BootloaderImage(eeprom_image, tmp_update) | 146 | image = BootloaderImage(eeprom_image, tmp_update) |
| 145 | - image.write(config) | 147 | + image.update_file(config, BOOTCONF_TXT) |
| 148 | + image.write() | ||
| 149 | + | ||
| 146 | config_str = open(config).read() | 150 | config_str = open(config).read() |
| 147 | if config_src is None: | 151 | if config_src is None: |
| 148 | config_src = '' | 152 | config_src = '' |
| @@ -176,7 +180,7 @@ def edit_config(eeprom=None): | @@ -176,7 +180,7 @@ def edit_config(eeprom=None): | ||
| 176 | if os.path.exists(pending): | 180 | if os.path.exists(pending): |
| 177 | config_src = pending | 181 | config_src = pending |
| 178 | image = BootloaderImage(pending) | 182 | image = BootloaderImage(pending) |
| 179 | - current_config = image.get_config().decode('utf-8') | 183 | + current_config = image.get_file(BOOTCONF_TXT).decode('utf-8') |
| 180 | else: | 184 | else: |
| 181 | current_config, config_src = read_current_config() | 185 | current_config, config_src = read_current_config() |
| 182 | 186 |