Re: [yocto] ntp recipe not able to install few packages in the rootfs
On 5/14/19 2:42 AM, Pandey, Kamal wrote: Hi I was trying to add ntp package to my image, I used the meta-networking layer for the recipe and added the ntp package to my custom image.bb recipe. After compiling I can see multiple packages in package-split directory of the working directory of ntp package, but these binaries are missing in the ROOTFS directory. You can see below that ntpq is packaged into package of its own. So you need to add that to your IMAGE_INSTALL something like IMAGE_INSTALL_append = " ntpq" in your image recipe might help Below is my ntp recipe: SUMMARY = "Network Time Protocol daemon and utilities" DESCRIPTION = "The Network Time Protocol (NTP) is used to \ synchronize the time of a computer client or server to \ another server or reference time source, such as a radio \ or satellite receiver or modem." HOMEPAGE = "http://support.ntp.org; SECTION = "net" LICENSE = "NTP" LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=e877a1d567a6a58996d2b66e3e387003" DEPENDS = "libevent" SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \ file://ntp-4.2.4_p6-nano.patch \ file://reproducibility-fixed-path-to-posix-shell.patch \ file://reproducibility-respect-source-date-epoch.patch \ file://ntpd \ file://ntp.conf \ file://ntpdate \ file://ntpdate.default \ file://ntpdate.service \ file://ntpd.service \ file://sntp.service \ file://sntp \ file://ntpd.list \ " SRC_URI[md5sum] = "1522d66574bae14abb2622746dad2bdc" SRC_URI[sha256sum] = "709b222b5013d77d26bfff532b5ea470a8039497ef29d09363931c036cb30454" inherit autotools update-rc.d useradd systemd pkgconfig # The ac_cv_header_readline_history is to stop ntpdc depending on either # readline or curses EXTRA_OECONF += "--with-net-snmp-config=no \ --without-ntpsnmpd \ ac_cv_header_readline_history_h=no \ --with-yielding_select=yes \ --with-locfile=redhat \ --without-rpath \ " CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" USERADD_PACKAGES = "${PN}" NTP_USER_HOME ?= "/var/lib/ntp" USERADD_PARAM_${PN} = "--system --home-dir ${NTP_USER_HOME} \ --no-create-home \ --shell /bin/false --user-group ntp" # NB: debug is default-enabled by NTP; keep it default-enabled here. PACKAGECONFIG ??= "cap debug refclocks openssl \ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ " PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \ --with-openssl-incdir=${STAGING_INCDIR} \ --with-crypto, \ --without-openssl --without-crypto, \ openssl" PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap" PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline" PACKAGECONFIG[refclocks] = "--enable-all-clocks,--disable-all-clocks,pps-tools" PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging" PACKAGECONFIG[mdns] = "ac_cv_header_dns_sd_h=yes,ac_cv_header_dns_sd_h=no,mdns" PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," do_install_append() { install -d ${D}${sysconfdir}/init.d install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir} install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d install -d ${D}${bindir} install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync install -m 755 -d ${D}${NTP_USER_HOME} chown ntp:ntp ${D}${NTP_USER_HOME} # Fix hardcoded paths in scripts sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${bindir}/ntpdate-sync sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace sed -i '1s,#!.*perl,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/calc_tickadj sed -i '/use/i use warnings;' ${D}${sbindir}/calc_tickadj install -d ${D}/${sysconfdir}/default install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/ install -d ${D}/${sysconfdir}/network/if-up.d ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d install -d
Re: [yocto] ntp recipe not able to install few packages in the rootfs
How does your image recipe look like? Also, log.do_rootfs can provide a hint about what got installed into the image (you will find it in the image build directory). Alex On Tue, 14 May 2019 at 11:42, Pandey, Kamal wrote: > > Hi > I was trying to add ntp package to my image, I used the meta-networking layer > for the recipe and added the ntp package to my custom image.bb recipe. > After compiling I can see multiple packages in package-split directory of the > working directory of ntp package, but these binaries are missing in the > ROOTFS directory. > Below is my ntp recipe: > > > SUMMARY = "Network Time Protocol daemon and utilities" > DESCRIPTION = "The Network Time Protocol (NTP) is used to \ > synchronize the time of a computer client or server to \ > another server or reference time source, such as a radio \ > or satellite receiver or modem." > HOMEPAGE = "http://support.ntp.org; > SECTION = "net" > LICENSE = "NTP" > LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=e877a1d567a6a58996d2b66e3e387003" > > DEPENDS = "libevent" > > SRC_URI = > "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \ >file://ntp-4.2.4_p6-nano.patch \ >file://reproducibility-fixed-path-to-posix-shell.patch \ >file://reproducibility-respect-source-date-epoch.patch \ >file://ntpd \ >file://ntp.conf \ >file://ntpdate \ >file://ntpdate.default \ >file://ntpdate.service \ >file://ntpd.service \ >file://sntp.service \ >file://sntp \ >file://ntpd.list \ > " > > SRC_URI[md5sum] = "1522d66574bae14abb2622746dad2bdc" > SRC_URI[sha256sum] = > "709b222b5013d77d26bfff532b5ea470a8039497ef29d09363931c036cb30454" > > inherit autotools update-rc.d useradd systemd pkgconfig > > # The ac_cv_header_readline_history is to stop ntpdc depending on either > # readline or curses > EXTRA_OECONF += "--with-net-snmp-config=no \ > --without-ntpsnmpd \ > ac_cv_header_readline_history_h=no \ > --with-yielding_select=yes \ > --with-locfile=redhat \ > --without-rpath \ > " > CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" > > USERADD_PACKAGES = "${PN}" > NTP_USER_HOME ?= "/var/lib/ntp" > USERADD_PARAM_${PN} = "--system --home-dir ${NTP_USER_HOME} \ >--no-create-home \ >--shell /bin/false --user-group ntp" > > # NB: debug is default-enabled by NTP; keep it default-enabled here. > PACKAGECONFIG ??= "cap debug refclocks openssl \ > ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ > " > PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \ > --with-openssl-incdir=${STAGING_INCDIR} \ > --with-crypto, \ > --without-openssl --without-crypto, \ > openssl" > PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap" > PACKAGECONFIG[readline] = > "--with-lineeditlibs,--without-lineeditlibs,readline" > PACKAGECONFIG[refclocks] = > "--enable-all-clocks,--disable-all-clocks,pps-tools" > PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging" > PACKAGECONFIG[mdns] = > "ac_cv_header_dns_sd_h=yes,ac_cv_header_dns_sd_h=no,mdns" > PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," > > do_install_append() { > install -d ${D}${sysconfdir}/init.d > install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir} > install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d > install -d ${D}${bindir} > install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync > > install -m 755 -d ${D}${NTP_USER_HOME} > chown ntp:ntp ${D}${NTP_USER_HOME} > > # Fix hardcoded paths in scripts > sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd > ${D}${bindir}/ntpdate-sync > sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd > ${D}${bindir}/ntpdate-sync > sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd > ${D}${bindir}/ntpdate-sync > sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd > ${D}${bindir}/ntpdate-sync > sed -i > 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' > ${D}${bindir}/ntpdate-sync > sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace > sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace > sed -i '1s,#!.*perl,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait > sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait > sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/calc_tickadj > sed -i '/use/i use warnings;' ${D}${sbindir}/calc_tickadj > > install -d ${D}/${sysconfdir}/default > install -m 644 ${WORKDIR}/ntpdate.default > ${D}${sysconfdir}/default/ntpdate > install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/ > > install
Re: [yocto] ntp recipe not able to install few packages in the rootfs
Hi I was trying to add ntp package to my image, I used the meta-networking layer for the recipe and added the ntp package to my custom image.bb recipe. After compiling I can see multiple packages in package-split directory of the working directory of ntp package, but these binaries are missing in the ROOTFS directory. Below is my ntp recipe: SUMMARY = "Network Time Protocol daemon and utilities" DESCRIPTION = "The Network Time Protocol (NTP) is used to \ synchronize the time of a computer client or server to \ another server or reference time source, such as a radio \ or satellite receiver or modem." HOMEPAGE = "http://support.ntp.org; SECTION = "net" LICENSE = "NTP" LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=e877a1d567a6a58996d2b66e3e387003" DEPENDS = "libevent" SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \ file://ntp-4.2.4_p6-nano.patch \ file://reproducibility-fixed-path-to-posix-shell.patch \ file://reproducibility-respect-source-date-epoch.patch \ file://ntpd \ file://ntp.conf \ file://ntpdate \ file://ntpdate.default \ file://ntpdate.service \ file://ntpd.service \ file://sntp.service \ file://sntp \ file://ntpd.list \ " SRC_URI[md5sum] = "1522d66574bae14abb2622746dad2bdc" SRC_URI[sha256sum] = "709b222b5013d77d26bfff532b5ea470a8039497ef29d09363931c036cb30454" inherit autotools update-rc.d useradd systemd pkgconfig # The ac_cv_header_readline_history is to stop ntpdc depending on either # readline or curses EXTRA_OECONF += "--with-net-snmp-config=no \ --without-ntpsnmpd \ ac_cv_header_readline_history_h=no \ --with-yielding_select=yes \ --with-locfile=redhat \ --without-rpath \ " CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" USERADD_PACKAGES = "${PN}" NTP_USER_HOME ?= "/var/lib/ntp" USERADD_PARAM_${PN} = "--system --home-dir ${NTP_USER_HOME} \ --no-create-home \ --shell /bin/false --user-group ntp" # NB: debug is default-enabled by NTP; keep it default-enabled here. PACKAGECONFIG ??= "cap debug refclocks openssl \ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ " PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \ --with-openssl-incdir=${STAGING_INCDIR} \ --with-crypto, \ --without-openssl --without-crypto, \ openssl" PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap" PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline" PACKAGECONFIG[refclocks] = "--enable-all-clocks,--disable-all-clocks,pps-tools" PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging" PACKAGECONFIG[mdns] = "ac_cv_header_dns_sd_h=yes,ac_cv_header_dns_sd_h=no,mdns" PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," do_install_append() { install -d ${D}${sysconfdir}/init.d install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir} install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d install -d ${D}${bindir} install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync install -m 755 -d ${D}${NTP_USER_HOME} chown ntp:ntp ${D}${NTP_USER_HOME} # Fix hardcoded paths in scripts sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${bindir}/ntpdate-sync sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace sed -i '1s,#!.*perl,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/calc_tickadj sed -i '/use/i use warnings;' ${D}${sbindir}/calc_tickadj install -d ${D}/${sysconfdir}/default install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/ install -d ${D}/${sysconfdir}/network/if-up.d ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d install -d ${D}${systemd_unitdir}/system install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/ install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/ install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/ install -d ${D}${systemd_unitdir}/ntp-units.d install