diff options
| author | Chen Qi <Qi.Chen@windriver.com> | 2013-10-31 14:29:44 +0800 |
|---|---|---|
| committer | Joe MacDonald <joe@deserted.net> | 2013-10-31 13:00:48 -0400 |
| commit | 7f1b4775ef198d86821997632bf6e38305f3fa1b (patch) | |
| tree | 2df496f0e75b0d019b114bd8a30f018f14dd42fe | |
| parent | 1ec32c102f48f26f18b4fa4b9ede064928e8a01e (diff) | |
| download | meta-openembedded-7f1b4775ef198d86821997632bf6e38305f3fa1b.tar.gz | |
quagga: fix pkg_postinst
This patch mainly involves two changes.
1. Create necessary files at do_install task. Add these configuration
files to the CONFFILES variable.
2. Move the `chmod' and `chown' commands to do_install task.
After these two changes, qugga can run successfully at rootfs time.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
| -rw-r--r-- | meta-networking/recipes-protocols/quagga/quagga.inc | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc index 9d900afae0..2106c9b28b 100644 --- a/meta-networking/recipes-protocols/quagga/quagga.inc +++ b/meta-networking/recipes-protocols/quagga/quagga.inc | |||
| @@ -74,6 +74,14 @@ do_install () { | |||
| 74 | install -m 0640 ${S}/$f/$f.conf.sample ${D}${sysconfdir}/quagga/$f.conf.sample | 74 | install -m 0640 ${S}/$f/$f.conf.sample ${D}${sysconfdir}/quagga/$f.conf.sample |
| 75 | done | 75 | done |
| 76 | 76 | ||
| 77 | for f in bgpd vtysh babeld isisd ospfd ripngd zebra ripd ospf6d; do | ||
| 78 | touch ${D}${sysconfdir}/quagga/$f.conf | ||
| 79 | done | ||
| 80 | chown quagga:quaggavty ${D}${sysconfdir}/quagga | ||
| 81 | chown quagga:quagga ${D}${sysconfdir}/quagga/*.conf | ||
| 82 | chmod 750 ${D}${sysconfdir}/quagga | ||
| 83 | chmod 640 ${D}${sysconfdir}/quagga/*.conf | ||
| 84 | |||
| 77 | # Install quagga | 85 | # Install quagga |
| 78 | oe_runmake install DESTDIR=${D} prefix=${prefix} \ | 86 | oe_runmake install DESTDIR=${D} prefix=${prefix} \ |
| 79 | sbindir=${sbindir} \ | 87 | sbindir=${sbindir} \ |
| @@ -109,7 +117,17 @@ FILES_${PN}-watchquagga = "${sbindir}/watchquagga ${sysconfdir}/default/watchqua | |||
| 109 | ${sysconfdir}/init.d/watchquagga" | 117 | ${sysconfdir}/init.d/watchquagga" |
| 110 | 118 | ||
| 111 | # Indicate that the default files are configuration files | 119 | # Indicate that the default files are configuration files |
| 112 | CONFFILES_${PN} = "${sysconfdir}/default/quagga" | 120 | CONFFILES_${PN} = "${sysconfdir}/default/quagga \ |
| 121 | ${sysconfdir}/quagga/bgpd.conf \ | ||
| 122 | ${sysconfdir}/quagga/vtysh.conf \ | ||
| 123 | ${sysconfdir}/quagga/babeld.conf \ | ||
| 124 | ${sysconfdir}/quagga/isisd.conf \ | ||
| 125 | ${sysconfdir}/quagga/ospfd.conf \ | ||
| 126 | ${sysconfdir}/quagga/ripngd.conf \ | ||
| 127 | ${sysconfdir}/quagga/zebra.conf \ | ||
| 128 | ${sysconfdir}/quagga/ripd.conf \ | ||
| 129 | ${sysconfdir}/quagga/ospf6d.conf \ | ||
| 130 | " | ||
| 113 | CONFFILES_${PN}-watchquagga = "${sysconfdir}/default/watchquagga" | 131 | CONFFILES_${PN}-watchquagga = "${sysconfdir}/default/watchquagga" |
| 114 | 132 | ||
| 115 | # Stop the names being rewritten due to the internal shared libraries | 133 | # Stop the names being rewritten due to the internal shared libraries |
| @@ -133,14 +151,6 @@ GROUPADD_PARAM_${PN} = "--system quagga ; --system quaggavty" | |||
| 133 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/quagga/ -M -g quagga quagga" | 151 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/quagga/ -M -g quagga quagga" |
| 134 | 152 | ||
| 135 | pkg_postinst_${PN} () { | 153 | pkg_postinst_${PN} () { |
| 136 | if [ "x$D" != "x" ] ; then | ||
| 137 | exit 1 | ||
| 138 | fi | ||
| 139 | for f in bgpd vtysh babeld isisd ospfd ripngd zebra ripd ospf6d; do touch ${sysconfdir}/quagga/$f.conf; done | ||
| 140 | chown quagga:quaggavty ${sysconfdir}/quagga | ||
| 141 | chown quagga:quagga ${sysconfdir}/quagga/*.conf | ||
| 142 | chmod 750 ${sysconfdir}/quagga | ||
| 143 | chmod 640 ${sysconfdir}/quagga/*.conf | ||
| 144 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | 154 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then |
| 145 | ${sysconfdir}/init.d/populate-volatile.sh update | 155 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 146 | fi | 156 | fi |
