Patchwork [11/16] udev: ensure /dev/pts and /dev/shm does exists

login
register
mail settings
Submitter Otavio Salvador
Date Dec. 28, 2011, 7:55 p.m.
Message ID <595333f997b8f8f2ecfbb361ad8a7ccfb33a993e.1325101674.git.otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/17729/
State New
Headers show

Comments

Otavio Salvador - Dec. 28, 2011, 7:55 p.m.
---
 meta/recipes-core/udev/udev/init |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
Richard Purdie - Jan. 4, 2012, 5:12 p.m.
On Wed, 2011-12-28 at 19:55 +0000, Otavio Salvador wrote:
> ---
>  meta/recipes-core/udev/udev/init |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
> index d0d7e5d..c2b491e 100644
> --- a/meta/recipes-core/udev/udev/init
> +++ b/meta/recipes-core/udev/udev/init
> @@ -30,9 +30,10 @@ echo -n "Starting udev"
>  # mount the tmpfs on /dev, if not already done
>  LANG=C awk '$2 == "/dev" && ($3 == "tmpfs" || $3 == "devtmpfs") { exit 1 }' /proc/mounts && {
>  	mount -n -o mode=0755 -t tmpfs none "/dev"
> -	mkdir -m 0755 /dev/pts
> -	mkdir -m 1777 /dev/shm
>  }
> +mkdir -p -m 0755 /dev/pts
> +mkdir -p -m 1777 /dev/shm
> +

Please put an if [ -e ] around these since its a couple of exec calls we
could do without if they already exist...

Cheers,

Richard
Otavio Salvador - Jan. 5, 2012, 4:59 p.m.
On Wed, Jan 4, 2012 at 15:12, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> Please put an if [ -e ] around these since its a couple of exec calls we
> could do without if they already exist...
>

Done locally, will send it soon.

Patch

diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
index d0d7e5d..c2b491e 100644
--- a/meta/recipes-core/udev/udev/init
+++ b/meta/recipes-core/udev/udev/init
@@ -30,9 +30,10 @@  echo -n "Starting udev"
 # mount the tmpfs on /dev, if not already done
 LANG=C awk '$2 == "/dev" && ($3 == "tmpfs" || $3 == "devtmpfs") { exit 1 }' /proc/mounts && {
 	mount -n -o mode=0755 -t tmpfs none "/dev"
-	mkdir -m 0755 /dev/pts
-	mkdir -m 1777 /dev/shm
 }
+mkdir -p -m 0755 /dev/pts
+mkdir -p -m 1777 /dev/shm
+
 
 if [ -e /etc/dev.tar ]; then
 	(cd /; tar xf /etc/dev.tar 2>&1 | grep -v 'time stamp' || true)