]> code.ossystems Code Review - openembedded-core.git/commitdiff
install*.sh: add short sleep after parted commands
authorCalifornia Sullivan <california.l.sullivan@intel.com>
Tue, 21 Nov 2017 23:02:09 +0000 (15:02 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 2 Dec 2017 11:24:36 +0000 (11:24 +0000)
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>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/initrdscripts/files/init-install-efi.sh
meta/recipes-core/initrdscripts/files/init-install.sh

index 5ad3a60c0558c7782c5fbdd8dbed9b64ef556bca..706418fa9c505885f81ed59d945dbbfe17d646b9 100644 (file)
@@ -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
 
index 1cac8064a224cbbbab9ca73c80ed8136d63367e2..dade059c8f1fc9e06d3323741f284e8ca6060dd5 100644 (file)
@@ -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