Go to file
Arnout Vandecappelle c85cd189dc makedevs: make device node creation idempotent
We use makedevs to create device nodes in the target rootfs. However,
this can be called several times, e.g. when building several filesystem
images or when rebuilding. When makedevs is called the second time, the
device node already exists so mknod() errors out.

This wasn't noticed before because fakeroot's mknod() wrapper
(incorrectly) does _not_ error out when the file exists already. Now
we switched from fakeroot to pseudo, the problem becomes apparent.

Before creating the device node, check if it already exists and if so,
if it has the correct device type and number. Change of mode and
ownership is still done.

This approach was preferred over removing the target files before
creating them, which would be simpler. However, when e.g. a file exists
as a normal file and makedevs specifies it as a device node, that
really is an error so we should detect it.

The other types don't have to be changed. The 'd' (directory) type is
already OK because it already only creates directories if they don't
exist yet. The 'f' (file mode) and 'r' (recursive) types only operate
on files and directories that exist already.

Patch also sent upstream to busybox.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reported-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-05 23:32:59 +01:00
arch MIPS: add support for M6201 cores 2016-10-19 23:31:29 +02:00
board board: atmel: genimage: add 1M offset for FAT partition 2016-11-04 15:13:59 +01:00
boot package/uboot: define help commands when using Kconfig 2016-11-01 14:51:15 +01:00
configs configs/nanopi-neo: use a more conventional kernel 2016-11-05 11:54:55 +01:00
docs docs/website: update news with 2016.11-rc1 release e-mail link 2016-11-04 10:09:34 +01:00
fs fs/iso9660: drop reference to host-fakeroot 2016-11-03 23:28:01 +01:00
linux linux: add ev3dev extension 2016-11-02 17:52:24 +01:00
package makedevs: make device node creation idempotent 2016-11-05 23:32:59 +01:00
support get-developers: fix parentheses for print 2016-11-05 11:49:05 +01:00
system system: fix typo 2016-10-13 08:06:11 +02:00
toolchain toolchain-external.mk: fix ARCH_SUBDIR calculation 2016-10-28 14:28:49 +02:00
.defconfig arch: remove support for sh64 2016-09-08 22:15:15 +02:00
.gitignore
CHANGES CHANGES: mention fakeroot as a removed package 2016-11-03 23:31:53 +01:00
Config.in Config.in: add BR2_HOST_GCC_AT_LEAST_4_5 2016-10-26 21:11:34 +02:00
Config.in.legacy legacy: add missing select 2016-10-24 22:42:07 +02:00
COPYING
DEVELOPERS DEVELOPERS: transfer lttng-* and liburcu projects to Philippe Proulx 2016-11-03 22:31:42 +01:00
Makefile Update for 2016.11-rc1 2016-11-03 23:32:26 +01:00
Makefile.legacy Remove BR2_DEPRECATED 2016-10-15 23:14:45 +02:00
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on Freenode IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches