lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 Jul 2007 20:59:44 +0200 (CEST)
From:	Bodo Eggert <7eggert@....de>
To:	Bodo Eggert <7eggert@....de>
cc:	linux-kernel@...r.kernel.org
Subject: [PATCH 1/3][try 1] init: enable system-on-initramfs: enable root=rootfs

Disable mounting a root filesystem if root=rootfs is supplied.

If you put a rescue system on an initramfs, you should be able to boot it
without using tricks like an additional /init script.

Signed-Off-By: Bodo Eggert <7eggert@....de>

diff -X dontdiff -pruN linux-2.6.22/Documentation/kernel-parameters.txt linux-2.6.22.tmpfsroot/Documentation/kernel-parameters.txt
--- linux-2.6.22/Documentation/kernel-parameters.txt	2007-07-11 23:14:59.000000000 +0200
+++ linux-2.6.22.tmpfsroot/Documentation/kernel-parameters.txt	2007-07-12 13:57:00.000000000 +0200
@@ -1528,6 +1528,7 @@ and is between 256 and 4096 characters. 
 	ro		[KNL] Mount root device read-only on boot
 
 	root=		[KNL] Root filesystem
+			If set to "rootfs", the initramfs will be used
 
 	rootdelay=	[KNL] Delay (in seconds) to pause before attempting to
 			mount the root filesystem
diff -X dontdiff -pruN linux-2.6.22/init/do_mounts.c linux-2.6.22.tmpfsroot/init/do_mounts.c
--- linux-2.6.22/init/do_mounts.c	2007-07-11 23:15:31.000000000 +0200
+++ linux-2.6.22.tmpfsroot/init/do_mounts.c	2007-07-12 13:57:00.000000000 +0200
@@ -433,6 +433,8 @@ void __init prepare_namespace(void)
 			mount_block_root(root_device_name, root_mountflags);
 			goto out;
 		}
+		if (!strcmp(root_device_name, "rootfs"))
+			goto out_nomount;
 		ROOT_DEV = name_to_dev_t(root_device_name);
 		if (strncmp(root_device_name, "/dev/", 5) == 0)
 			root_device_name += 5;
@@ -450,6 +452,7 @@ void __init prepare_namespace(void)
 out:
 	sys_mount(".", "/", NULL, MS_MOVE, NULL);
 	sys_chroot(".");
+out_nomount:
 	security_sb_post_mountroot();
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