Skip to contentSkip to conversation

V2: Some fixes for LSB tests

PATCH New Kai Kang 1 participant 4 messages Mar 10, 2015

lore
Share & tools
lore

Kai Kang

author
#0 lore raw

cover V2: Some fixes for LSB tests

V2 doesn't use alternative to handle /usr/lib/sendmail either. Because the link target is alway ${sbindir}/sendmail, update-alternative can't handle this kind of case.

So check whether /usr/lib/sendmail exists and is a link file, otherwise create it during pkg_postinst of packages such as msmtp postfix and esmtp which provide ${sbindir}/sendmail.

Only one flaw is when all these packages are removed, broken link file /usr/lib/sendmail left.

The following changes since commit 8ce2f2c3549248b2aa1259ceb28ed03be166ac6f:

maintainers.inc: Became maintainer of python2 and python3 (2015-03-09 16:01:08 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib kangkai/lsb-20150310
http://git.yoctoproject.org/cgit.cgi//log/?h=kangkai/lsb-20150310

Kai Kang (3):
systemd: correct permission mode of /var/volatile/tmp
lsb: update init-functions and remove sendmail
msmtp: add link file /usr/lib/sendmail

 .../recipes-core/systemd/systemd/00-create-volatile.conf |  2 +-
 meta/recipes-extended/lsb/lsb_4.1.bb                     | 16 +++-------------
 meta/recipes-extended/msmtp/msmtp_1.6.1.bb               |  5 +++++
 3 files changed, 9 insertions(+), 14 deletions(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/3 systemd: correct permission mode of /var/volatile/tmp

Permission mode of directory /var/volatile/tmp should be 1777, correct it.

---
 meta/recipes-core/systemd/systemd/00-create-volatile.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd/00-create-volatile.conf +1 -1
index 9ffa88e..87cbe1e 100644
@@ -4,4 +4,4 @@
 
 
 d		/var/volatile/log		-	-	-	-
-d		/var/volatile/tmp		-	-	-	-
+d		/var/volatile/tmp		1777	-	-
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH 2/3 lsb: update init-functions and remove sendmail

In reply to Kai Kang

According to LSB specification Ref1, LSB checks file /lib/lsb/init-functions. But for 64 bits system it is installed in /lib64. Install init-functions to /lib/lsb to conform with LSB specification.

Link file /usr/lib/sendmail which points to /usr/sbin/sendmail is required by LSB according to Linux FHS[Ref 2]. But it should be done by packages which provides command sendmail such as msmtp, postfix and esmtp etc.

Refs:
1 http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html
2 http://www.pathname.com/fhs/pub/fhs-2.3.html#SPECIFICOPTIONS13

---
 meta/recipes-extended/lsb/lsb_4.1.bb | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
meta/recipes-extended/lsb/lsb_4.1.bb +3 -13
index b4ef98e..f05c30c 100644
@@ -72,19 +72,18 @@ do_install(){
 
 do_install_append(){
        install -d ${D}${sysconfdir}/core-lsb
-       install -d ${D}/${baselib}/lsb
        for i in lsb_killproc lsb_log_message lsb_pidofproc lsb_start_daemon
        do
            install -m 0755 ${WORKDIR}/${i} ${D}${sysconfdir}/core-lsb
        done
-       install -m 0755 ${WORKDIR}/init-functions ${D}/${baselib}/lsb
+
+       install -d ${D}/lib/lsb
+       install -m 0755 ${WORKDIR}/init-functions ${D}/lib/lsb
 
        # creat links for LSB test
        install -d ${D}/usr/lib/lsb
        ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/install_initd
        ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/remove_initd
-       install -d ${D}/${libdir}
-       ln -sf ${sbindir}/sendmail ${D}/${libdir}/sendmail
 
        if [ "${TARGET_ARCH}" = "x86_64" ];then
 	       cd ${D}
@@ -119,13 +118,4 @@ do_install_append(){
 FILES_${PN} += "/lib64 \
 		/usr/lib/lsb \
                 ${base_libdir}/lsb/* \
-		${libdir}/sendmail \
                "
-
-# The sysroot/${libdir}/sendmail conflicts with esmtp's, and it's a
-# symlink to ${sbindir}/sendmail which is meaningless for sysroot, so
-# remove it.
-SYSROOT_PREPROCESS_FUNCS += "remove_sysroot_sendmail"
-remove_sysroot_sendmail() {
-    rm -r "${SYSROOT_DESTDIR}${libdir}/sendmail"
-}
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 3/3 msmtp: add link file /usr/lib/sendmail

In reply to Kai Kang

Link file /usr/lib/sendmail points to /usr/sbin/sendmail is required by LSB core test according to Linux FHS: "For historical reasons, /usr/lib/sendmail must be a symbolic link to /usr/sbin/sendmail if the latter exists."

Create the link file /usr/lib/sendmail if it doesn't exist.

Refs:
1 http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/normativerefs.html#STD.LSB
2 http://www.pathname.com/fhs/pub/fhs-2.3.html#SPECIFICOPTIONS13

---
 meta/recipes-extended/msmtp/msmtp_1.6.1.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-extended/msmtp/msmtp_1.6.1.bb +5 -0
index c9ad1da..d6f3a15 100644
@@ -23,3 +23,8 @@ ALTERNATIVE_${PN} = "sendmail"
 ALTERNATIVE_TARGET[sendmail] = "${bindir}/msmtp"
 ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail"
 ALTERNATIVE_PRIORITY = "100"
+
+pkg_postinst_${PN}_linuxstdbase () {
+	# /usr/lib/sendmial is required by LSB core test
+	[ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/
+}
Signature · 1 line
1.9.1