aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-28 14:06:39 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-28 14:06:39 -0400
commitf28e71617ddaf2483e3e5c5237103484a303743f (patch)
tree67627d2d8ddbf6a4449371e9261d796c013b1fa1 /init
parentdc6a78f1af10d28fb8c395034ae1e099b85c05b0 (diff)
parenta39727f212426b9d5f9267b3318a2afaf9922d3b (diff)
Merge ../linux-2.6/
Conflicts: drivers/scsi/aacraid/comminit.c Fixed up by removing the now renamed CONFIG_IOMMU option from aacraid Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig23
-rw-r--r--init/initramfs.c36
-rw-r--r--init/main.c5
3 files changed, 47 insertions, 17 deletions
diff --git a/init/Kconfig b/init/Kconfig
index e0358f3946a1..f70f2fd273c2 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1,3 +1,11 @@
1config DEFCONFIG_LIST
2 string
3 option defconfig_list
4 default "/lib/modules/$UNAME_RELEASE/.config"
5 default "/etc/kernel-config"
6 default "/boot/config-$UNAME_RELEASE"
7 default "arch/$ARCH/defconfig"
8
1menu "Code maturity level options" 9menu "Code maturity level options"
2 10
3config EXPERIMENTAL 11config EXPERIMENTAL
@@ -236,16 +244,6 @@ config UID16
236 help 244 help
237 This enables the legacy 16-bit UID syscall wrappers. 245 This enables the legacy 16-bit UID syscall wrappers.
238 246
239config VM86
240 depends X86
241 default y
242 bool "Enable VM86 support" if EMBEDDED
243 help
244 This option is required by programs like DOSEMU to run 16-bit legacy
245 code on X86 processors. It also may be needed by software like
246 XFree86 to initialize some video cards via BIOS. Disabling this
247 option saves about 6k.
248
249config CC_OPTIMIZE_FOR_SIZE 247config CC_OPTIMIZE_FOR_SIZE
250 bool "Optimize for size (Look out for broken compilers!)" 248 bool "Optimize for size (Look out for broken compilers!)"
251 default y 249 default y
@@ -341,9 +339,14 @@ config BASE_FULL
341 kernel data structures. This saves memory on small machines, 339 kernel data structures. This saves memory on small machines,
342 but may reduce performance. 340 but may reduce performance.
343 341
342config RT_MUTEXES
343 boolean
344 select PLIST
345
344config FUTEX 346config FUTEX
345 bool "Enable futex support" if EMBEDDED 347 bool "Enable futex support" if EMBEDDED
346 default y 348 default y
349 select RT_MUTEXES
347 help 350 help
348 Disabling this option will cause the kernel to be built without 351 Disabling this option will cause the kernel to be built without
349 support for "fast userspace mutexes". The resulting kernel may not 352 support for "fast userspace mutexes". The resulting kernel may not
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..0d57f6ccb63a 100644
--- a/init/main.c
+++ b/init/main.c
@@ -47,6 +47,8 @@
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>
51#include <linux/buffer_head.h>
50 52
51#include <asm/io.h> 53#include <asm/io.h>
52#include <asm/bugs.h> 54#include <asm/bugs.h>
@@ -79,7 +81,6 @@ extern void mca_init(void);
79extern void sbus_init(void); 81extern void sbus_init(void);
80extern void sysctl_init(void); 82extern void sysctl_init(void);
81extern void signals_init(void); 83extern void signals_init(void);
82extern void buffer_init(void);
83extern void pidhash_init(void); 84extern void pidhash_init(void);
84extern void pidmap_init(void); 85extern void pidmap_init(void);
85extern void prio_tree_init(void); 86extern void prio_tree_init(void);
@@ -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