# kargs, which is ramdisk_size=8192
pass
- utils.sysexec_noerr( 'hwclock --systohc --utc ' )
+ utils.sysexec_noerr( 'hwclock --systohc --utc ', log )
utils.breakpoint ("Before kexec");
try:
- utils.sysexec( 'kexec --force --initrd=/tmp/initrd ' \
- '--append="%s" /tmp/kernel' % kargs)
+ utils.sysexec( 'kexec --force --initrd=/tmp/initrd --append="%s" /tmp/kernel' % kargs, log)
except BootManagerException, e:
# if kexec fails, we've shut the machine down to a point where nothing
# can run usefully anymore (network down, all modules unloaded, file
utils.makedirs(SYSIMG_PATH + "/etc/pki/rpm-gpg")
utils.sysexec("gpg --homedir=/root --export --armor" \
" --no-default-keyring --keyring %s/usr/boot/pubring.gpg" \
- " >%s/etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab" % (SYSIMG_PATH, SYSIMG_PATH))
- utils.sysexec_chroot(SYSIMG_PATH, "rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab")
+ " >%s/etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab" % (SYSIMG_PATH, SYSIMG_PATH), log)
+ utils.sysexec_chroot(SYSIMG_PATH, "rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab", log)
return 1
except OSError, e:
pass
- utils.sysexec_noerr( "umount %s/proc" % SYSIMG_PATH )
- utils.sysexec_noerr( "umount %s/mnt/cdrom" % SYSIMG_PATH )
- utils.sysexec_noerr( "umount %s/vservers" % SYSIMG_PATH )
- utils.sysexec_noerr( "umount %s" % SYSIMG_PATH )
+ utils.sysexec_noerr( "umount %s/proc" % SYSIMG_PATH , log )
+ utils.sysexec_noerr( "umount %s/mnt/cdrom" % SYSIMG_PATH , log )
+ utils.sysexec_noerr( "umount %s/vservers" % SYSIMG_PATH , log )
+ utils.sysexec_noerr( "umount %s" % SYSIMG_PATH , log )
vars['ROOT_MOUNTED']= 0
# log.write( "Removing any old files, directories\n" )
# for centos5.3
# 14:42:27(UTC) No module dm-mem-cache found for kernel 2.6.22.19-vs2.3.0.34.33.onelab, aborting.
# http://kbase.redhat.com/faq/docs/DOC-16528;jsessionid=7E984A99DE8DB094D9FB08181C71717C.ab46478d
-def bypassRaidIfNeeded(sysimg_path):
+def bypassRaidIfNeeded(sysimg_path, log):
try:
[ a,b,c,d]=file('%s/etc/redhat-release'%sysimg_path).readlines()[0].strip().split()
if a !='CentOS': return
[major,minor]=[int(x) for x in c.split('.')]
if minor >= 3:
- utils.sysexec_noerr('echo "DMRAID=no" >> %s/etc/sysconfig/mkinitrd/noraid' % sysimg_path)
- utils.sysexec_noerr('chmod 755 %s/etc/sysconfig/mkinitrd/noraid' % sysimg_path)
+ utils.sysexec_noerr('echo "DMRAID=no" >> %s/etc/sysconfig/mkinitrd/noraid' % sysimg_path , log )
+ utils.sysexec_noerr('chmod 755 %s/etc/sysconfig/mkinitrd/noraid' % sysimg_path, log )
except:
pass
print "%s/boot/%s is already removed" % (SYSIMG_PATH, initrd)
# hack for CentOS 5.3
- bypassRaidIfNeeded(SYSIMG_PATH)
+ bypassRaidIfNeeded(SYSIMG_PATH , log )
utils.sysexec_chroot( SYSIMG_PATH, "mkinitrd -v --allow-missing /boot/initrd-%s.img %s" % \
(kernel_version, kernel_version), log )
- utils.sysexec_noerr("umount %s/sys" % SYSIMG_PATH)
- utils.sysexec_noerr("umount %s/dev" % SYSIMG_PATH)
+ utils.sysexec_noerr("umount %s/sys" % SYSIMG_PATH , log )
+ utils.sysexec_noerr("umount %s/dev" % SYSIMG_PATH , log)
# 2.6.22/f8 root environment. files randomly show up with the
# immutible attribute set. this clears it before trying to write
# the files below.
- utils.sysexec( "chattr -i %s/etc/hosts" % vserver_dir )
- utils.sysexec( "chattr -i %s/etc/resolv.conf" % vserver_dir )
+ utils.sysexec( "chattr -i %s/etc/hosts" % vserver_dir , log )
+ utils.sysexec( "chattr -i %s/etc/resolv.conf" % vserver_dir , log )
except:
pass
try:
# first run fsck to prevent fs corruption from hanging mount...
log.write( "fsck %s file system\n" % filesystem )
- utils.sysexec("e2fsck -v -p %s" % (PARTITIONS[filesystem]),log, True)
+ utils.sysexec("e2fsck -v -p %s" % (PARTITIONS[filesystem]), log, fsck=True)
except BootManagerException, e:
log.write( "BootManagerException during fsck of %s (%s) filesystem : %s\n" %
(filesystem, PARTITIONS[filesystem], str(e)) )
try:
log.write( "Trying to recover filesystem errors on %s\n" % filesystem )
- utils.sysexec("e2fsck -v -y %s" % (PARTITIONS[filesystem]),log, True)
+ utils.sysexec("e2fsck -v -y %s" % (PARTITIONS[filesystem]),log, fsck=True)
except BootManagerException, e:
log.write( "BootManagerException during trying to recover filesystem errors on %s (%s) filesystem : %s\n" %
(filesystem, PARTITIONS[filesystem], str(e)) )