1
0
mirror of https://github.com/systemd/systemd synced 2025-09-29 00:34:45 +02:00

Compare commits

..

No commits in common. "e0f90ad98802a43addd40f7f8ef69118d04f4cd2" and "d6c0fdf4923420bd808094d02df9f05d739f4b17" have entirely different histories.

5 changed files with 32 additions and 53 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
set -e set -ex
# This is a build script for OS image generation using mkosi (https://github.com/systemd/mkosi). # 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. # Simply invoke "mkosi" in the project directory to build an OS image.
@ -21,21 +21,21 @@ umask 022
# So let's ensure we're running under UTF-8. # 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 our current locale already is UTF-8, then we don't need to do anything:
if [ "$(locale charmap 2> /dev/null)" != "UTF-8" ] ; then if [ "$(locale charmap)" != "UTF-8" ] ; then
# Try using C.UTF-8 locale, if available. This locale is not shipped # Try using C.UTF-8 locale, if available. This locale is not shipped
# by upstream glibc, so it's not available in all distros. # by upstream glibc, so it's not available in all distros.
# (In particular, it's not available in Arch Linux.) # (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
export LC_CTYPE=C.UTF-8 if [ "$(locale charmap)" != "UTF-8" ] ; then
# Finally, try something like en_US.UTF-8, which should be # Finally, try something like en_US.UTF-8, which should be
# available in Arch Linux, but is not present in Debian's # available in Arch Linux, but is not present in Debian's
# minimal image in our mkosi config. # minimal image in our mkosi config.
elif locale -a | grep -q en_US.utf8; then
export LC_CTYPE=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8
else if [ "$(locale charmap)" != "UTF-8" ] ; then
# If nothing works, fail early. # If nothing works, fail early.
echo "*** Could not find a valid locale that supports UTF-8. ***" >&2 echo "*** Could not find a valid locale that supports UTF-8. ***" >&2
exit 1 exit 1
fi
fi fi
fi fi
@ -84,7 +84,7 @@ if [ ! -f "$BUILDDIR"/build.ninja ] ; then
fi fi
fi fi
meson "$BUILDDIR" -D "sysvinit-path=$sysvinit_path" -D "rootprefix=$rootprefix" -D man=false -D "nobody-user=$nobody_user" -D "nobody-group=$nobody_group" 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"
fi fi
ninja -C "$BUILDDIR" all ninja -C "$BUILDDIR" all
@ -95,13 +95,7 @@ if [ "$WITH_TESTS" = 1 ] ; then
ninja -C "$BUILDDIR" test ninja -C "$BUILDDIR" test
fi 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 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"); return log_netdev_error_errno(netdev, r, "Could not append IFLA_ADDRESS attribute: %m");
} }
if (netdev->mtu != 0) { if (netdev->mtu) {
r = sd_netlink_message_append_u32(m, IFLA_MTU, netdev->mtu); r = sd_netlink_message_append_u32(m, IFLA_MTU, netdev->mtu);
if (r < 0) if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_MTU attribute: %m"); return log_netdev_error_errno(netdev, r, "Could not append IFLA_MTU attribute: %m");

View File

@ -200,17 +200,16 @@ enum nss_status _nss_resolve_gethostbyname4_r(
if (r < 0) if (r < 0)
goto fail; 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); 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)) if (!error_shall_fallback(error_id))
goto not_found; 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; goto fail;
} }
@ -353,11 +352,10 @@ enum nss_status _nss_resolve_gethostbyname3_r(
goto fail; goto fail;
r = varlink_call(link, "io.systemd.Resolve.ResolveHostname", cparams, &rparams, &error_id, NULL); 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)) if (!error_shall_fallback(error_id))
goto not_found; goto not_found;
goto fail; goto fail;
} }
@ -557,11 +555,10 @@ enum nss_status _nss_resolve_gethostbyaddr2_r(
goto fail; goto fail;
r = varlink_call(link, "io.systemd.Resolve.ResolveAddress", cparams, &rparams, &error_id, NULL); 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)) if (!error_shall_fallback(error_id))
goto not_found; goto not_found;
goto fail; goto fail;
} }

View File

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

View File

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