diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2017-05-17 13:17:14 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2017-07-05 17:17:42 -0400 |
commit | d3878bb8003009d148cd787e1a2d74cff914a7b2 (patch) | |
tree | 94e08d03649a6afb6169c9144ee83821ce6d73ff | |
parent | f7887ee11082b468517f31ae315b474eaa48b843 (diff) |
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>
-rw-r--r-- | arch/um/kernel/um_arch.c | 8 | ||||
-rw-r--r-- | arch/um/os-Linux/main.c | 3 | ||||
-rw-r--r-- | arch/um/os-Linux/mem.c | 18 | ||||
-rw-r--r-- | arch/um/os-Linux/start_up.c | 26 |
4 files changed, 28 insertions, 27 deletions
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 64a1fd06f3fd..5df91d845a0d 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c | |||
@@ -289,8 +289,8 @@ int __init linux_main(int argc, char **argv) | |||
289 | 289 | ||
290 | diff = UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end); | 290 | diff = UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end); |
291 | if (diff > 1024 * 1024) { | 291 | if (diff > 1024 * 1024) { |
292 | printf("Adding %ld bytes to physical memory to account for " | 292 | os_info("Adding %ld bytes to physical memory to account for " |
293 | "exec-shield gap\n", diff); | 293 | "exec-shield gap\n", diff); |
294 | physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end); | 294 | physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end); |
295 | } | 295 | } |
296 | 296 | ||
@@ -330,8 +330,8 @@ int __init linux_main(int argc, char **argv) | |||
330 | end_vm = start_vm + virtmem_size; | 330 | end_vm = start_vm + virtmem_size; |
331 | 331 | ||
332 | if (virtmem_size < physmem_size) | 332 | if (virtmem_size < physmem_size) |
333 | printf("Kernel virtual memory size shrunk to %lu bytes\n", | 333 | os_info("Kernel virtual memory size shrunk to %lu bytes\n", |
334 | virtmem_size); | 334 | virtmem_size); |
335 | 335 | ||
336 | os_flush_stdout(); | 336 | os_flush_stdout(); |
337 | 337 | ||
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 9d499de87e63..f880dcd6ecc9 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c | |||
@@ -184,14 +184,13 @@ int __init main(int argc, char **argv, char **envp) | |||
184 | */ | 184 | */ |
185 | unblock_signals(); | 185 | unblock_signals(); |
186 | 186 | ||
187 | os_info("\n"); | ||
187 | /* Reboot */ | 188 | /* Reboot */ |
188 | if (ret) { | 189 | if (ret) { |
189 | printf("\n"); | ||
190 | execvp(new_argv[0], new_argv); | 190 | execvp(new_argv[0], new_argv); |
191 | perror("Failed to exec kernel"); | 191 | perror("Failed to exec kernel"); |
192 | ret = 1; | 192 | ret = 1; |
193 | } | 193 | } |
194 | printf("\n"); | ||
195 | return uml_exitcode; | 194 | return uml_exitcode; |
196 | } | 195 | } |
197 | 196 | ||
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c index 8b1767668515..a7f6023301cd 100644 --- a/arch/um/os-Linux/mem.c +++ b/arch/um/os-Linux/mem.c | |||
@@ -25,13 +25,13 @@ static int __init check_tmpfs(const char *dir) | |||
25 | { | 25 | { |
26 | struct statfs st; | 26 | struct statfs st; |
27 | 27 | ||
28 | printf("Checking if %s is on tmpfs...", dir); | 28 | os_info("Checking if %s is on tmpfs...", dir); |
29 | if (statfs(dir, &st) < 0) { | 29 | if (statfs(dir, &st) < 0) { |
30 | printf("%s\n", strerror(errno)); | 30 | os_info("%s\n", strerror(errno)); |
31 | } else if (st.f_type != TMPFS_MAGIC) { | 31 | } else if (st.f_type != TMPFS_MAGIC) { |
32 | printf("no\n"); | 32 | os_info("no\n"); |
33 | } else { | 33 | } else { |
34 | printf("OK\n"); | 34 | os_info("OK\n"); |
35 | return 0; | 35 | return 0; |
36 | } | 36 | } |
37 | return -1; | 37 | return -1; |
@@ -61,18 +61,18 @@ static char * __init choose_tempdir(void) | |||
61 | int i; | 61 | int i; |
62 | const char *dir; | 62 | const char *dir; |
63 | 63 | ||
64 | printf("Checking environment variables for a tempdir..."); | 64 | os_info("Checking environment variables for a tempdir..."); |
65 | for (i = 0; vars[i]; i++) { | 65 | for (i = 0; vars[i]; i++) { |
66 | dir = getenv(vars[i]); | 66 | dir = getenv(vars[i]); |
67 | if ((dir != NULL) && (*dir != '\0')) { | 67 | if ((dir != NULL) && (*dir != '\0')) { |
68 | printf("%s\n", dir); | 68 | os_info("%s\n", dir); |
69 | if (check_tmpfs(dir) >= 0) | 69 | if (check_tmpfs(dir) >= 0) |
70 | goto done; | 70 | goto done; |
71 | else | 71 | else |
72 | goto warn; | 72 | goto warn; |
73 | } | 73 | } |
74 | } | 74 | } |
75 | printf("none found\n"); | 75 | os_info("none found\n"); |
76 | 76 | ||
77 | for (i = 0; tmpfs_dirs[i]; i++) { | 77 | for (i = 0; tmpfs_dirs[i]; i++) { |
78 | dir = tmpfs_dirs[i]; | 78 | dir = tmpfs_dirs[i]; |
@@ -194,7 +194,7 @@ void __init check_tmpexec(void) | |||
194 | 194 | ||
195 | addr = mmap(NULL, UM_KERN_PAGE_SIZE, | 195 | addr = mmap(NULL, UM_KERN_PAGE_SIZE, |
196 | PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0); | 196 | PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0); |
197 | printf("Checking PROT_EXEC mmap in %s...", tempdir); | 197 | os_info("Checking PROT_EXEC mmap in %s...", tempdir); |
198 | if (addr == MAP_FAILED) { | 198 | if (addr == MAP_FAILED) { |
199 | err = errno; | 199 | err = errno; |
200 | printf("%s\n", strerror(err)); | 200 | printf("%s\n", strerror(err)); |
@@ -203,7 +203,7 @@ void __init check_tmpexec(void) | |||
203 | printf("%s must be not mounted noexec\n", tempdir); | 203 | printf("%s must be not mounted noexec\n", tempdir); |
204 | exit(1); | 204 | exit(1); |
205 | } | 205 | } |
206 | printf("OK\n"); | 206 | os_info("OK\n"); |
207 | munmap(addr, UM_KERN_PAGE_SIZE); | 207 | munmap(addr, UM_KERN_PAGE_SIZE); |
208 | 208 | ||
209 | close(fd); | 209 | close(fd); |
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c index 22a358ef1b0c..f16e001998e5 100644 --- a/arch/um/os-Linux/start_up.c +++ b/arch/um/os-Linux/start_up.c | |||
@@ -166,7 +166,7 @@ static void __init check_sysemu(void) | |||
166 | unsigned long regs[MAX_REG_NR]; | 166 | unsigned long regs[MAX_REG_NR]; |
167 | int pid, n, status, count=0; | 167 | int pid, n, status, count=0; |
168 | 168 | ||
169 | non_fatal("Checking syscall emulation patch for ptrace..."); | 169 | os_info("Checking syscall emulation patch for ptrace..."); |
170 | sysemu_supported = 0; | 170 | sysemu_supported = 0; |
171 | pid = start_ptraced_child(); | 171 | pid = start_ptraced_child(); |
172 | 172 | ||
@@ -199,10 +199,10 @@ static void __init check_sysemu(void) | |||
199 | goto fail_stopped; | 199 | goto fail_stopped; |
200 | 200 | ||
201 | sysemu_supported = 1; | 201 | sysemu_supported = 1; |
202 | non_fatal("OK\n"); | 202 | os_info("OK\n"); |
203 | set_using_sysemu(!force_sysemu_disabled); | 203 | set_using_sysemu(!force_sysemu_disabled); |
204 | 204 | ||
205 | non_fatal("Checking advanced syscall emulation patch for ptrace..."); | 205 | os_info("Checking advanced syscall emulation patch for ptrace..."); |
206 | pid = start_ptraced_child(); | 206 | pid = start_ptraced_child(); |
207 | 207 | ||
208 | if ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0, | 208 | if ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0, |
@@ -244,7 +244,7 @@ static void __init check_sysemu(void) | |||
244 | goto fail_stopped; | 244 | goto fail_stopped; |
245 | 245 | ||
246 | sysemu_supported = 2; | 246 | sysemu_supported = 2; |
247 | non_fatal("OK\n"); | 247 | os_info("OK\n"); |
248 | 248 | ||
249 | if (!force_sysemu_disabled) | 249 | if (!force_sysemu_disabled) |
250 | set_using_sysemu(sysemu_supported); | 250 | set_using_sysemu(sysemu_supported); |
@@ -260,7 +260,7 @@ static void __init check_ptrace(void) | |||
260 | { | 260 | { |
261 | int pid, syscall, n, status; | 261 | int pid, syscall, n, status; |
262 | 262 | ||
263 | non_fatal("Checking that ptrace can change system call numbers..."); | 263 | os_info("Checking that ptrace can change system call numbers..."); |
264 | pid = start_ptraced_child(); | 264 | pid = start_ptraced_child(); |
265 | 265 | ||
266 | if ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0, | 266 | if ((ptrace(PTRACE_OLDSETOPTIONS, pid, 0, |
@@ -292,7 +292,7 @@ static void __init check_ptrace(void) | |||
292 | } | 292 | } |
293 | } | 293 | } |
294 | stop_ptraced_child(pid, 0, 1); | 294 | stop_ptraced_child(pid, 0, 1); |
295 | non_fatal("OK\n"); | 295 | os_info("OK\n"); |
296 | check_sysemu(); | 296 | check_sysemu(); |
297 | } | 297 | } |
298 | 298 | ||
@@ -308,15 +308,17 @@ static void __init check_coredump_limit(void) | |||
308 | return; | 308 | return; |
309 | } | 309 | } |
310 | 310 | ||
311 | printf("Core dump limits :\n\tsoft - "); | 311 | os_info("Core dump limits :\n\tsoft - "); |
312 | if (lim.rlim_cur == RLIM_INFINITY) | 312 | if (lim.rlim_cur == RLIM_INFINITY) |
313 | printf("NONE\n"); | 313 | os_info("NONE\n"); |
314 | else printf("%lu\n", lim.rlim_cur); | 314 | else |
315 | os_info("%llu\n", (unsigned long long)lim.rlim_cur); | ||
315 | 316 | ||
316 | printf("\thard - "); | 317 | os_info("\thard - "); |
317 | if (lim.rlim_max == RLIM_INFINITY) | 318 | if (lim.rlim_max == RLIM_INFINITY) |
318 | printf("NONE\n"); | 319 | os_info("NONE\n"); |
319 | else printf("%lu\n", lim.rlim_max); | 320 | else |
321 | os_info("%llu\n", (unsigned long long)lim.rlim_max); | ||
320 | } | 322 | } |
321 | 323 | ||
322 | void __init os_early_checks(void) | 324 | void __init os_early_checks(void) |