Commit graph

16 commits

Author SHA1 Message Date
Arnout Vandecappelle 685f44de98 Globally replace $(HOST_DIR)/usr with $(HOST_DIR)
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' | xargs sed -i 's%\$(HOST_DIR)/usr%$(HOST_DIR)%g'

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-05 15:22:29 +02:00
Arnout Vandecappelle 19ba17ee3b Globally replace $(HOST_DIR)/usr/lib with $(HOST_DIR)/lib
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/lib' | xargs sed -i 's%$(HOST_DIR)/usr/lib%$(HOST_DIR)/lib%g'

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-05 15:20:05 +02:00
Rahul Bedarkar 30a3e8d108 boot, package: use SPDX short identifier for LGPLv2.1/LGPLv2.1+
We want to use SPDX identifier for license string as much as possible.
SPDX short identifier for LGPLv2.1/LGPLv2.1+ is LGPL-2.1/LGPL-2.1+.

This change is done using following command.
find . -name "*.mk" | xargs sed -ri '/LICENSE( )?[\+:]?=/s/LGPLv2.1(\+)?/LGPL-2.1\1/g'

Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-04-01 15:18:10 +02:00
Peter Korsgaard 6d3e05690f Revert "package/pseudo: add a legacy symlink to emulate fakeroot"
This reverts commit 7158403805.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-11-27 21:12:24 +01:00
Peter Korsgaard ca41a78c2d Revert "package/pseudo: wrap the real pseudo with a wrapper"
This reverts commit a1d602a74d.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-11-27 21:12:24 +01:00
Peter Korsgaard 0f496d77db Revert "package/pseudo: provide better legacy handling for fakeroot"
This reverts commit 499f28fc7c.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-11-27 20:34:49 +01:00
Yann E. MORIN 499f28fc7c package/pseudo: provide better legacy handling for fakeroot
We now have a wrapper that makes pseudo behaves like the fakeroot of the
good ol' days. So the symlink will just magically keep old scripts
working as they did before the switch to pseudo.

However, using fakeroot is deprecated, and we want people to stop using
it altogether and switch to pseudo.

So, make the wrapper recognise how it's called, and if called as
fakeroot, print a warning message.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Gaël PORTAY <gael.portay@savoirfairelinux.com>
Cc: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>
Cc: Erico Nunes <nunes.erico@gmail.com>
Cc: Julien BOIBESSOT <julien.boibessot@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-09 23:30:15 +01:00
Yann E. MORIN a1d602a74d package/pseudo: wrap the real pseudo with a wrapper
Running pseudo is more involved than running fakeroot. In the transition
from using fakeroot, we just did not account for the extra requirements.

First, we explicitly tell pseudo where it is, otherwise it tries to
guess. Its guess is correct, but it prints a warning, which is not nice.

Second, we tell it where to find the passwd and group files in case it
has to emulate access to them. We currently do not use that feature, but
better safe than sorry.

Third, pseudo spawns a background daemon, and talks to it (when fakeroot
would emulate the state all in the current process' state, pseudo uses
the daemon to coordinate the state across multiple processes). We are
not much interested in the daemon lingering around, so we just tell it
to terminate as soon as the last clients quits (this can take up to one
second).

Fourth and last, pseudo always stores its internal database when
exiting, and reloads it when spawned. The database is by default stored
in a sub-directory of the prefix it was installed in, but this is
impractical for us. We want the database to be specific to the one
config dir we are building, so we store the database in a (hidden)
sub-dir of the build dir, thus ensuring it is never shared with another
build. That directory is hidden (starts with a dot) because we consider
that to be our internal state that we do not want to expose to the user.

The wrapper has to be relocatable, so we avoid using hard-coded paths
in there: we derive those paths fom the runtime path of pseudo. However,
the build directory $(BUILD_DIR) is not available in the environment
(we do not export it because it conflicts with some buildsystems).
Instead, we use $(BASE_DIR) which is exported.

Finally, when relocated, the wrapper would not be used in the Buildroot
environment, so may not have access to TARGET_DIR or BASE_DIR, unless
the user sets them. If he does not, we still want the wrapper to be
working (to avoid the warning about the prefix, and to exit the daemon
asap); thus we leave the passwd and localstatedir variable alone if we
don't have what it needs to set them, rather than set them to incorrect
values.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Gaël PORTAY <gael.portay@savoirfairelinux.com>
Cc: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>
Cc: Erico Nunes <nunes.erico@gmail.com>
Cc: Julien BOIBESSOT <julien.boibessot@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-09 23:29:59 +01:00
Yann E. MORIN 527e63cb82 package/pseudo: force rpath and pass our host CFLAGS
pseudo whines when those are not set, and tries to find a suitable
value; this is usually correct but risk an incorrect guess in corner
cases.

Rather than leaving those in guess-mode, just force them to values we
know are correct.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Gaël PORTAY <gael.portay@savoirfairelinux.com>
Cc: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>
Cc: Erico Nunes <nunes.erico@gmail.com>
Cc: Julien BOIBESSOT <julien.boibessot@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle <arnout@mind.be>
[Thomas: use double quotes instead of single quotes.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-09 23:28:29 +01:00
Yann E. MORIN f9fb1d59f5 package/pseudo: enforce the host bitness
pseudo can detect the host bitness, but is not sure about it: it checks
what type of file /bin/sh is, using file(1).

However, in some conditions, /bin/sh can be of a different bitness than
the rest of the system (weird, but not impossible), which causes build
issues.

Just enforce the bitness, so that pseudo needs not (wrongly) guess it.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Gaël PORTAY <gael.portay@savoirfairelinux.com>
Cc: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>
Cc: Erico Nunes <nunes.erico@gmail.com>
Cc: Julien BOIBESSOT <julien.boibessot@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-09 22:24:48 +01:00
Yann E. MORIN bafd08a162 package/pseudo: update version
Brings in a fix about externded attributes (xattrs).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-05 23:34:02 +01:00
Yann E. MORIN a25210b8a0 packages/pseudo: needs attr
This fixes the build on machines that do not have attr development files
installed.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-05 13:53:08 +01:00
Gaël PORTAY 998d44e088 pseudo: fix build for python3 based distros
Pseudo is not python3 friendly. It causes build failure on distros using
python3 as default python interpretor.

./maketables enums/*.in
  File "./makewrappers", line 327
    return """/* This function is not called if pseudo is configured --enable-force-async */
                                                                                           ^
TabError: inconsistent use of tabs and spaces in indentation
  File "./maketables", line 76
    print "Flags: set for %s" % self.name
                            ^
SyntaxError: Missing parentheses in call to 'print'
make[2]: *** [Makefile:150: wrappers] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:147: tables] Error 1

Those patches make pseudo works with python2 and python3.

Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.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>
2016-11-05 13:41:58 +01:00
Yann E. MORIN 7158403805 package/pseudo: add a legacy symlink to emulate fakeroot
In case some post-image script want to call fakeroot, add a symlink to
use pseudo instead.

Reported-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-03 23:29:10 +01:00
Yann E. MORIN 2837209efd package/pseudo: needs sqlite
pseudo uses sqlite to store its state.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[Thomas: add comment about --libdir.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-03 23:27:21 +01:00
Yann E. MORIN d625227229 package/pseudo: new package
Pseudo is a program that can either be used directly or as an
LD_PRELOAD, which allows these operations to succeed as if the
user did have system administrator privileges even though they
are an ordinary user.

Pseudo has a lot of similarities to fakeroot but is a new
implementation that improves on the problems seen using fakeroot.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Andrey Yurovsky <yurovsky@gmail.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-03 21:36:01 +01:00