Commit graph

22 commits

Author SHA1 Message Date
Adam Duskett e2a7822415 package makefiles: clean up backslash spacing.
The check-package script when ran gave warnings on only using
one space before backslashes on all of these makefiles.
This patch cleans up all warnings related to the one space before
backslashes rule in the make files in the package directory.

Signed-off-by: Adam Duskett <aduskett@codeblue.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-04-22 15:57:23 +02:00
Thomas Petazzoni fc91501e6b system: do not overwrite /bin/sh Busybox symlink
The BR2_SYSTEM_BIN_SH hidden option defines to what binary the /bin/sh
symlinks should point to. If busybox is chosen, then /bin/sh is created
to point to /bin/busybox.

This works fine with the default installation mode of Busybox, but it
fails with the upcoming "individual binaries" mode, in which each applet
is installed as its own binary, and /bin/busybox doesn't exist: we get
/bin/sh as a broken symlink to /bin/busybox.

Since Busybox already installs its own /bin/sh symlink, properly
pointing to /bin/ash or /bin/hush depending on the selected shell, it
doesn't make sense for the BR2_SYSTEM_BIN_SH logic to override
this. Just let Busybox install its own /bin/sh by making
BR2_SYSTEM_BIN_SH empty when Busybox shell is selected as /bin/sh.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-03-29 23:28:58 +02:00
Yann E. MORIN 8c8b9b6ad7 system: do not set hostname and issue for custom skeleton
We expect the custom skeleton to be fully filled with the necessary
files, now. There is definitely no reason we should handle setting the
hostname and the issue file in there. A user using a custom skeleton
should be fully responsible for providing a functional skeleton.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-18 23:45:49 +02:00
Yann E. MORIN 65329a1024 system: do not handle network settings for custom skeleton
We expect the custom skeleton to be fully filled with the necessary
files, now. There is definitely no reason we should handle network
settings in there. A user using a custom skeleton should be fully
responsible for providing a functional skeleton.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-18 23:45:34 +02:00
Yann E. MORIN b541b9ff94 system: provide no default for custom skeleton path
Being custom means that our default one is not suitable to start with.
So there is no reason to offer it as the default path.

Add a check that it is not empty.

Add a separating empty line, for good measure, too.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Romain Naour <romain.naour@openwide.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-18 23:40:06 +02:00
Yann E. MORIN faece0a425 package/skeleton: respect variables namespace
In makefiles, variables have global scope. We traditionally ensure that
we get no name clashing by prefixing all variables with the package
name.

Currently, this is not the case in the skeleton package, for historical
reasons (code snippets copied over from the common Makefiles). We
currently have a mix of naming for the variables:
  - some are indeed prefixed with SKELETON_
  - some are prefixed with SYSTEM_
  - some are prefixed with both
  - some are not prefixed

Clean up these discrepancies, and prefix all variables with just
SKELETON_ and drop the SYSTEM_ prefix.

Also include SET_ in all variables that do set something (getty) for
consistency across all the variables.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-05 15:22:51 +02:00
Thomas Petazzoni 33e2eb5084 skeleton: remove SOURCE variable
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 SOURCE
variable in the skeleton package.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-07-03 12:58:14 +02:00
Yann E. MORIN be8270d3e3 package/skeleton: fix message about non-merged custom skeleton
Use of a merged /usr is not restricted to systemd anymore, thus the
current error message is misleading, as it only speaks about systemd.

Fix the message by just ditching the reference to systemd altogether.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-05-24 22:12:18 +02:00
Thomas De Schampheleire 50a93866f0 skeleton: move LIB_SYMLINK definition from Makefile
Commit 7a6b83a211 introduced the skeleton
package, which took over the lib32/lib64 -> lib symlink creation from the
main Makefile.
However, the definition of the LIB_SYMLINK variable did not move along, for
no real reason.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-01-20 21:49:14 +01:00
Luca Ceresoli f896b109ed skeleton: fix indentation of generated interfaces file
The generated $(TARGET_DIR)/etc/network/interfaces mixes spaces and
tabs. Fix by using tabs only.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-01-11 17:30:53 +01:00
Nathan Ford f61257b40f skeleton: fix VCS folders not being excluded from rootfs
There is a typo in skeleton.mk preventing rsync from excluding VCS
folders such as .svn.

