def rpmbbnt(spec,buildid,rpmbuild,hostname): chroot.chrootcmd(hostname,rpmbuild + ' -bb --clean --define \\"_topdir ' + builddir + '\\" ' + '--define \\"_mvl_build_id ' + buildid + '\\" ' + '--define \\"vendor MontaVista Software, Inc.\\" ' + '--define \\"packager <*****@*****.**>\\" ' + '--define \\"_builddir ' + builddir + '/BUILD\\" ' + '--define \\"_rpmdir ' + builddir + '/RPMS\\" ' + '--define \\"_mvl_host_os_build ' + hostname + '\\" ' + spec) return chroot.wrotecheck(hostname)
def rpminst_q(rpm,rpmbin,hostname): chroot.chrootcmd(hostname,rpmbin + ' -U ' + rpm)
def uninst(installdir,hostname): print 'uninstalling previous build...' sys.__stdout__.flush() chroot.chrootcmd(hostname,'rm -rf ' + installdir + '/*')
def rpminstall(chrootpath,installpath,rpm,rpmbin,hostname): if os.path.exists(chrootpath): chroot.chrootcmd(hostname,rpmbin + ' -Uvh ' + installpath + '/' + rpm)
#---------------------------------------- # common-rpm #---------------------------------------- # If build is a foundation build, common-rpm must be built # # To build common-rpm, copy the userland/rpm directories to the chroot environment # then build common-rpm, install it with rpm2cpio, then rebuild it using common-rpm # bootstrapcrossrpm = 0 if product in ('fe','dev'): os.system('cp -a %s/rpm/* %s/%s' % (userpath,chrootdir,builddir)) os.system('mkdir -p %s/%s/BUILD %s/%s/RPMS' % (chrootdir,builddir,chrootdir,builddir)) buildutils.mstart('bootstrap-common-rpm') if rpmbbnt(builddir + '/SPECS/common-rpm.spec',buildid,sysrpm,hostname): chroot.chrootcmd(hostname,'cd /; rpm2cpio ' + builddir + '/RPMS/i386/common-rpm-4* | cpio -iud') chroot.chrootcmd(hostname,'cd /; rpm2cpio ' + builddir + '/RPMS/i386/common-rpm-dev* | cpio -iud') chroot.chrootcmd(hostname,'cd /; rpm2cpio ' + builddir + '/RPMS/i386/common-rpm-build* | cpio -iud') print 'BUILT: common-rpm for ' + hostname + ' built.' else: print 'BUILD ERROR: common-rpm for ' + hostname + ' did not build.' bootstrapcrossrpm = 1 sys.__stdout__.flush() buildutils.mstop('bootstrap-common-rpm') if bootstrapcrossrpm: print 'boostrap build for common-rpm failed, stopping build.' touchresultfile('failed') sys.exit(1) else: # use common-rpm to build common-rpm os.system('rm -rf %s/%s/BUILD %s/%s/RPMS' % (chrootdir,builddir,chrootdir,builddir))