Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763950AbZFMN0N (ORCPT ); Sat, 13 Jun 2009 09:26:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1763364AbZFMNZY (ORCPT ); Sat, 13 Jun 2009 09:25:24 -0400 Received: from mail-bw0-f213.google.com ([209.85.218.213]:49807 "EHLO mail-bw0-f213.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763404AbZFMNZU (ORCPT ); Sat, 13 Jun 2009 09:25:20 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=MfMZQrhB+QDdpc95bJYNURZyFZB+UaGjCt7tFz2eYiUJVdc++GTVscBhK/vZdIdrMf aJ3s9qLoz94aN7FmJOhS7YwY1xoJVik9zExn8LqCDCYdDJJfLDLyk1+y280H6Ya9AtUY OGugYAiwo9ti7vbaJtVoIeYmCNm+OOOCyfFEQ= Message-ID: <4A33A7D7.3040008@gmail.com> Date: Sat, 13 Jun 2009 15:21:27 +0200 From: Marco User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: Linux FS Devel CC: Linux Embedded , Linux Kernel , Daniel Walker Subject: [PATCH 04/14] Pramfs: Mounting as root filesystem Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1466 Lines: 52 From: Marco Stornelli Pramfs can be used even as root filesystem. Signed-off-by: Marco Stornelli --- diff -uprN linux-2.6.30-orig/init/do_mounts.c linux-2.6.30/init/do_mounts.c --- linux-2.6.30-orig/init/do_mounts.c 2009-06-10 05:05:27.000000000 +0200 +++ linux-2.6.30/init/do_mounts.c 2009-06-13 12:50:36.000000000 +0200 @@ -299,6 +299,17 @@ static int __init mount_nfs_root(void) } #endif +#ifdef CONFIG_ROOT_PRAMFS +static int __init mount_pramfs_root(void) +{ + create_dev("/dev/root", ROOT_DEV); + if (do_mount_root("/dev/root", "pramfs", + root_mountflags, root_mount_data) == 0) + return 1; + return 0; +} +#endif + #if defined(CONFIG_BLK_DEV_RAM) || defined(CONFIG_BLK_DEV_FD) void __init change_floppy(char *fmt, ...) { @@ -331,6 +342,15 @@ void __init change_floppy(char *fmt, ... void __init mount_root(void) { +#ifdef CONFIG_ROOT_PRAMFS + if (MAJOR(ROOT_DEV) == MEM_MAJOR) { + if (mount_pramfs_root()) + return; + + printk(KERN_ERR "VFS: Unable to mount root fs via PRAMFS, trying floppy.\n"); + ROOT_DEV = Root_FD0; + } +#endif #ifdef CONFIG_ROOT_NFS if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) { if (mount_nfs_root()) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/