Signed-off-by: Nathan Ford <nford@westpond.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-12-31 10:35:13 +01:00
Peter Korsgaard cc257ee493 Merge branch 'next'
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-12-01 23:24:07 +01:00
Yann E. MORIN cb34ea5d6a package/skeleton: also handle merged /usr in the staging
When the target uses a merged /usr setup, gdbserver will only report
paths in /lib to the remote gdb, which in turn will only look for
libraries in staging/lib and never in staging/usr/lib.

So. the merged (or non-merged) /usr setup must be replicated in the
staging.

The best solution where to do so is in the skeleton package, since it
is guaranteed to come before any package that installs things in the
staging, and even before the (internal or external) toolchain as well.

Reported-by: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-11-28 23:08:33 +01:00
Yann E. MORIN d60d6ac037 package/skeleton: parameterise the symlinks-or-mkdir macro
currently, we only make the merged symlinks or non-merged mkdirs in the
target directory. This is fine, as long as one does not run gdb.

However, as soon as one wants to run gdbserver on the target,
gdb will only search for libraries in /lib in the sysroot.

In preparation for a patch to fix that, make the symlink-or-mkdir macro
a function that takes as parameter the base directory where to create
symlinks or mkdir in.

Move the function declarations out of the custom/non-custom skeleton
conditional block, so they are always available.

Reported-by: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-11-28 23:05:35 +01:00
Trent Piepho 71c75a5ea0 system: Fix for NFS booting with interface config via DHCP
Configuring the network interface with DHCP via
/etc/network/interfaces generally does not work when NFS booting.  The
DHCP configuration will initially bring the interface down and system
then hangs at that point as the root filesystem is no longer
accessable.

This adds a script to be run via a pre-up line in
/etc/network/interfaces.  It checks for a NFS root filesystem and if
the interface to be configured is used for access to the NFS server.
If this is the case, then it returns a failure code so that ifup will
not configure the interface.  This works for DHCP and another config
methods (static, bootp, etc.).  This system does detect if the
interface to be configured isn't the one used for NFS and doesn't skip
it when that is the case.

NFS filesystems that aren't the root fs aren't considered.

