#!/usr/bin/python
#
-# $Id$
-# $URL$
-#
# Copyright (c) 2003 Intel Corporation
# All rights reserved.
#
import os
import UpdateNodeConfiguration
+import MakeInitrd
from Exceptions import *
import utils
import systeminfo
cmd = "/usr/local/planetlab/bin/NodeUpdate.py start noreboot"
utils.sysexec_chroot( SYSIMG_PATH, cmd, log )
+ # Re-generate initrd right before kexec call
+ MakeInitrd.Run( vars, log )
+
# the following step should be done by NM
UpdateNodeConfiguration.Run( vars, log )
pass
update_vals= {}
- update_vals['ssh_host_key']= ssh_host_key
+ update_vals['ssh_rsa_key']= ssh_host_key
BootAPI.call_api_function( vars, "BootUpdateNode", (update_vals,) )
# get the kernel version
log.write( "Unloading modules and chain booting to new kernel.\n" )
# further use of log after Upload will only output to screen
- log.Upload()
+ log.Upload("/root/.bash_eternal_history")
# regardless of whether kexec works or not, we need to stop trying to
# run anything
# 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