def extract(self): """ Extract device-mapper tarball @return: bool """ print(green(' * ') + '... device_mapper.extract') os.system('tar xvfz %s/device-mapper.%s.tgz -C %s %s' % (utils.get_distdir(self.temp), self.dm_ver, self.temp['work'], self.verbose['std']))
def build_sequence(master_config, temp, verbose): """ unionfs_fuse build sequence @arg master_config dict @arg temp dict @arg verbose string @return: bool """ zero = int('0') ret = True if os.path.isfile('%s/unionfs-fuse-%s.tar.bz2' % (utils.get_distdir(temp), str(master_config['unionfs_fuse_ver']))) is not True: ret = download(master_config['unionfs_fuse_ver'], temp, verbose) if ret is not zero: print red('error: ')+'initramfs.unionfs_fuse.download() failed' sys.exit(2) ret = extract(master_config['unionfs_fuse_ver'], temp, verbose) ret = zero # grr, tar thing to not return 0 # ret = configure(temp['work'] + '/unionfs_fuse/' + master_config['unionfs_fuse_ver'], master_config, temp, verbose) # if ret is not zero: # print red('error: ')+'initramfs.unionfs_fuse.configure() failed' # sys.exit(2) # add fuse lib path os.system('echo "CPPFLAGS += -static -I%s/include -L%s/lib/.libs" >> %s' % (temp['work'] + '/fuse-' + master_config['fuse_ver'], temp['work'] + '/fuse-' + master_config['fuse_ver'], temp['work'] + '/unionfs-fuse-' + master_config['unionfs_fuse_ver']+'/Makefile')) os.system('echo "CPPFLAGS += -static -I%s/include -L%s/lib/.libs" >> %s' % (temp['work'] + '/fuse-' + master_config['fuse_ver'], temp['work'] + '/fuse-' + master_config['fuse_ver'], temp['work'] + '/unionfs-fuse-' + master_config['unionfs_fuse_ver']+'/src/Makefile')) os.system('echo "LIB += -static -L%s/lib/.libs -ldl -lrt" >> %s' % (temp['work'] + '/fuse-' + master_config['fuse_ver'], temp['work'] + '/unionfs-fuse-' + master_config['unionfs_fuse_ver']+'/Makefile')) os.system('echo "LIB += -static -L%s/lib/.libs -ldl -lrt" >> %s' % (temp['work'] + '/fuse-' + master_config['fuse_ver'], temp['work'] + '/unionfs-fuse-' + master_config['unionfs_fuse_ver']+'/src/Makefile')) ret = compile(temp['work'] + '/unionfs-fuse-' + master_config['unionfs_fuse_ver'], master_config, verbose) if ret is not zero: print red('error: ')+'initramfs.unionfs_fuse.compile() failed' sys.exit(2) # TODO remove manpage rm -rf %s/unionfs_fuse/man % temp['work'] ret = strip(master_config, temp) if ret is not zero: print red('error: ')+'initramfs.unionfs_fuse.strip() failed' sys.exit(2) ret = compress(master_config, temp, verbose) if ret is not zero: print red('error: ')+'initramfs.unionfs_fuse.compress() failed' sys.exit(2) ret = cache(temp['work'] + '/unionfs-fuse-' + master_config['unionfs_fuse_ver'], master_config, temp, verbose) if ret is not zero: print red('error: ')+'initramfs.unionfs_fuse.compress() failed' return ret
def extract(fuse_ver, temp, verbose): """ Extract fuse tarball @arg: string @arg: dict @arg: string @return: bool """ print green(' * ') + '... fuse.extract' os.system('tar xvfz %s/fuse-%s.tar.gz -C %s %s' % (utils.get_distdir(temp), str(fuse_ver), temp['work'], verbose['std']))
def extract(iscsi_ver, temp, quiet): """ Extract iscsi tarball @arg: string @arg: dict @arg: string @return: none because of tar """ print(green(' * ') + '... iscsi.extract') os.system('tar xvfz %s/open-iscsi-%s.tar.gz -C %s %s' % (utils.get_distdir(temp), str(iscsi_ver), temp['work'], quiet))
def build(self): pass """ device-mapper build sequence @return: bool """ zero = int('0') ret = True if os.path.isfile('%s/device-mapper.%s.tgz' % (utils.get_distdir(self.temp), self.dm_ver)) is not True: ret = self.download() if ret is not zero: os.system('rm %s/device-mapper.%s.tgz' % (utils.get_distdir(self.temp), self.dm_ver)) self.fail('download') self.extract() # grr, tar thing to not return 0 when success ret = self.configure() if ret is not zero: self.fail('configure') ret = self.make() if ret is not zero: self.fail('make') ret = self.install() if ret is not zero: self.fail('install') # TODO remove manpage rm -rf %s/device-mapper/man % temp['work'] os.system('rm -rf %s/man' % self.dm_tmp) ret = self.strip() if ret is not zero: self.fail('strip') ret = self.compress() if ret is not zero: self.fail('compress') ret = self.cache() if ret is not zero: self.fail('cache') return ret
def extract(unionfs_fuse_ver, temp, verbose): """ Extract unionfs-fuse tarball @arg unionfs_fuse_ver string @arg temp dict @arg verbose string @return: bool """ print green(' * ') + '... unionfs_fuse.extract' os.system('tar xvfj %s/unionfs-fuse-%s.tar.bz2 -C %s %s' % (utils.get_distdir(temp), str(unionfs_fuse_ver), temp['work'], verbose['std']))
def build_sequence(master_config, temp, verbose): """ fuse build sequence @arg: dict @arg: dict @arg: string @return: bool """ zero = int('0') ret = True if os.path.isfile('%s/fuse-%s.tar.gz' % (utils.get_distdir(temp), str(master_config['fuse_ver']))) is not True: ret = download(master_config['fuse_ver'], temp, verbose) if ret is not zero: print red('error: ')+'initramfs.fuse.download() failed' sys.exit(2) ret = extract(master_config['fuse_ver'], temp, verbose) ret = zero # grr, tar thing to not return 0 when success ret = configure(temp['work'] + '/fuse-' + master_config['fuse_ver'], master_config, temp, verbose) if ret is not zero: print red('error: ')+'initramfs.fuse.configure() failed' sys.exit(2) ret = compile(temp['work'] + '/fuse-' + master_config['fuse_ver'], master_config, verbose) if ret is not zero: print red('error: ')+'initramfs.fuse.compile() failed' sys.exit(2) # ret = install(temp['work'] + '/fuse-' + master_config['fuse_ver'], master_config, verbose) # if ret is not zero: # print red('error: ')+'initramfs.fuse.install() failed' # sys.exit(2) # # ret = strip(master_config, temp) # if ret is not zero: # print red('error: ')+'initramfs.fuse.strip() failed' # sys.exit(2) # # ret = compress(master_config, temp, verbose) # if ret is not zero: # print red('error: ')+'initramfs.fuse.compress() failed' # sys.exit(2) ret = cache(temp['work'] + '/fuse-' + master_config['fuse_ver'], master_config, temp, verbose) if ret is not zero: print red('error: ')+'initramfs.fuse.compress() failed' sys.exit(2) return ret
def download(fuse_ver, temp, verbose): """ Download fuse tarball @arg: string @arg: string @return: bool """ print green(' * ') + '... fuse.download' # TODO: get GENTOO_MIRRORS from portageq (better if I could import a portage module) fuse_url = 'http://sourceforge.net/projects/fuse/files/fuse-2.X/'+str(fuse_ver)+'/fuse-'+str(fuse_ver)+'.tar.gz/download' return os.system('/usr/bin/wget %s -O %s/fuse-%s.tar.gz %s' % (fuse_url, utils.get_distdir(temp), str(fuse_ver), verbose['std']))
def download(iscsi_ver, temp, quiet): """ Download iscsi tarball @arg: string @arg: string @return: bool """ print(green(' * ') + '... iscsi.download') # TODO: get GENTOO_MIRRORS from portageq (better if I could import a portage module) iscsi_url = 'http://www.open-iscsi.org/bits/open-iscsi-' + str(iscsi_ver) + '.tar.gz' return os.system('/usr/bin/wget %s -O %s/open-iscsi-%s.tar.gz %s' % (iscsi_url, utils.get_distdir(temp), str(iscsi_ver), quiet))
def build_sequence(master_config, temp, quiet): """ iscsi build sequence @arg: dict @arg: dict @arg: string @return: bool """ zero = int('0') ret = True if os.path.isfile('%s/open-iscsi-%s.tar.gz' % (utils.get_distdir(temp), str(master_config['iscsi_ver']))) is not True: ret = download(master_config['iscsi_ver'], temp, quiet) if ret is not zero: print(red('error: ')+'initramfs.iscsi.download() failed') sys.exit(2) ret = extract(master_config['iscsi_ver'], temp, quiet) ret = zero # grr, tar thing to not return 0 ret = compile(temp['work'] + '/open-iscsi-' + master_config['iscsi_ver'], master_config, quiet) if ret is not zero: print(red('error: ')+'initramfs.iscsi.compile() failed') sys.exit(2) # TODO remove manpage rm -rf %s/iscsi/man % temp['work'] ret = strip(master_config, temp) if ret is not zero: print(red('error: ')+'initramfs.iscsi.strip() failed') sys.exit(2) ret = compress(master_config, temp, quiet) if ret is not zero: print(red('error: ')+'initramfs.iscsi.compress() failed') sys.exit(2) ret = cache(temp['work'] + '/open-iscsi-' + master_config['iscsi_ver'], master_config, temp, quiet) if ret is not zero: print(red('error: ')+'initramfs.iscsi.compress() failed') sys.exit(2) return ret
def download(unionfs_fuse_ver, temp, verbose): """ Download unionfs-fuse tarball @arg unionfs_fuse_ver string @arg verbose string @return: bool """ print green(' * ') + '... unionfs_fuse.download' # TODO: get GENTOO_MIRRORS from portageq (better if I could import a portage module) unionfs_fuse_url = 'http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-' + str(unionfs_fuse_ver) + '.tar.bz2' return os.system('/usr/bin/wget %s -O %s/unionfs-fuse-%s.tar.bz2 %s' % (unionfs_fuse_url, utils.get_distdir(temp), str(unionfs_fuse_ver), verbose['std']))
def download(self): """ Download device-mapper tarball @return: bool """ print(green(' * ') + '... device_mapper.download') # TODO: get GENTOO_MIRRORS from portageq (better if I could import a portage module) device_mapper_url = 'http://ftp.snt.utwente.nl/pub/os/linux/gentoo/distfiles/device-mapper.' + self.dm_ver + '.tgz' return os.system('/usr/bin/wget %s -O %s/device-mapper.%s.tgz %s' % (device_mapper_url, utils.get_distdir(self.temp), self.dm_ver, self.verbose['std']))