Fixes bug #4790.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-11-18 22:14:56 +01:00
Yann E. MORIN 08fc0a47e1 package/skeleton: ensure custom skeleton uses merged /usr if needed
When using systemd, the policy in Buildroot is to use a merged /usr
(see c5bd8af6, "system: add options for /bin /sbin and /lib to be
symlinks into /usr" for more info). So, we apply a few tricks in some
packages to account for the merged /usr case.

However, when using a custom skeleton, we have no say in how that
skeleton is organised, so it may well have a split /usr. In that case,
our little tricks might not work as expected.

So, when the user uses a custom skeleton and wants systemd as an init
system, we must check that the custom skeleton is setup with a merged
/usr.

We do that by checking that each pair of {/lib,/usr/lib} {/bin,/usr/bin}
and {/sbin,/usr/sbin} have the same inode numbers, i.e. /lib must have
the same inode number as /usr/lib (and so on...). When a pair does not
share the same inode number, this is not a merged /usr and we abort.

We implement that check with make constructs, so it is done very early
in the build process, and we can abort early if need be.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-11-10 23:47:53 +01:00
Yann E. MORIN aab5a2829b package/skeleton: don't handle merged /usr for custom skeleton
In case the user wants to use a custom skeleton, we should not try to
handle the symlinks (resp. mkdir) to handle merged (resp. split) /usr.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-11-10 23:47:14 +01:00
Yann E. MORIN 8d9b39a979 package/skeleton: qstrip path before using it
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-11-10 23:46:47 +01:00
Jérôme Pouiller ccc52c8183 skeleton: optionally wait for network interfaces to appear
This patch has same purpose than 49964858f4:

  On some machines, the network interface is slow to appear. For example,
  on the Raspberry Pi, the network interface eth0 is an ethernet-over-USB,
  and our standard boot process is too fast, so our network startup script
  is called before the USB bus is compeltely enumerated, thus it can't
  configure eth0.

  Closes #8116.

However, wait-delay hook is enabled only if wait-delay property appears
in /etc/network/interfaces. This patch enable it automaticaly when
interface is configured through DHCP at bootup. But, if user choose
to write /etc/network/interface himself, he have to explicitly
set wait-delay.

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-11-02 16:51:47 +01:00
Yann E. MORIN c5bd8af65e system: add options for /bin /sbin and /lib to be symlinks into /usr
systemd is increasingly expecting things to live in /usr/bin, /usr/sbin
or /usr/lib nad not in /bin, /sbin or /lib. It has inherited those
expectations from a Fedora change:
    https://fedoraproject.org/wiki/Features/UsrMove

Note however, that systemd does support /usr being on a separate
filesystem; it just expects an initramfs to mount it before the final
switchroot over to the actual rootfs.

But the traditional use-case for Buildroot is not to boot with an
initramfs; although that is totally feasible, that's probably not what
is commonly done in the vast majority of cases.

However, a lot of packages still install stuff directly into /bin,
/sbin or /lib, which systemd may need early-on in the boot process,
even before it may have a chance to mount /usr. Even though we can
tell systemd, at configure-time, where it should expect programs to
be at runtime, it does not make sense to go head-first against an
upstream wa^Hill.

Add an option so that /bin, /sbin and /lib be symlinks to /usr/bin
and /usr/sbin. That option is forcibly enabled when the init system
is systemd.

Note: we need not handle /lib32 or /lib64, as they already are symlinks
to /lib, which means they will automatically be redirected to /usr/lib,
as /usr/lib32 and /usr/lib64 already are.

Furthermore, this means we're no longer supporting a split-usr setup, so
the corresponding configure options have been removed as well for
systemd and, when using a merged /usr, for eudev as well.

In Buildroot, we decided (with this patch) not to support a split-usr
when systemd is used as an init system. This is a design decision, not
a systemd issue. Thus the select is with BR2_INIT_SYSTEMD rather than
with BR2_PACKAGE_SYSTEMD.

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>
Cc: Mike Williams <mike@mikebwilliams.com>
Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Cc: Baruch Siach <baruch@tkos.co.il>
Tested-by: Mike Williams <mike@mikebwilliams.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-10-14 22:50:03 +02:00
Arnout Vandecappelle 0291f7c220 skeleton: use backtick instead of $(shell ...) make function
Only the instance for setting the root password is changed. The
instance in SYSTEM_GETTY is harmless since it just uses echo and tail.

If SKELETON_TARGET_GENERIC_ROOT_PASSWD is passed as a hashed password
by the user, it contains $, so the '-quotes are needed. If it is not,
we need the backtick to be expanded so "-quotes are needed. Therefore,
the quoting is moved to the definition of SYSTEM_ROOT_PASSWORD.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-15 00:43:39 +02:00
Maxime Hadjinlian 7a6b83a211 skeleton: New package
Create a proper package for the skeleton.

The main Makefile is modified to remove the skeleton support.
The 'dirs' target, will create the $(TARGET_DIR).
The file 'output/target/.root' doesn't exists anymore, as there's no
Make rule to statisfy.

The infrastructure are modified to filter host-skeleton.
It's needed becauses the host-dependencies are derived from the
dependencies of the target package where 'host-' is preprended to the
depedency name.

In the pkg-generic we add skeleton as a dependency to every package.

The whole system/system.mk is now removed at the profit of
package/skeleton/skeleton.mk

[Thomas:
  - rebase on top of master and fix some minor conflicts
  - remove the 'select BR2_PACKAGE_SKELETON' in
    BR2_ROOTFS_SKELETON_DEFAULT and BR2_ROOTFS_SKELETON_CUSTOM, since
    anyway the skeleton package is always enabled.
  - fixup a few mistakes in the getty handling due to misnamed
    variables.]

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-14 18:08:23 +02:00