aboutsummaryrefslogtreecommitdiff
path: root/package/makedevs
Commit message (Collapse)AuthorAgeFilesLines
* makedevs: allow leading whitespace for capabilitiesGravatar Ricardo Martincoski2018-08-101-1/+1
| | | | | | | | | | | | | | | | | | Currently makedevs silently ignores extended attributes with leading whitespace, for example those added to a <PACKAGE>_PERMISSIONS following the recommended style from check-package. Makedevs already ignores leading whitespace for normal entries (file permission changes and device files creation). Do the same for extended attributes. Fixes: #11191. Reported-by: Jean-pierre Cartal <jpcartal@free.fr> Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* Globally replace $(HOST_DIR)/usr/bin with $(HOST_DIR)/binGravatar Arnout Vandecappelle2017-07-051-1/+1
| | | | | | | | | | | Since things are no longer installed in $(HOST_DIR)/usr, the callers should also not refer to it. This is a mechanical change with git grep -l '$(HOST_DIR)/usr/bin' | xargs sed -i 's%$(HOST_DIR)/usr/bin%$(HOST_DIR)/bin%g' Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* makedevs: support optional filesGravatar Arnout Vandecappelle2017-07-041-1/+4
| | | | | | | | | | | | | | | | | Add the 'F' file type to makedevs, that allows a file to be optional. With this option, the line is just silently skipped if the file doesn't exist (or is not a regular file). This is useful for _PERMISSIONS where the file can be configured out by package-specific configuration that is not directly handled by Buildroot, like busybox. Cc: Clayton Shotwell <clayton.shotwell@rockwellcollins.com> Cc: Matthew Weber <matthew.weber@rockwellcollins.com> Cc: Niranjan Reddy <niranjan.reddy@rockwellcollins.com> Cc: Bryce Ferguson <bryce.ferguson@rockwellcollins.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* boot, linux, package: use SPDX short identifier for GPLv2/GPLv2+Gravatar Rahul Bedarkar2017-04-011-1/+1
| | | | | | | | | | | We want to use SPDX identifier for license strings as much as possible. SPDX short identifier for GPLv2/GPLv2+ is GPL-2.0/GPL-2.0+. This change is done by using following command. find . -name "*.mk" | xargs sed -ri '/LICENSE( )?[\+:]?=/s/\<GPLv2\>/GPL-2.0/g' Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* Merge branch 'next'Gravatar Peter Korsgaard2016-12-012-15/+0
|\ | | | | | | Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
| * makedevs: remove target packageGravatar Arnout Vandecappelle2016-11-232-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The makedevs package is a fork of the makedevs tool from busybox. It is part of the Buildroot infrastructure, not something that should be used on the target. It something like this is needed on the target, upstream busybox should be used. And if one of the Buildroot-specific features is needed, then that feature should be upstreamed to busybox. Besides, there were already two things wrong with the target package: - it didn't take into account the overlap with busybox (no depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS, no dependency on busybox); - it didn't take into account the libcap feature. The target package was introduced more or less accidentally in 81cd9d45 where the intention was to make it more similar to other packages. So, kill it with fire. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* | Revert "makedevs: make device node creation idempotent"Gravatar Peter Korsgaard2016-11-271-16/+2
| | | | | | | | | | | | This reverts commit c85cd189dc1ded92b78c5968860ff447ec9815ad. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* | makedevs: make device node creation idempotentGravatar Arnout Vandecappelle2016-11-051-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | makedevs: resync device creation with upstream busyboxGravatar Arnout Vandecappelle2016-11-051-32/+15
|/ | | | | | | | | | | | | | | | | | | | | | | 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>
* makedevs: remove VERSION/SOURCEGravatar Thomas Petazzoni2016-07-031-5/+0
| | | | | | | | | 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>
* makedevs: add capability supportGravatar Philippe Reynes2016-06-302-4/+81
| | | | | | | | | | | | 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>
* package/makedevs: use the rooted /etc/passwd and /etc/groupGravatar Yann E. MORIN2016-02-011-9/+31
| | | | | | | | | | | | | | | | | | | | | 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>
* package/makedevs: fixing missing return typeGravatar Angelo Compagnucci2015-04-131-1/+1
| | | | | | | 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>
* package/makedevs: add recursive optionGravatar Angelo Compagnucci2015-04-111-0/+31
| | | | | | | | | | | | 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>
* makedevs: Rework READMEGravatar Maxime Hadjinlian2014-11-081-9/+9
| | | | | | | | | 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>
* makedevs: add license informationGravatar Gustavo Zacarias2014-07-151-0/+1
| | | | | | | | | | [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>
* makedevs: change version from 'undefined' to 'buildroot-$(BR2_VERSION)'Gravatar Thomas De Schampheleire2014-06-141-0/+2
| | | | | | | | | | | | | | 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>
* packages: replace command install by $(INSTALL)Gravatar Maxime Hadjinlian2014-06-081-2/+2
| | | | | | 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>
* packages: remove uninstall commandsGravatar Thomas De Schampheleire2013-12-061-5/+0
| | | | | Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* Config.in files: whitespace cleanupGravatar Thomas De Schampheleire2013-11-111-4/+4
| | | | | | | | | | 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>
* Normalize separator size to 80Gravatar Alexandre Belloni2013-06-061-2/+2
| | | | | Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* all packages: rename XXXTARGETS to xxx-packageGravatar Arnout Vandecappelle (Essensium/Mind)2012-07-171-1/+1
| | | | | | | | | | | | | 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>
* all packages: use new host-xxx-package macrosGravatar Arnout Vandecappelle (Essensium/Mind)2012-07-171-1/+1
| | | | | | | | | | | 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>
* Fix makedevs to allow longer path namesGravatar Julian Lunz2012-04-081-2/+2
| | | | | | | 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>
* makedevs: remove compiler warning about used-but-setGravatar Peter Korsgaard2011-10-091-1/+1
| | | | | | | Closes #4171 Based on patch by Hector Oron <hector.oron@gmail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* package: remove useless arguments from GENTARGETSGravatar Thomas Petazzoni2011-09-291-2/+2
| | | | | | | | | | 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>
* makedevs: minor fix to command's helpGravatar Javier Viguera2011-05-251-1/+1
| | | | | Signed-off-by: Javier Viguera <javier.viguera@digi.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* Allow several device tables and split in two parts our device tableGravatar Thomas Petazzoni2011-05-091-0/+35
| | | | | | | | | | | | | | 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>
* makedevs: don't call /bin/sync after creating nodesGravatar Peter Korsgaard2011-03-121-3/+0
| | | | | | | | | | 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>
* makedevs: convert to GENTARGETS formatGravatar Peter Korsgaard2011-03-121-24/+22
| | | | | | | And at the same time fix target build (used host compiler, didn't add to TARGETS). Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* makedevs: fix cases where (start != 0)Gravatar Thomas De Schampheleire2011-02-231-5/+13
| | | | | | | | | | | 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>
* makedevs: Add support for 16-bit major/minor numbersGravatar Matt Fleming2011-01-141-2/+2
| | | | | | | | 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>
* makedevs: add source targetsGravatar Peter Korsgaard2010-11-191-1/+3
| | | | Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* makedevs: convert to a more normal way of building packagesGravatar Thomas Petazzoni2010-04-192-14/+24
| | | | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* makedevs: move to package/Gravatar Thomas Petazzoni2010-04-192-0/+565
Since target/ doesn't contain any .mk file in subdirectories, also remove the include in target/Makefile.in.