From d73ce80ec072bf7fdaf19ecf7c3d027d76dd8dcf Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Wed, 12 Jun 2019 14:44:36 +1000 Subject: misc/boot-image: Fix macro set logic and --net-boot-dhcp processing. --- misc/tools/boot.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/misc/tools/boot.py b/misc/tools/boot.py index 8d6afd1..fb2e7f8 100644 --- a/misc/tools/boot.py +++ b/misc/tools/boot.py @@ -160,8 +160,10 @@ class bootloader(object): def __setitem__(self, key, value): if value is None: value = 'None' - if isinstance(value, int): - value = str(int) + elif isinstance(value, bool): + value = '1' if value else '0' + elif isinstance(value, int): + value = str(value) self.macros[key] = value def get_mandatory_configs(self): @@ -377,9 +379,8 @@ class uboot_bootloader(bootloader): image.install(path.abspath(uenv_txt), mountpoint) else: template = None - if self['net_dhcp'] is not None or \ - self['net_ip'] is not None: - if self['net_dhcp'] is not None: + if self['net_dhcp'] or self['net_ip'] is not None: + if self['net_dhcp']: template = 'uenv_net_dhcp' else: template = 'uenv_net_static' -- cgit v1.2.3