[oe-commits] [openembedded-core] 28/44: install*.sh: add short sleep after parted commands

git at git.openembedded.org git at git.openembedded.org
Sat Dec 2 11:27:00 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 9daafd49b448122e35d67a1637ce2212793a4dc5
Author: California Sullivan <california.l.sullivan at intel.com>
AuthorDate: Tue Nov 21 15:02:09 2017 -0800

    install*.sh: add short sleep after parted commands
    
    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 at 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 at intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 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
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list