Beispiel #1
0
    def verify(self):
        ''' A simple method which checks that each of the modules has been built
            correctly.'''
        # Tell the user what's happening
        Output.header('Building {}...'.format(self.stage[0].lower()))

        # Change the root if necessary
        if self.user == 'chroot':

            # Change our root
            set_chroot(self.environment['WANDER'])

        # Store whether or not the modules are valid
        result = True

        # Get ready to run the stage
        result &= self.initialise()

        # Iterate through each of the prerequisites, and verify them
        for element in self.elements:

            # Verify that the prerequisite is met
            result &= Module(self.elements[element], self).verify()

            # Add the final line of output
            print('')

        # Cleanup the stage
        result &= self.clean()

        # Inform the user of the status
        Output.footer(result, 'Building {}'.format(self.stage[0].lower()))

        # And return the result
        return result
Beispiel #2
0
    def verify(self):
        ''' The verify method, which ensures that the partition is correctly
            selected and properly formatted.'''
        # First, check if we are in a docker container
        if docker():

            return True

        # Otherwise, tell the user what's happening
        Output.header('Checking partition system...')

        # Create the disk variable
        disk, device = self.getPath()

        # Store the partition to use
        partition = self.getPartition(self.printPartitions(disk, device),
                                      device)

        # Store the partition that we're using
        self.path = device.path + str(partition)

        # Let the user know exactly what the path is
        Output.text('Wander will be built on ' + self.path + '.')

        # Log the filesystem
        Output.log(
            Output.TESTING,
            'Checking that the filesystem of ' + self.path + ' is ext4.')

        # Store the unknown filesystem
        filesystem = None

        # Check the file system
        for partition in disk.partitions:

            # Check that the paths match
            if partition.path == self.path:

                # Store the file system information
                filesystem = partition.fileSystem
                filesystem = filesystem.type if filesystem else None

                # And close
                break

        # Get our result
        result = filesystem == 'ext4'

        # Log the filesystem
        Output.log(
            Output.PASSED if result else Output.FAILED,
            'Checking that' + ' the filesystem of ' + self.path + ' is ext4.')
        print()

        # Inform the user of the status
        Output.footer(result, "Checking partition system")

        # And return the result
        return result
Beispiel #3
0
    def verify(self):
        ''' A simple method which downloads the packages and ensures that
            everything worked smoothly.'''
        # Tell the user what's happening
        Output.header("Downloading required packages and patches...")

        # Download all of the packages
        result = self.packages.verify()

        # And download all of the patches
        result &= self.patches.verify()

        # Inform the user of the status
        Output.footer(result, "Downloading required packages and patches")

        # And return the result
        return result
Beispiel #4
0
    def verify(self):
        ''' A simple method which ensures that the host system is ready...'''
        # Check that the partition system is defined
        if self.partitions is not None and not docker():

            # Add the folder location
            if self.environment.get('LOCATION') is None:
                self.environment['LOCATION'] = self.partitions.path

            else:
                self.environment['LOCATION'] += ':' + self.partitions.path

        # Tell the user what's happening
        Output.header('Preparing {}...'.format(self.stage[0].lower()))

        # Change the root if necessary
        if self.user == 'chroot':

            # And change our root
            set_chroot(self.environment['WANDER'])

        # Store whether or not the preparations are valid
        result = True

        # Iterate through each of the preparations, and verify them
        for element in self.elements:

            # Verify that the prerequisite is met
            result &= Preparation(self.elements[element], self).verify()

            # Add the final line of output
            print('')

        # Update any changes in the user list
        self.commands.update()

        # Inform the user of the status
        Output.footer(result, 'Preparing {}'.format(self.stage[0].lower()))

        # And return the result
        return result
Beispiel #5
0
    def verify(self):
        ''' A simple method which checks that each of the requirements has been
            met.'''
        # Tell the user what's happening
        Output.header('Checking host prerequisites...')

        # Store whether or not the prerequisites are valid
        result = True

        # Iterate through each of the prerequisites, and verify them
        for element in self.elements:

            # Verify that the prerequisite is met
            result &= Prerequisite(self.elements[element], self).verify()

            # Add the final line of output
            print('')

        # Inform the user of the status
        Output.footer(result, "Checking host prerequisites")

        # And return the result
        return result