1
0
mirror of https://github.com/systemd/systemd synced 2025-09-27 15:54:47 +02:00

Compare commits

...

9 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
e0f90ad988
Merge pull request #17874 from DaanDeMeyer/mkosi-build-verbosity
Reduce mkosi build script verbosity
2020-12-07 10:12:33 +01:00
Yu Watanabe
3c229a9afb nss-resolve: varlink_call() set error_id only when r >= 0
Fixes #17870.
2020-12-07 09:25:39 +01:00
Yu Watanabe
a7b6e29c1f network: mtu is neither a boolean nor a pointer 2020-12-07 08:59:21 +01:00
Daan De Meyer
09422f9a28 meson: Respect MESON_INSTALL_QUIET
MESON_INSTALL_QUIET is set when --quiet is passed to meson install.
Make sure we check the variable in our custom install scripts and
don't output anything if it is set.
2020-12-06 22:11:11 +00:00
Daan De Meyer
5e577e1737 mkosi: Silence locale checking in mkosi.build
Avoid warning and error logs from locale charmap and export LC_CTYPE
by piping to dev/null and checking if locales are available before
using them.
2020-12-06 22:11:11 +00:00
Daan De Meyer
3dab2a4697 mkosi: Remove explicit default_hierarchy=unified option from mkosi.build
default_hierarchy is set to unified in meson_options already so
we can remove it from mkosi.build.
2020-12-06 22:11:11 +00:00
Daan De Meyer
fe2b7631ad mkosi: Add --quiet and --no-rebuild options to meson install in mkosi.build
By default, meson install prints a line for every file it installs.
This is verbose and doesn't provide much value. Let's silence the
meson install step to remove this output from the mkosi build step.

The --no-rebuild option removes some additional duplicate output
by the meson install step.

Ubuntu Focal still has meson 0.53.0 so we add a version check and
only use the new feature if the meson version supports it.
2020-12-06 22:11:11 +00:00
Daan De Meyer
1394a3ec35 mkosi: Remove bash -x option from mkosi.build
-x is for debugging purposes. During regular usage, using -x mostly
prints useless output when building the mkosi image.
2020-12-06 22:11:11 +00:00
Daan De Meyer
06ac1b1f2c mkosi: Use meson install instead of ninja install in build script
Allows using extra options not available when using ninja.
2020-12-06 22:11:11 +00:00
5 changed files with 53 additions and 32 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
set -ex
set -e
# This is a build script for OS image generation using mkosi (https://github.com/systemd/mkosi).
# Simply invoke "mkosi" in the project directory to build an OS image.
@ -21,22 +21,22 @@ umask 022
# So let's ensure we're running under UTF-8.
#
# If our current locale already is UTF-8, then we don't need to do anything:
if [ "$(locale charmap)" != "UTF-8" ] ; then
if [ "$(locale charmap 2> /dev/null)" != "UTF-8" ] ; then
# Try using C.UTF-8 locale, if available. This locale is not shipped
# by upstream glibc, so it's not available in all distros.
# (In particular, it's not available in Arch Linux.)
if locale -a | grep -q -E "C.UTF-8|C.utf8"; then
export LC_CTYPE=C.UTF-8
if [ "$(locale charmap)" != "UTF-8" ] ; then
# Finally, try something like en_US.UTF-8, which should be
# available in Arch Linux, but is not present in Debian's
# minimal image in our mkosi config.
elif locale -a | grep -q en_US.utf8; then
export LC_CTYPE=en_US.UTF-8
if [ "$(locale charmap)" != "UTF-8" ] ; then
else
# If nothing works, fail early.
echo "*** Could not find a valid locale that supports UTF-8. ***" >&2
exit 1
fi
fi
fi
if [ ! -f "$BUILDDIR"/build.ninja ] ; then
@ -84,7 +84,7 @@ if [ ! -f "$BUILDDIR"/build.ninja ] ; then
fi
fi
meson "$BUILDDIR" -D "sysvinit-path=$sysvinit_path" -D "rootprefix=$rootprefix" -D default-hierarchy=unified -D man=false -D "nobody-user=$nobody_user" -D "nobody-group=$nobody_group"
meson "$BUILDDIR" -D "sysvinit-path=$sysvinit_path" -D "rootprefix=$rootprefix" -D man=false -D "nobody-user=$nobody_user" -D "nobody-group=$nobody_group"
fi
ninja -C "$BUILDDIR" all
@ -95,7 +95,13 @@ if [ "$WITH_TESTS" = 1 ] ; then
ninja -C "$BUILDDIR" test
fi
ninja -C "$BUILDDIR" install
# Ubuntu Focal is stuck with meson 0.53.0.
if [ "$(meson -v | cut -d . -f 2)" -gt 53 ] ; then
meson install -C "$BUILDDIR" --quiet --no-rebuild
else
meson install -C "$BUILDDIR" --no-rebuild
fi
mkdir -p "$DESTDIR"/etc

