Misc improvements 2 from Mentor
cover Misc improvements 2 from Mentor
From: Christopher Larson <[email protected]>
This is the final of three pull requests / patch series from Mentor's queue of changes destined for oe-core master (not jethro). This series includes a small number of improvements which may be more contentious or may require more consideration and review.
The following changes since commit e44ed8c18e395b9c055aefee113b90708e8a8a2f:
build-appliance-image: Update to jethro head revision (2015-11-03 14:02:57 +0000)
are available in the git repository at:
git://github.com/kergoth/openembedded-core mentor-misc-improvements-2-after-jethro
https://github.com/kergoth/openembedded-core/tree/mentor-misc-improvements-2-after-jethro
Christopher Larson (4):
linux-dtb.inc: use absolute upd-alt paths
opkg-utils: add update-alternatives PACKAGECONFIG
systemd: add myhostname to nsswitch.conf
systemd: arrange for volatile /etc/resolv.conf
meta/recipes-core/systemd/systemd_225.bb | 20 ++++++++++++++++++++ meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 12 +++++++++--- meta/recipes-kernel/linux/linux-dtb.inc | 4 ++-- 3 files changed, 31 insertions(+), 5 deletions(-)
Signature · 1 line
2.2.1
PATCH 1/4 linux-dtb.inc: use absolute upd-alt paths
From: Christopher Larson <[email protected]>
This works around a limitation of the chkconfig update-alternatives, so it works with all our update-alternatives providers.
--- meta/recipes-kernel/linux/linux-dtb.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-kernel/linux/linux-dtb.inc +2 -2
@@ -64,7 +64,7 @@ pkg_postinst_kernel-devicetree () { do DTB_BASE_NAME=`basename ${DTB_FILE} | awk -F "." '{print $1}'` DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` - update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.dtb ${DTB_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true + update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.dtb ${DTB_BASE_NAME}.dtb /boot/devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true done }
@@ -74,6 +74,6 @@ pkg_postrm_kernel-devicetree () { do DTB_BASE_NAME=`basename ${DTB_FILE} | awk -F "." '{print $1}'` DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` - update-alternatives --remove ${DTB_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true + update-alternatives --remove ${DTB_BASE_NAME}.dtb /boot/devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true done }
Signature · 1 line
2.2.1
PATCH 2/4 opkg-utils: add update-alternatives PACKAGECONFIG
From: Christopher Larson <[email protected]>
This lets someone use a different update-alternatives-native provider. Without this available, they'll step on one another in the sysroot unconditionally, since we need to build opkg-utils-native for ipk based builds regardless.
--- meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +9 -3
@@ -5,7 +5,7 @@ HOMEPAGE = "http://code.google.com/p/opkg/" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ file://opkg.py;beginline=1;endline=18;md5=15917491ad6bf7acc666ca5f7cc1e083" -PROVIDES += "virtual/update-alternatives" +PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}" SRCREV = "53274f087565fd45d8452c5367997ba6a682a37a" PV = "0.1.8+git${SRCPV}"
@@ -21,15 +21,21 @@ TARGET_CC_ARCH += "${LDFLAGS}" PYTHONRDEPS = "python python-shell python-io python-math python-crypt python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-stringold" PYTHONRDEPS_class-native = "" -PACKAGECONFIG = "python" +PACKAGECONFIG = "python update-alternatives" PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}" +PACKAGECONFIG[update-alternatives] = ",,," do_install() { oe_runmake PREFIX=${prefix} DESTDIR=${D} install + if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then + rm -f "${D}${bindir}/update-alternatives" + fi } do_install_append_class-target() { - sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${libdir},g' + if [ -e "${D}${bindir}/update-alternatives" ]; then + sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${libdir},g' + fi } PACKAGES =+ "update-alternatives-opkg"
Signature · 1 line
2.2.1
Re: [PATCH 2/4] opkg-utils: add update-alternatives PACKAGECONFIG
Hi Chris,
I've afraid this patch can't work well, when opkg-utils doesn't provide virtual/update-alternatives, then chkconfig would be built and there would be dependency loops for example,
PACKAGECONFIG = "python"
$ bitbake core-image-minimal
[snip]
ERROR:
Dependency loop #1 found:
Task 747
(/buildarea/lyang1/poky/meta/recipes-support/libpcre/libpcre_8.38.bb, do_packagedata) (dependent Tasks ['libpcre, do_package'])
Task 2067 (/buildarea/lyang1/poky/meta/recipes-extended/slang/slang_2.2.4.bb,do_package) (dependent Tasks ['gcc-runtime, do_packagedata', 'pseudo, do_populate_sysroot', 'slang, do_install', 'libpcre, do_packagedata', 'libtool-cross, do_packagedata', 'glibc, do_packagedata', 'rpm, do_populate_sysroot'])
Task 2064 (/buildarea/lyang1/poky/meta/recipes-extended/slang/slang_2.2.4.bb,do_packagedata) (dependent Tasks ['slang, do_package'])
Task 1876
(/buildarea/lyang1/poky/meta/recipes-extended/newt/libnewt_0.52.18.bb, do_package) (dependent Tasks ['slang, do_packagedata', 'gcc-runtime, do_packagedata', 'pseudo, do_populate_sysroot', 'libnewt, do_install', 'libtool-cross, do_packagedata', 'glibc, do_packagedata', 'popt, do_packagedata', 'rpm, do_populate_sysroot'])
Task 1873
(/buildarea/lyang1/poky/meta/recipes-extended/newt/libnewt_0.52.18.bb, do_packagedata) (dependent Tasks ['libnewt, do_package'])
Task 1405
(/buildarea/lyang1/poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb, do_package) (dependent Tasks ['gcc-runtime, do_packagedata', 'pseudo, do_populate_sysroot', 'glibc, do_packagedata', 'libnewt, do_packagedata', 'chkconfig, do_install', 'popt, do_packagedata', 'gettext, do_packagedata', 'rpm, do_populate_sysroot'])
Task 1402
(/buildarea/lyang1/poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb, do_packagedata) (dependent Tasks ['chkconfig, do_package'])
Task 853 (/buildarea/lyang1/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb,do_package) (dependent Tasks ['gcc-runtime, do_packagedata', 'bzip2, do_install_ptest_base', 'bzip2, do_install', 'libtool-cross, do_packagedata', 'glibc, do_packagedata', 'pseudo, do_populate_sysroot', 'chkconfig, do_packagedata', 'rpm, do_populate_sysroot'])
Task 850 (/buildarea/lyang1/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb,do_packagedata) (dependent Tasks ['bzip2, do_package'])
Task 750
(/buildarea/lyang1/poky/meta/recipes-support/libpcre/libpcre_8.38.bb, do_package) (dependent Tasks ['libpcre, do_install_ptest_base', 'libpcre, do_install', 'gcc-runtime, do_packagedata', 'pseudo, do_populate_sysroot', 'libtool-cross, do_packagedata', 'glibc, do_packagedata', 'bzip2, do_packagedata', 'zlib, do_packagedata', 'rpm, do_populate_sysroot'])
[snip]
// Robert
Quoted 49 lines · Christopher Larson
From: Christopher Larson <[email protected]>
This lets someone use a different update-alternatives-native provider. Without this available, they'll step on one another in the sysroot unconditionally, since we need to build opkg-utils-native for ipk based builds regardless.
Signed-off-by Christopher Larson <[email protected]>--- meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +9
-3@@ -5,7 +5,7 @@ HOMEPAGE = "http://code.google.com/p/opkg/" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ file://opkg.py;beginline=1;endline=18;md5=15917491ad6bf7acc666ca5f7cc1e083" -PROVIDES += "virtual/update-alternatives" +PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}" SRCREV = "53274f087565fd45d8452c5367997ba6a682a37a" PV = "0.1.8+git${SRCPV}"@@ -21,15 +21,21 @@ TARGET_CC_ARCH += "${LDFLAGS}" PYTHONRDEPS = "python python-shell python-io python-math python-crypt python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-stringold" PYTHONRDEPS_class-native = "" -PACKAGECONFIG = "python" +PACKAGECONFIG = "python update-alternatives" PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}" +PACKAGECONFIG[update-alternatives] = ",,," do_install() { oe_runmake PREFIX=${prefix} DESTDIR=${D} install + if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then + rm -f "${D}${bindir}/update-alternatives" + fi } do_install_append_class-target() { - sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${libdir},g' + if [ -e "${D}${bindir}/update-alternatives" ]; then + sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${libdir},g' + fi } PACKAGES =+ "update-alternatives-opkg"
Re: [PATCH 2/4] opkg-utils: add update-alternatives PACKAGECONFIG
Quoted 43 lines · Robert Yang
I've afraid this patch can't work well, when opkg-utils doesn't provide virtual/update-alternatives, then chkconfig would be built and there would be dependency loops for example,
PACKAGECONFIG = "python"
$ bitbake core-image-minimal[snip]
ERROR:
Dependency loop #1 found:
Task 747 (/buildarea/lyang1/poky/meta/recipes-support/libpcre/
libpcre_8.38.bb,do_packagedata) (dependent Tasks ['libpcre,do_package'])
Task 2067 (/buildarea/lyang1/poky/meta/recipes-extended/slang/
slang_2.2.4.bb,do_package) (dependent Tasks ['gcc-runtime,do_packagedata', 'pseudo,do_populate_sysroot', 'slang,do_install', 'libpcre,do_packagedata', 'libtool-cross,do_packagedata', 'glibc,do_packagedata', 'rpm,do_populate_sysroot'])
Task 2064 (/buildarea/lyang1/poky/meta/recipes-extended/slang/
slang_2.2.4.bb,do_packagedata) (dependent Tasks ['slang,do_package'])
Task 1876 (/buildarea/lyang1/poky/meta/recipes-extended/newt/
libnewt_0.52.18.bb,do_package) (dependent Tasks ['slang,do_packagedata', 'gcc-runtime,do_packagedata', 'pseudo,do_populate_sysroot', 'libnewt,do_install', 'libtool-cross,do_packagedata', 'glibc,do_packagedata', 'popt,do_packagedata', 'rpm,do_populate_sysroot'])
Task 1873 (/buildarea/lyang1/poky/meta/recipes-extended/newt/
libnewt_0.52.18.bb,do_packagedata) (dependent Tasks ['libnewt,do_package'])
Task 1405 (/buildarea/lyang1/poky/meta/recipes-extended/chkconfig/
chkconfig_1.3.58.bb,do_package) (dependent Tasks ['gcc-runtime,do_packagedata', 'pseudo,do_populate_sysroot', 'glibc,do_packagedata', 'libnewt,do_packagedata', 'chkconfig,do_install', 'popt,do_packagedata', 'gettext,do_packagedata', 'rpm,do_populate_sysroot'])
Task 1402 (/buildarea/lyang1/poky/meta/recipes-extended/chkconfig/
chkconfig_1.3.58.bb,do_packagedata) (dependent Tasks ['chkconfig,do_package'])
Task 853 (/buildarea/lyang1/poky/meta/recipes-extended/bzip2/
bzip2_1.0.6.bb,do_package) (dependent Tasks ['gcc-runtime,do_packagedata', 'bzip2,do_install_ptest_base', 'bzip2,do_install', 'libtool-cross,do_packagedata', 'glibc,do_packagedata', 'pseudo,do_populate_sysroot', 'chkconfig,do_packagedata', 'rpm,do_populate_sysroot'])
Quoted 8 lines
Task 850 (/buildarea/lyang1/poky/meta/recipes-extended/bzip2/
bzip2_1.0.6.bb,do_packagedata) (dependent Tasks ['bzip2,do_package'])
Task 750 (/buildarea/lyang1/poky/meta/recipes-support/libpcre/
libpcre_8.38.bb,do_package) (dependent Tasks ['libpcre,do_install_ptest_base', 'libpcre,do_install', 'gcc-runtime,do_packagedata', 'pseudo,do_populate_sysroot', 'libtool-cross,do_packagedata', 'glibc,do_packagedata', 'bzip2,do_packagedata', 'zlib,do_packagedata', 'rpm,do_populate_sysroot'])
Afaict it should work for the native case, just not target, if you use the chkconfig-alternatives-native recipe. In meta-mentor we have that recipe for target as well, to cover both cases, I'll see about submitting that. We've been using the chkconfig update-alternatives implementation for a few releases now.
Signature · 5 lines
Christopher Larson kergoth at gmail dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
Re: [PATCH 2/4] opkg-utils: add update-alternatives PACKAGECONFIG
Quoted 67 lines · Christopher Larson
On Fri, Jan 15, 2016 at 2:23 AM, Robert Yang <[email protected] <mailto:[email protected]>> wrote:
I've afraid this patch can't work well, when opkg-utils doesn't provide virtual/update-alternatives, then chkconfig would be built and there would be dependency loops for example, PACKAGECONFIG = "python" $ bitbake core-image-minimal [snip] ERROR: Dependency loop #1 found: Task 747 (/buildarea/lyang1/poky/meta/recipes-support/libpcre/libpcre_8.38.bb <http://libpcre_8.38.bb>, do_packagedata) (dependent Tasks ['libpcre, do_package']) Task 2067 (/buildarea/lyang1/poky/meta/recipes-extended/slang/slang_2.2.4.bb <http://slang_2.2.4.bb>, do_package) (dependent Tasks ['gcc-runtime, do_packagedata', 'pseudo, do_populate_sysroot', 'slang, do_install', 'libpcre, do_packagedata', 'libtool-cross, do_packagedata', 'glibc, do_packagedata', 'rpm, do_populate_sysroot']) Task 2064 (/buildarea/lyang1/poky/meta/recipes-extended/slang/slang_2.2.4.bb <http://slang_2.2.4.bb>, do_packagedata) (dependent Tasks ['slang, do_package']) Task 1876 (/buildarea/lyang1/poky/meta/recipes-extended/newt/libnewt_0.52.18.bb <http://libnewt_0.52.18.bb>, do_package) (dependent Tasks ['slang, do_packagedata', 'gcc-runtime, do_packagedata', 'pseudo, do_populate_sysroot', 'libnewt, do_install', 'libtool-cross, do_packagedata', 'glibc, do_packagedata', 'popt, do_packagedata', 'rpm, do_populate_sysroot']) Task 1873 (/buildarea/lyang1/poky/meta/recipes-extended/newt/libnewt_0.52.18.bb <http://libnewt_0.52.18.bb>, do_packagedata) (dependent Tasks ['libnewt, do_package']) Task 1405 (/buildarea/lyang1/poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb <http://chkconfig_1.3.58.bb>, do_package) (dependent Tasks ['gcc-runtime, do_packagedata', 'pseudo, do_populate_sysroot', 'glibc, do_packagedata', 'libnewt, do_packagedata', 'chkconfig, do_install', 'popt, do_packagedata', 'gettext, do_packagedata', 'rpm, do_populate_sysroot']) Task 1402 (/buildarea/lyang1/poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb <http://chkconfig_1.3.58.bb>, do_packagedata) (dependent Tasks ['chkconfig, do_package']) Task 853 (/buildarea/lyang1/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb <http://bzip2_1.0.6.bb>, do_package) (dependent Tasks ['gcc-runtime, do_packagedata', 'bzip2, do_install_ptest_base', 'bzip2, do_install', 'libtool-cross, do_packagedata', 'glibc, do_packagedata', 'pseudo, do_populate_sysroot', 'chkconfig, do_packagedata', 'rpm, do_populate_sysroot']) Task 850 (/buildarea/lyang1/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb <http://bzip2_1.0.6.bb>, do_packagedata) (dependent Tasks ['bzip2, do_package']) Task 750 (/buildarea/lyang1/poky/meta/recipes-support/libpcre/libpcre_8.38.bb <http://libpcre_8.38.bb>, do_package) (dependent Tasks ['libpcre, do_install_ptest_base', 'libpcre, do_install', 'gcc-runtime, do_packagedata', 'pseudo, do_populate_sysroot', 'libtool-cross, do_packagedata', 'glibc, do_packagedata', 'bzip2, do_packagedata', 'zlib, do_packagedata', 'rpm, do_populate_sysroot'])
Quoted 4 lines
Afaict it should work for the native case, just not target, if you use the chkconfig-alternatives-native recipe. In meta-mentor we have that recipe for target as well, to cover both cases, I'll see about submitting that. We've been using the chkconfig update-alternatives implementation for a few releases now.
If I understand correctly, maybe we need make PACKAGECONFIG only be available for opkg-utils-native ?
// Robert
Quoted 6 lines
--
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
PATCH 3/4 systemd: add myhostname to nsswitch.conf
In reply to Christopher LarsonFrom: Christopher Larson <[email protected]>
We don't need nss-myhostname on systemd systems, because systemd already provides myhostname, but we weren't configuring nsswitch to use it. Being able to resolve the hostname is useful for a number of different applications, so enable it using the same postinst/prerm bits which are in nss-myhostname.
--- meta/recipes-core/systemd/systemd_225.bb | 12 ++++++++++++ 1 file changed, 12 insertions(+)
meta/recipes-core/systemd/systemd_225.bb +12 -0
@@ -397,6 +397,18 @@ ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" ALTERNATIVE_PRIORITY[runlevel] ?= "300" +pkg_postinst_${PN} () { + sed -e '/^hosts:/s/\s*\<myhostname\>//' \ + -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \ + -i $D${sysconfdir}/nsswitch.conf +} + +pkg_prerm_${PN} () { + sed -e '/^hosts:/s/\s*\<myhostname\>//' \ + -e '/^hosts:/s/\s*myhostname//' \ + -i $D${sysconfdir}/nsswitch.conf +} + pkg_postinst_udev-hwdb () { if test -n "$D"; then ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
Signature · 1 line
2.2.1
Re: [PATCH 3/4] systemd: add myhostname to nsswitch.conf
Quoted 38 lines · Christopher Larson
From: Christopher Larson <[email protected]>
We don't need nss-myhostname on systemd systems, because systemd already provides myhostname, but we weren't configuring nsswitch to use it. Being able to resolve the hostname is useful for a number of different applications, so enable it using the same postinst/prerm bits which are in nss-myhostname.
Signed-off-by Christopher Larson <[email protected]>--- meta/recipes-core/systemd/systemd_225.bb | 12 ++++++++++++ 1 file changed, 12 insertions(+)meta/recipes-core/systemd/systemd_225.bb +12
-1@@ -397,6 +397,18 @@ ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" ALTERNATIVE_PRIORITY[runlevel] ?= "300" +pkg_postinst_${PN} () { + sed -e '/^hosts:/s/\s*\<myhostname\>//' \ + -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \ + -i $D${sysconfdir}/nsswitch.conf +} + +pkg_prerm_${PN} () { + sed -e '/^hosts:/s/\s*\<myhostname\>//' \ + -e '/^hosts:/s/\s*myhostname//' \ + -i $D${sysconfdir}/nsswitch.conf +} + pkg_postinst_udev-hwdb () { if test -n "$D"; then ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ --2.2.1
Quoted 1 line
--
This seems to solve my xfce4-terminal delay - thanks. I have a questions regarding this patch: As soon as basefiles are updated resolving stops working - right? So why not handle at basefiles based on systemd distro setting?
Andreas
Re: [PATCH 3/4] systemd: add myhostname to nsswitch.conf
Quoted 44 lines · Andreas Müller
Quoted 4 lines · Christopher Larson
From: Christopher Larson <[email protected]>
We don't need nss-myhostname on systemd systems, because systemd already provides myhostname, but we weren't configuring nsswitch to use it.
Being able
Quoted 1 line
to resolve the hostname is useful for a number of different
applications, so
Review
Quoted 8 lines
enable it using the same postinst/prerm bits which are in nss-myhostname.
Signed-off-by Christopher Larson <[email protected]>--- meta/recipes-core/systemd/systemd_225.bb | 12 ++++++++++++ 1 file changed, 12 insertions(+)(quoted diff) +0
-0b/meta/recipes-core/systemd/systemd_225.bb
meta/recipes-core/systemd/systemd_225.bb ALTERNATIVE_TARGET[runlevel] =
Quoted 4 lines
index 18c2448..20515f5 100644
meta/recipes-core/systemd/systemd_225.bb +0
-0@@ -397,6 +397,18 @@ ALTERNATIVE_TARGET[runlevel] ="${base_bindir}/systemctl"
meta/recipes-core/systemd/systemd_225.bb ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
Quoted 6 lines
meta/recipes-core/systemd/systemd_225.bb +3
-0ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" ALTERNATIVE_PRIORITY[runlevel] ?= "300" +pkg_postinst_${PN} () { + sed -e '/^hosts:/s/\s*\<myhostname\>//' \ + -e's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
meta/recipes-core/systemd/systemd_225.bb ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
Quoted 12 lines
meta/recipes-core/systemd/systemd_225.bb +9
-0+ -i $D${sysconfdir}/nsswitch.conf +} + +pkg_prerm_${PN} () { + sed -e '/^hosts:/s/\s*\<myhostname\>//' \ + -e '/^hosts:/s/\s*myhostname//' \ + -i $D${sysconfdir}/nsswitch.conf +} + pkg_postinst_udev-hwdb () { if test -n "$D"; then ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')}hwdb --update \
Quoted 8 lines
Quoted 4 lines
--
2.2.1--
This seems to solve my xfce4-terminal delay - thanks. I have a questions regarding this patch: As soon as basefiles are updated resolving stops working - right? So why not handle at basefiles based on systemd distro setting?
As far as I know, nsswitch.conf is flagged as a conffile (actually in master everything in /etc/ will be), so once it's modified externally (in this case, by the systemd recipe), the original package which installed the file won't blindliy overwrite those changes.
Signature · 5 lines
Christopher Larson kergoth at gmail dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
Re: [PATCH 3/4] systemd: add myhostname to nsswitch.conf
In reply to Christopher LarsonQuoted 5 lines · Christopher Larson
From: Christopher Larson <[email protected]>
We don't need nss-myhostname on systemd systems, because systemd already provides myhostname, but we weren't configuring nsswitch to use it. Being
able
Quoted 1 line
to resolve the hostname is useful for a number of different applications,
so
Quoted 1 line
enable it using the same postinst/prerm bits which are in nss-myhostname.
I have this and a similar change for resolved in an append at work. Would others be interested in that too?
Review
Quoted 7 lines
Signed-off-by Christopher Larson <[email protected]>--- meta/recipes-core/systemd/systemd_225.bb | 12 ++++++++++++ 1 file changed, 12 insertions(+)(quoted diff) +0
-0
b/meta/recipes-core/systemd/systemd_225.bb
meta/recipes-core/systemd/systemd_225.bb ALTERNATIVE_TARGET[runlevel] =
Quoted 4 lines
index 18c2448..20515f5 100644
meta/recipes-core/systemd/systemd_225.bb +0
-0@@ -397,6 +397,18 @@ ALTERNATIVE_TARGET[runlevel] =
"${base_bindir}/systemctl"
meta/recipes-core/systemd/systemd_225.bb ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
Quoted 6 lines
meta/recipes-core/systemd/systemd_225.bb +3
-0ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" ALTERNATIVE_PRIORITY[runlevel] ?= "300" +pkg_postinst_${PN} () { + sed -e '/^hosts:/s/\s*\<myhostname\>//' \ + -e
's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
meta/recipes-core/systemd/systemd_225.bb ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
Quoted 12 lines
meta/recipes-core/systemd/systemd_225.bb +9
-0+ -i $D${sysconfdir}/nsswitch.conf +} + +pkg_prerm_${PN} () { + sed -e '/^hosts:/s/\s*\<myhostname\>//' \ + -e '/^hosts:/s/\s*myhostname//' \ + -i $D${sysconfdir}/nsswitch.conf +} + pkg_postinst_udev-hwdb () { if test -n "$D"; then ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')}
hwdb --update \
Quoted 8 lines
--
2.2.1--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [PATCH 3/4] systemd: add myhostname to nsswitch.conf
Quoted 6 lines · Dan McGregor
Quoted 5 lines · Christopher Larson
From: Christopher Larson <[email protected]>
We don't need nss-myhostname on systemd systems, because systemd already provides myhostname, but we weren't configuring nsswitch to use it.
Quoted 8 lines
Being able
Quoted 1 line
to resolve the hostname is useful for a number of different
applications, so
Quoted 1 line
enable it using the same postinst/prerm bits which are in nss-myhostname.
I have this and a similar change for resolved in an append at work. Would others be interested in that too?
I'm sure there are folks that would find that interesting. I'm sure not everyone uses resolved, but I'm sure we want it to work well for folks taht do want to use it.
Signature · 5 lines
Christopher Larson kergoth at gmail dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
Re: [PATCH 3/4] systemd: add myhostname to nsswitch.conf
Quoted 3 lines · Christopher Larson
On Tue, Nov 17, 2015 at 8:49 PM, Dan McGregor <[email protected]>
Quoted 6 lines · wrote:
Quoted 6 lines · Christopher Larson
Quoted 4 lines
From: Christopher Larson <[email protected]>
We don't need nss-myhostname on systemd systems, because systemd
already
Quoted 1 line
Quoted 1 line
Quoted 1 line
provides myhostname, but we weren't configuring nsswitch to use it.
Being able
Quoted 1 line
Quoted 1 line
Quoted 1 line
to resolve the hostname is useful for a number of different
applications, so
Quoted 1 line
Quoted 1 line
Quoted 1 line
enable it using the same postinst/prerm bits which are in
nss-myhostname.
Quoted 2 lines
Quoted 2 lines
I have this and a similar change for resolved in an append at work.
Would others be interested in that too?
Quoted 3 lines
I'm sure there are folks that would find that interesting. I'm sure not
everyone uses resolved, but I'm sure we want it to work well for folks taht do want to use it.
Quoted 1 line
Cool. I'll post my change. nss_resolve can be used unconditionally if it's there. If resolved isn't running it falls back to nss_dns.
PATCH 4/4 systemd: arrange for volatile /etc/resolv.conf
In reply to Christopher LarsonFrom: Christopher Larson <[email protected]>
On sysvinit systems, volatiles is configured to make /etc/resolv.conf symlink to a file in a volatile path, which lets us write to /etc/resolv.conf for read-only-rootfs. For systemd, this isn't set up unless we enable systemd-resolved, which we don't by default. When it's not enabled, create the /etc/resolv.conf symlink and ensure the volatile path is created on boot with tmpfiles.d.
--- meta/recipes-core/systemd/systemd_225.bb | 8 ++++++++ 1 file changed, 8 insertions(+)
meta/recipes-core/systemd/systemd_225.bb +8 -0
@@ -196,6 +196,13 @@ do_install() { if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then ${@bb.utils.contains('PACKAGECONFIG', 'networkd', ':', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf', d)} fi + if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then + # if resolved is disabled, it won't handle the link of resolv.conf, so + # set it up ourselves + ln -s ../run/resolv.conf ${D}${sysconfdir}/resolv.conf + echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf + echo 'f /run/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf + fi install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install }
@@ -290,6 +297,7 @@ FILES_${PN} = " ${base_bindir}/* \ ${sysconfdir}/tmpfiles.d/ \ ${sysconfdir}/xdg/ \ ${sysconfdir}/init.d/README \ + ${sysconfdir}/resolv.conf \ ${rootlibexecdir}/systemd/* \ ${systemd_unitdir}/* \ ${base_libdir}/security/*.so \
Signature · 1 line
2.2.1
Re: [PATCH 1/4] linux-dtb.inc: use absolute upd-alt paths
In reply to Christopher LarsonQuoted 4 lines · Christopher Larson
From: Christopher Larson <[email protected]>
This works around a limitation of the chkconfig update-alternatives, so it works with all our update-alternatives providers.
I know this change is old and has been in for over a year...
But the side-effect of it is that it breaks NFS-boot due to absolute DTB symlinks. We had to implement a local workaround to switch them back to relative links.
Is there another way to fix the original issue w/o absolute links?
Signature · 1 line
Denys
Quoted 34 lines
Signed-off-by Christopher Larson <[email protected]>--- meta/recipes-kernel/linux/linux-dtb.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)meta/recipes-kernel/linux/linux-dtb.inc +2
-2@@ -64,7 +64,7 @@ pkg_postinst_kernel-devicetree () { do DTB_BASE_NAME=`basename ${DTB_FILE} | awk -F "." '{print $1}'` DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` - update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.dtb ${DTB_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true + update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.dtb ${DTB_BASE_NAME}.dtb /boot/devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true done }@@ -74,6 +74,6 @@ pkg_postrm_kernel-devicetree () { do DTB_BASE_NAME=`basename ${DTB_FILE} | awk -F "." '{print $1}'` DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` - update-alternatives --remove ${DTB_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true + update-alternatives --remove ${DTB_BASE_NAME}.dtb /boot/devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true done }Signature · 7 lines
2.2.1 -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [PATCH 1/4] linux-dtb.inc: use absolute upd-alt paths
Quoted 7 lines · Denys Dmytriyenko
Quoted 3 lines · Christopher Larson
From: Christopher Larson <[email protected]>
This works around a limitation of the chkconfig update-alternatives, so
it
Quoted 1 line
works with all our update-alternatives providers.
Quoted 7 lines
I know this change is old and has been in for over a year...
But the side-effect of it is that it breaks NFS-boot due to absolute DTB symlinks. We had to implement a local workaround to switch them back to relative links.
Is there another way to fix the original issue w/o absolute links?
I expect so. I’d be fine with dropping this, it was a workaround more than anything else anyway.
Signature · 4 lines
Christopher Larson kergoth at gmail dot com Founder - BitBake, OpenEmbedded, OpenZaurus Senior Software Engineer, Mentor Graphics
Re: [PATCH 1/4] linux-dtb.inc: use absolute upd-alt paths
Quoted 11 lines · Christopher Larson
Quoted 9 lines · Denys Dmytriyenko
Quoted 3 lines · Christopher Larson
From: Christopher Larson <[email protected]>
This works around a limitation of the chkconfig update-alternatives, so
it
Quoted 1 line
works with all our update-alternatives providers.
I know this change is old and has been in for over a year...
Quoted 8 lines
Quoted 5 lines
But the side-effect of it is that it breaks NFS-boot due to absolute DTB symlinks. We had to implement a local workaround to switch them back to relative links.
Is there another way to fix the original issue w/o absolute links?
I expect so. I’d be fine with dropping this, it was a workaround more than anything else anyway.
Ok, someone just changed it, works for me :)
http://cgit.openembedded.org/openembedded-core/commit/?id=c7bc46b9bc29dd0953ab8d63b50fa105bb66892e
Signature · 1 line
Denys
Quoted 29 lines · Christopher Larson
From: Christopher Larson <[email protected]>
This is the final of three pull requests / patch series from Mentor's queue of
changes destined for oe-core master (not jethro). This series includes a small
number of improvements which may be more contentious or may require more consideration and review.The following changes since commit
e44ed8c18e395b9c055aefee113b90708e8a8a2f:build-appliance-image: Update to jethro head revision (2015-11-03
14:02:57 +0000)are available in the git repository at:
git://github.com/kergoth/openembedded-core
mentor-misc-improvements-2-after-jethrohttps://github.com/kergoth/openembedded-core/tree/mentor-misc-improvements-2-after-jethro
Christopher Larson (4):
linux-dtb.inc: use absolute upd-alt paths
opkg-utils: add update-alternatives PACKAGECONFIG
systemd: add myhostname to nsswitch.conf
systemd: arrange for volatile/etc/resolv.conf
Quoted 6 lines
meta/recipes-core/systemd/systemd_225.bb | 20 ++++++++++++++++++++ meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 12 +++++++++--- meta/recipes-kernel/linux/linux-dtb.inc | 4 ++-- 3 files changed, 31 insertions(+), 5 deletions(-)
Any objections to this series?
Signature · 5 lines
Christopher Larson kergoth at gmail dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
Quoted 2 lines · Christopher Larson
Any objections to this series?
Slipped through the net, thanks for the ping. They look good to me, in mut now.
Ross