diff options
| -rw-r--r-- | meta/recipes-devtools/opkg/opkg.inc | 21 | ||||
| -rw-r--r-- | meta/recipes-devtools/opkg/opkg/opkg-configure.service | 17 | ||||
| -rw-r--r-- | meta/recipes-devtools/opkg/opkg_svn.bb | 1 | 
3 files changed, 37 insertions, 2 deletions
| diff --git a/meta/recipes-devtools/opkg/opkg.inc b/meta/recipes-devtools/opkg/opkg.inc index afe6cb0ce6..3d568867d4 100644 --- a/meta/recipes-devtools/opkg/opkg.inc +++ b/meta/recipes-devtools/opkg/opkg.inc | |||
| @@ -16,7 +16,13 @@ do_configure_prepend() { | |||
| 16 | sed -i -e s:-Werror::g ${S}/libopkg/Makefile.am | 16 | sed -i -e s:-Werror::g ${S}/libopkg/Makefile.am | 
| 17 | } | 17 | } | 
| 18 | 18 | ||
| 19 | inherit autotools pkgconfig | 19 | inherit autotools pkgconfig systemd | 
| 20 | |||
| 21 | python () { | ||
| 22 | if 'sysvinit' not in d.getVar("DISTRO_FEATURES", True).split(): | ||
| 23 | pn = d.getVar('PN', True) | ||
| 24 | d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'opkg-configure.service') | ||
| 25 | } | ||
| 20 | 26 | ||
| 21 | target_localstatedir := "${localstatedir}" | 27 | target_localstatedir := "${localstatedir}" | 
| 22 | OPKGLIBDIR = "${target_localstatedir}/lib" | 28 | OPKGLIBDIR = "${target_localstatedir}/lib" | 
| @@ -49,6 +55,16 @@ FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/" | |||
| 49 | do_install_append() { | 55 | do_install_append() { | 
| 50 | # We need to create the lock directory | 56 | # We need to create the lock directory | 
| 51 | install -d ${D}${OPKGLIBDIR}/opkg | 57 | install -d ${D}${OPKGLIBDIR}/opkg | 
| 58 | |||
| 59 | if ${@base_contains('DISTRO_FEATURES','sysvinit','false','true',d)};then | ||
| 60 | install -d ${D}${systemd_unitdir}/system | ||
| 61 | install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/ | ||
| 62 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
| 63 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ | ||
| 64 | -e 's,@BINDIR@,${bindir},g' \ | ||
| 65 | -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \ | ||
| 66 | ${D}${systemd_unitdir}/system/opkg-configure.service | ||
| 67 | fi | ||
| 52 | } | 68 | } | 
| 53 | 69 | ||
| 54 | do_install_append_class-native() { | 70 | do_install_append_class-native() { | 
| @@ -59,7 +75,8 @@ do_install_append_class-native() { | |||
| 59 | 75 | ||
| 60 | pkg_postinst_${PN} () { | 76 | pkg_postinst_${PN} () { | 
| 61 | #!/bin/sh | 77 | #!/bin/sh | 
| 62 | if [ "x$D" != "x" ] && [ -f $D${OPKGLIBDIR}/opkg/status ]; then | 78 | if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)} && \ | 
| 79 | [ "x$D" != "x" ] && [ -f $D${OPKGLIBDIR}/opkg/status ]; then | ||
| 63 | install -d $D${sysconfdir}/rcS.d | 80 | install -d $D${sysconfdir}/rcS.d | 
| 64 | 81 | ||
| 65 | # this happens at S98 where our good 'ole packages script used to run | 82 | # this happens at S98 where our good 'ole packages script used to run | 
| diff --git a/meta/recipes-devtools/opkg/opkg/opkg-configure.service b/meta/recipes-devtools/opkg/opkg/opkg-configure.service new file mode 100644 index 0000000000..a1c3a31796 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/opkg-configure.service | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=Opkg first boot configure | ||
| 3 | DefaultDependencies=no | ||
| 4 | After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount | ||
| 5 | Before=sysinit.target | ||
| 6 | |||
| 7 | [Service] | ||
| 8 | Type=oneshot | ||
| 9 | EnvironmentFile=-@SYSCONFDIR@/default/postinst | ||
| 10 | ExecStart=@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/opkg-cl configure > $LOGFILE 2>&1; else @BINDIR@/opkg-cl configure; fi" | ||
| 11 | ExecStartPost=@BASE_BINDIR@/systemctl disable opkg-configure.service | ||
| 12 | StandardOutput=syslog | ||
| 13 | RemainAfterExit=No | ||
| 14 | |||
| 15 | [Install] | ||
| 16 | WantedBy=basic.target | ||
| 17 | WantedBy=sysinit.target | ||
| diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb index bc10491030..cd0485fe38 100644 --- a/meta/recipes-devtools/opkg/opkg_svn.bb +++ b/meta/recipes-devtools/opkg/opkg_svn.bb | |||
| @@ -3,6 +3,7 @@ require opkg.inc | |||
| 3 | SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ | 3 | SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ | 
| 4 | file://no-install-recommends.patch \ | 4 | file://no-install-recommends.patch \ | 
| 5 | file://add-exclude.patch \ | 5 | file://add-exclude.patch \ | 
| 6 | file://opkg-configure.service \ | ||
| 6 | " | 7 | " | 
| 7 | 8 | ||
| 8 | S = "${WORKDIR}/trunk" | 9 | S = "${WORKDIR}/trunk" | 
