diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/Kconfig | 19 | ||||
-rw-r--r-- | init/do_mounts.c | 4 | ||||
-rw-r--r-- | init/initramfs.c | 36 | ||||
-rw-r--r-- | init/main.c | 3 |
4 files changed, 41 insertions, 21 deletions
diff --git a/init/Kconfig b/init/Kconfig index 9fb403a..df55b36 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -159,7 +159,8 @@ config BSD_PROCESS_ACCT_V3 at <http://www.physik3.uni-rostock.de/tim/kernel/utils/acct/>. config SYSCTL - bool "Sysctl support" + bool "Sysctl support" if EMBEDDED + default y ---help--- The sysctl interface provides a means of dynamically changing certain kernel parameters and variables on the fly without requiring @@ -190,7 +191,8 @@ config AUDITSYSCALL help Enable low-overhead system-call auditing infrastructure that can be used independently or with another kernel subsystem, - such as SELinux. + such as SELinux. To use audit's filesystem watch feature, please + ensure that INOTIFY is configured. config IKCONFIG bool "Kernel .config support" @@ -242,16 +244,6 @@ config UID16 help This enables the legacy 16-bit UID syscall wrappers. -config VM86 - depends X86 - default y - bool "Enable VM86 support" if EMBEDDED - help - This option is required by programs like DOSEMU to run 16-bit legacy - code on X86 processors. It also may be needed by software like - XFree86 to initialize some video cards via BIOS. Disabling this - option saves about 6k. - config CC_OPTIMIZE_FOR_SIZE bool "Optimize for size (Look out for broken compilers!)" default y @@ -397,9 +389,6 @@ config SLOB default !SLAB bool -config OBSOLETE_INTERMODULE - tristate - menu "Loadable module support" config MODULES diff --git a/init/do_mounts.c b/init/do_mounts.c index f4b7b9d..21b3b8f 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -409,6 +409,10 @@ void __init prepare_namespace(void) if (saved_root_name[0]) { root_device_name = saved_root_name; + if (!strncmp(root_device_name, "mtd", 3)) { + mount_block_root(root_device_name, root_mountflags); + goto out; + } ROOT_DEV = name_to_dev_t(root_device_name); if (strncmp(root_device_name, "/dev/", 5) == 0) root_device_name += 5; diff --git a/init/initramfs.c b/init/initramfs.c index f81cfa4..d28c109 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -30,6 +30,7 @@ static void __init free(void *where) static __initdata struct hash { int ino, minor, major; + mode_t mode; struct hash *next; char name[N_ALIGN(PATH_MAX)]; } *head[32]; @@ -41,7 +42,8 @@ static inline int hash(int major, int minor, int ino) return tmp & 31; } -static char __init *find_link(int major, int minor, int ino, char *name) +static char __init *find_link(int major, int minor, int ino, + mode_t mode, char *name) { struct hash **p, *q; 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) continue; if ((*p)->major != major) continue; + if (((*p)->mode ^ mode) & S_IFMT) + continue; return (*p)->name; } q = (struct hash *)malloc(sizeof(struct hash)); if (!q) panic("can't allocate link hash entry"); - q->ino = ino; - q->minor = minor; q->major = major; + q->minor = minor; + q->ino = ino; + q->mode = mode; strcpy(q->name, name); q->next = NULL; *p = q; @@ -229,13 +234,25 @@ static int __init do_reset(void) static int __init maybe_link(void) { if (nlink >= 2) { - char *old = find_link(major, minor, ino, collected); + char *old = find_link(major, minor, ino, mode, collected); if (old) return (sys_link(old, collected) < 0) ? -1 : 1; } return 0; } +static void __init clean_path(char *path, mode_t mode) +{ + struct stat st; + + if (!sys_newlstat(path, &st) && (st.st_mode^mode) & S_IFMT) { + if (S_ISDIR(st.st_mode)) + sys_rmdir(path); + else + sys_unlink(path); + } +} + static __initdata int wfd; static int __init do_name(void) @@ -248,9 +265,15 @@ static int __init do_name(void) } if (dry_run) return 0; + clean_path(collected, mode); if (S_ISREG(mode)) { - if (maybe_link() >= 0) { - wfd = sys_open(collected, O_WRONLY|O_CREAT, mode); + int ml = maybe_link(); + if (ml >= 0) { + int openflags = O_WRONLY|O_CREAT; + if (ml != 1) + openflags |= O_TRUNC; + wfd = sys_open(collected, openflags, mode); + if (wfd >= 0) { sys_fchown(wfd, uid, gid); sys_fchmod(wfd, mode); @@ -291,6 +314,7 @@ static int __init do_copy(void) static int __init do_symlink(void) { collected[N_ALIGN(name_len) + body_len] = '\0'; + clean_path(collected, 0); sys_symlink(collected + N_ALIGN(name_len), collected); sys_lchown(collected, uid, gid); state = SkipIt; diff --git a/init/main.c b/init/main.c index f715b9b..80af1a52 100644 --- a/init/main.c +++ b/init/main.c @@ -47,6 +47,7 @@ #include <linux/rmap.h> #include <linux/mempolicy.h> #include <linux/key.h> +#include <linux/unwind.h> #include <asm/io.h> #include <asm/bugs.h> @@ -482,6 +483,7 @@ asmlinkage void __init start_kernel(void) __stop___param - __start___param, &unknown_bootoption); sort_main_extable(); + unwind_init(); trap_init(); rcu_init(); init_IRQ(); @@ -490,6 +492,7 @@ asmlinkage void __init start_kernel(void) hrtimers_init(); softirq_init(); time_init(); + timekeeping_init(); /* * HACK ALERT! This is early. We're enabling the console before |