aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig19
-rw-r--r--init/do_mounts.c4
-rw-r--r--init/initramfs.c36
-rw-r--r--init/main.c3
4 files changed, 41 insertions, 21 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 9fb403af1085..df55b3665601 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -159,7 +159,8 @@ config BSD_PROCESS_ACCT_V3
159 at <http://www.physik3.uni-rostock.de/tim/kernel/utils/acct/>. 159 at <http://www.physik3.uni-rostock.de/tim/kernel/utils/acct/>.
160 160
161config SYSCTL 161config SYSCTL
162 bool "Sysctl support" 162 bool "Sysctl support" if EMBEDDED
163 default y
163 ---help--- 164 ---help---
164 The sysctl interface provides a means of dynamically changing 165 The sysctl interface provides a means of dynamically changing
165 certain kernel parameters and variables on the fly without requiring 166 certain kernel parameters and variables on the fly without requiring
@@ -190,7 +191,8 @@ config AUDITSYSCALL
190 help 191 help
191 Enable low-overhead system-call auditing infrastructure that 192 Enable low-overhead system-call auditing infrastructure that
192 can be used independently or with another kernel subsystem, 193 can be used independently or with another kernel subsystem,
193 such as SELinux. 194 such as SELinux. To use audit's filesystem watch feature, please
195 ensure that INOTIFY is configured.
194 196
195config IKCONFIG 197config IKCONFIG
196 bool "Kernel .config support" 198 bool "Kernel .config support"
@@ -242,16 +244,6 @@ config UID16
242 help 244 help
243 This enables the legacy 16-bit UID syscall wrappers. 245 This enables the legacy 16-bit UID syscall wrappers.
244 246
245config VM86
246 depends X86
247 default y
248 bool "Enable VM86 support" if EMBEDDED
249 help
250 This option is required by programs like DOSEMU to run 16-bit legacy
251 code on X86 processors. It also may be needed by software like
252 XFree86 to initialize some video cards via BIOS. Disabling this
253 option saves about 6k.
254
255config CC_OPTIMIZE_FOR_SIZE 247config CC_OPTIMIZE_FOR_SIZE
256 bool "Optimize for size (Look out for broken compilers!)" 248 bool "Optimize for size (Look out for broken compilers!)"
257 default y 249 default y
@@ -397,9 +389,6 @@ config SLOB
397 default !SLAB 389 default !SLAB
398 bool 390 bool
399 391
400config OBSOLETE_INTERMODULE
401 tristate
402
403menu "Loadable module support" 392menu "Loadable module support"
404 393
405config MODULES 394config MODULES
diff --git a/init/do_mounts.c b/init/do_mounts.c
index f4b7b9d278cd..21b3b8f33a72 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -409,6 +409,10 @@ void __init prepare_namespace(void)
409 409
410 if (saved_root_name[0]) { 410 if (saved_root_name[0]) {
411 root_device_name = saved_root_name; 411 root_device_name = saved_root_name;
412 if (!strncmp(root_device_name, "mtd", 3)) {
413 mount_block_root(root_device_name, root_mountflags);
414 goto out;
415 }
412 ROOT_DEV = name_to_dev_t(root_device_name); 416 ROOT_DEV = name_to_dev_t(root_device_name);
413 if (strncmp(root_device_name, "/dev/", 5) == 0) 417 if (strncmp(root_device_name, "/dev/", 5) == 0)
414 root_device_name += 5; 418 root_device_name += 5;
diff --git a/init/initramfs.c b/init/initramfs.c
index f81cfa40a719..d28c1094d7e5 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -30,6 +30,7 @@ static void __init free(void *where)
30 30
31static __initdata struct hash { 31static __initdata struct hash {
32 int ino, minor, major; 32 int ino, minor, major;
33 mode_t mode;
33 struct hash *next; 34 struct hash *next;
34 char name[N_ALIGN(PATH_MAX)]; 35 char name[N_ALIGN(PATH_MAX)];
35} *head[32]; 36} *head[32];
@@ -41,7 +42,8 @@ static inline int hash(int major, int minor, int ino)
41 return tmp & 31; 42 return tmp & 31;
42} 43}
43 44
44static char __init *find_link(int major, int minor, int ino, char *name) 45static char __init *find_link(int major, int minor, int ino,
46 mode_t mode, char *name)
45{ 47{
46 struct hash **p, *q; 48 struct hash **p, *q;
47 for (p = head + hash(major, minor, ino); *p; p = &(*p)->next) { 49 for (p = head + hash(major, minor, ino); *p; p = &(*p)->next) {
@@ -51,14 +53,17 @@ static char __init *find_link(int major, int minor, int ino, char *name)
51 continue; 53 continue;
52 if ((*p)->major != major) 54 if ((*p)->major != major)
53 continue; 55 continue;
56 if (((*p)->mode ^ mode) & S_IFMT)
57 continue;
54 return (*p)->name; 58 return (*p)->name;
55 } 59 }
56 q = (struct hash *)malloc(sizeof(struct hash)); 60 q = (struct hash *)malloc(sizeof(struct hash));
57 if (!q) 61 if (!q)
58 panic("can't allocate link hash entry"); 62 panic("can't allocate link hash entry");
59 q->ino = ino;
60 q->minor = minor;
61 q->major = major; 63 q->major = major;
64 q->minor = minor;
65 q->ino = ino;
66 q->mode = mode;
62 strcpy(q->name, name); 67 strcpy(q->name, name);
63 q->next = NULL; 68 q->next = NULL;
64 *p = q; 69 *p = q;
@@ -229,13 +234,25 @@ static int __init do_reset(void)
229static int __init maybe_link(void) 234static int __init maybe_link(void)
230{ 235{
231 if (nlink >= 2) { 236 if (nlink >= 2) {
232 char *old = find_link(major, minor, ino, collected); 237 char *old = find_link(major, minor, ino, mode, collected);
233 if (old) 238 if (old)
234 return (sys_link(old, collected) < 0) ? -1 : 1; 239 return (sys_link(old, collected) < 0) ? -1 : 1;
235 } 240 }
236 return 0; 241 return 0;
237} 242}
238 243
244static void __init clean_path(char *path, mode_t mode)
245{
246 struct stat st;
247
248 if (!sys_newlstat(path, &st) && (st.st_mode^mode) & S_IFMT) {
249 if (S_ISDIR(st.st_mode))
250 sys_rmdir(path);
251 else
252 sys_unlink(path);
253 }
254}
255
239static __initdata int wfd; 256static __initdata int wfd;
240 257
241static int __init do_name(void) 258static int __init do_name(void)
@@ -248,9 +265,15 @@ static int __init do_name(void)
248 } 265 }
249 if (dry_run) 266 if (dry_run)
250 return 0; 267 return 0;
268 clean_path(collected, mode);
251 if (S_ISREG(mode)) { 269 if (S_ISREG(mode)) {
252 if (maybe_link() >= 0) { 270 int ml = maybe_link();
253 wfd = sys_open(collected, O_WRONLY|O_CREAT, mode); 271 if (ml >= 0) {
272 int openflags = O_WRONLY|O_CREAT;
273 if (ml != 1)
274 openflags |= O_TRUNC;
275 wfd = sys_open(collected, openflags, mode);
276
254 if (wfd >= 0) { 277 if (wfd >= 0) {
255 sys_fchown(wfd, uid, gid); 278 sys_fchown(wfd, uid, gid);
256 sys_fchmod(wfd, mode); 279 sys_fchmod(wfd, mode);
@@ -291,6 +314,7 @@ static int __init do_copy(void)
291static int __init do_symlink(void) 314static int __init do_symlink(void)
292{ 315{
293 collected[N_ALIGN(name_len) + body_len] = '\0'; 316 collected[N_ALIGN(name_len) + body_len] = '\0';
317 clean_path(collected, 0);
294 sys_symlink(collected + N_ALIGN(name_len), collected); 318 sys_symlink(collected + N_ALIGN(name_len), collected);
295 sys_lchown(collected, uid, gid); 319 sys_lchown(collected, uid, gid);
296 state = SkipIt; 320 state = SkipIt;
diff --git a/init/main.c b/init/main.c
index f715b9b89753..80af1a52485f 100644
--- a/init/main.c
+++ b/init/main.c
@@ -47,6 +47,7 @@
47#include <linux/rmap.h> 47#include <linux/rmap.h>
48#include <linux/mempolicy.h> 48#include <linux/mempolicy.h>
49#include <linux/key.h> 49#include <linux/key.h>
50#include <linux/unwind.h>
50 51
51#include <asm/io.h> 52#include <asm/io.h>
52#include <asm/bugs.h> 53#include <asm/bugs.h>
@@ -482,6 +483,7 @@ asmlinkage void __init start_kernel(void)
482 __stop___param - __start___param, 483 __stop___param - __start___param,
483 &unknown_bootoption); 484 &unknown_bootoption);
484 sort_main_extable(); 485 sort_main_extable();
486 unwind_init();
485 trap_init(); 487 trap_init();
486 rcu_init(); 488 rcu_init();
487 init_IRQ(); 489 init_IRQ();
@@ -490,6 +492,7 @@ asmlinkage void __init start_kernel(void)
490 hrtimers_init(); 492 hrtimers_init();
491 softirq_init(); 493 softirq_init();
492 time_init(); 494 time_init();
495 timekeeping_init();
493 496
494 /* 497 /*
495 * HACK ALERT! This is early. We're enabling the console before 498 * HACK ALERT! This is early. We're enabling the console before