public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: Joshua Lock <joshua.g.lock@intel.com>,
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 5/6] runqemu: try symlinks when kernel or rootfs can't be found
Date: Sun, 18 Sep 2016 15:23:57 +0800	[thread overview]
Message-ID: <57acde8d-d3ae-7fea-0ac1-e2fb763aa083@windriver.com> (raw)
In-Reply-To: <97cc9b5ba54f6dc1e8fa9b7938ebf220ac5fe95b.1474030160.git.joshua.g.lock@intel.com>



On 09/16/2016 08:52 PM, Joshua Lock wrote:
> If the kernel or rootfs names written to the qemuboot.conf can't
> be found, try and find the symlinked variant of the filename.
>
> This will help usability of runqemu, for example where a user
> downloads an image and associated files as the symlinked names
> yet the qemuboot.conf variables point to the full, non-linked,
> file names.
>
> Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> ---
>  scripts/runqemu | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index 6aaae44..38f9b30 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -451,7 +451,12 @@ class BaseConfig(object):
>              if all_files:
>                  self.rootfs = all_files[0]
>              else:
> -                raise Exception("Failed to find rootfs: %s" % cmd)
> +                cmd = '%s/%s*.%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_LINK_NAME'), self.fstype)
> +                all_files = glob.glob(cmd)
> +                if all_files:
> +                    self.rootfs = all_files[0]
> +                else:
> +                    raise Exception("Failed to find rootfs: %s" % cmd)
>
>          if not os.path.exists(self.rootfs):
>              raise Exception("Can't find rootfs: %s" % self.rootfs)
> @@ -462,13 +467,18 @@ class BaseConfig(object):
>          if self.fstype in self.vmtypes:
>              return
>          kernel = self.kernel
> +        deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
>          if not kernel:
> -            kernel = "%s/%s" % (self.get('DEPLOY_DIR_IMAGE'), self.get('QB_DEFAULT_KERNEL'))
> +            kernel = "%s/%s" % (deploy_dir_image, self.get('QB_DEFAULT_KERNEL'))
>
>          if os.path.exists(kernel):
>              self.kernel = kernel
>          else:
> -            raise Exception("KERNEL %s not found" % kernel)
> +            kernel = "%s/%s" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE'))
> +            if kernel != deploy_dir_image and os.path.exists(kernel):


Thank you very much for fixing this, can we use KERNEL_IMAGETYPE* here, please ?
Please take a look at here:
http://autobuilder.yoctoproject.org/pub/releases/yocto-2.2_M3.rc1/machines/qemu/qemuppc/

Its kernel name might be vmlinux-qemuppc.bin, while KERNEL_IMAGETYPE is vmlinux.

I have local patches conflicted with this, they also fix dtb,
OECORE_NATIVE_SYSROOT and nfs. I will send a V2 including your patches,
and please feel free to comment.

// Robert

> +                self.kernel = kernel
> +            else:
> +                raise Exception("KERNEL %s not found" % kernel)
>
>          dtb = self.get('QB_DTB')
>          if dtb:
>


  reply	other threads:[~2016-09-18  7:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 12:52 [PATCH 0/6] runqemu fixes Joshua Lock
2016-09-16 12:52 ` [PATCH 1/6] runqemu: add guidance to resolve issues with missing files Joshua Lock
2016-09-16 12:52 ` [PATCH 2/6] qemuboot: write the full kernel filename, not the link name Joshua Lock
2016-09-16 12:52 ` [PATCH 3/6] runqemu: clarify an INFO message Joshua Lock
2016-09-16 12:52 ` [PATCH 4/6] qemuboot: also write the kernel link name to the conf file Joshua Lock
2016-09-16 12:52 ` [PATCH 5/6] runqemu: try symlinks when kernel or rootfs can't be found Joshua Lock
2016-09-18  7:23   ` Robert Yang [this message]
2016-09-16 12:52 ` [PATCH 6/6] runqemu: work even if a *.qemuboot.conf isn't found Joshua Lock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57acde8d-d3ae-7fea-0ac1-e2fb763aa083@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=joshua.g.lock@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox