git://git.onelab.eu
/
bootmanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bugfixes for the location of kernel and initrd as observed on recent f23
[bootmanager.git]
/
source
/
steps
/
ChainBootNode.py
diff --git
a/source/steps/ChainBootNode.py
b/source/steps/ChainBootNode.py
index
f21a2ff
..
1fa9609
100644
(file)
--- a/
source/steps/ChainBootNode.py
+++ b/
source/steps/ChainBootNode.py
@@
-78,7
+78,7
@@
def Run(vars, log):
# simply creating an instance of this class and listing the system
# block devices will make them show up so vgscan can find the planetlab
# volume group
# simply creating an instance of this class and listing the system
# block devices will make them show up so vgscan can find the planetlab
# volume group
- systeminfo.get_block_device
_lis
t(vars, log)
+ systeminfo.get_block_device
s_dic
t(vars, log)
utils.sysexec("vgscan", log)
utils.sysexec("vgchange -ay planetlab", log)
utils.sysexec("vgscan", log)
utils.sysexec("vgchange -ay planetlab", log)
@@
-95,6
+95,8
@@
def Run(vars, log):
ROOT_MOUNTED = 1
vars['ROOT_MOUNTED'] = 1
ROOT_MOUNTED = 1
vars['ROOT_MOUNTED'] = 1
+ utils.display_disks_status(PARTITIONS, "In ChainBootNode", log)
+
# write out the session value /etc/planetlab/session
try:
session_file_path = "{}/{}/session".format(SYSIMG_PATH, PLCONF_DIR)
# write out the session value /etc/planetlab/session
try:
session_file_path = "{}/{}/session".format(SYSIMG_PATH, PLCONF_DIR)
@@
-166,17
+168,24
@@
def Run(vars, log):
major_version = int(kversion[0]) # Check if the string looks like a kernel version
except:
# Try a different method for non-rpm-based distributions
major_version = int(kversion[0]) # Check if the string looks like a kernel version
except:
# Try a different method for non-rpm-based distributions
- kversion = os.popen("ls -lrt {}/lib/modules | tail -1 | awk '{
print $9;
}'"\
+ kversion = os.popen("ls -lrt {}/lib/modules | tail -1 | awk '{
{print $9;}
}'"\
.format(SYSIMG_PATH)).read().rstrip()
.format(SYSIMG_PATH)).read().rstrip()
- utils.sysexec("cp {}/boot/vmlinuz-{} /tmp/kernel".format(SYSIMG_PATH, kversion), log)
- candidates = []
+ # kernel and initrd come in various locations depending on the distro
+
+ kernel_candidates = []
+ kernel_candidates.append("/boot/vmlinux-{}*".format(kversion))
+ # on f23 starting dec. 2015 - what a twisted naming scheme
+ kernel_candidates.append("/boot/*/{}*/initrd".format(kversion))
+
+ initrd_candidates = []
# f16/18: expect initramfs image here
# f16/18: expect initramfs image here
- candidates.append ("/boot/initramfs-{}.img".format(kversion))
+
initrd_
candidates.append ("/boot/initramfs-{}.img".format(kversion))
# f20: uses a uid of some kind, e.g. /boot/543f88c129de443baaa65800cf3927ce/<kversion>/initrd
# f20: uses a uid of some kind, e.g. /boot/543f88c129de443baaa65800cf3927ce/<kversion>/initrd
- candidates.append ("/boot/*/{}/initrd".format(kversion))
+
initrd_
candidates.append ("/boot/*/{}/initrd".format(kversion))
# Ubuntu:
# Ubuntu:
- candidates.append ("/boot/initrd.img-{}".format(kversion))
+ initrd_candidates.append ("/boot/initrd.img-{}".format(kversion))
+
def find_file_in_sysimg (candidates):
import glob
for pattern in candidates:
def find_file_in_sysimg (candidates):
import glob
for pattern in candidates:
@@
-184,7
+193,15
@@
def Run(vars, log):
log.write("locating initrd: found {} matches in {}\n".format(len(matches), pattern))
if matches:
return matches[0]
log.write("locating initrd: found {} matches in {}\n".format(len(matches), pattern))
if matches:
return matches[0]
- initrd = find_file_in_sysimg(candidates)
+
+ kernel = find_file_in_sysimg(kernel_candidates)
+ if kernel:
+ utils.sysexec("cp {} /tmp/kernel".format(kernel), log)
+ else:
+ raise Exception("Unable to locate kernel - bailing out")
+
+
+ initrd = find_file_in_sysimg(initrd_candidates)
if initrd:
utils.sysexec("cp {} /tmp/initrd".format(initrd), log)
else:
if initrd:
utils.sysexec("cp {} /tmp/initrd".format(initrd), log)
else:
@@
-295,7
+312,7
@@
def Run(vars, log):
log.write("Couldn't read /proc/modules, continuing.\n")
log.write("Couldn't read /proc/modules, continuing.\n")
- kargs = "root={} ramdisk_size=8192".format(PARTITIONS["
mapper-
root"])
+ kargs = "root={} ramdisk_size=8192".format(PARTITIONS["root"])
if NODE_MODEL_OPTIONS & ModelOptions.SMP:
kargs = kargs + " " + "acpi=off"
try:
if NODE_MODEL_OPTIONS & ModelOptions.SMP:
kargs = kargs + " " + "acpi=off"
try: