Change resolv.conf generation for sysvinit
PATCH 1/1 Change resolv.conf generation for sysvinit
Move /etc/resolv.conf link generation a volatiles file. Then use update-alternatives to choose the correct one. This is for sysvinit and resolvconf.
--- .../resolvconf/files/volatiles_resolv-conf | 1 + .../resolvconf/resolvconf_1.75.bb | 15 ++++++++++++++- .../initscripts/initscripts-1.0/volatiles | 1 - .../initscripts-1.0/volatiles_resolv-conf | 1 + meta/recipes-core/initscripts/initscripts_1.0.bb | 9 ++++++++- 5 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 meta/recipes-connectivity/resolvconf/files/volatiles_resolv-conf create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/volatiles_resolv-conf
meta/recipes-connectivity/resolvconf/files/volatiles_resolv-conf new file +1 -0
@@ -0,0 +1 @@ +l root root 0644 /etc/resolv.conf /etc/resolvconf/run/resolv.conf
meta/recipes-connectivity/resolvconf/resolvconf_1.75.bb +14 -1
@@ -11,12 +11,16 @@ AUTHOR = "Thomas Hood" HOMEPAGE = "http://packages.debian.org/resolvconf" RDEPENDS_${PN} = "bash" -SRC_URI = "${DEBIAN_MIRROR}/main/r/resolvconf/resolvconf_${PV}.tar.xz" +SRC_URI = "\ + ${DEBIAN_MIRROR}/main/r/resolvconf/resolvconf_${PV}.tar.xz \ + file://volatiles_resolv-conf \ +" SRC_URI[md5sum] = "4b8bc86a3cf070e3fd0e9aff7eaaba56" SRC_URI[sha256sum] = "16167f37a77ef4bc4596dcbefece269b6a10d10fa448594ec55ed3303193086e" inherit allarch +inherit update-alternatives do_compile () { :
@@ -30,6 +34,10 @@ do_install () { install -d ${D}${sysconfdir}/tmpfiles.d echo "d /run/${BPN}/interface - - - -" \ > ${D}${sysconfdir}/tmpfiles.d/resolvconf.conf + else + # Use a volatiles script to install resolv.conf symlink + install -d install -d ${D}${libdir}/${BPN} + install -m 0755 ${WORKDIR}/volatiles_resolv-conf ${D}${libdir}/${BPN}/resolv-conf fi install -d ${D}${sysconfdir}/${BPN} ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run
@@ -42,6 +50,11 @@ do_install () { install -m 0644 man/resolvconf.8 ${D}${mandir}/man8/ } +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN}_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'resolvconf', d)}" +ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/default/volatiles/00_resolv-conf" +ALTERNATIVE_TARGET[resolv-conf] = "${libdir}/${BPN}/resolv-conf" + pkg_postinst_${PN} () { if [ -z "$D" ]; then if command -v systemd-tmpfiles >/dev/null; then
meta/recipes-core/initscripts/initscripts-1.0/volatiles +0 -1
@@ -32,5 +32,4 @@ l root root 1777 /tmp /var/tmp d root root 0755 /var/lock/subsys none f root root 0664 /var/log/wtmp none f root root 0664 /var/run/utmp none -l root root 0644 /etc/resolv.conf /var/run/resolv.conf f root root 0644 /var/run/resolv.conf none
meta/recipes-core/initscripts/initscripts-1.0/volatiles_resolv-conf new file +1 -0
@@ -0,0 +1 @@ +l root root 0644 /etc/resolv.conf /var/run/resolv.conf
meta/recipes-core/initscripts/initscripts_1.0.bb +8 -1
@@ -3,7 +3,7 @@ DESCRIPTION = "Initscripts provide the basic system startup initialization scrip SECTION = "base" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" -PR = "r155" +PR = "r156" INHIBIT_DEFAULT_DEPS = "1"
@@ -29,6 +29,7 @@ SRC_URI = "file://functions \ file://populate-volatile.sh \ file://read-only-rootfs-hook.sh \ file://volatiles \ + file://volatiles_resolv-conf \ file://save-rtc.sh \ file://GPLv2.patch \ file://dmesg.sh \
@@ -45,8 +46,14 @@ DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-sys PACKAGES =+ "${PN}-functions" RDEPENDS_${PN} = "${PN}-functions" +FILES_${PN} += "${libdir}/${BPN}/" FILES_${PN}-functions = "${sysconfdir}/init.d/functions*" +ALTERNATIVE_PRIORITY_${PN} = "90" +ALTERNATIVE_${PN} = "resolv-conf" +ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/default/volatiles/00_resolv-conf" +ALTERNATIVE_TARGET[resolv-conf] = "${libdir}/${BPN}/resolv-conf" + ALTERNATIVE_PRIORITY_${PN}-functions = "90" ALTERNATIVE_${PN}-functions = "functions" ALTERNATIVE_LINK_NAME[functions] = "${sysconfdir}/init.d/functions"
Signature · 1 line
1.7.9.5
Quoted 3 lines · Jate Sujjavanich
Move
/etc/resolv.conflink generation a volatiles file. Then use update-alternatives to choose the correct one. This is for sysvinit and resolvconf.
Please review the commit guide lines on the Openembedded wiki
http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Since this touches 2 recipes you can just say
resolvconf/initscripts: Change resolv.conf generation for sysvinit
as the summary
Quoted 84 lines
--- .../resolvconf/files/volatiles_resolv-conf | 1 + .../resolvconf/resolvconf_1.75.bb | 15 ++++++++++++++- .../initscripts/initscripts-1.0/volatiles | 1 - .../initscripts-1.0/volatiles_resolv-conf | 1 + meta/recipes-core/initscripts/initscripts_1.0.bb | 9 ++++++++- 5 files changed, 24 insertions(+), 3 deletions(-)create mode 100644 meta/recipes-connectivity/resolvconf/files/volatiles_resolv-conf create mode 100644 meta/recipes-core/initscripts/initscripts-1.0/volatiles_resolv-conf
meta/recipes-connectivity/resolvconf/files/volatiles_resolv-conf new file +1
-0@@ -0,0 +1 @@ +l root root 0644 /etc/resolv.conf /etc/resolvconf/run/resolv.confmeta/recipes-connectivity/resolvconf/resolvconf_1.75.bb +14
-1@@ -11,12 +11,16 @@ AUTHOR = "Thomas Hood" HOMEPAGE = "http://packages.debian.org/resolvconf" RDEPENDS_${PN} = "bash" -SRC_URI = "${DEBIAN_MIRROR}/main/r/resolvconf/resolvconf_${PV}.tar.xz" +SRC_URI = "\ + ${DEBIAN_MIRROR}/main/r/resolvconf/resolvconf_${PV}.tar.xz \ + file://volatiles_resolv-conf \ +" SRC_URI[md5sum] = "4b8bc86a3cf070e3fd0e9aff7eaaba56" SRC_URI[sha256sum] = "16167f37a77ef4bc4596dcbefece269b6a10d10fa448594ec55ed3303193086e" inherit allarch +inherit update-alternatives do_compile () { :@@ -30,6 +34,10 @@ do_install () { install -d ${D}${sysconfdir}/tmpfiles.d echo "d /run/${BPN}/interface - - - -" \ > ${D}${sysconfdir}/tmpfiles.d/resolvconf.conf + else + # Use a volatiles script to install resolv.conf symlink + install -d install -d ${D}${libdir}/${BPN} + install -m 0755 ${WORKDIR}/volatiles_resolv-conf ${D}${libdir}/${BPN}/resolv-conf fi install -d ${D}${sysconfdir}/${BPN} ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run@@ -42,6 +50,11 @@ do_install () { install -m 0644 man/resolvconf.8 ${D}${mandir}/man8/ } +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN}_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'resolvconf', d)}" +ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/default/volatiles/00_resolv-conf" +ALTERNATIVE_TARGET[resolv-conf] = "${libdir}/${BPN}/resolv-conf" + pkg_postinst_${PN} () { if [ -z "$D" ]; then if command -v systemd-tmpfiles >/dev/null; thenmeta/recipes-core/initscripts/initscripts-1.0/volatiles +0
-1@@ -32,5 +32,4 @@ l root root 1777 /tmp /var/tmp d root root 0755 /var/lock/subsys none f root root 0664 /var/log/wtmp none f root root 0664 /var/run/utmp none -l root root 0644 /etc/resolv.conf /var/run/resolv.conf f root root 0644 /var/run/resolv.conf nonemeta/recipes-core/initscripts/initscripts-1.0/volatiles_resolv-conf new file +1
-0@@ -0,0 +1 @@ +l root root 0644 /etc/resolv.conf /var/run/resolv.confmeta/recipes-core/initscripts/initscripts_1.0.bb +0
-0
meta/recipes-core/initscripts/initscripts_1.0.bb DESCRIPTION = "Initscripts provide the basic system startup initialization scrip · line 7
Quoted 6 lines
meta/recipes-core/initscripts/initscripts_1.0.bb +1
-1@@ -3,7 +3,7 @@ DESCRIPTION = "Initscripts provide the basic system startup initialization scrip SECTION = "base" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" -PR = "r155" +PR = "r156"
Don't need to bump PR anymore
Quoted 26 lines
meta/recipes-core/initscripts/initscripts_1.0.bb +7
-0INHIBIT_DEFAULT_DEPS = "1"@@ -29,6 +29,7 @@ SRC_URI = "file://functions \ file://populate-volatile.sh \ file://read-only-rootfs-hook.sh \ file://volatiles \ + file://volatiles_resolv-conf \ file://save-rtc.sh \ file://GPLv2.patch \ file://dmesg.sh \@@ -45,8 +46,14 @@ DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-sys PACKAGES =+ "${PN}-functions" RDEPENDS_${PN} = "${PN}-functions" +FILES_${PN} += "${libdir}/${BPN}/" FILES_${PN}-functions = "${sysconfdir}/init.d/functions*" +ALTERNATIVE_PRIORITY_${PN} = "90" +ALTERNATIVE_${PN} = "resolv-conf" +ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/default/volatiles/00_resolv-conf" +ALTERNATIVE_TARGET[resolv-conf] = "${libdir}/${BPN}/resolv-conf" + ALTERNATIVE_PRIORITY_${PN}-functions = "90" ALTERNATIVE_${PN}-functions = "functions" ALTERNATIVE_LINK_NAME[functions] = "${sysconfdir}/init.d/functions"