Go to file
Yann E. MORIN 4628b6f3b4 fs: add pre- and post-command hooks
In some cases, the directory structure we want in the filesystem is not
exactly what we have in target/

For example, when systemd is used on a read-only rootfs, /var must be a
tmpfs. However, we may have packages that install stuff in there, and
set important rights (via the permission-table). So, at build time, we
need /var to be a symlink to the remanent location (/usr/share/factory)
while at runtime we need /var to be a directory.

One option would have been to have /var as a real directory even during
build time, and in a target-finalize hook, move everything out of there
and into the "factory" location. However, that's not possible because
it's too early: some packages may want to set ownership and/or acces
rights on directories or files in /var, and this is only done in the
fakeroot script, which is called only later during the assembling of the
filesystem images.

Also, there would have been no way to undo the tweak (i.e. we need to
restore the /var symlink so that subsequent builds continue to work) if
it were done as a target-finalize hook.

The only solution is to allow packages to register pre- and post-hooks
that are called right before and right after the rootfs commands are
executed, and inside in the fakeroot script.

We can however not re-use the BR2_ROOTFS_POST_FAKEROOT_SCRIPT feature
either because it is done before the filesystem command, but there is
nothing that is done after. Also, we don't want to add to, and modify a
user-supplied variable.

So, we introduce two new variables that packages can set to add the
commands they need to run to tweak the filesystem right at the last
moment.

Those hooks are not documented on-purpose; they are probably going to
only ever be used by systemd.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-08-02 20:58:27 +02:00
arch arch/arm: add big.LITTLE cpu variants 2017-07-22 23:29:24 +02:00
board configs/armadeus_apf27: bump to kernel 4.12.4 2017-07-31 19:35:19 +02:00
boot uboot: bump to version 2017.07 2017-07-21 22:43:36 +02:00
configs configs/armadeus_apf27: bump to kernel 4.12.4 2017-07-31 19:35:19 +02:00
docs core/legal-info: use hash file from version sub-dir 2017-07-29 22:34:41 +02:00
fs fs: add pre- and post-command hooks 2017-08-02 20:58:27 +02:00
linux linux: bump default to version 4.12.4 2017-07-29 15:38:16 +02:00
package fs: add pre- and post-command hooks 2017-08-02 20:58:27 +02:00
support support/testing: add runtime testing for init systems 2017-08-02 17:42:49 +02:00
system system: separate sysv and systemd parts of the skeleton 2017-08-02 20:04:29 +02:00
toolchain arch/arm: add big.LITTLE cpu variants 2017-07-22 23:29:24 +02:00
utils utils/readme.txt: add documentation of genrandconfig 2017-07-29 15:41:09 +02:00
.defconfig arch: remove support for sh64 2016-09-08 22:15:15 +02:00
.gitignore update gitignore 2013-05-04 12:41:55 +02:00
.gitlab-ci.yml support/testing: add runtime testing for init systems 2017-08-02 17:42:49 +02:00
.gitlab-ci.yml.in .gitlab-ci.yml: save rootfs as artifact for runtime tests 2017-07-31 21:23:25 +02:00
CHANGES CHANGES: update after binutils changes 2017-08-01 23:40:09 +02:00
Config.in Config.in: add BR2_HOST_GCC_AT_LEAST_7 2017-07-05 16:20:27 +02:00
Config.in.legacy binutils: remove support for 2.26 2017-08-01 23:38:05 +02:00
COPYING COPYING: add exception about patch licensing 2016-02-26 19:50:13 +01:00
DEVELOPERS let-me-create: new package 2017-07-29 23:10:41 +02:00
Makefile Makefile: add alldefconfig target 2017-07-25 23:06:58 +02:00
Makefile.legacy Remove BR2_DEPRECATED 2016-10-15 23:14:45 +02:00
README README: add reference to submitting-patches 2016-02-01 19:16:08 +01:00

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