From: soltesz@opentechinstitute.org Date: Thu, 21 Feb 2013 22:12:32 +0000 (-0500) Subject: get nodeimage kernel version using nodeimage rpm via chroot; this avoids rpm-db versi... X-Git-Tag: bootmanager-5.1-5~1 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8d7b2fd42d34d90569595431dd99ca8634231bc3;hp=6869ff2f5465312ac4975a6de6cfb51452122720;p=bootmanager.git get nodeimage kernel version using nodeimage rpm via chroot; this avoids rpm-db version mis-matches between bootimage & nodeimage --- diff --git a/source/steps/ChainBootNode.py b/source/steps/ChainBootNode.py index 94c3e27..4c2149a 100644 --- a/source/steps/ChainBootNode.py +++ b/source/steps/ChainBootNode.py @@ -150,7 +150,8 @@ def Run( vars, log ): option = 'smp' log.write( "Copying kernel and initrd for booting.\n" ) - kversion = os.popen('rpm -r /tmp/mnt/sysimg -qa kernel | tail -1 | cut -c 8-').read().rstrip() + # Use chroot to call rpm, b/c the bootimage&nodeimage rpm-versions may not work together + kversion = os.popen("chroot %s rpm -qa kernel | tail -1 | cut -c 8-" % SYSIMG_PATH).read().rstrip() utils.sysexec( "cp %s/boot/vmlinuz-%s /tmp/kernel" % (SYSIMG_PATH,kversion), log ) utils.sysexec( "cp %s/boot/initramfs-%s.img /tmp/initrd" % (SYSIMG_PATH,kversion), log ) diff --git a/source/steps/ValidateNodeInstall.py b/source/steps/ValidateNodeInstall.py index 5f63598..2ca2b7a 100644 --- a/source/steps/ValidateNodeInstall.py +++ b/source/steps/ValidateNodeInstall.py @@ -137,7 +137,8 @@ def Run( vars, log ): # these 2 links are created by our kernel's post-install scriplet log.write("Checking for a custom kernel\n") try: - kversion = os.popen('rpm -r /tmp/mnt/sysimg -qa kernel | tail -1 | cut -c 8-').read().rstrip() + # Use chroot to call rpm, b/c the bootimage&nodeimage rpm-versions may not work together + kversion = os.popen("chroot %s rpm -qa kernel | tail -1 | cut -c 8-" % SYSIMG_PATH).read().rstrip() os.stat("%s/boot/vmlinuz-%s" % (SYSIMG_PATH,kversion)) except OSError, e: log.write( "Couldn't locate base kernel (you might be using the stock kernel).\n")