Changeset 48afbab in rtems-tools


Ignore:
Timestamp:
Jun 13, 2019, 8:28:50 AM (4 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
6f99d80
Parents:
d73ce80
git-author:
Chris Johns <chrisj@…> (06/13/19 08:28:50)
git-committer:
Chris Johns <chrisj@…> (06/13/19 08:38:50)
Message:

misc/boot-image: Fix image convert. Add --build option.

  • Change the build directory away from build, avoid the tool wiping out a libbsd build directory.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • misc/tools/boot.py

    rd73ce80 r48afbab  
    128128    ]
    129129
    130     def __init__(self, command_path, bootloader = None):
     130    def __init__(self, command_path, build = None, bootloader = None):
    131131        #
    132132        # Check if there is a defaults.mc file under the command path. If so
     
    141141            rtdir = '%{_prefix}/share/rtems'
    142142        boot_ini = '%s/%s' % (rtdir, boot_ini)
    143         self.build = 'build'
     143        self.build = None
    144144        self.macros = macros.macros(rtdir = rtdir, show_minimal = True)
    145145        self.config = configuration.configuration(raw = False)
     
    305305class uboot_bootloader(bootloader):
    306306
    307     def __init__(self, command_path, convert_kernel, paths, board):
     307    def __init__(self, command_path, build, convert_kernel, paths, board):
    308308        self.uboot = { 'paths': paths, 'board': board }
    309309        self.convert_kernel = convert_kernel
    310         super(uboot_bootloader, self).__init__(command_path, 'u-boot')
     310        super(uboot_bootloader, self).__init__(command_path, build, 'u-boot')
    311311        if self.board() not in self.boards():
    312312            raise error.general('board not found: %s' %(self.board()))
     
    318318
    319319    def _check_frist_second_stages(self):
    320         if self['first_stage'] is not None and \
    321            not path.exists(self['first_stage']):
    322             err = 'u-boot: first stage loader not found: %s' % \
    323                 (self['first_stage'])
    324             raise error.general(err)
    325         if self['second_stage'] is not None and \
    326            not path.exists(self['second_stage']):
    327             err = 'u-boot: second stage loader not found: %s' % \
    328                 (self['second_stage'])
    329             raise error.general(err)
     320        if not self.convert_kernel:
     321            if self['first_stage'] is not None and \
     322               not path.exists(self['first_stage']):
     323                err = 'u-boot: first stage loader not found: %s' % \
     324                      (self['first_stage'])
     325                raise error.general(err)
     326            if self['second_stage'] is not None and \
     327               not path.exists(self['second_stage']):
     328                err = 'u-boot: second stage loader not found: %s' % \
     329                      (self['second_stage'])
     330                raise error.general(err)
    330331
    331332    def load_config(self, bootloader, config):
     
    10411042                                  '(default: %(default)r).',
    10421043                           action = 'store_true', default = False)
     1044        argsp.add_argument('--build',
     1045                           help = 'set the build directory (default: %(default)r).',
     1046                           type = str, default = 'ribuild')
    10431047        argsp.add_argument('--no-clean',
    10441048                           help = 'do not clean when finished (default: %(default)r).',
     
    10581062        log.tracing = argopts.trace
    10591063
    1060         if argopts.net_boot_dhcp is not None or \
     1064        if argopts.net_boot_dhcp or \
    10611065           argopts.net_boot_ip is not None:
    10621066            if argopts.convert_kernel:
     
    10801084
    10811085        loader = uboot_bootloader(command_path,
     1086                                  argopts.build,
    10821087                                  argopts.convert_kernel,
    10831088                                  argopts.paths,
     
    10951100            loader.clean = argopts.no_clean
    10961101
     1102        loader['build'] = argopts.build
    10971103        loader['board'] = argopts.board
    10981104        loader['output'] = argopts.output
    1099         loader['build'] = 'build'  # need an option for this at some point
    11001105        loader['image_size'] = argopts.image_size
    11011106        loader['fs_format'] = argopts.fs_format
Note: See TracChangeset for help on using the changeset viewer.