Commit Graph

198 Commits

Author SHA1 Message Date
Yann E. MORIN
3f28a38e1a fs/common: generate users before setting permissions
We will need the users and groups to get defined before we can use them
from makedevs.

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>
2016-02-01 07:25:36 +01:00
Yann E. MORIN
301c18e123 fs/ext2: add options for extra space and extra inodes
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>
2015-10-31 15:56:56 +01:00
Peter Korsgaard
576463a951 fs/axfs: fix URL indentation
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-10-15 21:59:39 +02:00
Ariel D'Alessandro
a6f916430f axfs: add new filesystem type
The Advanced XIP File System is a Linux kernel filesystem driver that
enables files to be executed directly from flash or ROM memory rather
than being copied into RAM. It has the ability to store individual
*pages* in a file uncompressed/XIP or compressed/Demand Paged.

This commit only adds support for 'XIP all' mode, so all the files that
have the execute attribute set will be XIP'ed.

At the moment, the FS is not supported in Linux mainline (v4.3-rc5), so
the kernel has to be built with the axfs patches to be able to read it.
Patches can be found here: https://github.com/jaredeh/axfs

[Thomas: rewrap Config.in help text.]

Signed-off-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-10-14 23:47:30 +02:00
Arnout Vandecappelle
03f18925a0 fs/romfs: remove redunant ROMFS_TARGET definition
Probably a leftover from our last fs infra reworking a couple of years
ago.

Incidentally, also added a newline at the end of the file.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-10-06 08:20:01 +02:00
Matthias Weisser
07e37bcc42 squashfs: Add lz4 hc compression
lz4 offers a high compression mode. A minimalistic file system shrinks by about 15%.

[Peter: Unconditionally use hc mode for lz4 instead of introducing another option]
Signed-off-by: Matthias Weisser <m.weisser.m@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-10-04 18:35:40 +02:00
Vivien Didelot
7a691d08e3 fs: iso9660: change boot menu entry text
Replace Grub-specific "menu.lst" with "menu config" in the
BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU Kconfig entry text, and mention
missing grub.cfg for Grub 2.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-08-18 21:42:51 +02:00
Thomas Petazzoni
15a53b93a0 fs/common: add <fs>_POST_GEN_HOOKS support
The common filesystem infrastructure already supports a
<fs>_PRE_GEN_HOOKS variable, which allows filesystem makefiles to
register some actions to be done before the root filesystem image is
generated.

This commit adds a similiar <fs>_POST_GEN_HOOKS variable, which will
allow filesystem makefiles to do some actions after the filesystem
image has been generated. It will initially be used by the iso9660
filesystem to delete the temporary directory it creates.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Noé Rubinstein <nrubinstein@aldebaran.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-08-10 20:56:05 +02:00
Noé Rubinstein
8fb2b4c9da fs/iso9660: install Isolinux comboot modules
This installs every module selected by the BR2_TARGET_SYSLINUX_C32.
This is useful when using a custom Isolinux configuration file that may use
comboot modules.

Signed-off-by: Noé Rubinstein <nrubinstein@aldebaran.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-30 23:31:26 +02:00
Thomas Petazzoni
95bd0ad351 fs: build host-mkpasswd when BR2_ROOTFS_USERS_TABLES is used
The code in fs/common.mk properly triggers the build of host-mkpasswd
when at least one package specifies a <pkg>_USERS variable. However,
when no selected package specifies a <pkg>_USERS variable but the user
uses a custom users table through BR2_ROOTFS_USERS_TABLES, then we
forget to build host-mkpasswd, leading to build failures if you don't
have mkpasswd installed in your machine.

This commit fixes that by taking into account both the package users
table and the custom users table when deciding to depend or not on
host-mkpasswd.

Reported-by: Auke Willem Oosterhoff <oosterhoff@baopt.nl>
Cc: Auke Willem Oosterhoff <oosterhoff@baopt.nl>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-07-21 23:12:52 +02:00
Arnout Vandecappelle
4d1a9d8cd8 fs/iso9660: change the name of the tmp dir to be consistent
Currently, the generated rootfs will be called rootfs.iso9660, but the
temporary directory we create while building it is called
rootfs-iso9660.tmp. They are in different directories so it's not so
obvious, but still to be consistent it's better to call the temp dir
rootfs.iso9660.tmp.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-14 01:31:07 +02:00
Thomas Petazzoni
795df97093 fs/iso9660: add support for grub2
After having extended the iso9660 support to allow isolinux as an
alternative to grub, this commit adds grub2 as a third
alternative. With the previous work done to support isolinux, adding
support for grub2 is fairly trivial.

