Patchwork [20/20] udev: don't halt if devtmpfs can't be mounted

login
register
mail settings
Submitter Ben Shelton
Date Aug. 4, 2014, 6:41 p.m.
Message ID <9288a31de2b502a43e9d0067ff9c1378133d00a4.1407177403.git.ben.shelton@ni.com>
Download mbox | patch
Permalink /patch/77255/
State New
Headers show

Comments

Ben Shelton - Aug. 4, 2014, 6:41 p.m.
From: Richard Tollerton <rich.tollerton@ni.com>

Halting if udev cannot start is problematic for a couple reasons.
- Compared to a reboot loop, halting is much more difficult to recover
  from in remote deployments.
- If the rootfs has a prepopulated /dev (which happens somewhat often),
  the system may be able to boot up just fine, or at least fine enough
  for the administrator to log in and fix things.

Instead of halting, just exit, and let the administrator deal with the
potential reboot loop.

Natinst-Rally-ID: TA44427
Acked-by: Gratian Crisan <gratian.crisan@ni.com>
Acked-by: Scot Salmon <scot.salmon@ni.com>
Natinst-ReviewBoard-ID: 58623
Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
---
 meta/recipes-core/udev/udev/init | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Martin Jansa - Aug. 4, 2014, 7:40 p.m.
On Mon, Aug 04, 2014 at 01:41:12PM -0500, Ben Shelton wrote:
> From: Richard Tollerton <rich.tollerton@ni.com>
> 
> Halting if udev cannot start is problematic for a couple reasons.
> - Compared to a reboot loop, halting is much more difficult to recover
>   from in remote deployments.
> - If the rootfs has a prepopulated /dev (which happens somewhat often),
>   the system may be able to boot up just fine, or at least fine enough
>   for the administrator to log in and fix things.
> 
> Instead of halting, just exit, and let the administrator deal with the
> potential reboot loop.
> 
> Natinst-Rally-ID: TA44427
> Acked-by: Gratian Crisan <gratian.crisan@ni.com>
> Acked-by: Scot Salmon <scot.salmon@ni.com>
> Natinst-ReviewBoard-ID: 58623
> Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
> ---
>  meta/recipes-core/udev/udev/init | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
> index 6caf7d5..f6a8391 100644
> --- a/meta/recipes-core/udev/udev/init
> +++ b/meta/recipes-core/udev/udev/init
> @@ -45,8 +45,7 @@ case "$1" in
>      if ! grep -q devtmpfs /proc/filesystems
>      then
>          echo "Missing devtmpfs, which is required for udev to run";
> -        echo "Halting..."
> -        halt
> +	exit 1

Please use spaces for indentation like previous lines.

>      fi
>      # mount the devtmpfs on /dev, if not already done
>      LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {
> -- 
> 2.0.4
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
index 6caf7d5..f6a8391 100644
--- a/meta/recipes-core/udev/udev/init
+++ b/meta/recipes-core/udev/udev/init
@@ -45,8 +45,7 @@  case "$1" in
     if ! grep -q devtmpfs /proc/filesystems
     then
         echo "Missing devtmpfs, which is required for udev to run";
-        echo "Halting..."
-        halt
+	exit 1
     fi
     # mount the devtmpfs on /dev, if not already done
     LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {