예제 #1
0
    def validate_config(self):
        """
        Returns true if the associated bspconfig has all the required
        configurations for this installation mode; false otherwise.
        """

        if not self._config.has_option('CONFIG_INSTALLER_MODE_SD_CARD'):
            self._logger.warning(
                'You are asking to generate the SD card ' +
                'memory map, but CONFIG_INSTALLER_MODE_SD_CARD ' +
                'is not set.')

        if not self._config.has_option(
                'CONFIG_INSTALLER_UBOOT_PARTITION_SIZE'):
            raise MemoryMapException(
                'Missing CONFIG_INSTALLER_UBOOT_PARTITION_SIZE.')

        if self._config.has_option('CONFIG_FS_TARGET_SD'):

            if not self._config.has_option('CONFIG_INSTALLER_SD_ROOTFS_SIZE'):
                raise MemoryMapException(
                    'Missing CONFIG_INSTALLER_SD_ROOTFS_SIZE.')

            if (not self._config.has_option(
                    'CONFIG_INSTALLER_SD_ROOTFS_TYPE_EXT3')
                    and not self._config.has_option(
                        'CONFIG_INSTALLER_SD_ROOTFS_TYPE_EXT4')
                    and not self._config.has_option(
                        'CONFIG_INSTALLER_SD_ROOTFS_TYPE_EXT4_NO_JOURNAL')):
                self._logger.warning(
                    'Missing CONFIG_INSTALLER_SD_ROOTFS_TYPE_EXT*, ' +
                    'assuming Linux native, ext4.')
    def validate_config(self):
        if (not self._c.has_option('CONFIG_INSTALLER_MODE_ATTACHED_BOARD')
                and not self._c.has_option(
                    'CONFIG_INSTALLER_MODE_SD_CARD_INSTALLER')):
            raise MemoryMapException(
                'You are asking to generate the NAND '
                'memory map, but neither CONFIG_INSTALLER_MODE_ATTACHED_BOARD '
                'or CONFIG_INSTALLER_MODE_SD_CARD_INSTALLER are set.')

        if not self._c.has_option(
                'CONFIG_BSP_ARCH_INSTALLER_IPL_FLASH_BLK_START'):
            self._l.warning(
                'Missing CONFIG_BSP_ARCH_INSTALLER_IPL_FLASH_BLK_START')

        if not self._c.has_option(
                'CONFIG_BSP_ARCH_INSTALLER_UBOOT_FLASH_BLK_START'):
            self._l.warning(
                'Missing CONFIG_BSP_ARCH_INSTALLER_UBOOT_FLASH_BLK_START')

        if not self._c.has_option('CONFIG_INSTALLER_UBOOT_SIZE_IN_BLKS'):
            self._l.warning('Missing CONFIG_INSTALLER_UBOOT_SIZE_IN_BLKS')

        if not self._c.has_option('CONFIG_INSTALLER_KERNEL_SIZE_IN_BLKS'):
            self._l.warning('Missing CONFIG_INSTALLER_KERNEL_SIZE_IN_BLKS')

        if not self._c.has_option('CONFIG_FS_TARGET_NFSROOT'):
            if not self._c.has_option('CONFIG_INSTALLER_FS_SIZE_IN_BLKS'):
                self._l.warning('Missing CONFIG_INSTALLER_FS_SIZE_IN_BLKS')

        if self._c.has_option('CONFIG_INSTALLER_MTD_UBOOT_INTEGRATION'):
            if not self._c.has_option('CONFIG_INSTALLER_MTD_DEVICE_NAME'):
                self._l.warning('Missing CONFIG_INSTALLER_MTD_DEVICE_NAME')
 def _check_imgs(self):
     for img in self.imgs.items():
         component = img[0]
         filename = '%s/%s' % (self._devdir, img[1])
         if component is 'fs':
             if self._fs_name() == NandMemoryMapDm816x.FS_NFS:
                 continue
         if not os.path.isfile(filename):
             raise MemoryMapException("File not found: %s" % filename)
예제 #4
0
    def validate_config(self):
        """
        Returns true if the associated bspconfig has all the required
        configurations for this installation mode; false otherwise.
        """

        if not self._config.has_option(
                'CONFIG_INSTALLER_MODE_SD_CARD_INSTALLER'):
            raise MemoryMapException(
                'You are asking to generate the SD card memory '
                'map, but CONFIG_INSTALLER_MODE_SD_CARD_INSTALLER is not set.')
 def _generate_bootloader(self):
     start_blk = 0
     ipl_last_blk = 0
     if self._c.has_option(
             'CONFIG_BSP_ARCH_INSTALLER_UBOOT_FLASH_BLK_START'):
         start_blk = int(
             self._c.get_clean(
                 'CONFIG_BSP_ARCH_INSTALLER_UBOOT_FLASH_BLK_START'), 16)
     for part in self._partitions:
         if part.name == self.names['ipl']:
             ipl_last_blk = part.start_blk + part.size_blks
     if start_blk < ipl_last_blk:
         if self._c.has_option(
                 'CONFIG_BSP_ARCH_INSTALLER_UBOOT_FLASH_BLK_START'):
             raise MemoryMapException(
                 "IPL ends at block %s, can't start the "
                 "bootloader partition at block %s, please check "
                 "CONFIG_BSP_ARCH_INSTALLER_UBOOT_FLASH_BLK_START" %
                 (hex(ipl_last_blk), hex(start_blk)))
         start_blk = ipl_last_blk
     img = '%s/%s' % (self._devdir, self.imgs['bootloader'])
     size = os.path.getsize(img)
     size_blks = self._bytes_to_blks(size)
     if self._c.has_option('CONFIG_INSTALLER_UBOOT_SIZE_IN_BLKS'):
         uboot_last_blk = start_blk + size_blks
         uboot_last_allowed_blk = int(
             self._c.get_clean('CONFIG_INSTALLER_UBOOT_SIZE_IN_BLKS'))
         if uboot_last_blk > uboot_last_allowed_blk:
             raise MemoryMapException(
                 "The allowed space for %s and %s "
                 "(CONFIG_INSTALLER_UBOOT_SIZE_IN_BLKS = %s) is smaller than "
                 "the required one (%s NAND blocks), please reconfigure your SDK"
                 % (self.names['ipl'], self.names['bootloader'],
                    uboot_last_allowed_blk, uboot_last_blk))
     uboot = NandPartition(self.names['bootloader'])
     uboot.image = img
     uboot.start_blk = start_blk
     uboot.size_blks = size_blks
     self._partitions.append(uboot)
예제 #6
0
    def validate_config(self):
        """
        Returns true if the associated bspconfig has all the required
        configurations for this installation mode; false otherwise.
        """

        if self._config.has_option('CONFIG_FS_TARGET_SD'):
            if (not self._config.has_option(
                    'CONFIG_INSTALLER_SD_ROOTFS_TYPE_EXT3')
                    and not self._config.has_option(
                        'CONFIG_INSTALLER_SD_ROOTFS_TYPE_EXT4')
                    and not self._config.has_option(
                        'CONFIG_INSTALLER_SD_ROOTFS_TYPE_EXT4_NO_JOURNAL')):
                self._logger.warning(
                    'Missing CONFIG_INSTALLER_SD_ROOTFS_TYPE_EXT*, ' +
                    'assuming rootfs partition type ext4.')
        else:
            raise MemoryMapException('Missing CONFIG_FS_TARGET_SD.')