Merge pull request #2241 from balena-os/config-txt-getBootConfig-arrayConf-patch

Patch config.txt backend to return array configs correctly
This commit is contained in:
flowzone-app[bot] 2024-02-17 02:44:00 +00:00 committed by GitHub
commit 6536bd7fed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -157,6 +157,9 @@ export class ConfigTxt extends ConfigBackend {
// Otherwise push the new value to the array
const arrayConf = conf[key] == null ? [] : conf[key]!;
arrayConf.push(value);
if (conf[key] == null) {
conf[key] = arrayConf;
}
}
}
continue;

View File

@ -17,6 +17,8 @@ describe('config/config-txt', () => {
dtoverlay=ads7846
enable_uart=1
avoid_warnings=1
gpio=8=pd
gpio=17=op,dh
gpu_mem=16
hdmi_force_hotplug:1=1
dtoverlay=lirc-rpi,gpio_out_pin=17,gpio_in_pin=13
@ -34,6 +36,7 @@ describe('config/config-txt', () => {
],
enable_uart: '1',
avoid_warnings: '1',
gpio: ['8=pd', '17=op,dh'],
gpu_mem: '16',
initramfs: 'initramf.gz 0x00800000',
'hdmi_force_hotplug:1': '1',