From 0ba16a06f2a72c615f41f94b6e4bb697f825941b Mon Sep 17 00:00:00 2001 From: Yin Kangkai Date: Mon, 12 Nov 2012 22:59:50 +0800 Subject: [PATCH] Move passwd and group back from /opt/etc to /etc/ Credentials (passwd and group) files in /opt (another partiton) instead of root introduces a depending cycle in systemd env: 1. systemd _depends_ on udev being able to notify it to mount /dev/mmcblk0p6 on /opt; 2. udev depends on "group" to set correctly permissions to /dev/ nodes based on its rules. 3. credentials (passwd and group) files are in /opt, only availabe when mounted; Some other information and discussion: 1. https://tizendev.org/pipermail/system/2012-November/000100.html 2. https://tizendev.org/gerrit/#/c/10005/ So we move it back to /etc (the root partition). Another thing needs to mention is we need to make sure {passwd,group} files available in "%install" section instead of doing that in "%post", since otherwise rpms installed after this package will fail for rpm keyword "%attr". e.g.: "%attr(4750,root,dbus)" in dbus package. Signed-off-by: Yin Kangkai Signed-off-by: Karol Lewandowski Signed-off-by: Patrick McCarty Change-Id: I29fd2d20f6099307603de74a22a8a27f508aba48 --- packaging/libprivilege-control.spec | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/packaging/libprivilege-control.spec b/packaging/libprivilege-control.spec index 9a9e067..23d2e7c 100644 --- a/packaging/libprivilege-control.spec +++ b/packaging/libprivilege-control.spec @@ -40,6 +40,9 @@ make %{?jobs:-j%jobs} rm -rf %{buildroot} %make_install +mkdir -p %{buildroot}/etc +mv %{buildroot}/opt/etc/passwd %{buildroot}/etc/passwd +mv %{buildroot}/opt/etc/group %{buildroot}/etc/group %post if [ ! -e "/home/app" ] @@ -62,20 +65,6 @@ then mkdir -p /usr/share/privilege-control/ fi -%post conf -if [ -e "/etc/passwd" ] -then - rm -f /etc/passwd -fi -ln -sf /opt/etc/passwd /etc/passwd - -if [ -e "/etc/group" ] -then - rm -f /etc/group -fi -ln -sf /opt/etc/group /etc/group - - %files /usr/lib/*.so.* /usr/bin/slp-su @@ -83,8 +72,8 @@ ln -sf /opt/etc/group /etc/group /lib/udev/rules.d/* %files conf -/opt/etc/group -/opt/etc/passwd +/etc/group +/etc/passwd %files devel /usr/include/*.h -- 2.7.4