| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In upstream busbyox, the code to create devices has been simplified:
the code for a single and for multiple devices is no longer duplicated.
Since we are going to change the device creation code next, it's
convenient to have only one copy to modify.
There are two behavioural changes with this, but they were introduced
silently together with other commits in upstream busybox.
- When mknod() fails, the chmod was still done. This is pointless so it
is no longer done now.
- There was a check for mode != -1; however, a mode of -1 would not
have worked anyway because all bits would be set for mknod(), which
would fail. So this check is redundant.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Fabio Estevam <festevam@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
| |
Now that the package infrastructure doesn't attempt to download a package
that has an empty version string, there's no need to define the VERSION and
SOURCE variables in the makedevs package.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the support of capability to makedevs as extended attribute.
Now, it's possible to add a line "|xattr <capability>" after a
file description to also add a capability to this file. It's
possible to add severals capabilities with severals lines.
[Peter: extend doc, reword Config.in, extend error message,
use HOST_MAKEDEVS_CFLAGS/LDFLAGS for all flags]
Signed-off-by: Philippe Reynes <philippe.reynes@sagemcom.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, makedevs will query the host's /etc/passwd and /etc/group to
resolve usernames and group names. This is inherently flawed, as we can
never guarantee that the UIDs will be the same on the target as on the
host, or even whether a particular user does exist on the host.
This is because getpwnam() and getgrnam() will forcibly read the
system's /etc/passwd and /etc/group, and there is no way to tell them to
look anywhere else.
However, we can use fgetpwent() and fgetgrent() instead, for which
we can pass a FILE* stream to read from to get the entries. This means
we must implement the scanning-loop ourselves, but fortunately, that's
pretty trivial to do.
[Peter: swap errno / return value check, use bb_perror_msg_and_die, code style]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
|
|
|
|
|
|
| |
This patch fixes a missing return type in bb_recursive function.
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the option to change owner/permission
of a directory recursively.
[Thomas: s/folder/directory/, as suggested by Yann.]
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
| |
Make all the example as a space separated list.
The definition of the different type was modified to look like the same
section on the manual.
Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
|
|
|
|
|
|
|
|
|
| |
[Thomas: change license to be GPLv2. The header of makedevs.c is a bit
unclear, as it mentions both the GPL and LGPL. But since the code
seems to originally be coming from Busybox, assuming GPLv2 is the
safest option.]
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The sources of the makedevs package are shipped with Buildroot, rather than
downloaded from an external location. As a result, no explicit version is
defined, causing build messages and build directory to show 'undefined' as
version.
This patch sets the version for makedevs to 'buildroot-$(BR2_VERSION), which
would for example expand to 'buildroot-2014.05'.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
| |
Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
| |
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes the following whitespace problems in Config.in files:
- trailing whitespace
- spaces instead of tabs for indentation
- help text not indented with tab + 2 spaces
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
|
|
|
|
| |
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also remove the redundant $(call ...).
This is a purely mechanical change, performed with
find package linux toolchain boot -name \*.mk | \
xargs sed -i -e 's/$(eval $(call GENTARGETS))/$(eval $(generic-package))/' \
-e 's/$(eval $(call AUTOTARGETS))/$(eval $(autotools-package))/' \
-e 's/$(eval $(call CMAKETARGETS))/$(eval $(cmake-package))/'
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This is a purely mechanical change, performed with
find package linux toolchain boot -name \*.mk | \
xargs sed -i -e 's/$(eval $(call GENTARGETS,host))/$(eval $(host-generic-package))/' \
-e 's/$(eval $(call AUTOTARGETS,host))/$(eval $(host-autotools-package))/' \
-e 's/$(eval $(call CMAKETARGETS,host))/$(eval $(host-cmake-package))/'
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
| |
Makedevs path name is currently limited to 40, changed it to
PATH_MAX 4096 from linux/include/linux/limits.h
Signed-off-by: Julian Lunz <git@jlunz.de>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
| |
Closes #4171
Based on patch by Hector Oron <hector.oron@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
| |
Thanks to the pkgparentdir and pkgname functions, we can rewrite the
GENTARGETS macro in a way that avoids the need for each package to
repeat its name and the directory in which it is present.
[Peter: pkgdir->pkgparentdir]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
| |
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows to have a device table for all directories/files and
another device table for the device files themselves. Both are needed
for static /dev, but only the first one is needed when
devtmpfs/mdev/udev are used.
We take this opportunity to move the documentation of the device table
format in a common location, package/makedevs/README.
[Peter: simplify code slightly, fix indentation]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
| |
Closes #3475
There's no real reason to sync after creating the device nodes,
and it slows down the file system image creating quite a lot on
busy systems, so get rid of it.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
| |
And at the same time fix target build (used host compiler, didn't add
to TARGETS).
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
|
|
|
| |
The makedevs script did not always generate the requested set of device names / minor number series.
* If start != 0, then requesting (count) devices would generate only (count - start)
* If start != 0 && increment != 1, then requesting minors starting with (minor) would generate minors starting with (minor + (start * (increment - 1)))
This patch fixes the code and updates the usage text with extra examples.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
|
|
|
|
| |
Closes #2647
[Peter: Adjust for the real 12bit majors/20bit minors supported by Linux]
Signed-off-by: Matt Fleming <matthew.fleming@imgtec.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
| |
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
|
|
|
|
| |
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
Since target/ doesn't contain any .mk file in subdirectories, also
remove the include in target/Makefile.in.
|