All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch 0727d35de ("Make initramfs honor CONFIG_DEVTMPFS_MOUNT") breaks boot
@ 2017-05-22 12:05 Yury Norov
  2017-05-23  2:07 ` Rob Landley
       [not found] ` <CAP2kuOwkM7hr5nOtrRSRdXcPi2y3KHVf4yFdDN1JW1o_mWo0yw@mail.gmail.com>
  0 siblings, 2 replies; 13+ messages in thread
From: Yury Norov @ 2017-05-22 12:05 UTC (permalink / raw)
  To: Rob Landley
  Cc: Andrew Morton, linux-kernel, Prarit Bhargava, Yang Shi,
	Rasmus Villemoes, Kees Cook, Emese Revfy, Petr Mladek,
	Fabian Frederick

Hi Rob, 

I found that next-20170522 fails to boot on arm64 machine with the
following log:
[...]
[4.179509] Freeing unused kernel memory: 1088K
Loading, please wait...
mount: mounting udev on /dev failed: Device or resource busy
W: devtmpfs not available, falling back to tmpfs for /dev
Couldn't get a file descriptor referring to the console
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running
/scripts/local-top ... done.
chvt: can't open console
Gave up waiting for root device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
   - Check root= (did the system wait for the right device?)
 - Missing modules (cat /proc/modules; ls /dev)
chvt: can't open console
ALERT!  /dev/sda does not exist.  Dropping to a shell!
Couldn't get a file descriptor referring to the console


BusyBox v1.21.1 (Ubuntu 1:1.21.0-1ubuntu1) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs)

Bisect points to your patch (attached below). If I revert it, everything
becomes fine. If you need to know something more about my environment,
feel free to ask me.

Yury

On Thu, May 11, 2017 at 12:05:03PM -0500, Rob Landley wrote:
> From: Rob Landley <rob@landley.net>
> 
> Make initramfs honor CONFIG_DEVTMPFS_MOUNT, move /dev/console
> open after devtmpfs mount, and update help text.
> 
> Signed-off-by: Rob Landley <rob@landley.net>
> ---
> 
>  drivers/base/Kconfig |   14 ++++----------
>  init/main.c          |   15 +++++++++------
>  2 files changed, 13 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
> index d718ae4..74779ee 100644
> --- a/drivers/base/Kconfig
> +++ b/drivers/base/Kconfig
> @@ -48,16 +48,10 @@ config DEVTMPFS_MOUNT
>  	bool "Automount devtmpfs at /dev, after the kernel mounted the rootfs"
>  	depends on DEVTMPFS
>  	help
> -	  This will instruct the kernel to automatically mount the
> -	  devtmpfs filesystem at /dev, directly after the kernel has
> -	  mounted the root filesystem. The behavior can be overridden
> -	  with the commandline parameter: devtmpfs.mount=0|1.
> -	  This option does not affect initramfs based booting, here
> -	  the devtmpfs filesystem always needs to be mounted manually
> -	  after the rootfs is mounted.
> -	  With this option enabled, it allows to bring up a system in
> -	  rescue mode with init=/bin/sh, even when the /dev directory
> -	  on the rootfs is completely empty.
> +	  Automatically mount devtmpfs at /dev on the root filesystem, which
> +	  lets the system come up in rescue mode with [rd]init=/bin/sh.
> +	  Override with devtmpfs.mount=0 on the commandline. Initramfs can
> +	  create a /dev dir as needed, other rootfs needs the mount point.
>  
>  config STANDALONE
>  	bool "Select only drivers that don't need compile-time external firmware"
> diff --git a/init/main.c b/init/main.c
> index f866510..9ec09ff 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -1038,12 +1038,6 @@ static noinline void __init kernel_init_freeable(void)
>  
>  	do_basic_setup();
>  
> -	/* Open the /dev/console on the rootfs, this should never fail */
> -	if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
> -		pr_err("Warning: unable to open an initial console.\n");
> -
> -	(void) sys_dup(0);
> -	(void) sys_dup(0);
>  	/*
>  	 * check if there is an early userspace init.  If yes, let it do all
>  	 * the work
> @@ -1055,8 +1049,17 @@ static noinline void __init kernel_init_freeable(void)
>  	if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) {
>  		ramdisk_execute_command = NULL;
>  		prepare_namespace();
> +	} else if (IS_ENABLED(CONFIG_DEVTMPFS_MOUNT)) {
> +		sys_mkdir("/dev", 0755);
> +		devtmpfs_mount("/dev");
>  	}
>  
> +	/* Open the /dev/console on the rootfs, this should never fail */
> +	if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
> +		pr_err("Warning: unable to open an initial console.\n");
> +	(void) sys_dup(0);
> +	(void) sys_dup(0);
> +
>  	/*
>  	 * Ok, we have completed the initial bootup, and
>  	 * we're essentially up and running. Get rid of the

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-09-13  2:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 12:05 Patch 0727d35de ("Make initramfs honor CONFIG_DEVTMPFS_MOUNT") breaks boot Yury Norov
2017-05-23  2:07 ` Rob Landley
2017-05-23  8:01   ` Yury Norov
2017-05-23 17:40     ` Rob Landley
2017-05-23 21:32       ` Yury Norov
2017-05-23 23:08         ` Yury Norov
2017-05-25  5:55           ` Rob Landley
2017-05-25  6:13       ` Michael Ellerman
2017-09-10 23:43         ` Rob Landley
2017-09-11 11:45           ` Petr Mladek
2017-09-12  0:42             ` Sergey Senozhatsky
2017-09-13  2:45             ` Rob Landley
     [not found] ` <CAP2kuOwkM7hr5nOtrRSRdXcPi2y3KHVf4yFdDN1JW1o_mWo0yw@mail.gmail.com>
2017-05-25 13:44   ` Leo Yan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.