diff -Nru systemd-228/debian/changelog systemd-228/debian/changelog --- systemd-228/debian/changelog 2016-01-14 11:20:05.000000000 +0000 +++ systemd-228/debian/changelog 2016-01-28 15:25:51.000000000 +0000 @@ -1,3 +1,10 @@ +systemd (228-4ubuntu2) xenial; urgency=high + + * Use shorter bus_id for ccw net-id interface names. LP: #1526808 + * Add a snippet to migrate existing network configuration to new names. + + -- Dimitri John Ledkov Wed, 27 Jan 2016 19:01:12 +0000 + systemd (228-4ubuntu1) xenial; urgency=medium * Merge with Debian unstable. Remaining Ubuntu changes: diff -Nru systemd-228/debian/patches/0001-udev-net_id-for-ccw-bus-strip-ccw-and-leading-zeros-.patch systemd-228/debian/patches/0001-udev-net_id-for-ccw-bus-strip-ccw-and-leading-zeros-.patch --- systemd-228/debian/patches/0001-udev-net_id-for-ccw-bus-strip-ccw-and-leading-zeros-.patch 1970-01-01 01:00:00.000000000 +0100 +++ systemd-228/debian/patches/0001-udev-net_id-for-ccw-bus-strip-ccw-and-leading-zeros-.patch 2016-01-27 21:18:23.000000000 +0000 @@ -0,0 +1,54 @@ +From 5bb72b5cf9ccbc4731ed00b02abb214e1aa5baa1 Mon Sep 17 00:00:00 2001 +From: Dimitri John Ledkov +Date: Wed, 27 Jan 2016 18:47:37 +0000 +Subject: [PATCH] udev: net_id - for ccw bus strip 'ccw' and leading zeros for + aesthetic purposes. + +The commmon case default qeth link is enccw0.0.0600 is rather long. + +Thus strip leading zeros (which doesn't make the bus_id unstable), similar +to the PCI domain case. + +Also 'ccw' is redundant on S/390, as there aren't really other buses +available which could have qeth driver interfaces. Not sure why this code is +even compiled on non-s390[x] platforms. + +Thus enccw0.0.0600 becomes en600. +--- + src/udev/udev-builtin-net_id.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c +index 104d511..980bd65 100644 +--- a/src/udev/udev-builtin-net_id.c ++++ b/src/udev/udev-builtin-net_id.c +@@ -36,7 +36,7 @@ + * + * Type of names: + * b -- BCMA bus core number +- * ccw -- CCW bus group name ++ * -- CCW bus group name, without leading zeros [s390] + * o[d] -- on-board device index number + * s[f][d] -- hotplug slot index number + * x -- MAC address +@@ -430,8 +430,16 @@ static int names_ccw(struct udev_device *dev, struct netnames *names) { + if (!bus_id_len || bus_id_len < 8 || bus_id_len > 9) + return -EINVAL; + ++ /* Strip leading zeros from the bus id for aesthetic purposes. This ++ * keeps the ccw names stable, yet much shorter in general case of ++ * bus_id 0.0.0600 -> 600. This is similar to e.g. how PCI domain is ++ * not prepended when it is zero. ++ */ ++ while (*bus_id == '0' || *bus_id == '.') ++ bus_id++; ++ + /* Store the CCW bus-ID for use as network device name */ +- rc = snprintf(names->ccw_group, sizeof(names->ccw_group), "ccw%s", bus_id); ++ rc = snprintf(names->ccw_group, sizeof(names->ccw_group), "%s", bus_id); + if (rc >= 0 && rc < (int)sizeof(names->ccw_group)) + names->type = NET_CCWGROUP; + return 0; +-- +2.7.0.rc3 + diff -Nru systemd-228/debian/patches/series systemd-228/debian/patches/series --- systemd-228/debian/patches/series 2016-01-14 11:20:05.000000000 +0000 +++ systemd-228/debian/patches/series 2016-01-27 21:34:43.000000000 +0000 @@ -43,3 +43,4 @@ Get-RTC-is-in-local-time-setting-from-etc-default-rc.patch core-Make-logind-session-cgroup-user-writable.patch systemctl-Don-t-forward-telinit-u-to-upstart.patch +0001-udev-net_id-for-ccw-bus-strip-ccw-and-leading-zeros-.patch diff -Nru systemd-228/debian/udev.postinst systemd-228/debian/udev.postinst --- systemd-228/debian/udev.postinst 2016-01-14 11:20:05.000000000 +0000 +++ systemd-228/debian/udev.postinst 2016-01-27 22:23:28.000000000 +0000 @@ -79,6 +79,12 @@ NamePolicy=onboard kernel EOF fi + + # Fix ugly, long, redundant, interface names on s390x + if [ "$(dpkg --print-architecture)" = "s390x" ]; + then + sed 's/enccw[0.]*/en/' -i /etc/network/interfaces 2>/dev/null || true + fi } update_hwdb() {