[Thomas: set timeout to 10 seconds and not 5 seconds, in order to
match the configuration used for grub.]

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:25:18 +02:00
Thomas Petazzoni
5bac06e881 fs/iso9660: add hybrid image support
This commit adds a new option, which allows, when isolinux is used as
the bootloader, to generate an "hybrid" ISO image. Such images can
either be booted from CD-ROM or from USB keys. It simply uses the
isohybrid tool provided by syslinux.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:24:52 +02:00
Thomas Petazzoni
f9ac784ee6 fs/iso9660: add isolinux support
After all the preparation commits, this commit finally adds the
iso9660 support itself. Besides adding a new Config.in entry, a little
bit of .mk code and the isolinux.cfg default configuration, not much
is needed.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:24:45 +02:00
Thomas Petazzoni
bd256e96c0 fs/iso9660: use 'depends on' instead of 'select' for bootloader
In preparation to the introduction of the support for other
bootloaders than Grub, this commit switches from having the iso9660
support "select" the necessary bootloader to using a "depends on".

The main motivation is that the isolinux bootloader support will
really need to do a "depends on", due to the need of having a certain
option enabled, but this option being a kconfig "choice".

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:21:34 +02:00
Thomas Petazzoni
a399f5ebbe fs/iso9660: introduce bootloader choice
In preparation to the introduction for the support of other
bootloaders than Grub, this commit adds a "choice ... endchoice" block
with just the Grub option, and adds some conditionals in the
iso9660.mk code for the Grub specific parts.

Of course, for now those conditionals are a bit useless with just this
commit, but they become useful with the followup commits.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:21:27 +02:00
Thomas Petazzoni
1c5a097b7e fs/iso9660: introduce new variables
In preparation to the introduction of the support for other
bootloaders that Grub, this commit introduces two new variables:

 - ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH, which gives the full path to
   the bootloader configuration file

 - ROOTFS_ISO9660_BOOT_IMAGE, which gives the relative path of the
   main bootloader image, as needed by genisoimage's -b option.

There are no functional changes made, as the variables are for now
always set to the same value.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:21:18 +02:00
Thomas Petazzoni
7080eef9b8 fs/iso9660: support building a real iso9660 filesystem
Until now, the iso9660 filesystem handling only supported using an
initrd/initramfs to store the root filesystem, which is very different
from what we do with the other filesystems.

This commit changes the iso9660 logic to also allow using directly an
iso9660 filesystem to store the root filesystem. A new option,
BR2_TARGET_ROOTFS_ISO9660_INITRD, is created to tell the iso9660 that
we want to use an initrd and not directly the root filesystem in
iso9660 format. This option defaults to 'y' to preserve the existing
behavior.

