Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Wold, Saul" <saul.wold@intel.com>
To: "Sullivan, California L" <california.l.sullivan@intel.com>,
	"openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH v2 2/2] install*.sh: add short sleep after parted commands
Date: Tue, 21 Nov 2017 23:04:10 +0000	[thread overview]
Message-ID: <1511305448.11515.4.camel@intel.com> (raw)
In-Reply-To: <20171121230209.4097-1-california.l.sullivan@intel.com>


Much better!

Sau!

On Tue, 2017-11-21 at 15:02 -0800, California Sullivan wrote:
> I wasn't able to install to my Optane SSD due to the following error:
> 
> Formatting /dev/nvme0n1p1 to vfat...
> mkfs.fat 4.1 (2017-01-24)
> mkfs.vfat: unable to open /dev/nvme0n1p1: No such file or directory
> Target install-efi failed
> 
> A couple lines later I see:
> 
> [    10.265401]  nvme0n1: p1 p2 p3
> 
> Then looking at the device itself after booting from a USB stick:
> 
> root@intel-corei7-64: ~# ls /dev/nvme0n1*
> /dev/nvme0n1 /dev/nvme0n1p1 /dev/nvme0n1p2 /dev/nvme0n1p3
> 
> So it looks like the parted commands return before the device node is
> actually created.
> 
> Work around this issue by waiting for device nodes for a short
> duration.
> 
> Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
> ---
> v2: sleep conditionally for up to three seconds instead of one second
> unconditionally. This makes it so if the device nodes are available
> immediately, people don't have to wait, but a system has up to three
> seconds to create them before failing. 
> 
>  meta/recipes-core/initrdscripts/files/init-install-efi.sh | 7
> +++++++
>  meta/recipes-core/initrdscripts/files/init-install.sh     | 7
> +++++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/meta/recipes-core/initrdscripts/files/init-install-
> efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
> index 5ad3a60..706418f 100644
> --- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
> +++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
> @@ -186,6 +186,13 @@ parted ${device} mkpart swap linux-swap
> $swap_start 100%
>  
>  parted ${device} print
>  
> +echo "Waiting for device nodes..."
> +C=0
> +while [ $C -ne 3 ] && [ ! -e $bootfs  -o ! -e $rootfs -o ! -e $swap
> ]; do
> +    C=$(( C + 1 ))
> +    sleep 1
> +done
> +
>  echo "Formatting $bootfs to vfat..."
>  mkfs.vfat $bootfs
>  
> diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh
> b/meta/recipes-core/initrdscripts/files/init-install.sh
> index 1cac806..dade059 100644
> --- a/meta/recipes-core/initrdscripts/files/init-install.sh
> +++ b/meta/recipes-core/initrdscripts/files/init-install.sh
> @@ -211,6 +211,13 @@ parted ${device} mkpart $pname linux-swap
> $swap_start 100%
>  
>  parted ${device} print
>  
> +echo "Waiting for device nodes..."
> +C=0
> +while [ $C -ne 3 ] && [ ! -e $bootfs  -o ! -e $rootfs -o ! -e $swap
> ]; do
> +    C=$(( C + 1 ))
> +    sleep 1
> +done
> +
>  echo "Formatting $bootfs to ext3..."
>  mkfs.ext3 $bootfs
>  

  reply	other threads:[~2017-11-21 23:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 21:47 [PATCH 1/2] init-install: fix grub-install command California Sullivan
2017-11-21 21:47 ` [PATCH 2/2] install*.sh: add short sleep after parted commands California Sullivan
2017-11-21 22:27   ` Saul Wold
2017-11-21 23:02 ` [PATCH v2 " California Sullivan
2017-11-21 23:04   ` Wold, Saul [this message]
2017-12-07 18:19 ` [PATCH 1/2] init-install: fix grub-install command Cal Sullivan

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=1511305448.11515.4.camel@intel.com \
    --to=saul.wold@intel.com \
    --cc=california.l.sullivan@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