raw: use relative path to the kernel image in extlinux.conf
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 19 Feb 2013 13:59:58 +0000 (15:59 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 19 Feb 2013 14:15:01 +0000 (16:15 +0200)
Currently raw image creator works only when there is a separate boot parition.
But when /boot is in the root partition, extlinux is unable to boot the kernel.

The reason of this is that in extlinux.conf MIC specify the absolute path to
the vmlinuz file - '/vmlinuz', which of course does not work when the correct
path is '/boot/vmlinuz'.

The fix seems to be easy - for extlinux the current directory is where the
'syslinux.conf' file is situated. And we know that the 'vmlinuz' file is one
level up. So all we need to do is to ask extlinux to take the look one level
up, i.e., take '../vmlinuz'.

This patch was tested in both configurations - with and without a separate boot
partition.

Change-Id: Ia87d053b46f7712aa491c38ed13ca6cd61c5b7ba
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
mic/imager/raw.py

index b1d28be..2f2b78c 100644 (file)
@@ -271,7 +271,7 @@ class RawImageCreator(BaseImageCreator):
             v = os.path.realpath(symkern).replace('%s-' % symkern, "")
             syslinux_conf += "label %s\n" % self.distro_name.lower()
             syslinux_conf += "\tmenu label %s (%s)\n" % (self.distro_name, v)
-            syslinux_conf += "\tlinux /vmlinuz\n"
+            syslinux_conf += "\tlinux ../vmlinuz\n"
             if self._ptable_format == 'msdos':
                 rootstr = rootdev
             else:
@@ -293,7 +293,7 @@ class RawImageCreator(BaseImageCreator):
                 syslinux_conf += "label %s%d\n" \
                                  % (self.distro_name.lower(), footlabel)
                 syslinux_conf += "\tmenu label %s (%s)\n" % (self.distro_name, v)
-                syslinux_conf += "\tlinux vmlinuz-%s\n" % v
+                syslinux_conf += "\tlinux ../vmlinuz-%s\n" % v
                 syslinux_conf += "\tappend ro root=%s %s\n" \
                                  % (rootdev, options)
                 if footlabel == 0: