diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 18:57:47 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 18:57:47 -0400 |
| commit | 8065be8d032f38da25b54bf077a05a30d9ce9f2a (patch) | |
| tree | 32a7baf4b40e0240ab4b9dd6f2bbe6129929bb66 /init | |
| parent | 27d438c56009e5ae632de36fe70985d1aab5e344 (diff) | |
| parent | ecc265fe9e09e32a3573b2ba26e79b2099eb8bbb (diff) | |
Merge branch 'akpm' (second patchbomb from Andrew Morton)
Merge more incoming from Andrew Morton:
"Two new syscalls:
memfd_create in "shm: add memfd_create() syscall"
kexec_file_load in "kexec: implementation of new syscall kexec_file_load"
And:
- Most (all?) of the rest of MM
- Lots of the usual misc bits
- fs/autofs4
- drivers/rtc
- fs/nilfs
- procfs
- fork.c, exec.c
- more in lib/
- rapidio
- Janitorial work in filesystems: fs/ufs, fs/reiserfs, fs/adfs,
fs/cramfs, fs/romfs, fs/qnx6.
- initrd/initramfs work
- "file sealing" and the memfd_create() syscall, in tmpfs
- add pci_zalloc_consistent, use it in lots of places
- MAINTAINERS maintenance
- kexec feature work"
* emailed patches from Andrew Morton <akpm@linux-foundation.org: (193 commits)
MAINTAINERS: update nomadik patterns
MAINTAINERS: update usb/gadget patterns
MAINTAINERS: update DMA BUFFER SHARING patterns
kexec: verify the signature of signed PE bzImage
kexec: support kexec/kdump on EFI systems
kexec: support for kexec on panic using new system call
kexec-bzImage64: support for loading bzImage using 64bit entry
kexec: load and relocate purgatory at kernel load time
purgatory: core purgatory functionality
purgatory/sha256: provide implementation of sha256 in purgaotory context
kexec: implementation of new syscall kexec_file_load
kexec: new syscall kexec_file_load() declaration
kexec: make kexec_segment user buffer pointer a union
resource: provide new functions to walk through resources
kexec: use common function for kimage_normal_alloc() and kimage_crash_alloc()
kexec: move segment verification code in a separate function
kexec: rename unusebale_pages to unusable_pages
kernel: build bin2c based on config option CONFIG_BUILD_BIN2C
bin2c: move bin2c in scripts/basic
shm: wait for pins to be released when sealing
...
Diffstat (limited to 'init')
| -rw-r--r-- | init/Kconfig | 5 | ||||
| -rw-r--r-- | init/do_mounts.c | 12 | ||||
| -rw-r--r-- | init/do_mounts_rd.c | 10 | ||||
| -rw-r--r-- | init/initramfs.c | 60 | ||||
| -rw-r--r-- | init/main.c | 23 |
5 files changed, 73 insertions, 37 deletions
diff --git a/init/Kconfig b/init/Kconfig index a291b7ef4738..44f9ed3dae22 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
| @@ -783,8 +783,13 @@ endchoice | |||
| 783 | 783 | ||
| 784 | endmenu # "RCU Subsystem" | 784 | endmenu # "RCU Subsystem" |
| 785 | 785 | ||
| 786 | config BUILD_BIN2C | ||
| 787 | bool | ||
| 788 | default n | ||
| 789 | |||
| 786 | config IKCONFIG | 790 | config IKCONFIG |
| 787 | tristate "Kernel .config support" | 791 | tristate "Kernel .config support" |
| 792 | select BUILD_BIN2C | ||
| 788 | ---help--- | 793 | ---help--- |
| 789 | This option enables the complete Linux kernel ".config" file | 794 | This option enables the complete Linux kernel ".config" file |
| 790 | contents to be saved in the kernel. It provides documentation | 795 | contents to be saved in the kernel. It provides documentation |
diff --git a/init/do_mounts.c b/init/do_mounts.c index 82f22885c87e..b6237c31b0e2 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c | |||
| @@ -539,12 +539,6 @@ void __init prepare_namespace(void) | |||
| 539 | { | 539 | { |
| 540 | int is_floppy; | 540 | int is_floppy; |
| 541 | 541 | ||
| 542 | if (root_delay) { | ||
| 543 | printk(KERN_INFO "Waiting %d sec before mounting root device...\n", | ||
| 544 | root_delay); | ||
| 545 | ssleep(root_delay); | ||
| 546 | } | ||
| 547 | |||
| 548 | /* | 542 | /* |
| 549 | * wait for the known devices to complete their probing | 543 | * wait for the known devices to complete their probing |
| 550 | * | 544 | * |
| @@ -571,6 +565,12 @@ void __init prepare_namespace(void) | |||
| 571 | if (initrd_load()) | 565 | if (initrd_load()) |
| 572 | goto out; | 566 | goto out; |
| 573 | 567 | ||
| 568 | if (root_delay) { | ||
| 569 | pr_info("Waiting %d sec before mounting root device...\n", | ||
| 570 | root_delay); | ||
| 571 | ssleep(root_delay); | ||
| 572 | } | ||
| 573 | |||
| 574 | /* wait for any asynchronous scanning to complete */ | 574 | /* wait for any asynchronous scanning to complete */ |
| 575 | if ((ROOT_DEV == 0) && root_wait) { | 575 | if ((ROOT_DEV == 0) && root_wait) { |
| 576 | printk(KERN_INFO "Waiting for root device %s...\n", | 576 | printk(KERN_INFO "Waiting for root device %s...\n", |
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index a8227022e3a0..e5d059e8aa11 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c | |||
| @@ -311,9 +311,9 @@ static int exit_code; | |||
| 311 | static int decompress_error; | 311 | static int decompress_error; |
| 312 | static int crd_infd, crd_outfd; | 312 | static int crd_infd, crd_outfd; |
| 313 | 313 | ||
| 314 | static int __init compr_fill(void *buf, unsigned int len) | 314 | static long __init compr_fill(void *buf, unsigned long len) |
| 315 | { | 315 | { |
| 316 | int r = sys_read(crd_infd, buf, len); | 316 | long r = sys_read(crd_infd, buf, len); |
| 317 | if (r < 0) | 317 | if (r < 0) |
| 318 | printk(KERN_ERR "RAMDISK: error while reading compressed data"); | 318 | printk(KERN_ERR "RAMDISK: error while reading compressed data"); |
| 319 | else if (r == 0) | 319 | else if (r == 0) |
| @@ -321,13 +321,13 @@ static int __init compr_fill(void *buf, unsigned int len) | |||
| 321 | return r; | 321 | return r; |
| 322 | } | 322 | } |
| 323 | 323 | ||
| 324 | static int __init compr_flush(void *window, unsigned int outcnt) | 324 | static long __init compr_flush(void *window, unsigned long outcnt) |
| 325 | { | 325 | { |
| 326 | int written = sys_write(crd_outfd, window, outcnt); | 326 | long written = sys_write(crd_outfd, window, outcnt); |
| 327 | if (written != outcnt) { | 327 | if (written != outcnt) { |
| 328 | if (decompress_error == 0) | 328 | if (decompress_error == 0) |
| 329 | printk(KERN_ERR | 329 | printk(KERN_ERR |
| 330 | "RAMDISK: incomplete write (%d != %d)\n", | 330 | "RAMDISK: incomplete write (%ld != %ld)\n", |
| 331 | written, outcnt); | 331 | written, outcnt); |
| 332 | decompress_error = 1; | 332 | decompress_error = 1; |
| 333 | return -1; | 333 | return -1; |
diff --git a/init/initramfs.c b/init/initramfs.c index a8497fab1c3d..bece48c3461e 100644 --- a/init/initramfs.c +++ b/init/initramfs.c | |||
| @@ -19,6 +19,29 @@ | |||
| 19 | #include <linux/syscalls.h> | 19 | #include <linux/syscalls.h> |
| 20 | #include <linux/utime.h> | 20 | #include <linux/utime.h> |
| 21 | 21 | ||
| 22 | static ssize_t __init xwrite(int fd, const char *p, size_t count) | ||
| 23 | { | ||
| 24 | ssize_t out = 0; | ||
| 25 | |||
| 26 | /* sys_write only can write MAX_RW_COUNT aka 2G-4K bytes at most */ | ||
| 27 | while (count) { | ||
| 28 | ssize_t rv = sys_write(fd, p, count); | ||
| 29 | |||
| 30 | if (rv < 0) { | ||
| 31 | if (rv == -EINTR || rv == -EAGAIN) | ||
| 32 | continue; | ||
| 33 | return out ? out : rv; | ||
| 34 | } else if (rv == 0) | ||
| 35 | break; | ||
| 36 | |||
| 37 | p += rv; | ||
| 38 | out += rv; | ||
| 39 | count -= rv; | ||
| 40 | } | ||
| 41 | |||
| 42 | return out; | ||
| 43 | } | ||
| 44 | |||
| 22 | static __initdata char *message; | 45 | static __initdata char *message; |
| 23 | static void __init error(char *x) | 46 | static void __init error(char *x) |
| 24 | { | 47 | { |
| @@ -174,7 +197,7 @@ static __initdata enum state { | |||
| 174 | } state, next_state; | 197 | } state, next_state; |
| 175 | 198 | ||
| 176 | static __initdata char *victim; | 199 | static __initdata char *victim; |
| 177 | static __initdata unsigned count; | 200 | static unsigned long count __initdata; |
| 178 | static __initdata loff_t this_header, next_header; | 201 | static __initdata loff_t this_header, next_header; |
| 179 | 202 | ||
| 180 | static inline void __init eat(unsigned n) | 203 | static inline void __init eat(unsigned n) |
| @@ -186,7 +209,7 @@ static inline void __init eat(unsigned n) | |||
| 186 | 209 | ||
| 187 | static __initdata char *vcollected; | 210 | static __initdata char *vcollected; |
| 188 | static __initdata char *collected; | 211 | static __initdata char *collected; |
| 189 | static __initdata int remains; | 212 | static long remains __initdata; |
| 190 | static __initdata char *collect; | 213 | static __initdata char *collect; |
| 191 | 214 | ||
| 192 | static void __init read_into(char *buf, unsigned size, enum state next) | 215 | static void __init read_into(char *buf, unsigned size, enum state next) |
| @@ -213,7 +236,7 @@ static int __init do_start(void) | |||
| 213 | 236 | ||
| 214 | static int __init do_collect(void) | 237 | static int __init do_collect(void) |
| 215 | { | 238 | { |
| 216 | unsigned n = remains; | 239 | unsigned long n = remains; |
| 217 | if (count < n) | 240 | if (count < n) |
| 218 | n = count; | 241 | n = count; |
| 219 | memcpy(collect, victim, n); | 242 | memcpy(collect, victim, n); |
| @@ -346,7 +369,8 @@ static int __init do_name(void) | |||
| 346 | static int __init do_copy(void) | 369 | static int __init do_copy(void) |
| 347 | { | 370 | { |
| 348 | if (count >= body_len) { | 371 | if (count >= body_len) { |
| 349 | sys_write(wfd, victim, body_len); | 372 | if (xwrite(wfd, victim, body_len) != body_len) |
| 373 | error("write error"); | ||
| 350 | sys_close(wfd); | 374 | sys_close(wfd); |
| 351 | do_utime(vcollected, mtime); | 375 | do_utime(vcollected, mtime); |
| 352 | kfree(vcollected); | 376 | kfree(vcollected); |
| @@ -354,7 +378,8 @@ static int __init do_copy(void) | |||
| 354 | state = SkipIt; | 378 | state = SkipIt; |
| 355 | return 0; | 379 | return 0; |
| 356 | } else { | 380 | } else { |
| 357 | sys_write(wfd, victim, count); | 381 | if (xwrite(wfd, victim, count) != count) |
| 382 | error("write error"); | ||
| 358 | body_len -= count; | 383 | body_len -= count; |
| 359 | eat(count); | 384 | eat(count); |
| 360 | return 1; | 385 | return 1; |
| @@ -384,7 +409,7 @@ static __initdata int (*actions[])(void) = { | |||
| 384 | [Reset] = do_reset, | 409 | [Reset] = do_reset, |
| 385 | }; | 410 | }; |
| 386 | 411 | ||
| 387 | static int __init write_buffer(char *buf, unsigned len) | 412 | static long __init write_buffer(char *buf, unsigned long len) |
| 388 | { | 413 | { |
| 389 | count = len; | 414 | count = len; |
| 390 | victim = buf; | 415 | victim = buf; |
| @@ -394,11 +419,11 @@ static int __init write_buffer(char *buf, unsigned len) | |||
| 394 | return len - count; | 419 | return len - count; |
| 395 | } | 420 | } |
| 396 | 421 | ||
| 397 | static int __init flush_buffer(void *bufv, unsigned len) | 422 | static long __init flush_buffer(void *bufv, unsigned long len) |
| 398 | { | 423 | { |
| 399 | char *buf = (char *) bufv; | 424 | char *buf = (char *) bufv; |
