aboutsummaryrefslogtreecommitdiff
path: root/fs/ext2
Commit message (Collapse)AuthorAgeFilesLines
* fs/ext2: pass a default string to filesystem labelGravatar Fabio Estevam2020-04-151-0/+1
| | | | | | | | | | | | Currently the volume-label for the root filesystem partition is a string wit the following pattern: ad09a287-46a9-4790-ba97-fbbb549e5e96. Specify the volume-label as "rootfs" to make it easier to identify it. Suggested-by: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Fabio Estevam <festevam@gmail.com> Tested-by: Pierre-Jean Texier <pjtexier@koncepto.io> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* fs: don't use := when not neededGravatar Yann E. MORIN2019-10-271-1/+1
| | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* fs/*/Config.in: re-wrap help textGravatar Ricardo Martincoski2018-04-011-10/+12
| | | | | | | ... to follow the convention <tab><2 spaces><62 chars>. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* fs/ext2: add option for lz4 compressionGravatar Peter Korsgaard2018-01-081-0/+5
| | | | | Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs: make it behave a bit more like the package infraGravatar Yann E. MORIN2018-01-031-1/+1
| | | | | | | | | | | | | | Currently, to register a filesystem, one has to call: $(eval $(call ROOTFS_TARGET,blabla)) This is very unlike the package infrastructure, where the name of the package is automatically guessed by the infra. It turns out that we can now do that for the filesystem infra too. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: use a post-gen hook rather than a post-target ruleGravatar Yann E. MORIN2017-11-301-6/+4
| | | | | | | | | | | | | | | | | | | post-target rules are probably not resilient to parallel builds, given that they do not depend on the image being generated first. Beside, we already have a mechanism for running stuff after the filesystem is generated, and that's called post-gen hooks. Use those hooks. Note: this basically reverts 75b6303 (rootfs-ext2: make the symlink as a _POST_TARGET) since we've now re-introduced post-gen hooks. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Reviewed-by: Romain Naour <romain.naour@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: fix typoGravatar Marcus Hoffmann2017-07-291-1/+1
| | | | | Signed-off-by: Marcus Hoffmann <m.hoffmann@cartelsol.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* fs/ext2: hint about setting the filesystem size on errorGravatar Yann E. MORIN2017-07-261-1/+5
| | | | | | | | | | | | | | | Since we now request that the user sets the exact size of the ext2/3/4 filesystem, we've had quite a few users wondering what was going on when they enable too much and the default 60M are no longer enough. When mkfs.ext2 fails, print a hint that the user should check the size setting. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> [Arnout: Add *** and redirect to stderr] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* fs/ext2: Add BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS optionGravatar Sébastien Szymanski2017-07-092-1/+23
| | | | | | | | | | | | | This option lets the user specify mke2fs options and/or ext2/3/4 features. Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com> Signed-off-by: Samuel Martin <s.martin49@gmail.com> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Thomas: improve wording a bit, fix typos.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: rename BR2_TARGET_ROOTFS_EXT2_BLOCKS to BR2_TARGET_ROOTFS_EXT2_SIZEGravatar Samuel Martin2017-07-092-6/+15
| | | | | | | | | | | | | | This change deprecates the ext2/3/4 rootfs size in blocks symbol in favor of one that mimic the fs-size argument behavior of mkfs (i.e. size in a human readable format accepting k, m, g or t suffix or their upper-case variants). This change also updates the defconfigs that used to set BR2_TARGET_ROOTFS_EXT2_BLOCKS symbol. Signed-off-by: Samuel Martin <s.martin49@gmail.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* Globally replace $(HOST_DIR)/usr/sbin with $(HOST_DIR)/sbinGravatar 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/sbin' | xargs sed -i 's%$(HOST_DIR)/usr/sbin%$(HOST_DIR)/sbin%g' Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: use mkfs to generate rootfs imageGravatar Sébastien Szymanski2017-07-052-10/+10
| | | | | | | | | | | | | | | | | | | | | | | mkfs is now capable of generating rootfs images. Use mkfs instead of genext2fs. If not set, we now let mkfs calculate the block size and the number of inodes needed. This change also adjusts the options to meet those of mkfs. Notes: * Passing a null inode number to mkfs triggers its automatic calculation. * Passing a fs-size with no unit suffix to mkfs is interpreted as using 1K block size. Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com> Signed-off-by: Samuel Martin <s.martin49@gmail.com> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Thomas: don't pass PATH when calling mkfs.ext, just call it directly from $(HOST_DIR)/usr/sbin, as suggested by Arnout.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: deprecate BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES optionGravatar Samuel Martin2017-07-052-9/+0
| | | | | | | | | | | | | | | | Soon, the ext{2,3,4} rootfs image will no longer be generated with genext2fs, but using mke2fs instead which has no support for the extra inode number option. So, deprecate the BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES option and recommend, in lieu, to set the total inode number, taking account of the extra ones if needed. Signed-off-by: Samuel Martin <s.martin49@gmail.com> Cc: Sébastien Szymanski <sebastien.szymanski@armadeus.com> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* package/mke2img: add option to specify block sizeGravatar Yann E. MORIN2017-07-041-0/+1
| | | | | | | | | | | | | ext filesystems can use a block size of 1024, 2048, or 4096 bytes, the former being interesting to store small files, while the latter being more intersting to store bigger files. So far, we were using the default, which was to use a 1024-byte block. Continue doing so (for now...). Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: simplify codeGravatar Yann E. MORIN2017-07-041-11/+8
| | | | | | | | | No option is conditional anymore, so just collate them into a single assignment. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: allow reserving zero block for rootGravatar Yann E. MORIN2017-07-042-3/+6
| | | | | | | | | | | | The previous default, zero, just meant "use the default value of the filesystem generator", which happened to be 5% (the traditional value for all ext-creating tools we've ever seen). So, change the new default accordingly to 5%. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: always pass the label optionGravatar Yann E. MORIN2017-07-041-2/+2
| | | | | | | | | | ... since passing an empty string is equivalent to not setting a label. And fix the syntax highlighting in some editors... Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: always pass the number of inodesGravatar Yann E. MORIN2017-07-041-2/+1
| | | | | | | | ... since zero also means auto for the mke2img script, now. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* ext2: add help text for BR2_TARGET_ROOTFS_EXT2_BLOCKSGravatar J Evans2017-05-041-0/+2
| | | | | | Signed-off-by: J Evans <g4@novadsp.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: ensure -b option is always set for mke2imgGravatar J Evans2017-04-301-2/+0
| | | | | | Signed-off-by: J Evans <g4@novadsp.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: Remove support for auto-calculation of rootfs sizeGravatar Sébastien Szymanski2017-03-252-11/+3
| | | | | | | | | | | | | | | | Auto-calculation of the rootfs size cannot be done in a reliable way as it depends on the host filesystem and is broken on non ext4 host (see bugs [1] [2]). So let the user specify the size he wants for his rootfs. [1] https://bugs.busybox.net/show_bug.cgi?id=8831 [2] https://bugs.busybox.net/show_bug.cgi?id=9496 Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Thomas: as suggested by Arnout, use 60 MB as the default size instead of 64 MB.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: default to ext2 rev1Gravatar Peter Korsgaard2016-12-141-1/+1
| | | | | | | | | | | | | | | Rev0 is very old (E.G. from before Linux was maintained in git), the kernel prints a scary warning when used: EXT4-fs warning (device sda): ext4_update_dynamic_rev:746: updating to rev 1 because of new feature flag, running e2fsck is recommended And rev0 support is broken in u-boot 2016.11: http://lists.denx.de/pipermail/u-boot/2016-December/275916.html So default to rev1 instead. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs/ext2: fix double quoted labelGravatar Gaël PORTAY2016-11-211-6/+5
| | | | | | | | | | | | | | | | | | | | | | | Since the commit 6dd7bbb59134799ed3d7343f238b3b02592faebf, the label does not need anymore to be quoted. Even worse it *must* not be simple-quoted, unless the label will contain the double-quotes from the config variable BR2_TARGET_ROOTFS_EXT2_LABEL. The commit mentionned above has replaced echo by printf: - echo "$$(ROOTFS_$(2)_CMD)" >> $$(FAKEROOT_SCRIPT) + $$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT) Since this commit the rootfs label contains extra double-quotes. $ blkid /dev/mmcblk0: LABEL=""BR 2016.08"" UUID="xxx" ^ ^ With this fix, the extra double-quotes have disappeared: /dev/mmcblk0: LABEL="BR 2016.11-rc2" UUID="yyy" Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: add options for extra space and extra inodesGravatar Yann E. MORIN2015-10-312-2/+20
| | | | | | | | | | | | Add two options to the ext2 filesystem, one to add extra free space, one to add extra free inodes. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Gustavo Zacarias <gustavo@zacarias.com.ar> Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Cc: Martin Bark <martin@barkynet.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs: declare phony targets as suchGravatar Thomas Petazzoni2015-04-141-0/+2
| | | | | | | | This commit improves the filesystem handling code to declare its various targets as PHONY when appropriate. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
* fs/ext2: add option to specify a filesystem labelGravatar Yann E. MORIN2014-12-072-0/+11
| | | | | | | | | | | | | | Filesystems of the ext familly can carry a filesystem label. Add an option for the user to specify such a label. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Károly Kasza <kaszak@gmail.com> Tested-by: Karoly Kasza <kaszak@gmail.com> Reviewed-by: Karoly Kasza <kaszak@gmail.com> Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: use the new mke2img host packageGravatar Yann E. MORIN2014-12-072-129/+5
| | | | | | | | | | | | And get rid of the old genext2fs.sh wrapper. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Karoly Kasza <kaszak@gmail.com> Reviewed-by: Karoly Kasza <kaszak@gmail.com> Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* package/mke2img: new packageGravatar Yann E. MORIN2014-12-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we are using a shell script called genext2fs, that impersonates the real genext2fs. But that script does much more than just call genextfs: it also calls tune2fs and e2fsck. Because it impersonates genext2fs, we can not easily add new options, and are constrained by the genext2fs options. But it turns out that, of all the options supported by the real genext2fs, we only really care for a subset, namely: - number of blocks - number of inodes - percentage of blocks reeserved to root - the root directory which to generate the image from So, we introduce a new host package, mke2img, that is intended to eventually replace genext2fs.sh. This new script is highly modeled from the existing genext2fs.sh, but was slightly refreshed, and a new, supposedly sane set of options has been choosen for the features we need (see above), and some new options were added, too, rather than relying on the arguments order or environment variables: -b <nb-blocks> number of blocks in the filesystem -i <nb-inodes> number of inodes in the filesystem -r <pc-reserved> percentage of reserved blocks * -d <root-dir> directory containing the root of the filesystem * -o <img-file> output image file -G <ext-gen> extfs generation: 2, 3, or 4 (default: 2) -R <ext-rev> ext2 revision: 0 or 1 (default 1) -l <label> filesystem label -u <uid> filesystem UUID; if not specified, a random one is used * Mandatory options Since the upstream e2fsprogs are expected to release a new mke2fs that will be able to generate a filesystem image from a directory, we then will be able to replace all the logic in mke2img, to use mke2fs instead of the (relatively fragile) combination of the three tools we currently use. An entry is added for it in the "Host utilities" menu, so it can be selected for use by post-{build,image} scripts. The ext2 filesystem selection is changed to select that now. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Karoly Kasza <kaszak@gmail.com> Reviewed-by: Karoly Kasza <kaszak@gmail.com> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* .mk files: bulk aligment and whitespace cleanup of assignmentsGravatar Thomas De Schampheleire2014-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Buildroot coding style defines one space around make assignments and does not align the assignment symbols. This patch does a bulk fix of offending packages. The package infrastructures (or more in general assignments to calculated variable names, like $(2)_FOO) are not touched. Alignment of line continuation characters (\) is kept as-is. The sed command used to do this replacement is: find * -name "*.mk" | xargs sed -i \ -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#' Brief explanation of this command: ^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line \([?:+]\?=\) any assignment character =, :=, ?=, += \([^\\]\+\) any string not containing a line continuation \([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a line continuation character \(\s*\\\) optional whitespace, followed by a line continuation character Hence, the first subexpression handles empty assignments, the second handles regular assignments, the third handles regular assignments with line continuation, and the fourth empty assignments with line continuation. This expression was tested on following test text: (initial tab not included) FOO = spaces before FOO = spaces before and after FOO = tab before FOO = tab and spaces before FOO = tab after FOO = tab and spaces after FOO = spaces and tab after FOO = \ FOO = bar \ FOO = bar space \ FOO = \ GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse FOO += spaces before FOO ?= spaces before and after FOO := FOO = FOO = FOO = FOO = $(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C AT91BOOTSTRAP3_DEFCONFIG = \ AXEL_DISABLE_I18N=--i18n=0 After this bulk change, following manual fixups were done: - fix line continuation alignment in cegui06 and spice (the sed expression leaves the number of whitespace between the value and line continuation character intact, but the whitespace before that could have changed, causing misalignment. - qt5base was reverted, as this package uses extensive alignment which actually makes the code more readable. Finally, the end result was manually reviewed. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Cc: Yann E. Morin <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* *.mk: replace (TARGET|HOST)_PATH by BR_PATHGravatar Samuel Martin2014-04-161-1/+1
| | | | | | | | | | | | Thanks to the 2 previous patches of the series, BR_PATH contains all locations in which host-packages may install programs. This patch replaces the occurrences TARGET_PATH and HOST_PATH with BR_PATH, everywhere these variables are used in the *.mk files. Signed-off-by: Samuel Martin <s.martin49@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: fix generation of ext4 filesystemsGravatar Yann E. MORIN2014-01-061-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cset 7a58a4e (e2fsprogs: bump to version 1.42.9) broke the generation of ext4 filesystems. This is because, in ext4, some metadata are dependent on the UUID. If changing the UUID of an ext4 filesystem, tune2fs now exits with exit-code 1, and prints a message to run fsck, to avoid trashing the filesystem. This condition is of utmost importance on a mounted filesysten (which is not our case) to avoid corruption (yes, it is possible to change the UUID of a mounted filesystem). But the error is not valid for us, since we are working on an unmonted filesystem image in the first place. Since we change the UUID after we convert the filesystem (to ext4), tune2fs just bails out. We can not just ignore the exit code of tune2fs, since we still want to catch any other failure. It turns out that, changing the UUID before converting the filesystem is just the way to go. Fixes #6752. Reported-by: Daniel Mentz <daniel@exxm.de> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Daniel Mentz <daniel@exxm.de> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* Config.in files: fix incorrect indentationGravatar Thomas De Schampheleire2013-12-251-3/+3
| | | | | | | Tab instead of spaces Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* rootfs-ext2: symlink with the compressed rootfsGravatar Arnout Vandecappelle2013-11-111-1/+1
| | | | | | | | Previously, a symlink was created to the uncompressed filesystem, which made it a bit useless in case compression was chosen. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* rootfs-ext2: make the symlink as a _POST_TARGETGravatar Arnout Vandecappelle2013-11-111-3/+3
| | | | | | | This will allow us to remove the unused ROOTFS_$(FSTYPE)_POST_GEN_HOOKS. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* Normalize separator size to 80Gravatar Jerzy Grzegorek2013-06-071-2/+2
| | | | | Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* package/genext2fs: add host variantGravatar Yann E. MORIN2013-06-031-0/+1
| | | | | | | | | | | | | | | | | | | | | genext2fs is built only if the user selected an ext2 root filesystem. However, some use-cases can't live with the full target/ dir on the root filesystem, and requires separate partitions (eg. for /usr). In this case, the user would not select an ext2 root fs in the Buildrooot menu, and would only generate a tarball of the rootfs. This tarball would then be used from a post-image script to build the actual required FSes. But then, genext2fs is not built, since the ext2 root FS was not selected. As for the other filesystem generators, provide a host variant of genext2fs (genext2fs is already host-package aware, so only needs adding a Kconfig entry). Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: further fix to the UUIDGravatar Yann E. MORIN2013-05-291-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turned out that setting a nil-UUID is no better than clearing it. What currently happens is as follows: - first, genext2fs does not generate a UUID - then we tune2fs to upgrade the filesystem - then we run fsck, which generates a random UUID - then we re-run tune2fs to set a nil-UUID So, on the target, if the file system is improperly unmounted (eg. with a power failure), on next boot, fsck may be run, and a new random UUID will be generated. *However*, fsck improperly updates the filesystem when it adds the UUID, and there are a few group descriptor checksum errors. Those errors will go undetected until the next fsck, which will then block for user input (bad on embedded systems, bad). Fix that by systematically generating a random UUID _before_ we call to fsck. A random UUID is not so bad, after all, since there are already so many sources of unpredictability in the filesystem: files date and ordering, files content (date, paths...) which renders a fixed UUID unneeded. And it is still possible to set the UUID in a post-image script if needed, anyway. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Peter Korsgaard <jacmet@uclibc.org> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: explicitly set a NULL UUIDGravatar Yann E. MORIN2013-05-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | "tune2fs -U clear" creates an invalid filesystem, that fsck.ext2 whines about later: $ make rootfs-ext2 [--SNIP--] $ ./host/usr/sbin/fsck.ext4 images/rootfs.ext2 e2fsck 1.42.7 (21-Jan-2013) Filesystem did not have a UUID; generating one. images/rootfs.ext2: clean, 4616/5120 files, 53171/131072 blocks $ ./host/usr/sbin/fsck.ext4 -f images/rootfs.ext2 e2fsck 1.42.7 (21-Jan-2013) One or more block group descriptor checksums are invalid. Fix<y>? yes Group descriptor 0 checksum is 0x4131, should be 0x8bdb. FIXED. [--SNIP--] So we set an explicitly NULL UUID instead. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/common: add support for LZO and XZ compression methodsGravatar Gustavo Zacarias2013-04-241-0/+10
| | | | | | | | Add support for LZO and XZ compression methods to cpio, ext2, tar and ubifs filesystem targets. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: bump journal overhead to 1300 blocksGravatar Peter Korsgaard2013-04-121-6/+3
| | | | | | | | | | | | | | | | | A quick test with a ~3.5MB ext4 filesystem shows that 1081 blocks isn't enough: tune2fs 1.42.7 (21-Jan-2013) Please run e2fsck on the filesystem. Creating journal inode: Journal size too big for filesystem. So bump it a bit. Overestimating the journal size is probably not really a big deal for the kind of systems using ext3/4 anyway. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: remove count- and time-based fsckGravatar Yann E. MORIN2013-04-121-2/+5
| | | | | | | | | | | Set the count- and time-based checks intervals to 0, thus effectively disabling automatic checks at boot (after a suggestion by Arnout). Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: add support for ext2 rev0 and rev1Gravatar Yann E. MORIN2013-04-123-7/+28
| | | | | | | | | | | | | Some bootloaders have a buggy ext2 support, and require ext2 rev1 instead of the traditional ext2 rev0 that genext2fs produces. tune2fs accepts only one '-O list' at a time, so we need to construct a list of -O options. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: add a symlink 'rootfs.ext#' -> 'rootfs.ext2'Gravatar Yann E. MORIN2013-04-121-0/+7
| | | | | | Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: add ability to build ext3/4 tooGravatar Yann E. MORIN2013-04-123-10/+105
| | | | | | | | | | | | | | | | | | | | | | Use the host-e2fsprogs to tune2fs the generated rootfs.ext2 image, and upgrade it to either one of ext2, ext3 or ext4. Since calling tune2fs may require running e2fsck (tune2fs will warn to do so when certain FS options are changed), we systematically call e2fsck. This makes the code path simpler, and as a side-effect checks that genext2fs did not generate garbage. In turn, e2fsck will unconditionally add a UUID to the filesystem, which is bad for reproducibility, so we call tune2fs again to remove the UUID. This does not require checking the filesystem. To ensure compatibility of Buildroot's .config, leave ext2 as the default. Boards' .config can override this at will. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Peter Korsgaard <jacmet@uclibc.org> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: enclose the ext2 options in if...endifGravatar Yann E. MORIN2013-04-121-4/+3
| | | | | | | | | | Use a 'if...endif' construct instead of repeating the 'depends on' for each symbols. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Acked-by: Arnout Vandecappelle <arnout@mind.be> Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/common.mk: delay evaluation of variablesGravatar Arnout Vandecappelle (Essensium/Mind)2013-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | This makes things easier to understand and more consistent with the pkg-infra. For example, it removes the need for '$$@' in the CMD variables of fs/*/*.mk. It also makes it possible to update the variables later, e.g. in the package override file. It also makes sure that the date will be recorded correctly in Yann E. Morin's patch that logs the MESSAGE macros to a file. The fs/*/*.mk must be updated as well because the '$@' shouldn't be quoted anymore in the CMD variables or the hooks. The $(eval ...) for the dependencies is redundant, because the $(ROOTFS_TARGET) variable is already eval'd. Note that it is only redundant if the evaluation of the uses of the variable is also delayed. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: remove redundant BR2_TARGET_ROOTFS_EXT2_SQUASH optionGravatar Peter Korsgaard2011-01-142-9/+0
| | | | | | | The generic fs handling does a chmod -R 0:0 $(TARGET_DIR), so there's no need for a specific option to enforce this when making an ext2fs image. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: don't enable by defaultGravatar Peter Korsgaard2011-01-141-1/+0
| | | | | | | | | It's pretty uncommon to use ext2fs on embedded systems, so don't enable it by default. Adjust defconfigs to match. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* genext2fs.sh: improve number of blocks calculationGravatar Peter Korsgaard2010-12-301-14/+11
| | | | | | | | | | | | | Closes #2929 Instead of just adding a fixed amount to the blocks used, try to estimate the real space needed according to the filesystem structure (bitmaps, inodes, blocks). The side effect of this is that we no longer significantly overestimate the size needed for small file systems. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: fix blocks/inodes calculationGravatar Peter Korsgaard2010-04-192-11/+41
| | | | | | | | | | | With the ROOTFS_TARGET conversion, EXT2_OPTS gets evaluated very early (before TARGET_DIR is populated with files), so the calculated blocks/inodes numbers are wrong. Fix it by moving the calculation to a shell script wrapper around genext2fs, so it only gets executed just before genext2fs runs. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>