Browse code

systemd: install absolute symlinks

Change-Id: I6252e72d7788942e87cafc4073c0c300ece61ce3
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1335
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>

Alexey Makhalov authored on 2016/08/30 05:50:23
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,28 @@
0
+diff -Naur a/Makefile.am b/Makefile.am
1
+--- a/Makefile.am	2016-08-29 12:55:38.000000000 -0700
2
+@@ -309,7 +309,7 @@
3
+ 	set -- $(USER_UNIT_ALIASES) && \
4
+ 		dir=$(userunitdir) && $(install-relative-aliases)
5
+ 	set -- $(GENERAL_ALIASES) && \
6
+-		dir= && $(install-relative-aliases)
7
++		dir= && $(install-general-aliases)
8
+ 
9
+ define install-aliases
10
+ 	while [ -n "$$1" ]; do \
11
+@@ -328,6 +328,15 @@
12
+ 		shift 2 || exit $$?; \
13
+ 	done
14
+ endef
15
++
16
++define install-general-aliases
17
++	while [ -n "$$1" ]; do \
18
++		$(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
19
++		rm -f $(DESTDIR)$$dir/$$2 && \
20
++		$(LN_S) /usr$$1 $(DESTDIR)$$dir/$$2 && \
21
++		shift 2 || exit $$?; \
22
++	done
23
++endef
24
+ 
25
+ install-touch-usr-hook:
26
+ 	touch -c $(DESTDIR)/$(prefix)
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:          Systemd-228
2 2
 Name:             systemd
3 3
 Version:          228
4
-Release:          29%{?dist}
4
+Release:          30%{?dist}
5 5
 License:          LGPLv2+ and GPLv2+ and MIT
6 6
 URL:              http://www.freedesktop.org/wiki/Software/systemd/
7 7
 Group:            System Environment/Security
... ...
@@ -31,6 +31,7 @@ Patch15:          systemd-228-default-dns-from-env.patch
31 31
 Patch16:          systemd-228-dhcp-duid-api-update.patch
32 32
 Patch17:          systemd-228-domains-search-fix.patch
33 33
 Patch18:          systemd-228-dns-transaction-pending-fix.patch
34
+Patch19:          02-install-general-aliases.patch
34 35
 Requires:         Linux-PAM
35 36
 Requires:         libcap
36 37
 Requires:         xz
... ...
@@ -82,6 +83,7 @@ sed -i "s:blkid/::" $(grep -rl "blkid/blkid.h")
82 82
 %patch16 -p1
83 83
 %patch17 -p1
84 84
 %patch18 -p1
85
+%patch19 -p1
85 86
 sed -i "s#\#DefaultTasksMax=512#DefaultTasksMax=infinity#g" src/core/system.conf
86 87
 
87 88
 %build
... ...
@@ -129,45 +131,12 @@ find %{buildroot}%{_libdir} -name '*.la' -delete
129 129
 install -Dm 0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/udev/rules.d
130 130
 install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysctl.d
131 131
 rm %{buildroot}/lib/systemd/system/default.target
132
-rm -r %{buildroot}/etc/systemd/system/*.target.wants
133 132
 ln -sfv multi-user.target %{buildroot}/lib/systemd/system/default.target
134 133
 
135 134
 %post
136 135
 /sbin/ldconfig
137
-if [ $1 -eq 1 ] ; then 
138
-        # Initial installation 
139
-	systemctl --no-reload preset getty@tty1.service >/dev/null 2>&1 || :
140
-	systemctl --no-reload preset remote-fs.target >/dev/null 2>&1 || :
141
-	systemctl --no-reload preset systemd-networkd.service >/dev/null 2>&1 || :
142
-	systemctl --no-reload preset systemd-resolved.service >/dev/null 2>&1 || :
143
-	systemctl --no-reload preset systemd-networkd-wait-online.service >/dev/null 2>&1 || :
144
-	systemctl --no-reload preset systemd-networkd.socket >/dev/null 2>&1 || :
145
-	systemctl --no-reload preset systemd-timesyncd.service >/dev/null 2>&1 || :
146
-fi
147 136
 %postun
148 137
 /sbin/ldconfig
149
-if [ $1 -ge 1 ] ; then 
150
-        # Package upgrade, not uninstall 
151
-	systemctl try-restart getty@tty1.service >/dev/null 2>&1 || :
152
-	systemctl try-restart remote-fs.target >/dev/null 2>&1 || :
153
-	systemctl try-restart systemd-networkd.service >/dev/null 2>&1 || :
154
-	systemctl try-restart systemd-resolved.service >/dev/null 2>&1 || :
155
-	systemctl try-restart systemd-networkd-wait-online.service >/dev/null 2>&1 || :
156
-	systemctl try-restart systemd-networkd.socket >/dev/null 2>&1 || :
157
-	systemctl try-restart systemd-timesyncd.service >/dev/null 2>&1 || :
158
-fi
159
-
160
-%preun
161
-if [ $1 -eq 0 ] ; then 
162
-        # Package removal, not upgrade 
163
-	systemctl --no-reload disable --now getty@tty1.service >/dev/null 2>&1 || :
164
-	systemctl --no-reload disable --now remote-fs.target >/dev/null 2>&1 || :
165
-	systemctl --no-reload disable --now systemd-networkd.service >/dev/null 2>&1 || :
166
-	systemctl --no-reload disable --now systemd-resolved.service >/dev/null 2>&1 || :
167
-	systemctl --no-reload disable --now systemd-networkd-wait-online.service >/dev/null 2>&1 || :
168
-	systemctl --no-reload disable --now systemd-networkd.socket >/dev/null 2>&1 || :
169
-	systemctl --no-reload disable --now systemd-timesyncd.service >/dev/null 2>&1 || :
170
-fi
171 138
 %clean
172 139
 rm -rf %{buildroot}/*
173 140
 %files
... ...
@@ -207,6 +176,7 @@ rm -rf %{buildroot}/*
207 207
 %dir %{_sysconfdir}/udev/hwdb.d
208 208
 %{_sysconfdir}/udev/rules.d/99-vmware-hotplug.rules
209 209
 %config(noreplace) %{_sysconfdir}/udev/udev.conf
210
+%{_sysconfdir}/systemd/system/*
210 211
 /lib/udev/*
211 212
 /lib/systemd/systemd*
212 213
 /lib/systemd/system-*
... ...
@@ -223,6 +193,8 @@ rm -rf %{buildroot}/*
223 223
 %dir %{_localstatedir}/log/journal
224 224
 
225 225
 %changelog
226
+*    Mon Aug 29 2016 Alexey Makhalov <amakhalov@vmware.com>  228-30
227
+-    02-install-general-aliases.patch to create absolute symlinks
226 228
 *    Fri Aug 26 2016 Anish Swaminathan <anishs@vmware.com>  228-29
227 229
 -    Change config file properties for 99-default.link
228 230
 *    Tue Aug 16 2016 Vinay Kulkarni <kulkarniv@vmware.com>  228-28