You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.8 KiB
64 lines
1.8 KiB
#-*- coding: utf-8 -*-
|
|
|
|
# Copyright 2010 Calculate Ltd. http://www.calculate-linux.org
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
__version__ = "2.2.0.0"
|
|
__app__ = "calculate-builder"
|
|
|
|
import os
|
|
import re
|
|
import sys
|
|
import traceback
|
|
from os import path
|
|
from cl_utils import process
|
|
from subprocess import STDOUT,PIPE
|
|
from cl_print import color_print
|
|
from cl_datavars import DataVars
|
|
from shutil import copy2 as copy_with_perm
|
|
|
|
from cl_kernel_utils import KernelConfig,InitRamFs
|
|
|
|
from cl_lang import lang
|
|
|
|
class printNoColor:
|
|
def colorPrint(self,attr,fg,bg,string):
|
|
sys.stdout.write(string)
|
|
|
|
class DataVarsBuilder(DataVars):
|
|
"""Variable class for installation"""
|
|
|
|
def importBuilder(self, **args):
|
|
'''Get variables for builder'''
|
|
# section name in calculate.env
|
|
envSection = "builder"
|
|
# import builder variables
|
|
self.importData(envSection, ('cl_vars_builder','cl_fill_builder'))
|
|
|
|
class cl_builder(color_print):
|
|
"""Primary class for image manipulation"""
|
|
|
|
def __init__(self):
|
|
self.clVars = None
|
|
self.startMessage = ""
|
|
|
|
def setNoColor(self):
|
|
self.color = False
|
|
|
|
def initVars(self):
|
|
"""Primary initialization of variables"""
|
|
self.clVars = DataVarsBuilder()
|
|
self.clVars.importBuilder()
|
|
self.clVars.flIniFile()
|