After this commit, we therefore have three possibilities:

 * BR2_TARGET_ROOTFS_ISO9660=y, with BR2_TARGET_ROOTFS_INITRAMFS and
   BR2_TARGET_ROOTFS_ISO9660_INITRD disabled. In this case, the
   iso9660 filesystem is directly the contents of the root filesystem
   (since is possible thanks to the Rockridge extensions that were
   already enabled using the -R option of genisoimage). Obviously, it
   means that the root filesystem is read-only.

 * BR2_TARGET_ROOTFS_ISO9660=y and BR2_TARGET_ROOTFS_INITRAMFS=y (the
   value of BR2_TARGET_ROOTFS_ISO9660_INITRD doesn't matter). In this
   case, the root filesystem is already linked into the kernel image
   itself, as an initramfs. So the iso9660 filesystem doesn't contain
   the root filesystem as is, but just the bootloader and the kernel
   image.

 * BR2_TARGET_ROOTFS_ISO9660=y, BR2_TARGET_ROOTFS_ISO9660_INITRD=y and
   BR2_TARGET_ROOTFS_INITRAMFS disabled. In this case, a separate
   initrd is used. The iso9660 filesystem only contains the
   bootloader, the kernel and the initrd.

In order to support the first case out of the box, root=/dev/sr0 is
added on the kernel command line in the example Grub configuration
file, so that the kernel knows where the root filesystem is
located. This argument is ignored when initrd/initramfs are used.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:21:10 +02:00
Thomas Petazzoni
168cce0496 fs/iso9660: prepare cleaner kernel/initrd path handling
The iso9660.mk modifies the menu.lst file from Grub to set the correct
initrd/kernel image locations. However, with the upcoming support of
other bootloaders for iso9660 filesystems, we need to modify a bit
this logic.

Instead of relying on the specific details of the grub menu.lst
syntax, we introduce the __KERNEL_PATH__ and __INITRD_PATH__ magic
keywords, which iso9660.mk will replace by the appropriate
values. They can therefore be used where needed in grub menu.lst, and
in similar configuration files of other bootloaders, as will be
supported in the following commits.

Also, in order to be consistent with the soon to be introduced support
for having the root filesystem itself as iso9660, this commit changes
the installation location of the initrd and kernel. Instead of being
/initrd and /kernel, they become /boot/initrd and
/boot/$(LINUX_IMAGE_NAME).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:18:53 +02:00
Thomas Petazzoni
3736b9a7c1 fs/iso9660: get grub splash from $(TARGET_DIR)
Instead of using directly the splash image from the Buildroot source
directory boot/grub, this commit changes the iso9660 logic to use the
splash image installed in $(TARGET_DIR)/boot/grub.

This effectively allows a user to use a custom splash image by
installing it to $(TARGET_DIR) through a rootfs overlay or using a
post-build script.

Suggested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:18:46 +02:00
Thomas Petazzoni
61db081ca1 fs/iso9660: change the location of the splash image
In order to simplify the introduction of the support for using ISO9660
as the real root filesystem, this commit changes the location of the
grub splash image. This makes it match where the splash image is
located in $(TARGET_DIR), so that regardless of whether the
initrd/initramfs solution or the real iso9660 filesystem solution are
used, the splash image is installed at the same location.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:18:37 +02:00
Thomas Petazzoni
0cfc57a8b3 fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix
For consistency reasons, this commit renames all internal variables of
iso9660.mk to use the ROOTFS_ISO9660 prefix.

While we're at it, replace a useless ':=' by '='.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:18:31 +02:00
Thomas Petazzoni
818fe5e596 fs/iso9660: enable Joliet extension
We already enable the Rockridge extension by default when building
ISO9660, so let's also enable the Joliet extension which allows to
support Unicode file names and long file names.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:18:24 +02:00
Thomas Petazzoni
41f0688d91 fs/iso9660: convert to the filesystem infrastructure
This commit converts the iso9660 logic to the common rootfs
infrastructure. What previously prevented it from being converted is
that the iso9660 logic needed to remove a temporary folder after the
image has been created.

However, since Buildroot typically keeps build artefacts around, this
commit changes the logic to keep this temporary folder around. Thanks
to this change, converting to the common rootfs infrastructure becomes
possible.

In addition, the temporary folder is renamed from $(BUILD_DIR)/iso9660
to the more descriptive $(BUILD_DIR)/rootfs-iso9660.tmp.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:18:20 +02:00
Thomas Petazzoni
48229662ce fs/iso9660: use if ... endif block instead of depends on
In preparation to the addition of numerous additional options to the
iso9660 filesystem logic, use a if ... endif block instead of a
depends on for the only option that currently exists.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:18:12 +02:00
Michał Leśniewski
e3904a890d fs/jffs2: Fix mkfs.jffs2 --pagesize parameter usage
Fixes #8186

Mkfs.jffs2 accepts a --pagesize parameter, which allows specifying the size
of the virtual memory page size of the target machine, where the image will
be used.  (This is the value of the PAGE_SIZE macro in Linux.) In most cases
the parameter doesn't need to be set as the default value of 4 kB is usually
correct.

The parameter was used incorrectly in Buildroot -- it was set to the page
size of flash memory chip -- this commit fixes this problem.  Now the
--pagesize parameter is not used at all (unless the user explicitly chooses
to use a custom value during configuration).  All existing defconfigs were
corrected to match the new configuration variable names.

[Peter: reword, add Config.in.legacy handling]
Signed-off-by: Michał Leśniewski <mlesniew@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-05-22 11:36:00 +02:00
Thomas Petazzoni
54640e8e89 fs: only add non rootfs- targets to PACKAGES
Commit 4570dbcb14
("4570dbcb14b394d8f3c97baf4c9e5f4f225d1d37") added the dependencies of
rootfs building logic to PACKAGES, only thinking about the case where
rootfs building logic actually depends on real, normal packages
(host-mtd, host-genext2fs, etc.). But some file systems (rootfs-ubi)
depend on other filesystem images (rootfs-ubifs). And such targets
should not be added to PACKAGES, otherwise an incorrect circular
dependency is created.

This commit fixes that by only adding the rootfs building logic
dependencies that do *not* start with rootfs- to the global PACKAGES
variable.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-04-26 12:16:19 +02:00
Thomas Petazzoni
4570dbcb14 fs: add rootfs dependencies to PACKAGES
The logic for creating most of the filesystem images requires a
certain number of host packages to be built. However, those packages
are not currently listed in the global PACKAGES variables, and they
are not dependencies of any other package listed in the PACKAGES
variable.

While it does not have any practical implications, it makes sense to
have those packages listed in the global PACKAGES variable, which this
commit implements.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-04-14 10:17:04 +02:00
Thomas Petazzoni
2aef771f6e fs: declare phony targets as such
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>
2015-04-14 10:12:32 +02:00
Thomas De Schampheleire
26e0d500b5 fs/common: build host-xz when xz compression is used
When a filesystem image is xz-compressed, the XZ variable is used to refer
to the xz compression tool, but it is not necessarily available. Add a
proper dependency to fix that.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-03-09 14:10:13 +01:00
Stefan Sørensen
6b577b3c3a fs: Bail out on errors in fakeroot script
Currently, the generated fakeroot script has no error checking causing
make to continue building even if some of the fakeroot script commands
have failed. This can cause e.g. using an invalid device tables to go
unnoticed.

So add a "set -e" to the start of the fakeroot script so it will exit
with a failure code as soon as one of the script commands fails.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-03-08 22:21:36 +01:00
Yann E. MORIN
66ee6dc872 fs/tar: only store numeric uid/gid
If a target user is asigned a UID (e.g. 1000) that happens to also exist
on the build machine, tar will happily store the username for that user.

This can be seen by some as potential information disclosure.

Instruct tar to just store the numeric uid/gid.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-19 22:02:59 +01:00
Jerzy Grzegorek
5d4734084d package: indentation cleanup
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-12-10 21:53:30 +01:00
Yann E. MORIN
c83fa6b0af fs/ext2: add option to specify a filesystem label
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>
2014-12-07 22:07:22 +01:00
Yann E. MORIN
d6831e5e97 fs/ext2: use the new mke2img host package
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>
2014-12-07 22:06:55 +01:00
Yann E. MORIN
9d19f8fc86 package/mke2img: new package
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>
2014-12-07 22:06:44 +01:00
Guido Martínez
4273d4d9ff fs/iso9660: use install instead of cp
This way we don't depend on the permissions of files under boot/ or fs/,
which aren't tracked.

While we're at it, change all 'cp' usages into 'install' with the
correct mode for each file.

Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-11-22 19:01:27 +01:00
Jerzy Grzegorek
1769933d98 package: indentation cleanup
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-26 05:47:05 +01:00
Jerzy Grzegorek
595bf30654 package: indentation cleanup
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-23 22:13:29 +02:00
Karoly Kasza
e4a436f5e4 fs/iso9660: add dependencies for make source
The "iso image" rootfs target is a special one, as it does not use the
ROOTFS_TARGET infrastructure. The absence of ROOTFS_*_DEPENDENCIES
variable makes "make source" to skip this target's dependencies
(namely host-cdrkit and it's children) obstructing an offline build.

[Thomas: add the rootfs-iso9660-show-depends target, so that 'make
graph-depends' doesn't break when iso9660 is selected.]

Signed-off-by: Karoly Kasza <kaszak@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-19 11:52:32 +02:00
Thomas De Schampheleire
f268f7131b .mk files: bulk aligment and whitespace cleanup of assignments
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>
2014-10-07 15:00:28 +02:00
Thomas De Schampheleire
025d4a1729 linux: remove support of linux26-* targets
The linux-* mirror targets of linux26-* have been added a very long time ago
(2010) and linux 2.6 is now considered 'old' anyway. It no longer makes
sense to support these linux26-* targets, so this patch removes them.

This is a simplification introduced in preparation of the kconfig-package
infrastructure.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-29 23:47:03 +02:00
Thomas De Schampheleire
54456cc698 infra: consistently use double dollar signs inside inner-xxx-targets
The inner-xxx-targets in the buildroot package infrastructures are
evaluated using $(eval) which causes variable references to be a bit
different than in regular make code. As we want most references to be
expanded only at the time of the $(eval) we should not use standard
references $(VAR) but rather use double dollar signs $$(VAR). This includes
function references like $(call), $(subst), etc. The only exception is the
reference to pkgdir/pkgname and numbered variables, which are parameters to
the inner block: $(1), $(2), etc.

This patch introduces consistent usage of double-dollar signs throughout the
different inner-xxx-targets blocks.

In some cases, this would potentially cause circular references, in
particular when the value of HOST_FOO_VAR would be obtained from the
corresponding FOO_VAR if HOST_FOO_VAR is not defined. In these cases, a test
is added to check for a host package (the only case where such constructions
are relevant; these are not circular).

Benefits of these changes are:
- behavior of variables is now again as expected. For example, setting
  $(2)_VERSION = virtual in pkg-virtual.mk will effectively work, while
  originally it would cause very odd results.

- The output of 'make printvars' is now much more useful. This target shows
  the value of all variables, and the expression that led to that value.
  However, if the expression was coming from an inner-xxx-targets block, and
  was using single dollar signs, it would show in printvars as
    VAR = value (value)
  while if double dollar signs are used, it would effectively look like
    VAR = value (actual expression)
  as is intended.
  This improvement is for example effective for FOO_DL_VERSION, FOO_RAWNAME,
  FOO_SITE_METHOD and FOO_MAKE.

The correctness of this patch has been verified using 'make printvars',
'make manual' and 'make legal-info' before and after applying this patch,
and comparing the output.

Insight-provided-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-14 19:09:54 +02:00
Yann E. MORIN
3fbd9887b3 filesystems: also chown symlinks
Currently, the symlinks in the generated filesystems will have the
UID of the user running the build, because 'chown' does not change
the ownership of symlinks, by default.

Although the implications are limited, some may not want that UID
to leak in the generated filesystems.

So, use 'chown -h' so even symlinks get properly chowned.

Reported-by: Angelo Dureghello <angelo@barix.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-09 11:28:57 +02:00
Peter Korsgaard
28b514a569 fs/common.mk: unbreak .xz compression when host-xz isn't built
Closes #7160

Since f46f81de13 (Don't build host-xz needlessly), host-xz is no longer
unconditionally built when xz fs compression is requested, so don't
explicitly refer to it.

Instead, rely on our check-host-xzcat logic to ensure xz is available and
set the path to ensure our host variant gets picked up if not available on
the build machine.

While we're at it, get rid of the now unused XZ variable.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-06-04 08:33:17 +02:00
Peter Korsgaard
27a5414804 Merge branch 'next'
Conflicts:
	package/gdb/Config.in.host

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-06-01 09:58:54 +02:00
Thomas De Schampheleire
e5512dfc49 fs/tar: use qstrip to clean up build output
When using the tar filesystem method, the build output shows at the end:

echo " tar -c""f <br>/output/images/rootfs.tar -C <br>/output/target ." >>
                                    <br>/output/build/_fakeroot.fs

The inner set of quotes can be easily removed by properly stripping the tar
options (coming from the buildroot configuration).

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-28 21:19:58 +02:00
Gustavo Zacarias
996dc12eff fs/squashfs: add lz4 compression support
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-18 23:48:28 +02:00
Yann E. MORIN
89e16118b4 fs: use our own tools when calling the fakerooted script
export PATH=$(BR_PATH) so that the fakerooted script uses our
own tools before any of the host-system ones.

Reported-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Romain Naour <romain.naour@openwide.fr>
Reviewed-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-11 10:51:28 +02:00
Yann E. MORIN
1773a2a142 fs: use our own mkpasswd when creating users
Export PATH=$(BR_PATH) so that our own mkpasswd is found before
any existing host-system one.

Reported-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Samuel Martin <s.martin49@gmail.com>
Tested-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-11 10:51:06 +02:00