#endif /* USE_ELF_CORE_DUMP */
-int init_elf_binfmt(void)
+static int __init init_elf_binfmt(void)
{
+ printk("%s\n",__FUNCTION__);
return register_binfmt(&elf_format);
}
unregister_binfmt(&elf_format);
}
-EXPORT_SYMBOL(init_elf_binfmt);
+core_initcall(init_elf_binfmt);
module_exit(exit_elf_binfmt)
MODULE_LICENSE("GPL");
mount_block_root("/dev/root", root_mountflags);
}
-extern int sysfs_mounted;
-extern asmlinkage long sys_access(const char * filename, int mode);
-extern asmlinkage long sys_umount(char __user * name, int flags);
-static char *kinit_command = "/sbin/kinit";
-
-static int __init kinit_setup(char *str)
-{
- kinit_command = str;
- return 1;
-}
-
-__setup("kinit=", kinit_setup);
-
-static int __init kinit_exec(void * shell)
-{
- static char *argv[] = { "kinit", NULL, };
- extern char * envp_init[];
-
- close(0);close(1);close(2);
- setsid();
- (void) open("/dev/console",O_RDWR,0);
- (void) dup(0);
- (void) dup(0);
- return execve(shell, argv, envp_init);
-}
/*
* Prepare the namespace - decide what/where to mount, load ramdisks, etc.
*/
void __init prepare_namespace(void)
{
int is_floppy;
- int pid, i;
mount_devfs();
md_run_setup();
- if (sysfs_mounted)
- sys_umount("/sys",0);
-
if (saved_root_name[0]) {
root_device_name = saved_root_name;
ROOT_DEV = name_to_dev_t(root_device_name);
if (initrd_load())
goto out;
- /*
- * check if there is an early userspace init, if yes
- * let it do all the work of mounting the root fs and return
- */
- if (kinit_command && sys_access(kinit_command,0) == 0) {
- pid = kernel_thread(kinit_exec, kinit_command, SIGCHLD);
- if (pid > 0) {
- while (pid != waitpid(-1, &i, 0))
- yield();
- }
- sys_chdir("/root");
- goto out;
- }
-
if (is_floppy && rd_doload && rd_load_disk(0))
ROOT_DEV = Root_RAM0;
#include <linux/initrd.h>
#endif
-extern int sysfs_mounted;
-
void __init populate_rootfs(void)
{
char *err = unpack_to_rootfs(&__initramfs_start,
&__initramfs_end - &__initramfs_start, 0);
if (err)
panic(err);
- sysfs_mounted = sys_mount("sys", "/sys","sysfs",NULL,NULL);
- printk(" mount sysfs returned %ld\n", sysfs_mounted);
- sysfs_mounted = !sysfs_mounted;
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) {
int fd;
}
__setup("init=", init_setup);
+static char *kinit_command;
+
+static int __init kinit_setup(char *str)
+{
+ kinit_command = str;
+ return 1;
+}
+__setup("kinit=", kinit_setup);
+
extern void setup_arch(char **);
extern void cpu_idle(void);
}
int __initdata initcall_debug;
-int __initdata sysfs_mounted;
static int __init initcall_debug_setup(char *str)
{
initcall_t *call;
int count = preempt_count();
+ printk("%s\n",__FUNCTION__);
for (call = &__initcall_start; call < &__initcall_end; call++) {
char *msg;
flush_scheduled_work();
}
-extern int init_elf_binfmt(void);
-extern int init_elf32_binfmt(void);
+asmlinkage long sys_access(const char __user * filename, int mode);
+asmlinkage long sys_mount(char *dev_name, char *dir_name, char *type,
+ unsigned long flags, void *data);
/*
* Ok, the machine is now initialized. None of the devices
*/
static void __init do_basic_setup(void)
{
+ extern char hotplug_path[];
+
driver_init();
#ifdef CONFIG_SYSCTL
sock_init();
init_workqueues();
- init_elf_binfmt();
-#if defined(__powerpc64__) || \
- defined(CONFIG_IA32_SUPPORT) || \
- defined(CONFIG_MIPS32) || \
- defined(CONFIG_PARISC64) || \
- defined(CONFIG_BINFMT_ELF32)
- init_elf32_binfmt();
-#endif
+
+ if (sys_access(hotplug_path, 0) == 0) {
+ printk(KERN_INFO "mounting sysfs on /sys");
+ sys_mount("sys", "/sys","sysfs",0,NULL);
+ }
+
do_initcalls();
}
smp_init();
do_basic_setup();
+ /*
+ * check if there is an early userspace init, if yes
+ * let it do all the work
+ */
+ if (kinit_command || sys_access("/sbin/init", 0) == 0)
+ execute_command = kinit_command ? kinit_command : 0;
+ else
prepare_namespace();
/*
envp [i++] = scratch;
scratch += sprintf(scratch, "ACTION=%s", action) + 1;
+ if(!sequence_num)
+ printk(" ... the first call_usermodehelper: %s\n", name);
+
spin_lock(&sequence_lock);
seq = sequence_num++;
spin_unlock(&sequence_lock);
{
cpio_mkdir("/dev", 0755, 0, 0);
cpio_mknod("/dev/console", 0600, 0, 0, 'c', 5, 1);
- cpio_mknod("/dev/ram0", 0600, 0, 0, 'b', 5, 1);
cpio_mkdir("/root", 0700, 0, 0);
- cpio_mkdir("/sys", 0755, 0, 0);
- cpio_mkdir("/events", 0755, 0, 0);
cpio_trailer();
exit(0);