summaryrefslogtreecommitdiff
path: root/2.6.0-t3-initrd_load-lkml.patch
blob: 7bf3f302a6aa9d49f02147d7feebe284079090c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff -ur linux-2.6.0-test1.orig/Documentation/kernel-parameters.txt linux-2.6.0-test1/Documentation/kernel-parameters.txt
--- linux-2.6.0-test1.orig/Documentation/kernel-parameters.txt	2003-07-14 05:39:36.000000000 +0200
+++ linux-2.6.0-test1/Documentation/kernel-parameters.txt	2003-08-01 01:19:46.000000000 +0200
@@ -816,6 +816,8 @@
 
 	resume=		[SWSUSP] Specify the partition device for software suspension
 
+	resume_initrd   [SWSUSP] Run initrd before resuming from software suspension
+
 	riscom8=	[HW,SERIAL]
 			Format: <io_board1>[,<io_board2>[,...<io_boardN>]]
 
diff -ur linux-2.6.0-test1.orig/init/do_mounts.c linux-2.6.0-test1/init/do_mounts.c
--- linux-2.6.0-test1.orig/init/do_mounts.c	2003-07-14 05:32:44.000000000 +0200
+++ linux-2.6.0-test1/init/do_mounts.c	2003-08-01 01:21:44.000000000 +0200
@@ -49,6 +49,15 @@
 __setup("ro", readonly);
 __setup("rw", readwrite);
 
+static int resume_initrd = 0;
+static int __init set_resume_initrd(char *str)
+{
+	resume_initrd = 1;
+	return 1;
+}
+
+__setup("resume_initrd", set_resume_initrd);
+
 static dev_t __init try_name(char *name, int part)
 {
 	char path[64];
@@ -365,12 +374,21 @@
 
 	is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR;
 
-	/* This has to be before mounting root, because even readonly mount of reiserfs would replay
-	   log corrupting stuff */
-	software_resume();
+	/* software_resume() has to be before mounting root, because even
+	   readonly mount of reiserfs would replay log corrupting stuff.
+	   However, users may still want to run initrd first. */
+	if (resume_initrd) {
+		if (initrd_load()) {
+			software_resume();
+			goto out;
+		}
+	}
+	else {
+		software_resume();
 
-	if (initrd_load())
-		goto out;
+		if (initrd_load())
+			goto out;
+	}
 
 	if (is_floppy && rd_doload && rd_load_disk(0))
 		ROOT_DEV = Root_RAM0;