openSUSE Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
September 2013
- 1 participants
- 2223 discussions
Hello community,
here is the log from the commit of package apache2 for openSUSE:Factory checked in at 2013-09-02 14:55:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/apache2 (Old)
and /work/SRC/openSUSE:Factory/.apache2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "apache2"
Changes:
--------
--- /work/SRC/openSUSE:Factory/apache2/apache2.changes 2013-08-04 16:48:08.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.apache2.new/apache2.changes 2013-09-02 14:55:31.000000000 +0200
@@ -1,0 +2,14 @@
+Fri Aug 30 04:48:07 UTC 2013 - crrodriguez(a)opensuse.org
+
+- Really use %requires_ge for libapr1 and libapr-util1
+ mentioned but not implemented in the previous commit.
+
+-------------------------------------------------------------------
+Wed Aug 28 07:29:47 UTC 2013 - crrodriguez(a)opensuse.org
+
+- Use %requires_ge for libapr1 and libapr-util1
+- apache2-default-server.conf: Need to use IncludeOptional
+- apache-20-22-upgrade: also load authz_core
+- httpd-visibility.patch: Use compiler symbol visibility.
+
+-------------------------------------------------------------------
New:
----
httpd-visibility.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ apache2.spec ++++++
--- /var/tmp/diff_new_pack.gnel1J/_old 2013-09-02 14:55:32.000000000 +0200
+++ /var/tmp/diff_new_pack.gnel1J/_new 2013-09-02 14:55:32.000000000 +0200
@@ -155,6 +155,7 @@
# PATCH-FEATURE-UPSTREAM httpd-2.4.3-mod_systemd.patch crrodriguez(a)opensuse.org simple module provides systemd integration.
Patch109: httpd-2.4.3-mod_systemd.patch
Patch110: http://people.apache.org/~minfrin/httpd-event-ssl.patch
+Patch111: httpd-visibility.patch
Url: http://httpd.apache.org/
Icon: Apache.xpm
Summary: The Apache Web Server Version 2.2
@@ -170,11 +171,9 @@
Requires: /etc/mime.types
PreReq: %{name}-utils
Requires: logrotate
-# in the past, libapr1 >= 1.0 was sufficient. But since 2.2.16, a failure to
-# create listen sockets can occur, unless newer libapr1 is used, with certain kernels.
-# see https://bugzilla.redhat.com/show_bug.cgi?id=516331
-Requires: libapr1 < 2.0
-Requires: libapr1 >= 1.4.2
+#for some reason the parser barfs if not conditional
+%{?requires_ge:%requires_ge libapr1}
+%{?requires_ge:%requires_ge libapr-util1}
%{?systemd_requires}
PreReq: fileutils textutils grep sed
%if %{?suse_version:1}0
@@ -379,8 +378,8 @@
#%patch108 -p1
%patch109 -p1
%patch110
+%patch111 -p1
cat $RPM_SOURCE_DIR/SUSE-NOTICE >> NOTICE
-
# install READMEs
a=$(basename %{S:22})
cp %{S:22} ./${a##%{name}-}
@@ -502,7 +501,7 @@
sed "s/%{vers}-$mpm//" include/ap_config_auto.h > include/ap_config_auto.h.new
mv include/ap_config_auto.h.new include/ap_config_auto.h
- make CFLAGS="$RPM_OPT_FLAGS -fPIC \
+ make CFLAGS="$RPM_OPT_FLAGS -fvisibility=hidden -fPIC \
-Wall \
-DDEFAULT_PIDLOG='\"%{runtimedir}/%{httpd}.pid\"' \
-DDEFAULT_ERRORLOG='\"%{logfiledir}/error_log\"' " \
++++++ apache-20-22-upgrade ++++++
--- /var/tmp/diff_new_pack.gnel1J/_old 2013-09-02 14:55:32.000000000 +0200
+++ /var/tmp/diff_new_pack.gnel1J/_new 2013-09-02 14:55:32.000000000 +0200
@@ -75,6 +75,10 @@
a2enmod authn_core
fi
+if ! a2enmod -q authz_core; then
+ a2enmod authz_core
+fi
+
if ! a2enmod -q log_config; then
a2enmod log_config
fi
++++++ apache2-default-server.conf ++++++
--- /var/tmp/diff_new_pack.gnel1J/_old 2013-09-02 14:55:32.000000000 +0200
+++ /var/tmp/diff_new_pack.gnel1J/_new 2013-09-02 14:55:32.000000000 +0200
@@ -99,7 +99,7 @@
# You can comment this out here if you want those bits include only in a
# certain virtual host, but not here.
#
-Include /etc/apache2/conf.d/*.conf
+IncludeOptional /etc/apache2/conf.d/*.conf
# The manual... if it is installed ('?' means it won't complain)
IncludeOptional /etc/apache2/conf.d/apache2-manual?conf
++++++ httpd-visibility.patch ++++++
--- httpd-2.4.6.orig/include/ap_config.h
+++ httpd-2.4.6/include/ap_config.h
@@ -64,7 +64,7 @@
* AP_DECLARE(rettype) ap_func(args)
* @endcode
*/
-#define AP_DECLARE(type) type
+#define AP_DECLARE(type) __attribute__ ((visibility ("default"))) type
/**
* Apache Core dso variable argument and hook functions are declared with
@@ -74,7 +74,7 @@
* AP_DECLARE_NONSTD(rettype) ap_func(args [...])
* @endcode
*/
-#define AP_DECLARE_NONSTD(type) type
+#define AP_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
/**
* Apache Core dso variables are declared with AP_MODULE_DECLARE_DATA.
@@ -86,7 +86,7 @@
* AP_DECLARE_DATA type apr_variable
* @endcode
*/
-#define AP_DECLARE_DATA
+#define AP_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(AP_DECLARE_STATIC)
#define AP_DECLARE(type) type __stdcall
@@ -115,10 +115,10 @@
#if defined(WIN32)
#define AP_MODULE_DECLARE(type) type __stdcall
#else
-#define AP_MODULE_DECLARE(type) type
+#define AP_MODULE_DECLARE(type) __attribute__ ((visibility ("default"))) type
#endif
-#define AP_MODULE_DECLARE_NONSTD(type) type
-#define AP_MODULE_DECLARE_DATA
+#define AP_MODULE_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define AP_MODULE_DECLARE_DATA __attribute__ ((visibility ("default")))
#else
/**
* AP_MODULE_DECLARE_EXPORT is a no-op. Unless contradicted by the
--- httpd-2.4.6.orig/modules/cache/mod_cache.h
+++ httpd-2.4.6/modules/cache/mod_cache.h
@@ -37,9 +37,9 @@
* CACHE_DECLARE_DATA with appropriate export and import tags for the platform
*/
#if !defined(WIN32)
-#define CACHE_DECLARE(type) type
-#define CACHE_DECLARE_NONSTD(type) type
-#define CACHE_DECLARE_DATA
+#define CACHE_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define CACHE_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define CACHE_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(CACHE_DECLARE_STATIC)
#define CACHE_DECLARE(type) type __stdcall
#define CACHE_DECLARE_NONSTD(type) type
--- httpd-2.4.6.orig/modules/proxy/mod_proxy.h
+++ httpd-2.4.6/modules/proxy/mod_proxy.h
@@ -475,9 +475,9 @@ struct proxy_balancer_method {
* PROXY_DECLARE_DATA with appropriate export and import tags for the platform
*/
#if !defined(WIN32)
-#define PROXY_DECLARE(type) type
-#define PROXY_DECLARE_NONSTD(type) type
-#define PROXY_DECLARE_DATA
+#define PROXY_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define PROXY_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define PROXY_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(PROXY_DECLARE_STATIC)
#define PROXY_DECLARE(type) type __stdcall
#define PROXY_DECLARE_NONSTD(type) type
--- httpd-2.4.6.orig/modules/lua/mod_lua.h
+++ httpd-2.4.6/modules/lua/mod_lua.h
@@ -58,9 +58,9 @@
* AP_LUA_DECLARE_DATA with appropriate export and import tags for the platform
*/
#if !defined(WIN32)
-#define AP_LUA_DECLARE(type) type
-#define AP_LUA_DECLARE_NONSTD(type) type
-#define AP_LUA_DECLARE_DATA
+#define AP_LUA_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define AP_LUA_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define AP_LUA_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(AP_LUA_DECLARE_STATIC)
#define AP_LUA_DECLARE(type) type __stdcall
#define AP_LUA_DECLARE_NONSTD(type) type
--- httpd-2.4.6.orig/modules/core/mod_watchdog.h
+++ httpd-2.4.6/modules/core/mod_watchdog.h
@@ -83,9 +83,9 @@ typedef struct ap_watchdog_t ap_watchdog
*/
#if !defined(AP_WD_DECLARE)
#if !defined(WIN32)
-#define AP_WD_DECLARE(type) type
-#define AP_WD_DECLARE_NONSTD(type) type
-#define AP_WD_DECLARE_DATA
+#define AP_WD_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define AP_WD_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define AP_WD_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(AP_WD_DECLARE_STATIC)
#define AP_WD_DECLARE(type) type __stdcall
#define AP_WD_DECLARE_NONSTD(type) type
--- httpd-2.4.6.orig/modules/generators/mod_status.h
+++ httpd-2.4.6/modules/generators/mod_status.h
@@ -34,9 +34,9 @@
#define AP_STATUS_EXTENDED (0x4) /* detailed report */
#if !defined(WIN32)
-#define STATUS_DECLARE(type) type
-#define STATUS_DECLARE_NONSTD(type) type
-#define STATUS_DECLARE_DATA
+#define STATUS_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define STATUS_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define STATUS_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(STATUS_DECLARE_STATIC)
#define STATUS_DECLARE(type) type __stdcall
#define STATUS_DECLARE_NONSTD(type) type
--- httpd-2.4.6.orig/modules/dav/main/mod_dav.h
+++ httpd-2.4.6/modules/dav/main/mod_dav.h
@@ -82,9 +82,9 @@ extern "C" {
* DAV_DECLARE_DATA with appropriate export and import tags for the platform
*/
#if !defined(WIN32)
-#define DAV_DECLARE(type) type
-#define DAV_DECLARE_NONSTD(type) type
-#define DAV_DECLARE_DATA
+#define DAV_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define DAV_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define DAV_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(DAV_DECLARE_STATIC)
#define DAV_DECLARE(type) type __stdcall
#define DAV_DECLARE_NONSTD(type) type
--- httpd-2.4.6.orig/modules/session/mod_session.h
+++ httpd-2.4.6/modules/session/mod_session.h
@@ -21,9 +21,9 @@
* SESSION_DECLARE_DATA with appropriate export and import tags for the platform
*/
#if !defined(WIN32)
-#define SESSION_DECLARE(type) type
-#define SESSION_DECLARE_NONSTD(type) type
-#define SESSION_DECLARE_DATA
+#define SESSION_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define SESSION_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define SESSION_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(SESSION_DECLARE_STATIC)
#define SESSION_DECLARE(type) type __stdcall
#define SESSION_DECLARE_NONSTD(type) type
--- httpd-2.4.6.orig/modules/database/mod_dbd.h
+++ httpd-2.4.6/modules/database/mod_dbd.h
@@ -35,9 +35,9 @@
* DBD_DECLARE_DATA with appropriate export and import tags for the platform
*/
#if !defined(WIN32)
-#define DBD_DECLARE(type) type
-#define DBD_DECLARE_NONSTD(type) type
-#define DBD_DECLARE_DATA
+#define DBD_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define DBD_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define DBD_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(DBD_DECLARE_STATIC)
#define DBD_DECLARE(type) type __stdcall
#define DBD_DECLARE_NONSTD(type) type
--- httpd-2.4.6.orig/modules/filters/mod_xml2enc.h
+++ httpd-2.4.6/modules/filters/mod_xml2enc.h
@@ -25,9 +25,9 @@
/* declarations to deal with WIN32 compile-flag-in-source-code crap */
#if !defined(WIN32)
-#define XML2ENC_DECLARE(type) type
-#define XML2ENC_DECLARE_NONSTD(type) type
-#define XML2ENC_DECLARE_DATA
+#define XML2ENC_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define XML2ENC_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define XML2ENC_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(XML2ENC_DECLARE_STATIC)
#define XML2ENC_DECLARE(type) type __stdcall
#define XML2ENC_DECLARE_NONSTD(type) type
--- httpd-2.4.6.orig/modules/filters/mod_ratelimit.h
+++ httpd-2.4.6/modules/filters/mod_ratelimit.h
@@ -21,9 +21,9 @@
* AP_RL_DECLARE_DATA with appropriate export and import tags for the platform
*/
#if !defined(WIN32)
-#define AP_RL_DECLARE(type) type
-#define AP_RL_DECLARE_NONSTD(type) type
-#define AP_RL_DECLARE_DATA
+#define AP_RL_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define AP_RL_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define AP_RL_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(AP_RL_DECLARE_STATIC)
#define AP_RL_DECLARE(type) type __stdcall
#define AP_RL_DECLARE_NONSTD(type) type
--- httpd-2.4.6.orig/modules/aaa/mod_authz_dbd.h
+++ httpd-2.4.6/modules/aaa/mod_authz_dbd.h
@@ -22,9 +22,9 @@
* AUTHZ_DBD_DECLARE_DATA with appropriate export and import tags
*/
#if !defined(WIN32)
-#define AUTHZ_DBD_DECLARE(type) type
-#define AUTHZ_DBD_DECLARE_NONSTD(type) type
-#define AUTHZ_DBD_DECLARE_DATA
+#define AUTHZ_DBD_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define AUTHZ_DBD_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define AUTHZ_DBD_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(AUTHZ_DBD_DECLARE_STATIC)
#define AUTHZ_DBD_DECLARE(type) type __stdcall
#define AUTHZ_DBD_DECLARE_NONSTD(type) type
--- httpd-2.4.6.orig/include/httpd.h
+++ httpd-2.4.6/include/httpd.h
@@ -341,7 +341,7 @@ extern "C" {
* by modules. Its purpose is to allow us to add attributes that
* particular platforms or compilers require to every exported function.
*/
-# define AP_DECLARE(type) type
+# define AP_DECLARE(type) __attribute__ ((visibility ("default"))) type
#endif
#ifndef AP_DECLARE_NONSTD
@@ -352,20 +352,20 @@ extern "C" {
* which use varargs or are used via indirect function call. This
* is to accomodate the two calling conventions in windows dlls.
*/
-# define AP_DECLARE_NONSTD(type) type
+# define AP_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
#endif
#ifndef AP_DECLARE_DATA
-# define AP_DECLARE_DATA
+# define AP_DECLARE_DATA __attribute__ ((visibility ("default")))
#endif
#ifndef AP_MODULE_DECLARE
-# define AP_MODULE_DECLARE(type) type
+# define AP_MODULE_DECLARE(type) __attribute__ ((visibility ("default"))) type
#endif
#ifndef AP_MODULE_DECLARE_NONSTD
-# define AP_MODULE_DECLARE_NONSTD(type) type
+# define AP_MODULE_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
#endif
#ifndef AP_MODULE_DECLARE_DATA
-# define AP_MODULE_DECLARE_DATA
+# define AP_MODULE_DECLARE_DATA __attribute__ ((visibility ("default")))
#endif
/**
--- httpd-2.4.6.orig/include/util_ldap.h
+++ httpd-2.4.6/include/util_ldap.h
@@ -66,9 +66,9 @@
* and import tags for the platform
*/
#if !defined(WIN32)
-#define LDAP_DECLARE(type) type
-#define LDAP_DECLARE_NONSTD(type) type
-#define LDAP_DECLARE_DATA
+#define LDAP_DECLARE(type) __attribute__ ((visibility ("default"))) type
+#define LDAP_DECLARE_NONSTD(type) __attribute__ ((visibility ("default"))) type
+#define LDAP_DECLARE_DATA __attribute__ ((visibility ("default")))
#elif defined(LDAP_DECLARE_STATIC)
#define LDAP_DECLARE(type) type __stdcall
#define LDAP_DECLARE_NONSTD(type) type
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package installation-images for openSUSE:Factory checked in at 2013-09-02 14:52:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/installation-images (Old)
and /work/SRC/openSUSE:Factory/.installation-images.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "installation-images"
Changes:
--------
--- /work/SRC/openSUSE:Factory/installation-images/installation-images.changes 2013-08-29 07:05:11.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.installation-images.new/installation-images.changes 2013-09-02 14:52:10.000000000 +0200
@@ -1,0 +2,12 @@
+Mon Sep 2 14:45:34 CEST 2013 - snwint(a)suse.de
+
+- samba package changes
+- On non intel architectures biosdevname doesn't exist.
+
+-------------------------------------------------------------------
+Fri Aug 30 11:43:12 CEST 2013 - snwint(a)suse.de
+
+- avoid /usr/src/packages else linuxrc thinks it's in test mode
+- ppc64: use classic initrd and linux, we use yaboot anyway for netboot now
+
+-------------------------------------------------------------------
Old:
----
installation-images-14.11.tar.bz2
New:
----
installation-images-14.13.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ installation-images.spec ++++++
--- /var/tmp/diff_new_pack.5ePyO5/_old 2013-09-02 14:52:12.000000000 +0200
+++ /var/tmp/diff_new_pack.5ePyO5/_new 2013-09-02 14:52:12.000000000 +0200
@@ -382,9 +382,9 @@
Summary: Installation Image Files
License: GPL-2.0+
Group: Metapackages
-Version: 14.11
+Version: 14.13
Release: 0
-Source: installation-images-14.11.tar.bz2
+Source: installation-images-14.13.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define _binary_payload w.ufdio
++++++ installation-images-14.11.tar.bz2 -> installation-images-14.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.11/VERSION new/installation-images-14.13/VERSION
--- old/installation-images-14.11/VERSION 2013-08-27 16:36:03.000000000 +0200
+++ new/installation-images-14.13/VERSION 2013-09-02 14:45:30.000000000 +0200
@@ -1 +1 @@
-14.11
+14.13
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.11/bin/mk_ppc_installation-images_bootbinaries.sh new/installation-images-14.13/bin/mk_ppc_installation-images_bootbinaries.sh
--- old/installation-images-14.11/bin/mk_ppc_installation-images_bootbinaries.sh 2013-08-09 16:06:04.000000000 +0200
+++ new/installation-images-14.13/bin/mk_ppc_installation-images_bootbinaries.sh 2013-08-30 11:15:21.000000000 +0200
@@ -50,60 +50,62 @@
gzip -fcv9 /boot/vmlinux-*-default > $CD1/suseboot/linux64.gz
fi
-if [ -f /lib/lilo/chrp/mkzimage_cmdline ] ; then
- mkdir -pv $CD1/ppc/netboot
- cp -Lpfv /lib/lilo/chrp/mkzimage_cmdline $CD1/ppc/netboot
- chmod 0755 $CD1/ppc/netboot/mkzimage_cmdline
-fi
-#
-if test "$do_64" = "true" ; then
- /bin/mkzimage \
- --board chrp \
- --vmlinux /boot/vmlinux-*-default \
- --initrd $bdir/initrd-default \
- --output $CD1/suseboot/inst64
-#
- if test "42" = "false" ; then
- /bin/mkzimage \
- --board iseries \
- --vmlinux /boot/vmlinux-*-default \
- --initrd $bdir/initrd-default \
- --output $CD1/ISERIES64
- fi
-#
-fi
-#
-if test "$do_32" = "true" ; then
- /bin/mkzimage \
- --board chrp \
- --vmlinux /boot/vmlinux-*-default \
- --initrd $bdir/initrd \
- --output $CD1/suseboot/inst32
-#
- if test "42" = "false" ; then
- /bin/mkzimage \
- --board prep \
- --vmlinux /boot/vmlinux-*-default \
- --initrd $bdir/initrd \
- --cmdline 'sysrq=1 nosshkey minmemory=0 MemYaSTText=0 quiet ' \
- --output $CD1/boot/ppc/zImage.prep.initrd
- fi
-#
- if test "42" = "false" ; then
- /bin/mkzimage \
- --board pmaccoff \
- --vmlinux /boot/vmlinux-*-default \
- --initrd $bdir/initrd-ppc32_pmac_coff \
- --output $CD1/boot/ppc/install-pmaccoff
-#
- /bin/mkzimage \
- --board pmaccoff \
- --vmlinux /boot/vmlinux-*-default \
- --output $CD1/boot/ppc/vmlinux-pmaccoff
+#deprecate inst{32,64}. We use yaboot anyway, it doens't make sense
+#to embed yaboot
+#if [ -f /lib/lilo/chrp/mkzimage_cmdline ] ; then
+# mkdir -pv $CD1/ppc/netboot
+# cp -Lpfv /lib/lilo/chrp/mkzimage_cmdline $CD1/ppc/netboot
+# chmod 0755 $CD1/ppc/netboot/mkzimage_cmdline
+#fi
+#
+#if test "$do_64" = "true" ; then
+# /bin/mkzimage \
+# --board chrp \
+# --vmlinux /boot/vmlinux-*-default \
+# --initrd $bdir/initrd-default \
+# --output $CD1/suseboot/inst64
+#
+# if test "42" = "false" ; then
+# /bin/mkzimage \
+# --board iseries \
+# --vmlinux /boot/vmlinux-*-default \
+# --initrd $bdir/initrd-default \
+# --output $CD1/ISERIES64
+# fi
+#
+#fi
+#
+#if test "$do_32" = "true" ; then
+# /bin/mkzimage \
+# --board chrp \
+# --vmlinux /boot/vmlinux-*-default \
+# --initrd $bdir/initrd \
+# --output $CD1/suseboot/inst32
+#
+# if test "42" = "false" ; then
+# /bin/mkzimage \
+# --board prep \
+# --vmlinux /boot/vmlinux-*-default \
+# --initrd $bdir/initrd \
+# --cmdline 'sysrq=1 nosshkey minmemory=0 MemYaSTText=0 quiet ' \
+# --output $CD1/boot/ppc/zImage.prep.initrd
+# fi
+#
+# if test "42" = "false" ; then
+# /bin/mkzimage \
+# --board pmaccoff \
+# --vmlinux /boot/vmlinux-*-default \
+# --initrd $bdir/initrd-ppc32_pmac_coff \
+# --output $CD1/boot/ppc/install-pmaccoff
+##
+# /bin/mkzimage \
+# --board pmaccoff \
+# --vmlinux /boot/vmlinux-*-default \
+# --output $CD1/boot/ppc/vmlinux-pmaccoff
#
- fi
+# fi
#
-fi
+#fi
#
we_dont_smoke_that_stuff=`echo ${BUILD_DISTRIBUTION_NAME} | sed -e 's@SUSE@SuSE@;s@LINUX@Linux@'`
#
@@ -144,13 +146,16 @@
do
cat >> $CD1/suseboot/yaboot.cnf <<EOF
-image[${i}bit]=inst${i}
+image[${i}bit]=linux${i}.gz
+ initrd=initrd${i}
label=install
append="quiet sysrq=1 insmod=sym53c8xx insmod=ipr "
-image[${i}bit]=inst${i}
+image[${i}bit]=linux${i}.gz
+ initrd=initrd${i}
label=slp
append="quiet sysrq=1 install=slp "
-image[${i}bit]=inst${i}
+image[${i}bit]=linux${i}.gz
+ initrd=initrd${i}
label=rescue
append="quiet sysrq=1 rescue=1 "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.11/changelog new/installation-images-14.13/changelog
--- old/installation-images-14.11/changelog 2013-08-27 16:36:06.000000000 +0200
+++ new/installation-images-14.13/changelog 2013-09-02 14:45:32.000000000 +0200
@@ -1,4 +1,15 @@
-2013-08-27: HEAD
+2013-09-02: HEAD
+ - samba package changes
+ - Merge pull request #1 from k0da/master
+ - Add biosdevname if available
+ - Add biosdevname if available
+ - On non intel architectures biosdevname doesn't exist.
+
+2013-08-30: 14.12
+ - avoid /usr/src/packages else linuxrc thinks it's in test mode
+ - Use clasic initrd and linux. We use yaboot anyway for netboot now.
+
+2013-08-27: 14.11
- convert root image - part 2
- add biosdevname (bnc #810478)
- packages we ignore need not exist
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.11/data/initrd/initrd.file_list new/installation-images-14.13/data/initrd/initrd.file_list
--- old/installation-images-14.11/data/initrd/initrd.file_list 2013-08-27 11:01:23.000000000 +0200
+++ new/installation-images-14.13/data/initrd/initrd.file_list 2013-09-02 12:12:25.000000000 +0200
@@ -91,7 +91,11 @@
terminfo-base: ignore
update-alternatives: ignore
-biosdevname:
+samba-libs: nodeps
+ /usr/lib*/samba/libreplace.so
+ /usr/lib*/samba/libwinbind-client.so
+
+?biosdevname:
cpio:
curl:
device-mapper:
@@ -450,8 +454,8 @@
:
-# remove, ehm, things...
-r /usr/share/doc /usr/share/info /usr/share/man /usr/share/locale /var/adm/fillup-templates
+# remove files we don't want to show up at all
+r /usr/share/{doc,info,locale,man} /usr/src/packages /var/adm/fillup-templates
# historical static device nodes
x devz /devz
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.11/data/rescue/rescue.file_list new/installation-images-14.13/data/rescue/rescue.file_list
--- old/installation-images-14.11/data/rescue/rescue.file_list 2013-08-27 15:41:28.000000000 +0200
+++ new/installation-images-14.13/data/rescue/rescue.file_list 2013-09-02 13:48:45.000000000 +0200
@@ -114,7 +114,6 @@
procps:
psmisc:
reiserfs:
-rpm:
rsh:
sdparm:
sed:
@@ -140,6 +139,18 @@
xfsprogs:
xz:
+samba-libs: nodeps
+ /usr/lib*/samba/libreplace.so
+ /usr/lib*/samba/libwinbind-client.so
+
+rpm:
+ /bin
+ /usr/bin
+ /{usr,var}/lib/rpm
+ /usr/lib*/librpm*.so.*
+r /usr/lib/rpm/rpm{get,put}text
+r /usr/bin/rpmqpack
+
gawk:
/usr/bin/gawk
s gawk usr/bin/awk
@@ -280,9 +291,8 @@
# create it now (see filesystem package above)
d /sys
-# remove, ehm, things...
-r /usr/share/doc /usr/share/info /usr/share/man /usr/share/locale /var/adm/fillup-templates
-# r /run/*
+# remove files we don't want to show up at all
+r /usr/share/{doc,info,locale,man} /usr/src/packages /var/adm/fillup-templates
# we better have one...
e touch etc/sysconfig/kernel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.11/data/root/root.file_list new/installation-images-14.13/data/root/root.file_list
--- old/installation-images-14.11/data/root/root.file_list 2013-08-27 15:08:12.000000000 +0200
+++ new/installation-images-14.13/data/root/root.file_list 2013-08-30 11:34:03.000000000 +0200
@@ -126,7 +126,6 @@
procps:
psmisc:
reiserfs:
-rpm:
screen:
sed:
sg3_utils:
@@ -174,6 +173,13 @@
# rubygem-nokogiri:
+rpm:
+ /bin
+ /etc
+ /usr/bin
+ /usr/lib*
+ r /usr/lib*/rpm-plugins/sepolicy.so
+
gawk:
/usr/bin/gawk
s gawk usr/bin/awk
@@ -628,8 +634,8 @@
e mkfontscale usr/share/fonts/truetype
e mkfontdir usr/share/fonts/truetype
-# remove, ehm, things...
-r /usr/share/doc /usr/share/info /usr/share/man /var/adm/fillup-templates
+# remove files we don't want to show up at all
+r /usr/share/{doc,info,man} /usr/src/packages /var/adm/fillup-templates
# don't mess with mtab (from aaa_base postin ATM)
r etc/mtab
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package virtuoso for openSUSE:12.3:Update checked in at 2013-09-02 13:35:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3:Update/virtuoso (Old)
and /work/SRC/openSUSE:12.3:Update/.virtuoso.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "virtuoso"
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
New:
----
_link
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
<link package='virtuoso.1959' cicount='copy' />
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package os-prober for openSUSE:12.3:Update checked in at 2013-09-02 13:34:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3:Update/os-prober (Old)
and /work/SRC/openSUSE:12.3:Update/.os-prober.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "os-prober"
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
--- /var/tmp/diff_new_pack.YgAF4P/_old 2013-09-02 13:34:46.000000000 +0200
+++ /var/tmp/diff_new_pack.YgAF4P/_new 2013-09-02 13:34:46.000000000 +0200
@@ -1 +1 @@
-<link package='os-prober.1600' cicount='copy' />
+<link package='os-prober.1953' cicount='copy' />
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package os-prober.1953 for openSUSE:12.3:Update checked in at 2013-09-02 13:34:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3:Update/os-prober.1953 (Old)
and /work/SRC/openSUSE:12.3:Update/.os-prober.1953.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "os-prober.1953"
Changes:
--------
New Changes file:
--- /dev/null 2013-07-23 23:44:04.804033756 +0200
+++ /work/SRC/openSUSE:12.3:Update/.os-prober.1953.new/os-prober.changes 2013-09-02 13:34:44.000000000 +0200
@@ -0,0 +1,85 @@
+-------------------------------------------------------------------
+Fri Aug 16 15:45:01 UTC 2013 - arvidjaar(a)gmail.com
+
+- update 05efi
+ * accept EFI partition on IMSM MD array (bnc#818871)
+ * fix DOS partition table detection
+
+-------------------------------------------------------------------
+Fri Apr 5 16:33:28 UTC 2013 - arvidjaar(a)gmail.com
+
+- add os-prober-linux-secure-boot.patch (bnc#810912)
+ * recognize linuxefi/initrdefi too
+
+-------------------------------------------------------------------
+Sun Mar 3 16:06:32 UTC 2013 - arvidjaar(a)gmail.com
+
+- 05efi - accept FUSE as valid filesystem too (bnc#807190)
+
+-------------------------------------------------------------------
+Fri Feb 8 15:16:13 UTC 2013 - arvidjaar(a)gmail.com
+
+- os-prober-usr_lib-detection.patch - fix detection of linux distro
+ which moved /lib to /usr/lib (e.g. Fedora)
+
+-------------------------------------------------------------------
+Sat Jan 19 19:12:20 UTC 2013 - arvidjaar(a)gmail.com
+
+- os-prober-1.49-grub2-mount.patch (bnc#767272)
+ * In openSUSE grub-mount is called grub2-mount
+
+-------------------------------------------------------------------
+Sat Jan 19 13:41:59 UTC 2013 - arvidjaar(a)gmail.com
+
+- fix os-prober-1.49-fix-grub2.cfg-parsing.patch (bnc#799457)
+ * initrd was missing
+ * entries sometimes were not emitted
+
+-------------------------------------------------------------------
+Wed Jan 16 18:09:08 UTC 2013 - arvidjaar(a)gmail.com
+
+- add os-prober-1.49-skip-LVM2_member.patch (bnc#798604)
+ * do not try to mount LVM2 PV
+
+-------------------------------------------------------------------
+Tue Jan 8 07:14:53 UTC 2013 - arvidjaar(a)gmail.com
+
+- add os-prober-1.49-fix-grub2.cfg-parsing.patch (bnc#796919)
+
+-------------------------------------------------------------------
+Fri Jan 4 11:18:01 UTC 2013 - arvidjaar(a)gmail.com
+
+- add support for chainloading another UEFI bootloader (bnc#775610)
+ * 05efi - top level driver to search ESP
+ * efi-20microsoft - support Microsoft UEFI bootloader
+ * efi-10elilo - support ELILO UEFI bootloader (Agnelo de la Crotche)
+- skip legacy Microsoft bootloader on UEFI (bnc#775610)
+
+-------------------------------------------------------------------
+Mon Dec 19 11:13:44 UTC 2011 - aj(a)suse.de
+
+- Clarify license.
+
+-------------------------------------------------------------------
+Thu Dec 8 12:23:12 UTC 2011 - aj(a)suse.de
+
+- Update to 1.49:
+ * MeeGo detection support
+ * Bugfixes
+
+-------------------------------------------------------------------
+Thu Dec 8 11:18:49 UTC 2011 - coolo(a)suse.com
+
+- this seems to be "GPL" as it was understood 2004, so guessing
+ GPL-2.0+
+
+-------------------------------------------------------------------
+Fri Sep 30 15:53:26 UTC 2011 - uli(a)suse.com
+
+- cross-build fix: use %__cc macro
+
+-------------------------------------------------------------------
+Tue Jul 12 13:08:58 UTC 2011 - aj(a)suse.de
+
+- Create new package.
+
New:
----
05efi
COPYING-note.txt
efi-10elilo
efi-20microsoft
os-prober-1.49-fix-grub2.cfg-parsing.patch
os-prober-1.49-grub2-mount.patch
os-prober-1.49-skip-LVM2_member.patch
os-prober-SUSE.patch
os-prober-linux-secure-boot.patch
os-prober-newnsdirfix.patch
os-prober-skip-MS-legacy-on-UEFI.patch
os-prober-usr_lib-detection.patch
os-prober.changes
os-prober.spec
os-prober_1.49.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ os-prober.spec ++++++
#
# spec file for package os-prober
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: os-prober
Version: 1.49
Release: 0
Summary: Probes disks on the system for installed operating systems
License: GPL-2.0+
Group: System/Boot
Url: http://kitenet.net/~joey/code/os-prober/
Source0: http://ftp.de.debian.org/debian/pool/main/o/os-prober/%{name}_%{version}.ta…
Source1: COPYING-note.txt
Source2: 05efi
Source3: efi-20microsoft
Source4: efi-10elilo
# move newns binary outside of os-prober subdirectory, so that debuginfo
# can be automatically generated for it
Patch0: os-prober-newnsdirfix.patch
# PATCH-FIX-OPENSUSE: Fix spelling of SUSE aj(a)suse.de
Patch1: os-prober-SUSE.patch
# PATCH-FIX-OPENSUSE: Skip legacy Microsoft bootloader on UEFI [bnc#775610]
Patch2: os-prober-skip-MS-legacy-on-UEFI.patch
# PATCH-FIX-OPENSUSE: Fix parsing of grub.cfg [bnc#796919]
Patch3: os-prober-1.49-fix-grub2.cfg-parsing.patch
# PATCH-FIX-OPENSUSE: Do not try to mount LVM2 PV [bnc#798604]
Patch4: os-prober-1.49-skip-LVM2_member.patch
# PATCH-FIX-OPENSUSE: Use correct name for grub2-mount
Patch5: os-prober-1.49-grub2-mount.patch
# PATCH-FIX-OPENSUSE: Detect distributions which moved /lib to /usr/lib
Patch6: os-prober-usr_lib-detection.patch
# PATCH-FIX-OPENSUSE: Detect linux secure boot entries too (bnc#810912)
Patch7: os-prober-linux-secure-boot.patch
Requires: /bin/grep
Requires: /bin/sed
Requires: /sbin/modprobe
Requires: coreutils
Requires: dmraid
Requires: lvm2
Requires: udev
Requires: util-linux
%description
This package detects other OSes available on a system and outputs the results
in a generic machine-readable format. Support for new OSes and Linux
distributions can be added easily.
%prep
%setup -q -n %{name}
cp %SOURCE1 .
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%build
make %{?_smp_mflags} CC="%__cc" CFLAGS="%{optflags}"
%install
install -m 0755 -d %{buildroot}%{_bindir}
install -m 0755 -d %{buildroot}%{_localstatedir}/lib/%{name}
install -m 0755 -p os-prober linux-boot-prober %{buildroot}%{_bindir}
install -m 0755 -Dp newns %{buildroot}%{_libexecdir}/newns
install -m 0644 -Dp common.sh %{buildroot}%{_datadir}/%{name}/common.sh
%ifarch m68k
ARCH=m68k
%endif
%ifarch ppc ppc64
ARCH=powerpc
%endif
%ifarch sparc sparc64
ARCH=sparc
%endif
%ifarch %{ix86} x86_64
ARCH=x86
%endif
for probes in os-probes os-probes/mounted os-probes/init \
linux-boot-probes linux-boot-probes/mounted; do
install -m 755 -d %{buildroot}%{_libexecdir}/$probes
cp -a $probes/common/* %{buildroot}%{_libexecdir}/$probes
if [ -e "$probes/$ARCH" ]; then
cp -a $probes/$ARCH/* %{buildroot}%{_libexecdir}/$probes
fi
done
if [ "$ARCH" = x86 ]; then
install -m 755 -p os-probes/mounted/powerpc/20macosx \
%{buildroot}%{_libexecdir}/os-probes/mounted
install -m 755 -p %SOURCE2 %{buildroot}%{_libexecdir}/os-probes/mounted
install -m 755 -d %{buildroot}%{_libexecdir}/os-probes/mounted/efi
install -m 755 -p %SOURCE3 \
%{buildroot}%{_libexecdir}/os-probes/mounted/efi/20microsoft
install -m 755 -p %SOURCE4 \
%{buildroot}%{_libexecdir}/os-probes/mounted/efi/10elilo
fi
%files
%defattr(-,root,root,-)
%doc README TODO debian/copyright debian/changelog COPYING-note.txt
%{_bindir}/*
%{_libexecdir}/linux-boot-probes
%{_libexecdir}/newns
%{_libexecdir}/os-probes
%{_datadir}/%{name}
%{_localstatedir}/lib/%{name}
%changelog
++++++ 05efi ++++++
#!/bin/sh
# Detects all UEFI bootloaders on EFI System Partition
. /usr/share/os-prober/common.sh
partition="$1"
mpoint="$2"
type="$3"
# This file is for UEFI platform only
if [ ! -d /sys/firmware/efi ]; then
debug "Not on UEFI platform"
exit 1
fi
# Weed out stuff that doesn't apply to us
case "$type" in
vfat) debug "$1 is a FAT32 partition" ;;
msdos) debug "$1 is a FAT16 partition" ;;
fuse|fuseblk) debug "$1 is a FUSE partition" ;; # might be GRUB
*) debug "$1 is $type partition: exiting"; exit 1 ;;
esac
if type udevadm > /dev/null 2>&1; then
udevinfo () {
udevadm info "$@"
}
fi
if type udevinfo > /dev/null 2>&1; then
eval "$(udevinfo -q property -n "$partition" | grep -E '^(MD_CONTAINER|ID_PART_ENTRY_(TYPE|SCHEME))=')"
debug "$partition container is '$MD_CONTAINER'"
# Skip virtual devices unless they are known SW-RAID
if udevinfo -q path -n $partition | grep -q /virtual/; then
# Check for Intel Matrix array
if [ -n "$MD_CONTAINER" ]; then
eval "$(udevinfo -q property -n "$MD_CONTAINER" | grep -E '^MD_METADATA=')"
debug "$MD_CONTAINER metadata is '$MD_METADATA'"
fi
if [ "$MD_METADATA" = imsm ]; then
debug "$partition is on IMSM array"
else
debug "$1 is virtual device: exiting"
exit 1
fi
fi
debug "$partition partition scheme is $ID_PART_ENTRY_SCHEME"
debug "$partition partition type is $ID_PART_ENTRY_TYPE"
if [ -z "$ID_PART_ENTRY_TYPE" -o -z "$ID_PART_ENTRY_SCHEME" -o \
\( "$ID_PART_ENTRY_SCHEME" != gpt -a "$ID_PART_ENTRY_SCHEME" != dos \) -o \
\( "$ID_PART_ENTRY_SCHEME" = gpt -a "$ID_PART_ENTRY_TYPE" != c12a7328-f81f-11d2-ba4b-00a0c93ec93b \) -o \
\( "$ID_PART_ENTRY_SCHEME" = dos -a "$ID_PART_ENTRY_TYPE" != 0xef \) ]; then
debug "$partition is not a ESP partition: exiting"
exit 1
fi
else
debug "udevinfo and udevadm missing - cannot check partition type"
fi
efi=$(item_in_dir efi "$mpoint")
if [ -z "$efi" ]; then
debug "$mpoint does not have /EFI directory: exiting"
exit 1
fi
ret=1
for test in /usr/lib/os-probes/mounted/efi/*; do
debug "running subtest $test"
if [ -f "$test" ] && [ -x "$test" ]; then
entry=$("$test" "$mpoint/$efi")
if [ -n "$entry" ]; then
debug "bootloader $entry found by subtest $test"
ret=0
result "${partition}@/$efi/${entry}:efi"
fi
fi
done
exit $ret
++++++ COPYING-note.txt ++++++
Version 1.50 of os-prober contains a license clarification, the
license of the package is GPL-2+, see for example the following commits:
http://anonscm.debian.org/gitweb/?p=d-i/os-prober.git;a=commitdiff;h=249d08…
http://anonscm.debian.org/gitweb/?p=d-i/os-prober.git;a=commit;h=25024daecc…
http://anonscm.debian.org/gitweb/?p=d-i/os-prober.git;a=commit;h=cc0ce8e5ec…
The copyright file reads as of 2011-12-19:
The majority of code in os-prober is Copyright 2004-2011 by Joshua
Kwan, Joey Hess, Christian Perrier, Colin Watson and Otavio Salvador.
This is licensed under the terms of the GNU GPL, either version 2 or,
at your option, any later version.
Some portions of os-prober by other contributors has an unclear license
of "GNU GPL", with the version not specified.
On Debian systems, a copy of the GNU General Public License is available in
/usr/share/common-licenses/GPL.
++++++ efi-10elilo ++++++
#!/bin/sh
# Detects ELILO bootloader on a EFI System Partition
. /usr/share/os-prober/common.sh
efi="$1"
found=
elilo=`find $1 -name "elilo.efi"`
if [ -n "$elilo" ]; then
bdir=`dirname $elilo`
bdir=`basename $bdir`
vendor=$(echo $bdir | sed 's|SuSE|SUSE|')
long="${vendor} ELILO Boot Manager"
short="ELILO"
path=${bdir}/elilo.efi
found=true
fi
if [ -n "$found" ]; then
label="$(count_next_label "$short")"
result "${path}:${long}:${label}"
fi
exit 0
++++++ efi-20microsoft ++++++
#!/bin/sh
# Detects Microsoft bootloader on a EFI System Partition
. /usr/share/os-prober/common.sh
efi="$1"
found=
for microsoft in $(item_in_dir microsoft "$efi"); do
for boot in $(item_in_dir boot "$efi/$microsoft"); do
bcd=$(item_in_dir bcd "$efi/$microsoft/$boot")
bootmgfw=$(item_in_dir bootmgfw.efi "$efi/$microsoft/$boot")
if [ -n "$bcd" -a -n "$bootmgfw" ]; then
long="Windows Boot Manager"
short=Windows
path="$microsoft/$boot/$bootmgfw"
found=true
break
fi
done
done
if [ -n "$found" ]; then
label="$(count_next_label "$short")"
result "${path}:${long}:${label}"
fi
exit 0
++++++ os-prober-1.49-fix-grub2.cfg-parsing.patch ++++++
From: Andrey Borzenkov <arvidjaar(a)gmail.com>
Subject: fix parsing GRUB2 grub.cfg
References: bnc#796919
Fix several problems in parsing of grub.cfg by
linux-boot-probes/mounted/40grub2
1. It looked for /boot/grub/grub.cfg only. Make it check for
/boot/grub2-efi/grub.cfg, /boot/grub2/grub.cfg, /boot/grub/grub.cfg in
that order
2. Parsing of menuentry was completely broken. It is (near to) impossible
to parse full fledged shell quoted strings with a couple of sed expressions.
Replace it with ``eval "set -- $line"'', which should handle quoting
automatically. It still may fail for manually created grub.cfg though.
3. It checked for literal "(on /dev/.*)" to filter out menu entries
added by another os-prober on target system. But grub.cfg now includes
TRANSLATED strings, so this check will fail if grub.cfg was created in
non-English locale. Relax check and make it '(.* /dev/.*)'. It should
work as long as grub.cfg was created by grub-mkconfig.
Index: os-prober/linux-boot-probes/mounted/common/40grub2
===================================================================
--- os-prober.orig/linux-boot-probes/mounted/common/40grub2
+++ os-prober/linux-boot-probes/mounted/common/40grub2
@@ -34,33 +34,43 @@ parse_grub_menu () {
title=""
ignore_item=0
- while read line; do
+ # grub.cfg is written in shell like language that can contain
+ # arbitrary quoting. We need to extract second word according to
+ # normal quoting rules. Unfortunately, sticking ``eval $line'' for
+ # every line will try to interpret it according to shell
+ # grammar and error out for something as simple as "xxx; then".
+ # So the following is using it only on known cases.
+ # FIXME: it will fail if ``menuentry'' is not the first word on line.
+ # case patterns below include SPACE and TAB.
+ while read -r line; do
debug "parsing: $line"
- set -f
- set -- $line
- set +f
- case "$1" in
- menuentry)
+ line="$(printf "%s" "$line" | sed -e 's/^[[:space:]]*//')"
+ case "$line" in
+ menuentry[" "]*)
entry_result
- shift 1
- # The double-quoted string is the title.
- title="$(echo "$@" | sed -n 's/[^"]*"\(.*\)".*/\1/p' | sed 's/://g')"
- if [ -z "$title" ]; then
- # ... or single-quoted? The
- # unescaping here is odd because the
- # 'set' above has already eaten
- # backslash-escapes.
- title="$(echo "$@" | sed -n "s/[^']*'\(.*\)'.*/\1/p" | sed "s/'''/'/; s/://g")"
- fi
+ set -f
+ eval "set -- $line"
+ set +f
+ title="$2"
if [ -z "$title" ]; then
ignore_item=1
- elif echo "$title" | grep -q '(on /dev/[^)]*)$'; then
+ # Currently GRUB2 puts translated strings
+ # in grub.cfg, so checking for verbatim
+ # (on /dev/.*) will fail if target grub.cfg
+ # was created in non-English locale
+ elif echo "$title" | grep -q '(.* /dev/[^)]*)$'; then
log "Skipping entry '$title':"
log "appears to be an automatic reference taken from another menu.lst"
ignore_item=1
fi
;;
- linux)
+ linux[" "]*)
+ # And here we do NOT want to strip off
+ # existing quting, which will be transferred
+ # verbatim in new grub.cfg
+ set -f
+ set -- $line
+ set +f
# Hack alert: sed off any (hdn,n) but
# assume the kernel is on the same
# partition.
@@ -73,7 +83,13 @@ parse_grub_menu () {
kernel="/boot$kernel"
fi
;;
- initrd)
+ initrd[" "]*)
+ # And here we do NOT want to strip off
+ # existing quting, which will be transferred
+ # verbatim in new grub.cfg
+ set -f
+ set -- $line
+ set +f
initrd="$(echo "$2" | sed 's/(.*)//')"
# Initrd same.
if [ "$partition" != "$bootpart" ]; then
@@ -89,11 +105,20 @@ parse_grub_menu () {
entry_result
}
-if [ -e "$mpoint/boot/grub/grub.cfg" ] && \
+grubcfg=
+if [ -e "$mpoint/boot/grub2-efi/grub.cfg" ]; then
+ grubcfg="$mpoint/boot/grub2-efi/grub.cfg"
+elif [ -e "$mpoint/boot/grub2/grub.cfg" ]; then
+ grubcfg="$mpoint/boot/grub2/grub.cfg"
+elif [ -e "$mpoint/boot/grub/grub.cfg" ]; then
+ grubcfg="$mpoint/boot/grub/grub.cfg"
+fi
+
+if [ -n "$grubcfg" ] && \
([ ! -e "$mpoint/boot/grub/menu.lst" ] || \
- [ "$mpoint/boot/grub/grub.cfg" -nt "$mpoint/boot/grub/menu.lst" ]); then
- debug "parsing grub.cfg"
- parse_grub_menu "$mpoint" "$partition" "$bootpart" < "$mpoint/boot/grub/grub.cfg"
+ [ "$grubcfg" -nt "$mpoint/boot/grub/menu.lst" ]); then
+ debug "parsing $grubcfg"
+ parse_grub_menu "$mpoint" "$partition" "$bootpart" < "$grubcfg"
fi
if [ "$found_item" = 0 ]; then
++++++ os-prober-1.49-grub2-mount.patch ++++++
From: Andrey Borzenkov <arvidjaar(a)gmail.com>
Subject: replace grub-mount with grub2-mount everywhere
References: bnc#799457, bnc#767272
We use grub2-mount, not grub-mount. As shown in bnc#799457,
grub2-mount may access filesystem even when kernel driver
will refuse it. os-prober makes devices read-only to prevent
accidental damage, so kernel driver fails if log replay is needed
but cannot be performed.
This may likely fix bnc#767272
Index: os-prober/common.sh
===================================================================
--- os-prober.orig/common.sh
+++ os-prober/common.sh
@@ -259,8 +259,8 @@ linux_mount_boot () {
debug "found boot partition $1 for linux system on $partition, but cannot map to existing device"
else
debug "found boot partition $bootpart for linux system on $partition"
- if which grub-mount >/dev/null 2>&1 && \
- grub-mount "$boottomnt" "$tmpmnt/boot" 2>/dev/null; then
+ if which grub2-mount >/dev/null 2>&1 && \
+ grub2-mount "$boottomnt" "$tmpmnt/boot" 2>/dev/null; then
mounted=1
else
ro_partition "$boottomnt"
Index: os-prober/linux-boot-probes/common/50mounted-tests
===================================================================
--- os-prober.orig/linux-boot-probes/common/50mounted-tests
+++ os-prober/linux-boot-probes/common/50mounted-tests
@@ -34,8 +34,8 @@ if [ ! -d "$tmpmnt" ]; then
fi
mounted=
-if which grub-mount >/dev/null 2>&1 && \
- grub-mount "$partition" "$tmpmnt" 2>/dev/null; then
+if which grub2-mount >/dev/null 2>&1 && \
+ grub2-mount "$partition" "$tmpmnt" 2>/dev/null; then
mounted=1
type=fuseblk
else
Index: os-prober/os-probes/common/50mounted-tests
===================================================================
--- os-prober.orig/os-probes/common/50mounted-tests
+++ os-prober/os-probes/common/50mounted-tests
@@ -49,8 +49,8 @@ if [ ! -d "$tmpmnt" ]; then
fi
mounted=
-if which grub-mount >/dev/null 2>&1 && \
- grub-mount "$partition" "$tmpmnt" 2>/dev/null; then
+if which grub2-mount >/dev/null 2>&1 && \
+ grub2-mount "$partition" "$tmpmnt" 2>/dev/null; then
debug "mounted using GRUB"
mounted=1
type=fuseblk
Index: os-prober/os-probes/init/common/10filesystems
===================================================================
--- os-prober.orig/os-probes/init/common/10filesystems
+++ os-prober/os-probes/init/common/10filesystems
@@ -3,7 +3,7 @@
set +e # ignore errors from modprobe
FILESYSTEMS='ext2 ext3 ext4 reiserfs xfs jfs msdos vfat ntfs minix hfs hfsplus qnx4 ufs btrfs'
-# fuse is needed to make grub-mount work.
+# fuse is needed to make grub2-mount work.
FILESYSTEMS="$FILESYSTEMS fuse"
# The Ubuntu kernel udebs put a number of filesystem modules in
# fs-{core,secondary}-modules. It's fairly cheap to check for these too.
++++++ os-prober-1.49-skip-LVM2_member.patch ++++++
Index: os-prober/os-probes/common/50mounted-tests
===================================================================
--- os-prober.orig/os-probes/common/50mounted-tests
+++ os-prober/os-probes/common/50mounted-tests
@@ -15,6 +15,9 @@ elif [ "$types" = swap ]; then
elif [ "$types" = crypto_LUKS ]; then
debug "$1 is a LUKS partition; skipping"
exit 0
+elif [ "$types" = LVM2_member ]; then
+ debug "$1 is a LVM2 partition; skipping"
+ exit 0
elif [ "$types" = ntfs ]; then
if type ntfs-3g >/dev/null 2>&1; then
types='ntfs-3g ntfs'
++++++ os-prober-SUSE.patch ++++++
Index: os-prober/os-probes/mounted/common/90linux-distro
===================================================================
--- os-prober.orig/os-probes/mounted/common/90linux-distro
+++ os-prober/os-probes/mounted/common/90linux-distro
@@ -80,7 +80,7 @@ if ls "$dir"/lib*/ld*.so* >/dev/null 2>/
short="RedHat"
long="$(cat "$dir/etc/redhat-release")"
elif [ -e "$dir/etc/SuSE-release" ]; then
- short="SuSE"
+ short="SUSE"
long="$(head -n 1 "$dir/etc/SuSE-release")"
elif [ -e "$dir/etc/gentoo-release" ]; then
short="Gentoo"
++++++ os-prober-linux-secure-boot.patch ++++++
From: Andrey Borzenkov <arvidjaar(a)gmail.com>
Subject: detect linuxefi/initrdefi secure bootloaders too
Reference: bnc#810912
Recognize initrdefi and linuxefi too. Whether linux/initrd or
linuxefi/initrdefi will be emitted is controlled by SECURE_BOOT
setting in /etc/sysconfig/bootloader.
Index: os-prober/linux-boot-probes/mounted/common/40grub2
===================================================================
--- os-prober.orig/linux-boot-probes/mounted/common/40grub2
+++ os-prober/linux-boot-probes/mounted/common/40grub2
@@ -64,7 +64,7 @@ parse_grub_menu () {
ignore_item=1
fi
;;
- linux[" "]*)
+ linux[" "]*|linuxefi[" "]*)
# And here we do NOT want to strip off
# existing quting, which will be transferred
# verbatim in new grub.cfg
@@ -83,7 +83,7 @@ parse_grub_menu () {
kernel="/boot$kernel"
fi
;;
- initrd[" "]*)
+ initrd[" "]*|initrdefi[" "]*)
# And here we do NOT want to strip off
# existing quting, which will be transferred
# verbatim in new grub.cfg
++++++ os-prober-newnsdirfix.patch ++++++
diff -up os-prober-1.46/common.sh.newnsmove os-prober-1.46/common.sh
--- os-prober-1.46/common.sh.newnsmove 2011-04-10 05:30:57.000000000 +0430
+++ os-prober-1.46/common.sh 2011-05-04 04:08:09.603020037 +0430
@@ -1,5 +1,5 @@
newns () {
- [ "$OS_PROBER_NEWNS" ] || exec /usr/lib/os-prober/newns "$0" "$@"
+ [ "$OS_PROBER_NEWNS" ] || exec /usr/lib/newns "$0" "$@"
}
cleanup_tmpdir=false
++++++ os-prober-skip-MS-legacy-on-UEFI.patch ++++++
From: Andrey Borzenkov <arvidjaar(a)gmail.com>
Date: Fri Jan 4 09:46:56 UTC 2013
Subject: skip legacy Microsoft bootloader on UEFI system
References: bnc#775610
Patch-Mainline: no
Sometimes Windows installs both legacy BIOS and UEFI bootloaders.
Attempt to chainload legacy bootloader on UEFI system fails. Skip
adding legacy bootloader in this case.
TODO: this probably should be implemented as runtime check. But it
does the right thing in majority of cases. If mixed legacy/UEFI
boot will be used frequently, it can be revisited.
Index: os-prober/os-probes/mounted/x86/20microsoft
===================================================================
--- os-prober.orig/os-probes/mounted/x86/20microsoft
+++ os-prober/os-probes/mounted/x86/20microsoft
@@ -7,6 +7,12 @@ partition="$1"
mpoint="$2"
type="$3"
+# This script looks for legacy BIOS bootloaders only. Skip if running UEFI
+if [ -d /sys/firmware/efi ]; then
+ debug "Skipping legacy bootloaders on UEFI system"
+ exit 1
+fi
+
# Weed out stuff that doesn't apply to us
case "$type" in
ntfs|ntfs-3g) debug "$1 is a NTFS partition" ;;
++++++ os-prober-usr_lib-detection.patch ++++++
From: Andrey Borzenkov <arvidjaar(a)gmail.com>
Subject: fix detection of distributions with /lib => /usr/lib symlink
Upstream: yes
grub-mount does not implement symbolic links, so distributions
that replaced /lib with /usr/lib were not detected. Check both
/lib and /usr/lib. Patch taken from upstream version.
Affected is e.g. Fedora 18.
Index: os-prober/os-probes/mounted/common/90linux-distro
===================================================================
--- os-prober.orig/os-probes/mounted/common/90linux-distro
+++ os-prober/os-probes/mounted/common/90linux-distro
@@ -13,7 +13,7 @@ type="$3"
# better. Make sure this test has a high number so that more accurate tests
# can come first.
# TODO: look for ld-linux.so on arches that have it
-if ls "$dir"/lib*/ld*.so* >/dev/null 2>/dev/null; then
+if (ls "$dir"/lib*/ld*.so* || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then
if [ -e "$dir/etc/debian_version" ]; then
short="Debian"
long="$(printf "Debian GNU/Linux (%s)\n" "$(cat "$dir/etc/debian_version")")"
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package hyper-v for openSUSE:12.3:Update checked in at 2013-09-02 13:32:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3:Update/hyper-v (Old)
and /work/SRC/openSUSE:12.3:Update/.hyper-v.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hyper-v"
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
New:
----
_link
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
<link package='hyper-v.1955' cicount='copy' />
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package hyper-v for openSUSE:12.2:Update checked in at 2013-09-02 13:32:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.2:Update/hyper-v (Old)
and /work/SRC/openSUSE:12.2:Update/.hyper-v.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hyper-v"
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
--- /var/tmp/diff_new_pack.avqCXu/_old 2013-09-02 13:32:38.000000000 +0200
+++ /var/tmp/diff_new_pack.avqCXu/_new 2013-09-02 13:32:38.000000000 +0200
@@ -1 +1 @@
-<link package='hyper-v.1085' cicount='copy' />
+<link package='hyper-v.1955' cicount='copy' />
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package hyper-v.1955 for openSUSE:12.2:Update checked in at 2013-09-02 13:32:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.2:Update/hyper-v.1955 (Old)
and /work/SRC/openSUSE:12.2:Update/.hyper-v.1955.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hyper-v.1955"
Changes:
--------
New Changes file:
--- /dev/null 2013-07-23 23:44:04.804033756 +0200
+++ /work/SRC/openSUSE:12.2:Update/.hyper-v.1955.new/hyper-v.changes 2013-09-02 13:32:36.000000000 +0200
@@ -0,0 +1,281 @@
+-------------------------------------------------------------------
+Mon Aug 12 16:56:08 CEST 2013 - ohering(a)suse.de
+
+- Skip restart_on_update with old hyper-v.rpms while old
+ kernel is running (bnc#770763)
+
+-------------------------------------------------------------------
+Wed Aug 7 19:04:35 CEST 2013 - ohering(a)suse.de
+
+- cache FQDN in kvp_daemon to avoid timeouts (bnc#828714)
+- use full nlmsghdr in netlink_send
+- correct payload size in netlink_send
+- use single send+recv buffer
+- log errors to syslog in kvp_set_ip_info
+- check return value of system in hv_kvp_daemon
+- in kvp_set_ip_info free mac_addr right after usage
+- check return value of daemon to fix compiler warning.
+
+-------------------------------------------------------------------
+Thu Aug 1 14:21:57 CEST 2013 - ohering(a)suse.de
+
+- Fix send/recv buffer allocation (bnc#828714)
+
+-------------------------------------------------------------------
+Wed Jul 24 10:18:34 CEST 2013 - ohering(a)suse.de
+
+- set BOOTPROTO=static if any IPADDR/IP6ADDR was passed to
+ hv_set_ifconfig and dhcp is disabled
+
+-------------------------------------------------------------------
+Mon Jul 15 16:16:06 CEST 2013 - ohering(a)suse.de
+
+- update hv_kvp_daemon (merge 0783d72fa from v3.9-rc1)
+ Fix how ifcfg-* file is created
+
+-------------------------------------------------------------------
+Mon Jul 15 15:24:00 CEST 2013 - ohering(a)suse.de
+
+- update hv_kvp_daemon (changes up to 3.11-rc1):
+ Improve error logging in KVP daemon.
+ Fix file descriptor leaks
+ Check retrun value of strchr call
+ Check return value of poll call
+ Check return value of setsockopt call
+ daemon should check type of received Netlink msg
+ daemon setsockopt should use options macros
+ daemon should subscribe only to CN_KVP_IDX group
+
+-------------------------------------------------------------------
+Mon Jul 15 12:04:05 CEST 2013 - ohering(a)suse.de
+
+- Fix a bug in IPV6 subnet enumeration (bnc#828714)
+
+-------------------------------------------------------------------
+Fri Mar 22 16:56:57 CET 2013 - ohering(a)suse.de
+
+- build hv_kvp_daemon with -D_GNU_SOURCE to get O_CLOEXEC
+
+-------------------------------------------------------------------
+Fri Mar 22 16:19:38 CET 2013 - ohering(a)suse.de
+
+- update hv_kvp_daemon
+ Use CLOEXEC when opening kvp_pool files
+ Fix permissions of created directory and files
+ Fix string types
+
+-------------------------------------------------------------------
+Tue Nov 27 11:19:32 CET 2012 - ohering(a)suse.de
+
+- update hv_set_ifconfig, use single index for static ipv4/ipv6 [bnc#790469]
+
+-------------------------------------------------------------------
+Sun Nov 25 17:50:40 CET 2012 - ohering(a)suse.de
+
+- update hv_set_ifconfig further to work with our ifcfg [bnc#790469]
+
+-------------------------------------------------------------------
+Thu Nov 22 18:14:12 CET 2012 - ohering(a)suse.de
+
+- update hv_get_dhcp_info to work with our ifcfg [bnc#790469]
+- remove cat usage from hv_get_dns_info
+- add quoting to hv_set_ifconfig to make it more robust
+
+-------------------------------------------------------------------
+Mon Nov 12 17:18:25 CET 2012 - ohering(a)suse.de
+
+- remove code to build kmp, it was not enabled because the
+ drivers are now in kernel since a long time. [bnc#676890]
+
+-------------------------------------------------------------------
+Thu Nov 8 14:30:05 CET 2012 - ohering(a)suse.de
+
+- Netlink source address validation allows DoS [bnc#791605, CVE-2012-5532]
+ bugfix for recvfrom check from bnc#761200
+
+-------------------------------------------------------------------
+Fri Oct 26 17:13:40 CEST 2012 - ohering(a)suse.de
+
+- update hv_set_ifconfig to work with our ifcfg
+
+-------------------------------------------------------------------
+Sat Oct 13 11:40:30 CEST 2012 - ohering(a)suse.de
+
+- update hv_kvp_daemon
+ Return the full kernel version
+ Don't return loopback addresses
+
+-------------------------------------------------------------------
+Thu Oct 4 15:14:05 CEST 2012 - ohering(a)suse.de
+
+- bump to version 4
+- update kv_kvp_daemon to 3.7-rc1 state [fate#314441]
+ support KVP IP Injection, helper scripts go to /usr/lib/hyper-v/bin:
+ hv_get_dhcp_info, hv_get_dns_info, hv_set_ifconfig
+- remove usage of absolute paths in runlevel script
+
+-------------------------------------------------------------------
+Tue Sep 4 14:55:38 CEST 2012 - ohering(a)suse.de
+
+- remove restart_on_update in postun section
+ the daemon can not be restarted at this point, and the new daemon
+ may not be 100 percent compatible with the currently running
+ kernel [bnc#770763]
+
+-------------------------------------------------------------------
+Wed May 16 20:44:36 CEST 2012 - ohering(a)suse.de
+
+- check origin of netlink messages, use recvfrom() [bnc#761200, CVE-2012-2669]
+
+-------------------------------------------------------------------
+Wed May 2 12:13:03 CEST 2012 - ohering(a)suse.de
+
+- update insserv part, see comments in OBS submit request #112701
+
+-------------------------------------------------------------------
+Tue Mar 27 08:50:43 CEST 2012 - ohering(a)suse.de
+
+- add kvptest.ps1.txt to docs, a PowerShell script to verify KVP
+
+-------------------------------------------------------------------
+Mon Mar 26 19:05:48 CEST 2012 - ohering(a)suse.de
+
+- update hv_kvp_daemon to 3.4-rc1 state
+ use a copy linux/hyperv.h to compile the daemon
+
+-------------------------------------------------------------------
+Thu Dec 8 17:46:21 CET 2011 - ohering(a)suse.de
+
+- do not package modprobe.conf rule in main package
+ prevents loading of ata_piix which is required for cdrom access
+
+-------------------------------------------------------------------
+Fri Nov 18 21:49:57 CET 2011 - ohering(a)suse.de
+
+- add Supplements to install package if dmi matches [bnc#731198]
+
+-------------------------------------------------------------------
+Thu Sep 1 18:51:03 CEST 2011 - ohering(a)suse.de
+
+- disable hyper-v-kmp
+ hv_storvsc handles now IDE and SCSI disks and ata_piix is
+ compiled into the kernel in SLE12, so the modprobe.conf rules
+ have no meaning anymore
+
+-------------------------------------------------------------------
+Tue Jul 26 21:24:25 CEST 2011 - ohering(a)suse.de
+
+- update hv_kvp_daemon: Cleanup kvp_get_domain_name(). If
+ getaddrinfo() fails, deal with it properly (this can happen if no
+ IP address has been assigned). Also, don't specify a specific
+ service in the call to getaddrinfo() to make this code as generic
+ as possible.
+
+-------------------------------------------------------------------
+Sun Jul 24 17:22:41 CEST 2011 - ohering(a)suse.de
+
+- update hv_kvp_daemon: The current win7 host does not like it when
+ we return the complete kernel release information. Conform to
+ what the host expects.
+
+-------------------------------------------------------------------
+Fri Jun 17 15:41:33 CEST 2011 - ohering(a)suse.de
+
+- update preun, stop_on_removal requires an argument
+
+-------------------------------------------------------------------
+Fri Jun 17 11:09:30 CEST 2011 - ohering(a)suse.de
+
+- remove get_release_number.sh, which was added by accident
+- bump version number to 2
+
+-------------------------------------------------------------------
+Fri Jun 17 10:58:42 CEST 2011 - ohering(a)suse.de
+
+- catch errors from daemon()
+
+-------------------------------------------------------------------
++++ 84 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:12.2:Update/.hyper-v.1955.new/hyper-v.changes
New:
----
hyper-v.changes
hyper-v.include.linux.hyperv.h
hyper-v.init.sh
hyper-v.kvptest.ps1.txt
hyper-v.spec
hyper-v.tools.hv.hv_get_dhcp_info.sh
hyper-v.tools.hv.hv_get_dns_info.sh
hyper-v.tools.hv.hv_kvp_daemon.c
hyper-v.tools.hv.hv_set_ifconfig.sh
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ hyper-v.spec ++++++
#
# spec file for package hyper-v
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define hv_kvp_daemon hv_kvp_daemon
Name: hyper-v
ExclusiveArch: %ix86 x86_64
PreReq: %insserv_prereq
Summary: Microsoft Hyper-V tools
License: GPL-2.0
Group: System/Kernel
Supplements: modalias(dmi*:svn*MicrosoftCorporation*:pn*VirtualMachine*:rn*VirtualMachine*)
Supplements: modalias(pci:v00001414d00005353sv*sd*bc*sc*i*)
Url: http://www.kernel.org
# Arbitrary version number
Version: 4
Release: 0
Source5: hyper-v.kvptest.ps1.txt
Source9: hyper-v.include.linux.hyperv.h
Source10: hyper-v.tools.hv.hv_kvp_daemon.c
Source11: hyper-v.init.sh
Source20: hyper-v.tools.hv.hv_get_dhcp_info.sh
Source21: hyper-v.tools.hv.hv_get_dns_info.sh
Source22: hyper-v.tools.hv.hv_set_ifconfig.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This package contains the Microsoft Hyper-V tools.
%prep
%setup -Tc
cp -avL %{S:5} kvptest.ps1.txt
cp -vL %{S:9} %{hv_kvp_daemon}.h
cp -vL %{S:10} %{hv_kvp_daemon}.c
%build
sed -i~ '/#include <linux.hyperv.h>/d' %{hv_kvp_daemon}.c
gcc \
$RPM_OPT_FLAGS \
-Wno-unused-variable \
-Wno-pointer-sign \
-D_GNU_SOURCE \
-g \
%{hv_kvp_daemon}.c \
-include %{hv_kvp_daemon}.h \
-DCN_KVP_IDX=0x9 \
-DCN_KVP_VAL=0x1 \
-o %{hv_kvp_daemon}
%install
mkdir -p $RPM_BUILD_ROOT/usr/sbin
install -m755 %{hv_kvp_daemon} $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT/usr/lib/%{name}/bin
cp -avL %{S:20} $RPM_BUILD_ROOT/usr/lib/%{name}/bin/hv_get_dhcp_info
cp -avL %{S:21} $RPM_BUILD_ROOT/usr/lib/%{name}/bin/hv_get_dns_info
cp -avL %{S:22} $RPM_BUILD_ROOT/usr/lib/%{name}/bin/hv_set_ifconfig
chmod 755 $RPM_BUILD_ROOT/usr/lib/%{name}/bin/*
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install -m755 %{S:11} $RPM_BUILD_ROOT/etc/init.d/%{hv_kvp_daemon}
ln -sfvbn ../../etc/init.d/%{hv_kvp_daemon} $RPM_BUILD_ROOT/usr/sbin/rc%{hv_kvp_daemon}
%files
%defattr (-,root,root)
%doc kvptest.ps1.txt
/etc/init.d/%{hv_kvp_daemon}
/usr/sbin/rc%{hv_kvp_daemon}
/usr/sbin/%{hv_kvp_daemon}
/usr/lib/%{name}
%post
board_vendor=
product_name=
if pushd /sys/class/dmi/id > /dev/null 2>/dev/null
then
if test -r board_vendor
then
board_vendor="`cat board_vendor`"
fi
if test -r product_name
then
product_name="`cat product_name`"
fi
popd > /dev/null
fi
if test "${board_vendor}" = "Microsoft Corporation" -a "${product_name}" = "Virtual Machine"
then
echo "Enabling %{hv_kvp_daemon} on '${product_name}' from '${board_vendor}'"
%{insserv_force_if_yast %{hv_kvp_daemon}}
fi
%preun
%stop_on_removal %{hv_kvp_daemon}
%postun
# no restart on update because the daemon can not be restarted
%insserv_cleanup
%changelog
++++++ hyper-v.include.linux.hyperv.h ++++++
++++ 1154 lines (skipped)
++++++ hyper-v.init.sh ++++++
#!/bin/sh
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
#
### BEGIN INIT INFO
# Provides: hv_kvp_daemon
# Required-Start: $null
# Should-Start: $syslog $remote_fs $time
# Required-Stop: $null
# Should-Stop: $syslog $remote_fs $time
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: hv_kvp_daemon provides info to the host
# Description: Start hv_kvp_daemon to allow the host to query this guest
### END INIT INFO
# Check for missing binaries (stale symlinks should not happen)
# Note: Special treatment of stop for LSB conformance
HV_KVP_BIN=/usr/sbin/hv_kvp_daemon
test -x $HV_KVP_BIN || { echo "$HV_KVP_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
. /etc/rc.status
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting Hyper-V KVP daemon "
# The service can not be restarted
# IF the currently running kernel is too old, the new daemon is started
# anyway. Due to a flaw in the old kernel-user protocol the kernel
# will flood /var/log/messages with messages like:
# "hv_utils: KVP: user-mode registering done."
# This is also caused by old hyper-v.rpms which have a restart command
# in their post install script. Catch those old kernels and avoid the
# flood, which will easily fill the root partition during an upgrade.
case "`uname -r`" in
2.*) rc_failed 3 ;;
3.0.13-*) rc_failed 3 ;;
3.0.26-*) rc_failed 3 ;;
3.0.31-*) rc_failed 3 ;;
3.0.34-*) rc_failed 3 ;;
3.0.38-*) rc_failed 3 ;;
3.0.42-*) rc_failed 3 ;;
*)
env PATH=/usr/lib/hyper-v/bin:$PATH \
startproc $HV_KVP_BIN
;;
esac
rc_status -v
;;
stop)
echo -n "Shutting down Hyper-V KVP daemon "
killproc -TERM $HV_KVP_BIN
rc_status -v
;;
try-restart|condrestart)
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
force-reload)
echo -n "Reload service Hyper-V KVP daemon "
$0 try-restart
rc_status
;;
reload)
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for service Hyper-V KVP daemon "
checkproc $HV_KVP_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
rc_exit
++++++ hyper-v.kvptest.ps1.txt ++++++
# Windows PowerShell script to test Key Value Pair functionality
#
# http://blogs.msdn.com/b/virtual_pc_guy/archive/2008/11/18/hyper-v-script-lo…
#
# Per default execution of scripts is disabled.
# http://technet.microsoft.com/en-us/library/ee176949.aspx
# The command 'Set-ExecutionPolicy RemoteSigned' will enable it.
#
# Filter for parsing XML data
filter Import-CimXml
{
# Create new XML object from input
$CimXml = [Xml]$_
$CimObj = New-Object -TypeName System.Object
# Iterate over the data and pull out just the value name and data for each entry
foreach ($CimProperty in $CimXml.SelectNodes("/INSTANCE/PROPERTY[@NAME='Name']"))
{
$CimObj | Add-Member -MemberType NoteProperty -Name $CimProperty.NAME -Value $CimProperty.VALUE
}
foreach ($CimProperty in $CimXml.SelectNodes("/INSTANCE/PROPERTY[@NAME='Data']"))
{
$CimObj | Add-Member -MemberType NoteProperty -Name $CimProperty.NAME -Value $CimProperty.VALUE
}
# Display output
$CimObj
}
# Prompt for the Hyper-V Server to use
$HyperVServer = Read-Host "Specify the Hyper-V Server to use (enter '.' for the local computer)"
# Prompt for the virtual machine to use
$VMName = Read-Host "Specify the name of the virtual machine"
# Get the virtual machine object
$query = "Select * From Msvm_ComputerSystem Where ElementName='" + $VMName + "'"
$Vm = gwmi -namespace root\virtualization -query $query -computername $HyperVServer
# Get the KVP Object
$query = "Associators of {$Vm} Where AssocClass=Msvm_SystemDevice ResultClass=Msvm_KvpExchangeComponent"
$Kvp = gwmi -namespace root\virtualization -query $query -computername $HyperVServer
Write-Host
Write-Host "Guest KVP information for" $VMName
# Filter the results
$Kvp.GuestIntrinsicExchangeItems | Import-CimXml
++++++ hyper-v.tools.hv.hv_get_dhcp_info.sh ++++++
#!/bin/bash
# This script retrieves the DHCP state of a given interface.
# In the interest of keeping the KVP daemon code free of distro specific
# information; the kvp daemon code invokes this external script to gather
# DHCP setting for the specific interface.
#
# Input: Name of the interface
#
# Output: The script prints the string "Enabled" to stdout to indicate
# that DHCP is enabled on the interface. If DHCP is not enabled,
# the script prints the string "Disabled" to stdout.
#
# Each Distro is expected to implement this script in a distro specific
# fashion. For instance on Distros that ship with Network Manager enabled,
# this script can be based on the Network Manager APIs for retrieving DHCP
# information.
if_file="/etc/sysconfig/network/ifcfg-$1"
dhcp=$(grep -- '^BOOTPROTO=.*dhcp' "$if_file" 2>/dev/null)
if [ "$dhcp" != "" ];
then
echo "Enabled"
else
echo "Disabled"
fi
++++++ hyper-v.tools.hv.hv_get_dns_info.sh ++++++
#!/bin/bash
# This script parses /etc/resolv.conf to retrive DNS information.
# In the interest of keeping the KVP daemon code free of distro specific
# information; the kvp daemon code invokes this external script to gather
# DNS information.
# This script is expected to print the nameserver values to stdout.
# Each Distro is expected to implement this script in a distro specific
# fashion. For instance on Distros that ship with Network Manager enabled,
# this script can be based on the Network Manager APIs for retrieving DNS
# entries.
if test -r /etc/resolv.conf
then
awk -- '/^nameserver/ { print $2 }' /etc/resolv.conf
fi
++++++ hyper-v.tools.hv.hv_kvp_daemon.c ++++++
++++ 1744 lines (skipped)
++++++ hyper-v.tools.hv.hv_set_ifconfig.sh ++++++
#!/bin/bash
#
# In the interest of keeping the KVP daemon code free of distro specific
# information; the kvp daemon code invokes this external script to configure
# the interface.
#
# The only argument to this script is the configuration file that is to
# be used to configure the interface.
#
# Here is the format of the ip configuration file:
#
# HWADDR=macaddr
# DEVICE=interface name
# BOOTPROTO=<protocol> (where <protocol> is "dhcp" if DHCP is configured
# or "none" if no boot-time protocol should be used)
#
# IPADDR0=ipaddr1
# IPADDR1=ipaddr2
# IPADDRx=ipaddry (where y = x + 1)
#
# NETMASK0=netmask1
# NETMASKx=netmasky (where y = x + 1)
#
# GATEWAY=ipaddr1
# GATEWAYx=ipaddry (where y = x + 1)
#
# DNSx=ipaddrx (where first DNS address is tagged as DNS1 etc)
#
# IPV6 addresses will be tagged as IPV6ADDR, IPV6 gateway will be
# tagged as IPV6_DEFAULTGW and IPV6 NETMASK will be tagged as
# IPV6NETMASK.
#
# The host can specify multiple ipv4 and ipv6 addresses to be
# configured for the interface. Furthermore, the configuration
# needs to be persistent. A subsequent GET call on the interface
# is expected to return the configuration that is set via the SET
# call.
#
cfg=$1
if ! test -f "${cfg}"
then
: expect configuration datafile as first argument
exit 1
fi
# send subshell output to syslog
(
f=/etc/sysconfig/network/scripts/functions
if test -f ${f}
then
. ${f}
else
echo "MISSING ${f}"
exit 1
fi
# remove known config variables from environment
unset HWADDR
unset BOOTPROTO
unset DEVICE
unset ${!IPADDR*}
unset ${!NETMASK*}
unset ${!GATEWAY*}
unset ${!IPV6ADDR*}
unset ${!IPV6NETMASK*}
unset ${!IPV6_DEFAULTGW*}
unset ${!DNS*}
. "$1"
#
if test -z "${DEVICE}"
then
echo "Missing DEVICE= in ${cfg}"
exit 1
fi
#
t_ifcfg=`mktemp`
t_ifroute=`mktemp`
_exit() {
rm -f "${t_ifcfg}" "${t_ifroute}"
}
trap _exit EXIT
#
if test -z "${t_ifcfg}" || test -z "${t_ifroute}"
then
exit 1
fi
#
# Create ifcfg-* file
(
echo "STARTMODE=auto"
#
if test -n "${HWADDR}"
then
: # ignore HWADDR, it just repeats the existing MAC value
fi
#
if test "${BOOTPROTO}" = "dhcp"
then
echo "BOOTPROTO=dhcp"
elif test -n "${!IPADDR*}${!IPV6ADDR*}"
then
echo "BOOTPROTO=static"
fi
# single index for all ipv4 and ipv6 adresses in final ifcfg file
i=0
idx=""
# loop through all ipv4 adresses
for var in ${!IPADDR*}
do
index=${var#IPADDR}
pfx=
# find corresponding NETMASK variable
eval nm=\$NETMASK${index}
# if specified, calculate prefix
if test -n "${nm}"
then
pfx=`mask2pfxlen "${nm}" 2>/dev/null`
fi
# if not specified, force prefix
if test -z "${pfx}"
then
pfx="32"
fi
# construct actual value
eval val=\$IPADDR${index}
# write config variable
echo "IPADDR${idx}='${val}/${pfx}'"
idx="_$((++i))"
done
# loop through all ipv6 adresses
for var in ${!IPV6ADDR*}
do
index=${var#IPV6ADDR}
# find corresponding IPV6NETMASK variable
eval pfx=\$IPV6NETMASK${index}
# if not specified, force prefix
if test -z "${pfx}"
then
pfx=128
fi
# construct actual value
eval val=\$IPV6ADDR${index}
# write config variable
echo "IPADDR${idx}='${val}/${pfx}'"
idx="_$((++i))"
done
) >> "${t_ifcfg}"
# Create ifroute-* file
(
if test -n "${GATEWAY}"
then
echo "default $GATEWAY - $DEVICE"
fi
if test -n "${IPV6_DEFAULTGW}"
then
echo "default $IPV6_DEFAULTGW - $DEVICE"
fi
) >> "${t_ifroute}"
# Only a single default gateway is supported
unset GATEWAY IPV6_DEFAULTGW
if test -n "${!GATEWAY*}${!IPV6_DEFAULTGW*}"
then
echo "WARNING: multiple gateways not supported: ${!GATEWAY*} ${!IPV6_DEFAULTGW*}"
fi
# collect DNS info
_DNS_=
for var in ${!DNS*}
do
eval val=\$${var}
if test -n "${_DNS_}"
then
_DNS_="${_DNS_} ${val}"
else
_DNS_=${val}
fi
done
#
echo "$0: working on network interface ifcfg-${DEVICE}"
cp -fb ${t_ifcfg} "/etc/sysconfig/network/ifcfg-${DEVICE}"
cp -fb ${t_ifroute} "/etc/sysconfig/network/ifroute-${DEVICE}"
if test -w /etc/sysconfig/network/config
then
sed -i "s@^NETCONFIG_DNS_STATIC_SERVERS=.*@NETCONFIG_DNS_STATIC_SERVERS='$_DNS_'@" /etc/sysconfig/network/config
netconfig update -m dns
fi
ifdown "${DEVICE}"
ifup "${DEVICE}"
) 2>&1 | logger -t "${0##*/}[$PPID / $$]"
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package systemd for openSUSE:12.3:Update checked in at 2013-09-02 13:30:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3:Update/systemd (Old)
and /work/SRC/openSUSE:12.3:Update/.systemd.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "systemd"
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
--- /var/tmp/diff_new_pack.HW3Gzj/_old 2013-09-02 13:30:19.000000000 +0200
+++ /var/tmp/diff_new_pack.HW3Gzj/_new 2013-09-02 13:30:19.000000000 +0200
@@ -1 +1 @@
-<link package='systemd.1776' cicount='copy' />
+<link package='systemd.1957' cicount='copy' />
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package systemd.1957 for openSUSE:12.3:Update checked in at 2013-09-02 13:30:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3:Update/systemd.1957 (Old)
and /work/SRC/openSUSE:12.3:Update/.systemd.1957.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "systemd.1957"
Changes:
--------
New Changes file:
--- /dev/null 2013-07-23 23:44:04.804033756 +0200
+++ /work/SRC/openSUSE:12.3:Update/.systemd.1957.new/systemd-mini.changes 2013-09-02 13:30:17.000000000 +0200
@@ -0,0 +1,2781 @@
+-------------------------------------------------------------------
+Tue Aug 27 08:07:26 UTC 2013 - rmilasan(a)suse.com
+
+- Replace RUN with IMPORT in 80-drivers.rules (bnc#836569).
+ update: 1028-rules-drivers-always-call-kmod-even-when-a-driver-is.patch
+
+-------------------------------------------------------------------
+Mon Aug 26 11:23:54 UTC 2013 - rmilasan(a)suse.com
+
+- rules: drivers - always call kmod, even when a driver is bound to
+ the device (bnc#836569).
+ add: 1028-rules-drivers-always-call-kmod-even-when-a-driver-is.patch
+
+-------------------------------------------------------------------
+Wed Jun 12 13:05:20 UTC 2013 - fcrozat(a)suse.com
+
+- Add allow-nuking-of-symlinks.patch: allow removal of some
+ specific symlinks created when enabling services (bnc#808144).
+
+-------------------------------------------------------------------
+Thu May 30 15:56:47 CEST 2013 - fcrozat(a)suse.com
+
+- Update
+ 0001-service-Fix-dependencies-added-when-parsing-insserv..patch
+ to fix potential memory corruption (bnc#820454).
+- Add sysctl-handle-boot-sysctl.conf-kernel_release.patch: ensure
+ /boot/sysctl.conf-<kernel_release> is handled (bnc#809420).
+- Update logind-nvidia-acl.diff to apply ACL to /dev/nvidia*
+ (bnc#808319).
+
+-------------------------------------------------------------------
+Fri Apr 19 12:40:44 UTC 2013 - fcrozat(a)suse.com
+
+- Update systemctl-options.patch to properly handle
+ SYSTEMCTL_OPTIONS only for systemctl commands.
+
+-------------------------------------------------------------------
+Mon Apr 8 14:51:47 CEST 2013 - fcrozat(a)suse.com
+
+- Add improve-readahead-spinning.patch: improve readahead
+ performance on spinning media with ext4.
+- Add fix-journal-vacuum-logic.patch: fix vacuum logic in journal
+ (bnc#789589).
+- Add fix-lsb-provides.patch: ensure LSB provides are correctly
+ handled if also referenced as dependencies (bnc#809646).
+- Add fix-loopback-mount.patch: ensure udevd is started (and
+ therefore static devices are created) before mounting
+ (bnc#809820).
+- Update systemd-sysv-convert to search services files in new
+ location (bnc#809695).
+- Add logind-nvidia-acl.diff: set ACL on nvidia devices
+ (bnc#808319).
+- Add do-no-isolate-on-fsck-failure.patch: do not turn off services
+ if fsck fails (bnc#812874)
+- Add wait-for-processes-killed.patch: wait for processes killed by
+ SIGTERM before killing them with SIGKILL.
+- Update systemctl-options.patch to only apply SYSTEMCTL_OPTIONS to
+ systemctl command (bnc#801878).
+
+-------------------------------------------------------------------
+Wed Apr 3 07:44:32 UTC 2013 - rmilasan(a)suse.com
+
+- Fixed disabling CapsLock and enabling NumLock (bnc#746595,
+ 0001-handle-disable_caplock-and-compose_table-and-kbd_rat.patch,
+ systemd-numlock-suse.patch).
+
+-------------------------------------------------------------------
+Tue Apr 2 07:34:38 UTC 2013 - rmilasan(a)suse.com
+
+- udev: re-implement network renaming (bnc#809843).
+ add: 1027-udev-always-rename-network.patch
+
+-------------------------------------------------------------------
+Wed Mar 20 10:14:59 UTC 2013 - rmilasan(a)suse.com
+
+- udev: re-add persistent network rules (bnc#809843).
+ add: 1026-re-add-persistent-net.patch
+- rebase all patches, ensure that they apply properly.
+
+-------------------------------------------------------------------
+Thu Feb 21 14:45:12 UTC 2013 - fcrozat(a)suse.com
+
+- Add rbind-mount.patch: handle rbind mount points correctly
+ (bnc#804575).
+
+-------------------------------------------------------------------
+Tue Feb 19 11:20:31 CET 2013 - fcrozat(a)suse.com
+
+- Ensure journal is flushed on disk when systemd-logger is
+ installed for the first time.
+- Add improve-journal-perf.patch: improve journal performance on
+ query.
+- Add support-hybrid-suspend.patch: add support for hybrid suspend.
+- Add forward-to-pmutils.patch: forward suspend/hibernation calls
+ to pm-utils, if installed (bnc#790157).
+
+-------------------------------------------------------------------
+Tue Feb 19 09:51:18 UTC 2013 - rmilasan(a)suse.com
+
+- udev: usb_id: parse only 'size' bytes of the 'descriptors' buffer
+ add: 1024-udev-usb_id-parse-only-size-bytes-of-the-descriptors.patch
+- udev: expose new ISO9660 properties from libblkid
+ add: 1025-udev-expose-new-ISO9660-properties-from-libblkid.patch
+
+-------------------------------------------------------------------
+Mon Feb 18 09:27:05 UTC 2013 - jengelh(a)inai.de
+
+- Create getty(a)tty1.service to restore traditional SUSE behavior
+ of not clearing tty1. (bnc#804158)
+- Better use of find -exec
+
+-------------------------------------------------------------------
+Fri Feb 15 16:04:39 UTC 2013 - fcrozat(a)suse.com
+
+- Add early-sync-shutdown.patch: start sync just when
+ shutdown.target is beginning
+- Update parse-multiline-env-file.patch to better handle continuing
+ lines.
+- Add handle-HOSTNAME.patch: handle /etc/HOSTNAME (bnc#803653).
+- Add systemctl-print-wall-on-if-successful.patch: only print on
+ wall if successful.
+- Add improve-bash-completion.patch: improve bash completion.
+
+-------------------------------------------------------------------
+Fri Feb 15 13:05:19 UTC 2013 - lnussel(a)suse.de
+
+- disable nss-myhostname warning (bnc#783841)
+ => disable-nss-myhostname-warning-bnc-783841.diff
+
+-------------------------------------------------------------------
+Wed Feb 13 11:34:06 UTC 2013 - rmilasan(a)suse.com
+
+- rework patch:
+ 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch
+- udev: use unique names for temporary files created in /dev.
+ add: 1022-udev-use-unique-names-for-temporary-files-created-in.patch
+- cdrom_id: add data track count for bad virtual drive.
+ add: 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch
+
+-------------------------------------------------------------------
+Tue Feb 12 09:16:23 UTC 2013 - rmilasan(a)suse.com
+
+- usb_id: ensure we have a valid serial number as a string (bnc#779493).
+ add: 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch
+- cdrom_id: created links for the default cd/dvd drive (bnc#783054).
+ add: 1021-create-default-links-for-primary-cd_dvd-drive.patch
+
+-------------------------------------------------------------------
+Fri Feb 1 16:27:45 UTC 2013 - fcrozat(a)suse.com
+
+- Add cryptsetup-accept-read-only.patch: accept "read-only" in
+ addition to "readonly" in crypttab
+- Update parse-multiline-env-file.patch to correctly handle
+ commented lines (bnc#793411)
+
+-------------------------------------------------------------------
+Tue Jan 29 13:32:30 UTC 2013 - rmilasan(a)suse.com
+
+- udev: Fix device matching in the accelerometer
+ add: 1019-udev-Fix-device-matching-in-the-accelerometer.patch
+- keymap: add aditional support for some keyboard keys
+ add: 1018-keymap-add-aditional-support.patch
+- journalctl: require argument for --priority
+ add: journalctl-require-argument-for-priority
+- dropped useless patches:
+ libudev-validate-argument-udev_enumerate_new.patch
+ kmod-fix-builtin-typo.patch
+- rename udev-root-symlink.service to systemd-udev-root-symlink.service.
+- fix in udev package missing link in basic.target.wants for
+ systemd-udev-root-symlink.service
+
+-------------------------------------------------------------------
+Mon Jan 28 10:49:21 UTC 2013 - fcrozat(a)suse.com
+
+- Add tmpfiles-X-type.patch: allow to clean directories with
+ removing them.
+- Add systemd-fix-merge-ignore-dependencies.patch: fix merging with
+ --ignore-dependencies waiting for dependencies (bnc#800365).
+- Update systemd-numlock-suse.patch: udev-trigger.service is now
+ called systemd-udev-trigger.service.
+- Add improve-man-environment.patch: improve manpage regarding
+ Environment value.
+
+-------------------------------------------------------------------
+Tue Jan 22 17:02:04 UTC 2013 - fcrozat(a)suse.com
+
+- Add systemctl-options.patch: handle SYSTEMCTL_OPTIONS internaly
+ (bnc#798620).
+- Update crypt-loop-file.patch to correctly detect crypto loop
+ files (bnc#799514).
+- Add journalctl-remove-leftover-message.patch: remove debug
+ message in systemctl.
+- Add job-avoid-recursion-when-cancelling.patch: prevent potential
+ recursion when cancelling a service.
+- Add sysctl-parse-all-keys.patch: ensure sysctl file is fully
+ parsed.
+- Add journal-fix-cutoff-max-date.patch: fix computation of cutoff
++++ 2584 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:12.3:Update/.systemd.1957.new/systemd-mini.changes
New Changes file:
systemd.changes: same change
New:
----
0001-Add-bootsplash-handling-for-password-dialogs.patch
0001-handle-disable_caplock-and-compose_table-and-kbd_rat.patch
0001-service-Fix-dependencies-added-when-parsing-insserv..patch
0001-service-flags-sysv-service-with-detected-pid-as-Rema.patch
1001-Reinstate-TIMEOUT-handling.patch
1002-re-enable-by_path-links-for-ata-devices.patch
1003-rules-create-by-id-scsi-links-for-ATA-devices.patch
1004-udev-netlink-null-rules.patch
1005-udev-fix-sg-autoload-regression.patch
1006-fix-devname-prefix.patch
1007-udevd-add-missing-to-getopt_long-e.patch
1008-udev-path_id-handle-Hyper-V-devices.patch
1009-keymap-Update-the-list-of-Samsung-Series-9-models.patch
1010-keymap-Add-Samsung-700T.patch
1011-libudev-avoid-leak-during-realloc-failure.patch
1012-libudev-do-not-resolve-attr-device-symlinks.patch
1013-libudev-validate-udev-argument-to-udev_enumerate_new.patch
1014-udev-fix-whitespace.patch
1015-udev-properly-handle-symlink-removal-by-change-event.patch
1016-udev-builtin-do-not-fail-builtin-initialization-if-o.patch
1017-udev-use-usec_t-and-now.patch
1018-keymap-add-aditional-support.patch
1019-udev-Fix-device-matching-in-the-accelerometer.patch
1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch
1021-create-default-links-for-primary-cd_dvd-drive.patch
1022-udev-use-unique-names-for-temporary-files-created-in.patch
1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch
1024-udev-usb_id-parse-only-size-bytes-of-the-descriptors.patch
1025-udev-expose-new-ISO9660-properties-from-libblkid.patch
1026-re-add-persistent-net.patch
1027-udev-always-rename-network.patch
1028-rules-drivers-always-call-kmod-even-when-a-driver-is.patch
agetty-overrides-term.patch
allow-nuking-of-symlinks.patch
baselibs.conf
boot.udev
check-for-empty-strings-in-strto-conversions.patch
core-interpret-escaped-semicolon-as-escaped.patch
core-load-fragment-improve-error-message.patch
coredumpctl-fix-crash.patch
crypsetup-generator-state-file-name-in-error-message.patch
crypsetup-handle-nofail.patch
crypt-loop-file.patch
cryptsetup-accept-read-only.patch
cryptsetup-handle-plain.patch
delay-fsck-cryptsetup-after-md-lvm-dmraid.patch
delta-accept-t-option.patch
detect-btrfs-ssd.patch
disable-nss-myhostname-warning-bnc-783841.diff
dm-lvm-after-local-fs-pre-target.patch
do-no-isolate-on-fsck-failure.patch
do-not-make-sockets-dependent-on-lo.patch
early-sync-shutdown.patch
fastboot-forcefsck.patch
fix-bad-mem-access.patch
fix-bad-memory-access.patch
fix-build-glibc217.patch
fix-dbus-crash.patch
fix-debugshell.patch
fix-enable-disable-boot-initscript.patch
fix-journal-vacuum-logic.patch
fix-logind-pty-seat.patch
fix-loopback-mount.patch
fix-lsb-provides.patch
fix-permissions-btmp.patch
fix-potential-bad-mem-access.patch
fix-swap-behaviour-with-symlinks.patch
forward-to-pmutils.patch
fstab-generator-error-message-on-duplicates.patch
fstab-generator-improve-error-message.patch
fstab-generator-properly-detect-bind-mounts.patch
handle-HOSTNAME.patch
handle-root-uses-lang.patch
highlight-ordering-cycle-deletions.patch
hostnamectl-fix-parsing-no-ask-password.patch
hostnamectl-fix-set-hostname-with-no-argument.patch
improve-bash-completion.patch
improve-journal-perf.patch
improve-man-environment.patch
improve-overflow-checks.patch
improve-readahead-spinning.patch
job-avoid-recursion-when-cancelling.patch
journal-fix-cutoff-max-date.patch
journal-send-always-send-syslog_identifier.patch
journalctl-quit-on-io-error.patch
journalctl-remove-leftover-message.patch
journalctl-require-argument-for-priority
libgcrypt.m4
localectl-fix-assertion.patch
localectl-support-systems-without-locale-archive.patch
localfs.service
lock-opensuse.patch
logind-capability-making-seats-without-fb.patch
logind-ignore-non-tty-non-x11-session-on-shutdown.patch
logind-nvidia-acl.diff
macros.systemd
modules_on_boot.patch
mount-efivars.patch
multiple-sulogin.patch
new-lsb-headers.patch
pam-properly-handle-ssh-logins-without-pam-tty-field.patch
parse-multiline-env-file.patch
path-util-fix-potential-crash.patch
pre_checkin.sh
rbind-mount.patch
remount-ro-before-unmount.patch
revert-of-9279749b84cc87c7830280b7895a48bed03c9429.patch
reword-rescue-mode-hints.patch
service-forking-ignore-exit-status-main-process.patch
shutdown-dont-force-mnt-force-on-final-umount.patch
shutdown-ignore-loop-devices-without-backing-file.patch
shutdown-improvements.patch
socket-improve-error-message.patch
socket-verbose-error-message.patch
storage-after-cryptsetup.patch
strv-cleanup-error-path-loops.patch
support-hybrid-suspend.patch
support-suse-clock-sysconfig.patch
support-sysvinit.patch
switch-root-try-pivot-root.patch
sync-on-shutdown.patch
sysctl-handle-boot-sysctl.conf-kernel_release.patch
sysctl-modules.patch
sysctl-parse-all-keys.patch
systemctl-no-assert-on-reboot-without-dbus.patch
systemctl-options.patch
systemctl-print-wall-on-if-successful.patch
systemctl-verbose-message-on-missing-install.patch
systemd-195.tar.xz
systemd-cgls-fix-piping-output.patch
systemd-fix-merge-ignore-dependencies.patch
systemd-insserv_conf
systemd-journald.init
systemd-mini-rpmlintrc
systemd-mini.changes
systemd-mini.spec
systemd-numlock-suse.patch
systemd-rpmlintrc
systemd-sysv-convert
systemd-udev-root-symlink
systemd.changes
systemd.spec
timedated-donot-close-bogus-dbus-connection.patch
tmpfiles-X-type.patch
tty1.patch
var-run-lock.patch
wait-for-processes-killed.patch
write_dev_root_rule
xdm-display-manager.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ systemd-mini.spec ++++++
++++ 1243 lines (skipped)
systemd.spec: same change
++++++ 0001-Add-bootsplash-handling-for-password-dialogs.patch ++++++
>From 81eca00461968aac09f9e8535f4327282698b495 Mon Sep 17 00:00:00 2001
From: Stefan Seyfried <seife+obs(a)b1-systems.com>
Date: Thu, 16 Dec 2010 11:30:17 +0100
Subject: [PATCH] Add bootsplash handling for password dialogs
openSUSE uses bootsplash.org, so add a crude handling for setting the
splash screen to verbose when a password is asked...
---
Index: systemd-195/src/shared/ask-password-api.c
===================================================================
--- systemd-195.orig/src/shared/ask-password-api.c
+++ systemd-195/src/shared/ask-password-api.c
@@ -63,6 +63,9 @@ int ask_password_tty(
bool reset_tty = false;
bool silent_mode = false;
bool dirty = false;
+ bool splash_silent = false;
+ FILE *procsplash = NULL;
+ char *line = NULL;
enum {
POLL_TTY,
POLL_INOTIFY
@@ -106,6 +109,19 @@ int ask_password_tty(
}
reset_tty = true;
+ procsplash = fopen("/proc/splash", "r+");
+ if (procsplash) {
+ getline(&line, &p, procsplash);
+ p = 0; /* reset, just to make sure */
+ if (line &&
+ (strstr(line, "on\n") == line + strlen(line) - 3) &&
+ (strstr(line, "silent") != NULL)) {
+ splash_silent = true;
+ rewind(procsplash);
+ fprintf(procsplash, "verbose\n");
+ fflush(procsplash);
+ }
+ }
}
zero(pollfd);
@@ -240,6 +256,12 @@ finish:
close_nointr_nofail(ttyfd);
}
+ if (splash_silent) { /* only set if procsplash != NULL */
+ rewind(procsplash);
+ fprintf(procsplash, "silent\n");
+ fclose(procsplash);
+ }
+
return r;
}
++++++ 0001-handle-disable_caplock-and-compose_table-and-kbd_rat.patch ++++++
m 5c894bc1e45f7c34bf7fc4ca0d20bf1c3b679bef Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat(a)suse.com>
Date: Thu, 18 Aug 2011 18:28:01 +0200
Subject: [PATCH] handle disable_caplock and compose_table and kbd_rate
---
src/vconsole-setup.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 121 insertions(+), 3 deletions(-)
Index: systemd-195/src/vconsole/vconsole-setup.c
===================================================================
--- systemd-195.orig/src/vconsole/vconsole-setup.c
+++ systemd-195/src/vconsole/vconsole-setup.c
@@ -40,6 +40,7 @@
#include "log.h"
#include "macro.h"
#include "virt.h"
+#include "strv.h"
static bool is_vconsole(int fd) {
unsigned char data[1];
@@ -99,8 +100,8 @@ static int enable_utf8(int fd) {
return r;
}
-static int load_keymap(const char *vc, const char *map, const char *map_toggle, bool utf8, pid_t *_pid) {
- const char *args[8];
+static int load_keymap(const char *vc, const char *map, const char *map_toggle, bool utf8, bool disable_capslock, pid_t *_pid) {
+ const char *args[9];
int i = 0;
pid_t pid;
@@ -119,6 +120,8 @@ static int load_keymap(const char *vc, c
args[i++] = map;
if (map_toggle)
args[i++] = map_toggle;
+ if (disable_capslock)
+ args[i++] = "disable.capslock";
args[i++] = NULL;
pid = fork();
@@ -172,6 +175,101 @@ static int load_font(const char *vc, con
return 0;
}
+#ifdef TARGET_SUSE
+static int load_compose_table(const char *vc, const char *compose_table, pid_t *_pid) {
+ const char *args[1024];
+ int i = 0, j = 0;
+ pid_t pid;
+ char **strv_compose_table = NULL;
+ char *to_free[1024];
+
+ if (isempty(compose_table)) {
+ /* An empty map means no compose table*/
+ *_pid = 0;
+ return 0;
+ }
+
+ args[i++] = KBD_LOADKEYS;
+ args[i++] = "-q";
+ args[i++] = "-C";
+ args[i++] = vc;
+
+ strv_compose_table = strv_split(compose_table, WHITESPACE);
+ if (strv_compose_table) {
+ bool compose_loaded = false;
+ bool compose_clear = false;
+ char **name;
+ char *arg;
+
+ STRV_FOREACH (name, strv_compose_table) {
+ if (streq(*name,"-c") || streq(*name,"clear")) {
+ compose_clear = true;
+ continue;
+ }
+ if (!compose_loaded) {
+ if (compose_clear)
+ args[i++] = "-c";
+ }
+ asprintf(&arg, "compose.%s",*name);
+ compose_loaded = true;
+ args[i++] = to_free[j++] = arg;
+
+ }
+ strv_free(strv_compose_table);
+ }
+ args[i++] = NULL;
+
+ if ((pid = fork()) < 0) {
+ log_error("Failed to fork: %m");
+ return -errno;
+ } else if (pid == 0) {
+ execv(args[0], (char **) args);
+ _exit(EXIT_FAILURE);
+ }
+
+ *_pid = pid;
+
+ for (i=0 ; i < j ; i++)
+ free (to_free[i]);
+
+ return 0;
+}
+
+static int set_kbd_rate(const char *vc, const char *kbd_rate, const char *kbd_delay, pid_t *_pid) {
+ const char *args[7];
+ int i = 0;
+ pid_t pid;
+
+ if (isempty(kbd_rate) && isempty(kbd_delay)) {
+ *_pid = 0;
+ return 0;
+ }
+
+ args[i++] = "/bin/kbdrate";
+ if (!isempty(kbd_rate)) {
+ args[i++] = "-r";
+ args[i++] = kbd_rate;
+ }
+ if (!isempty(kbd_delay)) {
+ args[i++] = "-d";
+ args[i++] = kbd_delay;
+ }
+ args[i++] = "-s";
+ args[i++] = NULL;
+
+ if ((pid = fork()) < 0) {
+ log_error("Failed to fork: %m");
+ return -errno;
+ } else if (pid == 0) {
+ execv(args[0], (char **) args);
+ _exit(EXIT_FAILURE);
+ }
+
+ *_pid = pid;
+ return 0;
+}
+#endif
+
int main(int argc, char **argv) {
const char *vc;
char *vc_keymap = NULL;
@@ -185,8 +283,16 @@ int main(int argc, char **argv) {
#if defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
char *vc_keytable = NULL;
#endif
+#ifdef TARGET_SUSE
+ char *vc_kbd_delay = NULL;
+ char *vc_kbd_rate = NULL;
+ char *vc_kbd_disable_caps_lock = NULL;
+ char *vc_compose_table = NULL;
+ pid_t kbd_rate_pid = 0, compose_table_pid = 0;
+#endif
int fd = -1;
bool utf8;
+ bool disable_capslock = false;
int r = EXIT_FAILURE;
pid_t font_pid = 0, keymap_pid = 0;
@@ -277,6 +383,10 @@ int main(int argc, char **argv) {
#elif defined(TARGET_SUSE)
r = parse_env_file("/etc/sysconfig/keyboard", NEWLINE,
"KEYTABLE", &vc_keymap,
+ "KBD_DELAY", &vc_kbd_delay,
+ "KBD_RATE", &vc_kbd_rate,
+ "KBD_DISABLE_CAPS_LOCK", &vc_kbd_disable_caps_lock,
+ "COMPOSETABLE", &vc_compose_table,
NULL);
if (r < 0 && r != -ENOENT)
log_warning("Failed to read /etc/sysconfig/keyboard: %s", strerror(-r));
@@ -289,6 +399,8 @@ int main(int argc, char **argv) {
if (r < 0 && r != -ENOENT)
log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r));
+ disable_capslock = vc_kbd_disable_caps_lock && strcasecmp(vc_kbd_disable_caps_lock, "YES") == 0;
+
#elif defined(TARGET_ARCH)
r = parse_env_file("/etc/rc.conf", NEWLINE,
"KEYMAP", &vc_keymap,
@@ -435,7 +547,11 @@ int main(int argc, char **argv) {
disable_utf8(fd);
- if (load_keymap(vc, vc_keymap, vc_keymap_toggle, utf8, &keymap_pid) >= 0 &&
+ if (load_keymap(vc, vc_keymap, vc_keymap_toggle, utf8, disable_capslock, &keymap_pid) >= 0 &&
+#ifdef TARGET_SUSE
+ load_compose_table(vc, vc_compose_table, &compose_table_pid) >= 0 &&
+ set_kbd_rate(vc, vc_kbd_rate, vc_kbd_delay, &kbd_rate_pid) >= 0 &&
+#endif
load_font(vc, vc_font, vc_font_map, vc_font_unimap, &font_pid) >= 0)
r = EXIT_SUCCESS;
@@ -443,6 +559,14 @@ finish:
if (keymap_pid > 0)
wait_for_terminate_and_warn(KBD_LOADKEYS, keymap_pid);
+#ifdef TARGET_SUSE
+ if (compose_table_pid > 0)
+ wait_for_terminate_and_warn(KBD_LOADKEYS, compose_table_pid);
+
+ if (kbd_rate_pid > 0)
+ wait_for_terminate_and_warn("/bin/kbdrate", kbd_rate_pid);
+#endif
+
if (font_pid > 0)
wait_for_terminate_and_warn(KBD_SETFONT, font_pid);
@@ -450,6 +574,12 @@ finish:
free(vc_font);
free(vc_font_map);
free(vc_font_unimap);
+#ifdef TARGET_SUSE
+ free(vc_kbd_delay);
+ free(vc_kbd_rate);
+ free(vc_kbd_disable_caps_lock);
+ free(vc_compose_table);
+#endif
if (fd >= 0)
close_nointr_nofail(fd);
++++++ 0001-service-Fix-dependencies-added-when-parsing-insserv..patch ++++++
Index: systemd-195/src/core/service.c
===================================================================
--- systemd-195.orig/src/core/service.c
+++ systemd-195/src/core/service.c
@@ -3391,12 +3391,13 @@ static void service_notify_message(Unit
#ifdef HAVE_SYSV_COMPAT
-#ifdef TARGET_SUSE
-static void sysv_facility_in_insserv_conf(Manager *mgr) {
- FILE *f=NULL;
+#if defined(TARGET_SUSE) || defined(TARGET_DEBIAN)
+static void sysv_parse_insserv_conf(Manager *mgr, const char* filename) {
+ FILE *f = NULL;
int r;
- if (!(f = fopen("/etc/insserv.conf", "re"))) {
+ if (!(f = fopen(filename, "re"))) {
+ log_error("Failed to open file %s", filename);
r = errno == ENOENT ? 0 : -errno;
goto finish;
}
@@ -3410,7 +3411,7 @@ static void sysv_facility_in_insserv_con
break;
r = -errno;
- log_error("Failed to read configuration file '/etc/insserv.conf': %s", strerror(-r));
+ log_error("Failed to read configuration file '%s': %s", filename, strerror(-r));
goto finish;
}
@@ -3425,23 +3426,32 @@ static void sysv_facility_in_insserv_con
Unit *u;
if (sysv_translate_facility(parsed[0], NULL, &facility) < 0)
continue;
+ if (streq(facility, SPECIAL_REMOTE_FS_TARGET)) {
+ /* insert also a Wants dependency from remote-fs-pre on remote-fs */
+ u = manager_get_unit(mgr, SPECIAL_REMOTE_FS_TARGET);
+ if (u) {
+ unit_add_dependency_by_name(u, UNIT_WANTS, SPECIAL_REMOTE_FS_PRE_TARGET, NULL, true);
+ free (facility);
+ facility=strdup(SPECIAL_REMOTE_FS_PRE_TARGET);
+ }
+ }
if ((u = manager_get_unit(mgr, facility)) && (u->type == UNIT_TARGET)) {
- UnitDependency e;
char *dep = NULL, *name, **j;
STRV_FOREACH (j, parsed+1) {
- if (*j[0]=='+') {
- e = UNIT_WANTS;
+ if (*j[0] == '+')
name = *j+1;
- }
- else {
- e = UNIT_REQUIRES;
+ else
name = *j;
- }
+ if (streq(name, "boot.localfs") ||
+ streq(name, "boot.crypto"))
+ continue;
if (sysv_translate_facility(name, NULL, &dep) < 0)
continue;
- r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, e, dep, NULL, true);
+ r = unit_add_two_dependencies_by_name_inverse(u, UNIT_WANTS, UNIT_BEFORE, dep, NULL, true);
+ if (*j[0] != '+')
+ r = unit_add_dependency_by_name(u, UNIT_REQUIRES, dep, NULL, true);
free(dep);
}
}
@@ -3454,6 +3464,35 @@ finish:
fclose(f);
}
+
+static void sysv_facility_in_insserv_conf(Manager *mgr) {
+ DIR *d =NULL;
+ struct dirent *de;
+
+#ifdef TARGET_DEBIAN
+ if (!(d = opendir("/etc/insserv.conf.d/")))
+ if (errno != ENOENT) {
+ log_warning("opendir() failed on /etc/insserv.conf.d/ %s", strerror(errno));
+ goto finish;
+ }
+
+ while ((de = readdir(d))) {
+ char *path = NULL;
+ if (ignore_file(de->d_name))
+ continue;
+
+ path = join("/etc/insserv.conf.d/", de->d_name, NULL);
+ sysv_parse_insserv_conf(mgr, path);
+ free(path);
+ }
+finish:
+ if (d)
+ closedir(d);
+#endif
+
+ sysv_parse_insserv_conf(mgr, "/etc/insserv.conf");
+}
+
#endif
static int service_enumerate(Manager *m) {
@@ -3604,7 +3643,7 @@ static int service_enumerate(Manager *m)
r = 0;
-#ifdef TARGET_SUSE
+#if defined(TARGET_SUSE) || defined(TARGET_DEBIAN)
sysv_facility_in_insserv_conf (m);
#endif
++++++ 0001-service-flags-sysv-service-with-detected-pid-as-Rema.patch ++++++
>From 700b1261115a67392014ff2c887a9cffc28108ab Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat(a)suse.com>
Date: Fri, 30 Sep 2011 12:58:17 +0200
Subject: [PATCH] service: flags sysv service with detected pid as RemainAfterExit=false
LSB header doesn't give pidfile, so all LSB initscripts have
RemainAfterExit=false, causing daemon termination to not be reported as
such by systemd. Checking at startup if daemon is still running for
sysv initscript to disable RemainAfterExit helps a lot.
Fixes https://bugzilla.novell.com/show_bug.cgi?id=721426
---
src/service.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
Index: systemd-195/src/core/service.c
===================================================================
--- systemd-195.orig/src/core/service.c
+++ systemd-195/src/core/service.c
@@ -2136,8 +2136,13 @@ static void service_enter_running(Servic
cgroup_ok = cgroup_good(s);
if ((main_pid_ok > 0 || (main_pid_ok < 0 && cgroup_ok != 0)) &&
- (s->bus_name_good || s->type != SERVICE_DBUS))
+ (s->bus_name_good || s->type != SERVICE_DBUS)) {
+#ifdef HAVE_SYSV_COMPAT
+ if (s->sysv_enabled && !s->pid_file)
+ s->remain_after_exit = false;
+#endif
service_set_state(s, SERVICE_RUNNING);
+ }
else if (s->remain_after_exit)
service_set_state(s, SERVICE_EXITED);
else
++++++ 1001-Reinstate-TIMEOUT-handling.patch ++++++
Without treating events with timeouts specially some drivers would
cause a 30 seconds stall on boot: .
I also received reports of some drivers not working at all, even
after the timeout.
We will remove this patch when more drivers have been fixed in
the kernel (3.4?).
This reverts 43d5c5f03645c4b842659f9b5bd0ae465e885e92 and
57c6f8ae5f52a6e8ffc66a54966346f733dded39.
---
Note: this is mostly a FYI, and whether or not it makes sense
to apply this upstream depends on how big problems other report
regarding this issue.
src/libudev-device.c | 19 +++++++++++++++++++
src/libudev-private.h | 1 +
src/udevd.c | 13 ++++++++++---
4 files changed, 32 insertions(+), 3 deletions(-)
Index: systemd-195/src/libudev/libudev-device.c
===================================================================
--- systemd-195.orig/src/libudev/libudev-device.c
+++ systemd-195/src/libudev/libudev-device.c
@@ -68,6 +68,7 @@ struct udev_device {
struct udev_list tags_list;
unsigned long long int seqnum;
unsigned long long int usec_initialized;
+ int timeout;
int devlink_priority;
int refcount;
dev_t devnum;
@@ -162,6 +163,21 @@ static int udev_device_set_devnum(struct
return 0;
}
+int udev_device_get_timeout(struct udev_device *udev_device)
+{
+ return udev_device->timeout;
+}
+
+static int udev_device_set_timeout(struct udev_device *udev_device, int timeout)
+{
+ char num[32];
+
+ udev_device->timeout = timeout;
+ snprintf(num, sizeof(num), "%u", timeout);
+ udev_device_add_property(udev_device, "TIMEOUT", num);
+ return 0;
+}
+
const char *udev_device_get_devpath_old(struct udev_device *udev_device)
{
return udev_device->devpath_old;
@@ -418,6 +434,8 @@ void udev_device_add_property_from_strin
udev_device_set_devpath_old(udev_device, &property[12]);
} else if (startswith(property, "SEQNUM=")) {
udev_device_set_seqnum(udev_device, strtoull(&property[7], NULL, 10));
+ } else if (startswith(property, "TIMEOUT=")) {
+ udev_device_set_timeout(udev_device, strtoull(&property[8], NULL, 10));
} else if (startswith(property, "IFINDEX=")) {
udev_device_set_ifindex(udev_device, strtoull(&property[8], NULL, 10));
} else if (startswith(property, "DEVMODE=")) {
@@ -605,6 +623,7 @@ struct udev_device *udev_device_new(stru
udev_list_init(udev, &udev_device->sysattr_value_list, true);
udev_list_init(udev, &udev_device->sysattr_list, false);
udev_list_init(udev, &udev_device->tags_list, true);
+ udev_device->timeout = -1;
udev_device->watch_handle = -1;
/* copy global properties */
udev_list_entry_foreach(list_entry, udev_get_properties_list_entry(udev))
Index: systemd-195/src/libudev/libudev-private.h
===================================================================
--- systemd-195.orig/src/libudev/libudev-private.h
+++ systemd-195/src/libudev/libudev-private.h
@@ -65,6 +65,7 @@ const char *udev_device_get_id_filename(
void udev_device_set_is_initialized(struct udev_device *udev_device);
int udev_device_add_tag(struct udev_device *udev_device, const char *tag);
void udev_device_cleanup_tags_list(struct udev_device *udev_device);
+int udev_device_get_timeout(struct udev_device *udev_device);
unsigned long long udev_device_get_usec_initialized(struct udev_device *udev_device);
void udev_device_set_usec_initialized(struct udev_device *udev_device, unsigned long long usec_initialized);
int udev_device_get_devlink_priority(struct udev_device *udev_device);
Index: systemd-195/src/udev/udevd.c
===================================================================
--- systemd-195.orig/src/udev/udevd.c
+++ systemd-195/src/udev/udevd.c
@@ -388,7 +388,7 @@ out:
}
}
-static void event_run(struct event *event)
+static void event_run(struct event *event, bool force)
{
struct udev_list_node *loop;
@@ -414,7 +414,7 @@ static void event_run(struct event *even
return;
}
- if (children >= children_max) {
+ if (!force && children >= children_max) {
if (children_max > 1)
log_debug("maximum number (%i) of children reached\n", children);
return;
@@ -450,6 +450,13 @@ static int event_queue_insert(struct ude
event->state = EVENT_QUEUED;
udev_list_node_append(&event->node, &event_list);
+
+ /* run all events with a timeout set immediately */
+ if (udev_device_get_timeout(dev) > 0) {
+ event_run(event, true);
+ return 0;
+ }
+
return 0;
}
@@ -559,7 +566,7 @@ static void event_queue_start(struct ude
if (is_devpath_busy(event))
continue;
- event_run(event);
+ event_run(event, false);
}
}
++++++ 1002-re-enable-by_path-links-for-ata-devices.patch ++++++
Index: systemd-195/src/udev/udev-builtin-path_id.c
===================================================================
--- systemd-195.orig/src/udev/udev-builtin-path_id.c
+++ systemd-195/src/udev/udev-builtin-path_id.c
@@ -302,6 +302,85 @@ out:
return hostdev;
}
+static struct udev_device *handle_ata(struct udev_device *parent, char **path)
+{
+ struct udev_device *hostdev;
+ int host, bus, target, lun;
+ const char *name;
+ char *base;
+ char *pos;
+ DIR *dir;
+ struct dirent *dent;
+ int basenum, len;
+
+ hostdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host");
+ if (hostdev == NULL)
+ return NULL;
+
+ name = udev_device_get_sysname(parent);
+ if (sscanf(name, "%d:%d:%d:%d", &host, &bus, &target, &lun) != 4)
+ return NULL;
+
+ /* rebase ata offset to get the local relative number */
+ basenum = -1;
+ base = strdup(udev_device_get_syspath(hostdev));
+ if (base == NULL)
+ return NULL;
+ pos = strrchr(base, '/');
+ if (pos == NULL) {
+ parent = NULL;
+ goto out;
+ }
+ pos[0] = '\0';
+ len = strlen(base) - 5;
+ if (len <= 0) {
+ parent = NULL;
+ goto out;
+ }
+ base[len] = '\0';
+ dir = opendir(base);
+ if (dir == NULL) {
+ parent = NULL;
+ goto out;
+ }
+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
+ char *rest;
+ int i;
+
+ if (dent->d_name[0] == '.')
+ continue;
+ if (dent->d_type != DT_DIR && dent->d_type != DT_LNK)
+ continue;
+ if (strncmp(dent->d_name, "ata", 3) != 0)
+ continue;
+ i = strtoul(&dent->d_name[3], &rest, 10);
+
+ /* ata devices start with 1, so decrease by 1 if i is bigger then 0 */
+ if (i > 0)
+ i--;
+ if (rest[0] != '\0')
+ continue;
+ /*
+ * find the smallest number; the host really needs to export its
+ * own instance number per parent device; relying on the global host
+ * enumeration and plainly rebasing the numbers sounds unreliable
+ */
+ if (basenum == -1 || i < basenum)
+ basenum = i;
+ }
+ closedir(dir);
+ if (basenum == -1) {
+ parent = NULL;
+ goto out;
+ }
+ host -= basenum;
+
+ path_prepend(path, "scsi-%u:%u:%u:%u", host, bus, target, lun);
+out:
+ free(base);
+ return hostdev;
+}
+
static struct udev_device *handle_scsi(struct udev_device *parent, char **path)
{
const char *devtype;
@@ -338,16 +417,8 @@ static struct udev_device *handle_scsi(s
goto out;
}
- /*
- * We do not support the ATA transport class, it creates duplicated link
- * names as the fake SCSI host adapters are all separated, they are all
- * re-based as host == 0. ATA should just stop faking two duplicated
- * hierarchies for a single topology and leave the SCSI stuff alone;
- * until that happens, there are no by-path/ links for ATA devices behind
- * an ATA transport class.
- */
if (strstr(name, "/ata") != NULL) {
- parent = NULL;
+ parent = handle_ata(parent, path);
goto out;
}
++++++ 1003-rules-create-by-id-scsi-links-for-ATA-devices.patch ++++++
Index: systemd-195/rules/60-persistent-storage.rules
===================================================================
--- systemd-195.orig/rules/60-persistent-storage.rules
+++ systemd-195/rules/60-persistent-storage.rules
@@ -44,6 +44,10 @@ KERNEL=="cciss*", ENV{DEVTYPE}=="disk",
KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
+# scsi compat links for ATA devices
+KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="ata", PROGRAM="scsi_id --whitelisted --replace-whitespace -p0x80 -d $devnode", RESULT=="?*", ENV{ID_SCSI_COMPAT}="$result", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
+KERNEL=="sd*[0-9]", ENV{ID_SCSI_COMPAT}=="?*", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}-part%n"
+
# firewire
KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}"
KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n"
++++++ 1004-udev-netlink-null-rules.patch ++++++
Index: systemd-195/src/udev/udevd.c
===================================================================
--- systemd-195.orig/src/udev/udevd.c
+++ systemd-195/src/udev/udevd.c
@@ -1513,6 +1513,8 @@ int main(int argc, char *argv[])
dev = udev_monitor_receive_device(monitor);
if (dev != NULL) {
udev_device_set_usec_initialized(dev, now_usec());
+ if (rules == NULL)
+ rules = udev_rules_new(udev, resolve_names);
if (event_queue_insert(dev) < 0)
udev_device_unref(dev);
}
++++++ 1005-udev-fix-sg-autoload-regression.patch ++++++
Index: systemd-190/rules/80-drivers.rules
===================================================================
--- systemd-190.orig/rules/80-drivers.rules
+++ systemd-190/rules/80-drivers.rules
@@ -7,6 +7,7 @@ SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}==
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", IMPORT{builtin}="kmod load tifm_ms"
SUBSYSTEM=="memstick", IMPORT{builtin}="kmod load ms_block mspro_block"
SUBSYSTEM=="i2o", IMPORT{builtin}="kmod load i2o_block"
+SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", IMPORT{builtin}="kmod load sg"
SUBSYSTEM=="module", KERNEL=="parport_pc", RUN{builtin}="kmod load ppdev"
LABEL="drivers_end"
++++++ 1006-fix-devname-prefix.patch ++++++
Index: systemd-195/src/udev/udevd.c
===================================================================
--- systemd-195.orig/src/udev/udevd.c
+++ systemd-195/src/udev/udevd.c
@@ -820,7 +820,7 @@ static void static_dev_create_from_modul
FILE *f;
uname(&kernel);
- util_strscpyl(modules, sizeof(modules), ROOTPREFIX "/lib/modules/", kernel.release, "/modules.devname", NULL);
+ util_strscpyl(modules, sizeof(modules), "/lib/modules/", kernel.release, "/modules.devname", NULL);
f = fopen(modules, "re");
if (f == NULL)
return;
++++++ 1007-udevd-add-missing-to-getopt_long-e.patch ++++++
>From 5bbbe461fd4d133eac49f41210e2fd4846f577d8 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn(a)redhat.com>
Date: Wed, 19 Dec 2012 13:12:26 +0100
Subject: [PATCH] udevd: add missing ':' to getopt_long 'e'
Parameter -e is set without additional argument in getopt
and this leads to segfault when calling 'systemd-udevd -e'.
---
src/udev/udevd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Index: systemd-195/src/udev/udevd.c
===================================================================
--- systemd-195.orig/src/udev/udevd.c
+++ systemd-195/src/udev/udevd.c
@@ -1104,7 +1104,7 @@ int main(int argc, char *argv[])
for (;;) {
int option;
- option = getopt_long(argc, argv, "c:deDtN:hV", options, NULL);
+ option = getopt_long(argc, argv, "c:de:DtN:hV", options, NULL);
if (option == -1)
break;
++++++ 1008-udev-path_id-handle-Hyper-V-devices.patch ++++++
>From a24d03b8ee2ca62cd1273e27cf4e79ddcc0fbb1c Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare(a)suse.de>
Date: Fri, 23 Nov 2012 14:12:39 +0100
Subject: [PATCH] udev: path_id - handle Hyper-V devices
Hyper-V has an abstract bus, which gets renumbered on guest
startup. So instead of the bus numbers we should be using
the device GUIDs, which can be retrieved from the 'device_id'
sysfs attribute.
---
src/udev/udev-builtin-path_id.c | 41 +++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
Index: systemd-195/src/udev/udev-builtin-path_id.c
===================================================================
--- systemd-195.orig/src/udev/udev-builtin-path_id.c
+++ systemd-195/src/udev/udev-builtin-path_id.c
@@ -381,6 +381,42 @@ out:
return hostdev;
}
+static struct udev_device *handle_scsi_hyperv(struct udev_device *parent, char **path) {
+ struct udev_device *hostdev;
+ struct udev_device *vmbusdev;
+ const char *guid_str;
+ char *lun = NULL;
+ char guid[38];
+ size_t i, k;
+
+ hostdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host");
+ if (!hostdev)
+ return NULL;
+
+ vmbusdev = udev_device_get_parent(hostdev);
+ if (!vmbusdev)
+ return NULL;
+
+ guid_str = udev_device_get_sysattr_value(vmbusdev, "device_id");
+ if (!guid_str)
+ return NULL;
+
+ if (strlen(guid_str) < 37 || guid_str[0] != '{' || guid_str[36] != '}')
+ return NULL;
+
+ for (i = 1, k = 0; i < 36; i++) {
+ if (guid_str[i] == '-')
+ continue;
+ guid[k++] = guid_str[i];
+ }
+ guid[k] = '\0';
+
+ format_lun_number(parent, &lun);
+ path_prepend(path, "vmbus-%s-%s", guid, lun);
+ free(lun);
+ return parent;
+}
+
static struct udev_device *handle_scsi(struct udev_device *parent, char **path)
{
const char *devtype;
@@ -422,6 +458,11 @@ static struct udev_device *handle_scsi(s
goto out;
}
+ if (strstr(name, "/vmbus_") != NULL) {
+ parent = handle_scsi_hyperv(parent, path);
+ goto out;
+ }
+
parent = handle_scsi_default(parent, path);
out:
return parent;
++++++ 1009-keymap-Update-the-list-of-Samsung-Series-9-models.patch ++++++
>From 68c77c2f6168dca0ce7b5edb81612cd6be39e63d Mon Sep 17 00:00:00 2001
From: Alessandro Crismani <alessandro.crismani(a)gmail.com>
Date: Wed, 8 Aug 2012 14:19:32 +0200
Subject: [PATCH] keymap: Update the list of Samsung Series 9 models
Currently, keymaps are provided only for the NP90X3A laptop. Samsung
introduced updated models, codenamed 900X3B, 900X3C, 900X4B, 900X4C,
which are currently not matched by udev rules. This patch includes the
newer modules in udev rules and move the samsung-n90x3a file defining
keys to a more generic samsung-series-9 file.
The patch was tested on a 900X4C laptop, and other people reported
that the rules also work for 900X3B and 900X3C ones.
---
delete mode 100644 keymaps-force-release/samsung-90x3a
create mode 100644 keymaps-force-release/samsung-series-9
delete mode 100644 keymaps/samsung-90x3a
create mode 100644 keymaps/samsung-series-9
>From 68c77c2f6168dca0ce7b5edb81612cd6be39e63d Mon Sep 17 00:00:00 2001
From: Alessandro Crismani <alessandro.crismani(a)gmail.com>
Date: Wed, 8 Aug 2012 14:19:32 +0200
Subject: [PATCH] keymap: Update the list of Samsung Series 9 models
Currently, keymaps are provided only for the NP90X3A laptop. Samsung
introduced updated models, codenamed 900X3B, 900X3C, 900X4B, 900X4C,
which are currently not matched by udev rules. This patch includes the
newer modules in udev rules and move the samsung-n90x3a file defining
keys to a more generic samsung-series-9 file.
The patch was tested on a 900X4C laptop, and other people reported
that the rules also work for 900X3B and 900X3C ones.
---
Makefile.am | 4 ++--
keymaps-force-release/samsung-90x3a | 6 ------
keymaps-force-release/samsung-series-9 | 6 ++++++
keymaps/samsung-90x3a | 5 -----
keymaps/samsung-series-9 | 5 +++++
src/udev/keymap/95-keyboard-force-release.rules | 2 +-
src/udev/keymap/95-keymap.rules | 2 +-
7 files changed, 15 insertions(+), 15 deletions(-)
delete mode 100644 keymaps-force-release/samsung-90x3a
create mode 100644 keymaps-force-release/samsung-series-9
delete mode 100644 keymaps/samsung-90x3a
create mode 100644 keymaps/samsung-series-9
Index: systemd-195/Makefile.am
===================================================================
--- systemd-195.orig/Makefile.am
+++ systemd-195/Makefile.am
@@ -2272,7 +2272,7 @@ dist_udevkeymap_DATA = \
keymaps/onkyo \
keymaps/oqo-model2 \
keymaps/samsung-other \
- keymaps/samsung-90x3a \
+ keymaps/samsung-series-9 \
keymaps/samsung-sq1us \
keymaps/samsung-sx20s \
keymaps/toshiba-satellite_a100 \
@@ -2286,7 +2286,7 @@ dist_udevkeymapforcerel_DATA = \
keymaps-force-release/dell-xps \
keymaps-force-release/hp-other \
keymaps-force-release/samsung-other \
- keymaps-force-release/samsung-90x3a \
+ keymaps-force-release/samsung-series-9 \
keymaps-force-release/common-volume-keys
src/udev/keymap/keys.txt: Makefile
Index: systemd-195/keymaps-force-release/samsung-90x3a
===================================================================
--- systemd-195.orig/keymaps-force-release/samsung-90x3a
+++ /dev/null
@@ -1,6 +0,0 @@
-# list of scancodes (hex or decimal), optional comment
-0xCE # Fn+F8 keyboard backlit up
-0x8D # Fn+F7 keyboard backlit down
-0x97 # Fn+F12 wifi on/off
-0x96 # Fn+F1 performance mode (?)
-0xD5 # Fn+F6 battery life extender
Index: systemd-195/keymaps-force-release/samsung-series-9
===================================================================
--- /dev/null
+++ systemd-195/keymaps-force-release/samsung-series-9
@@ -0,0 +1,6 @@
+# list of scancodes (hex or decimal), optional comment
+0xCE # Fn+F8 keyboard backlit up
+0x8D # Fn+F7 keyboard backlit down
+0x97 # Fn+F12 wifi on/off
+0x96 # Fn+F1 performance mode (?)
+0xD5 # Fn+F6 battery life extender
Index: systemd-195/keymaps/samsung-90x3a
===================================================================
--- systemd-195.orig/keymaps/samsung-90x3a
+++ /dev/null
@@ -1,5 +0,0 @@
-0x96 kbdillumup # Fn+F8 keyboard backlit up
-0x97 kbdillumdown # Fn+F7 keyboard backlit down
-0xD5 wlan # Fn+F12 wifi on/off
-0xCE prog1 # Fn+F1 performance mode
-0x8D prog2 # Fn+F6 battery life extender
Index: systemd-195/keymaps/samsung-series-9
===================================================================
--- /dev/null
+++ systemd-195/keymaps/samsung-series-9
@@ -0,0 +1,5 @@
+0x96 kbdillumup # Fn+F8 keyboard backlit up
+0x97 kbdillumdown # Fn+F7 keyboard backlit down
+0xD5 wlan # Fn+F12 wifi on/off
+0xCE prog1 # Fn+F1 performance mode
+0x8D prog2 # Fn+F6 battery life extender
Index: systemd-195/src/udev/keymap/95-keyboard-force-release.rules
===================================================================
--- systemd-195.orig/src/udev/keymap/95-keyboard-force-release.rules
+++ systemd-195/src/udev/keymap/95-keyboard-force-release.rules
@@ -19,7 +19,7 @@ DRIVER!="atkbd", GOTO="force_release_end
ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}"
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", RUN+="keyboard-force-release.sh $devpath samsung-other"
-ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*90X3A*", RUN+="keyboard-force-release.sh $devpath samsung-90x3a"
+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*90X3A*|*900X3*|*900X4*", RUN+="keyboard-force-release.sh $devpath samsung-series-9"
ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557|Studio 1558", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Latitude E*|Latitude *U|Precision M*", RUN+="keyboard-force-release.sh $devpath dell-touchpad"
Index: systemd-195/src/udev/keymap/95-keymap.rules
===================================================================
--- systemd-195.orig/src/udev/keymap/95-keymap.rules
+++ systemd-195/src/udev/keymap/95-keymap.rules
@@ -147,7 +147,7 @@ ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][n
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*SX20S*", RUN+="keymap $name samsung-sx20s"
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="SQ1US", RUN+="keymap $name samsung-sq1us"
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*700Z*", RUN+="keymap $name 0xBA ejectcd 0x96 keyboardbrightnessup 0x97 keyboardbrightnessdown"
-ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*90X3A*", RUN+="keymap $name samsung-90x3a"
+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*90X3A*|*900X3*|*900X4*", RUN+="keymap $name samsung-series-9"
ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="SATELLITE A100", RUN+="keymap $name toshiba-satellite_a100"
ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite A110", RUN+="keymap $name toshiba-satellite_a110"
++++++ 1010-keymap-Add-Samsung-700T.patch ++++++
>From a5dea3d43b3866b48c66d6bef9663cf8372fd96c Mon Sep 17 00:00:00 2001
From: Martin Pitt <martinpitt(a)gnome.org>
Date: Wed, 28 Nov 2012 21:33:26 +0100
Subject: [PATCH] keymap: Add Samsung 700T
https://bugzilla.redhat.com/show_bug.cgi?id=879691
---
src/udev/keymap/95-keymap.rules | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
Index: systemd-195/src/udev/keymap/95-keymap.rules
===================================================================
--- systemd-195.orig/src/udev/keymap/95-keymap.rules
+++ systemd-195/src/udev/keymap/95-keymap.rules
@@ -147,6 +147,7 @@ ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][n
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*SX20S*", RUN+="keymap $name samsung-sx20s"
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="SQ1US", RUN+="keymap $name samsung-sq1us"
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*700Z*", RUN+="keymap $name 0xBA ejectcd 0x96 keyboardbrightnessup 0x97 keyboardbrightnessdown"
+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*700T*", RUN+="keymap $name 0xAD leftmeta"
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*90X3A*|*900X3*|*900X4*", RUN+="keymap $name samsung-series-9"
ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="SATELLITE A100", RUN+="keymap $name toshiba-satellite_a100"
++++++ 1011-libudev-avoid-leak-during-realloc-failure.patch ++++++
>From cf2292f5ac87087f57dbd632a25a332c9d194ebf Mon Sep 17 00:00:00 2001
From: Mauro Dreissig <mukadr(a)gmail.com>
Date: Sun, 11 Nov 2012 22:07:51 -0200
Subject: [PATCH] libudev: avoid leak during realloc failure
---
src/libudev/libudev-list.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: systemd-195/src/libudev/libudev-list.c
===================================================================
--- systemd-195.orig/src/libudev/libudev-list.c
+++ systemd-195/src/libudev/libudev-list.c
@@ -177,18 +177,20 @@ struct udev_list_entry *udev_list_entry_
if (list->unique) {
/* allocate or enlarge sorted array if needed */
if (list->entries_cur >= list->entries_max) {
+ struct udev_list_entry **entries;
unsigned int add;
add = list->entries_max;
if (add < 1)
add = 64;
- list->entries = realloc(list->entries, (list->entries_max + add) * sizeof(struct udev_list_entry *));
- if (list->entries == NULL) {
+ entries = realloc(list->entries, (list->entries_max + add) * sizeof(struct udev_list_entry *));
+ if (entries == NULL) {
free(entry->name);
free(entry->value);
free(entry);
return NULL;
}
+ list->entries = entries;
list->entries_max += add;
}
++++++ 1012-libudev-do-not-resolve-attr-device-symlinks.patch ++++++
>From 5ae18ddc0d86673520c0dd6b59ccac8afc8aa605 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay(a)vrfy.org>
Date: Tue, 20 Nov 2012 18:07:57 +0100
Subject: [PATCH] libudev: do not resolve $attr{device} symlinks
---
src/libudev/libudev-device.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
Index: systemd-195/src/libudev/libudev-device.c
===================================================================
--- systemd-195.orig/src/libudev/libudev-device.c
+++ systemd-195/src/libudev/libudev-device.c
@@ -1369,16 +1369,17 @@ _public_ const char *udev_device_get_sys
goto out;
}
- /* resolve link to a device and return its syspath */
- util_strscpyl(path, sizeof(path), udev_device->syspath, "/", sysattr, NULL);
- dev = udev_device_new_from_syspath(udev_device->udev, path);
- if (dev != NULL) {
- list_entry = udev_list_entry_add(&udev_device->sysattr_value_list, sysattr,
- udev_device_get_syspath(dev));
- val = udev_list_entry_get_value(list_entry);
- udev_device_unref(dev);
+ /* resolve custom link to a device and return its syspath */
+ if (!streq(sysattr, "device")) {
+ util_strscpyl(path, sizeof(path), udev_device->syspath, "/", sysattr, NULL);
+ dev = udev_device_new_from_syspath(udev_device->udev, path);
+ if (dev != NULL) {
+ list_entry = udev_list_entry_add(&udev_device->sysattr_value_list, sysattr,
+ udev_device_get_syspath(dev));
+ val = udev_list_entry_get_value(list_entry);
+ udev_device_unref(dev);
+ }
}
-
goto out;
}
++++++ 1013-libudev-validate-udev-argument-to-udev_enumerate_new.patch ++++++
>From e68893075083a7461b1572233d23fdb23541d630 Mon Sep 17 00:00:00 2001
From: Michael Terry <michael.terry(a)canonical.com>
Date: Fri, 14 Dec 2012 09:02:13 -0500
Subject: [PATCH] libudev: validate 'udev' argument to udev_enumerate_new()
https://bugs.freedesktop.org/show_bug.cgi?id=58289
---
src/libudev/libudev-enumerate.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
Index: systemd-195/src/libudev/libudev-enumerate.c
===================================================================
--- systemd-195.orig/src/libudev/libudev-enumerate.c
+++ systemd-195/src/libudev/libudev-enumerate.c
@@ -73,6 +73,8 @@ _public_ struct udev_enumerate *udev_enu
{
struct udev_enumerate *udev_enumerate;
+ if (udev == NULL)
+ return NULL;
udev_enumerate = calloc(1, sizeof(struct udev_enumerate));
if (udev_enumerate == NULL)
return NULL;
++++++ 1014-udev-fix-whitespace.patch ++++++
>From 3fd0c4c66df45ee457cfb5e4ca8e285914ebc32f Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay(a)vrfy.org>
Date: Tue, 20 Nov 2012 18:07:14 +0100
Subject: [PATCH] udev: fix whitespace
---
src/udev/udev-event.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
Index: systemd-195/src/udev/udev-event.c
===================================================================
--- systemd-195.orig/src/udev/udev-event.c
+++ systemd-195/src/udev/udev-event.c
@@ -90,24 +90,24 @@ size_t udev_event_apply_format(struct ud
const char fmt;
enum subst_type type;
} map[] = {
- { .name = "devnode", .fmt = 'N', .type = SUBST_DEVNODE },
- { .name = "tempnode", .fmt = 'N', .type = SUBST_DEVNODE },
- { .name = "attr", .fmt = 's', .type = SUBST_ATTR },
- { .name = "sysfs", .fmt = 's', .type = SUBST_ATTR },
- { .name = "env", .fmt = 'E', .type = SUBST_ENV },
- { .name = "kernel", .fmt = 'k', .type = SUBST_KERNEL },
- { .name = "number", .fmt = 'n', .type = SUBST_KERNEL_NUMBER },
- { .name = "driver", .fmt = 'd', .type = SUBST_DRIVER },
- { .name = "devpath", .fmt = 'p', .type = SUBST_DEVPATH },
- { .name = "id", .fmt = 'b', .type = SUBST_ID },
- { .name = "major", .fmt = 'M', .type = SUBST_MAJOR },
- { .name = "minor", .fmt = 'm', .type = SUBST_MINOR },
- { .name = "result", .fmt = 'c', .type = SUBST_RESULT },
- { .name = "parent", .fmt = 'P', .type = SUBST_PARENT },
- { .name = "name", .fmt = 'D', .type = SUBST_NAME },
- { .name = "links", .fmt = 'L', .type = SUBST_LINKS },
- { .name = "root", .fmt = 'r', .type = SUBST_ROOT },
- { .name = "sys", .fmt = 'S', .type = SUBST_SYS },
+ { .name = "devnode", .fmt = 'N', .type = SUBST_DEVNODE },
+ { .name = "tempnode", .fmt = 'N', .type = SUBST_DEVNODE },
+ { .name = "attr", .fmt = 's', .type = SUBST_ATTR },
+ { .name = "sysfs", .fmt = 's', .type = SUBST_ATTR },
+ { .name = "env", .fmt = 'E', .type = SUBST_ENV },
+ { .name = "kernel", .fmt = 'k', .type = SUBST_KERNEL },
+ { .name = "number", .fmt = 'n', .type = SUBST_KERNEL_NUMBER },
+ { .name = "driver", .fmt = 'd', .type = SUBST_DRIVER },
+ { .name = "devpath", .fmt = 'p', .type = SUBST_DEVPATH },
+ { .name = "id", .fmt = 'b', .type = SUBST_ID },
+ { .name = "major", .fmt = 'M', .type = SUBST_MAJOR },
+ { .name = "minor", .fmt = 'm', .type = SUBST_MINOR },
+ { .name = "result", .fmt = 'c', .type = SUBST_RESULT },
+ { .name = "parent", .fmt = 'P', .type = SUBST_PARENT },
+ { .name = "name", .fmt = 'D', .type = SUBST_NAME },
+ { .name = "links", .fmt = 'L', .type = SUBST_LINKS },
+ { .name = "root", .fmt = 'r', .type = SUBST_ROOT },
+ { .name = "sys", .fmt = 'S', .type = SUBST_SYS },
};
const char *from;
char *s;
++++++ 1015-udev-properly-handle-symlink-removal-by-change-event.patch ++++++
>From bf9d233f781f27841be6638ee745e9c80bda5f4d Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay(a)vrfy.org>
Date: Tue, 13 Nov 2012 02:05:06 +0100
Subject: [PATCH] udev: properly handle symlink removal by 'change' event
If a 'change' event is supposed to remove created symlinks, we create
a new device structure from the sysfs device and fill it with the list
of links, to compute the delta of the old and new list of links to apply.
If the device is already 'remove'd by the kernel though, udev fails to
create the device structure, so the links are not removed properly.
> From: Neil Brown <nfbrown(a)suse.com>
> Date: Thu, 8 Nov 2012 10:39:06 +0100
> Subject: [PATCH] If a 'change' event does not get handled by udev until
> after the device has subsequently disappeared, udev mis-handles
> it. This can happen with 'md' devices which emit a change
> event and then a remove event when they are stopped. It is
> normally only noticed if udev is very busy (lots of arrays
> being stopped at once) or the machine is otherwise loaded
> and reponding slowly.
>
> There are two problems.
>
> 1/ udev_device_new_from_syspath() will refuse to create the device
> structure if the device does not exist in /sys, and particularly if
> the uevent file does not exist.
> If a 'db' file does exist, that is sufficient evidence that the device
> is genuine and should be created. Equally if we have just received an
> event from the kernel about the device, it must be real.
>
> This patch just disabled the test for the 'uevent' file, it doesn't
> try imposing any other tests - it isn't clear that they are really
> needed.
>
> 2/ udev_event_execute_rules() calls udev_device_read_db() on a 'device'
> structure that is largely uninitialised and in particular does not
> have the 'subsystem' set. udev_device_read_db() needs the subsystem
> so it tries to read the 'subsystem' symlink out of sysfs. If the
> device is already deleted, this naturally fails.
> udev_event_execute_rules() knows the subsystem (as it was in the
> event message) so this patch simply sets the subsystem for the device
> structure to be loaded to match the subsystem of the device structure
> that is handling the event.
>
> With these two changes, deleted handling of change events will still
> correctly remove any symlinks that are not needed any more.
Use udev_device_new() instead of allowing udev_device_new_from_syspath()
to proceed without a sysfs device.
---
src/udev/udev-event.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
Index: systemd-195/src/udev/udev-event.c
===================================================================
--- systemd-195.orig/src/udev/udev-event.c
+++ systemd-195/src/udev/udev-event.c
@@ -797,8 +797,10 @@ int udev_event_execute_rules(struct udev
if (major(udev_device_get_devnum(dev)) != 0)
udev_node_remove(dev);
} else {
- event->dev_db = udev_device_new_from_syspath(event->udev, udev_device_get_syspath(dev));
+ event->dev_db = udev_device_new(event->udev);
if (event->dev_db != NULL) {
+ udev_device_set_syspath(event->dev_db, udev_device_get_syspath(dev));
+ udev_device_set_subsystem(event->dev_db, udev_device_get_subsystem(dev));
udev_device_read_db(event->dev_db, NULL);
udev_device_set_info_loaded(event->dev_db);
++++++ 1016-udev-builtin-do-not-fail-builtin-initialization-if-o.patch ++++++
Index: systemd-195/src/udev/udev-builtin.c
===================================================================
--- systemd-195.orig/src/udev/udev-builtin.c
+++ systemd-195/src/udev/udev-builtin.c
@@ -42,24 +42,18 @@ static const struct udev_builtin *builti
#endif
};
-int udev_builtin_init(struct udev *udev)
+void udev_builtin_init(struct udev *udev)
{
unsigned int i;
- int err = 0;
if (initialized)
- return 0;
+ return;
- for (i = 0; i < ELEMENTSOF(builtins); i++) {
- if (builtins[i]->init) {
- err = builtins[i]->init(udev);
- if (err < 0)
- break;
- }
- }
+ for (i = 0; i < ELEMENTSOF(builtins); i++)
+ if (builtins[i]->init)
+ builtins[i]->init(udev);
initialized = true;
- return err;
}
void udev_builtin_exit(struct udev *udev)
@@ -79,13 +73,11 @@ void udev_builtin_exit(struct udev *udev
bool udev_builtin_validate(struct udev *udev)
{
unsigned int i;
- bool change = false;
for (i = 0; i < ELEMENTSOF(builtins); i++)
- if (builtins[i]->validate)
- if (builtins[i]->validate(udev))
- change = true;
- return change;
+ if (builtins[i]->validate && builtins[i]->validate(udev))
+ return true;
+ return false;
}
void udev_builtin_list(struct udev *udev)
Index: systemd-195/src/udev/udev.h
===================================================================
--- systemd-195.orig/src/udev/udev.h
+++ systemd-195/src/udev/udev.h
@@ -167,7 +167,7 @@ extern const struct udev_builtin udev_bu
extern const struct udev_builtin udev_builtin_usb_db;
extern const struct udev_builtin udev_builtin_usb_id;
extern const struct udev_builtin udev_builtin_uaccess;
-int udev_builtin_init(struct udev *udev);
+void udev_builtin_init(struct udev *udev);
void udev_builtin_exit(struct udev *udev);
enum udev_builtin_cmd udev_builtin_lookup(const char *command);
const char *udev_builtin_name(enum udev_builtin_cmd cmd);
++++++ 1017-udev-use-usec_t-and-now.patch ++++++
Index: systemd-195/src/libudev/libudev-device-private.c
===================================================================
--- systemd-195.orig/src/libudev/libudev-device-private.c
+++ systemd-195/src/libudev/libudev-device-private.c
@@ -147,7 +147,7 @@ int udev_device_update_db(struct udev_de
}
if (udev_device_get_usec_initialized(udev_device) > 0)
- fprintf(f, "I:%llu\n", udev_device_get_usec_initialized(udev_device));
+ fprintf(f, "I:%llu\n", (unsigned long long)udev_device_get_usec_initialized(udev_device));
udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) {
if (!udev_list_entry_get_num(list_entry))
Index: systemd-195/src/libudev/libudev-device.c
===================================================================
--- systemd-195.orig/src/libudev/libudev-device.c
+++ systemd-195/src/libudev/libudev-device.c
@@ -67,7 +67,7 @@ struct udev_device {
struct udev_list sysattr_list;
struct udev_list tags_list;
unsigned long long int seqnum;
- unsigned long long int usec_initialized;
+ usec_t usec_initialized;
int timeout;
int devlink_priority;
int refcount;
@@ -262,7 +262,7 @@ static int udev_device_set_devtype(struc
return 0;
}
-static int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem)
+int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem)
{
free(udev_device->subsystem);
udev_device->subsystem = strdup(subsystem);
@@ -1286,7 +1286,7 @@ _public_ const char *udev_device_get_act
**/
_public_ unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device)
{
- unsigned long long now_ts;
+ usec_t now_ts;
if (udev_device == NULL)
return 0;
@@ -1294,23 +1294,23 @@ _public_ unsigned long long int udev_dev
udev_device_read_db(udev_device, NULL);
if (udev_device->usec_initialized == 0)
return 0;
- now_ts = now_usec();
+ now_ts = now(CLOCK_MONOTONIC);
if (now_ts == 0)
return 0;
return now_ts - udev_device->usec_initialized;
}
-unsigned long long udev_device_get_usec_initialized(struct udev_device *udev_device)
+usec_t udev_device_get_usec_initialized(struct udev_device *udev_device)
{
return udev_device->usec_initialized;
}
-void udev_device_set_usec_initialized(struct udev_device *udev_device, unsigned long long usec_initialized)
+void udev_device_set_usec_initialized(struct udev_device *udev_device, usec_t usec_initialized)
{
char num[32];
udev_device->usec_initialized = usec_initialized;
- snprintf(num, sizeof(num), "%llu", usec_initialized);
+ snprintf(num, sizeof(num), "%llu", (unsigned long long)usec_initialized);
udev_device_add_property(udev_device, "USEC_INITIALIZED", num);
}
Index: systemd-195/src/libudev/libudev-private.h
===================================================================
--- systemd-195.orig/src/libudev/libudev-private.h
+++ systemd-195/src/libudev/libudev-private.h
@@ -48,6 +48,7 @@ struct udev_list_entry *udev_get_propert
/* libudev-device.c */
struct udev_device *udev_device_new(struct udev *udev);
mode_t udev_device_get_devnode_mode(struct udev_device *udev_device);
+int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsystem);
int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath);
int udev_device_set_devnode(struct udev_device *udev_device, const char *devnode);
int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink);
@@ -66,8 +67,8 @@ void udev_device_set_is_initialized(stru
int udev_device_add_tag(struct udev_device *udev_device, const char *tag);
void udev_device_cleanup_tags_list(struct udev_device *udev_device);
int udev_device_get_timeout(struct udev_device *udev_device);
-unsigned long long udev_device_get_usec_initialized(struct udev_device *udev_device);
-void udev_device_set_usec_initialized(struct udev_device *udev_device, unsigned long long usec_initialized);
+usec_t udev_device_get_usec_initialized(struct udev_device *udev_device);
+void udev_device_set_usec_initialized(struct udev_device *udev_device, usec_t usec_initialized);
int udev_device_get_devlink_priority(struct udev_device *udev_device);
int udev_device_set_devlink_priority(struct udev_device *udev_device, int prio);
int udev_device_get_watch_handle(struct udev_device *udev_device);
@@ -166,7 +167,5 @@ uid_t util_lookup_user(struct udev *udev
gid_t util_lookup_group(struct udev *udev, const char *group);
int util_resolve_subsys_kernel(struct udev *udev, const char *string,
char *result, size_t maxsize, int read_value);
-unsigned long long ts_usec(const struct timespec *ts);
-unsigned long long now_usec(void);
ssize_t print_kmsg(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
#endif
Index: systemd-195/src/libudev/libudev-util.c
===================================================================
--- systemd-195.orig/src/libudev/libudev-util.c
+++ systemd-195/src/libudev/libudev-util.c
@@ -691,23 +691,6 @@ uint64_t util_string_bloom64(const char
return bits;
}
-#define USEC_PER_SEC 1000000ULL
-#define NSEC_PER_USEC 1000ULL
-unsigned long long ts_usec(const struct timespec *ts)
-{
- return (unsigned long long) ts->tv_sec * USEC_PER_SEC +
- (unsigned long long) ts->tv_nsec / NSEC_PER_USEC;
-}
-
-unsigned long long now_usec(void)
-{
- struct timespec ts;
-
- if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0)
- return 0;
- return ts_usec(&ts);
-}
-
ssize_t print_kmsg(const char *fmt, ...)
{
int fd;
Index: systemd-195/src/udev/udev-event.c
===================================================================
--- systemd-195.orig/src/udev/udev-event.c
+++ systemd-195/src/udev/udev-event.c
@@ -48,7 +48,7 @@ struct udev_event *udev_event_new(struct
event->udev = udev;
udev_list_init(udev, &event->run_list, false);
event->fd_signal = -1;
- event->birth_usec = now_usec();
+ event->birth_usec = now(CLOCK_MONOTONIC);
event->timeout_usec = 30 * 1000 * 1000;
return event;
}
@@ -466,9 +466,9 @@ static void spawn_read(struct udev_event
int i;
if (event->timeout_usec > 0) {
- unsigned long long age_usec;
+ usec_t age_usec;
- age_usec = now_usec() - event->birth_usec;
+ age_usec = now(CLOCK_MONOTONIC) - event->birth_usec;
if (age_usec >= event->timeout_usec) {
log_error("timeout '%s'\n", cmd);
goto out;
@@ -554,9 +554,9 @@ static int spawn_wait(struct udev_event
int fdcount;
if (event->timeout_usec > 0) {
- unsigned long long age_usec;
+ usec_t age_usec;
- age_usec = now_usec() - event->birth_usec;
+ age_usec = now(CLOCK_MONOTONIC) - event->birth_usec;
if (age_usec >= event->timeout_usec)
timeout = 1000;
else
@@ -862,7 +862,7 @@ int udev_event_execute_rules(struct udev
if (event->dev_db != NULL && udev_device_get_usec_initialized(event->dev_db) > 0)
udev_device_set_usec_initialized(event->dev, udev_device_get_usec_initialized(event->dev_db));
else if (udev_device_get_usec_initialized(event->dev) == 0)
- udev_device_set_usec_initialized(event->dev, now_usec());
+ udev_device_set_usec_initialized(event->dev, now(CLOCK_MONOTONIC));
/* (re)write database file */
udev_device_update_db(dev);
Index: systemd-195/src/udev/udev-rules.c
===================================================================
--- systemd-195.orig/src/udev/udev-rules.c
+++ systemd-195/src/udev/udev-rules.c
@@ -47,7 +47,7 @@ struct uid_gid {
struct udev_rules {
struct udev *udev;
char **dirs;
- unsigned long long *dirs_ts_usec;
+ usec_t *dirs_ts_usec;
int resolve_names;
/* every key in the rules file becomes a token */
@@ -1691,7 +1691,7 @@ bool udev_rules_check_timestamp(struct u
if (stat(rules->dirs[i], &stats) < 0)
continue;
- if (rules->dirs_ts_usec[i] == ts_usec(&stats.st_mtim))
+ if (rules->dirs_ts_usec[i] == timespec_load(&stats.st_mtim))
continue;
/* first check */
@@ -1701,7 +1701,7 @@ bool udev_rules_check_timestamp(struct u
}
/* update timestamp */
- rules->dirs_ts_usec[i] = ts_usec(&stats.st_mtim);
+ rules->dirs_ts_usec[i] = timespec_load(&stats.st_mtim);
}
out:
return changed;
Index: systemd-195/src/udev/udev.h
===================================================================
--- systemd-195.orig/src/udev/udev.h
+++ systemd-195/src/udev/udev.h
@@ -41,8 +41,8 @@ struct udev_event {
gid_t gid;
struct udev_list run_list;
int exec_delay;
- unsigned long long birth_usec;
- unsigned long long timeout_usec;
+ usec_t birth_usec;
+ usec_t timeout_usec;
int fd_signal;
unsigned int builtin_run;
unsigned int builtin_ret;
Index: systemd-195/src/udev/udevadm-settle.c
===================================================================
--- systemd-195.orig/src/udev/udevadm-settle.c
+++ systemd-195/src/udev/udevadm-settle.c
@@ -47,9 +47,9 @@ static int adm_settle(struct udev *udev,
{ "help", no_argument, NULL, 'h' },
{}
};
- unsigned long long start_usec = now_usec();
- unsigned long long start = 0;
- unsigned long long end = 0;
+ usec_t start_usec = now(CLOCK_MONOTONIC);
+ usec_t start = 0;
+ usec_t end = 0;
int quiet = 0;
const char *exists = NULL;
unsigned int timeout = 120;
@@ -123,7 +123,7 @@ static int adm_settle(struct udev *udev,
start = 0;
end = 0;
}
- log_debug("start=%llu end=%llu current=%llu\n", start, end, kernel_seq);
+ log_debug("start=%llu end=%llu current=%llu\n", (unsigned long long)start, (unsigned long long)end, kernel_seq);
} else {
if (end > 0) {
log_error("seq-end needs seq-start parameter, ignoring\n");
@@ -199,9 +199,9 @@ static int adm_settle(struct udev *udev,
}
if (timeout > 0) {
- unsigned long long age_usec;
+ usec_t age_usec;
- age_usec = now_usec() - start_usec;
+ age_usec = now(CLOCK_MONOTONIC) - start_usec;
if (age_usec / (1000 * 1000) >= timeout) {
struct udev_list_entry *list_entry;
Index: systemd-195/src/udev/udevd.c
===================================================================
--- systemd-195.orig/src/udev/udevd.c
+++ systemd-195/src/udev/udevd.c
@@ -122,7 +122,7 @@ struct worker {
struct udev_monitor *monitor;
enum worker_state state;
struct event *event;
- unsigned long long event_start_usec;
+ usec_t event_start_usec;
};
/* passed from worker to main process */
@@ -378,7 +378,7 @@ out:
worker->monitor = worker_monitor;
worker->pid = pid;
worker->state = WORKER_RUNNING;
- worker->event_start_usec = now_usec();
+ worker->event_start_usec = now(CLOCK_MONOTONIC);
worker->event = event;
event->state = EVENT_RUNNING;
udev_list_node_append(&worker->node, &worker_list);
@@ -409,7 +409,7 @@ static void event_run(struct event *even
worker_ref(worker);
worker->event = event;
worker->state = WORKER_RUNNING;
- worker->event_start_usec = now_usec();
+ worker->event_start_usec = now(CLOCK_MONOTONIC);
event->state = EVENT_RUNNING;
return;
}
@@ -1381,7 +1381,7 @@ int main(int argc, char *argv[])
udev_list_node_init(&worker_list);
for (;;) {
- static unsigned long long last_usec;
+ static usec_t last_usec;
struct epoll_event ev[8];
int fdcount;
int timeout;
@@ -1452,7 +1452,7 @@ int main(int argc, char *argv[])
if (worker->state != WORKER_RUNNING)
continue;
- if ((now_usec() - worker->event_start_usec) > 30 * 1000 * 1000) {
+ if ((now(CLOCK_MONOTONIC) - worker->event_start_usec) > 30 * 1000 * 1000) {
log_error("worker [%u] %s timeout; kill it\n", worker->pid,
worker->event ? worker->event->devpath : "<idle>");
kill(worker->pid, SIGKILL);
@@ -1486,13 +1486,13 @@ int main(int argc, char *argv[])
}
/* check for changed config, every 3 seconds at most */
- if ((now_usec() - last_usec) > 3 * 1000 * 1000) {
+ if ((now(CLOCK_MONOTONIC) - last_usec) > 3 * 1000 * 1000) {
if (udev_rules_check_timestamp(rules))
reload = true;
if (udev_builtin_validate(udev))
reload = true;
- last_usec = now_usec();
+ last_usec = now(CLOCK_MONOTONIC);
}
/* reload requested, HUP signal received, rules changed, builtin changed */
@@ -1512,7 +1512,7 @@ int main(int argc, char *argv[])
dev = udev_monitor_receive_device(monitor);
if (dev != NULL) {
- udev_device_set_usec_initialized(dev, now_usec());
+ udev_device_set_usec_initialized(dev, now(CLOCK_MONOTONIC));
if (rules == NULL)
rules = udev_rules_new(udev, resolve_names);
if (event_queue_insert(dev) < 0)
++++++ 1018-keymap-add-aditional-support.patch ++++++
Index: systemd-195/Makefile.am
===================================================================
--- systemd-195.orig/Makefile.am
+++ systemd-195/Makefile.am
@@ -2246,6 +2246,8 @@ dist_udevkeymap_DATA = \
keymaps/hewlett-packard-presario-2100 \
keymaps/hewlett-packard-tablet \
keymaps/hewlett-packard-tx2 \
+ keymaps/hewlett-packard_elitebook-8440p \
+ keymaps/hewlett-packard-hdx9494nr \
keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
keymaps/inventec-symphony_6.0_7.0 \
keymaps/lenovo-3000 \
Index: systemd-195/keymaps/hewlett-packard-hdx9494nr
===================================================================
--- /dev/null
+++ systemd-195/keymaps/hewlett-packard-hdx9494nr
@@ -0,0 +1,3 @@
+0xB2 www # FnF3
+0xD8 f23 # touchpad off
+0xD9 f22 # touchpad on
Index: systemd-195/keymaps/hewlett-packard_elitebook-8440p
===================================================================
--- /dev/null
+++ systemd-195/keymaps/hewlett-packard_elitebook-8440p
@@ -0,0 +1,5 @@
+0x88 www
+0xA0 mute
+0xAE volumedown
+0xB0 volumeup
+0xEC mail
Index: systemd-195/src/udev/keymap/95-keyboard-force-release.rules
===================================================================
--- systemd-195.orig/src/udev/keymap/95-keyboard-force-release.rules
+++ systemd-195/src/udev/keymap/95-keyboard-force-release.rules
@@ -42,7 +42,7 @@ ENV{DMI_VENDOR}=="Viooo Corporation", AT
# These are all the HP laptops that setup a touchpad toggle key
ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[pP][aA][vV][iI][lL][iI][oO][nN]*", RUN+="keyboard-force-release.sh $devpath hp-other"
ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][xX]2*", RUN+="keyboard-force-release.sh $devpath hp-other"
-ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*|HP G60 Notebook PC", RUN+="keyboard-force-release.sh $devpath hp-other"
+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*|HP G60 Notebook PC|HDX9494NR", RUN+="keyboard-force-release.sh $devpath hp-other"
ENV{DMI_VENDOR}=="Zepto", ATTR{[dmi/id]product_name}=="Znote 6615WD", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
Index: systemd-195/src/udev/keymap/95-keymap.rules
===================================================================
--- systemd-195.orig/src/udev/keymap/95-keymap.rules
+++ systemd-195/src/udev/keymap/95-keymap.rules
@@ -96,7 +96,9 @@ ENV{DMI_VENDOR}=="Hewlett-Packard*", ATT
ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][xX]2*", RUN+="keymap $name hewlett-packard-tx2"
ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="Presario 2100*", RUN+="keymap $name hewlett-packard-presario-2100"
ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP G62 Notebook PC", RUN+="keymap $name 0xB2 www"
-ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP ProBook*", RUN+="keymap $name 0xF8 rfkill"
+ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP ProBook*", RUN+="keymap $name 0xF8 rfkill 0xB2 www"
+ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP EliteBook 8440p", RUN+="keymap $name hewlett-packard_elitebook-8440p"
+ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HDX9494NR", RUN+="keymap $name hewlett-packard-hdx9494nr"
# HP Pavillion dv6315ea has empty DMI_VENDOR
ATTR{[dmi/id]board_vendor}=="Quanta", ATTR{[dmi/id]board_name}=="30B7", ATTR{[dmi/id]board_version}=="65.2B", RUN+="keymap $name 0x88 media" # "quick play
++++++ 1019-udev-Fix-device-matching-in-the-accelerometer.patch ++++++
>From 1d010426c01044350b2b32d8b3af5d064f7dfe27 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess(a)hadess.net>
Date: Thu, 10 Jan 2013 14:23:23 +0100
Subject: [PATCH] udev: Fix device matching in the accelerometer
As we were searching by ID_PATH, it would have been possible
for us to find a sibling device instead of the device we were
looking for.
This fixes device matching on the WeTab with the upstream kernel,
as it was trying to use the "Asus Laptop extra buttons" device
instead of the accelerometer.
---
src/udev/accelerometer/accelerometer.c | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)
diff --git a/src/udev/accelerometer/accelerometer.c b/src/udev/accelerometer/accelerometer.c
index 21f5193..2fea388 100644
--- a/src/udev/accelerometer/accelerometer.c
+++ b/src/udev/accelerometer/accelerometer.c
@@ -257,7 +257,6 @@ int main (int argc, char** argv)
char devpath[PATH_MAX];
char *devnode;
- const char *id_path;
struct udev_enumerate *enumerate;
struct udev_list_entry *list_entry;
@@ -303,18 +302,10 @@ int main (int argc, char** argv)
return 1;
}
- id_path = udev_device_get_property_value(dev, "ID_PATH");
- if (id_path == NULL) {
- fprintf (stderr, "unable to get property ID_PATH for '%s'", devpath);
- return 0;
- }
-
/* Get the children devices and find the devnode */
- /* FIXME: use udev_enumerate_add_match_parent() instead */
devnode = NULL;
enumerate = udev_enumerate_new(udev);
- udev_enumerate_add_match_property(enumerate, "ID_PATH", id_path);
- udev_enumerate_add_match_subsystem(enumerate, "input");
+ udev_enumerate_add_match_parent(enumerate, dev);
udev_enumerate_scan_devices(enumerate);
udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(enumerate)) {
struct udev_device *device;
--
1.7.7
++++++ 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch ++++++
>From 2ffcfb9b45262271019d1751cafc895c3dae8f0e Mon Sep 17 00:00:00 2001
From: Robert Milasan <rmilasan(a)suse.com>
Date: Sun, 10 Feb 2013 11:00:20 +0100
Subject: [PATCH] usb_id: some strange devices have a very bogus or strange serial
numer, making a mess in /dev/disk/by-id. Let's check if the
serial number is a valid, otherwise don't use it.
---
src/udev/udev-builtin-usb_id.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
Index: systemd-195/src/udev/udev-builtin-usb_id.c
===================================================================
--- systemd-195.orig/src/udev/udev-builtin-usb_id.c
+++ systemd-195/src/udev/udev-builtin-usb_id.c
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
@@ -31,6 +32,26 @@
#include "udev.h"
+static bool valid_string(const char *str)
+{
+ const char *s;
+
+ if (!str)
+ return false;
+
+ for (s = str; *s != '\0'; s++) {
+ if ((*s >= 'a' && *s <= 'z') ||
+ (*s >= 'A' && *s <= 'Z') ||
+ (*s >= '0' && *s <= '9') ||
+ *s == '-' || *s == '_')
+ continue;
+ else
+ return false;
+ }
+
+ return true;
+}
+
static void set_usb_iftype(char *to, int if_class_num, size_t len)
{
const char *type = "generic";
@@ -428,10 +449,10 @@ fallback:
}
if (serial_str[0] == '\0') {
- const char *usb_serial;
+ const char *usb_serial = NULL;
usb_serial = udev_device_get_sysattr_value(dev_usb, "serial");
- if (usb_serial) {
+ if (valid_string(usb_serial)) {
util_replace_whitespace(usb_serial, serial_str, sizeof(serial_str)-1);
util_replace_chars(serial_str, NULL);
}
++++++ 1021-create-default-links-for-primary-cd_dvd-drive.patch ++++++
Index: systemd-195/rules/60-cdrom_id.rules
===================================================================
--- systemd-195.orig/rules/60-cdrom_id.rules
+++ systemd-195/rules/60-cdrom_id.rules
@@ -15,6 +15,9 @@ ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdr
# enable the receiving of media eject button events
IMPORT{program}="cdrom_id --lock-media $devnode"
-KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
+KERNEL=="sr0", ENV{ID_CDROM}=="1", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
+KERNEL=="sr0", ENV{ID_CDROM_CD_RW}=="1", SYMLINK+="cdrw", OPTIONS+="link_priority=-100"
+KERNEL=="sr0", ENV{ID_CDROM_DVD}=="1", SYMLINK+="dvd", OPTIONS+="link_priority=-100"
+KERNEL=="sr0", ENV{ID_CDROM_DVD_RW}=="1", SYMLINK+="dvdrw", OPTIONS+="link_priority=-100"
LABEL="cdrom_end"
++++++ 1022-udev-use-unique-names-for-temporary-files-created-in.patch ++++++
Index: systemd-195/src/udev/udev-node.c
===================================================================
--- systemd-195.orig/src/udev/udev-node.c
+++ systemd-195/src/udev/udev-node.c
@@ -31,15 +31,13 @@
#include "udev.h"
-#define TMP_FILE_EXT ".udev-tmp"
-
-static int node_symlink(struct udev *udev, const char *node, const char *slink)
+static int node_symlink(struct udev_device *dev, const char *node, const char *slink)
{
struct stat stats;
char target[UTIL_PATH_SIZE];
char *s;
size_t l;
- char slink_tmp[UTIL_PATH_SIZE + sizeof(TMP_FILE_EXT)];
+ char slink_tmp[UTIL_PATH_SIZE + 32];
int i = 0;
int tail = 0;
int err = 0;
@@ -101,7 +99,7 @@ static int node_symlink(struct udev *ude
}
log_debug("atomically replace '%s'\n", slink);
- util_strscpyl(slink_tmp, sizeof(slink_tmp), slink, TMP_FILE_EXT, NULL);
+ util_strscpyl(slink_tmp, sizeof(slink_tmp), slink, ".tmp-", udev_device_get_id_filename(dev), NULL);
unlink(slink_tmp);
do {
err = mkdir_parents_label(slink_tmp, 0755);
@@ -204,7 +202,7 @@ static void link_update(struct udev_devi
util_delete_path(udev, slink);
} else {
log_debug("creating link '%s' to '%s'\n", slink, target);
- node_symlink(udev, target, slink);
+ node_symlink(dev, target, slink);
}
if (add) {
@@ -304,7 +302,6 @@ out:
void udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid)
{
- struct udev *udev = udev_device_get_udev(dev);
char filename[UTIL_PATH_SIZE];
struct udev_list_entry *list_entry;
@@ -318,7 +315,7 @@ void udev_node_add(struct udev_device *d
snprintf(filename, sizeof(filename), "/dev/%s/%u:%u",
strcmp(udev_device_get_subsystem(dev), "block") == 0 ? "block" : "char",
major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev)));
- node_symlink(udev, udev_device_get_devnode(dev), filename);
+ node_symlink(dev, udev_device_get_devnode(dev), filename);
/* create/update symlinks, add symlinks to name index */
udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev))
++++++ 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch ++++++
>From a0ec302b9309bc56f6bed6162e47ad6c27165747 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald(a)redhat.com>
Date: Tue, 12 Feb 2013 15:19:38 +0100
Subject: [PATCH] cdrom_id: add data track count for bad virtual drive
implementations
Organization: SUSE Linux
/# /lib/udev/cdrom_id --debug /dev/sr0
probing: '/dev/sr0'
INQUIRY: [AMI ][Virtual CDROM ][1.00]
GET CONFIGURATION failed with SK=5h/ASC=20h/ACQ=00h
drive is pre-MMC2 and does not support 46h get configuration command
trying to work around the problem
READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h
no current profile, but disc is present; assuming CD-ROM
READ TOC: len: 12, start track: 1, end track: 1
last track 1 starts at block 0
READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h
ID_CDROM=1
ID_CDROM_MEDIA=1
ID_CDROM_MEDIA_CD=1
What is missing here is ID_CDROM_MEDIA_TRACK_COUNT_DATA to trigger
blkid in /lib/udev/rules.d/60-persistent-storage.rules
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*",
ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*",
ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \
IMPORT{builtin}="blkid --noraid"
Signed-off-by: Robert Milasan <rmilasan(a)suse.com>
---
src/udev/cdrom_id/cdrom_id.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c
index 1056536..b659cc3 100644
--- a/src/udev/cdrom_id/cdrom_id.c
+++ b/src/udev/cdrom_id/cdrom_id.c
@@ -513,6 +513,8 @@ static int cd_profiles_old_mmc(struct udev *udev, int fd)
if (cd_media == 1) {
log_debug("no current profile, but disc is present; assuming CD-ROM\n");
cd_media_cd_rom = 1;
+ cd_media_track_count = 1;
+ cd_media_track_count_data = 1;
return 0;
} else {
log_debug("no current profile, assuming no media\n");
--
1.7.7
++++++ 1024-udev-usb_id-parse-only-size-bytes-of-the-descriptors.patch ++++++
>From 7962afbba9016ea03d9f2987fee341443fcde39d Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay(a)vrfy.org>
Date: Sun, 17 Feb 2013 21:16:56 +0100
Subject: [PATCH] udev: usb_id: parse only 'size' bytes of the 'descriptors'
buffer
Signed-off-by: Robert Milasan <rmilasan(a)suse.com>
---
src/udev/udev-builtin-usb_id.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Index: systemd-195/src/udev/udev-builtin-usb_id.c
===================================================================
--- systemd-195.orig/src/udev/udev-builtin-usb_id.c
+++ systemd-195/src/udev/udev-builtin-usb_id.c
@@ -210,7 +210,7 @@ static int dev_if_packed_info(struct ude
pos = 0;
strpos = 0;
ifs_str[0] = '\0';
- while (pos < sizeof(buf) && strpos+7 < len-2) {
+ while (pos < size && strpos+7 < len-2) {
struct usb_interface_descriptor *desc;
char if_str[8];
++++++ 1025-udev-expose-new-ISO9660-properties-from-libblkid.patch ++++++
>From ddb5bee15a6ad71e5b596c035c1ee4dc04d5fd2e Mon Sep 17 00:00:00 2001
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
Date: Sun, 17 Feb 2013 03:21:27 +0200
Subject: [PATCH] udev: expose new ISO9660 properties from libblkid
Signed-off-by: Robert Milasan <rmilasan(a)suse.com>
---
src/udev/udev-builtin-blkid.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
Index: systemd-195/src/udev/udev-builtin-blkid.c
===================================================================
--- systemd-195.orig/src/udev/udev-builtin-blkid.c
+++ systemd-195/src/udev/udev-builtin-blkid.c
@@ -78,6 +78,22 @@ static void print_property(struct udev_d
} else if (startswith(name, "PART_ENTRY_")) {
util_strscpyl(s, sizeof(s), "ID_", name, NULL);
udev_builtin_add_property(dev, test, s, value);
+
+ } else if (streq(name, "SYSTEM_ID")) {
+ blkid_encode_string(value, s, sizeof(s));
+ udev_builtin_add_property(dev, test, "ID_FS_SYSTEM_ID", s);
+
+ } else if (streq(name, "PUBLISHER_ID")) {
+ blkid_encode_string(value, s, sizeof(s));
+ udev_builtin_add_property(dev, test, "ID_FS_PUBLISHER_ID", s);
+
+ } else if (streq(name, "APPLICATION_ID")) {
+ blkid_encode_string(value, s, sizeof(s));
+ udev_builtin_add_property(dev, test, "ID_FS_APPLICATION_ID", s);
+
+ } else if (streq(name, "BOOT_SYSTEM_ID")) {
+ blkid_encode_string(value, s, sizeof(s));
+ udev_builtin_add_property(dev, test, "ID_FS_BOOT_SYSTEM_ID", s);
}
}
++++++ 1026-re-add-persistent-net.patch ++++++
Index: systemd-195/src/udev/rule_generator/75-persistent-net-generator.rules
===================================================================
--- /dev/null
+++ systemd-195/src/udev/rule_generator/75-persistent-net-generator.rules
@@ -0,0 +1,102 @@
+# do not edit this file, it will be overwritten on update
+
+# these rules generate rules for persistent network device naming
+#
+# variables used to communicate:
+# MATCHADDR MAC address used for the match
+# MATCHID bus_id used for the match
+# MATCHDRV driver name used for the match
+# MATCHIFTYPE interface type match
+# COMMENT comment to add to the generated rule
+# INTERFACE_NAME requested name supplied by external tool
+# INTERFACE_NEW new interface name returned by rule writer
+
+ACTION!="add", GOTO="persistent_net_generator_end"
+SUBSYSTEM!="net", GOTO="persistent_net_generator_end"
+
+# ignore the interface if a name has already been set
+NAME=="?*", GOTO="persistent_net_generator_end"
+
+# device name whitelist
+KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", GOTO="persistent_net_generator_end"
+
+# ignore Xen virtual interfaces
+SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end"
+
+# read MAC address
+ENV{MATCHADDR}="$attr{address}"
+
+# match interface type
+ENV{MATCHIFTYPE}="$attr{type}"
+
+# ignore KVM virtual interfaces
+ENV{MATCHADDR}=="52:54:00:*", GOTO="persistent_net_generator_end"
+# ignore VMWare virtual interfaces
+ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*", GOTO="persistent_net_generator_end"
+# ignore Hyper-V virtual interfaces
+ENV{MATCHADDR}=="00:15:5d:*", GOTO="persistent_net_generator_end"
+
+# These vendors are known to violate the local MAC address assignment scheme
+# Interlan, DEC (UNIBUS or QBUS), Apollo, Cisco, Racal-Datacom
+ENV{MATCHADDR}=="02:07:01:*", GOTO="globally_administered_whitelist"
+# 3Com
+ENV{MATCHADDR}=="02:60:60:*", GOTO="globally_administered_whitelist"
+# 3Com IBM PC; Imagen; Valid; Cisco; Apple
+ENV{MATCHADDR}=="02:60:8c:*", GOTO="globally_administered_whitelist"
+# Intel
+ENV{MATCHADDR}=="02:a0:c9:*", GOTO="globally_administered_whitelist"
+# Olivetti
+ENV{MATCHADDR}=="02:aa:3c:*", GOTO="globally_administered_whitelist"
+# CMC Masscomp; Silicon Graphics; Prime EXL
+ENV{MATCHADDR}=="02:cf:1f:*", GOTO="globally_administered_whitelist"
+# Prominet Corporation Gigabit Ethernet Switch
+ENV{MATCHADDR}=="02:e0:3b:*", GOTO="globally_administered_whitelist"
+# BTI (Bus-Tech, Inc.) IBM Mainframes
+ENV{MATCHADDR}=="02:e6:d3:*", GOTO="globally_administered_whitelist"
+# Realtek
+ENV{MATCHADDR}=="52:54:00:*", GOTO="globally_administered_whitelist"
+# Novell 2000
+ENV{MATCHADDR}=="52:54:4c:*", GOTO="globally_administered_whitelist"
+# Realtec
+ENV{MATCHADDR}=="52:54:ab:*", GOTO="globally_administered_whitelist"
+# Kingston Technologies
+ENV{MATCHADDR}=="e2:0c:0f:*", GOTO="globally_administered_whitelist"
+# Xensource
+ENV{MATCHADDR}=="00:16:3e:*", GOTO="globally_administered_whitelist"
+
+# match interface dev_id
+ATTR{dev_id}=="?*", ENV{MATCHDEVID}="$attr{dev_id}"
+
+# do not use "locally administered" MAC address
+ENV{MATCHADDR}=="?[2367abef]:*", ENV{MATCHADDR}=""
+
+# do not use empty address
+ENV{MATCHADDR}=="00:00:00:00:00:00", ENV{MATCHADDR}=""
+
+LABEL="globally_administered_whitelist"
+
+# build comment line for generated rule:
+SUBSYSTEMS=="pci", ENV{COMMENT}="PCI device $attr{vendor}:$attr{device} ($driver)"
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="?*", ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct} ($driver)"
+SUBSYSTEMS=="pcmcia", ENV{COMMENT}="PCMCIA device $attr{card_id}:$attr{manf_id} ($driver)"
+SUBSYSTEMS=="ieee1394", ENV{COMMENT}="Firewire device $attr{host_id})"
+
+# ibmveth likes to use "locally administered" MAC addresses
+DRIVERS=="ibmveth", ENV{MATCHADDR}="$attr{address}", ENV{COMMENT}="ibmveth ($id)"
+
+# S/390 uses id matches only, do not use MAC address match
+SUBSYSTEMS=="ccwgroup", ENV{COMMENT}="S/390 $driver device at $id", ENV{MATCHID}="$id", ENV{MATCHDRV}="$driver", ENV{MATCHADDR}=""
+
+# see if we got enough data to create a rule
+ENV{MATCHADDR}=="", ENV{MATCHID}=="", ENV{INTERFACE_NAME}=="", GOTO="persistent_net_generator_end"
+
+# default comment
+ENV{COMMENT}=="", ENV{COMMENT}="net device ($attr{driver})"
+
+# write rule
+DRIVERS=="?*", IMPORT{program}="write_net_rules"
+
+# rename interface if needed
+ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}"
+
+LABEL="persistent_net_generator_end"
Index: systemd-195/src/udev/rule_generator/rule_generator.functions
===================================================================
--- /dev/null
+++ systemd-195/src/udev/rule_generator/rule_generator.functions
@@ -0,0 +1,113 @@
+# functions used by the udev rule generator
+
+# Copyright (C) 2006 Marco d'Itri <md(a)Linux.IT>
+
+# 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/>.
+
+PATH='/usr/bin:/bin:/usr/sbin:/sbin'
+
+# Read a single line from file $1 in the $DEVPATH directory.
+# The function must not return an error even if the file does not exist.
+sysread() {
+ local file="$1"
+ [ -e "/sys$DEVPATH/$file" ] || return 0
+ local value
+ read value < "/sys$DEVPATH/$file" || return 0
+ echo "$value"
+}
+
+sysreadlink() {
+ local file="$1"
+ [ -e "/sys$DEVPATH/$file" ] || return 0
+ readlink -f /sys$DEVPATH/$file 2> /dev/null || true
+}
+
+# Return true if a directory is writeable.
+writeable() {
+ if ln -s test-link $1/.is-writeable 2> /dev/null; then
+ rm -f $1/.is-writeable
+ return 0
+ else
+ return 1
+ fi
+}
+
+# Create a lock file for the current rules file.
+lock_rules_file() {
+ RUNDIR="/run/udev"
+ [ -e "$RUNDIR" ] || return 0
+
+ RULES_LOCK="$RUNDIR/.lock-${RULES_FILE##*/}"
+
+ retry=30
+ while ! mkdir $RULES_LOCK 2> /dev/null; do
+ if [ $retry -eq 0 ]; then
+ echo "Cannot lock $RULES_FILE!" >&2
+ exit 2
+ fi
+ sleep 1
+ retry=$(($retry - 1))
+ done
+}
+
+unlock_rules_file() {
+ [ "$RULES_LOCK" ] || return 0
+ rmdir $RULES_LOCK || true
+}
+
+# Choose the real rules file if it is writeable or a temporary file if not.
+# Both files should be checked later when looking for existing rules.
+choose_rules_file() {
+ RUNDIR="/run/udev"
+ local tmp_rules_file="$RUNDIR/tmp-rules--${RULES_FILE##*/}"
+ [ -e "$RULES_FILE" -o -e "$tmp_rules_file" ] || PRINT_HEADER=1
+
+ if writeable ${RULES_FILE%/*}; then
+ RO_RULES_FILE='/dev/null'
+ else
+ RO_RULES_FILE=$RULES_FILE
+ RULES_FILE=$tmp_rules_file
+ fi
+}
+
+# Return the name of the first free device.
+raw_find_next_available() {
+ local links="$1"
+
+ local basename=${links%%[ 0-9]*}
+ local max=-1
+ for name in $links; do
+ local num=${name#$basename}
+ [ "$num" ] || num=0
+ [ $num -gt $max ] && max=$num
+ done
+
+ local max=$(($max + 1))
+ # "name0" actually is just "name"
+ [ $max -eq 0 ] && return
+ echo "$max"
+}
+
+# Find all rules matching a key (with action) and a pattern.
+find_all_rules() {
+ local key="$1"
+ local linkre="$2"
+ local match="$3"
+
+ local search='.*[[:space:],]'"$key"'"('"$linkre"')".*'
+ echo $(sed -n -r -e 's/^#.*//' -e "${match}s/${search}/\1/p" \
+ $RO_RULES_FILE \
+ $([ -e $RULES_FILE ] && echo $RULES_FILE) \
+ 2>/dev/null)
+}
Index: systemd-195/Makefile.in
===================================================================
--- systemd-195.orig/Makefile.in
+++ systemd-195/Makefile.in
@@ -1743,7 +1743,9 @@ am_v4l_id_OBJECTS = src/udev/v4l_id/v4l_
v4l_id_OBJECTS = $(am_v4l_id_OBJECTS)
v4l_id_DEPENDENCIES = libudev.la
am__dist_udevhome_SCRIPTS_DIST = src/udev/keymap/findkeyboards \
- src/udev/keymap/keyboard-force-release.sh
+ src/udev/keymap/keyboard-force-release.sh \
+ src/udev/rule_generator/rule_generator.functions \
+ src/udev/rule_generator/write_net_rules
SCRIPTS = $(dist_bin_SCRIPTS) $(dist_udevhome_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -2051,7 +2053,8 @@ am__dist_udevrules_DATA_DIST = rules/99-
src/udev/keymap/95-keymap.rules \
src/udev/keymap/95-keyboard-force-release.rules \
rules/75-probe_mtd.rules src/login/70-uaccess.rules \
- src/login/70-power-switch.rules
+ src/login/70-power-switch.rules \
+ src/udev/rule_generator/75-persistent-net-generator.rules
DATA = $(dbusinterface_DATA) $(dist_bashcompletion_DATA) \
$(dist_dbuspolicy_DATA) $(dist_dbussystemservice_DATA) \
$(dist_doc_DATA) $(dist_gatewayddocumentroot_DATA) \
Index: systemd-195/Makefile.am
===================================================================
--- systemd-195.orig/Makefile.am
+++ systemd-195/Makefile.am
@@ -2179,6 +2179,14 @@ EXTRA_DIST += \
# ------------------------------------------------------------------------------
+dist_udevhome_SCRIPTS = \
+ src/udev/rule_generator/rule_generator.functions \
+ src/udev/rule_generator/write_net_rules
+
+dist_udevrules_DATA += \
+ src/udev/rule_generator/75-persistent-net-generator.rules
+
+# ------------------------------------------------------------------------------
if ENABLE_KEYMAP
keymap_SOURCES = \
src/udev/keymap/keymap.c
@@ -2206,7 +2214,7 @@ dist_udevrules_DATA += \
src/udev/keymap/95-keymap.rules \
src/udev/keymap/95-keyboard-force-release.rules
-dist_udevhome_SCRIPTS = \
+dist_udevhome_SCRIPTS += \
src/udev/keymap/findkeyboards \
src/udev/keymap/keyboard-force-release.sh
Index: systemd-195/src/udev/rule_generator/write_net_rules
===================================================================
--- /dev/null
+++ systemd-195/src/udev/rule_generator/write_net_rules
@@ -0,0 +1,145 @@
+#!/bin/sh -e
+
+# This script is run to create persistent network device naming rules
+# based on properties of the device.
+# If the interface needs to be renamed, INTERFACE_NEW=<name> will be printed
+# on stdout to allow udev to IMPORT it.
+
+# variables used to communicate:
+# MATCHADDR MAC address used for the match
+# MATCHID bus_id used for the match
+# MATCHDEVID dev_id used for the match
+# MATCHDRV driver name used for the match
+# MATCHIFTYPE interface type match
+# COMMENT comment to add to the generated rule
+# INTERFACE_NAME requested name supplied by external tool
+# INTERFACE_NEW new interface name returned by rule writer
+
+# Copyright (C) 2006 Marco d'Itri <md(a)Linux.IT>
+# Copyright (C) 2007 Kay Sievers <kay.sievers(a)vrfy.org>
+#
+# 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/>.
+
+# debug, if UDEV_LOG=<debug>
+if [ -n "$UDEV_LOG" ]; then
+ if [ "$UDEV_LOG" -ge 7 ]; then
+ set -x
+ fi
+fi
+
+RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules'
+
+if [ -e /usr/lib/udev/rule_generator.functions ]; then
+ . /usr/lib/udev/rule_generator.functions
+else
+ . /lib/udev/rule_generator.functions
+fi
+
+interface_name_taken() {
+ local value="$(find_all_rules 'NAME=' $INTERFACE)"
+ if [ "$value" ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+find_next_available() {
+ raw_find_next_available "$(find_all_rules 'NAME=' "$1")"
+}
+
+write_rule() {
+ local match="$1"
+ local name="$2"
+ local comment="$3"
+
+ {
+ if [ "$PRINT_HEADER" ]; then
+ PRINT_HEADER=
+ echo "# This file was automatically generated by the $0"
+ echo "# program, run by the persistent-net-generator.rules rules file."
+ echo "#"
+ echo "# You can modify it, as long as you keep each rule on a single"
+ echo "# line, and change only the value of the NAME= key."
+ fi
+
+ echo ""
+ [ "$comment" ] && echo "# $comment"
+ echo "SUBSYSTEM==\"net\", ACTION==\"add\"$match, NAME=\"$name\""
+ } >> $RULES_FILE
+}
+
+if [ -z "$INTERFACE" ]; then
+ echo "missing \$INTERFACE" >&2
+ exit 1
+fi
+
+# Prevent concurrent processes from modifying the file at the same time.
+lock_rules_file
+
+# Check if the rules file is writeable.
+choose_rules_file
+
+# the DRIVERS key is needed to not match bridges and VLAN sub-interfaces
+if [ "$MATCHADDR" ]; then
+ match="$match, DRIVERS==\"?*\", ATTR{address}==\"$MATCHADDR\""
+fi
+
+if [ "$MATCHDRV" ]; then
+ match="$match, DRIVERS==\"$MATCHDRV\""
+fi
+
+if [ "$MATCHDEVID" ]; then
+ match="$match, ATTR{dev_id}==\"$MATCHDEVID\""
+fi
+
+if [ "$MATCHID" ]; then
+ match="$match, KERNELS==\"$MATCHID\""
+fi
+
+if [ "$MATCHIFTYPE" ]; then
+ match="$match, ATTR{type}==\"$MATCHIFTYPE\""
+fi
+
+if [ -z "$match" ]; then
+ echo "missing valid match" >&2
+ unlock_rules_file
+ exit 1
+fi
+
+basename=${INTERFACE%%[0-9]*}
+match="$match, KERNEL==\"$basename*\""
+
+if [ "$INTERFACE_NAME" ]; then
+ # external tools may request a custom name
+ COMMENT="$COMMENT (custom name provided by external tool)"
+ if [ "$INTERFACE_NAME" != "$INTERFACE" ]; then
+ INTERFACE=$INTERFACE_NAME;
+ echo "INTERFACE_NEW=$INTERFACE"
+ fi
+else
+ # if a rule using the current name already exists, find a new name
+ if interface_name_taken; then
+ INTERFACE="$basename$(find_next_available "$basename[0-9]*")"
+ # prevent INTERFACE from being "eth" instead of "eth0"
+ [ "$INTERFACE" = "${INTERFACE%%[ \[\]0-9]*}" ] && INTERFACE=${INTERFACE}0
+ echo "INTERFACE_NEW=$INTERFACE"
+ fi
+fi
+
+write_rule "$match" "$INTERFACE" "$COMMENT"
+
+unlock_rules_file
+
+exit 0
++++++ 1027-udev-always-rename-network.patch ++++++
Index: systemd-195/src/udev/udev-event.c
===================================================================
--- systemd-195.orig/src/udev/udev-event.c
+++ systemd-195/src/udev/udev-event.c
@@ -750,6 +750,7 @@ static int rename_netif(struct udev_even
struct udev_device *dev = event->dev;
int sk;
struct ifreq ifr;
+ int loop;
int err;
log_debug("changing net interface name from '%s' to '%s'\n",
@@ -766,12 +767,51 @@ static int rename_netif(struct udev_even
util_strscpy(ifr.ifr_name, IFNAMSIZ, udev_device_get_sysname(dev));
util_strscpy(ifr.ifr_newname, IFNAMSIZ, event->name);
err = ioctl(sk, SIOCSIFNAME, &ifr);
- if (err >= 0) {
+ if (err == 0) {
print_kmsg("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname);
- } else {
+ goto out;
+ }
+
+ /* keep trying if the destination interface name already exists */
+ err = -errno;
+ if (err != -EEXIST) {
+ goto out;
+ }
+
+ /* free our own name, another process may wait for us */
+ snprintf(ifr.ifr_newname, IFNAMSIZ, "rename%u", udev_device_get_ifindex(dev));
+ err = ioctl(sk, SIOCSIFNAME, &ifr);
+ if (err < 0) {
err = -errno;
- log_error("error changing net interface name %s to %s: %m\n", ifr.ifr_name, ifr.ifr_newname);
+ goto out;
}
+
+ /* log temporary name */
+ print_kmsg("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname);
+
+ /* wait a maximum of 90 seconds for our target to become available */
+ util_strscpy(ifr.ifr_name, IFNAMSIZ, ifr.ifr_newname);
+ util_strscpy(ifr.ifr_newname, IFNAMSIZ, event->name);
+ loop = 90 * 20;
+ while (loop--) {
+ const struct timespec duration = { 0, 1000 * 1000 * 1000 / 20 };
+
+ log_debug("wait for netif '%s' to become free, loop=%i\n", event->name, (90 * 20) - loop);
+ nanosleep(&duration, NULL);
+
+ err = ioctl(sk, SIOCSIFNAME, &ifr);
+ if (err == 0) {
+ print_kmsg("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname);
+ break;
+ }
+ err = -errno;
+ if (err != -EEXIST)
+ break;
+ }
+
+out:
+ if (err < 0)
+ log_error("error changing net interface name %s to %s: %m\n", ifr.ifr_name, ifr.ifr_newname);
close(sk);
return err;
}
++++++ 1028-rules-drivers-always-call-kmod-even-when-a-driver-is.patch ++++++
>From bf7f800f2b3e93ccd1229d4717166f3a4d3af72f Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay(a)vrfy.org>
Date: Sat, 20 Jul 2013 14:29:12 +0200
Subject: [PATCH] rules: drivers - always call kmod, even when a driver is
bound to the device
On Sat, Jul 20, 2013 at 12:56 PM, Rafael J. Wysocki <rjw(a)sisk.pl> wrote:
> After a recent change present in 3.11-rc1 there is a driver, called processor,
> that can be bound to the CPU devices whose sysfs directories are located under
> /sys/devices/system/cpu/. A side effect of this is that, after the driver has
> been bound to those devices, the kernel adds DRIVER=processor to ENV for CPU
> uevents and they don't match the default rule for autoloading modules matching
> MODALIAS:
>
> DRIVER!="?*", ENV{MODALIAS}=="?*", IMPORT{builtin}="kmod load $env{MODALIAS}"
>
> any more. However, there are some modules whose module aliases match specific
> CPU features through the modalias string and those modules should be loaded
> automatically if a compatible CPU is present. Yet, with the processor driver
> bound to the CPU devices the above rule is not sufficient for that, so we need
> a new default udev rule allowing those modules to be autoloaded even if the
> CPU devices have drivers.
Signed-off-by: Robert Milasan <rmilasan(a)suse.com>
---
rules/80-drivers.rules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/rules/80-drivers.rules
===================================================================
--- systemd-195.orig/rules/80-drivers.rules
+++ systemd-195/rules/80-drivers.rules
@@ -2,7 +2,7 @@
ACTION=="remove", GOTO="drivers_end"
-DRIVER!="?*", ENV{MODALIAS}=="?*", IMPORT{builtin}="kmod load $env{MODALIAS}"
+ENV{MODALIAS}=="?*", IMPORT{builtin}="kmod load $env{MODALIAS}"
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", IMPORT{builtin}="kmod load tifm_sd"
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", IMPORT{builtin}="kmod load tifm_ms"
SUBSYSTEM=="memstick", IMPORT{builtin}="kmod load ms_block mspro_block"
++++++ agetty-overrides-term.patch ++++++
>From 2161de72c517d34d1ceb9b4c1a300f0b54ce5a9c Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Mon, 29 Oct 2012 21:59:34 +0100
Subject: [PATCH] units: agetty overrides TERM
Environment=TERM=... has no effect on agetty who sets it by itself. To
really set TERM to a specified value, it has to be given on the command
line.
https://bugzilla.redhat.com/show_bug.cgi?id=870622
---
units/getty@.service.m4 | 3 +--
units/serial-getty@.service.m4 | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
Index: systemd-195/units/getty@.service.m4
===================================================================
--- systemd-195.orig/units/getty@.service.m4
+++ systemd-195/units/getty@.service.m4
@@ -41,9 +41,8 @@ IgnoreOnIsolate=yes
ConditionPathExists=/dev/tty0
[Service]
-Environment=TERM=linux
# the VT is cleared by TTYVTDisallocate
-ExecStart=-/sbin/agetty --noclear %I 38400
+ExecStart=-/sbin/agetty --noclear %I 38400 linux
Type=idle
Restart=always
RestartSec=0
Index: systemd-195/units/serial-getty@.service.m4
===================================================================
--- systemd-195.orig/units/serial-getty@.service.m4
+++ systemd-195/units/serial-getty@.service.m4
@@ -37,8 +37,7 @@ Before=getty.target
IgnoreOnIsolate=yes
[Service]
-Environment=TERM=vt102
-ExecStart=-/sbin/agetty -s %I 115200,38400,9600
+ExecStart=-/sbin/agetty -s %I 115200,38400,9600 vt102
Type=idle
Restart=always
RestartSec=0
++++++ allow-nuking-of-symlinks.patch ++++++
>From 02b9e969a6f512d2312e7028ce5c48c84ad87d06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Mon, 3 Jun 2013 13:55:13 -0400
Subject: [PATCH] systemctl,core: allow nuking of symlinks to removed units
Before, one the unit file was deleted, install_context_for_removal()
would refuse to look for symlinks. But we can remove dangling symlinks
anyway.
In principle, package installation/deinstallation scripts should do
that before the unit is uninstalled, but they don't always do. Also,
a user might have added additional symlinks manually.
https://bugs.freedesktop.org/show_bug.cgi?id=62395
---
src/shared/install.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: systemd-195/src/shared/install.c
===================================================================
--- systemd-195.orig/src/shared/install.c
+++ systemd-195/src/shared/install.c
@@ -1450,7 +1450,9 @@ static int install_context_mark_for_remo
assert_se(hashmap_move_one(c->have_installed, c->will_install, i->name) == 0);
q = unit_file_search(c, i, paths, root_dir, false);
- if (q < 0) {
+ if (q == -ENOENT) {
+ /* do nothing */
+ } else if (q < 0) {
if (r >= 0)
r = q;
++++++ baselibs.conf ++++++
systemd
supplements "packageand(systemd:pam-<targettype>)"
-/lib/systemd/system/
libudev0
libgudev-1_0-0
libudev1
++++++ boot.udev ++++++
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: boot.udev
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: B
# Default-Stop:
# Short-Description: manage /dev and kernel device-events
# Description: udevd daemon to manage /dev and kernel device events
### END INIT INFO
. /etc/rc.status
PATH="/sbin:/bin:/usr/sbin:/usr/bin"
DAEMON="@@SYSTEMD@@/systemd-udevd"
UDEVADM="@@BINDIR@@/udevadm"
WRITERULE="@@PREFIX@@/write_dev_root_rule"
udev_timeout=180
case "$1" in
start)
# create /dev/root symlink with dynamic rule
if [ -x ${WRITERULE} ]; then
${WRITERULE} >/dev/null 2>&1 || true
fi
# start udevd
echo -n "Starting udevd: "
${DAEMON} --daemon
if [ $? -ne 0 ]; then
rc_status -v
rc_exit
fi
rc_status -v
# trigger events for all devices
echo -n "Loading drivers, configuring devices: "
${UDEVADM} trigger --type=subsystems --action=add
${UDEVADM} trigger --type=devices --action=add
# wait for events to finish
${UDEVADM} settle --timeout=$udev_timeout
rc_status -v
;;
stop)
echo -n "Stopping udevd: "
killproc ${DAEMON}
rc_status -v
;;
restart)
echo -n "Restarting udevd: "
killproc ${DAEMON}
${DAEMON} --daemon
rc_status -v
;;
status)
echo -n "Checking for udevd: "
checkproc ${DAEMON}
rc_status -v
;;
reload|force-reload)
echo -n "Reloading udevd: "
killproc -G -HUP ${DAEMON}
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart|status|reload|force-reload}"
exit 1
;;
esac
rc_exit
++++++ check-for-empty-strings-in-strto-conversions.patch ++++++
>From f3910003bce32ebdc1dbb71fd9ca2d4b8352b563 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Tue, 30 Oct 2012 10:29:40 +0100
Subject: [PATCH] shared, libsystemd-daemon: check for empty strings in
strto*l conversions
strtol() and friends may set EINVAL if no conversion was performed, but
they are not required to do so. In practice they don't. We need to check
for it.
https://bugzilla.redhat.com/show_bug.cgi?id=870577
---
src/libsystemd-daemon/sd-daemon.c | 4 ++--
src/shared/conf-parser.c | 2 +-
src/shared/util.c | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
Index: systemd-195/src/libsystemd-daemon/sd-daemon.c
===================================================================
--- systemd-195.orig/src/libsystemd-daemon/sd-daemon.c
+++ systemd-195/src/libsystemd-daemon/sd-daemon.c
@@ -88,7 +88,7 @@ _sd_export_ int sd_listen_fds(int unset_
goto finish;
}
- if (!p || *p || l <= 0) {
+ if (!p || p == e || *p || l <= 0) {
r = -EINVAL;
goto finish;
}
@@ -112,7 +112,7 @@ _sd_export_ int sd_listen_fds(int unset_
goto finish;
}
- if (!p || *p) {
+ if (!p || p == e || *p) {
r = -EINVAL;
goto finish;
}
Index: systemd-195/src/shared/conf-parser.c
===================================================================
--- systemd-195.orig/src/shared/conf-parser.c
+++ systemd-195/src/shared/conf-parser.c
@@ -865,7 +865,7 @@ int config_parse_mode(
errno = 0;
l = strtol(rvalue, &x, 8);
- if (!x || *x || errno) {
+ if (!x || x == rvalue || *x || errno) {
log_error("[%s:%u] Failed to parse mode value, ignoring: %s", filename, line, rvalue);
return 0;
}
Index: systemd-195/src/shared/util.c
===================================================================
--- systemd-195.orig/src/shared/util.c
+++ systemd-195/src/shared/util.c
@@ -388,7 +388,7 @@ int safe_atou(const char *s, unsigned *r
errno = 0;
l = strtoul(s, &x, 0);
- if (!x || *x || errno)
+ if (!x || x == s || *x || errno)
return errno ? -errno : -EINVAL;
if ((unsigned long) (unsigned) l != l)
@@ -408,7 +408,7 @@ int safe_atoi(const char *s, int *ret_i)
errno = 0;
l = strtol(s, &x, 0);
- if (!x || *x || errno)
+ if (!x || x == s || *x || errno)
return errno ? -errno : -EINVAL;
if ((long) (int) l != l)
@@ -428,7 +428,7 @@ int safe_atollu(const char *s, long long
errno = 0;
l = strtoull(s, &x, 0);
- if (!x || *x || errno)
+ if (!x || x == s || *x || errno)
return errno ? -errno : -EINVAL;
*ret_llu = l;
@@ -445,7 +445,7 @@ int safe_atolli(const char *s, long long
errno = 0;
l = strtoll(s, &x, 0);
- if (!x || *x || errno)
+ if (!x || x == s || *x || errno)
return errno ? -errno : -EINVAL;
*ret_lli = l;
++++++ core-interpret-escaped-semicolon-as-escaped.patch ++++++
>From 7e1a84f55244ca78093b1dabc58683bc0e7f4304 Mon Sep 17 00:00:00 2001
From: Oleksii Shevchuk <alxchk(a)gmail.com>
Date: Sat, 3 Nov 2012 21:52:02 +0200
Subject: [PATCH] core: interpret \; token in ExecStart as escaped ;
Some commands (like 'find') take a semicolon as separate arg. With
current parser implementation there is no way to pass one.
Patch adds token \;
---
src/core/load-fragment.c | 2 ++
src/test/test-unit-file.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 5803044..4dc5c52 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -483,6 +483,8 @@ int config_parse_exec(
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
if (strncmp(w, ";", MAX(l, 1U)) == 0)
break;
+ else if (strncmp(w, "\\;", MAX(l, 1U)) == 0)
+ w ++;
if (honour_argv0 && w == rvalue) {
assert(!path);
--
1.7.10.4
++++++ core-load-fragment-improve-error-message.patch ++++++
>From c040936be2a4c77e9465cffae47d77d5ec14fb49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Mon, 19 Nov 2012 16:02:45 +0100
Subject: [PATCH] core/load-fragment: be more precise in error messages
Whenever a message fails, mention the offending word, instead
of just giving the whole line. If one bad word causes just this
word to be rejected, print only the word. If one bad word causes
the whole line to be rejected, print the whole line too.
https://bugs.freedesktop.org/show_bug.cgi?id=56874
---
src/core/load-fragment.c | 69 +++++++++++++++++++++-------------------------
1 file changed, 31 insertions(+), 38 deletions(-)
Index: systemd-195/src/core/load-fragment.c
===================================================================
--- systemd-195.orig/src/core/load-fragment.c
+++ systemd-195/src/core/load-fragment.c
@@ -85,7 +85,7 @@ int config_parse_unit_deps(
assert(rvalue);
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- char *t, *k;
+ char _cleanup_free_ *t = NULL, *k = NULL;
int r;
t = strndup(w, l);
@@ -93,15 +93,13 @@ int config_parse_unit_deps(
return -ENOMEM;
k = unit_name_printf(u, t);
- free(t);
if (!k)
return -ENOMEM;
r = unit_add_dependency_by_name(u, d, k, NULL, true);
if (r < 0)
- log_error("[%s:%u] Failed to add dependency on %s, ignoring: %s", filename, line, k, strerror(-r));
-
- free(k);
+ log_error("[%s:%u] Failed to add dependency on %s, ignoring: %s",
+ filename, line, k, strerror(-r));
}
return 0;
@@ -739,22 +737,25 @@ int config_parse_exec_cpu_affinity(
assert(data);
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- char *t;
+ char _cleanup_free_ *t = NULL;
int r;
unsigned cpu;
- if (!(t = strndup(w, l)))
+ t = strndup(w, l);
+ if (!t)
return -ENOMEM;
r = safe_atou(t, &cpu);
- free(t);
- if (!(c->cpuset))
- if (!(c->cpuset = cpu_set_malloc(&c->cpuset_ncpus)))
+ if (!c->cpuset) {
+ c->cpuset = cpu_set_malloc(&c->cpuset_ncpus);
+ if (!c->cpuset)
return -ENOMEM;
+ }
if (r < 0 || cpu >= c->cpuset_ncpus) {
- log_error("[%s:%u] Failed to parse CPU affinity, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse CPU affinity %s, ignoring: %s",
+ filename, line, t, rvalue);
return 0;
}
@@ -831,7 +832,8 @@ int config_parse_exec_secure_bits(
else if (first_word(w, "noroot-locked"))
c->secure_bits |= SECURE_NOROOT_LOCKED;
else {
- log_error("[%s:%u] Failed to parse secure bits, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse secure bits, ignoring: %s",
+ filename, line, rvalue);
return 0;
}
}
@@ -872,7 +874,7 @@ int config_parse_bounding_set(
* interface. */
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- char *t;
+ char _cleanup_free_ *t = NULL;
int r;
cap_value_t cap;
@@ -881,10 +883,9 @@ int config_parse_bounding_set(
return -ENOMEM;
r = cap_from_name(t, &cap);
- free(t);
-
if (r < 0) {
- log_error("[%s:%u] Failed to parse capability bounding set, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse capability in bounding set, ignoring: %s",
+ filename, line, t);
continue;
}
@@ -950,7 +951,7 @@ int config_parse_unit_cgroup(
char *state;
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- char *t, *k;
+ char _cleanup_free_ *t = NULL, *k = NULL, *ku = NULL;
int r;
t = strndup(w, l);
@@ -958,22 +959,17 @@ int config_parse_unit_cgroup(
return -ENOMEM;
k = unit_full_printf(u, t);
- free(t);
-
if (!k)
return -ENOMEM;
- t = cunescape(k);
- free(k);
-
- if (!t)
+ ku = cunescape(k);
+ if (!ku)
return -ENOMEM;
- r = unit_add_cgroup_from_text(u, t);
- free(t);
-
+ r = unit_add_cgroup_from_text(u, ku);
if (r < 0) {
- log_error("[%s:%u] Failed to parse cgroup value, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse cgroup value %s, ignoring: %s",
+ filename, line, k, rvalue);
return 0;
}
}
@@ -1333,33 +1329,30 @@ int config_parse_service_sockets(
assert(data);
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- char *t, *k;
+ char _cleanup_free_ *t = NULL, *k = NULL;
t = strndup(w, l);
if (!t)
return -ENOMEM;
k = unit_name_printf(UNIT(s), t);
- free(t);
-
if (!k)
return -ENOMEM;
if (!endswith(k, ".socket")) {
- log_error("[%s:%u] Unit must be of type socket, ignoring: %s", filename, line, rvalue);
- free(k);
+ log_error("[%s:%u] Unit must be of type socket, ignoring: %s",
+ filename, line, k);
continue;
}
r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_WANTS, UNIT_AFTER, k, NULL, true);
if (r < 0)
- log_error("[%s:%u] Failed to add dependency on %s, ignoring: %s", filename, line, k, strerror(-r));
+ log_error("[%s:%u] Failed to add dependency on %s, ignoring: %s",
+ filename, line, k, strerror(-r));
r = unit_add_dependency_by_name(UNIT(s), UNIT_TRIGGERED_BY, k, NULL, true);
if (r < 0)
return r;
-
- free(k);
}
return 0;
@@ -2087,17 +2080,17 @@ int config_parse_syscall_filter(
FOREACH_WORD_QUOTED(w, l, rvalue, state) {
int id;
- char *t;
+ char _cleanup_free_ *t = NULL;
t = strndup(w, l);
if (!t)
return -ENOMEM;
id = syscall_from_name(t);
- free(t);
if (id < 0) {
- log_error("[%s:%u] Failed to parse syscall, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse syscall, ignoring: %s",
+ filename, line, t);
continue;
}
++++++ coredumpctl-fix-crash.patch ++++++
>From 348a25edbb87ee4e67aa79fcb97a2bc1b5c11c7b Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn(a)redhat.com>
Date: Wed, 19 Dec 2012 14:38:53 +0100
Subject: [PATCH] coredumpctl: check return of strndup
---
src/journal/coredumpctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/journal/coredumpctl.c
===================================================================
--- systemd-195.orig/src/journal/coredumpctl.c
+++ systemd-195/src/journal/coredumpctl.c
@@ -222,7 +222,7 @@ static int retrieve(sd_journal *j, const
assert(len >= field);
*var = strndup((const char*)data + field, len - field);
- if (!var)
+ if (!*var)
return log_oom();
return 0;
++++++ crypsetup-generator-state-file-name-in-error-message.patch ++++++
>From 1cda32b8a29750720872d3525084ac67b88e066f Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Fri, 23 Nov 2012 14:16:39 +0100
Subject: [PATCH] cryptsetup-generator: state file name in error messages
---
src/cryptsetup/cryptsetup-generator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: systemd-195/src/cryptsetup/cryptsetup-generator.c
===================================================================
--- systemd-195.orig/src/cryptsetup/cryptsetup-generator.c
+++ systemd-195/src/cryptsetup/cryptsetup-generator.c
@@ -230,7 +230,7 @@ static int create_disk(
f = fopen(p, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file: %m");
+ log_error("Failed to create unit file %s: %m", p);
goto fail;
}
@@ -283,7 +283,7 @@ static int create_disk(
if (ferror(f)) {
r = -errno;
- log_error("Failed to write file: %m");
+ log_error("Failed to write file %s: %m", p);
goto fail;
}
++++++ crypsetup-handle-nofail.patch ++++++
>From adc40dc2f670a6298cce918fb318ba6a4b80c306 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg(a)jklm.no>
Date: Wed, 21 Nov 2012 12:30:47 +0100
Subject: [PATCH] cryptsetup: fix nofail support
This was documented in the man page and supported in the generator,
but systemd-cryptestup itself would fail with this option.
systemd-cryptsetup should ignore 'nofail', as it does with 'noauto'.
---
src/cryptsetup/cryptsetup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 56a3b50..f332843 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -62,7 +62,7 @@ static int parse_one_option(const char *option) {
assert(option);
/* Handled outside of this tool */
- if (streq(option, "noauto"))
+ if (streq(option, "noauto") || streq(option, "nofail"))
return 0;
if (startswith(option, "cipher=")) {
--
1.7.10.4
++++++ crypt-loop-file.patch ++++++
Index: systemd-195/src/cryptsetup/cryptsetup-generator.c
===================================================================
--- systemd-195.orig/src/cryptsetup/cryptsetup-generator.c
+++ systemd-195/src/cryptsetup/cryptsetup-generator.c
@@ -136,7 +136,7 @@ static int create_disk(
const char *password,
const char *options) {
- char *p = NULL, *n = NULL, *d = NULL, *u = NULL, *from = NULL, *to = NULL, *e = NULL;
+ char *p = NULL, *n = NULL, *d = NULL, *u = NULL, *from = NULL, *to = NULL, *e = NULL, *path_file = NULL;
int r;
FILE *f = NULL;
bool noauto, nofail;
@@ -168,11 +168,63 @@ static int create_disk(
goto fail;
}
- d = unit_name_from_path(u, ".device");
- if (!d) {
- r = -ENOMEM;
- log_error("Failed to allocate device name.");
- goto fail;
+ if (!startswith(device,"/dev/")) {
+ char *e;
+
+ d = strdup(n);
+ if (!d) {
+ r = -ENOMEM;
+ log_error("Failed to allocate path name.");
+ goto fail;
+ }
+
+ e = endswith(d,".service");
+ if (!e) {
+ r = -ENOMEM;
+ log_error("Failed to modify path name.");
+ goto fail;
+ }
+
+ *e = 0;
+
+ d = strcat(d,".path");
+ if (asprintf(&path_file, "%s/%s", arg_dest, d) < 0) {
+ r = -ENOMEM;
+ log_error("Failed to allocate unit file name.");
+ goto fail;
+ }
+
+ f = fopen(path_file, "wxe");
+ if (!f) {
+ r = -errno;
+ log_error("Failed to create unit file %s: %m", path_file);
+ goto fail;
+ }
+
+ fprintf(f,
+ "[Unit]\n"
+ "Description=Cryptography Setup for %s\n"
+ "DefaultDependencies=no\n"
+ "[Path]\n"
+ "PathExists=%s\n",
+ device, device);
+
+ fflush(f);
+
+ if (ferror(f)) {
+ r = -errno;
+ log_error("Failed to write file: %m");
+ goto fail;
+ }
+
+ f = NULL;
+ } else {
+ d = unit_name_from_path(u, ".device");
+ if (!d) {
+ r = -ENOMEM;
+ log_error("Failed to allocate device name.");
+ goto fail;
+ }
}
f = fopen(p, "wxe");
@@ -298,6 +350,7 @@ fail:
free(n);
free(d);
free(e);
+ free(path_file);
free(from);
free(to);
++++++ cryptsetup-accept-read-only.patch ++++++
>From 18cf1a1be5ae6985f211ec6f02504506da36b223 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Thu, 31 Jan 2013 11:03:09 +0100
Subject: [PATCH] cryptsetup: accept both "read-only" and "readonly" spellings
Mukund Sivaraman pointed out that cryptsetup(5) mentions the "read-only"
option, while the code understands "readonly".
We could just fix the manpage, but for consistency in naming of
multi-word options it would be prettier to have "read-only". So let's
accept both spellings.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=903463
---
man/crypttab.xml | 2 +-
src/cryptsetup/cryptsetup.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/man/crypttab.xml b/man/crypttab.xml
index 2379fc0..f976bda 100644
--- a/man/crypttab.xml
+++ b/man/crypttab.xml
@@ -182,7 +182,7 @@
</varlistentry>
<varlistentry>
- <term><varname>read-only</varname></term>
+ <term><varname>read-only</varname></term><term><varname>readonly</varname></term>
<listitem><para>Set up the encrypted
block device in read-only
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index f332843..a8cdf10 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -111,7 +111,7 @@ static int parse_one_option(const char *option) {
return 0;
}
- } else if (streq(option, "readonly"))
+ } else if (streq(option, "readonly") || streq(option, "read-only"))
opt_readonly = true;
else if (streq(option, "verify"))
opt_verify = true;
--
1.7.10.4
++++++ cryptsetup-handle-plain.patch ++++++
>From 65343c749441322d1e65e8bb5d433b6fee8c28bf Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner(a)archlinux.org>
Date: Tue, 6 Nov 2012 09:49:27 -0500
Subject: [PATCH] cryptsetup: hash=plain means don't use a hash
"plain" is a semantic value that cryptsetup(8) uses to describe a plain
dm-crypt volume that does not use a hash. Catch this value earlier and
ensure that a NULL params.hash is passed to crypt_format to avoid
passing an invalid hash type to the libcryptsetup backend.
FDO bug #56593.
---
src/cryptsetup/cryptsetup.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 916509a..e8ba3f0 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -342,7 +342,12 @@ int main(int argc, char *argv[]) {
opt_tries = opt_tries > 0 ? opt_tries : 3;
opt_key_size = (opt_key_size > 0 ? opt_key_size : 256);
- hash = opt_hash ? opt_hash : "ripemd160";
+ if (opt_hash) {
+ /* plain isn't a real hash type. it just means "use no hash" */
+ if (!streq(opt_hash, "plain"))
+ hash = opt_hash;
+ } else
+ hash = "ripemd160";
if (opt_cipher) {
size_t l;
@@ -463,7 +468,7 @@ int main(int argc, char *argv[]) {
opt_keyfile_size,
¶ms);
- pass_volume_key = streq(hash, "plain");
+ pass_volume_key = !!hash;
}
if (k < 0) {
--
1.7.10.4
>From 8db9d8c2a4ef9806c286e258f9932a0972dc2375 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner(a)archlinux.org>
Date: Tue, 6 Nov 2012 10:17:18 -0500
Subject: [PATCH] cryptsetup: fix inverted comparison in pass_volume_key
---
src/cryptsetup/cryptsetup.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index e8ba3f0..56a3b50 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -468,7 +468,8 @@ int main(int argc, char *argv[]) {
opt_keyfile_size,
¶ms);
- pass_volume_key = !!hash;
+ /* hash == NULL implies the user passed "plain" */
+ pass_volume_key = (hash == NULL);
}
if (k < 0) {
--
1.7.10.4
++++++ delay-fsck-cryptsetup-after-md-lvm-dmraid.patch ++++++
>From c6170719e7afbcecc04e8939e93e9678529e6391 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat(a)suse.com>
Date: Wed, 9 Nov 2011 11:10:49 +0100
Subject: [PATCH] delay fsck / cryptsetup after md / dmraid / lvm are started
---
src/cryptsetup-generator.c | 1 +
units/fsck@.service.in | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
Index: systemd-189/src/cryptsetup/cryptsetup-generator.c
===================================================================
--- systemd-189.orig/src/cryptsetup/cryptsetup-generator.c
+++ systemd-189/src/cryptsetup/cryptsetup-generator.c
@@ -192,6 +192,7 @@ static int create_disk(
"DefaultDependencies=no\n"
"BindsTo=%s dev-mapper-%%i.device\n"
"After=systemd-readahead-collect.service systemd-readahead-replay.service %s\n"
+ "After=md.service dmraid.service lvm.service\n"
"Before=umount.target\n",
d, d);
Index: systemd-189/units/systemd-fsck@.service.in
===================================================================
--- systemd-189.orig/units/systemd-fsck@.service.in
+++ systemd-189/units/systemd-fsck@.service.in
@@ -10,7 +10,7 @@ Description=File System Check on %f
Documentation=man:systemd-fsck@.service(8)
DefaultDependencies=no
BindsTo=%i.device
-After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device
+After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device lvm.service md.service dmraid.service
Before=shutdown.target
[Service]
++++++ delta-accept-t-option.patch ++++++
>From 377ec8bf1907a1a227d195cc3721c4acbad19213 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes(a)gmail.com>
Date: Wed, 14 Nov 2012 00:18:02 +0100
Subject: [PATCH] delta.c: fix option '-t'
Both the help and man page claims that it accepts -t with an argument
so let's do that.
---
src/delta/delta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/delta/delta.c
===================================================================
--- systemd-195.orig/src/delta/delta.c
+++ systemd-195/src/delta/delta.c
@@ -375,7 +375,7 @@ static int parse_argv(int argc, char *ar
assert(argc >= 1);
assert(argv);
- while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, "ht:", options, NULL)) >= 0) {
switch (c) {
++++++ detect-btrfs-ssd.patch ++++++
commit d7228cb8529de83115af04bf653b4d204dad8fae
Author: Lennart Poettering <lennart(a)poettering.net>
Date: Thu Nov 22 01:51:06 2012 +0100
readahead: properly detect btrfs on SSD
diff --git a/src/readahead/readahead-common.c b/src/readahead/readahead-common.c
index 10b0ccc..41aaff0 100644
--- a/src/readahead/readahead-common.c
+++ b/src/readahead/readahead-common.c
@@ -32,6 +32,7 @@
#include "log.h"
#include "readahead-common.h"
#include "util.h"
+#include "missing.h"
int file_verify(int fd, const char *fn, off_t file_size_max, struct stat *st) {
assert(fd >= 0);
@@ -62,14 +63,63 @@ int fs_on_ssd(const char *p) {
struct udev_device *udev_device = NULL, *look_at = NULL;
bool b = false;
const char *devtype, *rotational, *model, *id;
+ int r;
assert(p);
if (stat(p, &st) < 0)
return -errno;
- if (major(st.st_dev) == 0)
+ if (major(st.st_dev) == 0) {
+ _cleanup_fclose_ FILE *f = NULL;
+ int mount_id;
+ struct file_handle *h;
+
+ /* Might be btrfs, which exposes "ssd" as mount flag if it is on ssd.
+ *
+ * We first determine the mount ID here, if we can,
+ * and then lookup the mount ID in mountinfo to find
+ * the mount options. */
+
+ h = alloca(MAX_HANDLE_SZ);
+ h->handle_bytes = MAX_HANDLE_SZ;
+ r = name_to_handle_at(AT_FDCWD, p, h, &mount_id, AT_SYMLINK_FOLLOW);
+ if (r < 0)
+ return false;
+
+ f = fopen("/proc/self/mountinfo", "re");
+ if (!f)
+ return false;
+
+ for (;;) {
+ char line[LINE_MAX], *e;
+ _cleanup_free_ char *opts = NULL;
+ int mid;
+
+ if (!fgets(line, sizeof(line), f))
+ return false;
+
+ truncate_nl(line);
+
+ if (sscanf(line, "%i", &mid) != 1)
+ continue;
+
+ if (mid != mount_id)
+ continue;
+
+ e = strstr(line, " - ");
+ if (!e)
+ continue;
+
+ if (sscanf(e+3, "%*s %*s %ms", &opts) != 1)
+ continue;
+
+ if (streq(opts, "ssd") || startswith(opts, "ssd,") || endswith(opts, ",ssd") || strstr(opts, ",ssd,"))
+ return true;
+ }
+
return false;
+ }
udev = udev_new();
if (!udev)
@@ -97,9 +147,10 @@ int fs_on_ssd(const char *p) {
/* Second, try kernel attribute */
rotational = udev_device_get_sysattr_value(look_at, "queue/rotational");
- if (rotational)
- if ((b = streq(rotational, "0")))
- goto finish;
+ if (rotational) {
+ b = streq(rotational, "0");
+ goto finish;
+ }
/* Finally, fallback to heuristics */
look_at = udev_device_get_parent(look_at);
++++++ disable-nss-myhostname-warning-bnc-783841.diff ++++++
>From 33db05b6bd6151c482f5efe01f2a6118efc82fde Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel(a)suse.de>
Date: Tue, 12 Feb 2013 17:24:35 +0100
Subject: [PATCH] disable nss-myhostname warning (bnc#783841)
---
src/hostname/hostnamed.c | 1 +
1 Datei geändert, 1 Zeile hinzugefügt(+)
Index: systemd-195/src/hostname/hostnamed.c
===================================================================
--- systemd-195.orig/src/hostname/hostnamed.c
+++ systemd-195/src/hostname/hostnamed.c
@@ -124,6 +124,7 @@ static int read_data(void) {
static bool check_nss(void) {
void *dl;
+ return true;
if ((dl = dlopen("libnss_myhostname.so.2", RTLD_LAZY))) {
dlclose(dl);
++++++ dm-lvm-after-local-fs-pre-target.patch ++++++
Index: systemd-189/units/local-fs-pre.target
===================================================================
--- systemd-189.orig/units/local-fs-pre.target
+++ systemd-189/units/local-fs-pre.target
@@ -8,3 +8,4 @@
[Unit]
Description=Local File Systems (Pre)
Documentation=man:systemd.special(7)
+After=md.service lvm.service dmraid.service
++++++ do-no-isolate-on-fsck-failure.patch ++++++
>From 80cfe9e163b1c92f917e0a5e053b148fca790677 Mon Sep 17 00:00:00 2001
From: "Dr. Tilmann Bubeck" <t.bubeck(a)reinform.de>
Date: Fri, 4 May 2012 10:32:47 +0200
Subject: [PATCH] Do no isolate in case of emergency or severe problems
This patch changes local-fs.target and systemd-fsck to not use
"isolate" when going into emergency.
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=810722
The motivation is, that when something wents wrong, we should
keep everything as it is, to let the user fix the problem. When
isolating we stop a lot of services and therefore change the
system heavily so that it gets harder for the user to fix.
An example is a crypted partition. When the fsck in a crypted
partition fails, it previously used "emergency/start/isolate"
which stops cryptsetup. Therefore if the user tries to fsck
e.g. /dev/mapper/luks-356c20ae-c7a2-4f1c-ae1d-1d290a91b691
as printed by the failing fsck, then it will not find this
device (because it got closed).
So please apply this patch to let the user see the failing
situation.
Thanks!
[zj: removed dead isolate param from start_target().]
https://bugs.freedesktop.org/show_bug.cgi?id=49463
https://bugzilla.redhat.com/show_bug.cgi?id=810722
---
src/fsck/fsck.c | 13 ++++---------
units/local-fs.target | 2 +-
2 files changed, 5 insertions(+), 10 deletions(-)
Index: systemd-195/src/fsck/fsck.c
===================================================================
--- systemd-195.orig/src/fsck/fsck.c
+++ systemd-195/src/fsck/fsck.c
@@ -40,10 +40,10 @@ static bool arg_skip = false;
static bool arg_force = false;
static bool arg_show_progress = false;
-static void start_target(const char *target, bool isolate) {
+static void start_target(const char *target) {
DBusMessage *m = NULL, *reply = NULL;
DBusError error;
- const char *mode, *basic_target = "basic.target";
+ const char *mode = "replace", *basic_target = "basic.target";
DBusConnection *bus = NULL;
assert(target);
@@ -55,11 +55,6 @@ static void start_target(const char *tar
goto finish;
}
- if (isolate)
- mode = "isolate";
- else
- mode = "replace";
-
log_info("Running request %s/start/%s", target, mode);
if (!(m = dbus_message_new_method_call("org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "StartUnitReplace"))) {
@@ -379,10 +374,10 @@ int main(int argc, char *argv[]) {
if (status.si_code == CLD_EXITED && (status.si_status & 2) && root_directory)
/* System should be rebooted. */
- start_target(SPECIAL_REBOOT_TARGET, false);
+ start_target(SPECIAL_REBOOT_TARGET);
else if (status.si_code == CLD_EXITED && (status.si_status & 6))
/* Some other problem */
- start_target(SPECIAL_EMERGENCY_TARGET, true);
+ start_target(SPECIAL_EMERGENCY_TARGET);
else {
r = EXIT_SUCCESS;
log_warning("Ignoring error.");
Index: systemd-195/units/local-fs.target
===================================================================
--- systemd-195.orig/units/local-fs.target
+++ systemd-195/units/local-fs.target
@@ -9,4 +9,4 @@
Description=Local File Systems
Documentation=man:systemd.special(7)
OnFailure=emergency.target
-OnFailureIsolate=yes
+OnFailureIsolate=no
++++++ do-not-make-sockets-dependent-on-lo.patch ++++++
>From 7d0c710d72f8a6e5c6909c65700aa088c53aebc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Bartoszkiewicz?= <mbartoszkiewicz(a)gmail.com>
Date: Sat, 12 Jan 2013 23:05:52 +0100
Subject: [PATCH] core: do not make sockets dependent on lo
/sys/subsystem/net/devices/lo is never considered active, so sockets
with BindToDevice=lo would never be activated.
---
src/core/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/core/socket.c
===================================================================
--- systemd-195.orig/src/core/socket.c
+++ systemd-195/src/core/socket.c
@@ -293,7 +293,7 @@ static int socket_add_device_link(Socket
assert(s);
- if (!s->bind_to_device)
+ if (!s->bind_to_device || streq(s->bind_to_device, "lo"))
return 0;
if (asprintf(&t, "/sys/subsystem/net/devices/%s", s->bind_to_device) < 0)
++++++ early-sync-shutdown.patch ++++++
>From c65eb8365344eeb72ee2c0b333ab54d925263b3f Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Fri, 25 Jan 2013 22:33:33 +0100
Subject: [PATCH] shutdown: issue a sync() as soon as shutdown.target is queued
---
Makefile.am | 7 ++++--
src/core/job.c | 26 ++++++++++++++++++++
src/core/job.h | 2 ++
src/core/sync.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++
src/core/sync.h | 24 +++++++++++++++++++
src/core/transaction.c | 1 +
6 files changed, 123 insertions(+), 2 deletions(-)
create mode 100644 src/core/sync.c
create mode 100644 src/core/sync.h
Index: systemd-195/Makefile.am
===================================================================
--- systemd-195.orig/Makefile.am
+++ systemd-195/Makefile.am
@@ -1038,7 +1038,9 @@ libsystemd_core_la_SOURCES = \
src/core/syscall-list.c \
src/core/syscall-list.h \
src/core/audit-fd.c \
- src/core/audit-fd.h
+ src/core/audit-fd.h \
+ src/core/sync.c \
+ src/core/sync.h
nodist_libsystemd_core_la_SOURCES = \
src/core/load-fragment-gperf.c \
@@ -1052,7 +1054,8 @@ libsystemd_core_la_CFLAGS = \
$(LIBWRAP_CFLAGS) \
$(PAM_CFLAGS) \
$(AUDIT_CFLAGS) \
- $(KMOD_CFLAGS)
+ $(KMOD_CFLAGS) \
+ -pthread
libsystemd_core_la_LIBADD = \
libsystemd-capability.la \
Index: systemd-195/src/core/job.c
===================================================================
--- systemd-195.orig/src/core/job.c
+++ systemd-195/src/core/job.c
@@ -34,6 +34,9 @@
#include "load-dropin.h"
#include "log.h"
#include "dbus-job.h"
+#include "special.h"
+#include "sync.h"
+#include "virt.h"
JobBusClient* job_bus_client_new(DBusConnection *connection, const char *name) {
JobBusClient *cl;
@@ -1045,6 +1048,29 @@ int job_coldplug(Job *j) {
return 0;
}
+void job_shutdown_magic(Job *j) {
+ assert(j);
+
+ /* The shutdown target gets some special treatment here: we
+ * tell the kernel to begin with flushing its disk caches, to
+ * optimize shutdown time a bit. Ideally we wouldn't hardcode
+ * this magic into PID 1. However all other processes aren't
+ * options either since they'd exit much sooner than PID 1 and
+ * asynchronous sync() would cause their exit to be
+ * delayed. */
+
+ if (!unit_has_name(j->unit, SPECIAL_SHUTDOWN_TARGET))
+ return;
+
+ if (j->type != JOB_START)
+ return;
+
+ if (detect_container(NULL) > 0)
+ return;
+
+ asynchronous_sync();
+}
+
static const char* const job_state_table[_JOB_STATE_MAX] = {
[JOB_WAITING] = "waiting",
[JOB_RUNNING] = "running"
Index: systemd-195/src/core/job.h
===================================================================
--- systemd-195.orig/src/core/job.h
+++ systemd-195/src/core/job.h
@@ -217,6 +217,8 @@ int job_finish_and_invalidate(Job *j, Jo
char *job_dbus_path(Job *j);
+void job_shutdown_magic(Job *j);
+
const char* job_type_to_string(JobType t);
JobType job_type_from_string(const char *s);
Index: systemd-195/src/core/sync.c
===================================================================
--- /dev/null
+++ systemd-195/src/core/sync.c
@@ -0,0 +1,65 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+ This file is part of systemd.
+
+ Copyright 2013 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/>.
+***/
+
+#include <pthread.h>
+#include <unistd.h>
+
+#include "sync.h"
+
+static void *sync_thread(void *p) {
+ sync();
+ return NULL;
+}
+
+int asynchronous_sync(void) {
+ pthread_attr_t a;
+ pthread_t t;
+ int r;
+
+ /* It kinda sucks that we have to resort to threads to
+ * implement an asynchronous sync(), but well, such is
+ * life.
+ *
+ * Note that issuing this command right before exiting a
+ * process will cause the process to wait for the sync() to
+ * complete. This function hence is nicely asynchronous really
+ * only in long running processes. */
+
+ r = pthread_attr_init(&a);
+ if (r != 0)
+ return -r;
+
+ r = pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED);
+ if (r != 0) {
+ r = -r;
+ goto finish;
+ }
+
+ r = pthread_create(&t, &a, sync_thread, NULL);
+ if (r != 0) {
+ r = -r;
+ goto finish;
+ }
+
+finish:
+ pthread_attr_destroy(&a);
+ return r;
+}
Index: systemd-195/src/core/sync.h
===================================================================
--- /dev/null
+++ systemd-195/src/core/sync.h
@@ -0,0 +1,24 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#pragma once
+
+/***
+ This file is part of systemd.
+
+ Copyright 2013 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/>.
+***/
+
+int asynchronous_sync(void);
Index: systemd-195/src/core/transaction.c
===================================================================
--- systemd-195.orig/src/core/transaction.c
+++ systemd-195/src/core/transaction.c
@@ -592,6 +592,7 @@ static int transaction_apply(Transaction
job_add_to_run_queue(j);
job_add_to_dbus_queue(j);
job_start_timer(j);
+ job_shutdown_magic(j);
}
return 0;
++++++ fastboot-forcefsck.patch ++++++
Index: systemd-189/src/fsck/fsck.c
===================================================================
--- systemd-189.orig/src/fsck/fsck.c
+++ systemd-189/src/fsck/fsck.c
@@ -128,7 +128,7 @@ static int parse_proc_cmdline(void) {
arg_skip = true;
else if (startswith(w, "fsck"))
log_warning("Invalid fsck parameter. Ignoring.");
-#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
+#if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA) || defined(TARGET_SUSE)
else if (strneq(w, "fastboot", l))
arg_skip = true;
else if (strneq(w, "forcefsck", l))
++++++ fix-bad-mem-access.patch ++++++
>From 86ed7ec58b9b6a0907bbb3b8d07c930e52915de0 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Thu, 17 Jan 2013 17:38:00 +0100
Subject: [PATCH] util: fix bad memory access
---
src/shared/util.c | 1 -
1 file changed, 1 deletion(-)
Index: systemd-195/src/shared/util.c
===================================================================
--- systemd-195.orig/src/shared/util.c
+++ systemd-195/src/shared/util.c
@@ -543,7 +543,6 @@ int get_parent_of_pid(pid_t pid, pid_t *
if (!fgets(line, sizeof(line), f)) {
r = feof(f) ? -EIO : -errno;
- fclose(f);
return r;
}
++++++ fix-bad-memory-access.patch ++++++
>From 7d73c1343be02a59b17de0cd34375deeb815d89c Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Tue, 20 Nov 2012 00:19:27 +0100
Subject: [PATCH] journald: fix bad memory access
https://bugzilla.redhat.com/show_bug.cgi?id=875653
---
src/journal/journald-server.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/journal/journald.c
===================================================================
--- systemd-195.orig/src/journal/journald.c
+++ systemd-195/src/journal/journald.c
@@ -342,7 +342,7 @@ static void server_rotate(Server *s) {
HASHMAP_FOREACH_KEY(f, k, s->user_journals, i) {
r = journal_file_rotate(&f, s->compress, s->seal);
if (r < 0)
- if (f->path)
+ if (f)
log_error("Failed to rotate %s: %s", f->path, strerror(-r));
else
log_error("Failed to create user journal: %s", strerror(-r));
++++++ fix-build-glibc217.patch ++++++
>From e17187091d463ad008c0b74eb04de5078b2abb96 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Wed, 14 Nov 2012 14:44:05 +0100
Subject: [PATCH] configure.ac: fix FTBFS with new glibc
glibc moved clock_* functions from librt to the core libc. As a result,
clock_gettime is no more a suitable symbol to use when finding librt.
Look for mq_open instead.
Reference:
http://www.sourceware.org/git/gitweb.cgi?p=glibc.git&h=6e6249d0b461b952d0f5…
Fixes a FTBFS in Fedora Rawhide.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/configure.ac
===================================================================
--- systemd-195.orig/configure.ac
+++ systemd-195/configure.ac
@@ -172,7 +172,7 @@ CC_CHECK_FLAGS_APPEND([with_ldflags], [L
-Wl,-z,now])
AC_SUBST([OUR_LDFLAGS], $with_ldflags)
-AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
+AC_SEARCH_LIBS([mq_open], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
save_LIBS="$LIBS"
++++++ fix-dbus-crash.patch ++++++
>From 645a9e5a2bbb06464a3fba1a3501e9d79e5bbad8 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra(a)logicblox.com>
Date: Wed, 31 Oct 2012 11:53:56 +0100
Subject: [PATCH] dbus-manager: fix a fatal dbus abort in
bus_manager_message_handler()
If ListUnitFiles fails, or an OOM occurs, then dbus_message_unref()
will be called twice on "reply", causing systemd to crash. So remove
the call to dbus_message_unref(); it is unnecessary because of
the cleanup attribute on "reply".
[zj: modified to leave one dbus_message_unref() alone, per Colin
Walters' comment.]
---
src/core/dbus-manager.c | 1 -
1 file changed, 1 deletion(-)
Index: systemd-195/src/core/dbus-manager.c
===================================================================
--- systemd-195.orig/src/core/dbus-manager.c
+++ systemd-195/src/core/dbus-manager.c
@@ -1432,7 +1432,6 @@ static DBusHandlerResult bus_manager_mes
r = unit_file_get_list(m->running_as == SYSTEMD_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER, NULL, h);
if (r < 0) {
unit_file_list_free(h);
- dbus_message_unref(reply);
return bus_send_error_reply(connection, message, NULL, r);
}
++++++ fix-debugshell.patch ++++++
Index: systemd-195/units/debug-shell.service.in
===================================================================
--- systemd-195.orig/units/debug-shell.service.in
+++ systemd-195/units/debug-shell.service.in
@@ -13,7 +13,7 @@ IgnoreOnIsolate=yes
[Service]
Environment=TERM=linux
-ExecStart=@sushell@
+ExecStart=/bin/bash -c '[ -x @sushell@ ] && exec @sushell@ || exec /bin/bash'
Restart=always
RestartSec=0
StandardInput=tty
++++++ fix-enable-disable-boot-initscript.patch ++++++
>From f9d333f8d202fd853f2553ee6c3196b041ccfba5 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat(a)suse.com>
Date: Thu, 23 Aug 2012 11:08:25 +0200
Subject: [PATCH] fix support for boot prefixed initscript (bnc#746506)
---
src/systemctl.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
Index: systemd-195/src/systemctl/systemctl.c
===================================================================
--- systemd-195.orig/src/systemctl/systemctl.c
+++ systemd-195/src/systemctl/systemctl.c
@@ -3453,7 +3453,27 @@ static int enable_sysv_units(char **args
if (!found_sysv) {
free(p);
+#if defined(TARGET_SUSE)
+ p = NULL;
+ if (!isempty(arg_root))
+ asprintf(&p, "%s/" SYSTEM_SYSVINIT_PATH "/boot.%s", arg_root, name);
+ else
+ asprintf(&p, SYSTEM_SYSVINIT_PATH "/boot.%s", name);
+ if (!p) {
+ log_error("No memory");
+ r = -ENOMEM;
+ goto finish;
+ }
+ p[strlen(p) - sizeof(".service") + 1] = 0;
+ found_sysv = access(p, F_OK) >= 0;
+
+ if (!found_sysv) {
+ free(p);
+ continue;
+ }
+#else
continue;
+#endif
}
/* Mark this entry, so that we don't try enabling it as native unit */
++++++ fix-journal-vacuum-logic.patch ++++++
>From 6c142648aaced56ab681fcc97a71b06d588122a9 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens(a)gmail.com>
Date: Wed, 20 Mar 2013 21:32:05 +0100
Subject: [PATCH] Fix vacuum logic error
The vacuum code used to stop vacuuming after one deletion, even
when max_use was still exceeded.
Also make usage a uint64_t, as the code already pretends it is one.
Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens(a)gmail.com>
---
src/journal/journal-vacuum.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c
index 731f6c7..4a3a5a9 100644
--- a/src/journal/journal-vacuum.c
+++ b/src/journal/journal-vacuum.c
@@ -36,7 +36,7 @@
#include "util.h"
struct vacuum_info {
- off_t usage;
+ uint64_t usage;
char *filename;
uint64_t realtime;
@@ -293,7 +293,7 @@ int journal_directory_vacuum(
if (unlinkat(dirfd(d), list[i].filename, 0) >= 0) {
log_debug("Deleted archived journal %s/%s.", directory, list[i].filename);
- if ((uint64_t) list[i].usage > sum)
+ if (list[i].usage < sum)
sum -= list[i].usage;
else
sum = 0;
--
1.8.1.4
++++++ fix-logind-pty-seat.patch ++++++
>From 978cf3c75fbd94fd0e046206ada6169b35edd919 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Sun, 28 Oct 2012 17:37:16 +0100
Subject: [PATCH] logind: it's OK if a process on an pty requests a session
for seat0
After all, if a sudo/su inside an X terminal should get added to the
same session as the X session itself.
---
src/login/logind-dbus.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: systemd-195/src/login/logind-dbus.c
===================================================================
--- systemd-195.orig/src/login/logind-dbus.c
+++ systemd-195/src/login/logind-dbus.c
@@ -409,8 +409,7 @@ static int bus_manager_create_session(Ma
if (vtnr != 0)
return -EINVAL;
- } else if (!isempty(tty) && s && seat_is_vtconsole(s))
- return -EINVAL;
+ }
if (s) {
if (seat_can_multi_session(s)) {
++++++ fix-loopback-mount.patch ++++++
Index: systemd-195/units/local-fs-pre.target
===================================================================
--- systemd-195.orig/units/local-fs-pre.target
+++ systemd-195/units/local-fs-pre.target
@@ -8,4 +8,4 @@
[Unit]
Description=Local File Systems (Pre)
Documentation=man:systemd.special(7)
-After=md.service lvm.service dmraid.service
+After=md.service lvm.service dmraid.service systemd-udevd.service
++++++ fix-lsb-provides.patch ++++++
>From a99435109b83e7146a30ccf5387037b51c1fe907 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat(a)suse.com>
Date: Thu, 21 Mar 2013 15:40:45 +0100
Subject: [PATCH] core: ensure LSB Provides are handled correctly
Let's say you have two initscripts, A and B:
A contains in its LSB header:
Required-Start: C
and B contains in its LSB header:
Provides: C
When systemd is parsing /etc/rc.d/, depending on the file order, you
can end up with either:
- B is parsed first. An unit "C.service" will be "created" and will be
added as additional name to B.service, with unit_add_name. No bug.
- A is parsed first. An unit "C.service" is created for the
"Required-Start" dependency (it will have no file attached, since
nothing provides this dependency yet). Then B is parsed and when trying
to handle "Provides: C", unit_add_name is called but will fail, because
"C.service" already exists in manager->units. Therefore, a merge should
occur for that case.
---
src/core/service.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/service.c b/src/core/service.c
index 4451d38..fa8a1cb 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -762,7 +762,7 @@ static int service_load_sysv_path(Service *s, const char *path) {
continue;
if (unit_name_to_type(m) == UNIT_SERVICE)
- r = unit_add_name(u, m);
+ r = unit_merge_by_name(u, m);
else
/* NB: SysV targets
* which are provided
--
1.8.1.4
++++++ fix-permissions-btmp.patch ++++++
Index: systemd-44/tmpfiles.d/systemd.conf
===================================================================
--- systemd-44.orig/tmpfiles.d/systemd.conf
+++ systemd-44/tmpfiles.d/systemd.conf
@@ -11,7 +11,7 @@ d /run/user 0755 root root 10d
F /run/utmp 0664 root utmp -
f /var/log/wtmp 0664 root utmp -
-f /var/log/btmp 0600 root utmp -
+f /var/log/btmp 0600 root root -
d /var/cache/man - - - 30d
++++++ fix-potential-bad-mem-access.patch ++++++
>From ac97e2c559f5d386a332aba4a24bf9930cdb1c51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Mon, 19 Nov 2012 16:36:38 +0100
Subject: [PATCH] core/load-fragment: fix (potential) bad memory access
strncmp() could be used with size bigger then the size of the string,
because MAX was used instead of MIN.
If failing, print just the offending mount flag.
---
src/core/load-fragment.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
Index: systemd-195/src/core/load-fragment.c
===================================================================
--- systemd-195.orig/src/core/load-fragment.c
+++ systemd-195/src/core/load-fragment.c
@@ -1083,15 +1083,22 @@ int config_parse_exec_mount_flags(
assert(rvalue);
assert(data);
- FOREACH_WORD_QUOTED(w, l, rvalue, state) {
- if (strncmp(w, "shared", MAX(l, 6U)) == 0)
+ FOREACH_WORD_SEPARATOR(w, l, rvalue, ", ", state) {
+ char _cleanup_free_ *t;
+
+ t = strndup(w, l);
+ if (!t)
+ return -ENOMEM;
+
+ if (streq(t, "shared"))
flags |= MS_SHARED;
- else if (strncmp(w, "slave", MAX(l, 5U)) == 0)
+ else if (streq(t, "slave"))
flags |= MS_SLAVE;
- else if (strncmp(w, "private", MAX(l, 7U)) == 0)
+ else if (streq(w, "private"))
flags |= MS_PRIVATE;
else {
- log_error("[%s:%u] Failed to parse mount flags, ignoring: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse mount flag %s, ignoring: %s",
+ filename, line, t, rvalue);
return 0;
}
}
++++++ fix-swap-behaviour-with-symlinks.patch ++++++
>From b61e88162a6ce0c30da6984b0120959701283daa Mon Sep 17 00:00:00 2001
From: Olivier Brunel <i.am.jack.mail(a)gmail.com>
Date: Sat, 13 Oct 2012 14:24:15 +0200
Subject: [PATCH] swap: fix swap behaviour with symlinks
Starting a swap unit pointing to (What) a symlink (e.g. /dev/mapper/swap
or /dev/disk/by-uuid/...) would have said unit marked active, following
the one using the "actual" device (/dev/{dm-1,sda3}), but that new unit
would be seen as inactive.
Since all requests to stop swap units would follow/redirect to it,
and it is seen inactive, nothing would be done (swapoff never called).
This is because this unit would be treated twice in
swap_process_new_swap, the second call to swap_add_one causing it to
eventually be marked inactive.
---
src/core/swap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: systemd-195/src/core/swap.c
===================================================================
--- systemd-195.orig/src/core/swap.c
+++ systemd-195/src/core/swap.c
@@ -415,7 +415,8 @@ static int swap_process_new_swap(Manager
return -ENOMEM;
dn = udev_device_get_devnode(d);
- if (dn)
+ /* Skip dn==device, since that case will be handled below */
+ if (dn && !streq(dn, device))
r = swap_add_one(m, dn, device, prio, false, false, set_flags);
/* Add additional units for all symlinks */
++++++ forward-to-pmutils.patch ++++++
Index: systemd-195/src/sleep/sleep.c
===================================================================
--- systemd-195.orig/src/sleep/sleep.c
+++ systemd-195/src/sleep/sleep.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
+#include <stdlib.h>
#include "log.h"
#include "util.h"
@@ -31,6 +32,9 @@
int main(int argc, char *argv[]) {
const char *verb;
char* arguments[4];
+ const char *pmtools;
+ bool delegate_to_pmutils = false;
+ struct stat buf;
int r;
FILE *f;
@@ -44,17 +48,27 @@ int main(int argc, char *argv[]) {
goto finish;
}
- if (streq(argv[1], "suspend"))
+ if (streq(argv[1], "suspend")) {
verb = "mem";
- else if (streq(argv[1], "hibernate") || streq(argv[1], "hybrid-sleep"))
+ pmtools = "/usr/sbin/pm-suspend";
+ }
+ else if (streq(argv[1], "hibernate") || streq(argv[1], "hybrid-sleep")) {
verb = "disk";
+ if (streq(argv[1], "hibernate"))
+ pmtools = "/usr/sbin/pm-hibernate";
+ else
+ pmtools = "/usr/sbin/pm-suspend-hybrid";
+ }
else {
log_error("Unknown action '%s'.", argv[1]);
r = -EINVAL;
goto finish;
}
+ delegate_to_pmutils = (stat(pmtools, &buf) >= 0 && S_ISREG(buf.st_mode) && (buf.st_mode & 0111));
+
/* Configure the hibernation mode */
+ if (!delegate_to_pmutils) {
if (streq(argv[1], "hibernate")) {
if (write_one_line_file("/sys/power/disk", "platform") < 0)
write_one_line_file("/sys/power/disk", "shutdown");
@@ -64,13 +78,14 @@ int main(int argc, char *argv[]) {
write_one_line_file("/sys/power/disk", "shutdown");
}
+
f = fopen("/sys/power/state", "we");
if (!f) {
log_error("Failed to open /sys/power/state: %m");
r = -errno;
goto finish;
}
-
+ }
arguments[0] = NULL;
arguments[1] = (char*) "pre";
arguments[2] = argv[1];
@@ -96,11 +111,16 @@ int main(int argc, char *argv[]) {
"SLEEP=hybrid-sleep",
NULL);
+ if (delegate_to_pmutils) {
+ r = -system(pmtools);
+ }
+ else {
fputs(verb, f);
fputc('\n', f);
fflush(f);
r = ferror(f) ? -errno : 0;
+ }
if (streq(argv[1], "suspend"))
log_struct(LOG_INFO,
@@ -118,6 +138,7 @@ int main(int argc, char *argv[]) {
arguments[1] = (char*) "post";
execute_directory(SYSTEM_SLEEP_PATH, NULL, arguments);
+ if (!delegate_to_pmutils)
fclose(f);
finish:
++++++ fstab-generator-error-message-on-duplicates.patch ++++++
>From 67ab5f761f9b854d8ce85f9ee47b298e497f8bd9 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg(a)jklm.no>
Date: Tue, 27 Nov 2012 01:09:28 +0100
Subject: [PATCH] fstab-generator: make error more helpful in case of
duplicates in fstab
Traditional sysvinit systems would not complain about duplicates in
fstab. Rather it (through monut -a) would mount one fs on top of another,
in effect the last entry taking precedent.
In systemd, the first entry takes precedent, all subsequent ones are
ignored and an error is printed.
The change of behavior and the source of this error message was causing
some confusion, so give a hint what migt be wrong.
---
src/fstab-generator/fstab-generator.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
Index: systemd-195/src/fstab-generator/fstab-generator.c
===================================================================
--- systemd-195.orig/src/fstab-generator/fstab-generator.c
+++ systemd-195/src/fstab-generator/fstab-generator.c
@@ -111,7 +111,10 @@ static int add_swap(const char *what, st
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file %s: %m", unit);
+ if (errno == EEXIST)
+ log_error("Failed to create swap unit file %s, as it already exists. Duplicate entry in /etc/fstab?", unit);
+ else
+ log_error("Failed to create unit file %s: %m", unit);
goto finish;
}
@@ -262,7 +265,10 @@ static int add_mount(const char *what, c
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file %s: %m", unit);
+ if (errno == EEXIST)
+ log_error("Failed to create mount unit file %s, as it already exists. Duplicate entry in /etc/fstab?", unit);
+ else
+ log_error("Failed to create unit file %s: %m", unit);
goto finish;
}
++++++ fstab-generator-improve-error-message.patch ++++++
>From 40b8acd039cf1ea00167017e63d9c0a773002f0e Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Fri, 9 Nov 2012 12:00:46 +0100
Subject: [PATCH] fstab-generator: more specific error messages
---
src/fstab-generator/fstab-generator.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 251a346..62053b7 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -111,7 +111,7 @@ static int add_swap(const char *what, struct mntent *me) {
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file: %m");
+ log_error("Failed to create unit file %s: %m", unit);
goto finish;
}
@@ -138,7 +138,7 @@ static int add_swap(const char *what, struct mntent *me) {
fflush(f);
if (ferror(f)) {
- log_error("Failed to write unit file: %m");
+ log_error("Failed to write unit file %s: %m", unit);
r = -errno;
goto finish;
}
@@ -152,7 +152,7 @@ static int add_swap(const char *what, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink: %m");
+ log_error("Failed to create symlink %s: %m", lnk);
r = -errno;
goto finish;
}
@@ -171,7 +171,7 @@ static int add_swap(const char *what, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink: %m");
+ log_error("Failed to create symlink %s: %m", lnk);
r = -errno;
goto finish;
}
@@ -262,7 +262,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file: %m");
+ log_error("Failed to create unit file %s: %m", unit);
goto finish;
}
@@ -306,7 +306,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
fflush(f);
if (ferror(f)) {
- log_error("Failed to write unit file: %m");
+ log_error("Failed to write unit file %s: %m", unit);
r = -errno;
goto finish;
}
@@ -320,7 +320,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink: %m");
+ log_error("Failed to create symlink %s: %m", lnk);
r = -errno;
goto finish;
}
@@ -342,7 +342,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink: %m");
+ log_error("Failed to create symlink %s: %m", lnk);
r = -errno;
goto finish;
}
@@ -367,7 +367,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
f = fopen(automount_unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file: %m");
+ log_error("Failed to create unit file %s: %m", automount_unit);
goto finish;
}
@@ -386,7 +386,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
fflush(f);
if (ferror(f)) {
- log_error("Failed to write unit file: %m");
+ log_error("Failed to write unit file %s: %m", automount_unit);
r = -errno;
goto finish;
}
@@ -400,7 +400,7 @@ static int add_mount(const char *what, const char *where, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(automount_unit, lnk) < 0) {
- log_error("Failed to create symlink: %m");
+ log_error("Failed to create symlink %s: %m", lnk);
r = -errno;
goto finish;
}
--
1.7.10.4
++++++ fstab-generator-properly-detect-bind-mounts.patch ++++++
>From f9ea108e7c3544c03822277a1112a48dc62f6ed4 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Mon, 24 Dec 2012 13:01:00 +0100
Subject: [PATCH] fstab-generator: properly detect bind mounts
This kinda undoes a83cbaccd03c3f28e47e9330f4a22ff65ce4b561 and
1d634e21b453f3c80d7c6c4bd90a6b84e42a3d2a but corrects the original code
to compare the mount type with "bind" rather than the mount options.
---
src/fstab-generator/fstab-generator.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
Index: systemd-195/src/fstab-generator/fstab-generator.c
===================================================================
--- systemd-195.orig/src/fstab-generator/fstab-generator.c
+++ systemd-195/src/fstab-generator/fstab-generator.c
@@ -199,7 +199,7 @@ static bool mount_is_bind(struct mntent
return
hasmntopt(me, "bind") ||
- streq(me->mnt_opts, "bind");
+ streq(me->mnt_type, "bind");
}
static bool mount_is_network(struct mntent *me) {
++++++ handle-HOSTNAME.patch ++++++
Index: systemd-195/src/hostname/hostnamed.c
===================================================================
--- systemd-195.orig/src/hostname/hostnamed.c
+++ systemd-195/src/hostname/hostnamed.c
@@ -118,6 +118,10 @@ static int read_data(void) {
if (r < 0 && r != -ENOENT)
return r;
+ r = read_one_line_file("/etc/HOSTNAME", &data[PROP_STATIC_HOSTNAME]);
+ if (r < 0 && r != -ENOENT)
+ return r;
+
return 0;
}
@@ -204,6 +208,7 @@ static int write_data_hostname(void) {
static int write_data_static_hostname(void) {
+ int r;
if (isempty(data[PROP_STATIC_HOSTNAME])) {
if (unlink("/etc/hostname") < 0)
@@ -212,7 +217,11 @@ static int write_data_static_hostname(vo
return 0;
}
- return write_one_line_file_atomic("/etc/hostname", data[PROP_STATIC_HOSTNAME]);
+ r = write_one_line_file_atomic("/etc/hostname", data[PROP_STATIC_HOSTNAME]);
+ if (!r) {
+ r = symlink_atomic("/etc/hostname", "/etc/HOSTNAME");
+ }
+ return r;
}
static int write_data_other(void) {
++++++ handle-root-uses-lang.patch ++++++
Index: systemd-195/src/core/locale-setup.c
===================================================================
--- systemd-195.orig/src/core/locale-setup.c
+++ systemd-195/src/core/locale-setup.c
@@ -69,6 +69,11 @@ static const char * const variable_names
int locale_setup(void) {
char *variables[_VARIABLE_MAX];
int r = 0, i;
+#if defined(TARGET_SUSE)
+ char *root_uses_lang;
+
+ zero(root_uses_lang);
+#endif
zero(variables);
@@ -134,11 +139,21 @@ int locale_setup(void) {
#elif defined(TARGET_SUSE)
if (r <= 0 &&
(r = parse_env_file("/etc/sysconfig/language", NEWLINE,
+ "ROOT_USES_LANG", &root_uses_lang,
"RC_LANG", &variables[VARIABLE_LANG],
NULL)) < 0) {
if (r != -ENOENT)
log_warning("Failed to read /etc/sysconfig/language: %s", strerror(-r));
+ } else {
+ if (!root_uses_lang || root_uses_lang && strcasecmp(root_uses_lang,"yes") != 0) {
+ if (root_uses_lang && strcasecmp(root_uses_lang,"ctype") == 0)
+ variables[VARIABLE_LC_CTYPE]=variables[VARIABLE_LANG];
+ else
+ free(variables[VARIABLE_LANG]);
+
+ variables[VARIABLE_LANG]=strdup("POSIX");
+ }
}
#elif defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)
@@ -247,5 +262,9 @@ finish:
for (i = 0; i < _VARIABLE_MAX; i++)
free(variables[i]);
+#if defined(TARGET_SUSE)
+ free(root_uses_lang);
+#endif
+
return r;
}
++++++ highlight-ordering-cycle-deletions.patch ++++++
>From f09a7d25545b5e3a2dd3dfc1ff7ebc8560a3354c Mon Sep 17 00:00:00 2001
From: Olivier Brunel <i.am.jack.mail(a)gmail.com>
Date: Mon, 5 Nov 2012 00:28:45 +0100
Subject: [PATCH] systemd: highlight ordering cycle deletions
Having unit(s) removed/not started, even if it solved the issue and allowed
to boot successfully, should still be considered an error, as something
clearly isn't right.
This patch elevates the log message from warning to error, and adds a status
message to make things more obvious.
---
src/core/transaction.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 4bce942..ee6992a 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -374,7 +374,8 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi
if (delete) {
- log_warning("Breaking ordering cycle by deleting job %s/%s", delete->unit->id, job_type_to_string(delete->type));
+ log_error("Breaking ordering cycle by deleting job %s/%s", delete->unit->id, job_type_to_string(delete->type));
+ status_printf(ANSI_HIGHLIGHT_RED_ON " SKIP " ANSI_HIGHLIGHT_OFF, true, "Ordering cycle found, skip %s", unit_description(delete->unit));
transaction_delete_unit(tr, delete->unit);
return -EAGAIN;
}
--
1.7.10.4
++++++ hostnamectl-fix-parsing-no-ask-password.patch ++++++
>From 59f432ea6d6d441d0af7c76c37e80730c8df473a Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Thu, 15 Nov 2012 22:47:04 +0100
Subject: [PATCH] hostnamectl: fix parsing of --no-ask-password
---
src/hostname/hostnamectl.c | 4 ++++
1 file changed, 4 insertions(+)
Index: systemd-195/src/hostname/hostnamectl.c
===================================================================
--- systemd-195.orig/src/hostname/hostnamectl.c
+++ systemd-195/src/hostname/hostnamectl.c
@@ -402,6 +402,10 @@ static int parse_argv(int argc, char *ar
arg_set_static = true;
break;
+ case ARG_NO_ASK_PASSWORD:
+ arg_ask_password = false;
+ break;
+
case '?':
return -EINVAL;
++++++ hostnamectl-fix-set-hostname-with-no-argument.patch ++++++
>From f36d7992ef9588e24feaae5bb3d103ca63af71bd Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay(a)vrfy.org>
Date: Mon, 29 Oct 2012 20:54:26 +0100
Subject: [PATCH] hostnamectl: do not choke on set-hostname with no argument
https://bugzilla.redhat.com/show_bug.cgi?id=871172
---
src/hostname/hostnamectl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c
index 1d448bd..e7b2b49 100644
--- a/src/hostname/hostnamectl.c
+++ b/src/hostname/hostnamectl.c
@@ -430,7 +430,7 @@ static int hostnamectl_main(DBusConnection *bus, int argc, char *argv[], DBusErr
int (* const dispatch)(DBusConnection *bus, char **args, unsigned n);
} verbs[] = {
{ "status", LESS, 1, show_status },
- { "set-hostname", LESS, 2, set_hostname },
+ { "set-hostname", EQUAL, 2, set_hostname },
{ "set-icon-name", EQUAL, 2, set_icon_name },
};
--
1.7.10.4
++++++ improve-bash-completion.patch ++++++
Index: systemd-195/bash-completion/systemd-bash-completion.sh
===================================================================
--- systemd-195.orig/bash-completion/systemd-bash-completion.sh
+++ systemd-195/bash-completion/systemd-bash-completion.sh
@@ -114,15 +114,15 @@ _systemctl () {
[SNAPSHOTS]='delete'
[ENVS]='set-environment unset-environment'
[STANDALONE]='daemon-reexec daemon-reload default dot dump
- emergency exit halt kexec list-jobs list-units
- list-unit-files poweroff reboot rescue show-environment'
+ emergency exit halt hybrid-sleep hibernate kexec list-jobs list-units
+ list-unit-files poweroff reboot rescue show-environment suspend'
[NAME]='snapshot load'
[FILE]='link'
)
for ((i=0; $i <= $COMP_CWORD; i++)); do
if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
- ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG}]}; then
+ ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
verb=${COMP_WORDS[i]}
break
fi
@@ -245,7 +245,7 @@ _loginctl () {
for ((i=0; $i <= $COMP_CWORD; i++)); do
if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
- ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG}]}; then
+ ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
verb=${COMP_WORDS[i]}
break
fi
@@ -280,10 +280,21 @@ _loginctl () {
}
complete -F _loginctl loginctl
+__journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC}
+ ERRNO SYSLOG_{FACILITY,IDENTIFIER,PID}
+ _{P,U,G}ID _COMM _EXE _CMDLINE
+ _AUDIT_{SESSION,LOGINUID}
+ _SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID}
+ _SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP
+ _{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT
+ _KERNEL_{DEVICE,SUBSYSTEM}
+ _UDEV_{SYSNAME,DEVNODE,DEVLINK}
+ __CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP)
+
_journalctl() {
local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
- [STANDALONE]='-a --all -b --this-boot -f --follow --header
+ [STANDALONE]='-a --all -b --this-boot --disk-usage -f --follow --header
-h --help -l --local --new-id128 -m --merge --no-pager
--no-tail -q --quiet --setup-keys --this-boot --verify
--version'
@@ -291,17 +302,6 @@ _journalctl() {
[ARGUNKNOWN]='-c --cursor --interval -n --lines -p --priority --since --until
--verify-key'
)
- local journal_fields=(MESSAGE{,_ID} PRIORITY CODE_{FILE,LINE,FUNC}
- ERRNO SYSLOG_{FACILITY,IDENTIFIER,PID}
- _{P,U,G}ID _COMM _EXE _CMDLINE
- _AUDIT_{SESSION,LOGINUID}
- _SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID}
- _SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP
- _{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT
- _KERNEL_{DEVICE,SUBSYSTEM}
- _UDEV_{SYSNAME,DEVNODE,DEVLINK}
- __CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP)
-
if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then
case $prev in
@@ -313,7 +313,7 @@ _journalctl() {
comps='short short-monotonic verbose export json cat'
;;
--field|-F)
- comps=${journal_fields[*]}
+ comps=${__journal_fields[*]}
;;
--unit|-u)
comps=$(journalctl -F '_SYSTEMD_UNIT')
@@ -337,7 +337,7 @@ _journalctl() {
COMPREPLY=( $(compgen -W '${field_vals[*]}' -- "$cur") )
else
compopt -o nospace
- COMPREPLY=( $(compgen -W '${journal_fields[*]}' -S= -- "$cur") )
+ COMPREPLY=( $(compgen -W '${__journal_fields[*]}' -S= -- "$cur") )
fi
}
complete -F _journalctl journalctl
@@ -476,3 +476,81 @@ _hostnamectl() {
return 0
}
complete -F _hostnamectl hostnamectl
+
+__get_all_sysdevs() {
+ local -a devs=(/sys/bus/*/devices/*/ /sys/class/*/*/)
+ printf '%s\n' "${devs[@]%/}"
+}
+
+_udevadm() {
+ local i verb comps
+ local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
+ local OPTS='-h --help --version --debug'
+
+ local -A VERBS=(
+ [INFO]='info'
+ [TRIGGER]='trigger'
+ [SETTLE]='settle'
+ [CONTROL]='control'
+ [MONITOR]='monitor'
+ [HWDB]='hwdb'
+ [TESTBUILTIN]='test-builtin'
+ [TEST]='test'
+ )
+
+ for ((i=0; $i <= $COMP_CWORD; i++)); do
+ if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
+ ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
+ verb=${COMP_WORDS[i]}
+ break
+ fi
+ done
+
+ if [[ -z $verb && $cur = -* ]]; then
+ COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
+ return 0
+ fi
+
+ if [[ -z $verb ]]; then
+ comps=${VERBS[*]}
+
+ elif __contains_word "$verb" ${VERBS[INFO]}; then
+ if [[ $cur = -* ]]; then
+ comps='--help --query= --path= --name= --root --attribute-walk --export-db --cleanup-db'
+ else
+ comps=$( __get_all_sysdevs )
+ fi
+
+ elif __contains_word "$verb" ${VERBS[TRIGGER]}; then
+ comps='--help --verbose --dry-run --type= --action= --subsystem-match=
+ --subsystem-nomatch= --attr-match= --attr-nomatch= --property-match=
+ --tag-match= --sysname-match= --parent-match='
+
+ elif __contains_word "$verb" ${VERBS[SETTLE]}; then
+ comps='--help --timeout= --seq-start= --seq-end= --exit-if-exists= --quiet'
+
+ elif __contains_word "$verb" ${VERBS[CONTROL]}; then
+ comps='--help --exit --log-priority= --stop-exec-queue --start-exec-queue
+ --reload --property= --children-max= --timeout='
+
+ elif __contains_word "$verb" ${VERBS[MONITOR]}; then
+ comps='--help --kernel --udev --property --subsystem-match= --tag-match='
+
+ elif __contains_word "$verb" ${VERBS[HWDB]}; then
+ comps='--help --update --test='
+
+ elif __contains_word "$verb" ${VERBS[TEST]}; then
+ if [[ $cur = -* ]]; then
+ comps='--help --action='
+ else
+ comps=$( __get_all_sysdevs )
+ fi
+
+ elif __contains_word "$verb" ${VERBS[TESTBUILTIN]}; then
+ comps='blkid btrfs firmware hwdb input_id kmod net_id path_id usb_id uaccess'
+ fi
+
+ COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
+ return 0
+}
+complete -F _udevadm udevadm
++++++ improve-journal-perf.patch ++++++
>From a4bcff5ba36115495994e9f9ba66074471de76ab Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Fri, 26 Oct 2012 03:24:03 +0200
Subject: [PATCH] journal: introduce entry array chain cache
When traversing entry array chains for a bisection or for retrieving an
item by index we previously always started at the beginning of the
chain. Since we tend to look at the same chains repeatedly, let's cache
where we have been the last time, and maybe we can skip ahead with this
the next time.
This turns most bisections and index lookups from O(log(n)*log(n)) into
O(log(n)). More importantly however, we seek around on disk much less,
which is good to reduce buffer cache and seek times on rotational disks.
---
.gitignore | 1 +
Makefile.am | 9 ++++
src/journal/journal-file.c | 109 +++++++++++++++++++++++++++++++++++++---
src/journal/journal-file.h | 3 ++
src/journal/test-journal-enum.c | 53 +++++++++++++++++++
src/shared/hashmap.c | 19 +++++++
src/shared/hashmap.h | 3 ++
7 files changed, 189 insertions(+), 8 deletions(-)
create mode 100644 src/journal/test-journal-enum.c
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index edf8e7d..6c9deac 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -65,6 +65,9 @@
/* n_data was the first entry we added after the initial file format design */
#define HEADER_SIZE_MIN ALIGN64(offsetof(Header, n_data))
+/* How many entries to keep in the entry array chain cache at max */
+#define CHAIN_CACHE_MAX 20
+
void journal_file_close(JournalFile *f) {
assert(f);
@@ -97,6 +100,8 @@ void journal_file_close(JournalFile *f) {
if (f->mmap)
mmap_cache_unref(f->mmap);
+ hashmap_free_free(f->chain_cache);
+
#ifdef HAVE_XZ
free(f->compress_buffer);
#endif
@@ -1307,37 +1312,89 @@ int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const st
return r;
}
+typedef struct ChainCacheItem {
+ uint64_t first; /* the array at the begin of the chain */
+ uint64_t array; /* the cached array */
+ uint64_t begin; /* the first item in the cached array */
+ uint64_t total; /* the total number of items in all arrays before this one in the chain */
+} ChainCacheItem;
+
+static void chain_cache_put(
+ Hashmap *h,
+ ChainCacheItem *ci,
+ uint64_t first,
+ uint64_t array,
+ uint64_t begin,
+ uint64_t total) {
+
+ if (!ci) {
+ if (hashmap_size(h) >= CHAIN_CACHE_MAX)
+ ci = hashmap_steal_first(h);
+ else {
+ ci = new(ChainCacheItem, 1);
+ if (!ci)
+ return;
+ }
+
+ ci->first = first;
+
+ if (hashmap_put(h, &ci->first, ci) < 0) {
+ free(ci);
+ return;
+ }
+ } else
+ assert(ci->first == first);
+
+ ci->array = array;
+ ci->begin = begin;
+ ci->total = total;
+}
+
static int generic_array_get(JournalFile *f,
uint64_t first,
uint64_t i,
Object **ret, uint64_t *offset) {
Object *o;
- uint64_t p = 0, a;
+ uint64_t p = 0, a, t = 0;
int r;
+ ChainCacheItem *ci;
assert(f);
a = first;
+
+ /* Try the chain cache first */
+ ci = hashmap_get(f->chain_cache, &first);
+ if (ci && i > ci->total) {
+ a = ci->array;
+ i -= ci->total;
+ t = ci->total;
+ }
+
while (a > 0) {
- uint64_t n;
+ uint64_t k;
r = journal_file_move_to_object(f, OBJECT_ENTRY_ARRAY, a, &o);
if (r < 0)
return r;
- n = journal_file_entry_array_n_items(o);
- if (i < n) {
+ k = journal_file_entry_array_n_items(o);
+ if (i < k) {
p = le64toh(o->entry_array.items[i]);
- break;
+ goto found;
}
- i -= n;
+ i -= k;
+ t += k;
a = le64toh(o->entry_array.next_entry_array_offset);
}
- if (a <= 0 || p <= 0)
- return 0;
+ return 0;
+
+found:
+ /* Let's cache this item for the next invocation */
+ chain_cache_put(f->chain_cache, ci, first, a, o->entry_array.items[0], t);
r = journal_file_move_to_object(f, OBJECT_ENTRY, p, &o);
if (r < 0)
@@ -1401,11 +1458,38 @@ static int generic_array_bisect(JournalFile *f,
bool subtract_one = false;
Object *o, *array = NULL;
int r;
+ ChainCacheItem *ci;
assert(f);
assert(test_object);
+ /* Start with the first array in the chain */
a = first;
+
+ ci = hashmap_get(f->chain_cache, &first);
+ if (ci && n > ci->total) {
+ /* Ah, we have iterated this bisection array chain
+ * previously! Let's see if we can skip ahead in the
+ * chain, as far as the last time. But we can't jump
+ * backwards in the chain, so let's check that
+ * first. */
+
+ r = test_object(f, ci->begin, needle);
+ if (r < 0)
+ return r;
+
+ if (r == TEST_LEFT) {
+ /* OK, what we are looking for is right of th
+ * begin of this EntryArray, so let's jump
+ * straight to previously cached array in the
+ * chain */
+
+ a = ci->array;
+ n -= ci->total;
+ t = ci->total;
+ }
+ }
+
while (a > 0) {
uint64_t left, right, k, lp;
@@ -1486,6 +1570,9 @@ found:
if (subtract_one && t == 0 && i == 0)
return 0;
+ /* Let's cache this item for the next invocation */
+ chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t);
+
if (subtract_one && i == 0)
p = last_p;
else if (subtract_one)
@@ -2265,6 +2352,12 @@ int journal_file_open(
goto fail;
}
+ f->chain_cache = hashmap_new(uint64_hash_func, uint64_compare_func);
+ if (!f->chain_cache) {
+ r = -ENOMEM;
+ goto fail;
+ }
+
f->fd = open(f->path, f->flags|O_CLOEXEC, f->mode);
if (f->fd < 0) {
r = -errno;
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
index d87cbe4..cdbc8e4 100644
--- a/src/journal/journal-file.h
+++ b/src/journal/journal-file.h
@@ -33,6 +33,7 @@
#include "journal-def.h"
#include "util.h"
#include "mmap-cache.h"
+#include "hashmap.h"
typedef struct JournalMetrics {
uint64_t max_use;
@@ -64,6 +65,8 @@ typedef struct JournalFile {
JournalMetrics metrics;
MMapCache *mmap;
+ Hashmap *chain_cache;
+
#ifdef HAVE_XZ
void *compress_buffer;
uint64_t compress_buffer_size;
diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c
index ef78070..dcfbb67 100644
--- a/src/shared/hashmap.c
+++ b/src/shared/hashmap.c
@@ -147,6 +147,25 @@ int trivial_compare_func(const void *a, const void *b) {
return a < b ? -1 : (a > b ? 1 : 0);
}
+unsigned uint64_hash_func(const void *p) {
+ uint64_t u;
+
+ assert_cc(sizeof(uint64_t) == 2*sizeof(unsigned));
+
+ u = *(const uint64_t*) p;
+
+ return (unsigned) ((u >> 32) ^ u);
+}
+
+int uint64_compare_func(const void *_a, const void *_b) {
+ uint64_t a, b;
+
+ a = *(const uint64_t*) _a;
+ b = *(const uint64_t*) _b;
+
+ return a < b ? -1 : (a > b ? 1 : 0);
+}
+
Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) {
bool b;
Hashmap *h;
diff --git a/src/shared/hashmap.h b/src/shared/hashmap.h
index 55dea0a..6fd71cf 100644
--- a/src/shared/hashmap.h
+++ b/src/shared/hashmap.h
@@ -44,6 +44,9 @@ int string_compare_func(const void *a, const void *b);
unsigned trivial_hash_func(const void *p);
int trivial_compare_func(const void *a, const void *b);
+unsigned uint64_hash_func(const void *p);
+int uint64_compare_func(const void *a, const void *b);
+
Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func);
void hashmap_free(Hashmap *h);
void hashmap_free_free(Hashmap *h);
--
1.8.1.1
>From 34741aa3e2ee1e67a4cc735b7492aec13f0d822c Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Fri, 26 Oct 2012 20:25:36 +0200
Subject: [PATCH] journal: special case the trivial cache chain cache entry
---
src/journal/journal-file.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 6c9deac..3df099d 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -1328,6 +1328,11 @@ static void chain_cache_put(
uint64_t total) {
if (!ci) {
+ /* If the chain item to cache for this chain is the
+ * first one it's not worth caching anything */
+ if (array == first)
+ return;
+
if (hashmap_size(h) >= CHAIN_CACHE_MAX)
ci = hashmap_steal_first(h);
else {
--
1.8.1.1
++++++ improve-man-environment.patch ++++++
>From 2cfd1ed4d853be4a22cc102037347c9041bf5ced Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat(a)suse.com>
Date: Thu, 24 Jan 2013 17:55:42 +0100
Subject: [PATCH] man: systemd.exec - explicit Environment assignment
Be more verbose about using space in Environment field and not
using value of other variables
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=840260
---
man/systemd.exec.xml | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Index: systemd-195/man/systemd.exec.xml
===================================================================
--- systemd-195.orig/man/systemd.exec.xml
+++ systemd-195/man/systemd.exec.xml
@@ -269,9 +269,24 @@
in which case all listed variables
will be set. If the same variable is
set twice the later setting will
- override the earlier setting. See
+ override the earlier setting.
+ Variable expansion is not performed
+ inside the strings, and $ has no special
+ meaning.
+ If you need to assign a value containing spaces
+ to a variable, use double quotes (")
+ for the assignment.</para>
+
+ <para>Example:
+ <programlisting>Environment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"</programlisting>
+ gives three variables <literal>VAR1</literal>,
+ <literal>VAR2</literal>, <literal>VAR3</literal>.
+ </para>
+
+ <para>
+ See
<citerefentry><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry>
- for details.</para></listitem>
+ for details about environment variables.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>EnvironmentFile=</varname></term>
++++++ improve-overflow-checks.patch ++++++
>From 3dd8ee8fa693597663b0338235becbb0b7a9520c Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta(a)redhat.com>
Date: Thu, 25 Oct 2012 16:16:17 +0200
Subject: [PATCH] util: fix possible integer overflows
---
src/shared/util.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: systemd-195/src/shared/util.c
===================================================================
--- systemd-195.orig/src/shared/util.c
+++ systemd-195/src/shared/util.c
@@ -152,6 +152,9 @@ usec_t timespec_load(const struct timesp
ts->tv_nsec == (long) -1)
return (usec_t) -1;
+ if ((usec_t) ts->tv_sec > (UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / USEC_PER_SEC)
+ return (usec_t) -1;
+
return
(usec_t) ts->tv_sec * USEC_PER_SEC +
(usec_t) ts->tv_nsec / NSEC_PER_USEC;
@@ -179,6 +182,9 @@ usec_t timeval_load(const struct timeval
tv->tv_usec == (suseconds_t) -1)
return (usec_t) -1;
+ if ((usec_t) tv->tv_sec > (UINT64_MAX - tv->tv_usec) / USEC_PER_SEC)
+ return (usec_t) -1;
+
return
(usec_t) tv->tv_sec * USEC_PER_SEC +
(usec_t) tv->tv_usec;
++++++ improve-readahead-spinning.patch ++++++
>From 94243ef299425d6c7089a7a05c48c9bb8f6cf3da Mon Sep 17 00:00:00 2001
From: Auke Kok <auke-jan.h.kok(a)intel.com>
Date: Fri, 22 Mar 2013 15:09:45 -0700
Subject: [PATCH 1/2] readahead: chunk on spinning media
Readahead has all sorts of bad side effects depending on your
storage media. On rotating disks, it may be degrading startup
performance if enough requests are queued spanning linearly
over all blocks early at boot, and mount, blkid and friends
want to insert reads to the start of these block devices after.
The end result is that on spinning disks with ext3/4 that udev
and mounts take a very long time, and nothing really happens until
readahead is completely finished.
This has the net effect that the CPU is almost entirely idle
for the entire period that readahead is working. We could have
finished starting up quite a lot of services in this time if
we were smarter at how we do readahead.
This patch sorts all requests into 2 second "chunks" and sub-sorts
each chunk by block. This adds a single cross-drive seek per "chunk"
but has the benefit that we will have a lot of the blocks we need
early on in the boot sequence loaded into memory faster.
For a comparison of how before/after bootcharts look (ext4 on a
mobile 5400rpm 250GB drive) please look at:
http://foo-projects.org/~sofar/blocked-tests/
There are bootcharts in the "before" and "after" folders where you
should be able to see that many low-level services finish 5-7
seconds earlier with the patch applied (after).
---
Makefile.am | 2 +-
src/readahead/readahead-collect.c | 28 +++++++++++++++++++++++++---
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 37c1cc2..5861976 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2956,7 +2956,7 @@ systemd_readahead_SOURCES = \
systemd_readahead_LDADD = \
libsystemd-shared.la \
libsystemd-daemon.la \
- libudev.la
+ libudev.la -lm
dist_doc_DATA += \
src/readahead/sd-readahead.c \
diff --git a/src/readahead/readahead-collect.c b/src/readahead/readahead-collect.c
index 5d07f47..5d22949 100644
--- a/src/readahead/readahead-collect.c
+++ b/src/readahead/readahead-collect.c
@@ -42,6 +42,7 @@
#include <sys/vfs.h>
#include <getopt.h>
#include <sys/inotify.h>
+#include <math.h>
#ifdef HAVE_FANOTIFY_INIT
#include <sys/fanotify.h>
@@ -67,6 +68,7 @@
*/
static ReadaheadShared *shared = NULL;
+static struct timespec starttime;
/* Avoid collisions with the NULL pointer */
#define SECTOR_TO_PTR(s) ULONG_TO_PTR((s)+1)
@@ -205,6 +207,7 @@ static unsigned long fd_first_block(int fd) {
struct item {
const char *path;
unsigned long block;
+ unsigned long bin;
};
static int qsort_compare(const void *a, const void *b) {
@@ -213,6 +216,13 @@ static int qsort_compare(const void *a, const void *b) {
i = a;
j = b;
+ /* sort by bin first */
+ if (i->bin < j->bin)
+ return -1;
+ if (i->bin > j->bin)
+ return 1;
+
+ /* then sort by sector */
if (i->block < j->block)
return -1;
if (i->block > j->block)
@@ -250,6 +260,8 @@ static int collect(const char *root) {
goto finish;
}
+ clock_gettime(CLOCK_MONOTONIC, &starttime);
+
/* If there's no pack file yet we lower the kernel readahead
* so that mincore() is accurate. If there is a pack file
* already we assume it is accurate enough so that kernel
@@ -447,10 +459,21 @@ static int collect(const char *root) {
free(p);
else {
unsigned long ul;
+ struct timespec ts;
+ struct item *entry;
+
+ entry = new0(struct item, 1);
ul = fd_first_block(m->fd);
- if ((k = hashmap_put(files, p, SECTOR_TO_PTR(ul))) < 0) {
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+
+ entry->block = ul;
+ entry->path = strdup(p);
+ entry->bin = round((ts.tv_sec - starttime.tv_sec +
+ ((ts.tv_nsec - starttime.tv_nsec) / 1000000000.0)) / 2.0);
+
+ if ((k = hashmap_put(files, p, entry)) < 0) {
log_warning("set_put() failed: %s", strerror(-k));
free(p);
}
@@ -518,8 +541,7 @@ done:
j = ordered;
HASHMAP_FOREACH_KEY(q, p, files, i) {
- j->path = p;
- j->block = PTR_TO_SECTOR(q);
+ memcpy(j, q, sizeof(struct item));
j++;
}
--
1.8.1.4
>From b0640287f784a320661f7206c9ade07b99003fd5 Mon Sep 17 00:00:00 2001
From: Auke Kok <auke-jan.h.kok(a)intel.com>
Date: Tue, 26 Mar 2013 11:13:47 -0700
Subject: [PATCH 2/2] readahead: cleanups
- check for OOM
- no need to use floats and round()
---
Makefile.am | 2 +-
src/readahead/readahead-collect.c | 20 ++++++++++++++------
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 5861976..37c1cc2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2956,7 +2956,7 @@ systemd_readahead_SOURCES = \
systemd_readahead_LDADD = \
libsystemd-shared.la \
libsystemd-daemon.la \
- libudev.la -lm
+ libudev.la
dist_doc_DATA += \
src/readahead/sd-readahead.c \
diff --git a/src/readahead/readahead-collect.c b/src/readahead/readahead-collect.c
index 5d22949..e2fd8df 100644
--- a/src/readahead/readahead-collect.c
+++ b/src/readahead/readahead-collect.c
@@ -68,7 +68,7 @@
*/
static ReadaheadShared *shared = NULL;
-static struct timespec starttime;
+static usec_t starttime;
/* Avoid collisions with the NULL pointer */
#define SECTOR_TO_PTR(s) ULONG_TO_PTR((s)+1)
@@ -260,7 +260,7 @@ static int collect(const char *root) {
goto finish;
}
- clock_gettime(CLOCK_MONOTONIC, &starttime);
+ starttime = now(CLOCK_MONOTONIC);
/* If there's no pack file yet we lower the kernel readahead
* so that mincore() is accurate. If there is a pack file
@@ -459,19 +459,27 @@ static int collect(const char *root) {
free(p);
else {
unsigned long ul;
- struct timespec ts;
+ usec_t entrytime;
struct item *entry;
entry = new0(struct item, 1);
+ if (!entry) {
+ r = log_oom();
+ goto finish;
+ }
ul = fd_first_block(m->fd);
- clock_gettime(CLOCK_MONOTONIC, &ts);
+ entrytime = now(CLOCK_MONOTONIC);
entry->block = ul;
entry->path = strdup(p);
- entry->bin = round((ts.tv_sec - starttime.tv_sec +
- ((ts.tv_nsec - starttime.tv_nsec) / 1000000000.0)) / 2.0);
+ if (!entry->path) {
+ free(entry);
+ r = log_oom();
+ goto finish;
+ }
+ entry->bin = (entrytime - starttime) / 2000000;
if ((k = hashmap_put(files, p, entry)) < 0) {
log_warning("set_put() failed: %s", strerror(-k));
--
1.8.1.4
++++++ job-avoid-recursion-when-cancelling.patch ++++++
>From 1abc85b8d026a2d72442b0edaee5213d0ee73c1f Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Thu, 25 Oct 2012 02:31:49 +0200
Subject: [PATCH] job: avoid recursion into transaction code from job
cancelation
I hit an "assert(j->installed)" failure in transaction_apply(). Looking
into the backtrace I saw what happened:
1. The system was booting. var.mount/start was an installed job.
2. I pressed Ctrl+Alt+Del.
3. reboot.target was going to be isolated.
4. transaction_apply() proceeded to install a var.mount/stop job.
5. job_install() canceled the conflicting start job.
6. Depending jobs ended recursively with JOB_DEPENDENCY, among them was
local-fs.target/start.
7. Its OnFailure action triggered - emergency.target was now going to be
isolated.
8. We recursed back into transaction_apply() where the half-installed
var.mount/stop job confused us.
Recursing from job installation back into the transaction code cannot be
a good idea. Avoid the problem by canceling the conflicting job
non-recursively in job_install(). I don't think we'll miss anything by
not recursing here. After all, we are called from transaction_apply().
We will not be installing just this one job, but all jobs from a
transaction. All requirement dependencies will be included in it and
will be installed separately. Every transaction job will get a chance
to cancel its own conflicting installed job.
---
src/core/job.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/job.c b/src/core/job.c
index cb5674b..f08b8cb 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -180,7 +180,7 @@ Job* job_install(Job *j) {
if (uj) {
if (j->type != JOB_NOP && job_type_is_conflicting(uj->type, j->type))
- job_finish_and_invalidate(uj, JOB_CANCELED, true);
+ job_finish_and_invalidate(uj, JOB_CANCELED, false);
else {
/* not conflicting, i.e. mergeable */
--
1.7.10.4
++++++ journal-fix-cutoff-max-date.patch ++++++
>From 0f91dd8749c1a1ec308cc645269be92166413e38 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Fri, 26 Oct 2012 01:07:41 +0200
Subject: [PATCH] journal: properly determine cutoff max date
---
src/journal/sd-journal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 09b0eb8..d5d2d78 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -2121,7 +2121,7 @@ _public_ int sd_journal_get_cutoff_realtime_usec(sd_journal *j, uint64_t *from,
if (from)
*from = MIN(fr, *from);
if (to)
- *to = MIN(t, *to);
+ *to = MAX(t, *to);
}
}
@@ -2160,7 +2160,7 @@ _public_ int sd_journal_get_cutoff_monotonic_usec(sd_journal *j, sd_id128_t boot
if (from)
*from = MIN(fr, *from);
if (to)
- *to = MIN(t, *to);
+ *to = MAX(t, *to);
}
}
--
1.7.10.4
++++++ journal-send-always-send-syslog_identifier.patch ++++++
>From ee55db41442ad8055f5a84a339b1e0e22bc037c4 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Tue, 20 Nov 2012 21:25:26 +0100
Subject: [PATCH] journal-send: always send SYSLOG_IDENTIFIER, if we have it
https://bugzilla.redhat.com/show_bug.cgi?id=872193
---
src/journal/journal-send.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
Index: systemd-195/src/journal/journal-send.c
===================================================================
--- systemd-195.orig/src/journal/journal-send.c
+++ systemd-195/src/journal/journal-send.c
@@ -208,6 +208,7 @@ _public_ int sd_journal_sendv(const stru
* be a tmpfs, and one that is available from early boot on
* and where unprivileged users can create files. */
char path[] = "/dev/shm/journal.XXXXXX";
+ bool have_syslog_identifier = false;
if (_unlikely_(!iov))
return -EINVAL;
@@ -217,7 +218,7 @@ _public_ int sd_journal_sendv(const stru
saved_errno = errno;
- w = alloca(sizeof(struct iovec) * n * 5);
+ w = alloca(sizeof(struct iovec) * n * 5 + 3);
l = alloca(sizeof(uint64_t) * n);
for (i = 0; i < n; i++) {
@@ -234,6 +235,9 @@ _public_ int sd_journal_sendv(const stru
goto finish;
}
+ have_syslog_identifier =
+ have_syslog_identifier || (c == iov[i].iov_base + 17 && memcmp(iov[i].iov_base, "SYSLOG_IDENTIFIER", 17) == 0);
+
nl = memchr(iov[i].iov_base, '\n', iov[i].iov_len);
if (nl) {
if (_unlikely_(nl < c)) {
@@ -269,6 +273,20 @@ _public_ int sd_journal_sendv(const stru
IOVEC_SET_STRING(w[j++], "\n");
}
+ if (!have_syslog_identifier &&
+ string_is_safe(program_invocation_short_name)) {
+
+ /* Implicitly add program_invocation_short_name, if it
+ * is not set explicitly. We only do this for
+ * program_invocation_short_name, and nothing else
+ * since everything else is much nicer to retrieve
+ * from the outside. */
+
+ IOVEC_SET_STRING(w[j++], "SYSLOG_IDENTIFIER=");
+ IOVEC_SET_STRING(w[j++], program_invocation_short_name);
+ IOVEC_SET_STRING(w[j++], "\n");
+ }
+
fd = journal_fd();
if (_unlikely_(fd < 0)) {
r = fd;
++++++ journalctl-quit-on-io-error.patch ++++++
>From 244692cbfb46df5ff79d07da8fb848a1165bd2fb Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann(a)googlemail.com>
Date: Sun, 13 Jan 2013 12:28:38 +0100
Subject: [PATCH] journalctl: quit on I/O error
This makes journalctl quit on ferror() conditions on stdout. It fixes an
annoying bug if you pipe its output through 'less' and press 'q'. Without
this fix journalctl will continue reading all journal data until EOF which
can take quite some time. For instance on my machine:
david-nb ~ # time journalctl | wc -l
327240
real 1m13.039s
user 1m0.217s
sys 0m10.467s
However, expected behavior is journalctl to quit when its pager closed the
output pipe.
Signed-off-by: David Herrmann <dh.herrmann(a)googlemail.com>
---
src/journal/journalctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/journal/journalctl.c
===================================================================
--- systemd-195.orig/src/journal/journalctl.c
+++ systemd-195/src/journal/journalctl.c
@@ -1035,7 +1035,7 @@ int main(int argc, char *argv[]) {
on_tty() * OUTPUT_COLOR;
r = output_journal(stdout, j, arg_output, 0, flags);
- if (r < 0)
+ if (r < 0 || ferror(stdout))
goto finish;
need_seek = true;
++++++ journalctl-remove-leftover-message.patch ++++++
>From db87a36e74ff26d1046a451ee086c9a2c4113d12 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Wed, 24 Oct 2012 01:05:55 +0200
Subject: [PATCH] journalctl: remove left-over log message
---
src/journal/journalctl.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index d1338d2..0f20448 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -547,8 +547,6 @@ static int add_priorities(sd_journal *j) {
if (arg_priorities & (1 << i)) {
match[sizeof(match)-2] = '0' + i;
- log_info("adding match %s", match);
-
r = sd_journal_add_match(j, match, strlen(match));
if (r < 0) {
log_error("Failed to add match: %s", strerror(-r));
--
1.7.10.4
++++++ journalctl-require-argument-for-priority ++++++
>From 71c015969233c21ea38b1e63993d02fe171df672 Mon Sep 17 00:00:00 2001
From: Lekensteyn <lekensteyn(a)gmail.com>
Date: Thu, 15 Nov 2012 12:17:03 +0100
Subject: [PATCH] journalctl: require argument for --priority
This fixes a segfault due to a missing value for --priority. -p is
unaffected because it is specified in the getopt_long parameter list.
---
src/journal/journalctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/journal/journalctl.c
===================================================================
--- systemd-195.orig/src/journal/journalctl.c
+++ systemd-195/src/journal/journalctl.c
@@ -158,7 +158,7 @@ static int parse_argv(int argc, char *ar
{ "this-boot", no_argument, NULL, 'b' },
{ "directory", required_argument, NULL, 'D' },
{ "header", no_argument, NULL, ARG_HEADER },
- { "priority", no_argument, NULL, 'p' },
+ { "priority", required_argument, NULL, 'p' },
{ "setup-keys", no_argument, NULL, ARG_SETUP_KEYS },
{ "interval", required_argument, NULL, ARG_INTERVAL },
{ "verify", no_argument, NULL, ARG_VERIFY },
++++++ 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)
])
++++++ localectl-fix-assertion.patch ++++++
>From 6b2b6f30e38d67b032d6bdc6b47ae05e143e96c5 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Wed, 12 Dec 2012 22:24:04 +0100
Subject: [PATCH] localectl: fix dbus call arguments in set_x11_keymap
Fixes an assertion failure in the dbus lib.
https://bugzilla.redhat.com/show_bug.cgi?id=882212
---
src/locale/localectl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/locale/localectl.c
===================================================================
--- systemd-195.orig/src/locale/localectl.c
+++ systemd-195/src/locale/localectl.c
@@ -535,7 +535,7 @@ static int set_x11_keymap(DBusConnection
layout = args[1];
model = n > 2 ? args[2] : "";
variant = n > 3 ? args[3] : "";
- options = n > 3 ? args[4] : "";
+ options = n > 4 ? args[4] : "";
b = arg_convert;
return bus_method_call_with_reply(
++++++ localectl-support-systems-without-locale-archive.patch ++++++
>From 17d33cecaa762f7e43200307328af5e9135e2091 Mon Sep 17 00:00:00 2001
From: Giovanni Campagna <scampa.giovanni(a)gmail.com>
Date: Sat, 5 Jan 2013 01:29:53 +0100
Subject: [PATCH] localectl: support systems without locale-archive
Not all systems ships with locales inside /usr/lib/locale-archive, some
prefer to have locale data as individual subdirectories of /usr/lib/locale.
(A notable example of this is OpenEmbeddded, and OSes deriving from it
like gnome-ostree).
Given that glibc supports both ways, localectl should too.
---
src/locale/localectl.c | 101 ++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 85 insertions(+), 16 deletions(-)
Index: systemd-195/src/locale/localectl.c
===================================================================
--- systemd-195.orig/src/locale/localectl.c
+++ systemd-195/src/locale/localectl.c
@@ -265,7 +265,7 @@ finish:
return r;
}
-static int list_locales(DBusConnection *bus, char **args, unsigned n) {
+static int add_locales_from_archive(Set *locales) {
/* Stolen from glibc... */
struct locarhead {
@@ -303,21 +303,15 @@ static int list_locales(DBusConnection *
const struct namehashent *e;
const void *p = MAP_FAILED;
_cleanup_close_ int fd = -1;
- _cleanup_strv_free_ char **l = NULL;
- char **j;
- Set *locales;
size_t sz = 0;
struct stat st;
unsigned i;
int r;
- locales = set_new(string_hash_func, string_compare_func);
- if (!locales)
- return log_oom();
-
fd = open("/usr/lib/locale/locale-archive", O_RDONLY|O_NOCTTY|O_CLOEXEC);
if (fd < 0) {
- log_error("Failed to open locale archive: %m");
+ if (errno != ENOENT)
+ log_error("Failed to open locale archive: %m");
r = -errno;
goto finish;
}
@@ -378,15 +372,93 @@ static int list_locales(DBusConnection *
}
}
+ r = 0;
+
+ finish:
+ if (p != MAP_FAILED)
+ munmap((void*) p, sz);
+
+ return r;
+}
+
+static int add_locales_from_libdir (Set *locales) {
+ DIR *dir;
+ struct dirent *entry;
+ int r;
+
+ dir = opendir("/usr/lib/locale");
+ if (!dir) {
+ log_error("Failed to open locale directory: %m");
+ r = -errno;
+ goto finish;
+ }
+
+ errno = 0;
+ while ((entry = readdir(dir))) {
+ char *z;
+
+ if (entry->d_type != DT_DIR)
+ continue;
+
+ if (ignore_file(entry->d_name))
+ continue;
+
+ z = strdup(entry->d_name);
+ if (!z) {
+ r = log_oom();
+ goto finish;
+ }
+
+ r = set_put(locales, z);
+ if (r < 0) {
+ free(z);
+
+ if (r != -EEXIST) {
+ log_error("Failed to add locale: %s", strerror(-r));
+ goto finish;
+ }
+ }
+
+ errno = 0;
+ }
+
+ if (errno != 0) {
+ log_error("Failed to read locale directory: %m");
+ r = -errno;
+ goto finish;
+ }
+
+ r = 0;
+
+ finish:
+ closedir(dir);
+ return r;
+}
+
+static int list_locales(DBusConnection *bus, char **args, unsigned n) {
+ Set *locales;
+ _cleanup_strv_free_ char **l = NULL;
+ char **j;
+ int r;
+
+ locales = set_new(string_hash_func, string_compare_func);
+ if (!locales)
+ return log_oom();
+
+ r = add_locales_from_archive(locales);
+ if (r < 0 && r != -ENOENT)
+ goto finish;
+
+ r = add_locales_from_libdir(locales);
+ if (r < 0)
+ goto finish;
+
l = set_get_strv(locales);
if (!l) {
r = log_oom();
goto finish;
}
- set_free(locales);
- locales = NULL;
-
strv_sort(l);
pager_open_if_enabled();
@@ -397,10 +469,7 @@ static int list_locales(DBusConnection *
r = 0;
finish:
- if (p != MAP_FAILED)
- munmap((void*) p, sz);
-
- set_free_free(locales);
+ set_free(locales);
return r;
}
++++++ localfs.service ++++++
[Unit]
Description=Shadow /etc/init.d/boot.localfs
DefaultDependencies=no
After=local-fs.target
[Service]
RemainAfterExit=true
ExecStart=/bin/true
++++++ lock-opensuse.patch ++++++
Index: systemd-37/tmpfiles.d/legacy.conf
===================================================================
--- systemd-37.orig/tmpfiles.d/legacy.conf
+++ systemd-37/tmpfiles.d/legacy.conf
@@ -17,6 +17,8 @@
# On modern systems a BSD file lock is a better choice if
# serialization is needed on those devices.
-d /run/lock 0755 root root -
-d /run/lock/subsys 0755 root root -
-d /run/lock/lockdev 0775 root lock -
+# changed for openSUSE : only /run/lock should be available
+
+d /run/lock 0775 root lock -
+#d /run/lock/subsys 0755 root root -
+#d /run/lock/lockdev 0775 root lock -
++++++ logind-capability-making-seats-without-fb.patch ++++++
>From 955f9bde9ba6d9f0a7364d5cb7c0cee951d5caab Mon Sep 17 00:00:00 2001
From: Oleg Samarin <osamarin68(a)gmail.com>
Date: Sat, 5 Jan 2013 20:33:37 +0400
Subject: [PATCH] logind: Capability of making seats without framebuffer
devices
file logind.c: The seat is now activated by any device with udev tag "seat-master"
file 71-seat.rules.in: All framebuffer devices have this tag
---
src/login/71-seat.rules.in | 2 +-
src/login/logind.c | 12 ++----------
2 files changed, 3 insertions(+), 11 deletions(-)
Index: systemd-195/src/login/71-seat.rules.in
===================================================================
--- systemd-195.orig/src/login/71-seat.rules.in
+++ systemd-195/src/login/71-seat.rules.in
@@ -10,7 +10,7 @@ ACTION=="remove", GOTO="seat_end"
TAG=="uaccess", SUBSYSTEM!="sound", TAG+="seat"
SUBSYSTEM=="sound", KERNEL=="card*", TAG+="seat"
SUBSYSTEM=="input", KERNEL=="input*", TAG+="seat"
-SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="seat"
+SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="seat", TAG+="seat-master"
SUBSYSTEM=="usb", ATTR{bDeviceClass}=="09", TAG+="seat"
# 'Plugable' USB hub, sound, network, graphics adapter
Index: systemd-195/src/login/logind.c
===================================================================
--- systemd-195.orig/src/login/logind.c
+++ systemd-195/src/login/logind.c
@@ -450,11 +450,7 @@ int manager_enumerate_devices(Manager *m
goto finish;
}
- r = udev_enumerate_add_match_subsystem(e, "graphics");
- if (r < 0)
- goto finish;
-
- r = udev_enumerate_add_match_tag(e, "seat");
+ r = udev_enumerate_add_match_tag(e, "seat-master");
if (r < 0)
goto finish;
@@ -1286,11 +1282,7 @@ static int manager_connect_udev(Manager
if (!m->udev_seat_monitor)
return -ENOMEM;
- r = udev_monitor_filter_add_match_tag(m->udev_seat_monitor, "seat");
- if (r < 0)
- return r;
-
- r = udev_monitor_filter_add_match_subsystem_devtype(m->udev_seat_monitor, "graphics", NULL);
+ r = udev_monitor_filter_add_match_tag(m->udev_seat_monitor, "seat-master");
if (r < 0)
return r;
++++++ logind-ignore-non-tty-non-x11-session-on-shutdown.patch ++++++
>From 1ca04b87979b2add53ebb8a7fdf13c34fb6c2743 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Mon, 14 Jan 2013 21:40:38 +0100
Subject: [PATCH] logind: ignore non-tty/non-x11 session when checking if
there are other sessions before shutting down
https://bugzilla.redhat.com/show_bug.cgi?id=890827
---
src/login/logind-dbus.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Index: systemd-195/src/login/logind-dbus.c
===================================================================
--- systemd-195.orig/src/login/logind-dbus.c
+++ systemd-195/src/login/logind-dbus.c
@@ -971,9 +971,12 @@ static int have_multiple_sessions(
assert(m);
- /* Check for other users' sessions. Greeter sessions do not count. */
+ /* Check for other users' sessions. Greeter sessions do not
+ * count, and non-login sessions do not count either. */
HASHMAP_FOREACH(session, m->sessions, i)
- if (session->class == SESSION_USER && session->user->uid != uid)
+ if (session->class == SESSION_USER &&
+ (session->type == SESSION_TTY || session->type == SESSION_X11) &&
+ session->user->uid != uid)
return true;
return false;
++++++ logind-nvidia-acl.diff ++++++
Index: systemd-195/src/login/logind-acl.c
===================================================================
--- systemd-195.orig/src/login/logind-acl.c
+++ systemd-195/src/login/logind-acl.c
@@ -240,6 +240,22 @@ int devnode_acl_all(struct udev *udev,
goto finish;
}
+ /* only apply ACL on nvidia* if /dev/nvidiactl exists */
+ if (devnode_acl("/dev/nvidiactl", flush, del, old_uid, add, new_uid) >= 0) {
+ int i;
+ char *devname;
+
+ for (i = 0; i <= 256 ; i++) {
+ if (asprintf(&devname, "/dev/nvidia%d", i) < 0)
+ break;
+ if (devnode_acl(devname, flush, del, old_uid, add, new_uid) < 0) {
+ free(devname);
+ break;
+ }
+ free(devname);
+ }
+ }
+
finish:
if (e)
udev_enumerate_unref(e);
++++++ macros.systemd ++++++
# RPM macros for packages installing systemd unit files
#
###
#
# When a package install systemd unit files, it should use the following macros:
#
# add %systemd_requires in the specfile
#
# %pre
# %service_add_pre demo.service demo1.service
#
# %post
# %service_add_post demo.service demo1.service
#
# %preun
# %service_del_preun demo.service
#
# %postun
# %service_del_postun demo.service
#
###
# This is for systemctl
%systemd_requires \
Requires(pre): systemd \
Requires(post): systemd \
Requires(preun): systemd \
Requires(postun): systemd \
%_unitdir /usr/lib/systemd/system
%service_add_pre() \
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
# disable migration if initial install under systemd \
[ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \
if [ $FIRST_ARG -eq 1 ]; then \
for service in %{?*} ; do \
sysv_service=${service%.*} \
touch "/var/lib/systemd/migrated/$sysv_service" || : \
done \
else \
for service in %{?*} ; do \
sysv_service=${service%.*} \
if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then \
services_to_migrate="$services_to_migrate $sysv_service" \
fi \
done \
if [ -n "$services_to_migrate" ]; then \
/usr/sbin/systemd-sysv-convert --save $services_to_migrate >/dev/null 2>&1 || : \
fi \
fi \
%{nil}
# On install, tell systemd to reload its unit files
%service_add_post() \
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
[ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \
for service in %{?*} ; do \
sysv_service=${service%.*} \
if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then \
services_to_migrate="$services_to_migrate $sysv_service" \
touch "/var/lib/systemd/migrated/$sysv_service" || : \
fi \
done \
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : \
if [ -n "$services_to_migrate" ]; then \
/usr/sbin/systemd-sysv-convert --apply $services_to_migrate >/dev/null 2>&1 || : \
elif [ $FIRST_ARG -eq 1 ]; then \
/usr/bin/systemctl preset %{?*} >/dev/null 2>&1 || : \
fi \
%{nil}
# On uninstall, disable and stop services
%service_del_preun() \
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
if [ $FIRST_ARG -eq 0 ]; then \
# Package removal, not upgrade \
/usr/bin/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
/usr/bin/systemctl stop %{?*} > /dev/null 2>&1 || : \
fi \
%{nil}
# On uninstall, tell systemd to reload its unit files
%service_del_postun() \
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
if [ $FIRST_ARG -ge 1 ]; then \
# Package upgrade, not uninstall \
/usr/bin/systemctl try-restart %{?*} >/dev/null 2>&1 || : \
else # package uninstall \
for service in %{?*} ; do \
sysv_service=${service%.*} \
rm -f "/var/lib/systemd/migrated/$sysv_service" 2> /dev/null || : \
done \
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : \
fi \
%{nil}
++++++ modules_on_boot.patch ++++++
>From 051e407e1af70e779c092c81733a98832c29d6b4 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat(a)suse.com>
Date: Wed, 12 Oct 2011 15:18:29 +0200
Subject: [PATCH] module-load: handle SUSE /etc/sysconfig/kernel module list
---
src/modules-load.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
Index: systemd-191/src/modules-load/modules-load.c
===================================================================
--- systemd-191.orig/src/modules-load/modules-load.c
+++ systemd-191/src/modules-load/modules-load.c
@@ -173,6 +173,9 @@ int main(int argc, char *argv[]) {
int r = EXIT_FAILURE, k;
char **files = NULL, **fn, **i;
struct kmod_ctx *ctx;
+#if defined(TARGET_SUSE)
+ char *modules_on_boot = NULL;
+#endif
if (argc > 1) {
log_error("This program takes no argument.");
@@ -256,9 +259,34 @@ int main(int argc, char *argv[]) {
fclose(f);
}
-
+#if defined(TARGET_SUSE)
+ log_debug("apply: /etc/sysconfig/kernel MODULES_LOADED_ON_BOOT");
+ if ((r = parse_env_file("/etc/sysconfig/kernel", NEWLINE,
+ "MODULES_LOADED_ON_BOOT", &modules_on_boot,
+ NULL)) < 0) {
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/kernel: %s", strerror(-r));
+ } else
+ r = EXIT_SUCCESS;
+ if (modules_on_boot) {
+ char **modules = strv_split(modules_on_boot,WHITESPACE);
+ char **module;
+
+ if (modules) {
+ STRV_FOREACH(module, modules) {
+ k = load_module(ctx, *module);
+ if (k < 0)
+ r = EXIT_FAILURE;
+ }
+ }
+ strv_free(modules);
+ }
+#endif
finish:
strv_free(files);
+#if defined(TARGET_SUSE)
+ free(modules_on_boot);
+#endif
kmod_unref(ctx);
strv_free(arg_proc_cmdline_modules);
Index: systemd-191/units/systemd-modules-load.service.in
===================================================================
--- systemd-191.orig/units/systemd-modules-load.service.in
+++ systemd-191/units/systemd-modules-load.service.in
@@ -13,6 +13,7 @@ Conflicts=shutdown.target
After=systemd-readahead-collect.service systemd-readahead-replay.service
Before=sysinit.target shutdown.target
ConditionCapability=CAP_SYS_MODULE
+ConditionPathExists=|/etc/sysconfig/kernel
ConditionDirectoryNotEmpty=|/lib/modules-load.d
ConditionDirectoryNotEmpty=|/usr/lib/modules-load.d
ConditionDirectoryNotEmpty=|/usr/local/lib/modules-load.d
++++++ mount-efivars.patch ++++++
>From f271dd97622b656c1c013d181ea615c671cc2438 Mon Sep 17 00:00:00 2001
From: "Lee, Chun-Yi" <joeyli.kernel(a)gmail.com>
Date: Sat, 27 Oct 2012 11:23:22 +0800
Subject: [PATCH] systemd: mount the EFI variable filesystem
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Add efivarfs to the mount_table in mount-setup.c, so the EFI variable
filesystem will be mounted when systemd executed.
The EFI variable filesystem will merge in v3.7 or v3.8 linux kernel.
Cc: Kay Sievers <kay(a)vrfy.org>
Cc: Lennart Poettering <lennart(a)poettering.net>
Cc: Mantas Mikulėnas <grawity(a)gmail.com>
Cc: Zbigniew Jędrzejewski-Szmek <zbyszek(a)in.waw.pl>
Cc: Matt Fleming <matt.fleming(a)intel.com>
Cc: Jeremy Kerr <jeremy.kerr(a)canonical.com>
Cc: Matthew Garrett <mjg(a)redhat.com>
Signed-off-by: Lee, Chun-Yi <jlee(a)suse.com>
---
src/core/kmod-setup.c | 7 ++++---
src/core/mount-setup.c | 1 +
2 files changed, 5 insertions(+), 3 deletions(-)
Index: systemd-195/src/core/kmod-setup.c
===================================================================
--- systemd-195.orig/src/core/kmod-setup.c
+++ systemd-195/src/core/kmod-setup.c
@@ -30,10 +30,16 @@
#include "kmod-setup.h"
-static const char * const kmod_table[] = {
- "autofs4", "/sys/class/misc/autofs",
- "ipv6", "/sys/module/ipv6",
- "unix", "/proc/net/unix"
+typedef struct Kmodule {
+ const char *name;
+ const char *directory;
+ bool (*condition_fn)(void);
+} KModule;
+
+static const KModule kmod_table[] = {
+ { "autofs4", "/sys/class/misc/autofs", NULL } ,
+ { "ipv6", "/sys/module/ipv6", NULL },
+ { "unix", "/proc/net/unix", NULL } ,
};
#pragma GCC diagnostic push
@@ -41,7 +47,8 @@ static const char * const kmod_table[] =
static void systemd_kmod_log(void *data, int priority, const char *file, int line,
const char *fn, const char *format, va_list args)
{
- log_metav(priority, file, line, fn, format, args);
+ /* library logging is enabled at debug only */
+ log_metav(LOG_DEBUG, file, line, fn, format, args);
}
#pragma GCC diagnostic pop
@@ -52,13 +59,15 @@ int kmod_setup(void) {
int err;
for (i = 0; i < ELEMENTSOF(kmod_table); i += 2) {
+ if (kmod_table[i].condition_fn && !kmod_table[i].condition_fn())
+ continue;
- if (access(kmod_table[i+1], F_OK) >= 0)
+ if (access(kmod_table[i].directory, F_OK) >= 0)
continue;
log_debug("Your kernel apparently lacks built-in %s support. Might be a good idea to compile it in. "
"We'll now try to work around this by loading the module...",
- kmod_table[i]);
+ kmod_table[i].name);
if (!ctx) {
ctx = kmod_new(NULL, NULL);
@@ -68,13 +77,12 @@ int kmod_setup(void) {
}
kmod_set_log_fn(ctx, systemd_kmod_log, NULL);
-
kmod_load_resources(ctx);
}
- err = kmod_module_new_from_name(ctx, kmod_table[i], &mod);
+ err = kmod_module_new_from_name(ctx, kmod_table[i].name, &mod);
if (err < 0) {
- log_error("Failed to load module '%s'", kmod_table[i]);
+ log_error("Failed to lookup module '%s'", kmod_table[i].name);
continue;
}
@@ -84,7 +92,7 @@ int kmod_setup(void) {
else if (err == KMOD_PROBE_APPLY_BLACKLIST)
log_info("Module '%s' is blacklisted", kmod_module_get_name(mod));
else
- log_error("Failed to insert '%s'", kmod_module_get_name(mod));
+ log_error("Failed to insert module '%s'", kmod_module_get_name(mod));
kmod_module_unref(mod);
}
Index: systemd-195/src/core/mount-setup.c
===================================================================
--- systemd-195.orig/src/core/mount-setup.c
+++ systemd-195/src/core/mount-setup.c
@@ -46,14 +46,20 @@
#define TTY_GID 5
#endif
+typedef enum MountMode {
+ MNT_NONE = 0,
+ MNT_FATAL = 1 << 0,
+ MNT_IN_CONTAINER = 1 << 1,
+} MountMode;
+
typedef struct MountPoint {
const char *what;
const char *where;
const char *type;
const char *options;
unsigned long flags;
- bool fatal;
- bool in_container;
+ bool (*condition_fn)(void);
+ MountMode mode;
} MountPoint;
/* The first three entries we might need before SELinux is up. The
@@ -62,15 +68,26 @@ typedef struct MountPoint {
#define N_EARLY_MOUNT 4
static const MountPoint mount_table[] = {
- { "proc", "/proc", "proc", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, true, true },
- { "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, true, true },
- { "devtmpfs", "/dev", "devtmpfs", "mode=755", MS_NOSUID|MS_STRICTATIME, true, true },
- { "securityfs", "/sys/kernel/security", "securityfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, false, false },
- { "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true, true },
- { "devpts", "/dev/pts", "devpts", "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC, false, true },
- { "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true, true },
- { "tmpfs", "/sys/fs/cgroup", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME, false, true },
- { "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV, false, true },
+ { "proc", "/proc", "proc", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_FATAL|MNT_IN_CONTAINER },
+ { "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_FATAL|MNT_IN_CONTAINER },
+ { "devtmpfs", "/dev", "devtmpfs", "mode=755", MS_NOSUID|MS_STRICTATIME,
+ NULL, MNT_FATAL|MNT_IN_CONTAINER },
+ { "securityfs", "/sys/kernel/security", "securityfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_NONE },
+ { "efivarfs", "/sys/firmware/efi/efivars", "efivarfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ is_efiboot, MNT_NONE },
+ { "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV|MS_STRICTATIME,
+ NULL, MNT_FATAL|MNT_IN_CONTAINER },
+ { "devpts", "/dev/pts", "devpts", "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC,
+ NULL, MNT_IN_CONTAINER },
+ { "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME,
+ NULL, MNT_FATAL|MNT_IN_CONTAINER },
+ { "tmpfs", "/sys/fs/cgroup", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME,
+ NULL, MNT_IN_CONTAINER },
+ { "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ NULL, MNT_IN_CONTAINER },
};
/* These are API file systems that might be mounted by other software,
@@ -118,6 +135,9 @@ static int mount_one(const MountPoint *p
assert(p);
+ if (p->condition_fn && !p->condition_fn())
+ return 0;
+
/* Relabel first, just in case */
if (relabel)
label_fix(p->where, true, true);
@@ -130,7 +150,7 @@ static int mount_one(const MountPoint *p
return 0;
/* Skip securityfs in a container */
- if (!p->in_container && detect_container(NULL) > 0)
+ if (!(p->mode & MNT_IN_CONTAINER) && detect_container(NULL) > 0)
return 0;
/* The access mode here doesn't really matter too much, since
@@ -148,8 +168,8 @@ static int mount_one(const MountPoint *p
p->type,
p->flags,
p->options) < 0) {
- log_full(p->fatal ? LOG_ERR : LOG_DEBUG, "Failed to mount %s: %s", p->where, strerror(errno));
- return p->fatal ? -errno : 0;
+ log_full((p->mode & MNT_FATAL) ? LOG_ERR : LOG_DEBUG, "Failed to mount %s: %s", p->where, strerror(errno));
+ return (p->mode & MNT_FATAL) ? -errno : 0;
}
/* Relabel again, since we now mounted something fresh here */
@@ -288,7 +308,6 @@ int mount_cgroup_controllers(char ***joi
p.type = "cgroup";
p.options = options;
p.flags = MS_NOSUID|MS_NOEXEC|MS_NODEV;
- p.fatal = false;
r = mount_one(&p, true);
free(controller);
Index: systemd-195/src/shared/util.c
===================================================================
--- systemd-195.orig/src/shared/util.c
+++ systemd-195/src/shared/util.c
@@ -75,6 +75,10 @@ char **saved_argv = NULL;
static volatile unsigned cached_columns = 0;
static volatile unsigned cached_lines = 0;
+bool is_efiboot(void) {
+ return access("/sys/firmware/efi", F_OK) >= 0;
+}
+
size_t page_size(void) {
static __thread size_t pgsz = 0;
long r;
Index: systemd-195/src/shared/util.h
===================================================================
--- systemd-195.orig/src/shared/util.h
+++ systemd-195/src/shared/util.h
@@ -90,6 +90,8 @@ union dirent_storage {
#define ANSI_HIGHLIGHT_YELLOW_ON "\x1B[1;33m"
#define ANSI_HIGHLIGHT_OFF "\x1B[0m"
+bool is_efiboot(void);
+
usec_t now(clockid_t clock);
dual_timestamp* dual_timestamp_get(dual_timestamp *ts);
++++++ multiple-sulogin.patch ++++++
Index: systemd-195/units/getty@.service.m4
===================================================================
--- systemd-195.orig/units/getty@.service.m4
+++ systemd-195/units/getty@.service.m4
@@ -8,6 +8,7 @@
[Unit]
Description=Getty on %I
Documentation=man:agetty(8)
+Conflicts=rescue.service
After=systemd-user-sessions.service plymouth-quit-wait.service
m4_ifdef(`TARGET_FEDORA',
After=rc-local.service
Index: systemd-195/units/rescue.target
===================================================================
--- systemd-195.orig/units/rescue.target
+++ systemd-195/units/rescue.target
@@ -10,6 +10,7 @@ Description=Rescue Mode
Documentation=man:systemd.special(7)
Requires=sysinit.target rescue.service
After=sysinit.target rescue.service
+Conflicts=getty.target
AllowIsolate=yes
[Install]
Index: systemd-195/units/serial-getty@.service.m4
===================================================================
--- systemd-195.orig/units/serial-getty@.service.m4
+++ systemd-195/units/serial-getty@.service.m4
@@ -9,6 +9,7 @@
Description=Serial Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
BindsTo=dev-%i.device
+Conflicts=rescue.service
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
m4_ifdef(`TARGET_FEDORA',
After=rc-local.service
++++++ new-lsb-headers.patch ++++++
Index: systemd-195/src/core/service.c
===================================================================
--- systemd-195.orig/src/core/service.c
+++ systemd-195/src/core/service.c
@@ -146,6 +146,7 @@ static void service_init(Unit *u) {
#ifdef HAVE_SYSV_COMPAT
s->sysv_start_priority = -1;
s->sysv_start_priority_from_rcnd = -1;
+ s->sysv_remain_after_exit_heuristic = true;
#endif
s->socket_fd = -1;
s->guess_main_pid = true;
@@ -906,6 +907,34 @@ static int service_load_sysv_path(Servic
free(short_description);
short_description = d;
+ } else if (startswith_no_case(t, "PIDFile:")) {
+ char *fn;
+
+ state = LSB;
+
+ fn = strstrip(t+8);
+ if (!path_is_absolute(fn)) {
+ log_warning("[%s:%u] PID file not absolute. Ignoring.", path, line);
+ continue;
+ }
+
+ if (!(fn = strdup(fn))) {
+ r = -ENOMEM;
+ goto finish;
+ }
+
+ free(s->pid_file);
+ s->pid_file = fn;
+ s->sysv_remain_after_exit_heuristic = false;
+ s->remain_after_exit = false;
+ } else if (startswith_no_case(t, "X-Systemd-RemainAfterExit:")) {
+ char *j;
+
+ state = LSB;
+ if ((j = strstrip(t+26)) && *j) {
+ s->remain_after_exit = parse_boolean(j);
+ s->sysv_remain_after_exit_heuristic = false;
+ }
} else if (state == LSB_DESCRIPTION) {
if (startswith(l, "#\t") || startswith(l, "# ")) {
@@ -963,7 +992,8 @@ static int service_load_sysv_path(Servic
/* Special setting for all SysV services */
s->type = SERVICE_FORKING;
- s->remain_after_exit = !s->pid_file;
+ if (s->sysv_remain_after_exit_heuristic)
+ s->remain_after_exit = !s->pid_file;
s->guess_main_pid = false;
s->restart = SERVICE_RESTART_NO;
s->exec_context.ignore_sigpipe = false;
@@ -2138,7 +2168,7 @@ static void service_enter_running(Servic
if ((main_pid_ok > 0 || (main_pid_ok < 0 && cgroup_ok != 0)) &&
(s->bus_name_good || s->type != SERVICE_DBUS)) {
#ifdef HAVE_SYSV_COMPAT
- if (s->sysv_enabled && !s->pid_file)
+ if (s->sysv_enabled && !s->pid_file && s->sysv_remain_after_exit_heuristic)
s->remain_after_exit = false;
#endif
service_set_state(s, SERVICE_RUNNING);
Index: systemd-195/src/core/service.h
===================================================================
--- systemd-195.orig/src/core/service.h
+++ systemd-195/src/core/service.h
@@ -176,6 +176,7 @@ struct Service {
bool is_sysv:1;
bool sysv_has_lsb:1;
bool sysv_enabled:1;
+ bool sysv_remain_after_exit_heuristic:1;
int sysv_start_priority_from_rcnd;
int sysv_start_priority;
++++++ pam-properly-handle-ssh-logins-without-pam-tty-field.patch ++++++
>From 0ad1271f564b9c956685938167f7ea8c301e835e Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Sun, 23 Dec 2012 22:31:17 +0100
Subject: [PATCH] pam: properly handle SSH logins lacking the PAM tty field
---
src/login/pam-module.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index 08a9328..e6764a1 100644
--- a/src/login/pam-module.c
+++ b/src/login/pam-module.c
@@ -322,7 +322,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
struct passwd *pw;
bool kill_processes = false, debug = false;
- const char *username, *id, *object_path, *runtime_path, *service = NULL, *tty = NULL, *display = NULL, *remote_user = NULL, *remote_host = NULL, *seat = NULL, *type, *class, *cvtnr = NULL;
+ const char *username, *id, *object_path, *runtime_path, *service = NULL, *tty = NULL, *display = NULL, *remote_user = NULL, *remote_host = NULL, *seat = NULL, *type = NULL, *class, *cvtnr = NULL;
char **controllers = NULL, **reset_controllers = NULL, **kill_only_users = NULL, **kill_exclude_users = NULL;
DBusError error;
uint32_t uid, pid;
@@ -453,9 +453,17 @@ _public_ PAM_EXTERN int pam_sm_open_session(
display = tty;
tty = "";
} else if (streq(tty, "cron")) {
- /* cron has been setting PAM_TTY to "cron" for a very long time
- * and it cannot stop doing that for compatibility reasons. */
+ /* cron has been setting PAM_TTY to "cron" for a very
+ * long time and it probably shouldn't stop doing that
+ * for compatibility reasons. */
tty = "";
+ type = "unspecified";
+ } else if (streq(tty, "ssh")) {
+ /* ssh has been setting PAM_TTY to "ssh" for a very
+ * long time and probably shouldn't stop doing that
+ * for compatibility reasons. */
+ tty = "";
+ type ="tty";
}
/* If this fails vtnr will be 0, that's intended */
@@ -469,8 +477,9 @@ _public_ PAM_EXTERN int pam_sm_open_session(
get_seat_from_display(display, NULL, &vtnr);
}
- type = !isempty(display) ? "x11" :
- !isempty(tty) ? "tty" : "unspecified";
+ if (!type)
+ type = !isempty(display) ? "x11" :
+ !isempty(tty) ? "tty" : "unspecified";
class = pam_getenv(handle, "XDG_SESSION_CLASS");
if (isempty(class))
--
1.7.10.4
++++++ parse-multiline-env-file.patch ++++++
>From 565d91fdf198b88f7c2d72c67cfc6c30341a3596 Mon Sep 17 00:00:00 2001
From: Michal Vyskocil <mvyskocil(a)suse.cz>
Date: Fri, 18 Jan 2013 10:05:10 +0100
Subject: [PATCH] util: continuation support for load_env_file
Variable definitions can be written on more than one line - if each ends
with a backslash, then is concatenated with a previous one. Only
backslash and unix end of line (\n) are treated as a continuation.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=58083
[zj: squashed two patches together; cleaned up grammar; removed
comment about ignoring trailing backslash -- it is not ignored.]
Document continuation support in systemd.exec
---
man/systemd.exec.xml | 8 +++++---
src/shared/util.c | 43 ++++++++++++++++++++++++++++++++++++++-----
2 files changed, 43 insertions(+), 8 deletions(-)
Index: systemd-195/man/systemd.exec.xml
===================================================================
--- systemd-195.orig/man/systemd.exec.xml
+++ systemd-195/man/systemd.exec.xml
@@ -282,9 +282,11 @@
contain new-line separated variable
assignments. Empty lines and lines
starting with ; or # will be ignored,
- which may be used for commenting. The
- parser strips leading and
- trailing whitespace from the values
+ which may be used for commenting. A line
+ ending with a backslash will be concatenated
+ with the following one, allowing multiline variable
+ definitions. The parser strips leading
+ and trailing whitespace from the values
of assignments, unless you use
double quotes (").
The
Index: systemd-195/src/shared/util.c
===================================================================
--- systemd-195.orig/src/shared/util.c
+++ systemd-195/src/shared/util.c
@@ -876,69 +876,88 @@ fail:
return r;
}
-int load_env_file(
- const char *fname,
- char ***rl) {
-
- FILE *f;
- char **m = NULL;
- int r;
+int load_env_file(const char *fname, char ***rl) {
+
+ _cleanup_fclose_ FILE *f;
+ _cleanup_strv_free_ char **m = NULL;
+ _cleanup_free_ char *c = NULL;
assert(fname);
assert(rl);
- if (!(f = fopen(fname, "re")))
+ /* This reads an environment file, but will not complain about
+ * any invalid assignments, that needs to be done by the
+ * caller */
+
+ f = fopen(fname, "re");
+ if (!f)
return -errno;
while (!feof(f)) {
- char l[LINE_MAX], *p, *u;
- char **t;
+ char l[LINE_MAX], *p, *cs, *b;
if (!fgets(l, sizeof(l), f)) {
- if (feof(f))
- break;
+ if (ferror(f))
+ return -errno;
+
+ /* The previous line was a continuation line?
+ * Let's process it now, before we leave the
+ * loop */
+ if (c)
+ goto process;
- r = -errno;
- goto finish;
+ break;
}
- p = strstrip(l);
+ /* Is this a continuation line? If so, just append
+ * this to c, and go to next line right-away */
+ cs = endswith(l, "\\\n");
+ if (cs) {
+ *cs = '\0';
+ b = strappend(c, l);
+ if (!b)
+ return -ENOMEM;
- if (!*p)
+ free(c);
+ c = b;
continue;
+ }
- if (strchr(COMMENTS, *p))
- continue;
+ /* If the previous line was a continuation line,
+ * append the current line to it */
+ if (c) {
+ b = strappend(c, l);
+ if (!b)
+ return -ENOMEM;
- if (!(u = normalize_env_assignment(p))) {
- r = log_oom();
- goto finish;
+ free(c);
+ c = b;
}
- t = strv_append(m, u);
- free(u);
+ process:
+ p = strstrip(c ? c : l);
- if (!t) {
- r = log_oom();
- goto finish;
+ if (*p && !strchr(COMMENTS, *p)) {
+ _cleanup_free_ char *u;
+ int k;
+
+ u = normalize_env_assignment(p);
+ if (!u)
+ return -ENOMEM;
+
+ k = strv_extend(&m, u);
+ if (k < 0)
+ return -ENOMEM;
}
- strv_free(m);
- m = t;
+ free(c);
+ c = NULL;
}
- r = 0;
-
*rl = m;
m = NULL;
-finish:
- if (f)
- fclose(f);
-
- strv_free(m);
-
- return r;
+ return 0;
}
int write_env_file(const char *fname, char **l) {
Index: systemd-195/src/shared/strv.c
===================================================================
--- systemd-195.orig/src/shared/strv.c
+++ systemd-195/src/shared/strv.c
@@ -370,6 +370,32 @@ fail:
return NULL;
}
+int strv_extend(char ***l, const char *value) {
+ char **c;
+ char *v;
+ unsigned n;
+
+ if (!value)
+ return 0;
+
+ v = strdup(value);
+ if (!v)
+ return -ENOMEM;
+
+ n = strv_length(*l);
+ c = realloc(*l, sizeof(char*) * (n + 2));
+ if (!c) {
+ free(v);
+ return -ENOMEM;
+ }
+
+ c[n] = v;
+ c[n+1] = NULL;
+
+ *l = c;
+ return 0;
+}
+
char **strv_uniq(char **l) {
char **i;
Index: systemd-195/src/shared/strv.h
===================================================================
--- systemd-195.orig/src/shared/strv.h
+++ systemd-195/src/shared/strv.h
@@ -37,6 +37,7 @@ unsigned strv_length(char **l);
char **strv_merge(char **a, char **b);
char **strv_merge_concat(char **a, char **b, const char *suffix);
char **strv_append(char **l, const char *s);
+int strv_extend(char ***l, const char *value);
char **strv_remove(char **l, const char *s);
char **strv_remove_prefix(char **l, const char *s);
++++++ path-util-fix-potential-crash.patch ++++++
>From c9c7aef24f9750bbd51d2c13beff66473d96bf3c Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta(a)redhat.com>
Date: Thu, 13 Dec 2012 14:59:39 +0100
Subject: [PATCH] path-util: set pointer to null after calling free()
In cases where path_strv_canonicalize() returns NULL, strv_free() is
called afterwards and it will call free() on pointers which were freed
already in path_strv_canonicalize()
---
src/shared/path-util.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index 70c8a8a..dd12d3d 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -181,6 +181,7 @@ char **path_strv_canonicalize(char **l) {
t = path_make_absolute_cwd(*s);
free(*s);
+ *s = NULL;
if (!t) {
enomem = true;
--
1.7.10.4
++++++ pre_checkin.sh ++++++
#!/bin/sh
# This script is based on libcdio_spec-prepare.sh (thanks to sbrabec(a)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 udevpkgname.*$/${EDIT_WARNING}%define udevpkgname udev-mini/;
s/^\(Name:.*\)$/\1-mini/;
s/^BuildRoot.*/&\n\nProvides: %{real} = %{version}-%{release}\n/
" < ${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
++++++ rbind-mount.patch ++++++
>From df77b11852d6b3495848c4123e7cbd9f099910f9 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat(a)suse.com>
Date: Thu, 21 Feb 2013 15:40:52 +0100
Subject: [PATCH] detect rbind as bind mount
Correctly detect rbind mount option as bind mount.
Fixes https://bugzilla.novell.com/show_bug.cgi?id=804575.
---
src/core/mount.c | 6 ++++++
src/fstab-generator/fstab-generator.c | 4 +++-
2 files changed, 9 insertions(+), 1 deletion(-)
Index: systemd-195/src/core/mount.c
===================================================================
--- systemd-195.orig/src/core/mount.c
+++ systemd-195/src/core/mount.c
@@ -320,6 +320,12 @@ static bool mount_is_bind(MountParameter
if (p->fstype && streq(p->fstype, "bind"))
return true;
+ if (mount_test_option(p->options, "rbind"))
+ return true;
+
+ if (p->fstype && streq(p->fstype, "rbind"))
+ return true;
+
return false;
}
Index: systemd-195/src/fstab-generator/fstab-generator.c
===================================================================
--- systemd-195.orig/src/fstab-generator/fstab-generator.c
+++ systemd-195/src/fstab-generator/fstab-generator.c
@@ -199,7 +199,9 @@ static bool mount_is_bind(struct mntent
return
hasmntopt(me, "bind") ||
- streq(me->mnt_type, "bind");
+ streq(me->mnt_type, "bind") ||
+ hasmntopt(me, "rbind") ||
+ streq(me->mnt_type, "rbind");
}
static bool mount_is_network(struct mntent *me) {
++++++ remount-ro-before-unmount.patch ++++++
>From 93bd157722c76b47d80742f290373c1ce2865070 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Fri, 16 Nov 2012 18:36:28 +0100
Subject: [PATCH] umount: always remount read-only before unmounting in final
shutdown loop
---
src/core/umount.c | 57 +++++++++++++++++++++++++----------------------------
1 file changed, 27 insertions(+), 30 deletions(-)
diff --git a/src/core/umount.c b/src/core/umount.c
index 83c9de3..e794057 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -407,6 +407,33 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
assert(head);
LIST_FOREACH_SAFE(mount_point, m, n, *head) {
+
+ /* If we are in a container, don't attempt to
+ read-only mount anything as that brings no real
+ benefits, but might confuse the host, as we remount
+ the superblock here, not the bind mound. */
+ if (detect_container(NULL) <= 0) {
+ /* We always try to remount directories
+ * read-only first, before we go on and umount
+ * them.
+ *
+ * Mount points can be stacked. If a mount
+ * point is stacked below / or /usr, we
+ * cannnot umount or remount it directly,
+ * since there is no way to refer to the
+ * underlying mount. There's nothing we can do
+ * about it for the general case, but we can
+ * do something about it if it is aliased
+ * somehwere else via a bind mount. If we
+ * explicitly remount the super block of that
+ * alias read-only we hence should be
+ * relatively safe regarding keeping the fs we
+ * can otherwise not see dirty. */
+ mount(NULL, m->path, NULL, MS_REMOUNT|MS_RDONLY, NULL);
+ }
+
+ /* Skip / and /usr since we cannot unmount that
+ * anyway, since we are running from it */
if (path_equal(m->path, "/")
#ifndef HAVE_SPLIT_USR
|| path_equal(m->path, "/usr")
@@ -432,29 +459,6 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
return n_failed;
}
-static int mount_points_list_remount_read_only(MountPoint **head, bool *changed) {
- MountPoint *m, *n;
- int n_failed = 0;
-
- assert(head);
-
- LIST_FOREACH_SAFE(mount_point, m, n, *head) {
-
- /* Trying to remount read-only */
- if (mount(NULL, m->path, NULL, MS_REMOUNT|MS_RDONLY, NULL) == 0) {
- if (changed)
- *changed = true;
-
- mount_point_free(head, m);
- } else {
- log_warning("Could not remount as read-only %s: %m", m->path);
- n_failed++;
- }
- }
-
- return n_failed;
-}
-
static int swap_points_list_off(MountPoint **head, bool *changed) {
MountPoint *m, *n;
int n_failed = 0;
@@ -571,13 +575,6 @@ int umount_all(bool *changed) {
if (r <= 0)
goto end;
- /* If we are in a container, don't attempt to read-only mount
- anything as that brings no real benefits, but might confuse
- the host, as we remount the superblock here, not the bind
- mound. */
- if (detect_container(NULL) <= 0)
- r = mount_points_list_remount_read_only(&mp_list_head, changed);
-
end:
mount_points_list_free(&mp_list_head);
--
1.7.10.4
++++++ revert-of-9279749b84cc87c7830280b7895a48bed03c9429.patch ++++++
commit 140883405e429d9f8d3480a2701d8904f97e4a98
Author: Tom Gundersen <teg(a)jklm.no>
Date: Wed Nov 28 18:08:54 2012 +0100
shutdown: don't consider umounting of / and /usr failed
In the words of Homer: If you don't try, you can't fail.
This is a revert of 9279749b84cc87c7830280b7895a48bed03c9429.
It used to be necessary to consider the umounting failed to make sure /
and /usr were remounted read-only, but that is no longer necessary as
everything is now remounted read-only anyway.
Moreover, this avoids a warning at shutdown saying a filesystem was not
unmounted. As the umounting of / is never attempted there was no
corresponding warning message saying which fs that failed. This caused some
spurious bug-reports from concerned users.
Cc: Michael Biebl <biebl(a)debian.org>
diff --git a/src/core/umount.c b/src/core/umount.c
index e794057..5989a4c 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -433,15 +433,14 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
}
/* Skip / and /usr since we cannot unmount that
- * anyway, since we are running from it */
+ * anyway, since we are running from it. They have already been
+ * remounte ro. */
if (path_equal(m->path, "/")
#ifndef HAVE_SPLIT_USR
|| path_equal(m->path, "/usr")
#endif
- ) {
- n_failed++;
+ )
continue;
- }
/* Trying to umount. Forcing to umount if busy (only for NFS mounts) */
if (umount2(m->path, MNT_FORCE) == 0) {
++++++ reword-rescue-mode-hints.patch ++++++
>From aa6eba407be2c23882bf41a1beafbbd1352f7ab3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Tue, 23 Oct 2012 16:32:12 +0200
Subject: [PATCH] units: reword rescue mode hints
Do not suggest to the user that commands can be issued before
logging in.
sulogin prints it own message, which mentions ^D, so there's no need
to repeat it here.
---
units/emergency.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/units/emergency.service.in b/units/emergency.service.in
index 1815f9d..129a831 100644
--- a/units/emergency.service.in
+++ b/units/emergency.service.in
@@ -16,7 +16,7 @@ Before=shutdown.target
Environment=HOME=/root
WorkingDirectory=/root
ExecStartPre=-/bin/plymouth quit
-ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! Type "systemctl default" or ^D to enter default mode.\\nType "journalctl -b" to view system logs. Type "systemctl reboot" to reboot.'
+ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -b" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\\nto boot into default mode.'
ExecStart=-/sbin/sulogin
ExecStopPost=@SYSTEMCTL@ --fail --no-block default
Type=idle
--
1.7.10.4
++++++ service-forking-ignore-exit-status-main-process.patch ++++++
>From fbeefb45ac1a257a0c5af975ad26d68ed6c39fda Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Mon, 14 Jan 2013 21:05:17 +0100
Subject: [PATCH] service: for Type=forking services, ignore exit status of
main process depending on ExecStart's ignore setting
https://bugzilla.redhat.com/show_bug.cgi?id=860464
---
src/core/service.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
Index: systemd-195/src/core/service.c
===================================================================
--- systemd-195.orig/src/core/service.c
+++ systemd-195/src/core/service.c
@@ -2978,15 +2978,25 @@ static void service_sigchld_event(Unit *
s->main_pid = 0;
exec_status_exit(&s->main_exec_status, &s->exec_context, pid, code, status);
- /* If this is not a forking service than the main
- * process got started and hence we copy the exit
- * status so that it is recorded both as main and as
- * control process exit status */
if (s->main_command) {
+ /* If this is not a forking service than the
+ * main process got started and hence we copy
+ * the exit status so that it is recorded both
+ * as main and as control process exit
+ * status */
+
s->main_command->exec_status = s->main_exec_status;
if (s->main_command->ignore)
f = SERVICE_SUCCESS;
+ } else if (s->exec_command[SERVICE_EXEC_START]) {
+
+ /* If this is a forked process, then we should
+ * ignore the return value if this was
+ * configured for the starter process */
+
+ if (s->exec_command[SERVICE_EXEC_START]->ignore)
+ f = SERVICE_SUCCESS;
}
log_struct(f == SERVICE_SUCCESS ? LOG_DEBUG : LOG_NOTICE,
++++++ shutdown-dont-force-mnt-force-on-final-umount.patch ++++++
>From 0c08f5cde749bd2818475e487109cd0d413452df Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Wed, 16 Jan 2013 03:51:56 +0100
Subject: [PATCH] shutdown: in the final umount loop don't use MNT_FORCE
MNT_FORCE is honoured by NFS and FUSE and allows unmounting of the FS
even if consumers still use it. For our brute-force loop we rely on
EBUSY being reported as long as a file system is still used by a
loopback device or suchlike. Hence, drop MNT_FORCE to make EBUSY
reliable.
---
src/core/umount.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/core/umount.c b/src/core/umount.c
index 96232d3..c7b6cee 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -442,9 +442,11 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
)
continue;
- /* Trying to umount. Forcing to umount if busy (only for NFS mounts) */
+ /* Trying to umount. We don't force here since we rely
+ * on busy NFS and FUSE file systems to return EBUSY
+ * until we closed everything on top of them. */
log_info("Unmounting %s.", m->path);
- if (umount2(m->path, MNT_FORCE) == 0) {
+ if (umount2(m->path, 0) == 0) {
if (changed)
*changed = true;
--
1.7.10.4
++++++ shutdown-ignore-loop-devices-without-backing-file.patch ++++++
>From bdffb521d01a2e2bc342154d74cb519755c52c25 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay(a)vrfy.org>
Date: Wed, 16 Jan 2013 04:35:54 +0100
Subject: [PATCH] shutdown: ignore loop devices without a backing file
---
src/core/umount.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/core/umount.c b/src/core/umount.c
index c7b6cee..f0f2711 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -233,6 +233,7 @@ static int loopback_list_get(MountPoint **head) {
udev_list_entry_foreach(item, first) {
MountPoint *lb;
struct udev_device *d;
+ const char *backing;
char *loop;
const char *dn;
@@ -241,6 +242,12 @@ static int loopback_list_get(MountPoint **head) {
goto finish;
}
+ backing = udev_device_get_sysattr_value(d, "loop/backing_file");
+ if (!backing) {
+ udev_device_unref(d);
+ continue;
+ }
+
if (!(dn = udev_device_get_devnode(d))) {
udev_device_unref(d);
continue;
--
1.7.10.4
++++++ shutdown-improvements.patch ++++++
>From 2569a5ce16638d99f1ebaaa7774d183496d8b8e8 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Fri, 7 Dec 2012 17:28:30 +0100
Subject: [PATCH] shutdown: downgrade a warning
All messages of the kind "not all done, %d left" are log_info, except
the one for DM devices. Make it info too.
---
src/core/shutdown.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 4bb4b4d..192746a 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -233,7 +233,7 @@ int main(int argc, char *argv[]) {
if (r == 0)
need_dm_detach = false;
else if (r > 0)
- log_warning("Not all DM devices detached, %d left.", r);
+ log_info("Not all DM devices detached, %d left.", r);
else
log_error("Failed to detach DM devices: %s", strerror(-r));
}
--
1.7.10.4
>From c678406681d32d56730b9e9c002d5500d7aa7f8b Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Fri, 7 Dec 2012 17:34:21 +0100
Subject: [PATCH] umount: fix check for DM changed
delete_dm() returns 0 on success. The check for "r > 0" was likely
a copy&paste error from the loopback code where "r > 0" makes sense.
---
src/core/umount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/umount.c b/src/core/umount.c
index f6c520e..8776807 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -536,7 +536,7 @@ static int dm_points_list_detach(MountPoint **head, bool *changed) {
if ((r = delete_dm(m->devnum)) >= 0) {
- if (r > 0 && changed)
+ if (changed)
*changed = true;
mount_point_free(head, m);
--
1.7.10.4
>From bce93b7ac7642426039863493694d8c12812e2a7 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Fri, 7 Dec 2012 17:44:50 +0100
Subject: [PATCH] shutdown, umount: logging improvements
In bugreports about hangs during the late shutdown we are often missing
important information - what were we trying to unmount/detach when it hung.
Instead of printing what we successfully unmounted, print what we are
going to unmount/detach. And add messages to mark the completion of
categories (mount/swap/loop/DM).
---
src/core/shutdown.c | 20 ++++++++++++--------
src/core/umount.c | 15 +++++++++------
2 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 192746a..6783008 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -197,9 +197,10 @@ int main(int argc, char *argv[]) {
if (need_umount) {
log_info("Unmounting file systems.");
r = umount_all(&changed);
- if (r == 0)
+ if (r == 0) {
need_umount = false;
- else if (r > 0)
+ log_info("All filesystems unmounted.");
+ } else if (r > 0)
log_info("Not all file systems unmounted, %d left.", r);
else
log_error("Failed to unmount file systems: %s", strerror(-r));
@@ -208,9 +209,10 @@ int main(int argc, char *argv[]) {
if (need_swapoff) {
log_info("Disabling swaps.");
r = swapoff_all(&changed);
- if (r == 0)
+ if (r == 0) {
need_swapoff = false;
- else if (r > 0)
+ log_info("All swaps disabled.");
+ } else if (r > 0)
log_info("Not all swaps are turned off, %d left.", r);
else
log_error("Failed to turn off swaps: %s", strerror(-r));
@@ -219,9 +221,10 @@ int main(int argc, char *argv[]) {
if (need_loop_detach) {
log_info("Detaching loop devices.");
r = loopback_detach_all(&changed);
- if (r == 0)
+ if (r == 0) {
need_loop_detach = false;
- else if (r > 0)
+ log_info("All loop devices detached.");
+ } else if (r > 0)
log_info("Not all loop devices detached, %d left.", r);
else
log_error("Failed to detach loop devices: %s", strerror(-r));
@@ -230,9 +233,10 @@ int main(int argc, char *argv[]) {
if (need_dm_detach) {
log_info("Detaching DM devices.");
r = dm_detach_all(&changed);
- if (r == 0)
+ if (r == 0) {
need_dm_detach = false;
- else if (r > 0)
+ log_info("All DM devices detached.");
+ } else if (r > 0)
log_info("Not all DM devices detached, %d left.", r);
else
log_error("Failed to detach DM devices: %s", strerror(-r));
diff --git a/src/core/umount.c b/src/core/umount.c
index 8776807..fd90d9f 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -443,8 +443,8 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
continue;
/* Trying to umount. Forcing to umount if busy (only for NFS mounts) */
+ log_info("Unmounting %s.", m->path);
if (umount2(m->path, MNT_FORCE) == 0) {
- log_info("Unmounted %s.", m->path);
if (changed)
*changed = true;
@@ -465,6 +465,7 @@ static int swap_points_list_off(MountPoint **head, bool *changed) {
assert(head);
LIST_FOREACH_SAFE(mount_point, m, n, *head) {
+ log_info("Disabling swap %s.", m->path);
if (swapoff(m->path) == 0) {
if (changed)
*changed = true;
@@ -500,8 +501,9 @@ static int loopback_points_list_detach(MountPoint **head, bool *changed) {
continue;
}
- if ((r = delete_loopback(m->path)) >= 0) {
-
+ log_info("Deleting loopback %s.", m->path);
+ r = delete_loopback(m->path);
+ if (r >= 0) {
if (r > 0 && changed)
*changed = true;
@@ -534,14 +536,15 @@ static int dm_points_list_detach(MountPoint **head, bool *changed) {
continue;
}
- if ((r = delete_dm(m->devnum)) >= 0) {
-
+ log_info("Deleting DM %u:%u.", major(m->devnum), minor(m->devnum));
+ r = delete_dm(m->devnum);
+ if (r >= 0) {
if (changed)
*changed = true;
mount_point_free(head, m);
} else {
- log_warning("Could not delete dm %s: %m", m->path);
+ log_warning("Could not delete DM %s: %m", m->path);
n_failed++;
}
}
--
1.7.10.4
>From 735e0712710a1dc26da0febafb91b242b2687f3f Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Fri, 7 Dec 2012 18:02:43 +0100
Subject: [PATCH] shutdown, umount: use verbs consistently
Mounts are "unmounted".
Swaps are "deactivated", not "turned off" nor "disabled".
Loop and DM devices are "detached", not "deleted".
Especially the deleting sounded a bit scary.
---
src/core/shutdown.c | 8 ++++----
src/core/umount.c | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 6783008..0b0e0c3 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -207,15 +207,15 @@ int main(int argc, char *argv[]) {
}
if (need_swapoff) {
- log_info("Disabling swaps.");
+ log_info("Deactivating swaps.");
r = swapoff_all(&changed);
if (r == 0) {
need_swapoff = false;
- log_info("All swaps disabled.");
+ log_info("All swaps deactivated.");
} else if (r > 0)
- log_info("Not all swaps are turned off, %d left.", r);
+ log_info("Not all swaps deactivated, %d left.", r);
else
- log_error("Failed to turn off swaps: %s", strerror(-r));
+ log_error("Failed to deactivate swaps: %s", strerror(-r));
}
if (need_loop_detach) {
diff --git a/src/core/umount.c b/src/core/umount.c
index fd90d9f..96232d3 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -465,7 +465,7 @@ static int swap_points_list_off(MountPoint **head, bool *changed) {
assert(head);
LIST_FOREACH_SAFE(mount_point, m, n, *head) {
- log_info("Disabling swap %s.", m->path);
+ log_info("Deactivating swap %s.", m->path);
if (swapoff(m->path) == 0) {
if (changed)
*changed = true;
@@ -501,7 +501,7 @@ static int loopback_points_list_detach(MountPoint **head, bool *changed) {
continue;
}
- log_info("Deleting loopback %s.", m->path);
+ log_info("Detaching loopback %s.", m->path);
r = delete_loopback(m->path);
if (r >= 0) {
if (r > 0 && changed)
@@ -509,7 +509,7 @@ static int loopback_points_list_detach(MountPoint **head, bool *changed) {
mount_point_free(head, m);
} else {
- log_warning("Could not delete loopback %s: %m", m->path);
+ log_warning("Could not detach loopback %s: %m", m->path);
n_failed++;
}
}
@@ -536,7 +536,7 @@ static int dm_points_list_detach(MountPoint **head, bool *changed) {
continue;
}
- log_info("Deleting DM %u:%u.", major(m->devnum), minor(m->devnum));
+ log_info("Detaching DM %u:%u.", major(m->devnum), minor(m->devnum));
r = delete_dm(m->devnum);
if (r >= 0) {
if (changed)
@@ -544,7 +544,7 @@ static int dm_points_list_detach(MountPoint **head, bool *changed) {
mount_point_free(head, m);
} else {
- log_warning("Could not delete DM %s: %m", m->path);
+ log_warning("Could not detach DM %s: %m", m->path);
n_failed++;
}
}
--
1.7.10.4
++++++ socket-improve-error-message.patch ++++++
>From 10f70492aea211981e4bdbe58dd7ea110e05cd16 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Tue, 20 Nov 2012 00:19:00 +0100
Subject: [PATCH] socket: improve error message when we cannot spawn the
socket's service unit
---
src/core/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/core/socket.c
===================================================================
--- systemd-195.orig/src/core/socket.c
+++ systemd-195/src/core/socket.c
@@ -1510,7 +1510,7 @@ static void socket_enter_running(Socket
return;
fail:
- log_warning("%s failed to queue socket startup job: %s", UNIT(s)->id, bus_error(&error, r));
+ log_warning("%s failed to queue service startup job (Maybe the service file is missing or not a %s unit?): %s", UNIT(s)->id, cfd >= 0 ? "template" : "non-template", bus_error(&error, r));
socket_enter_stop_pre(s, SOCKET_FAILURE_RESOURCES);
if (cfd >= 0)
++++++ socket-verbose-error-message.patch ++++++
>From 80cba3795da3a43b27cbb219d7daf7d6f049b079 Mon Sep 17 00:00:00 2001
From: Dimitrios Apostolou <jimis(a)gmx.net>
Date: Wed, 19 Dec 2012 22:32:52 +0100
Subject: [PATCH] socket: Too many incoming connections
Hello list,
some socket activated service gave me the error message you can see on
the subject, maybe systemd should be more verbose in that case.
Thanks,
Dimitris
---
src/core/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/core/socket.c
===================================================================
--- systemd-195.orig/src/core/socket.c
+++ systemd-195/src/core/socket.c
@@ -1441,7 +1441,7 @@ static void socket_enter_running(Socket
Service *service;
if (s->n_connections >= s->max_connections) {
- log_warning("Too many incoming connections (%u)", s->n_connections);
+ log_warning("%s: Too many incoming connections (%u)", UNIT(s)->id, s->n_connections);
close_nointr_nofail(cfd);
return;
}
++++++ storage-after-cryptsetup.patch ++++++
>From b9841589cf16950af7d123ecd128b84464d15a1d Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat(a)suse.com>
Date: Mon, 7 Nov 2011 18:04:20 +0100
Subject: [PATCH] force lvm restart after cryptsetup target is reached
---
src/cryptsetup-generator.c | 80 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 80 insertions(+), 0 deletions(-)
Index: systemd-194/src/cryptsetup/cryptsetup-generator.c
===================================================================
--- systemd-194.orig/src/cryptsetup/cryptsetup-generator.c
+++ systemd-194/src/cryptsetup/cryptsetup-generator.c
@@ -22,6 +22,7 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
+#include <stdlib.h>
#include "log.h"
#include "util.h"
@@ -64,6 +65,71 @@ static bool has_option(const char *hayst
return false;
}
+static int create_storage_after_cryptsetup (void) {
+ int r;
+ char *to = NULL, *p = NULL;
+ FILE *f = NULL;
+
+ if (asprintf(&p, "%s/storage-after-cryptsetup.service", arg_dest) < 0) {
+ r = -ENOMEM;
+ log_error("Failed to allocate unit file name.");
+ goto fail;
+ }
+
+ if (!(f = fopen(p, "wxe"))) {
+ r = -errno;
+ log_error("Failed to create unit file: %m");
+ goto fail;
+ }
+
+ fprintf(f,
+ "[Unit]\n"
+ "Description=Restart storage after cryptsetup\n"
+ "DefaultDependencies=no\n"
+ "After=cryptsetup.target\n"
+ "Wants=cryptsetup.target\n"
+ "Before=local-fs.target\n"
+ "Before=shutdown.target\n");
+
+ fprintf(f,
+ "\n[Service]\n"
+ "RemainAfterExit=true\n"
+ "Type=oneshot\n"
+ "TimeoutSec=0\n"
+ "ExecStart=/usr/bin/systemctl restart lvm.service\n");
+
+ fflush(f);
+
+ if (ferror(f)) {
+ r = -errno;
+ log_error("Failed to write file: %m");
+ goto fail;
+ }
+
+ if (asprintf(&to, "%s/local-fs.target.wants/storage-after-cryptsetup.service", arg_dest) < 0) {
+ r = -ENOMEM;
+ goto fail;
+ }
+
+ mkdir_parents(to, 0755);
+
+ if (symlink("../storage-after-cryptsetup.service", to) < 0) {
+ log_error("Failed to create symlink ../storage-after-cryptsetup.service to '%s': %m", to);
+ r = -errno;
+ goto fail;
+ }
+
+ r=0;
+fail:
+ free(p);
+ free(to);
+
+ if (f)
+ fclose(f);
+
+ return r;
+}
+
static int create_disk(
const char *name,
const char *device,
@@ -439,6 +505,9 @@ int main(int argc, char *argv[]) {
free(options);
}
+ if ((r == EXIT_SUCCESS) && (create_storage_after_cryptsetup () < 0))
+ r = EXIT_FAILURE;
+
finish:
if (f)
fclose(f);
++++++ strv-cleanup-error-path-loops.patch ++++++
>From 1fd8d04e384ae2066c02129b033c6be509edfd67 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Tue, 30 Oct 2012 18:29:45 +0100
Subject: [PATCH] strv: cleanup error path loops
https://bugzilla.redhat.com/show_bug.cgi?id=858799
---
src/shared/strv.c | 100 ++++++++++++++++++++++++++---------------------------
1 file changed, 49 insertions(+), 51 deletions(-)
diff --git a/src/shared/strv.c b/src/shared/strv.c
index 1b8e27b..6b76d0e 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -75,25 +75,21 @@ void strv_freep(char ***l) {
char **strv_copy(char **l) {
char **r, **k;
- k = r = new(char*, strv_length(l)+1);
- if (!k)
+ k = r = new(char*, strv_length(l) + 1);
+ if (!r)
return NULL;
if (l)
- for (; *l; k++, l++)
- if (!(*k = strdup(*l)))
- goto fail;
+ for (; *l; k++, l++) {
+ *k = strdup(*l);
+ if (!*k) {
+ strv_free(r);
+ return NULL;
+ }
+ }
*k = NULL;
return r;
-
-fail:
- for (k--; k >= r; k--)
- free(*k);
-
- free(r);
-
- return NULL;
}
unsigned strv_length(char **l) {
@@ -163,13 +159,7 @@ char **strv_new_ap(const char *x, va_list ap) {
return a;
fail:
-
- for (; i > 0; i--)
- if (a[i-1])
- free(a[i-1]);
-
- free(a);
-
+ strv_free(a);
return NULL;
}
@@ -265,16 +255,21 @@ char **strv_split(const char *s, const char *separator) {
FOREACH_WORD_SEPARATOR(w, l, s, separator, state)
n++;
- if (!(r = new(char*, n+1)))
+ r = new(char*, n+1);
+ if (!r)
return NULL;
i = 0;
- FOREACH_WORD_SEPARATOR(w, l, s, separator, state)
- if (!(r[i++] = strndup(w, l))) {
+ FOREACH_WORD_SEPARATOR(w, l, s, separator, state) {
+ r[i] = strndup(w, l);
+ if (!r[i]) {
strv_free(r);
return NULL;
}
+ i++;
+ }
+
r[i] = NULL;
return r;
}
@@ -292,15 +287,19 @@ char **strv_split_quoted(const char *s) {
FOREACH_WORD_QUOTED(w, l, s, state)
n++;
- if (!(r = new(char*, n+1)))
+ r = new(char*, n+1);
+ if (!r)
return NULL;
i = 0;
- FOREACH_WORD_QUOTED(w, l, s, state)
- if (!(r[i++] = cunescape_length(w, l))) {
+ FOREACH_WORD_QUOTED(w, l, s, state) {
+ r[i] = cunescape_length(w, l);
+ if (!r[i]) {
strv_free(r);
return NULL;
}
+ i++;
+ }
r[i] = NULL;
return r;
@@ -323,7 +322,8 @@ char *strv_join(char **l, const char *separator) {
n += strlen(*s);
}
- if (!(r = new(char, n+1)))
+ r = new(char, n+1);
+ if (!r)
return NULL;
e = r;
@@ -352,22 +352,21 @@ char **strv_append(char **l, const char *s) {
if (!r)
return NULL;
- for (k = r; *l; k++, l++)
- if (!(*k = strdup(*l)))
+ for (k = r; *l; k++, l++) {
+ *k = strdup(*l);
+ if (!*k)
goto fail;
+ }
- if (!(*(k++) = strdup(s)))
+ k[0] = strdup(s);
+ if (!k[0])
goto fail;
- *k = NULL;
+ k[1] = NULL;
return r;
fail:
- for (k--; k >= r; k--)
- free(*k);
-
- free(r);
-
+ strv_free(r);
return NULL;
}
@@ -462,7 +461,8 @@ static int env_append(char **r, char ***k, char **a) {
else
free(*j);
- if (!(*j = strdup(*a)))
+ *j = strdup(*a);
+ if (!*j)
return -ENOMEM;
}
@@ -484,7 +484,8 @@ char **strv_env_merge(unsigned n_lists, ...) {
}
va_end(ap);
- if (!(r = new(char*, n+1)))
+ r = new(char*, n+1);
+ if (!r)
return NULL;
k = r;
@@ -503,11 +504,7 @@ char **strv_env_merge(unsigned n_lists, ...) {
fail:
va_end(ap);
-
- for (k--; k >= r; k--)
- free(*k);
-
- free(r);
+ strv_free(r);
return NULL;
}
@@ -619,7 +616,8 @@ char **strv_env_set(char **x, const char *p) {
/* Overrides the env var setting of p, returns a new copy */
- if (!(r = new(char*, strv_length(x)+2)))
+ r = new(char*, strv_length(x)+2);
+ if (!r)
return NULL;
k = r;
@@ -634,11 +632,7 @@ char **strv_env_set(char **x, const char *p) {
return r;
fail:
- for (k--; k >= r; k--)
- free(*k);
-
- free(r);
-
+ strv_free(r);
return NULL;
}
@@ -698,7 +692,8 @@ char **strv_parse_nulstr(const char *s, size_t l) {
if (s[l-1] != 0)
c++;
- if (!(v = new0(char*, c+1)))
+ v = new0(char*, c+1);
+ if (!v)
return NULL;
p = s;
@@ -707,11 +702,14 @@ char **strv_parse_nulstr(const char *s, size_t l) {
e = memchr(p, 0, s + l - p);
- if (!(v[i++] = strndup(p, e ? e - p : s + l - p))) {
+ v[i] = strndup(p, e ? e - p : s + l - p);
+ if (!v[i]) {
strv_free(v);
return NULL;
}
+ i++;
+
if (!e)
break;
--
1.7.10.4
++++++ support-hybrid-suspend.patch ++++++
++++ 680 lines (skipped)
++++++ support-suse-clock-sysconfig.patch ++++++
>From 64ddc0bfa995041196fd0b9c61756d64578f925c Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat(a)suse.com>
Date: Tue, 14 Aug 2012 14:26:16 +0200
Subject: [PATCH] timedate: add support for openSUSE version of
/etc/sysconfig/clock
---
src/timedate/timedated.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: systemd-190/src/timedate/timedated.c
===================================================================
--- systemd-190.orig/src/timedate/timedated.c
+++ systemd-190/src/timedate/timedated.c
@@ -175,6 +175,13 @@ static int read_data(void) {
goto have_timezone;
}
}
+#ifdef TARGET_SUSE
+ r = parse_env_file("/etc/sysconfig/clock", NEWLINE,
+ "TIMEZONE", &tz.zone,
+ NULL);
+ if (r < 0 && r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/clock: %s", strerror(-r));
+#endif
#ifdef HAVE_DEBIAN
r = read_one_line_file("/etc/timezone", &tz.zone);
++++++ support-sysvinit.patch ++++++
Index: systemd-195/src/systemctl/systemctl.c
===================================================================
--- systemd-195.orig/src/systemctl/systemctl.c
+++ systemd-195/src/systemctl/systemctl.c
@@ -4678,10 +4678,13 @@ static int parse_argv(int argc, char *ar
/* Hmm, so some other init system is
* running, we need to forward this
* request to it. For now we simply
- * guess that it is Upstart. */
-
- execv("/lib/upstart/telinit", argv);
+ * guess that it is Sysvinit or Upstart. */
+ if (!access("/lib/sysvinit/telinit", X_OK)) {
+ execv("/lib/sysvinit/telinit", argv);
+ } else {
+ execv("/lib/upstart/telinit", argv);
+ }
log_error("Couldn't find an alternative telinit implementation to spawn.");
return -EIO;
}
++++++ switch-root-try-pivot-root.patch ++++++
>From 891a4918ef75fa81e22691156c050d061bd53dd3 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Fri, 16 Nov 2012 18:15:30 +0100
Subject: [PATCH] switch-root: try pivot_root() before overmounting /
We should always try to umount the old root dir if possible, instead of
overmounting it -- if that's possible.
The initial ("first") kernel rootfs can never be umounted, hence
for the usual nitrd case we never bothered using pivot_root() and
hence with fully unmounting it. However, fedup now tranisitions twice
during boot, and in that case it is highly desirable that the "second"
root dir is entirely unmounted when we switch to the "third". This patch
makes that possible.
The pivot_root() needs a directory in the "third" root dir, to move the
"second" root dir to. We use /mnt for that, under the assumption that
this directory is likely to exist, and is not itself a mount point.
---
src/core/switch-root.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/src/core/switch-root.c b/src/core/switch-root.c
index 150332a..ce0e41d 100644
--- a/src/core/switch-root.c
+++ b/src/core/switch-root.c
@@ -30,6 +30,7 @@
#include "util.h"
#include "path-util.h"
#include "switch-root.h"
+#include "missing.h"
int switch_root(const char *new_root) {
@@ -44,10 +45,21 @@ int switch_root(const char *new_root) {
struct stat new_root_stat;
bool old_root_remove;
const char *i;
+ _cleanup_free_ char *temporary_old_root = NULL;
if (path_equal(new_root, "/"))
return 0;
+ /* When using pivot_root() we assume that /mnt exists as place
+ * we can temporarily move the old root to. As we immediately
+ * unmount it from there it doesn't matter much which
+ * directory we choose for this, but it should be more likely
+ * than not that /mnt exists and is suitable as mount point
+ * and is on the same fs as the old root dir */
+ temporary_old_root = strappend(new_root, "/mnt");
+ if (!temporary_old_root)
+ return -ENOMEM;
+
old_root_remove = in_initrd();
if (stat(new_root, &new_root_stat) < 0) {
@@ -103,7 +115,20 @@ int switch_root(const char *new_root) {
log_warning("Failed to open root directory: %m");
}
- if (mount(new_root, "/", NULL, MS_MOVE, NULL) < 0) {
+ /* We first try a pivot_root() so that we can umount the old
+ * root dir. In many cases (i.e. where rootfs is /), that's
+ * not possible however, and hence we simply overmount root */
+ if (pivot_root(new_root, temporary_old_root) >= 0) {
+
+ /* Immediately get rid of the old root. Since we are
+ * running off it we need to do this lazily. */
+ if (umount2(temporary_old_root, MNT_DETACH) < 0) {
+ r = -errno;
+ log_error("Failed to umount old root dir %s: %m", temporary_old_root);
+ goto fail;
+ }
+
+ } else if (mount(new_root, "/", NULL, MS_MOVE, NULL) < 0) {
r = -errno;
log_error("Failed to mount moving %s to /: %m", new_root);
goto fail;
--
1.7.10.4
++++++ sync-on-shutdown.patch ++++++
>From 0049f05a8bb82c3e084bacc5945596761d706c55 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Fri, 16 Nov 2012 01:30:29 +0100
Subject: [PATCH] shutdown: readd explicit sync() when shutting down
As it turns out reboot() doesn't actually imply a file system sync, but
only a disk sync. Accordingly, readd explicit sync() invocations
immediately before we invoke reboot().
This is much less dramatic than it might sounds as we umount all
disks/read-only remount them anyway before going down.
---
src/core/service.c | 1 +
src/core/shutdown.c | 7 +++++++
2 files changed, 8 insertions(+)
Index: systemd-195/src/core/service.c
===================================================================
--- systemd-195.orig/src/core/service.c
+++ systemd-195/src/core/service.c
@@ -2526,6 +2526,7 @@ static int service_start_limit_test(Serv
case SERVICE_START_LIMIT_REBOOT_IMMEDIATE:
log_warning("%s start request repeated too quickly, rebooting immediately.", UNIT(s)->id);
+ sync();
reboot(RB_AUTOBOOT);
break;
Index: systemd-195/src/core/shutdown.c
===================================================================
--- systemd-195.orig/src/core/shutdown.c
+++ systemd-195/src/core/shutdown.c
@@ -273,6 +273,13 @@ int main(int argc, char *argv[]) {
}
}
+ /* The kernel will automaticall flush ATA disks and suchlike
+ * on reboot(), but the file systems need to be synce'd
+ * explicitly in advance. So let's do this here, but not
+ * needlessly slow down containers. */
+ if (!in_container)
+ sync();
+
if (cmd == LINUX_REBOOT_CMD_KEXEC) {
if (!in_container) {
++++++ sysctl-handle-boot-sysctl.conf-kernel_release.patch ++++++
>From 752a4370ecb5643a432ad73b1e22c80cd304948f Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat(a)suse.com>
Date: Fri, 17 May 2013 13:31:46 +0200
Subject: [PATCH] sysctl: handle /boot/sysctl.conf-<kernel_release>
Add support for kernel release sysctl.conf files (for per-flavor
configuration), needed by openSUSE (bnc#809420).
---
src/sysctl/sysctl.c | 8 ++++++++
units/systemd-sysctl.service.in | 1 +
2 files changed, 9 insertions(+)
Index: systemd-195/src/sysctl/sysctl.c
===================================================================
--- systemd-195.orig/src/sysctl/sysctl.c
+++ systemd-195/src/sysctl/sysctl.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <limits.h>
#include <getopt.h>
+#include <sys/utsname.h>
#include "log.h"
#include "strv.h"
@@ -289,6 +290,14 @@ int main(int argc, char *argv[]) {
} else {
char **files, **f;
+ char kernel_sysctl[PATH_MAX];
+ struct utsname uts;
+
+ assert_se(uname(&uts) >= 0);
+
+ snprintf(kernel_sysctl, sizeof(kernel_sysctl), "/boot/sysctl.conf-%s", uts.release);
+ r = parse_file(kernel_sysctl, true);
+
r = conf_files_list(&files, ".conf",
"/etc/sysctl.d",
"/run/sysctl.d",
Index: systemd-195/units/systemd-sysctl.service.in
===================================================================
--- systemd-195.orig/units/systemd-sysctl.service.in
+++ systemd-195/units/systemd-sysctl.service.in
@@ -20,6 +20,7 @@ ConditionDirectoryNotEmpty=|/usr/lib/sys
ConditionDirectoryNotEmpty=|/usr/local/lib/sysctl.d
ConditionDirectoryNotEmpty=|/etc/sysctl.d
ConditionDirectoryNotEmpty=|/run/sysctl.d
+ConditionPathExistsGlob=|/boot/sysctl.conf-*
[Service]
Type=oneshot
++++++ sysctl-modules.patch ++++++
Index: systemd-189/units/systemd-sysctl.service.in
===================================================================
--- systemd-189.orig/units/systemd-sysctl.service.in
+++ systemd-189/units/systemd-sysctl.service.in
@@ -11,6 +11,7 @@ Documentation=man:systemd-sysctl.service
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-readahead-collect.service systemd-readahead-replay.service
+After=systemd-modules-load.service
Before=sysinit.target shutdown.target
ConditionPathIsReadWrite=/proc/sys/
ConditionPathExists=|/etc/sysctl.conf
++++++ sysctl-parse-all-keys.patch ++++++
>From 91b32fa987a4a50faf3d8561b28b6c9d5150adef Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta(a)redhat.com>
Date: Thu, 25 Oct 2012 16:16:19 +0200
Subject: [PATCH] sysctl: parse all keys in a config file
https://bugzilla.redhat.com/show_bug.cgi?id=869779
---
src/sysctl/sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
index a68d67f..035e0ec 100644
--- a/src/sysctl/sysctl.c
+++ b/src/sysctl/sysctl.c
@@ -178,7 +178,7 @@ static int parse_file(const char *path, bool ignore_enoent) {
free(property);
free(new_value);
- if (r != -EEXIST)
+ if (r != 0)
goto finish;
}
}
--
1.7.10.4
++++++ systemctl-no-assert-on-reboot-without-dbus.patch ++++++
>From d255133d8edc84662d2370a77414505a800d1922 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Sat, 12 Jan 2013 00:00:22 +0100
Subject: [PATCH] systemctl: don't hit an assert if we try to reboot and dbus
is dead
https://bugzilla.redhat.com/show_bug.cgi?id=889624
---
src/systemctl/systemctl.c | 3 +++
1 file changed, 3 insertions(+)
Index: systemd-195/src/systemctl/systemctl.c
===================================================================
--- systemd-195.orig/src/systemctl/systemctl.c
+++ systemd-195/src/systemctl/systemctl.c
@@ -1744,6 +1744,9 @@ static int reboot_with_logind(DBusConnec
const char *method;
dbus_bool_t interactive = true;
+ if (!bus)
+ return -EIO;
+
polkit_agent_open_if_enabled();
switch (a) {
++++++ systemctl-options.patch ++++++
Index: systemd-195/src/systemctl/systemctl.c
===================================================================
--- systemd-195.orig/src/systemctl/systemctl.c
+++ systemd-195/src/systemctl/systemctl.c
@@ -5239,6 +5239,7 @@ static int runlevel_main(void) {
int main(int argc, char*argv[]) {
int r, retval = EXIT_FAILURE;
+ char **to_free = NULL;
DBusConnection *bus = NULL;
DBusError error;
@@ -5247,6 +5248,29 @@ int main(int argc, char*argv[]) {
log_parse_environment();
log_open();
+ if (secure_getenv("SYSTEMCTL_OPTIONS") &&
+ (!program_invocation_short_name ||
+ (program_invocation_short_name && strstr(program_invocation_short_name, "systemctl")))) {
+ char **parsed_systemctl_options = strv_split_quoted(getenv("SYSTEMCTL_OPTIONS"));
+
+ if (*parsed_systemctl_options && **parsed_systemctl_options) {
+ char **k,**a;
+ char **new_argv = new(char*, strv_length(argv) + strv_length(parsed_systemctl_options) + 1);
+ new_argv[0] = strdup(argv[0]);
+ for (k = new_argv+1, a = parsed_systemctl_options; *a; k++, a++) {
+ *k = strdup(*a);
+ }
+ for (a = argv+1; *a; k++, a++) {
+ *k = strdup(*a);
+ }
+ *k = NULL;
+ argv = new_argv;
+ argc = strv_length(new_argv);
+ strv_free (parsed_systemctl_options);
+ to_free = new_argv;
+ }
+ }
+
r = parse_argv(argc, argv);
if (r < 0)
goto finish;
@@ -5348,6 +5372,8 @@ finish:
strv_free(arg_property);
+ strv_free(to_free);
+
pager_close();
ask_password_agent_close();
polkit_agent_close();
++++++ systemctl-print-wall-on-if-successful.patch ++++++
>From f6bb13ab8db51aaedc825fec2f0458b60309b27a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Thu, 14 Feb 2013 14:08:09 -0500
Subject: [PATCH] systemctl: print wall message only if successful
systemctl would write to the wall even if unsuccessful.
https://bugs.freedesktop.org/show_bug.cgi?id=60393
---
src/systemctl/systemctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: systemd-195/src/systemctl/systemctl.c
===================================================================
--- systemd-195.orig/src/systemctl/systemctl.c
+++ systemd-195/src/systemctl/systemctl.c
@@ -1825,7 +1825,7 @@ static int start_special(DBusConnection
}
r = start_unit(bus, args);
- if (r >= 0)
+ if (r == EXIT_SUCCESS)
warn_wall(a);
return r;
++++++ systemctl-verbose-message-on-missing-install.patch ++++++
>From 4b9d3dc9748ec3f52a71b06f851f4398462a1c60 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Thu, 6 Dec 2012 16:20:10 +0100
Subject: [PATCH] systemctl: verbose message on missing [Install]
People still don't understand what the message implies.
We have to be more verbose (or more intelligent and detect some of the
cases automatically, but that's not so easy).
https://bugzilla.redhat.com/show_bug.cgi?id=884438
---
src/systemctl/systemctl.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
Index: systemd-195/src/systemctl/systemctl.c
===================================================================
--- systemd-195.orig/src/systemctl/systemctl.c
+++ systemd-195/src/systemctl/systemctl.c
@@ -3783,7 +3783,16 @@ static int enable_unit(DBusConnection *b
}
if (carries_install_info == 0)
- log_warning("The unit files have no [Install] section. They are not meant to be enabled using systemctl.");
+ log_warning(
+"The unit files have no [Install] section. They are not meant to be enabled\n"
+"using systemctl.\n"
+"Possible reasons for having this kind of units are:\n"
+"1) A unit may be statically enabled by being symlinked from another unit's\n"
+" .wants/ or .requires/ directory.\n"
+"2) A unit's purpose may be to act as a helper for some other unit which has\n"
+" a requirement dependency on it.\n"
+"3) A unit may be started when needed via activation (socket, path, timer,\n"
+" D-Bus, udev, scripted systemctl call, ...).\n");
finish:
if (m)
++++++ systemd-cgls-fix-piping-output.patch ++++++
>From 7009eec20823add711e0aa452bdf9dfdd677fa4f Mon Sep 17 00:00:00 2001
From: Anders Olofsson <anders.olofsson(a)axis.com>
Date: Mon, 19 Nov 2012 15:25:36 +0100
Subject: [PATCH] shared/utils: systemd-cgls shows 'n/a' when piping output
-1 was used to signal failure, but the type was unsigned.
https://bugs.freedesktop.org/show_bug.cgi?id=56644
---
src/shared/util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: systemd-195/src/shared/util.c
===================================================================
--- systemd-195.orig/src/shared/util.c
+++ systemd-195/src/shared/util.c
@@ -3806,7 +3806,7 @@ int fd_columns(int fd) {
unsigned columns(void) {
const char *e;
- unsigned c;
+ int c;
if (_likely_(cached_columns > 0))
return cached_columns;
@@ -3814,7 +3814,7 @@ unsigned columns(void) {
c = 0;
e = getenv("COLUMNS");
if (e)
- safe_atou(e, &c);
+ safe_atoi(e, &c);
if (c <= 0)
c = fd_columns(STDOUT_FILENO);
++++++ systemd-fix-merge-ignore-dependencies.patch ++++++
>From e45460d666512db4f908f86e8722d7932dcf0f82 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt(a)redhat.com>
Date: Fri, 25 Jan 2013 19:54:21 +0100
Subject: [PATCH] job: fix merging with --ignore-dependencies
This fixes a bug where a job with --ignore-dependencies would wait for
other jobs because it merged into a previously queued job.
---
src/core/job.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/core/job.c b/src/core/job.c
index e381ea2..6a03d17 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -166,6 +166,7 @@ static void job_merge_into_installed(Job *j, Job *other) {
assert(other->type == JOB_NOP);
j->override = j->override || other->override;
+ j->ignore_order = j->ignore_order || other->ignore_order;
}
Job* job_install(Job *j) {
--
1.7.10.4
++++++ systemd-insserv_conf ++++++
#!/bin/bash
[ -r /etc/insserv.conf ] || exit 0
declare -A facilities
facilities["local_fs"]="local-fs.target"
facilities["localfs"]="local-fs.target"
facilities["named"]="nss-lookup.target"
facilities["network"]="network.target"
# done in systemd code
#facilities["portmap"]="rpcbind.target"
facilities["remote_fs"]="remote-fs.target"
facilities["syslog"]="syslog.target"
facilities["time"]="time-sync.target"
while read line ; do
case "$line" in
\#*|"" ) continue;;
\<* ) continue;;
\$*) t=${line%% *}
target=${facilities[${t:1}]}
[ -z $target ] && continue
mkdir -p $1/$target.{requires,wants}
for dep in ${line##* } ; do
stripped_dep=${dep/boot./}
case "$stripped_dep" in
+*) ln -s -f /lib/systemd/system/${facilities[${stripped_dep:2}]:-${stripped_dep:1}.service} $1/$target.wants/ ;;
*) ln -s -f /lib/systemd/system/${facilities[${stripped_dep:1}]:-${stripped_dep}.service} $1/$target.requires/ ;;
esac
done
;;
esac
done < /etc/insserv.conf
++++++ systemd-journald.init ++++++
#! /bin/sh
#
# Copyright (c) 2001-2002 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# /etc/init.d/systemd-journald
#
### BEGIN INIT INFO
# Provides: syslog
# Required-Start: $null
# Required-Stop: $null
# Default-Start: 2 3 5
# Default-Stop:
# Short-Description: compat wrapper for journald
# Description: compat wrapper for journald
### END INIT INFO
. /etc/rc.status
rc_reset
case "$1" in
start|stop|restart)
rc_failed 3
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
rc_exit
++++++ 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.*")
++++++ systemd-numlock-suse.patch ++++++
Index: systemd-195/src/vconsole/vconsole-setup.c
===================================================================
--- systemd-195.orig/src/vconsole/vconsole-setup.c
+++ systemd-195/src/vconsole/vconsole-setup.c
@@ -287,12 +287,14 @@ int main(int argc, char **argv) {
char *vc_kbd_delay = NULL;
char *vc_kbd_rate = NULL;
char *vc_kbd_disable_caps_lock = NULL;
+ char *vc_kbd_numlock = NULL;
char *vc_compose_table = NULL;
pid_t kbd_rate_pid = 0, compose_table_pid = 0;
#endif
int fd = -1;
bool utf8;
bool disable_capslock = false;
+ bool numlock = false;
int r = EXIT_FAILURE;
pid_t font_pid = 0, keymap_pid = 0;
@@ -386,6 +388,7 @@ int main(int argc, char **argv) {
"KBD_DELAY", &vc_kbd_delay,
"KBD_RATE", &vc_kbd_rate,
"KBD_DISABLE_CAPS_LOCK", &vc_kbd_disable_caps_lock,
+ "KBD_NUMLOCK", &vc_kbd_numlock,
"COMPOSETABLE", &vc_compose_table,
NULL);
if (r < 0 && r != -ENOENT)
@@ -400,6 +403,37 @@ int main(int argc, char **argv) {
log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r));
disable_capslock = vc_kbd_disable_caps_lock && strcasecmp(vc_kbd_disable_caps_lock, "YES") == 0;
+ if (vc_kbd_numlock && strcasecmp(vc_kbd_numlock, "BIOS") == 0) {
+ int hwinfo_fd[2];
+ pid_t hwinfo_pid;
+
+ pipe(hwinfo_fd);
+ if ((hwinfo_pid = fork()) < 0) {
+ log_error("Failed to fork: %m");
+ _exit(EXIT_FAILURE);
+ } else if (hwinfo_pid == 0) {
+ const char *args[3];
+ int i = 0;
+ args[i++] = HWINFO;
+ args[i++] = "--bios";
+ args[i++] = NULL;
+ close(hwinfo_fd[0]);
+ fclose(stdout);
+ dup2(hwinfo_fd[1], STDOUT_FILENO);
+ execv(args[0], (char **) args);
+ _exit(EXIT_FAILURE);
+ } else {
+ char line[17];
+ FILE *hwinfo_file = fdopen(hwinfo_fd[0], "r");
+ close(hwinfo_fd[1]);
+ while (fgets(line, 17, hwinfo_file))
+ if (strstr(line, "Num Lock: on"))
+ numlock = true;
+ close(hwinfo_fd[0]);
+ fclose(hwinfo_file);
+ }
+ } else
+ numlock = vc_kbd_numlock && strcasecmp(vc_kbd_numlock, "YES") == 0;
#elif defined(TARGET_ARCH)
r = parse_env_file("/etc/rc.conf", NEWLINE,
@@ -558,6 +592,10 @@ int main(int argc, char **argv) {
finish:
if (keymap_pid > 0)
wait_for_terminate_and_warn(KBD_LOADKEYS, keymap_pid);
+ if (numlock)
+ close(open("/run/numlock-on", O_WRONLY|O_CREAT, 0644));
+ else
+ unlink("/run/numlock-on");
#ifdef TARGET_SUSE
if (compose_table_pid > 0)
Index: systemd-195/Makefile.am
===================================================================
--- systemd-195.orig/Makefile.am
+++ systemd-195/Makefile.am
@@ -2017,6 +2017,19 @@ dist_udevrules_DATA += \
rules/61-accelerometer.rules
# ------------------------------------------------------------------------------
+numlock_on_SOURCES = \
+ src/login/numlock-on.c
+
+numlock_on_CFLAGS = \
+ $(AM_CFLAGS)
+
+udevlibexec_PROGRAMS += \
+ numlock-on
+
+dist_udevrules_DATA += \
+ rules/73-seat-numlock.rules
+
+# ------------------------------------------------------------------------------
if ENABLE_GUDEV
if ENABLE_GTK_DOC
SUBDIRS += \
Index: systemd-195/configure.ac
===================================================================
--- systemd-195.orig/configure.ac
+++ systemd-195/configure.ac
@@ -660,6 +660,13 @@ fi
with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
AC_DEFINE_UNQUOTED(DISTRIBUTION, ["${with_distro}"], [Target Distribution])
+if test z"$with_distro" = z"suse" ; then
+ AC_PATH_PROG([HWINFO], [hwinfo], [/usr/sbin/hwinfo], [/sbin:/usr/sbin:/usr/bin:/bin])
+ AC_DEFINE_UNQUOTED([HWINFO], ["${HWINFO}"], [Path to hwinfo binary. (SUSE)])
+fi
+AC_PATH_PROG([SETLEDS], [setleds], [/bin/setleds], [/sbin:/usr/sbin:/usr/bin:/bin])
+AC_DEFINE_UNQUOTED([SETLEDS], ["${SETLEDS}"], [Path to setleds binary.])
+
# Location of the init scripts as mandated by LSB
SYSTEM_SYSVINIT_PATH=/etc/init.d
SYSTEM_SYSVRCND_PATH=/etc/rc.d
Index: systemd-195/rules/73-seat-numlock.rules
===================================================================
--- /dev/null
+++ systemd-195/rules/73-seat-numlock.rules
@@ -0,0 +1,8 @@
+# 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.
+
+SUBSYSTEM=="tty", ACTION=="add", KERNEL=="tty[0-9]|tty1[0-2]", TEST=="/run/numlock-on", RUN+="numlock-on $env{DEVNAME}"
Index: systemd-195/src/login/numlock-on.c
===================================================================
--- /dev/null
+++ systemd-195/src/login/numlock-on.c
@@ -0,0 +1,36 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+ This file is part of systemd.
+
+ Copyright 2012 Stanislav Brabec
+
+ 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.
+
+ 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include "config.h"
+#include <fcntl.h>
+#include <sysexits.h>
+#include <unistd.h>
+
+int main (int argc, char *argv[]) {
+ static char *args[] = { SETLEDS, "-D", "+num", NULL };
+
+ if (argc != 2)
+ return EX_USAGE;
+ close (STDIN_FILENO);
+ if (open (argv[1], O_RDONLY) != STDIN_FILENO)
+ return EX_IOERR;
+ return execv(args[0], args);
+}
Index: systemd-195/units/systemd-vconsole-setup.service.in
===================================================================
--- systemd-195.orig/units/systemd-vconsole-setup.service.in
+++ systemd-195/units/systemd-vconsole-setup.service.in
@@ -11,7 +11,7 @@ Documentation=man:systemd-vconsole-setup
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-readahead-collect.service systemd-readahead-replay.service
-Before=sysinit.target shutdown.target
+Before=sysinit.target shutdown.target systemd-udev-trigger.service
ConditionPathExists=/dev/tty0
[Service]
++++++ 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.*")
++++++ 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 /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
}
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
exit 1
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
fail=0
for service in $services; do
if [ -z "${results_runlevel[$service]}" ]; then
echo No information found about service $service found. >/dev/stderr
fail=1
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
exit $fail
;;
--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
fail=1
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
exit 2;;
esac
++++++ systemd-udev-root-symlink ++++++
[Unit]
Description=Create dynamic rule for /dev/root link
Before=udev.service
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@@PREFIX@@/write_dev_root_rule
++++++ timedated-donot-close-bogus-dbus-connection.patch ++++++
commit b779821b8fdcb3f2bdd0c362bceaae3c76ed9678
Author: Shawn Landden <shawnlandden(a)gmail.com>
Date: Mon Dec 3 00:50:55 2012 +0000
timedated: do not incorrectly close non-opened dbus connection
Fix the fallowing error when no system dbus available:
Failed to get system D-Bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
process 14920: arguments to dbus_connection_close() were incorrect, assertion "connection != NULL" failed in file ../../dbus/dbus-connection.c line 2889.
This is normally a bug in some application using the D-Bus library.
process 14920: arguments to dbus_connection_unref() were incorrect, assertion "connection != NULL" failed in file ../../dbus/dbus-connection.c line 2776.
This is normally a bug in some application using the D-Bus library.
Index: systemd-195/src/timedate/timedated.c
===================================================================
--- systemd-195.orig/src/timedate/timedated.c
+++ systemd-195/src/timedate/timedated.c
@@ -943,7 +943,7 @@ static int connect_bus(DBusConnection **
if (!bus) {
log_error("Failed to get system D-Bus connection: %s", bus_error_message(&error));
r = -ECONNREFUSED;
- goto fail;
+ goto fail2;
}
dbus_connection_set_exit_on_disconnect(bus, FALSE);
@@ -975,7 +975,7 @@ static int connect_bus(DBusConnection **
fail:
dbus_connection_close(bus);
dbus_connection_unref(bus);
-
+fail2:
dbus_error_free(&error);
return r;
++++++ tmpfiles-X-type.patch ++++++
>From 78a92a5a2306709e4587e332728a76901323ade9 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta(a)redhat.com>
Date: Fri, 18 Jan 2013 16:13:08 +0100
Subject: [PATCH] tmpfiles: introduce type X
Type X will exclude path itself from clean-up. However, if the path is a
directory systemd-tmpfiles will clean-up its content.
In contrast to type x, where path is ignored completely, type X needs some
Age parameter. In order to determine Age parameter, we will look for config
entries of type d or D and pick the best match. Best match is either
exact match or longest prefix match.
---
man/tmpfiles.d.xml | 15 ++++
src/tmpfiles/tmpfiles.c | 192 ++++++++++++++++++++++++++++++-----------------
2 files changed, 138 insertions(+), 69 deletions(-)
Index: systemd-195/man/tmpfiles.d.xml
===================================================================
--- systemd-195.orig/man/tmpfiles.d.xml
+++ systemd-195/man/tmpfiles.d.xml
@@ -166,6 +166,21 @@ L /tmp/foobar - - - - /dev
</varlistentry>
<varlistentry>
+ <term><varname>X</varname></term>
+ <listitem><para>Ignore a path
+ during cleanup. Use this type
+ to prevent path removal as
+ controlled with the Age parameter.
+ Note that if path is a directory,
+ content of a directory is not
+ excluded from clean-up, only
+ directory itself. Lines of this
+ type accept shell-style globs
+ in place of normal path
+ names.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><varname>r</varname></term>
<listitem><para>Remove a file
or directory if it
Index: systemd-195/src/tmpfiles/tmpfiles.c
===================================================================
--- systemd-195.orig/src/tmpfiles/tmpfiles.c
+++ systemd-195/src/tmpfiles/tmpfiles.c
@@ -70,6 +70,7 @@ typedef enum ItemType {
/* These ones take globs */
IGNORE_PATH = 'x',
+ IGNORE_DIRECTORY_PATH = 'X',
REMOVE_PATH = 'r',
RECURSIVE_REMOVE_PATH = 'R',
RELABEL_PATH = 'z',
@@ -119,7 +120,7 @@ static const char * const conf_file_dirs
#define MAX_DEPTH 256
static bool needs_glob(ItemType t) {
- return t == IGNORE_PATH || t == REMOVE_PATH || t == RECURSIVE_REMOVE_PATH || t == RELABEL_PATH || t == RECURSIVE_RELABEL_PATH;
+ return t == IGNORE_PATH || t == IGNORE_DIRECTORY_PATH || t == REMOVE_PATH || t == RECURSIVE_REMOVE_PATH || t == RELABEL_PATH || t == RECURSIVE_RELABEL_PATH;
}
static struct Item* find_glob(Hashmap *h, const char *match) {
@@ -218,6 +219,7 @@ static bool unix_socket_alive(const char
}
static int dir_cleanup(
+ Item *i,
const char *p,
DIR *d,
const struct stat *ds,
@@ -297,7 +299,7 @@ static int dir_cleanup(
continue;
}
- q = dir_cleanup(sub_path, sub_dir, &s, cutoff, rootdev, false, maxdepth-1, false);
+ q = dir_cleanup(i, sub_path, sub_dir, &s, cutoff, rootdev, false, maxdepth-1, false);
closedir(sub_dir);
if (q < 0)
@@ -320,12 +322,14 @@ static int dir_cleanup(
if (age >= cutoff)
continue;
- log_debug("rmdir '%s'\n", sub_path);
+ if (!i->type == IGNORE_DIRECTORY_PATH || !streq(dent->d_name, p)) {
+ log_debug("rmdir '%s'\n", sub_path);
- if (unlinkat(dirfd(d), dent->d_name, AT_REMOVEDIR) < 0) {
- if (errno != ENOENT && errno != ENOTEMPTY) {
- log_error("rmdir(%s): %m", sub_path);
- r = -errno;
+ if (unlinkat(dirfd(d), dent->d_name, AT_REMOVEDIR) < 0) {
+ if (errno != ENOENT && errno != ENOTEMPTY) {
+ log_error("rmdir(%s): %m", sub_path);
+ r = -errno;
+ }
}
}
@@ -395,68 +399,6 @@ finish:
return r;
}
-static int clean_item(Item *i) {
- DIR *d;
- struct stat s, ps;
- bool mountpoint;
- int r;
- usec_t cutoff, n;
-
- assert(i);
-
- if (i->type != CREATE_DIRECTORY &&
- i->type != TRUNCATE_DIRECTORY &&
- i->type != IGNORE_PATH)
- return 0;
-
- if (!i->age_set || i->age <= 0)
- return 0;
-
- n = now(CLOCK_REALTIME);
- if (n < i->age)
- return 0;
-
- cutoff = n - i->age;
-
- d = opendir(i->path);
- if (!d) {
- if (errno == ENOENT)
- return 0;
-
- log_error("Failed to open directory %s: %m", i->path);
- return -errno;
- }
-
- if (fstat(dirfd(d), &s) < 0) {
- log_error("stat(%s) failed: %m", i->path);
- r = -errno;
- goto finish;
- }
-
- if (!S_ISDIR(s.st_mode)) {
- log_error("%s is not a directory.", i->path);
- r = -ENOTDIR;
- goto finish;
- }
-
- if (fstatat(dirfd(d), "..", &ps, AT_SYMLINK_NOFOLLOW) != 0) {
- log_error("stat(%s/..) failed: %m", i->path);
- r = -errno;
- goto finish;
- }
-
- mountpoint = s.st_dev != ps.st_dev ||
- (s.st_dev == ps.st_dev && s.st_ino == ps.st_ino);
-
- r = dir_cleanup(i->path, d, &s, cutoff, s.st_dev, mountpoint, MAX_DEPTH, i->keep_first_level);
-
-finish:
- if (d)
- closedir(d);
-
- return r;
-}
-
static int item_set_perms(Item *i, const char *path) {
/* not using i->path directly because it may be a glob */
if (i->mode_set)
@@ -667,6 +609,7 @@ static int create_item(Item *i) {
switch (i->type) {
case IGNORE_PATH:
+ case IGNORE_DIRECTORY_PATH:
case REMOVE_PATH:
case RECURSIVE_REMOVE_PATH:
return 0;
@@ -850,6 +793,7 @@ static int remove_item_instance(Item *i,
case CREATE_BLOCK_DEVICE:
case CREATE_CHAR_DEVICE:
case IGNORE_PATH:
+ case IGNORE_DIRECTORY_PATH:
case RELABEL_PATH:
case RECURSIVE_RELABEL_PATH:
case WRITE_FILE:
@@ -894,6 +838,7 @@ static int remove_item(Item *i) {
case CREATE_CHAR_DEVICE:
case CREATE_BLOCK_DEVICE:
case IGNORE_PATH:
+ case IGNORE_DIRECTORY_PATH:
case RELABEL_PATH:
case RECURSIVE_RELABEL_PATH:
case WRITE_FILE:
@@ -909,6 +854,84 @@ static int remove_item(Item *i) {
return r;
}
+static int clean_item_instance(Item *i, const char* instance) {
+ DIR *d;
+ struct stat s, ps;
+ bool mountpoint;
+ int r;
+ usec_t cutoff, n;
+
+ assert(i);
+
+ if (!i->age_set)
+ return 0;
+
+ n = now(CLOCK_REALTIME);
+ if (n < i->age)
+ return 0;
+
+ cutoff = n - i->age;
+
+ d = opendir(instance);
+ if (!d) {
+ if (errno == ENOENT || errno == ENOTDIR)
+ return 0;
+
+ log_error("Failed to open directory %s: %m", i->path);
+ return -errno;
+ }
+
+ if (fstat(dirfd(d), &s) < 0) {
+ log_error("stat(%s) failed: %m", i->path);
+ r = -errno;
+ goto finish;
+ }
+
+ if (!S_ISDIR(s.st_mode)) {
+ log_error("%s is not a directory.", i->path);
+ r = -ENOTDIR;
+ goto finish;
+ }
+
+ if (fstatat(dirfd(d), "..", &ps, AT_SYMLINK_NOFOLLOW) != 0) {
+ log_error("stat(%s/..) failed: %m", i->path);
+ r = -errno;
+ goto finish;
+ }
+
+ mountpoint = s.st_dev != ps.st_dev ||
+ (s.st_dev == ps.st_dev && s.st_ino == ps.st_ino);
+
+ r = dir_cleanup(i, instance, d, &s, cutoff, s.st_dev, mountpoint, MAX_DEPTH, i->keep_first_level);
+
+finish:
+ if (d)
+ closedir(d);
+
+ return r;
+}
+
+static int clean_item(Item *i) {
+ int r = 0;
+
+ assert(i);
+
+ switch (i->type) {
+ case CREATE_DIRECTORY:
+ case TRUNCATE_DIRECTORY:
+ case IGNORE_PATH:
+ clean_item_instance(i, i->path);
+ break;
+ case IGNORE_DIRECTORY_PATH:
+ r = glob_item(i, clean_item_instance);
+ break;
+ default:
+ break;
+ }
+
+ return r;
+}
+
static int process_item(Item *i) {
int r, q, p;
@@ -1028,6 +1051,7 @@ static int parse_line(const char *fname,
case TRUNCATE_DIRECTORY:
case CREATE_FIFO:
case IGNORE_PATH:
+ case IGNORE_DIRECTORY_PATH:
case REMOVE_PATH:
case RECURSIVE_REMOVE_PATH:
case RELABEL_PATH:
@@ -1264,6 +1288,8 @@ static int read_config_file(const char *
FILE *f;
unsigned v = 0;
int r = 0;
+ Iterator iterator;
+ Item *i;
assert(fn);
@@ -1296,6 +1322,34 @@ static int read_config_file(const char *
r = k;
}
+ /* we have to determine age parameter for each entry of type X */
+ HASHMAP_FOREACH(i, globs, iterator) {
+ Iterator iter;
+ Item *j, *candidate_item = NULL;
+
+ if (i->type != IGNORE_DIRECTORY_PATH)
+ continue;
+
+ HASHMAP_FOREACH(j, items, iter) {
+ if (j->type != CREATE_DIRECTORY && j->type != TRUNCATE_DIRECTORY)
+ continue;
+
+ if (path_equal(j->path, i->path)) {
+ candidate_item = j;
+ break;
+ }
+
+ if ((!candidate_item && path_startswith(i->path, j->path)) ||
+ (candidate_item && path_startswith(j->path, candidate_item->path) && (fnmatch(i->path, j->path, FNM_PATHNAME | FNM_PERIOD) == 0)))
+ candidate_item = j;
+ }
+
+ if (candidate_item) {
+ i->age = candidate_item->age;
+ i->age_set = true;
+ }
+ }
+
if (ferror(f)) {
log_error("Failed to read from file %s: %m", fn);
if (r == 0)
Index: systemd-195/tmpfiles.d/tmp.conf
===================================================================
--- systemd-195.orig/tmpfiles.d/tmp.conf
+++ systemd-195/tmpfiles.d/tmp.conf
@@ -10,3 +10,7 @@
# Clear tmp directories separately, to make them easier to override
d /tmp 1777 root root 10d
d /var/tmp 1777 root root 30d
+
+# Exclude namespace mountpoints created with PrivateTmp=yes
+X /tmp/systemd-private-*
+X /var/tmp/systemd-private-*
Index: systemd-195/man/systemd.exec.xml
===================================================================
--- systemd-195.orig/man/systemd.exec.xml
+++ systemd-195/man/systemd.exec.xml
@@ -1022,15 +1022,17 @@
<listitem><para>Takes a boolean
argument. If true sets up a new file
system namespace for the executed
- processes and mounts a private
- <filename>/tmp</filename> directory
- inside it, that is not shared by
+ processes and mounts private
+ <filename>/tmp</filename> and
+ <filename>/var/tmp</filename> directories
+ inside it, that are not shared by
processes outside of the
namespace. This is useful to secure
access to temporary files of the
process, but makes sharing between
processes via
- <filename>/tmp</filename>
+ <filename>/tmp</filename> or
+ <filename>/var/tmp</filename>
impossible. Defaults to
false.</para></listitem>
</varlistentry>
++++++ tty1.patch ++++++
Index: systemd-189/units/systemd-ask-password-wall.service.in
===================================================================
--- systemd-189.orig/units/systemd-ask-password-wall.service.in
+++ systemd-189/units/systemd-ask-password-wall.service.in
@@ -8,7 +8,7 @@
[Unit]
Description=Forward Password Requests to Wall
Documentation=man:systemd-ask-password-console.service(8)
-After=systemd-user-sessions.service
+After=systemd-user-sessions.service getty(a)tty1.service
[Service]
ExecStartPre=-@SYSTEMCTL@ stop systemd-ask-password-console.path systemd-ask-password-console.service systemd-ask-password-plymouth.path systemd-ask-password-plymouth.service
++++++ var-run-lock.patch ++++++
Index: systemd-195/Makefile.am
===================================================================
--- systemd-195.orig/Makefile.am
+++ systemd-195/Makefile.am
@@ -294,6 +294,7 @@ dist_systemunit_DATA = \
units/sys-kernel-config.mount \
units/sys-kernel-debug.mount \
units/sys-fs-fuse-connections.mount \
+ units/var-run.mount \
units/tmp.mount \
units/printer.target \
units/sound.target \
@@ -308,6 +309,11 @@ dist_systemunit_DATA = \
units/systemd-udevd-kernel.socket \
units/system-update.target
+if HAVE_SYSV_COMPAT
+dist_systemunit_DATA += \
+ units/var-lock.mount
+endif
+
nodist_systemunit_DATA = \
units/getty@.service \
units/serial-getty@.service \
@@ -3874,9 +3880,11 @@ systemd-install-data-hook:
( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
rm -f systemd-remount-fs.service \
systemd-fsck-root.service \
+ var-run.mount \
tmp.mount && \
$(LN_S) ../systemd-remount-fs.service systemd-remount-fs.service && \
$(LN_S) ../systemd-fsck-root.service systemd-fsck-root.service && \
+ $(LN_S) ../var-run.mount var-run.mount && \
$(LN_S) ../tmp.mount tmp.mount )
( cd $(DESTDIR)$(userunitdir) && \
rm -f shutdown.target sockets.target bluetooth.target printer.target sound.target && \
@@ -3964,6 +3972,12 @@ if TARGET_MAGEIA
rm -f display-manager.service )
endif
+if HAVE_SYSV_COMPAT
+ ( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
+ rm -f var-lock.mount && \
+ $(LN_S) ../var-lock.mount var-lock.mount )
+endif
+
install-exec-hook: $(INSTALL_EXEC_HOOKS)
uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
Index: systemd-195/units/var-lock.mount
===================================================================
--- /dev/null
+++ systemd-195/units/var-lock.mount
@@ -0,0 +1,19 @@
+# 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=Lock Directory
+Before=local-fs.target
+# skip mounting if the directory does not exist or is a symlink
+ConditionPathIsDirectory=/var/lock
+ConditionPathIsSymbolicLink=!/var/lock
+
+[Mount]
+What=/run/lock
+Where=/var/lock
+Type=bind
+Options=bind
Index: systemd-195/units/var-run.mount
===================================================================
--- /dev/null
+++ systemd-195/units/var-run.mount
@@ -0,0 +1,19 @@
+# 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=Runtime Directory
+Before=local-fs.target
+# skip mounting if the directory does not exist or is a symlink
+ConditionPathIsDirectory=/var/run
+ConditionPathIsSymbolicLink=!/var/run
+
+[Mount]
+What=/run
+Where=/var/run
+Type=bind
+Options=bind
++++++ wait-for-processes-killed.patch ++++++
>From df758e98754016119a9c8d49213a636a80ffab22 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay(a)vrfy.org>
Date: Thu, 28 Mar 2013 23:00:32 +0100
Subject: [PATCH] killall: print notice what we forcefully KILL
---
src/core/killall.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/core/killall.c b/src/core/killall.c
index 55200ff..1eb3766 100644
--- a/src/core/killall.c
+++ b/src/core/killall.c
@@ -139,6 +139,13 @@ static int killall(int sig) {
if (ignore_proc(pid))
continue;
+ if (sig == SIGKILL) {
+ _cleanup_free_ char *s;
+
+ get_process_comm(pid, &s);
+ log_notice("Sending SIGKILL to PID %lu (%s)", (unsigned long) pid, strna(s));
+ }
+
if (kill(pid, sig) >= 0)
n_processes++;
else if (errno != ENOENT)
--
1.8.1.4
>From aaf7eb81be912e7bed939f31e3bc4c631b2552b3 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart(a)poettering.net>
Date: Mon, 1 Apr 2013 22:48:40 +0200
Subject: [PATCH] shutdown: correctly wait for processes we killed in the
killall spree
Previously we simply counted how many processes we killed and expected
as many waitpid() calls to succeed. That however is incorrect to do.
As we might kill processes that are not our immediate children, and as
there might be left-over processes in the waitpid() queue from earlier
the we might get more ore less waitpid() events that we expect.
Hence: keep precise track of the processes we kill, remove the ones we
get waitpid() for, and after each time we get SIGCHLD check if all
others still exist. We use getpgid() to check if a PID still exists.
This should fix issues with journald not setting journal files offline
correctly on shutdown, because we'd too quickly proceed from SIGTERM to
SIGKILL because some left-over process was in our waitpid() queue.
---
src/core/killall.c | 85 +++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 58 insertions(+), 27 deletions(-)
diff --git a/src/core/killall.c b/src/core/killall.c
index 1eb3766..7f0dbb9 100644
--- a/src/core/killall.c
+++ b/src/core/killall.c
@@ -22,12 +22,14 @@
#include <sys/wait.h>
#include <signal.h>
#include <errno.h>
+#include <unistd.h>
#include "util.h"
#include "def.h"
#include "killall.h"
+#include "set.h"
-#define TIMEOUT_USEC (5 * USEC_PER_SEC)
+#define TIMEOUT_USEC (10 * USEC_PER_SEC)
static bool ignore_proc(pid_t pid) {
char buf[PATH_MAX];
@@ -73,38 +75,68 @@ static bool ignore_proc(pid_t pid) {
return false;
}
-static void wait_for_children(int n_processes, sigset_t *mask) {
+static void wait_for_children(Set *pids, sigset_t *mask) {
usec_t until;
assert(mask);
+ if (set_isempty(pids))
+ return;
+
until = now(CLOCK_MONOTONIC) + TIMEOUT_USEC;
for (;;) {
struct timespec ts;
int k;
usec_t n;
+ void *p;
+ Iterator i;
+ /* First, let the kernel inform us about killed
+ * children. Most processes will probably be our
+ * children, but some are not (might be our
+ * grandchildren instead...). */
for (;;) {
- pid_t pid = waitpid(-1, NULL, WNOHANG);
+ pid_t pid;
+ pid = waitpid(-1, NULL, WNOHANG);
if (pid == 0)
break;
+ if (pid < 0) {
+ if (errno == ECHILD)
+ break;
- if (pid < 0 && errno == ECHILD)
+ log_error("waitpid() failed: %m");
return;
+ }
+
+ set_remove(pids, ULONG_TO_PTR(pid));
+ }
- if (n_processes > 0)
- if (--n_processes == 0)
- return;
+ /* Now explicitly check who might be remaining, who
+ * might not be our child. */
+ SET_FOREACH(p, pids, i) {
+
+ /* We misuse getpgid as a check whether a
+ * process still exists. */
+ if (getpgid((pid_t) PTR_TO_ULONG(p)) >= 0)
+ continue;
+
+ if (errno != ESRCH)
+ continue;
+
+ set_remove(pids, p);
}
+ if (set_isempty(pids))
+ return;
+
n = now(CLOCK_MONOTONIC);
if (n >= until)
return;
timespec_store(&ts, until - n);
-
- if ((k = sigtimedwait(mask, NULL, &ts)) != SIGCHLD) {
+ k = sigtimedwait(mask, NULL, &ts);
+ if (k != SIGCHLD) {
if (k < 0 && errno != EAGAIN) {
log_error("sigtimedwait() failed: %m");
@@ -117,10 +149,9 @@ static void wait_for_children(int n_processes, sigset_t *mask) {
}
}
-static int killall(int sig) {
- DIR *dir;
+static int killall(int sig, Set *pids) {
+ _cleanup_closedir_ DIR *dir = NULL;
struct dirent *d;
- unsigned int n_processes = 0;
dir = opendir("/proc");
if (!dir)
@@ -143,23 +174,25 @@ static int killall(int sig) {
_cleanup_free_ char *s;
get_process_comm(pid, &s);
- log_notice("Sending SIGKILL to PID %lu (%s)", (unsigned long) pid, strna(s));
+ log_notice("Sending SIGKILL to PID %lu (%s).", (unsigned long) pid, strna(s));
}
- if (kill(pid, sig) >= 0)
- n_processes++;
- else if (errno != ENOENT)
+ if (kill(pid, sig) >= 0) {
+ if (pids)
+ set_put(pids, ULONG_TO_PTR((unsigned long) pid));
+ } else if (errno != ENOENT)
log_warning("Could not kill %d: %m", pid);
}
- closedir(dir);
-
- return n_processes;
+ return set_size(pids);
}
void broadcast_signal(int sig, bool wait_for_exit) {
sigset_t mask, oldmask;
- int n_processes;
+ Set *pids;
+
+ if (wait_for_exit)
+ pids = set_new(trivial_hash_func, trivial_compare_func);
assert_se(sigemptyset(&mask) == 0);
assert_se(sigaddset(&mask, SIGCHLD) == 0);
@@ -168,17 +201,15 @@ void broadcast_signal(int sig, bool wait_for_exit) {
if (kill(-1, SIGSTOP) < 0 && errno != ESRCH)
log_warning("kill(-1, SIGSTOP) failed: %m");
- n_processes = killall(sig);
+ killall(sig, pids);
if (kill(-1, SIGCONT) < 0 && errno != ESRCH)
log_warning("kill(-1, SIGCONT) failed: %m");
- if (n_processes <= 0)
- goto finish;
-
if (wait_for_exit)
- wait_for_children(n_processes, &mask);
+ wait_for_children(pids, &mask);
+
+ assert_se(sigprocmask(SIG_SETMASK, &oldmask, NULL) == 0);
-finish:
- sigprocmask(SIG_SETMASK, &oldmask, NULL);
+ set_free(pids);
}
--
1.8.1.4
>From b6e8f1f03dc8b7579f8c6b00372f136d74c45232 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald(a)redhat.com>
Date: Wed, 3 Apr 2013 15:16:06 +0200
Subject: [PATCH] core/killall.c: prevent segfault and initialize pids
---
src/core/killall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/killall.c b/src/core/killall.c
index 7f0dbb9..e078012 100644
--- a/src/core/killall.c
+++ b/src/core/killall.c
@@ -189,7 +189,7 @@ static int killall(int sig, Set *pids) {
void broadcast_signal(int sig, bool wait_for_exit) {
sigset_t mask, oldmask;
- Set *pids;
+ Set *pids = NULL;
if (wait_for_exit)
pids = set_new(trivial_hash_func, trivial_compare_func);
--
1.8.1.4
++++++ write_dev_root_rule ++++++
#!/bin/sh
eval $(@@PREFIX@@/udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/)
[ "$ROOT_MAJOR" -gt 0 ] || return
mkdir -m 0755 -p /run/udev/rules.d >/dev/null 2>&1
ln -sf /run/udev /dev/.udev 2>/dev/null || :
echo "ACTION==\"add|change\", SUBSYSTEM==\"block\", \
ENV{MAJOR}==\"$ROOT_MAJOR\", ENV{MINOR}==\"$ROOT_MINOR\", \
SYMLINK+=\"root\"" > /run/udev/rules.d/10-root-symlink.rules
exit 0
++++++ xdm-display-manager.patch ++++++
Index: systemd-195/units/graphical.target
===================================================================
--- systemd-195.orig/units/graphical.target
+++ systemd-195/units/graphical.target
@@ -11,7 +11,7 @@ Documentation=man:systemd.special(7)
Requires=multi-user.target
After=multi-user.target
Conflicts=rescue.target
-Wants=display-manager.service
+Wants=xdm.service
AllowIsolate=yes
[Install]
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0