mirror of https://github.com/torvalds/linux.git
um: Use os_info for the messages on normal path
Use os_info() for printing out the messages on the normal execution path. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
f7887ee110
commit
d3878bb800
|
|
@ -289,8 +289,8 @@ int __init linux_main(int argc, char **argv)
|
||||||
|
|
||||||
diff = UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
|
diff = UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
|
||||||
if (diff > 1024 * 1024) {
|
if (diff > 1024 * 1024) {
|
||||||
printf("Adding %ld bytes to physical memory to account for "
|
os_info("Adding %ld bytes to physical memory to account for "
|
||||||
"exec-shield gap\n", diff);
|
"exec-shield gap\n", diff);
|
||||||
physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
|
physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -330,8 +330,8 @@ int __init linux_main(int argc, char **argv)
|
||||||
end_vm = start_vm + virtmem_size;
|
end_vm = start_vm + virtmem_size;
|
||||||
|
|
||||||
if (virtmem_size < physmem_size)
|
if (virtmem_size < physmem_size)
|
||||||
printf("Kernel virtual memory size shrunk to %lu bytes\n",
|
os_info("Kernel virtual memory size shrunk to %lu bytes\n",
|
||||||
virtmem_size);
|
virtmem_size);
|
||||||
|
|
||||||
os_flush_stdout();
|
os_flush_stdout();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -184,14 +184,13 @@ int __init main(int argc, char **argv, char **envp)
|
||||||
*/
|
*/
|
||||||
unblock_signals();
|
unblock_signals();
|
||||||
|
|
||||||
|
os_info("\n");
|
||||||
/* Reboot */
|
/* Reboot */
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printf("\n");
|
|
||||||
execvp(new_argv[0], new_argv);
|
execvp(new_argv[0], new_argv);
|
||||||
perror("Failed to exec kernel");
|
perror("Failed to exec kernel");
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
printf("\n");
|
|
||||||
return uml_exitcode;
|
return uml_exitcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,13 @@ static int __init check_tmpfs(const char *dir)
|
||||||
{
|
{
|
||||||
struct statfs st;
|
struct statfs st;
|
||||||
|
|
||||||
printf("Checking if %s is on tmpfs...", dir);
|
os_info("Checking if %s is on tmpfs...", dir);
|
||||||
if (statfs(dir, &st) < 0) {
|
if (statfs(dir, &st) < 0) {
|
||||||
printf("%s\n", strerror(errno));
|
os_info("%s\n", strerror(errno));
|
||||||
} else if (st.f_type != TMPFS_MAGIC) {
|
} else if (st.f_type != TMPFS_MAGIC) {
|
||||||
printf("no\n");
|
os_info("no\n");
|
||||||
} else {
|
} else {
|
||||||
printf("OK\n");
|
os_info("OK\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -61,18 +61,18 @@ static char * __init choose_tempdir(void)
|
||||||
int i;
|
int i;
|
||||||
const char *dir;
|
const char *dir;
|
||||||
|
|
||||||
printf("Checking environment variables for a tempdir...");
|
os_info("Checking environment variables for a tempdir...");
|
||||||
for (i = 0; vars[i]; i++) {
|
for (i = 0; vars[i]; i++) {
|
||||||
dir = getenv(vars[i]);
|
dir = getenv(vars[i]);
|
||||||
if ((dir != NULL) && (*dir != '\0')) {
|
if ((dir != NULL) && (*dir != '\0')) {
|
||||||
printf("%s\n", dir);
|
os_info("%s\n", dir);
|
||||||
if (check_tmpfs(dir) >= 0)
|
if (check_tmpfs(dir) >= 0)
|
||||||
goto done;
|
goto done;
|
||||||
else
|
else
|
||||||
goto warn;
|
goto warn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("none found\n");
|
os_info("none found\n");
|
||||||
|
|
||||||
for (i = 0; tmpfs_dirs[i]; i++) {
|
for (i = 0; tmpfs_dirs[i]; i++) {
|
||||||
dir = tmpfs_dirs[i];
|
dir = tmpfs_dirs[i];
|
||||||
|
|
@ -194,7 +194,7 @@ void __init check_tmpexec(void)
|
||||||
|
|
||||||
addr = mmap(NULL, UM_KERN_PAGE_SIZE,
|
addr = mmap(NULL, UM_KERN_PAGE_SIZE,
|
||||||
PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0);
|
PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0);
|
||||||
printf("Checking PROT_EXEC mmap in %s...", tempdir);
|
os_info("Checking PROT_EXEC mmap in %s...", tempdir);
|
||||||
if (addr == MAP_FAILED) {
|
if (addr == MAP_FAILED) {
|
||||||
err = errno;
|
err = errno;
|
||||||
printf("%s\n", strerror(err));
|
printf("%s\n", strerror(err));
|
||||||
|
|
@ -203,7 +203,7 @@ void __init check_tmpexec(void)
|
||||||
printf("%s must be not mounted noexec\n", tempdir);
|
printf("%s must be not mounted noexec\n", tempdir);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
printf("OK\n");
|
os_info("OK\n");
|
||||||
munmap(addr, UM_KERN_PAGE_SIZE);
|
munmap(addr, UM_KERN_PAGE_SIZE);
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ static void __init check_sysemu(void)
|
||||||
unsigned long regs[MAX_REG_NR];
|
unsigned long regs[MAX_REG_NR];
|
||||||
int pid, n, status, count=0;
|
int pid, n, status, count=0;
|
||||||
|
|
||||||
non_fatal("Checking syscall emulation patch for ptrace...");
|
os_info("Checking syscall emulation patch for ptrace...");
|
||||||
sysemu_supported = 0;
|
sysemu_supported = 0;
|
||||||
pid = start_ptraced_child();
|
pid = start_ptraced_child();
|
||||||
|
|
||||||
|
|
@ -199,10 +199,10 @@ static void __init check_sysemu(void)
|
||||||
goto fail_stopped;
|
goto fail_stopped;
|
||||||
|
|
||||||
sysemu_supported = 1;
|
sysemu_supported = 1;
|
||||||
non_fatal("OK\n");
|
os_info("OK\n");
|
||||||
set_using_sysemu(!force_sysemu_disabled);
|
set_using_sysemu(!force_sysemu_disabled);
|
||||||
|
|
||||||
non_fatal("Checking advanced syscall emulation patch for ptrace...");
|
os_info("Checking advanced syscall emulation patch for ptrace...");
|
||||||
pid = start_ptraced_child();
|
pid = start_ptraced_child();
|
||||||
|
|
||||||
if ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0,
|
if ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0,
|
||||||
|
|
@ -244,7 +244,7 @@ static void __init check_sysemu(void)
|
||||||
goto fail_stopped;
|
goto fail_stopped;
|
||||||
|
|
||||||
sysemu_supported = 2;
|
sysemu_supported = 2;
|
||||||
non_fatal("OK\n");
|
os_info("OK\n");
|
||||||
|
|
||||||
if (!force_sysemu_disabled)
|
if (!force_sysemu_disabled)
|
||||||
set_using_sysemu(sysemu_supported);
|
set_using_sysemu(sysemu_supported);
|
||||||
|
|
@ -260,7 +260,7 @@ static void __init check_ptrace(void)
|
||||||
{
|
{
|
||||||
int pid, syscall, n, status;
|
int pid, syscall, n, status;
|
||||||
|
|
||||||
non_fatal("Checking that ptrace can change system call numbers...");
|
os_info("Checking that ptrace can change system call numbers...");
|
||||||
pid = start_ptraced_child();
|
pid = start_ptraced_child();
|
||||||
|
|
||||||
if ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0,
|
if ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0,
|
||||||
|
|
@ -292,7 +292,7 @@ static void __init check_ptrace(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stop_ptraced_child(pid, 0, 1);
|
stop_ptraced_child(pid, 0, 1);
|
||||||
non_fatal("OK\n");
|
os_info("OK\n");
|
||||||
check_sysemu();
|
check_sysemu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -308,15 +308,17 @@ static void __init check_coredump_limit(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Core dump limits :\n\tsoft - ");
|
os_info("Core dump limits :\n\tsoft - ");
|
||||||
if (lim.rlim_cur == RLIM_INFINITY)
|
if (lim.rlim_cur == RLIM_INFINITY)
|
||||||
printf("NONE\n");
|
os_info("NONE\n");
|
||||||
else printf("%lu\n", lim.rlim_cur);
|
else
|
||||||
|
os_info("%llu\n", (unsigned long long)lim.rlim_cur);
|
||||||
|
|
||||||
printf("\thard - ");
|
os_info("\thard - ");
|
||||||
if (lim.rlim_max == RLIM_INFINITY)
|
if (lim.rlim_max == RLIM_INFINITY)
|
||||||
printf("NONE\n");
|
os_info("NONE\n");
|
||||||
else printf("%lu\n", lim.rlim_max);
|
else
|
||||||
|
os_info("%llu\n", (unsigned long long)lim.rlim_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init os_early_checks(void)
|
void __init os_early_checks(void)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue