aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig40
-rw-r--r--init/Makefile7
-rw-r--r--init/initramfs.c17
-rw-r--r--init/main.c5
-rw-r--r--init/noinitramfs.c52
5 files changed, 96 insertions, 25 deletions
diff --git a/init/Kconfig b/init/Kconfig
index a3f83e2c8250..ad33c979e0b3 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -192,6 +192,24 @@ config TASK_DELAY_ACCT
192 192
193 Say N if unsure. 193 Say N if unsure.
194 194
195config TASK_XACCT
196 bool "Enable extended accounting over taskstats (EXPERIMENTAL)"
197 depends on TASKSTATS
198 help
199 Collect extended task accounting data and send the data
200 to userland for processing over the taskstats interface.
201
202 Say N if unsure.
203
204config TASK_IO_ACCOUNTING
205 bool "Enable per-task storage I/O accounting (EXPERIMENTAL)"
206 depends on TASK_XACCT
207 help
208 Collect information on the number of bytes of storage I/O which this
209 task has caused.
210
211 Say N if unsure.
212
195config UTS_NS 213config UTS_NS
196 bool "UTS Namespaces" 214 bool "UTS Namespaces"
197 default n 215 default n
@@ -280,8 +298,12 @@ config RELAY
280 298
281 If unsure, say N. 299 If unsure, say N.
282 300
301if BLK_DEV_INITRD
302
283source "usr/Kconfig" 303source "usr/Kconfig"
284 304
305endif
306
285config CC_OPTIMIZE_FOR_SIZE 307config CC_OPTIMIZE_FOR_SIZE
286 bool "Optimize for size (Look out for broken compilers!)" 308 bool "Optimize for size (Look out for broken compilers!)"
287 default y 309 default y
@@ -295,24 +317,6 @@ config CC_OPTIMIZE_FOR_SIZE
295 317
296 If unsure, say N. 318 If unsure, say N.
297 319
298config TASK_XACCT
299 bool "Enable extended accounting over taskstats (EXPERIMENTAL)"
300 depends on TASKSTATS
301 help
302 Collect extended task accounting data and send the data
303 to userland for processing over the taskstats interface.
304
305 Say N if unsure.
306
307config TASK_IO_ACCOUNTING
308 bool "Enable per-task storage I/O accounting (EXPERIMENTAL)"
309 depends on TASK_XACCT
310 help
311 Collect information on the number of bytes of storage I/O which this
312 task has caused.
313
314 Say N if unsure.
315
316config SYSCTL 320config SYSCTL
317 bool 321 bool
318 322
diff --git a/init/Makefile b/init/Makefile
index 633a268d270d..0154aea1e52d 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -2,7 +2,12 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-y := main.o version.o mounts.o initramfs.o 5obj-y := main.o version.o mounts.o
6ifneq ($(CONFIG_BLK_DEV_INITRD),y)
7obj-y += noinitramfs.o
8else
9obj-$(CONFIG_BLK_DEV_INITRD) += initramfs.o
10endif
6obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o 11obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o
7 12
8mounts-y := do_mounts.o 13mounts-y := do_mounts.o
diff --git a/init/initramfs.c b/init/initramfs.c
index 4fa0f7977de1..00eff7a11085 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -491,6 +491,17 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only)
491 return message; 491 return message;
492} 492}
493 493
494static int __initdata do_retain_initrd;
495
496static int __init retain_initrd_param(char *str)
497{
498 if (*str)
499 return 0;
500 do_retain_initrd = 1;
501 return 1;
502}
503__setup("retain_initrd", retain_initrd_param);
504
494extern char __initramfs_start[], __initramfs_end[]; 505extern char __initramfs_start[], __initramfs_end[];
495#ifdef CONFIG_BLK_DEV_INITRD 506#ifdef CONFIG_BLK_DEV_INITRD
496#include <linux/initrd.h> 507#include <linux/initrd.h>
@@ -501,7 +512,11 @@ static void __init free_initrd(void)
501#ifdef CONFIG_KEXEC 512#ifdef CONFIG_KEXEC
502 unsigned long crashk_start = (unsigned long)__va(crashk_res.start); 513 unsigned long crashk_start = (unsigned long)__va(crashk_res.start);
503 unsigned long crashk_end = (unsigned long)__va(crashk_res.end); 514 unsigned long crashk_end = (unsigned long)__va(crashk_res.end);
515#endif
516 if (do_retain_initrd)
517 goto skip;
504 518
519#ifdef CONFIG_KEXEC
505 /* 520 /*
506 * If the initrd region is overlapped with crashkernel reserved region, 521 * If the initrd region is overlapped with crashkernel reserved region,
507 * free only memory that is not part of crashkernel region. 522 * free only memory that is not part of crashkernel region.
@@ -519,7 +534,7 @@ static void __init free_initrd(void)
519 } else 534 } else
520#endif 535#endif
521 free_initrd_mem(initrd_start, initrd_end); 536 free_initrd_mem(initrd_start, initrd_end);
522 537skip:
523 initrd_start = 0; 538 initrd_start = 0;
524 initrd_end = 0; 539 initrd_end = 0;
525} 540}
diff --git a/init/main.c b/init/main.c
index 8b4a7d769162..4e88bddfbebf 100644
--- a/init/main.c
+++ b/init/main.c
@@ -395,11 +395,6 @@ static void __init smp_init(void)
395 /* Any cleanup work */ 395 /* Any cleanup work */
396 printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus()); 396 printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus());
397 smp_cpus_done(max_cpus); 397 smp_cpus_done(max_cpus);
398#if 0
399 /* Get other processors into their bootup holding patterns. */
400
401 smp_commence();
402#endif
403} 398}
404 399
405#endif 400#endif
diff --git a/init/noinitramfs.c b/init/noinitramfs.c
new file mode 100644
index 000000000000..f4c1a3a1b8c5
--- /dev/null
+++ b/init/noinitramfs.c
@@ -0,0 +1,52 @@
1/*
2 * init/noinitramfs.c
3 *
4 * Copyright (C) 2006, NXP Semiconductors, All Rights Reserved
5 * Author: Jean-Paul Saman <jean-paul.saman@nxp.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#include <linux/init.h>
21#include <linux/stat.h>
22#include <linux/kdev_t.h>
23#include <linux/syscalls.h>
24
25/*
26 * Create a simple rootfs that is similar to the default initramfs
27 */
28static int __init default_rootfs(void)
29{
30 int err;
31
32 err = sys_mkdir("/dev", 0755);
33 if (err < 0)
34 goto out;
35
36 err = sys_mknod((const char __user *) "/dev/console",
37 S_IFCHR | S_IRUSR | S_IWUSR,
38 new_encode_dev(MKDEV(5, 1)));
39 if (err < 0)
40 goto out;
41
42 err = sys_mkdir("/root", 0700);
43 if (err < 0)
44 goto out;
45
46 return 0;
47
48out:
49 printk(KERN_WARNING "Failed to create a rootfs\n");
50 return err;
51}
52rootfs_initcall(default_rootfs);