- apply http://lkml.org/lkml/2006/4/7/149
authorMark Huang <mlhuang@cs.princeton.edu>
Thu, 4 May 2006 14:32:21 +0000 (14:32 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Thu, 4 May 2006 14:32:21 +0000 (14:32 +0000)
commit48ed14b8d2050ff25be145ef132d089c5599ce33
tree9fbdb27f3b7aee74d148ec2c79899f461009e01a
parentc0caf9cfdfd743c036162aab4f3157e89b42b7e7
- apply http://lkml.org/lkml/2006/4/7/149

Unlink files, symlinks, FIFOs, devices etc. (except directories) before
writing them when extracting CPIOs.  This stops weird behaviour like:
  1) writing through symlinks created in earlier CPIOs. eg foo->bar in
     the first CPIO.  Having foo as a non-link in a subsequent CPIO,
     results in bar being written and foo remaining as a symlink.
  2) if the first version of file foo is larger than foo in a
     subsequent CPIO, we end up with a mix of the two.  ie. neither
     the first or second version of /foo.
  3) special files like devices, fifo etc. can't be overwritten in
     subsequent CPIOS.

With this, the kernel will more closely replicate
   for i in *.cpio; do cpio --extract --unconditional < $i ; done

This is a change but it's regarded as fixing broken functionality.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
init/initramfs.c