Commit a94c3af9 authored by Sjoerd Simons's avatar Sjoerd Simons
Browse files

Add patches to fix FTBS on ppc and run timesyncd without networkd

* debian/patches/always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch
  + Added. Fix checking of of system endianess. Fixes FTBS on powerpc
* debian/patches/timesyncd-when-we-don-t-know-anything-about-the-netw.patch:
  + Let timesyncd go online even if networkd isn't running (from upstream
    git) (Closes: #760087)
parent 1bb9275b
systemd (215-2) UNRELEASED; urgency=medium
* debian/patches/always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch
+ Added. Fix checking of of system endianess. Fixes FTBS on powerpc
* debian/patches/timesyncd-when-we-don-t-know-anything-about-the-netw.patch:
+ Let timesyncd go online even if networkd isn't running (from upstream
git) (Closes: #760087)
-- Sjoerd Simons <sjoerd@debian.org> Sun, 07 Sep 2014 17:15:46 +0200
systemd (215-1) experimental; urgency=medium
* New upstream release.
......
......@@ -11,10 +11,10 @@ Subject: Add targets for compatibility with Debian insserv system facilities
create mode 100644 units/x-display-manager.target
diff --git a/Makefile.am b/Makefile.am
index 0c01e55..9fb9bbf 100644
index 5658f18..e50224b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -524,6 +524,12 @@ nodist_systemunit_DATA = \
@@ -539,6 +539,12 @@ nodist_systemunit_DATA = \
units/systemd-nspawn@.service \
units/systemd-update-done.service
......
......@@ -18,10 +18,10 @@ anymore afterwards).
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 764a4fd..04c2a3d 100644
index dd01efe..3e23d8b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5346,8 +5346,7 @@ SYSINIT_TARGET_WANTS += \
@@ -5363,8 +5363,7 @@ SYSINIT_TARGET_WANTS += \
ldconfig.service
LOCAL_FS_TARGET_WANTS += \
......
......@@ -13,7 +13,7 @@ again.
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/man/systemd.mount.xml b/man/systemd.mount.xml
index 3bc4d3a..2c01a5e 100644
index f06c18e..bea0bea 100644
--- a/man/systemd.mount.xml
+++ b/man/systemd.mount.xml
@@ -153,7 +153,7 @@
......
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 11 Jul 2014 15:56:16 +0200
Subject: always check for __BYTE_ORDER == __BIG_ENDIAN when checking for
endianess
Let's always stick to glibc's way to determine byte order, and not mix
autoconf-specific checks with gcc checks.
---
src/shared/architecture.h | 12 ++++++------
src/shared/gpt.h | 4 ++--
src/shared/time-dst.c | 6 +++---
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/shared/architecture.h b/src/shared/architecture.h
index ee50ff4..c98ce63 100644
--- a/src/shared/architecture.h
+++ b/src/shared/architecture.h
@@ -80,7 +80,7 @@ Architecture uname_architecture(void);
# define native_architecture() ARCHITECTURE_X86
# define LIB_ARCH_TUPLE "i386-linux-gnu"
#elif defined(__powerpc64__)
-# if defined(WORDS_BIGENDIAN)
+# if __BYTE_ORDER == __BIG_ENDIAN
# define native_architecture() ARCHITECTURE_PPC64
# define LIB_ARCH_TUPLE "ppc64-linux-gnu"
# else
@@ -88,7 +88,7 @@ Architecture uname_architecture(void);
# define LIB_ARCH_TUPLE "powerpc64le-linux-gnu"
# endif
#elif defined(__powerpc__)
-# if defined(WORDS_BIGENDIAN)
+# if __BYTE_ORDER == __BIG_ENDIAN
# define native_architecture() ARCHITECTURE_PPC
# define LIB_ARCH_TUPLE "powerpc-linux-gnu"
# else
@@ -117,7 +117,7 @@ Architecture uname_architecture(void);
# define native_architecture() ARCHITECTURE_SPARC
# define LIB_ARCH_TUPLE "sparc-linux-gnu"
#elif defined(__mips64__)
-# if defined(WORDS_BIGENDIAN)
+# if __BYTE_ORDER == __BIG_ENDIAN
# define native_architecture() ARCHITECTURE_MIPS64
# error "Missing LIB_ARCH_TUPLE for MIPS64"
# else
@@ -125,7 +125,7 @@ Architecture uname_architecture(void);
# error "Missing LIB_ARCH_TUPLE for MIPS64_LE"
# endif
#elif defined(__mips__)
-# if defined(WORDS_BIGENDIAN)
+# if __BYTE_ORDER == __BIG_ENDIAN
# define native_architecture() ARCHITECTURE_MIPS
# define LIB_ARCH_TUPLE "mips-linux-gnu"
# else
@@ -136,7 +136,7 @@ Architecture uname_architecture(void);
# define native_architecture() ARCHITECTURE_ALPHA
# define LIB_ARCH_TUPLE "alpha-linux-gnu"
#elif defined(__aarch64__)
-# if defined(WORDS_BIGENDIAN)
+# if __BYTE_ORDER == __BIG_ENDIAN
# define native_architecture() ARCHITECTURE_ARM64_BE
# define LIB_ARCH_TUPLE "aarch64_be-linux-gnu"
# else
@@ -144,7 +144,7 @@ Architecture uname_architecture(void);
# define LIB_ARCH_TUPLE "aarch64-linux-gnu"
# endif
#elif defined(__arm__)
-# if defined(WORDS_BIGENDIAN)
+# if __BYTE_ORDER == __BIG_ENDIAN
# define native_architecture() ARCHITECTURE_ARM_BE
# if defined(__ARM_EABI__)
# if defined(__ARM_PCS_VFP)
diff --git a/src/shared/gpt.h b/src/shared/gpt.h
index 64090e0..278940b 100644
--- a/src/shared/gpt.h
+++ b/src/shared/gpt.h
@@ -42,10 +42,10 @@
# define GPT_ROOT_NATIVE GPT_ROOT_X86
#endif
-#if defined(__aarch64__) && !defined(WORDS_BIGENDIAN)
+#if defined(__aarch64__) && (__BYTE_ORDER != __BIG_ENDIAN)
# define GPT_ROOT_NATIVE GPT_ROOT_ARM_64
# define GPT_ROOT_SECONDARY GPT_ROOT_ARM
-#elif defined(__arm__) && !defined(WORDS_BIGENDIAN)
+#elif defined(__arm__) && (__BYTE_ORDER != __BIG_ENDIAN)
# define GPT_ROOT_NATIVE GPT_ROOT_ARM
#endif
diff --git a/src/shared/time-dst.c b/src/shared/time-dst.c
index ceca2fa..6195b11 100644
--- a/src/shared/time-dst.c
+++ b/src/shared/time-dst.c
@@ -207,8 +207,8 @@ read_again:
if (type_idxs[i] >= num_types)
return -EINVAL;
- if (BYTE_ORDER == BIG_ENDIAN ? sizeof(time_t) == 8 && trans_width == 4
- : sizeof(time_t) == 4 || trans_width == 4) {
+ if (__BYTE_ORDER == __BIG_ENDIAN ? sizeof(time_t) == 8 && trans_width == 4
+ : sizeof(time_t) == 4 || trans_width == 4) {
/* Decode the transition times, stored as 4-byte integers in
network (big-endian) byte order. We work from the end of
the array so as not to clobber the next element to be
@@ -216,7 +216,7 @@ read_again:
i = num_transitions;
while (i-- > 0)
transitions[i] = decode((char *)transitions + i * 4);
- } else if (BYTE_ORDER != BIG_ENDIAN && sizeof(time_t) == 8) {
+ } else if (__BYTE_ORDER != __BIG_ENDIAN && sizeof(time_t) == 8) {
/* Decode the transition times, stored as 8-byte integers in
network (big-endian) byte order. */
for (i = 0; i < num_transitions; ++i)
......@@ -23,10 +23,10 @@ It has the following modifications:
create mode 100644 src/insserv-generator/insserv-generator.c
diff --git a/Makefile.am b/Makefile.am
index 04b4ad6..0c01e55 100644
index 713df57..5658f18 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -375,6 +375,7 @@ rootlibexec_PROGRAMS = \
@@ -383,6 +383,7 @@ rootlibexec_PROGRAMS = \
systemd-update-done
systemgenerator_PROGRAMS = \
......@@ -34,7 +34,7 @@ index 04b4ad6..0c01e55 100644
systemd-getty-generator \
systemd-fstab-generator \
systemd-system-update-generator \
@@ -1943,6 +1944,14 @@ systemd_delta_LDADD = \
@@ -1958,6 +1959,14 @@ systemd_delta_LDADD = \
libsystemd-shared.la
# ------------------------------------------------------------------------------
......
......@@ -92,6 +92,8 @@ build-don-t-install-busname-units-and-target-if-kdbu.patch
man-fix-references-to-systemctl-man-page-which-is-no.patch
parse_boolean-require-exact-matches.patch
sd-journal-properly-convert-object-size-on-big-endia.patch
always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch
timesyncd-when-we-don-t-know-anything-about-the-netw.patch
## Debian specific patches:
Add-back-support-for-Debian-specific-config-files.patch
......
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 11 Aug 2014 22:04:05 +0200
Subject: timesyncd: when we don't know anything about the network state,
assume we are online
This should provide better compatibility with systems that lack networkd
Conflicts:
src/timesync/timesyncd.c
---
src/timesync/timesyncd.c | 48 ++++++++++++++++++++++--------------------------
1 file changed, 22 insertions(+), 26 deletions(-)
diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c
index 19af9f9..c711e83 100644
--- a/src/timesync/timesyncd.c
+++ b/src/timesync/timesyncd.c
@@ -340,6 +340,7 @@ static int manager_clock_watch(sd_event_source *source, int fd, uint32_t revents
/* resync */
log_info("System time changed. Resyncing.");
m->poll_resync = true;
+
return manager_send_request(m);
}
@@ -1121,80 +1122,75 @@ static bool network_is_online(void) {
int r;
r = sd_network_get_operational_state(&state);
- if (r >= 0 && STR_IN_SET(state, "routable", "degraded"))
+ if (r < 0) /* if we don't know anything, we consider the system online */
+ return true;
+
+ if (STR_IN_SET(state, "routable", "degraded"))
return true;
return false;
}
-static int manager_network_event_handler(sd_event_source *s, int fd, uint32_t revents,
- void *userdata) {
+static int manager_network_event_handler(sd_event_source *s, int fd, uint32_t revents, void *userdata) {
Manager *m = userdata;
bool connected, online;
int r;
assert(m);
+ sd_network_monitor_flush(m->network_monitor);
+
/* check if the machine is online */
online = network_is_online();
/* check if the client is currently connected */
- connected = (m->server_socket != -1);
+ connected = m->server_socket >= 0;
if (connected && !online) {
log_info("No network connectivity, watching for changes.");
manager_disconnect(m);
+
} else if (!connected && online) {
log_info("Network configuration changed, trying to establish connection.");
- if (m->current_server_address) {
+
+ if (m->current_server_address)
r = manager_begin(m);
- if (r < 0)
- return r;
- } else {
+ else
r = manager_connect(m);
- if (r < 0)
- return r;
- }
+ if (r < 0)
+ return r;
}
- sd_network_monitor_flush(m->network_monitor);
-
return 0;
}
static int manager_network_monitor_listen(Manager *m) {
- _cleanup_event_source_unref_ sd_event_source *event_source = NULL;
- _cleanup_network_monitor_unref_ sd_network_monitor *monitor = NULL;
int r, fd, events;
- r = sd_network_monitor_new(NULL, &monitor);
+ assert(m);
+
+ r = sd_network_monitor_new(NULL, &m->network_monitor);
if (r < 0)
return r;
- fd = sd_network_monitor_get_fd(monitor);
+ fd = sd_network_monitor_get_fd(m->network_monitor);
if (fd < 0)
return fd;
- events = sd_network_monitor_get_events(monitor);
+ events = sd_network_monitor_get_events(m->network_monitor);
if (events < 0)
return events;
- r = sd_event_add_io(m->event, &event_source, fd, events,
- &manager_network_event_handler, m);
+ r = sd_event_add_io(m->event, &m->network_event_source, fd, events, manager_network_event_handler, m);
if (r < 0)
return r;
- m->network_monitor = monitor;
- m->network_event_source = event_source;
- monitor = NULL;
- event_source = NULL;
-
return 0;
}
int main(int argc, char *argv[]) {
- const char *user = "systemd-timesync";
_cleanup_manager_free_ Manager *m = NULL;
+ const char *user = "systemd-timesync";
uid_t uid;
gid_t gid;
int r;
......@@ -15,10 +15,10 @@ Move it to udevlibexecdir instead.
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 04c2a3d..04b4ad6 100644
index 3e23d8b..713df57 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3071,7 +3071,7 @@ INSTALL_DATA_HOOKS += \
@@ -3086,7 +3086,7 @@ INSTALL_DATA_HOOKS += \
hwdb-update-hook
hwdb-remove-hook:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment