Hello community, here is the log from the commit of package systemd.4624 for openSUSE:13.1:Update checked in at 2016-04-19 15:26:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:13.1:Update/systemd.4624 (Old) and /work/SRC/openSUSE:13.1:Update/.systemd.4624.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "systemd.4624" Changes: -------- New Changes file: --- /dev/null 2016-04-07 01:36:33.300037506 +0200 +++ /work/SRC/openSUSE:13.1:Update/.systemd.4624.new/systemd-mini.changes 2016-04-19 15:26:31.000000000 +0200 @@ -0,0 +1,7096 @@ +------------------------------------------------------------------- +Tue Apr 5 09:20:50 UTC 2016 - fbui@suse.com + +- Import commit f5639143e4e290f2534e5f7fc12f37339b02d6ef + + e5e362a udev: exclude MD from block device ownership event locking + 8839413 udev: really exclude device-mapper from block device ownership event locking + 66782e6 udev: exclude device-mapper from block device ownership event locking (bsc#972727) + 1386f57 tmpfiles: explicitly set mode for /run/log + faadb74 tmpfiles: don't allow read access to journal files to users not in systemd-journal + 9b1ef37 tmpfiles: don't apply sgid and executable bit to journal files, only the directories they are contained in + 011c39f tmpfiles: add ability to mask access mode by pre-existing access mode on files/directories + 07e2d60 tmpfiles: get rid of "m" lines + d504e28 tmpfiles: various modernizations + f97250d systemctl: no need to pass --all if inactive is explicitly requested in list-units (bsc#967122) + 2686573 fstab-generator: fix automount option and don't start associated mount unit at boot (bsc#970423) + 5c1637d login: support more than just power-gpio-key (fate#318444) (bsc#970860) + 2c95ecd logind: add standard gpio power button support (fate#318444) (bsc#970860) + af3eb93 Revert "log-target-null-instead-kmsg" + 555dad4 shorten hostname before checking for trailing dot (bsc#965897) + 522194c Revert "log: honour the kernel's quiet cmdline argument" (bsc#963230) + cc94e47 transaction: downgrade warnings about wanted unit which are not found (bsc#960158) + eb3cfb3 Revert "vhangup-on-all-consoles" + 0c28752 remove WorkingDirectory parameter from emergency, rescue and console-shell.service (bsc#959886) + +------------------------------------------------------------------- +Fri Apr 1 06:51:02 UTC 2016 - fbui@suse.com + +- Don't allow read access to journal files to users (boo#972612 CVE-2014-9770 CVE-2015-8842) + + Remove the world read bit from the permissions of (persistent) + archived journals. This was incorrectly set due to backported commit + 18afa5c2a7a6c215. + + For the same reasons we also have to fix the permissions of + /run/log/journal/<machine-id> directory to make sure that regular + user won't access to its content. + +------------------------------------------------------------------- +Thu Mar 31 12:38:16 UTC 2016 - fbui@suse.com + +- spec: remove libudev1 runtime dependencies on udev + +------------------------------------------------------------------- +Thu Mar 31 12:35:08 UTC 2016 - fbui@suse.com + +- spec remove libusb-devel and pkgconfig(usbutils) BRs from systemd + + They're not needed since v196 (see commit 796b06c21b62d13). + +------------------------------------------------------------------- +Thu Mar 31 12:32:33 UTC 2016 - fbui@suse.com + +- spec: no need to post-require libudev1 for udev + +------------------------------------------------------------------- +Thu Mar 31 12:27:27 UTC 2016 - fbui@suse.com + +- spec: no need for libgudev to require the mini version of libudev. + + Since this package is not built when bootstrapping. + +------------------------------------------------------------------- +Thu Mar 31 12:21:18 UTC 2016 - fbui@suse.com + +- Don't ship boot.udev and systemd-journald.init anymore. + + It was used during the systemd transition when both sysvinit and + systemd could be used on the same system + +------------------------------------------------------------------- +Thu Mar 31 12:15:42 UTC 2016 - fbui@suse.com + +- spec: do not filter out command completions which rely on + _init_completion() anymore. + + This function is provided by bash-completion package on all distros + we're shipping v210 + +------------------------------------------------------------------- +Thu Mar 31 12:11:58 UTC 2016 - fbui@suse.com + +- rop %{real} and simplify sed expr in pre_checkin.sh + +------------------------------------------------------------------- +Thu Mar 31 12:07:07 UTC 2016 - fbui@suse.com + +- Drop %{udevpkgname}/%{udev_major} and introduce %{mini} instead + + This is imported from Base:System and makes the specfile a little + bit easier to parse. + +------------------------------------------------------------------- +Thu Mar 31 11:59:32 UTC 2016 - fbui@suse.com + +- spec: disable build of src/test since we currently don't run the testsuite + +------------------------------------------------------------------- +Thu Mar 31 11:56:16 UTC 2016 - fbui@suse.com + +- spec: use %{name} in Source1 + +------------------------------------------------------------------- +Thu Mar 31 11:51:54 UTC 2016 - fbui@suse.com + +- spec: use %make_install + +------------------------------------------------------------------- +Wed Mar 16 15:55:40 UTC 2016 - fbui@suse.com + +- drop all compiler/linker option customizations: + - -pipe option is used by default since day 0 + - get rid of cflags() function which is not needed + - --hash-size has no impact specially in runtime + + IOW, use the default options for the compiler and the linker, + there's no point in making systemd different from other package in + this regards. + +------------------------------------------------------------------- +Wed Mar 16 15:08:10 UTC 2016 - fbui@suse.com + +- Fix UEFI detection logic: basically we let configure.ac figure out + if UEFI is supported by the current build environment. No need to + clutter the spec file with a new conditionnal %has_efi. + +------------------------------------------------------------------- +Mon Feb 22 11:06:42 UTC 2016 - fbui@suse.com + +- Don't build require binutils-gold anymore + + The use of the gold linker has been (probably) introduced due to + the use of the -flto option. However forcing the version of the linker + is not a good idea since it's not supported on various architectures. + + Since -flto has been disabled, it's now safe to use the *default* + linker. + + It actually fixed a build error on 13.1 on the ppc arch. + +------------------------------------------------------------------- +Mon Feb 8 14:04:20 UTC 2016 - fbui@suse.com + +- Don't ship fix.service anymore on 13.1, not needed by v210 (boo#965475) + +------------------------------------------------------------------- +Tue Feb 02 09:05:35 GMT 2016 - fbui@suse.com + +- Fix wrong substitution variable name in systemd-udev-root-symlink.service.in (boo#964355) + +------------------------------------------------------------------- +Thu Jan 28 13:38:38 UTC 2016 - fbui@suse.com + +- udev firmware loading support has been removed from 13.1 + +------------------------------------------------------------------- +Thu Jan 28 13:14:38 UTC 2016 - fbui@suse.com + +- systemd-firstboot is also shipped by SLE12 + +------------------------------------------------------------------- +Wed Jan 20 12:47:11 GMT 2016 - fbui@suse.com + +- Revert "disable device timeout when nofail is set" (bsc#962080) + +------------------------------------------------------------------- +Wed Jan 20 12:26:20 GMT 2016 - fbui@suse.com + +- Revert "0001-make-fortify-happy-with-ppoll" (bsc#958937) + +------------------------------------------------------------------- +Thu Jan 14 10:59:28 GMT 2016 - Thomas.Blume@suse.com + +- udev: set udev max children logging to debug level (bsc#958295) + +------------------------------------------------------------------- +Wed Jan 13 11:32:54 UTC 2016 - fbui@suse.com + +- don't use OBS service "set_service" anymore (bsc#961576) + +------------------------------------------------------------------- +Tue Jan 12 08:58:14 GMT 2016 - lennart@poettering.net + +- journald: properly sum up entry size counter (bsc#961226) + +------------------------------------------------------------------- +Tue Jan 12 08:58:14 GMT 2016 - zbyszek@in.waw.pl + +- shutdown: rework messages during shutdown (bsc#955469) + +------------------------------------------------------------------- +Tue Dec 22 11:46:20 GMT 2015 - fbui@suse.com + +- Don't track units/systemd-udev-root-symlink.service + +------------------------------------------------------------------- +Tue Dec 22 11:45:55 GMT 2015 - hare@suse.de ++++ 6899 more lines (skipped) ++++ between /dev/null ++++ and /work/SRC/openSUSE:13.1:Update/.systemd.4624.new/systemd-mini.changes New Changes file: systemd.changes: same change New: ---- _service after-local.service baselibs.conf libgcrypt.m4 localfs.service macros.systemd.upstream nss-myhostname-config pre_checkin.sh systemd-210.tar.xz systemd-mini-rpmlintrc systemd-mini.changes systemd-mini.spec systemd-remount-tmpfs systemd-rpmlintrc systemd-sleep-grub systemd-sysv-convert systemd.changes systemd.spec udev-generate-persistent-rule.sh ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ systemd-mini.spec ++++++ ++++ 1287 lines (skipped) systemd.spec: same change ++++++ _service ++++++ <services> <service name="tar_scm" mode="disabled"> <param name="scm">git</param> <param name="url">https://github.com/openSUSE/systemd.git</param> <param name="subdir"></param> <param name="filename">systemd</param> <param name="version">210</param> <param name="revision">f5639143e4e290f2534e5f7fc12f37339b02d6ef</param> </service> <service name="recompress" mode="disabled"> <param name="file">*systemd*.tar</param> <param name="compression">xz</param> </service> </services> ++++++ after-local.service ++++++ # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. [Unit] Description=/etc/init.d/after.local Compatibility ConditionFileIsExecutable=/etc/init.d/after.local After=getty.target [Service] Type=idle ExecStart=/etc/init.d/after.local TimeoutSec=0 RemainAfterExit=yes SysVStartPriority=99 ++++++ baselibs.conf ++++++ systemd supplements "packageand(systemd:pam-<targettype>)" -/lib/systemd/system/ post "<prefix>%{_sbindir}/pam-config -a --systemd || :" # postun "if [ "$1" == "0" ]; then" # postun "<prefix>%{_sbindir}/pam-config -d --systemd || :" # postun "fi" libgudev-1_0-0 libudev1 nss-myhostname ++++++ libgcrypt.m4 ++++++ dnl Autoconf macros for libgcrypt dnl Copyright (C) 2002, 2004 Free Software Foundation, Inc. dnl dnl This file is free software; as a special exception the author gives dnl unlimited permission to copy and/or distribute it, with or without dnl modifications, as long as this notice is preserved. dnl dnl This file is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS. dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed dnl with the API version to also check the API compatibility. Example: dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using dnl this features allows to prevent build against newer versions of libgcrypt dnl with a changed API. dnl AC_DEFUN([AM_PATH_LIBGCRYPT], [ AC_ARG_WITH(libgcrypt-prefix, AC_HELP_STRING([--with-libgcrypt-prefix=PFX], [prefix where LIBGCRYPT is installed (optional)]), libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="") if test x$libgcrypt_config_prefix != x ; then if test x${LIBGCRYPT_CONFIG+set} != xset ; then LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config fi fi AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no) tmp=ifelse([$1], ,1:1.2.0,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_libgcrypt_api=0 min_libgcrypt_version="$tmp" fi AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version) ok=no if test "$LIBGCRYPT_CONFIG" != "no" ; then req_major=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` major=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` minor=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` micro=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` if test "$major" -gt "$req_major"; then ok=yes else if test "$major" -eq "$req_major"; then if test "$minor" -gt "$req_minor"; then ok=yes else if test "$minor" -eq "$req_minor"; then if test "$micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi if test $ok = yes; then AC_MSG_RESULT([yes ($libgcrypt_config_version)]) else AC_MSG_RESULT(no) fi if test $ok = yes; then # If we have a recent libgcrypt, we should also check that the # API is compatible if test "$req_libgcrypt_api" -gt 0 ; then tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then AC_MSG_CHECKING([LIBGCRYPT API version]) if test "$req_libgcrypt_api" -eq "$tmp" ; then AC_MSG_RESULT([okay]) else ok=no AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp]) fi fi fi fi if test $ok = yes; then LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` ifelse([$2], , :, [$2]) if test x"$host" != x ; then libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` if test x"$libgcrypt_config_host" != xnone ; then if test x"$libgcrypt_config_host" != x"$host" ; then AC_MSG_WARN([[ *** *** The config script $LIBGCRYPT_CONFIG was *** built for $libgcrypt_config_host and thus may not match the *** used host $host. *** You may want to use the configure option --with-libgcrypt-prefix *** to specify a matching config script. ***]]) fi fi fi else LIBGCRYPT_CFLAGS="" LIBGCRYPT_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(LIBGCRYPT_CFLAGS) AC_SUBST(LIBGCRYPT_LIBS) ]) ++++++ localfs.service ++++++ [Unit] Description=Shadow /etc/init.d/boot.localfs DefaultDependencies=no After=local-fs.target [Service] RemainAfterExit=true ExecStart=/bin/true ++++++ macros.systemd.upstream ++++++ # -*- Mode: makefile; indent-tabs-mode: t -*- */ # # This file is part of systemd. # # Copyright 2012 Lennart Poettering # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # systemd is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see <http://www.gnu.org/licenses/>. # RPM macros for packages installing systemd unit files %_unitdir @systemunitdir@ %_userunitdir @userunitdir@ %_presetdir @systempresetdir@ %_udevhwdbdir @udevhwdbdir@ %_udevrulesdir @udevrulesdir@ %_journalcatalogdir @catalogdir@ %_tmpfilesdir @tmpfilesdir@ %_sysctldir @sysctldir@ %systemd_requires \ Requires(post): systemd \ Requires(preun): systemd \ Requires(postun): systemd \ %{nil} %systemd_post() \ if [ $1 -eq 1 ] ; then \ # Initial installation \ @rootbindir@/systemctl preset %{?*} >/dev/null 2>&1 || : \ fi \ %{nil} %systemd_preun() \ if [ $1 -eq 0 ] ; then \ # Package removal, not upgrade \ @rootbindir@/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \ @rootbindir@/systemctl stop %{?*} > /dev/null 2>&1 || : \ fi \ %{nil} %systemd_postun() \ @rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \ %{nil} %systemd_postun_with_restart() \ @rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \ if [ $1 -ge 1 ] ; then \ # Package upgrade, not uninstall \ @rootbindir@/systemctl try-restart %{?*} >/dev/null 2>&1 || : \ fi \ %{nil} %udev_hwdb_update() \ @rootbindir@/udevadm hwdb --update >/dev/null 2>&1 || : \ %{nil} %udev_rules_update() \ @rootbindir@/udevadm control --reload >/dev/null 2>&1 || : \ %{nil} %journal_catalog_update() \ @rootbindir@/journalctl --update-catalog >/dev/null 2>&1 || : \ %{nil} %tmpfiles_create() \ @rootbindir@/systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \ %{nil} ++++++ nss-myhostname-config ++++++ #!/bin/bash # sed calls copied from fedora package set -e case "$1" in --help) echo "$0 [--enable|--disable]" exit 0 ;; --enable) sed -i.bak -e ' /^hosts:/ !b /\<myhostname\>/ b s/[[:blank:]]*$/ myhostname/ ' /etc/nsswitch.conf ;; --disable) sed -i.bak -e ' /^hosts:/ !b s/[[:blank:]]\+myhostname\>// ' /etc/nsswitch.conf ;; "") if grep -q "^hosts:.*\<myhostname\>" /etc/nsswitch.conf; then echo "enabled" else echo "disabled" fi ;; *) echo "invalid argument $1"; exit 1 ;; esac ++++++ pre_checkin.sh ++++++ #!/bin/sh # This script is based on libcdio_spec-prepare.sh (thanks to sbrabec@suse.cz) # create a -mini spec for systemd for bootstrapping ORIG_SPEC=systemd EDIT_WARNING="##### WARNING: please do not edit this auto generated spec file. Use the ${ORIG_SPEC}.spec! #####\n" sed "s/^%define bootstrap.*$/${EDIT_WARNING}%define bootstrap 1/; s/^%define mini .*$/${EDIT_WARNING}%define mini -mini/; s/^\(Name:.*\)$/\1-mini/ " < ${ORIG_SPEC}.spec > ${ORIG_SPEC}-mini.spec cp ${ORIG_SPEC}.changes ${ORIG_SPEC}-mini.changes cp ${ORIG_SPEC}-rpmlintrc ${ORIG_SPEC}-mini-rpmlintrc osc service localrun format_spec_file ++++++ systemd-mini-rpmlintrc ++++++ addFilter(".*dangling-symlink /sbin/(halt|init|poweroff|telinit|shutdown|runlevel|reboot).*") addFilter(".*dangling-symlink .* /dev/null.*") addFilter(".*files-duplicate .*/reboot\.8.*") addFilter(".*files-duplicate .*/sd_is_socket\.3.*") addFilter("non-conffile-in-etc /etc/bash_completion.d/systemd-bash-completion\.sh") addFilter("non-conffile-in-etc /etc/rpm/macros\.systemd") addFilter(".*dbus-policy-allow-receive") addFilter(".*dangling-symlink /lib/udev/devices/std(in|out|err).*") addFilter(".*dangling-symlink /lib/udev/devices/core.*") addFilter(".*dangling-symlink /lib/udev/devices/fd.*") addFilter(".*incoherent-init-script-name boot\.udev.*") addFilter(".init-script-without-%stop_on_removal-preun /etc/init\.d/boot\.udev") addFilter(".init-script-without-%restart_on_update-postun /etc/init\.d/boot\.udev") addFilter(".*devel-file-in-non-devel-package.*udev.pc.*") addFilter(".*libgudev-.*shlib-fixed-dependency.*") addFilter(".*suse-filelist-forbidden-systemd-userdirs.*") addFilter("libudev-mini.*shlib-policy-name-error.*") addFilter("nss-myhostname.*shlib-policy-name-error.*") addFilter("systemd-logger.*useless-provides sysvinit(syslog).*") addFilter("devel-file-in-non-devel-package.*/usr/share/pkgconfig/(udev|systemd)\.pc.*") addFilter(".*script-without-shebang.*/usr/lib/udev/rule_generator.functions.*") addFilter(".*files-duplicate.*/systemd-logger.*") addFilter(".*missing-call-to-setgroups-before-setuid.*") addFilter(".*missing-call-to-chdir-with-chroot.*") addFilter(".*systemd-service-without-service.*") addFilter(".*shlib-policy-missing-suffix.*") addFilter(".*suse-missing-rclink.*") ++++++ systemd-remount-tmpfs ++++++ #!/bin/sh PATH=/usr/bin:/bin:/usr/sbin:/sbin DIR=$(sed -rn '/^#/d;\@^[[:graph:]]+[[:space:]]+/[[:graph:]]+[[:space:]]+tmpfs[[:space:]]+.*size=[0-9]+[kmg,[:space:]]@{ s@^[[:graph:]]+[[:space:]]+(/[[:graph:]]+).*@\1@p }' /etc/fstab) if [ -n "$DIR" ]; then for i in $DIR; do echo $i mount -o remount "$i" >/dev/null 2>&1 STATE=$? if [ "$STATE" -gt 0 ]; then logger "Remount of $i failed with state $STATE" fi done fi ++++++ systemd-rpmlintrc ++++++ addFilter(".*dangling-symlink /sbin/(halt|init|poweroff|telinit|shutdown|runlevel|reboot).*") addFilter(".*dangling-symlink .* /dev/null.*") addFilter(".*files-duplicate .*/reboot\.8.*") addFilter(".*files-duplicate .*/sd_is_socket\.3.*") addFilter("non-conffile-in-etc /etc/bash_completion.d/systemd-bash-completion\.sh") addFilter("non-conffile-in-etc /etc/rpm/macros\.systemd") addFilter(".*dbus-policy-allow-receive") addFilter(".*dangling-symlink /lib/udev/devices/std(in|out|err).*") addFilter(".*dangling-symlink /lib/udev/devices/core.*") addFilter(".*dangling-symlink /lib/udev/devices/fd.*") addFilter(".*incoherent-init-script-name boot\.udev.*") addFilter(".init-script-without-%stop_on_removal-preun /etc/init\.d/boot\.udev") addFilter(".init-script-without-%restart_on_update-postun /etc/init\.d/boot\.udev") addFilter(".*devel-file-in-non-devel-package.*udev.pc.*") addFilter(".*libgudev-.*shlib-fixed-dependency.*") addFilter(".*suse-filelist-forbidden-systemd-userdirs.*") addFilter("libudev-mini.*shlib-policy-name-error.*") addFilter("nss-myhostname.*shlib-policy-name-error.*") addFilter("systemd-logger.*useless-provides sysvinit(syslog).*") addFilter("devel-file-in-non-devel-package.*/usr/share/pkgconfig/(udev|systemd)\.pc.*") addFilter(".*script-without-shebang.*/usr/lib/udev/rule_generator.functions.*") addFilter(".*files-duplicate.*/systemd-logger.*") addFilter(".*missing-call-to-setgroups-before-setuid.*") addFilter(".*missing-call-to-chdir-with-chroot.*") addFilter(".*systemd-service-without-service.*") addFilter(".*shlib-policy-missing-suffix.*") addFilter(".*suse-missing-rclink.*") ++++++ systemd-sleep-grub ++++++ #!/bin/bash # # Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. prepare-parameters() { eval `grep LOADER_TYPE= /etc/sysconfig/bootloader` if [ x"$LOADER_TYPE" = "xgrub2" -o x"$LOADER_TYPE" = "xgrub2-efi" ]; then GRUBONCE="/usr/sbin/grub2-once" GRUBDEFAULT="/boot/grub2/grubenv" GRUB2EDITENV="/usr/bin/grub2-editenv" GRUB2CONF="/boot/grub2/grub.cfg" BLKID="/usr/sbin/blkid" getkernels="getkernels-grub2" fi } ##################################################################### # gets a list of available kernels from /boot/grub2/grub.cfg # kernels are in the array $KERNELS, output to stdout to be eval-ed. getkernels-grub2() { local I DUMMY MNT ROOTDEV declare -i I=0 J=-1 # we need the root partition later to decide if this is the kernel to select while read ROOTDEV MNT DUMMY; do [ "$ROOTDEV" = "rootfs" ] && continue # not what we are searching for if [ "$MNT" = "/" ]; then break fi done < /proc/mounts while read LINE; do case $LINE in menuentry\ *) let J++ ;; set\ default*) local DEFAULT=${LINE#*default=} if echo $DEFAULT | grep -q saved_entry ; then local SAVED=`$GRUB2EDITENV $GRUBDEFAULT list | sed -n s/^saved_entry=//p` if [ -n "$SAVED" ]; then DEFAULT_BOOT=$($GRUBONCE --show-mapped "$SAVED") fi fi ;; linux*noresume*|module*xen*noresume*) echo " Skipping grub entry #${J}, because it has the noresume option" >&2 ;; linux*root=*|module*xen*root=*) local ROOT ROOT=${LINE#*root=} DUMMY=($ROOT) ROOT=${DUMMY[0]} if [ x"${ROOT:0:5}" = "xUUID=" ]; then UUID=${ROOT#UUID=} if [ -n "$UUID" ]; then ROOT=$($BLKID -U $UUID) fi fi if [ "$(stat -Lc '%t:%T' $ROOT)" != "$(stat -Lc '%t:%T' $ROOTDEV)" ]; then echo " Skipping grub entry #${J}, because its root= parameter ($ROOT)" >&2 echo " does not match the current root device ($ROOTDEV)." >&2 continue fi DUMMY=($LINE) # kernel (hd0,1)/boot/vmlinuz-ABC root=/dev/hda2 echo "KERNELS[$I]='${DUMMY[1]##*/}'" # vmlinuz-ABC echo "MENU_ENTRIES[$I]=$J" # DEBUG "Found kernel entry #${I}: '${DUMMY[1]##*/}'" INFO let I++ ;; linux*|module*xen*) # a kernel without "root="? We better skip that one... echo " Skipping grub entry #${J}, because it has no root= option" >&2 ;; *) ;; esac done < "$GRUB2CONF" } ############################################################# # runs grubonce from the grub package to select which kernel # to boot on next startup grub-once() { if [ -x "$GRUBONCE" ]; then echo " running '$GRUBONCE $1'" $GRUBONCE $1 else echo "WARNING: $GRUBONCE not found, not preparing bootloader" fi } ############################################################# # restore grub default after (eventually failed) resume grub-once-restore() { echo "INFO: running grub-once-restore" prepare-parameters $GRUB2EDITENV $GRUBDEFAULT unset next_entry } ############################################################################# # try to find a kernel image that matches the actually running kernel. # We need this, if more than one kernel is installed. This works reasonably # well with grub, if all kernels are named "vmlinuz-`uname -r`" and are # located in /boot. If they are not, good luck ;-) find-kernel-entry() { NEXT_BOOT=-1 ARCH=`uname -m` declare -i I=0 # DEBUG "running kernel: $RUNNING" DIAG while [ -n "${KERNELS[$I]}" ]; do BOOTING="${KERNELS[$I]}" if IMAGE=`readlink /boot/$BOOTING` && [ -e "/boot/${IMAGE##*/}" ]; then # DEBUG "Found kernel symlink $BOOTING => $IMAGE" INFO BOOTING=$IMAGE fi case $ARCH in ppc*) BOOTING="${BOOTING#*vmlinux-}" ;; *) BOOTING="${BOOTING#*vmlinuz-}" ;; esac if [ "$RUNNING" == "$BOOTING" ]; then NEXT_BOOT=${MENU_ENTRIES[$I]} echo " running kernel is grub menu entry $NEXT_BOOT (${KERNELS[$I]})" break fi let I++ done # if we have not found a kernel, issue a warning. # if we have found a kernel, we'll do "grub-once" later, after # prepare_suspend finished. if [ $NEXT_BOOT -eq -1 ]; then echo "WARNING: no kernelfile matching the running kernel found" fi } ############################################################################# # if we did not find a kernel (or BOOT_LOADER is not GRUB) check, # if the running kernel is still the one that will (probably) be booted for # resume (default entry in menu.lst or, if there is none, the kernel file # /boot/vmlinuz points to.) # This will only work, if you use "original" SUSE kernels. # you can always override with the config variable set to "yes" prepare-grub() { echo "INFO: running prepare-grub" prepare-parameters eval `$getkernels` RUNNING=`uname -r` find-kernel-entry RET=0 if [ $NEXT_BOOT -eq -1 ]; then # which kernel is booted with the default entry? BOOTING="${KERNELS[$DEFAULT_BOOT]}" # if there is no default entry (no menu.lst?) we fall back to # the default of /boot/vmlinuz. [ -z "$BOOTING" ] && BOOTING="vmlinuz" if IMAGE=`readlink /boot/$BOOTING` && [ -e "/boot/${IMAGE##*/}" ]; then BOOTING=$IMAGE fi BOOTING="${BOOTING#*vmlinuz-}" echo "running kernel: '$RUNNING', probably booting kernel: '$BOOTING'" if [ "$BOOTING" != "$RUNNING" ]; then echo "ERROR: kernel version mismatch, cannot suspend to disk" RET=1 fi else # set the bootloader to the running kernel echo " preparing boot-loader: selecting entry $NEXT_BOOT, kernel /boot/$BOOTING" T1=`date +"%s%N"` sync; sync; sync # this is needed to speed up grub-once on reiserfs T2=`date +"%s%N"` echo " grub-once: `grub-once $NEXT_BOOT`" T3=`date +"%s%N"` S=$(((T2-T1)/100000000)); S="$((S/10)).${S:0-1}" G=$(((T3-T2)/100000000)); G="$((G/10)).${G:0-1}" echo " time needed for sync: $S seconds, time needed for grub: $G seconds." fi return $RET } ###### main() if [ "$1" = pre ] ; then prepare-grub || exit 7 fi if [ "$1" = post ] ; then grub-once-restore fi ++++++ systemd-sysv-convert ++++++ #!/bin/bash if [ "$UID" != "0" ]; then echo Need to be root. exit 1 fi declare -A results_runlevel declare -A results_priority usage() { cat << EOF usage: systemd-sysv-convert [-h] [--save] [--show] [--apply] SERVICE [SERVICE ...] EOF } help() { usage cat << EOF Save and Restore SysV Service Runlevel Information positional arguments: SERVICE Service names optional arguments: -h, --help show this help message and exit --save Save SysV runlevel information for one or more services --show Show saved SysV runlevel information for one or more services --apply Apply saved SysV runlevel information for one or more services to systemd counterparts EOF } find_service() { local service local runlevel declare -i priority service=$1 runlevel=$2 priority=-1 for l in $(ls /etc/rc.d/rc$runlevel.d/) ; do initscript=$(basename $l) if [ ${initscript:0:1} != "S" -o ${initscript:3} != "$service" ]; then continue fi if [ ${initscript:1:2} -ge 0 -a ${initscript:1:2} -le 99 -a ${initscript:1:2} -ge $priority ]; then if [ ${initscript:1:1} == 0 ]; then priority=${initscript:2:1} else priority=${initscript:1:2} fi fi done if [ $priority -ge 0 ]; then return $priority else return 255 fi } lookup_database() { local services local service local service_file local runlevel local priority local -i k declare -a parsed services=$@ k=0 results_runlevel=() results_priority=() while read line ; do k+=1 parsed=($line) service=${parsed[0]} runlevel=${parsed[1]} priority=${parsed[2]} if [ $runlevel -lt 2 -o $runlevel -gt 5 ]; then echo "Runlevel out of bounds in database line $k. Ignoring" >/dev/stderr continue fi if [ $priority -lt 0 -o $priority -gt 99 ]; then echo "Priority out of bounds in database line $k. Ignoring" >/dev/stderr continue fi declare -i found found=0 for s in $services ; do if [ $s == $service ]; then found=1 continue fi done if [ $found -eq 0 ]; then continue fi results_runlevel[$service]+=" $runlevel" results_priority[$service]+=" $priority" done < /var/lib/systemd/sysv-convert/database } declare -i fail=0 case "$1" in -h|--help) help exit 0 ;; --save) shift for service in $@ ; do if [ ! -r "/etc/init.d/$service" ]; then echo "SysV service $service does not exist" >/dev/stderr let fail++ continue fi for runlevel in 2 3 4 5; do find_service $service $runlevel priority=$? if [ $priority -lt 255 ]; then echo "$service $runlevel $priority" >> /var/lib/systemd/sysv-convert/database fi done done ;; --show) shift services=$@ lookup_database $services for service in $services; do if [ -z "${results_runlevel[$service]}" ]; then echo No information found about service $service found. >/dev/stderr let fail++ continue fi declare -i count count=0 priority=(${results_priority[$service]}) for runlevel in ${results_runlevel[$service]}; do echo SysV service $service enabled in runlevel $runlevel at priority ${priority[$count]} count+=1 done done ;; --apply) shift services=$@ for service in $services; do if [ ! -f "/lib/systemd/system/$service.service" -a ! -f "/usr/lib/systemd/system/$service.service" ]; then echo systemd service $service.service does not exist. >/dev/stderr exit 1 fi done lookup_database $services for service in $services; do [ -f "/lib/systemd/system/$service.service" ] && service_file="/lib/systemd/system/$service.service" [ -f "/usr/lib/systemd/system/$service.service" ] && service_file="/usr/lib/systemd/system/$service.service" if [ -z "${results_runlevel[$service]}" ]; then echo No information found about service $service found. >/dev/stderr let fail++ continue fi for runlevel in ${results_runlevel[$service]}; do echo ln -sf $service_file /etc/systemd/system/runlevel$runlevel.target.wants/$service.service >/dev/stderr mkdir -p "/etc/systemd/system/runlevel$runlevel.target.wants" /bin/ln -sf $service_file /etc/systemd/system/runlevel$runlevel.target.wants/$service.service done done ;; *) usage let fail=2 ;; esac exit $fail ++++++ udev-generate-persistent-rule.sh ++++++ #!/bin/bash # # Copyright (C) 2014 Robert Milasan <rmilasan@suse.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # This script run manually by user, will generate a persistent rule for # a given network interface to rename it to new interface name. # _prj="$(basename $0 2>/dev/null)" prj="${_prj%.*}" ver="0.2" log_info() { local msg="$1" echo "$prj: $msg" } log_error() { local msg="$1" echo "$prj: $msg" >&2 } usage() { cat << EOF $prj: udev persistent rule generator script Usage: $prj [OPTION] ... -h Show this help -l List available interfaces -m Generate the persistent rule based on interface MAC address default option, if nothing is specified -p Generate the persistent rule based on interface PCI slot -v Be more verbose -V Output the version number -c [INTERFACE] Current interface name (ex: ip link) only needed for retrieving information -n [INTERFACE] New interface name (ex: net0) -o [FILE] Where to write the new generate rule (default: /dev/stdout) prefered location is /etc/udev/rules.d/70-persistent-net.rules Example: $prj -v -c enp0s4 -n lan0 or $prj -m -c enp0s4 -n net0 -o /etc/udev/rules.d/70-persistent-net.rules or $prj -p -c wlp3s0 -n wlan0 -o /etc/udev/rules.d/50-mynet.rules EOF } display_note() { cat << EOF NOTE: Using the generate persistent rule might mean you will need to do extra work to ensure that it will work accordingly. This mean, regenerating the initramfs/initrd image and/or using 'net.ifnames=0' option at boot time. In openSUSE/SUSE, the user will need to regenerate the initramfs/initrd image, but usually there is no need for 'net.ifnames=0' option if the persistent rule is available in initramfs/initrd image. EOF } get_pci() { local path="$1" local pci="" if [ -L "$path/device" ]; then local pci_link="$(readlink -f $path/device 2>/dev/null)" pci="$(basename $pci_link 2>/dev/null)" fi echo $pci } get_pci_id() { local path="$1" local pci_id="" if [ -r "$path/device/uevent" ]; then local _pci_id="$(cat $path/device/uevent|grep ^PCI_ID 2>/dev/null)" pci_id="${_pci_id#*=}" fi echo $pci_id } get_macaddr() { local path="$1" local macaddr="" if [ -r "$path/address" ]; then macaddr="$(cat $path/address 2>/dev/null)" fi echo $macaddr } get_type() { local path="$1" local dev_type="" if [ -r "$path/type" ]; then dev_type="$(cat $path/type 2>/dev/null)" fi echo $dev_type } get_dev_id() { local path="$1" local dev_id="" if [ -r "$path/dev_id" ]; then dev_id="$(cat $path/dev_id 2>/dev/null)" fi echo $dev_id } get_devtype() { local path="$1" local devtype="" if [ -r "$path/uevent" ]; then local _devtype="$(cat $path/uevent|grep ^DEVTYPE 2>/dev/null)" devtype="${_devtype#*=}" fi echo $devtype } get_subsystem() { local path="$1" local subsystem="" if [ -L "$path/subsystem" ]; then local subsystem_link="$(readlink -f $path/subsystem 2>/dev/null)" subsystem="$(basename $subsystem_link 2>/dev/null)" fi echo $subsystem } get_parent_subsystem() { local path="$1" local subsystem="" if [ -L "$path/device/subsystem" ]; then local subsystem_link="$(readlink -f $path/device/subsystem 2>/dev/null)" subsystem="$(basename $subsystem_link 2>/dev/null)" fi echo $subsystem } get_driver() { local path="$1" local driver="" if [ -L "$path/device/driver" ]; then local driver_link="$(readlink -f $path/device/driver 2>/dev/null)" driver="$(basename $driver_link 2>/dev/null)" fi echo $driver } valid_mac() { local macaddr="$1" local valid_macaddr="" if [ -n "$macaddr" ]; then valid_macaddr="$(echo $macaddr | sed -n '/^\([0-9a-z][0-9a-z]:\)\{5\}[0-9a-z][0-9a-z]$/p')" fi echo $valid_macaddr } valid_dev_type() { local dev_type="$1" case "$dev_type" in [0-32]) echo "$dev_type" ;; *) echo "invalid" ;; esac } generate_comment() { local pci_id="$1" local driver="$2" local output="$3" local device_type="$4" local _type="" if [ -z "$pci_id" ]; then log_error "\$pci_id empty." exit 1 elif [ -z "$driver" ]; then log_error "\$driver empty." exit 1 elif [ -z "$output" ]; then log_error "\$output empty." exit 1 else if [ "$device_type" == "pci" ]; then _type="PCI" elif [ "$device_type" == "usb" ]; then _type="USB" else _type="Unknown" fi echo "# $_type device $pci_id ($driver)" >> $output fi } generate_rule() { local _subsystem="$1" local _mac="$2" local _pci="$3" local _dev_id="$4" local _dev_type="$5" local _kernel="$6" local _interface="$7" local output="$8" if [ -z "$_subsystem" ]; then log_error "\$_subsystem empty." exit 1 elif [ -z "$_dev_id" ]; then log_error "\$_dev_id empty." exit 1 elif [ -z "$_dev_type" ]; then log_error "\$_dev_type empty." exit 1 elif [ -z "$_kernel" ]; then log_error "\$_kernel empty." exit 1 elif [ -z "$_interface" ]; then log_error "\$_interface empty." exit 1 elif [ -z "$output" ]; then output="/dev/stdout" fi if [ "$_mac" != "none" ]; then echo "SUBSYSTEM==\"$_subsystem\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$_mac\", \ ATTR{dev_id}==\"$_dev_id\", ATTR{type}==\"$_dev_type\", KERNEL==\"$_kernel\", NAME=\"$_interface\"" >> ${output} elif [ "$_pci" != "none" ]; then echo "SUBSYSTEM==\"$_subsystem\", ACTION==\"add\", DRIVERS==\"?*\", KERNELS==\"$_pci\", \ ATTR{dev_id}==\"$_dev_id\", ATTR{type}==\"$_dev_type\", KERNEL==\"$_kernel\", NAME=\"$_interface\"" >> ${output} else log_error "MAC address or PCI slot information missing." exit 1 fi } list_adapters() { declare -a netdev local count=0 local _netdev="" local _dev="" for _dev in $SYSPATH/*; do if [ -L "$_dev/device" ]; then local _dev_type="$(cat $_dev/type 2>/dev/null)" if [ "$(valid_dev_type $_dev_type)" == "invalid" ]; then continue; fi _dev="$(basename $_dev 2>/dev/null)" netdev[$count]="$_dev" count=$((count + 1)) fi done echo "Found $count network interfaces:" for _netdev in "${netdev[@]}"; do _macaddr="$(get_macaddr $SYSPATH/$_netdev)" _pcislot="$(get_pci $SYSPATH/$_netdev)" echo "I: INTERFACE: $_netdev" echo "I: MACADDR: $_macaddr" echo "I: PCI: $_pcislot" done } if [ $# -eq 0 ]; then usage log_error "missing option(s)." exit 1 fi SYSPATH="/sys/class/net" use_mac=0 use_pci=0 use_verbose=0 while getopts "hlmpvVc:n:o:" opt; do case "$opt" in h) usage; exit 0;; l) list_adapters; exit 0;; m) use_mac=1 ;; p) use_pci=1 ;; v) use_verbose=1 ;; V) echo "$prj $ver"; exit 0;; c) ifcur="$OPTARG" ;; n) ifnew="$OPTARG" ;; o) output="$OPTARG" ;; \?) exit 1 ;; esac done if [[ "$use_mac" -eq 0 ]] && [[ "$use_pci" -eq 0 ]]; then use_mac=1 fi if [[ "$use_mac" -eq 1 ]] && [[ "$use_pci" -eq 1 ]]; then log_error "generating a persistent rule can be done only using one of the option, -m or -p, not both." exit 1 fi outfile="$output" if [ -z "$output" ]; then outfile="/dev/stdout" else dir="$(dirname $outfile 2>/dev/null)" tmpfile="$dir/.tmp_file" if [ -d "$dir" ]; then touch "$tmpfile" >/dev/null 2>&1 if [ $? -ne 0 ]; then log_error "no write access for $outfile. make sure you have write permissions to $dir." exit 1 fi rm -f "$tmpfile" >/dev/null 2>&1 else log_error "$dir not a directory." exit 1 fi fi interface="$ifcur" if [ -z "$interface" ]; then log_error "current interface must be specified." exit 1 elif [ "$interface" == "lo" ]; then log_error "loopback interface is not a valid interface." exit 1 fi [ "$use_verbose" -eq 1 ] && echo "I: INTERFACE=$interface" new_interface="$ifnew" if [ -z "$new_interface" ]; then log_error "new interface must be specified." exit 1 elif [ "$new_interface" == "lo" ]; then log_error "new interface cant be named loopback interface." exit fi [ "$use_verbose" -eq 1 ] && echo "I: INTERFACE_NEW=$new_interface" path="$SYSPATH/$interface" if [ ! -d "$path" ]; then log_error "devpath $path not a directory." exit 1 fi [ "$use_verbose" -eq 1 ] && echo "I: DEVPATH=$path" devtype="$(get_devtype $path)" if [ -n "$devtype" ]; then [ "$use_verbose" -eq 1 ] && echo "I: DEVTYPE=$devtype" fi parent_subsystem="$(get_parent_subsystem $path)" if [ -z "$parent_subsystem" ]; then log_error "unable to retrieve parent subsystem for interface $interface." exit 1 fi [ "$use_verbose" -eq 1 ] && echo "I: PARENT_SUBSYSTEM=$parent_subsystem" subsystem="$(get_subsystem $path)" if [ -z "$subsystem" ]; then log_error "unable to retrieve subsystem for interface $interface." exit 1 fi [ "$use_verbose" -eq 1 ] && echo "I: SUBSYSTEM=$subsystem" pci_id="$(get_pci_id $path)" if [ -z "$pci_id" ]; then pci_id="0x:0x" fi [ "$use_verbose" -eq 1 ] && echo "I: PCI_ID=$pci_id" driver="$(get_driver $path)" if [ -z "$driver" ]; then log_error "unable to retrieve driver for interface $interface." exit 1 fi [ "$use_verbose" -eq 1 ] && echo "I: DRIVER=$driver" if [ "$use_mac" -eq 1 ]; then macaddr="$(get_macaddr $path)" if [ -z "$macaddr" ]; then log_error "unable to retrieve MAC address for interface $interface." exit 1 fi if [ "$(valid_mac $macaddr)" != "$macaddr" ]; then log_error "$macaddr invalid MAC address." exit 1 fi [ "$use_verbose" -eq 1 ] && echo "I: MACADDR=$macaddr" fi if [ "$use_pci" -eq 1 ]; then pci="$(get_pci $path)" if [ -z "$pci" ]; then log_error "unable to retrieve PCI slot for interface $interface." exit 1 fi [ "$use_verbose" -eq 1 ] && echo "I: KERNELS=$pci" fi dev_id="$(get_dev_id $path)" if [ -z "$dev_id" ]; then log_error "unable to retrieve dev_id for interface $interface." exit 1 fi [ "$use_verbose" -eq 1 ] && echo "I: DEV_ID=$dev_id" dev_type="$(get_type $path)" if [ -z "$dev_type" ]; then log_error "unable to retrieve dev_type for interface $interface." exit 1 elif [ "$(valid_dev_type $dev_type)" == "invalid" ]; then log_info "$interface not a supported device." exit 1 fi [ "$use_verbose" -eq 1 ] && echo "I: TYPE=$dev_type" kernel="eth*" if [ -n "$devtype" ]; then if [ "$devtype" == "wlan" ]; then kernel="wlan*" fi fi if [ -n "$output" ]; then echo "Persistent rule written to "$outfile"" generate_comment "$pci_id" "$driver" "$outfile" "$parent_subsystem" fi if [ "$use_mac" -eq 1 ]; then generate_rule "$subsystem" "$macaddr" "none" "$dev_id" "$dev_type" "$kernel" "$new_interface" if [ -n "$output" ]; then generate_rule "$subsystem" "$macaddr" "none" "$dev_id" "$dev_type" "$kernel" "$new_interface" "$outfile" fi elif [ "$use_pci" -eq 1 ]; then generate_rule "$subsystem" "none" "$pci" "$dev_id" "$dev_type" "$kernel" "$new_interface" if [ -n "$output" ]; then generate_rule "$subsystem" "none" "$pci" "$dev_id" "$dev_type" "$kernel" "$new_interface" "$outfile" fi fi if [ -n "$output" ]; then display_note fi exit 0