Description : Added the upgrade script from 2.4 to 3.0
authorwchang kim <wchang.kim@samsung.com>
Mon, 12 Sep 2016 06:51:15 +0000 (15:51 +0900)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Fri, 26 Jan 2024 16:49:49 +0000 (17:49 +0100)
systemd_upgrade.sh is installed to /usr/share/upgrade/scripts.
It changes the smack rule for /var/log/wtmp and /var/lib/systemd.

Change-Id: Iebffca3238bcedd195ec2e91afdf5e46a882ec42
Signed-off-by: Woochang Kim <wchang.kim@samsung.com>
packaging/systemd.spec
packaging/systemd_upgrade.sh [new file with mode: 0644]

index 76a6d7d..8756aeb 100644 (file)
@@ -24,6 +24,7 @@ Source0:        http://www.freedesktop.org/software/systemd/%{name}-%{version}.t
 Source1:        pamconsole-tmp.conf
 Source2:        %{name}-rpmlintrc
 Source1001:     systemd.manifest
+Source3:        systemd_upgrade.sh
 BuildRequires:  gperf
 BuildRequires:  intltool >= 0.40.0
 BuildRequires:  libacl-devel
@@ -281,6 +282,10 @@ rm -rf %{buildroot}/%{_datadir}/zsh/site-functions/*
 
 mkdir -p %{buildroot}/%{_localstatedir}/log/journal
 
+# Upgrade script from 2.4 to 3.0
+install -m 755 -d %{buildroot}%{_datadir}/upgrade/scripts
+install -m 755 %{SOURCE3} %{buildroot}%{_datadir}/upgrade/scripts
+
 # end of install
 %pre
 /usr/bin/getent group cdrom >/dev/null 2>&1 || /usr/sbin/groupadd -r -g 11 cdrom >/dev/null 2>&1 || :
@@ -508,6 +513,9 @@ fi
 
 %{_localstatedir}/log/journal
 
+%dir %{_datadir}/upgrade/scripts
+%{_datadir}/upgrade/scripts/systemd_upgrade.sh
+
 # Make sure we don't remove runlevel targets from F14 alpha installs,
 # but make sure we don't create then anew.
 %ghost %config(noreplace) %{_sysconfdir}/systemd/system/runlevel2.target
diff --git a/packaging/systemd_upgrade.sh b/packaging/systemd_upgrade.sh
new file mode 100644 (file)
index 0000000..b2a0036
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+#-----------------------------------------------#
+# systemd patch for upgrade (2.4 -> 3.0) #
+#-----------------------------------------------#
+
+# Macro
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+WTMP_DIR=/var/log/wtmp
+SYSTEMD_DIR=/var/lib/systemd
+
+# set smack rule
+chsmack -a "System" $WTMP_DIR
+chsmack -a "System" $SYSTEMD_DIR