Example #1
0
def makedev(target, devices=['generic']):
    here = os.getcwd()
    os.chdir(join(target, 'dev'))
    for dev in devices:
        echo('making device %s with MAKEDEV' % dev)
        runlog('./MAKEDEV %s' % dev)
    os.chdir(here)
Example #2
0
 def extract_basebootstrap(self):
     echo('extracting premade base tarball')
     suite_path = self.defenv.get('installer', 'suite_storage')
     basefile = join(suite_path, '%s.tar' % self.installer.suite)
     runvalue = extract_tarball(self.target, basefile)
     if runvalue:
         raise InstallError, 'problems extracting %s to %s' % (basefile, self.target)
Example #3
0
def makedev(target, devices=['generic']):
    here = os.getcwd()
    os.chdir(join(target, 'dev'))
    for dev in devices:
        echo('making device %s with MAKEDEV' % dev)
        runlog('./MAKEDEV %s' % dev)
    os.chdir(here)
Example #4
0
 def extract_basebootstrap(self):
     echo('extracting premade base tarball')
     suite_path = self.defenv.get('installer', 'suite_storage')
     basefile = join(suite_path, '%s.tar' % self.installer.suite)
     runvalue = extract_tarball(self.target, basefile)
     if runvalue:
         raise InstallError, 'problems extracting %s to %s' % (basefile,
                                                               self.target)
Example #5
0
def extract_tarball(target, tarball):
    opts = '-xf'
    if tarball[-7:] == '.tar.gz' or tarball[-4:] == '.tgz':
        opts = '-xzf'
    elif tarball[-8:] == '.tar.bz2':
        opts = '-xjf'
    cmd = 'tar -C %s %s %s' % (target, opts, tarball)
    echo('extracting tarball with command %s' % cmd)
    return runlog(cmd)
Example #6
0
def extract_tarball(target, tarball):
    opts = '-xf'
    if tarball[-7:] == '.tar.gz' or tarball[-4:] == '.tgz':
        opts = '-xzf'
    elif tarball[-8:] == '.tar.bz2':
        opts = '-xjf'
    cmd = 'tar -C %s %s %s' % (target, opts, tarball)
    echo('extracting tarball with command %s' % cmd)
    return runlog(cmd)
Example #7
0
def extract_tarball(target, tarball):
    opts = "-xf"
    if tarball[-7:] == ".tar.gz" or tarball[-4:] == ".tgz":
        opts = "-xzf"
    elif tarball[-8:] == ".tar.bz2":
        opts = "-xjf"
    cmd = "tar -C %s %s %s" % (target, opts, tarball)
    echo("extracting tarball with command %s" % cmd)
    return runlog(cmd)
Example #8
0
def make_filesystem(device, fstype):
    if fstype == 'reiserfs':
        cmd = 'mkreiserfs -f -q %s' % device
    elif fstype == 'ext3':
        cmd = 'mkfs.ext3 -F -q %s' % device
    elif fstype == 'ext2':
        cmd = 'mkfs.ext2 -F -q %s' % device
    else:
        raise RuntimeError,  'unhandled fstype %s '  % fstype
    echo(cmd)
    return runlog(cmd)
Example #9
0
def make_filesystem(device, fstype):
    if fstype == 'reiserfs':
        cmd = 'mkreiserfs -f -q %s' % device
    elif fstype == 'ext3':
        cmd = 'mkfs.ext3 -F -q %s' % device
    elif fstype == 'ext2':
        cmd = 'mkfs.ext2 -F -q %s' % device
    else:
        raise Error,  'unhandled fstype %s '  % fstype
    echo(cmd)
    runlog(cmd, keeprunning=True)
Example #10
0
def make_filesystem(device, fstype):
    if fstype == 'reiserfs':
        cmd = 'mkreiserfs -f -q %s' % device
    elif fstype == 'ext3':
        cmd = 'mkfs.ext3 -F -q %s' % device
    elif fstype == 'ext2':
        cmd = 'mkfs.ext2 -F -q %s' % device
    else:
        raise Error, 'unhandled fstype %s ' % fstype
    echo(cmd)
    runlog(cmd, keeprunning=True)
Example #11
0
def make_filesystems(device, fsmounts, env):
    mddev = False
    if device == '/dev/md':
        mdnum = 0
        mddev = True
    for row in fsmounts:
        if mddev:
            pdev = '/dev/md%d' % mdnum
            mdnum += 1
        else:
            pdev = device + str(row.partition)
        if row.mnt_name in env.keys():
            echo('%s held' % row.mnt_name)
        elif row.fstype == 'swap':
            runlog('echo making swap on %s' % pdev)
            runvalue = runlog('mkswap %s' % pdev)
            if runvalue:
                raise RuntimeError, 'problem making swap on %s' % pdev
        else:
            echo('making filesystem for %s' % row.mnt_name)
            make_filesystem(pdev, row.fstype)
Example #12
0
 def umount_target_proc(self):
     "this is a default process"
     echo('unmounting target /proc')
     mount_target_proc(self.target, umount=True)
Example #13
0
 def install_kernel(self):
     "this is a default process"
     kernel = self.machine.current.kernel
     echo('installing kernel %s' % kernel)
     install_kernel(kernel, self.target)
Example #14
0
 def mount_target_proc(self):
     "this is a default process"
     echo('mounting target /proc')
     mount_target_proc(self.target)
Example #15
0
 def mount_target_proc(self):
     "this is a default process"
     echo('mounting target /proc')
     mount_target_proc(self.target)
Example #16
0
 def umount_target_proc(self):
     "this is a default process"
     echo('unmounting target /proc')
     mount_target_proc(self.target, umount=True)
Example #17
0
 def install_kernel(self):
     "this is a default process"
     kernel = self.machine.current.kernel
     echo('installing kernel %s' % kernel)
     install_kernel(kernel, self.target)