View File

@ -552,7 +552,7 @@ static int netdev_create(NetDev *netdev, Link *link, link_netlink_message_handle
return log_netdev_error_errno(netdev, r, "Could not append IFLA_ADDRESS attribute: %m");
}
if (netdev->mtu) {
if (netdev->mtu != 0) {
r = sd_netlink_message_append_u32(m, IFLA_MTU, netdev->mtu);
if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_MTU attribute: %m");

View File

@ -200,16 +200,17 @@ enum nss_status _nss_resolve_gethostbyname4_r(
if (r < 0)
goto fail;
/* Return NSS_STATUS_UNAVAIL when communication with systemd-resolved fails, allowing falling
* back to other nss modules. Treat all other error conditions as NOTFOUND. This includes
* DNSSEC errors and suchlike. (We don't use UNAVAIL in this case so that the nsswitch.conf
* configuration can distinguish such executed but negative replies from complete failure to
* talk to resolved). */
r = varlink_call(link, "io.systemd.Resolve.ResolveHostname", cparams, &rparams, &error_id, NULL);
if (r < 0) {
if (r < 0)
goto fail;
if (!isempty(error_id)) {
if (!error_shall_fallback(error_id))
goto not_found;
/* Return NSS_STATUS_UNAVAIL when communication with systemd-resolved fails, allowing falling
back to other nss modules. Treat all other error conditions as NOTFOUND. This includes
DNSSEC errors and suchlike. (We don't use UNAVAIL in this case so that the nsswitch.conf
configuration can distinguish such executed but negative replies from complete failure to
talk to resolved). */
goto fail;
}
@ -352,10 +353,11 @@ enum nss_status _nss_resolve_gethostbyname3_r(
goto fail;
r = varlink_call(link, "io.systemd.Resolve.ResolveHostname", cparams, &rparams, &error_id, NULL);
if (r < 0) {
if (r < 0)
goto fail;
if (!isempty(error_id)) {
if (!error_shall_fallback(error_id))
goto not_found;
goto fail;
}
@ -555,10 +557,11 @@ enum nss_status _nss_resolve_gethostbyaddr2_r(
goto fail;
r = varlink_call(link, "io.systemd.Resolve.ResolveAddress", cparams, &rparams, &error_id, NULL);
if (r < 0) {
if (r < 0)
goto fail;
if (!isempty(error_id)) {
if (!error_shall_fallback(error_id))
goto not_found;
goto fail;
}

View File

@ -1,12 +1,18 @@
#!/bin/sh
set -eu
if [ "${MESON_INSTALL_QUIET:-0}" = 1 ] ; then
VERBOSE=""
else
VERBOSE="v"
fi
# this is needed mostly because $DESTDIR is provided as a variable,
# and we need to create the target directory...
mkdir -vp "$(dirname "${DESTDIR:-}$2")"
mkdir -${VERBOSE}p "$(dirname "${DESTDIR:-}$2")"
if [ "$(dirname $1)" = . -o "$(dirname $1)" = .. ]; then
ln -vfs -T -- "$1" "${DESTDIR:-}$2"
ln -${VERBOSE}fs -T -- "$1" "${DESTDIR:-}$2"
else
ln -vfs -T --relative -- "${DESTDIR:-}$1" "${DESTDIR:-}$2"
ln -${VERBOSE}fs -T --relative -- "${DESTDIR:-}$1" "${DESTDIR:-}$2"
fi

View File

@ -5,6 +5,12 @@ unitdir="$1"
target="$2"
unit="$3"
if [ "${MESON_INSTALL_QUIET:-0}" = 1 ] ; then
VERBOSE=""
else
VERBOSE="v"
fi
case "$target" in
*/?*) # a path, but not just a slash at the end
dir="${DESTDIR:-}${target}"
@ -18,11 +24,11 @@ unitpath="${DESTDIR:-}${unitdir}/${unit}"
case "$target" in
*/)
mkdir -vp -m 0755 "$dir"
mkdir -${VERBOSE}p -m 0755 "$dir"
;;
*)
mkdir -vp -m 0755 "$(dirname "$dir")"
mkdir -${VERBOSE}p -m 0755 "$(dirname "$dir")"
;;
esac
ln -vfs --relative "$unitpath" "$dir"
ln -${VERBOSE}fs --relative "$unitpath" "$dir"