Commit Graph

19 Commits

Author SHA1 Message Date
Luke Shumaker cb35d74f8c
Avoid using string interpolation; use printf format strings instead.
This involves extending the signature of lib/common.sh's `stat_busy()`,
`lock()`, and `slock()`. The `mesg=$1; shift` in stat_busy even suggests
that this is what was originally intended from it.
2017-04-05 22:11:16 +02:00
Luke Shumaker 14d5e1c21b
Add a "License:" tag to all code files.
In cases where there is no license specified, the file is tagged as
"License: Unspecified".  Obviously, that is not ideal, but it
highlights the fact, and I hope that it encourages whoever has the
authority to specify the license to do so.

On that note, to anyone who may have the authority to specify the
license of files in devtools: the current licence of many files is
GPLv2 with no option for later versions; I impore you to re-license
them to have the "or any later version" option.
2017-04-05 22:10:03 +02:00
Jan Alexander Steffens (heftig) 45f87aa9d5
lib/archroot.sh: Simplify check_root
Move the function and save the orig_argv right along it.
2017-03-07 19:35:09 +01:00
Jan Alexander Steffens (heftig) 66553e7e07
lib/archroot.sh: Move CHROOT_VERSION to a common file 2017-03-07 19:35:09 +01:00
Jan Alexander Steffens (heftig) c8147a3512
mkarchroot: Set LANG=en_US.UTF-8
In order to have an UTF-8 locale in the build root. This is something
normally set on real machines but is not set from our chroots. Meson,
for example, loudly complains when the locale charset is not UTF-8.

I'd like to have C.UTF-8, as most other distributions do. Unfortunately,
it's not part of vanilla glibc; en_US.UTF-8 will have to do.

mkarchroot already creates roots with both en_US.UTF-8 and de_DE.UTF-8,
the latter because builds of gcc (perhaps used to) require it.

Bump the CHROOT_VERSION due to the setting change.
2017-02-17 19:51:56 +01:00
Jan Alexander Steffens (heftig) eb6b0e3f11 arch-nspawn: Work around pacman master returning file-URLs from the cache 2016-05-28 12:33:00 +02:00
Evangelos Foutras 5a7890f076 arch-nspawn: preserve systemd-nspawn's stderr
It is passed down to the container when stdin/stdout is not a tty; this
is the case when archbuild's output is redirected to a pipe or file.
2015-11-29 12:01:34 +02:00
Dave Reisner bf7dc83bab save and reuse original argv when auto-elevating
Fixes FS#42277.
2014-10-19 16:48:03 -04:00
Luke Shumaker 651f8f834f arch-nspawn: Fix a grammar mistake (a/an) in an error message. 2014-09-22 08:25:43 -04:00
Dave Reisner d83805bc54 nspawn: skip machine registration
No need to do this since we don't run an init system in the build root.
2014-09-22 08:25:43 -04:00
Sébastien Luttringer 03611dc63e Switch to root when started as regular user
In collaborative builder machine, these scripts are often allowed to become root
via sudo. This patch avoid to prefix them by sudo each time or call su.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2014-05-10 08:05:08 +02:00
Dave Reisner 7267664ed8 arch-nspawn: allow oddly named directories
This fixes various errors one might encounter when trying to use a
build root or cachedir with whitespace in it.

Note that the cachedir fix is not a complete one, as pacman's output is
unreliable (and not meant for parsing here).

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-18 18:17:05 +02:00
Dave Reisner e0f7c21a68 arch-nspawn: avoid escaping mount_args
eval is no longer involved in the execution of systemd-nspawn, so we no
longer need a layer of escaping on the arguments.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-18 18:16:59 +02:00
Dave Reisner be3c71fa81 avoid injecting code into the format string
Now that die() properly forwards arguments to error(), we can expect
that the first arg is a format string and not the entirety of the
output.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-08 21:28:10 +02:00
Florian Pritz 29e62278a7 arch-nspawn: remove leading - from the machine name/hostname
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-08 21:24:55 +02:00
Jan Alexander Steffens (heftig) a5bc6acf32 arch-nspawn: Quiet systemd-nspawn again
systemd-nspawn always outputs some debug messages over stderr.
Both stdout and stderr from inside the chroot are sent through
a pty to stdout.
2013-05-11 12:26:20 +02:00
Jan Alexander Steffens (heftig) 1489f75419 arch-nspawn: setarch to CARCH
Allows calling makechrootpkg without worrying about the architecture
2013-05-06 01:50:05 +02:00
Jan Alexander Steffens (heftig) 0e98bd8c48 arch-nspawn: Set machine name
Recent changes to systemd-nspawn have it take the machine name from
the chroot dir name, which isn't unique enough for our setup.
2013-05-03 04:34:29 +02:00
Jan Alexander Steffens (heftig) 453558c4bb mkarchroot: Refactor chroot running into a new script
Separates the two features of mkarchroot. Provides users of the new
arch-nspawn with the full feature set of systemd-nspawn.

For example, this can be used to bind custom directories into the chroot.
2013-05-02 10:33:24 +02:00