diff --git a/meta-openeuler/conf/local.conf.sample b/meta-openeuler/conf/local.conf.sample index f06fc21ead9b9c586a6d653f73dfac6ba2662eaf..37723d459765b4725437ed63649c29568d1c9f8c 100644 --- a/meta-openeuler/conf/local.conf.sample +++ b/meta-openeuler/conf/local.conf.sample @@ -274,7 +274,7 @@ CONF_VERSION = "2" HOSTTOOLS += "python chrpath rpmbuild pkg-config flex bison bc automake autoreconf libtool \ ninja xz autopoint autoreconf aclocal libtoolize autoscan autom4te autoconf autoheader \ autoupdate libtool libtoolize pkg-config cmake fmt gperf m4 createrepo_c dnf ldconfig \ - msgfmt msgmerge rpcgen" + msgfmt msgmerge rpcgen makeinfo meson" HOSTTOOLS_remove += "diffstat lz4c pzstd" SANITY_REQUIRED_UTILITIES_remove += "diffstat chrpath" CONNECTIVITY_CHECK_URIS = "" diff --git a/meta-openeuler/recipes-core/bind/bind/0001-revert-d10fbdec-for-lib-dns-gen.c-as-it-is-a-build-p.patch b/meta-openeuler/recipes-core/bind/bind/0001-revert-d10fbdec-for-lib-dns-gen.c-as-it-is-a-build-p.patch new file mode 100644 index 0000000000000000000000000000000000000000..b088f54cdf45cc3702188430afbb65207089bc69 --- /dev/null +++ b/meta-openeuler/recipes-core/bind/bind/0001-revert-d10fbdec-for-lib-dns-gen.c-as-it-is-a-build-p.patch @@ -0,0 +1,37 @@ +From 7278f2529a4f811db8f1d7f5f4e36402986a4470 Mon Sep 17 00:00:00 2001 +From: Mark Andrews +Date: Mon, 23 Dec 2019 07:37:13 +1100 +Subject: [PATCH] revert d10fbdec for lib/dns/gen.c as it is a build platform + executable + +--- + lib/dns/gen.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/lib/dns/gen.c b/lib/dns/gen.c +index 99f0395b3a..6c6e55d4c6 100644 +--- a/lib/dns/gen.c ++++ b/lib/dns/gen.c +@@ -26,8 +26,6 @@ + + #include + +-#include +- + #include + #include + #include +@@ -39,6 +37,10 @@ + #include + #include + ++#ifndef PATH_MAX ++#define PATH_MAX 1024 ++#endif ++ + #ifdef WIN32 + #include "gen-win32.h" + #else +-- +2.12.3 + diff --git a/meta-openeuler/recipes-core/bind/bind/bind9 b/meta-openeuler/recipes-core/bind/bind/bind9 new file mode 100644 index 0000000000000000000000000000000000000000..968679ff7f7adc4b50c17e5d849a0941eae82664 --- /dev/null +++ b/meta-openeuler/recipes-core/bind/bind/bind9 @@ -0,0 +1,2 @@ +# startup options for the server +OPTIONS="-u bind" diff --git a/meta-openeuler/recipes-core/bind/bind/conf.patch b/meta-openeuler/recipes-core/bind/bind/conf.patch new file mode 100644 index 0000000000000000000000000000000000000000..aad345f9fcfdfe000e41189cc14b69b6eb0dd637 --- /dev/null +++ b/meta-openeuler/recipes-core/bind/bind/conf.patch @@ -0,0 +1,330 @@ +Upstream-Status: Inappropriate [configuration] + +the patch is imported from openembedded project + +11/30/2010 - Qing He + +diff -urN bind-9.3.1.orig/conf/db.0 bind-9.3.1/conf/db.0 +--- bind-9.3.1.orig/conf/db.0 1970-01-01 01:00:00.000000000 +0100 ++++ bind-9.3.1/conf/db.0 2005-07-10 22:14:00.000000000 +0200 +@@ -0,0 +1,12 @@ ++; ++; BIND reverse data file for broadcast zone ++; ++$TTL 604800 ++@ IN SOA localhost. root.localhost. ( ++ 1 ; Serial ++ 604800 ; Refresh ++ 86400 ; Retry ++ 2419200 ; Expire ++ 604800 ) ; Negative Cache TTL ++; ++@ IN NS localhost. +diff -urN bind-9.3.1.orig/conf/db.127 bind-9.3.1/conf/db.127 +--- bind-9.3.1.orig/conf/db.127 1970-01-01 01:00:00.000000000 +0100 ++++ bind-9.3.1/conf/db.127 2005-07-10 22:14:00.000000000 +0200 +@@ -0,0 +1,13 @@ ++; ++; BIND reverse data file for local loopback interface ++; ++$TTL 604800 ++@ IN SOA localhost. root.localhost. ( ++ 1 ; Serial ++ 604800 ; Refresh ++ 86400 ; Retry ++ 2419200 ; Expire ++ 604800 ) ; Negative Cache TTL ++; ++@ IN NS localhost. ++1.0.0 IN PTR localhost. +diff -urN bind-9.3.1.orig/conf/db.empty bind-9.3.1/conf/db.empty +--- bind-9.3.1.orig/conf/db.empty 1970-01-01 01:00:00.000000000 +0100 ++++ bind-9.3.1/conf/db.empty 2005-07-10 22:14:00.000000000 +0200 +@@ -0,0 +1,14 @@ ++; BIND reverse data file for empty rfc1918 zone ++; ++; DO NOT EDIT THIS FILE - it is used for multiple zones. ++; Instead, copy it, edit named.conf, and use that copy. ++; ++$TTL 86400 ++@ IN SOA localhost. root.localhost. ( ++ 1 ; Serial ++ 604800 ; Refresh ++ 86400 ; Retry ++ 2419200 ; Expire ++ 86400 ) ; Negative Cache TTL ++; ++@ IN NS localhost. +diff -urN bind-9.3.1.orig/conf/db.255 bind-9.3.1/conf/db.255 +--- bind-9.3.1.orig/conf/db.255 1970-01-01 01:00:00.000000000 +0100 ++++ bind-9.3.1/conf/db.255 2005-07-10 22:14:00.000000000 +0200 +@@ -0,0 +1,12 @@ ++; ++; BIND reserve data file for broadcast zone ++; ++$TTL 604800 ++@ IN SOA localhost. root.localhost. ( ++ 1 ; Serial ++ 604800 ; Refresh ++ 86400 ; Retry ++ 2419200 ; Expire ++ 604800 ) ; Negative Cache TTL ++; ++@ IN NS localhost. +diff -urN bind-9.3.1.orig/conf/db.local bind-9.3.1/conf/db.local +--- bind-9.3.1.orig/conf/db.local 1970-01-01 01:00:00.000000000 +0100 ++++ bind-9.3.1/conf/db.local 2005-07-10 22:14:00.000000000 +0200 +@@ -0,0 +1,13 @@ ++; ++; BIND data file for local loopback interface ++; ++$TTL 604800 ++@ IN SOA localhost. root.localhost. ( ++ 1 ; Serial ++ 604800 ; Refresh ++ 86400 ; Retry ++ 2419200 ; Expire ++ 604800 ) ; Negative Cache TTL ++; ++@ IN NS localhost. ++@ IN A 127.0.0.1 +diff -urN bind-9.3.1.orig/conf/db.root bind-9.3.1/conf/db.root +--- bind-9.3.1.orig/conf/db.root 1970-01-01 01:00:00.000000000 +0100 ++++ bind-9.3.1/conf/db.root 2005-07-10 22:14:00.000000000 +0200 +@@ -0,0 +1,45 @@ ++ ++; <<>> DiG 9.2.3 <<>> ns . @a.root-servers.net. ++;; global options: printcmd ++;; Got answer: ++;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18944 ++;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13 ++ ++;; QUESTION SECTION: ++;. IN NS ++ ++;; ANSWER SECTION: ++. 518400 IN NS A.ROOT-SERVERS.NET. ++. 518400 IN NS B.ROOT-SERVERS.NET. ++. 518400 IN NS C.ROOT-SERVERS.NET. ++. 518400 IN NS D.ROOT-SERVERS.NET. ++. 518400 IN NS E.ROOT-SERVERS.NET. ++. 518400 IN NS F.ROOT-SERVERS.NET. ++. 518400 IN NS G.ROOT-SERVERS.NET. ++. 518400 IN NS H.ROOT-SERVERS.NET. ++. 518400 IN NS I.ROOT-SERVERS.NET. ++. 518400 IN NS J.ROOT-SERVERS.NET. ++. 518400 IN NS K.ROOT-SERVERS.NET. ++. 518400 IN NS L.ROOT-SERVERS.NET. ++. 518400 IN NS M.ROOT-SERVERS.NET. ++ ++;; ADDITIONAL SECTION: ++A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4 ++B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201 ++C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12 ++D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90 ++E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10 ++F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241 ++G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4 ++H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53 ++I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17 ++J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30 ++K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129 ++L.ROOT-SERVERS.NET. 3600000 IN A 198.32.64.12 ++M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33 ++ ++;; Query time: 81 msec ++;; SERVER: 198.41.0.4#53(a.root-servers.net.) ++;; WHEN: Sun Feb 1 11:27:14 2004 ++;; MSG SIZE rcvd: 436 ++ +diff -urN bind-9.3.1.orig/conf/named.conf bind-9.3.1/conf/named.conf +--- bind-9.3.1.orig/conf/named.conf 1970-01-01 01:00:00.000000000 +0100 ++++ bind-9.3.1/conf/named.conf 2005-07-10 22:33:46.000000000 +0200 +@@ -0,0 +1,49 @@ ++// This is the primary configuration file for the BIND DNS server named. ++// ++// If you are just adding zones, please do that in /etc/bind/named.conf.local ++ ++include "/etc/bind/named.conf.options"; ++ ++// prime the server with knowledge of the root servers ++zone "." { ++ type hint; ++ file "/etc/bind/db.root"; ++}; ++ ++// be authoritative for the localhost forward and reverse zones, and for ++// broadcast zones as per RFC 1912 ++ ++zone "localhost" { ++ type master; ++ file "/etc/bind/db.local"; ++}; ++ ++zone "127.in-addr.arpa" { ++ type master; ++ file "/etc/bind/db.127"; ++}; ++ ++zone "0.in-addr.arpa" { ++ type master; ++ file "/etc/bind/db.0"; ++}; ++ ++zone "255.in-addr.arpa" { ++ type master; ++ file "/etc/bind/db.255"; ++}; ++ ++// zone "com" { type delegation-only; }; ++// zone "net" { type delegation-only; }; ++ ++// From the release notes: ++// Because many of our users are uncomfortable receiving undelegated answers ++// from root or top level domains, other than a few for whom that behaviour ++// has been trusted and expected for quite some length of time, we have now ++// introduced the "root-delegations-only" feature which applies delegation-only ++// logic to all top level domains, and to the root domain. An exception list ++// should be specified, including "MUSEUM" and "DE", and any other top level ++// domains from whom undelegated responses are expected and trusted. ++// root-delegation-only exclude { "DE"; "MUSEUM"; }; ++ ++include "/etc/bind/named.conf.local"; +diff -urN bind-9.3.1.orig/conf/named.conf.local bind-9.3.1/conf/named.conf.local +--- bind-9.3.1.orig/conf/named.conf.local 1970-01-01 01:00:00.000000000 +0100 ++++ bind-9.3.1/conf/named.conf.local 2005-07-10 22:14:06.000000000 +0200 +@@ -0,0 +1,8 @@ ++// ++// Do any local configuration here ++// ++ ++// Consider adding the 1918 zones here, if they are not used in your ++// organization ++//include "/etc/bind/zones.rfc1918"; ++ +diff -urN bind-9.3.1.orig/conf/named.conf.options bind-9.3.1/conf/named.conf.options +--- bind-9.3.1.orig/conf/named.conf.options 1970-01-01 01:00:00.000000000 +0100 ++++ bind-9.3.1/conf/named.conf.options 2005-07-10 22:14:06.000000000 +0200 +@@ -0,0 +1,24 @@ ++options { ++ directory "/var/cache/bind"; ++ ++ // If there is a firewall between you and nameservers you want ++ // to talk to, you might need to uncomment the query-source ++ // directive below. Previous versions of BIND always asked ++ // questions using port 53, but BIND 8.1 and later use an unprivileged ++ // port by default. ++ ++ // query-source address * port 53; ++ ++ // If your ISP provided one or more IP addresses for stable ++ // nameservers, you probably want to use them as forwarders. ++ // Uncomment the following block, and insert the addresses replacing ++ // the all-0's placeholder. ++ ++ // forwarders { ++ // 0.0.0.0; ++ // }; ++ ++ auth-nxdomain no; # conform to RFC1035 ++ ++}; ++ +diff -urN bind-9.3.1.orig/conf/zones.rfc1918 bind-9.3.1/conf/zones.rfc1918 +--- bind-9.3.1.orig/conf/zones.rfc1918 1970-01-01 01:00:00.000000000 +0100 ++++ bind-9.3.1/conf/zones.rfc1918 2005-07-10 22:14:10.000000000 +0200 +@@ -0,0 +1,20 @@ ++zone "10.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++ ++zone "16.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "17.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "18.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "19.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "20.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "21.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "22.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "23.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "24.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "25.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "26.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "27.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "28.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "29.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "30.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++zone "31.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; ++ ++zone "168.192.in-addr.arpa" { type master; file "/etc/bind/db.empty"; }; +diff -urN bind-9.3.1.orig/init.d bind-9.3.1/init.d +--- bind-9.3.1.orig/init.d 1970-01-01 01:00:00.000000000 +0100 ++++ bind-9.3.1/init.d 2005-07-10 23:09:58.000000000 +0200 +@@ -0,0 +1,70 @@ ++#!/bin/sh ++ ++PATH=/sbin:/bin:/usr/sbin:/usr/bin ++ ++# for a chrooted server: "-u bind -t /var/lib/named" ++# Don't modify this line, change or create /etc/default/bind9. ++OPTIONS="" ++ ++test -f /etc/default/bind9 && . /etc/default/bind9 ++ ++test -x /usr/sbin/rndc || exit 0 ++ ++case "$1" in ++ start) ++ echo -n "Starting domain name service: named" ++ ++ modprobe capability >/dev/null 2>&1 || true ++ if [ ! -f /etc/bind/rndc.key ]; then ++ /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom ++ chmod 0640 /etc/bind/rndc.key ++ fi ++ if [ -f /var/run/named/named.pid ]; then ++ ps `cat /var/run/named/named.pid` > /dev/null && exit 1 ++ fi ++ ++ # dirs under /var/run can go away on reboots. ++ mkdir -p /var/run/named ++ mkdir -p /var/cache/bind ++ chmod 775 /var/run/named ++ chown root:bind /var/run/named >/dev/null 2>&1 || true ++ ++ if [ ! -x /usr/sbin/named ]; then ++ echo "named binary missing - not starting" ++ exit 1 ++ fi ++ if start-stop-daemon --start --quiet --exec /usr/sbin/named \ ++ --pidfile /var/run/named/named.pid -- $OPTIONS; then ++ if [ -x /sbin/resolvconf ] ; then ++ echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo ++ fi ++ fi ++ echo "." ++ ;; ++ ++ stop) ++ echo -n "Stopping domain name service: named" ++ if [ -x /sbin/resolvconf ]; then ++ /sbin/resolvconf -d lo ++ fi ++ /usr/sbin/rndc stop >/dev/null 2>&1 ++ echo "." ++ ;; ++ ++ reload) ++ /usr/sbin/rndc reload ++ ;; ++ ++ restart|force-reload) ++ $0 stop ++ sleep 2 ++ $0 start ++ ;; ++ ++ *) ++ echo "Usage: /etc/init.d/bind {start|stop|reload|restart|force-reload}" >&2 ++ exit 1 ++ ;; ++esac ++ ++exit 0 diff --git a/meta-openeuler/recipes-core/bind/bind/generate-rndc-key.sh b/meta-openeuler/recipes-core/bind/bind/generate-rndc-key.sh new file mode 100644 index 0000000000000000000000000000000000000000..633e29c0e6157f465f22b0c9577b7813ccc6b6b1 --- /dev/null +++ b/meta-openeuler/recipes-core/bind/bind/generate-rndc-key.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ ! -s /etc/bind/rndc.key ]; then + echo -n "Generating /etc/bind/rndc.key:" + /usr/sbin/rndc-confgen -a -b 512 + chown root:bind /etc/bind/rndc.key + chmod 0640 /etc/bind/rndc.key +fi diff --git a/meta-openeuler/recipes-core/bind/bind/named.service b/meta-openeuler/recipes-core/bind/bind/named.service new file mode 100644 index 0000000000000000000000000000000000000000..cda56ef0150c3ecffa65ef212de3ee622fbc8e51 --- /dev/null +++ b/meta-openeuler/recipes-core/bind/bind/named.service @@ -0,0 +1,22 @@ +[Unit] +Description=Berkeley Internet Name Domain (DNS) +Wants=nss-lookup.target +Before=nss-lookup.target +After=network.target + +[Service] +Type=forking +EnvironmentFile=-/etc/default/bind9 +PIDFile=/run/named/named.pid + +ExecStartPre=@SBINDIR@/generate-rndc-key.sh +ExecStart=@SBINDIR@/named $OPTIONS + +ExecReload=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc reload > /dev/null 2>&1 || @BASE_BINDIR@/kill -HUP $MAINPID' + +ExecStop=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc stop > /dev/null 2>&1 || @BASE_BINDIR@/kill -TERM $MAINPID' + +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/meta-openeuler/recipes-core/bind/bind_9.11.14.bb b/meta-openeuler/recipes-core/bind/bind_9.11.14.bb new file mode 100644 index 0000000000000000000000000000000000000000..8b336ef74832ccf2712a1b8c3d85c4ddf028d05f --- /dev/null +++ b/meta-openeuler/recipes-core/bind/bind_9.11.14.bb @@ -0,0 +1,132 @@ +SUMMARY = "ISC Internet Domain Name Server" +HOMEPAGE = "https://www.isc.org/bind/" +DESCRIPTION = "BIND 9 provides a full-featured Domain Name Server system" +SECTION = "console/network" + +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8f17f64e47e83b60cd920a1e4b54419e" + +DEPENDS = "openssl libcap zlib" + +SRC_URI = "file://dhcp/dhcp-4.4.2.tar.gz \ + file://0001-revert-d10fbdec-for-lib-dns-gen.c-as-it-is-a-build-p.patch \ + file://conf.patch \ + file://named.service \ + file://bind9 \ + file://generate-rndc-key.sh \ + " + +SRC_URI[sha256sum] = "1a7ccd64a16e5e68f7b5e0f527fd07240a2892ea53fe245620f4f5f607004521" + +UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/" +# stay at 9.16 follow the ESV versions divisible by 4 +UPSTREAM_CHECK_REGEX = "(?P9.(16|20|24|28)(\.\d+)+(-P\d+)*)/" + +inherit autotools systemd pkgconfig multilib_header + +# PACKAGECONFIGs readline and libedit should NOT be set at same time +PACKAGECONFIG ?= "readline" +PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2" +PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline" +PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit" +PACKAGECONFIG[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,," +PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native," + +EXTRA_OECONF = " --with-libtool --disable-devpoll --enable-epoll \ + --with-gssapi=no --with-lmdb=no --with-zlib \ + --with-ecdsa=yes --with-eddsa=no --with-gost=no \ + --sysconfdir=${sysconfdir}/bind \ + --with-openssl=${STAGING_DIR_HOST}${prefix} \ + " +LDFLAGS_append = " -lz" + +inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)} + +# dhcp needs .la so keep them +REMOVE_LIBTOOL_LA = "0" + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \ + --user-group bind" + +INITSCRIPT_NAME = "bind" +INITSCRIPT_PARAMS = "defaults" + +SYSTEMD_SERVICE_${PN} = "named.service" + +do_unpak () { + cd ${WORKDIR} + tar -xf dhcp-4.4.2/bind/bind.tar.gz +} + +addtask unpak after do_unpack before do_patch + +do_install_append() { + + rmdir "${D}${localstatedir}/run" + rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" + install -d bind "${D}${localstatedir}/cache/bind" + install -d "${D}${sysconfdir}/bind" + install -d "${D}${sysconfdir}/init.d" + install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/" + install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind" + if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then + sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \ + ${D}${sbindir}/dnssec-coverage \ + ${D}${sbindir}/dnssec-checkds \ + ${D}${sbindir}/dnssec-keymgr + fi + + # Install systemd related files + install -d ${D}${sbindir} + install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir} + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system + sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ + -e 's,@SBINDIR@,${sbindir},g' \ + ${D}${systemd_unitdir}/system/named.service + + install -d ${D}${sysconfdir}/default + install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/tmpfiles.d + echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf + fi + + oe_multilib_header isc/platform.h +} + +CONFFILES_${PN} = " \ + ${sysconfdir}/bind/named.conf \ + ${sysconfdir}/bind/named.conf.local \ + ${sysconfdir}/bind/named.conf.options \ + ${sysconfdir}/bind/db.0 \ + ${sysconfdir}/bind/db.127 \ + ${sysconfdir}/bind/db.empty \ + ${sysconfdir}/bind/db.local \ + ${sysconfdir}/bind/db.root \ + " + +ALTERNATIVE_${PN}-utils = "nslookup" +ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup" +ALTERNATIVE_PRIORITY = "100" + +PACKAGE_BEFORE_PN += "${PN}-utils" +FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate" +FILES_${PN}-dev += "${bindir}/isc-config.h" +FILES_${PN} += "${sbindir}/generate-rndc-key.sh" + +PACKAGE_BEFORE_PN += "${PN}-libs" +# special arrangement below due to +# https://github.com/isc-projects/bind9/commit/0e25af628cd776f98c04fc4cc59048f5448f6c88 +FILES_SOLIBSDEV = "${libdir}/*[!0-9].so ${libdir}/libbind9.so" +FILES_${PN}-libs = "${libdir}/named/*.so* ${libdir}/*-${PV}.so" +FILES_${PN}-staticdev += "${libdir}/*.la" + +PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}" +FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \ + ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}" + +RDEPENDS_${PN}-dev = "" +RDEPENDS_python3-bind = "python3-core python3-ply" diff --git a/meta-openeuler/recipes-core/dhcp/dhcp.inc b/meta-openeuler/recipes-core/dhcp/dhcp.inc new file mode 100644 index 0000000000000000000000000000000000000000..21e1edc4ebc8bbc2890b29529aee6ac2738ca88c --- /dev/null +++ b/meta-openeuler/recipes-core/dhcp/dhcp.inc @@ -0,0 +1,184 @@ +SECTION = "console/network" +SUMMARY = "Internet Software Consortium DHCP package" +DESCRIPTION = "DHCP (Dynamic Host Configuration Protocol) is a protocol \ +which allows individual devices on an IP network to get their own \ +network configuration information from a server. DHCP helps make it \ +easier to administer devices." + +HOMEPAGE = "http://www.isc.org/" + +LICENSE = "ISC" +LIC_FILES_CHKSUM = "file://LICENSE;md5=b9c6e660b3d9260de9a342d2fb77540a" + +SRC_URI = "file://dhcp/${BP}.tar.gz \ + file://dhcp/backport-0001-change-bug-url.patch \ + file://dhcp/backport-0002-additional-dhclient-options.patch \ + file://dhcp/backport-0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch \ + file://dhcp/backport-0004-Support-unicast-BOOTP-for-IBM-pSeries-systems-and-ma.patch \ + file://dhcp/backport-0005-Change-default-requested-options.patch \ + file://dhcp/backport-0006-Various-man-page-only-fixes.patch \ + file://dhcp/backport-0007-Change-paths-to-conform-to-our-standards.patch \ + file://dhcp/backport-0008-Make-sure-all-open-file-descriptors-are-closed-on-ex.patch \ + file://dhcp/backport-0009-Fix-garbage-in-format-string-error.patch \ + file://dhcp/backport-0010-Handle-null-timeout.patch \ + file://dhcp/backport-0011-Drop-unnecessary-capabilities.patch \ + file://dhcp/backport-0012-RFC-3442-Classless-Static-Route-Option-for-DHCPv4-51.patch \ + file://dhcp/backport-0013-DHCPv6-over-PPP-support-626514.patch \ + file://dhcp/backport-0014-IPoIB-support-660681.patch \ + file://dhcp/backport-0015-Add-GUID-DUID-to-dhcpd-logs-1064416.patch \ + file://dhcp/backport-0016-Turn-on-creating-sending-of-DUID.patch \ + file://dhcp/backport-0017-Send-unicast-request-release-via-correct-interface.patch \ + file://dhcp/backport-0018-No-subnet-declaration-for-iface-should-be-info-not-e.patch \ + file://dhcp/backport-0019-dhclient-write-DUID_LLT-even-in-stateless-mode-11563.patch \ + file://dhcp/backport-0020-Discover-all-hwaddress-for-xid-uniqueness.patch \ + file://dhcp/backport-0021-Load-leases-DB-in-non-replay-mode-only.patch \ + file://dhcp/backport-0022-dhclient-make-sure-link-local-address-is-ready-in-st.patch \ + file://dhcp/backport-0023-option-97-pxe-client-id.patch \ + file://dhcp/backport-0025-bind-Detect-system-time-changes.patch \ + file://dhcp/backport-0026-Add-dhclient-5-B-option-description.patch \ + file://dhcp/backport-0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch \ + file://dhcp/bugfix-dhcp-4.2.5-check-dhclient-pid.patch \ + file://dhcp/bugfix-reduce-getifaddr-calls.patch \ + file://dhcp/bugfix-dhcpd-2038-problem.patch \ + file://dhcp/dhcpd-coredump-infiniband.patch \ + file://dhcp/bugfix-dhclient-check-if-pid-was-held.patch \ + file://dhcp/bugfix-dhcp-64-bit-lease-parse.patch \ + file://dhcp/backport-CVE-2021-25217.patch \ + file://dhcp/fix-multiple-definition-with-gcc-10-1.patch \ + file://dhcp/fix-multiple-definition-with-gcc-10-2.patch \ + file://0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch \ + file://0013-fixup_use_libbind.patch \ + file://init-server file://default-server \ + file://dhclient.conf file://dhcpd.conf \ + " + +SRC_URI[sha256sum] = "1a7ccd64a16e5e68f7b5e0f527fd07240a2892ea53fe245620f4f5f607004521" +DEPENDS = "openssl bind" + +UPSTREAM_CHECK_URI = "http://ftp.isc.org/isc/dhcp/" +UPSTREAM_CHECK_REGEX = "(?P\d+\.\d+\.(\d+?))/" + +inherit autotools-brokensep systemd + +USERADD_PACKAGES = "${PN}-server" +USERADD_PARAM_${PN}-server = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}" + +SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay ${PN}-client" +#SYSTEMD_SERVICE_${PN}-server = "dhcpd.service dhcpd6.service" +#SYSTEMD_AUTO_ENABLE_${PN}-server = "disable" + +#SYSTEMD_SERVICE_${PN}-relay = "dhcrelay.service" +#SYSTEMD_AUTO_ENABLE_${PN}-relay = "disable" + +#SYSTEMD_SERVICE_${PN}-client = "dhclient.service" +#SYSTEMD_AUTO_ENABLE_${PN}-client = "disable" + +INITSCRIPT_PACKAGES = "dhcp-server" +INITSCRIPT_NAME_dhcp-server = "dhcp-server" +INITSCRIPT_PARAMS_dhcp-server = "defaults" + +TARGET_CFLAGS += "-D_GNU_SOURCE" +TARGET_CFLAGS += "-fcommon" +EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \ + --with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \ + --with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \ + --with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases \ + --enable-paranoia --enable-static=yes --enable-shared=yes \ + --with-randomdev=/dev/random \ + --with-libbind=${STAGING_DIR_HOST} \ + --enable-libtool \ + " + +do_unpak() { + cd ${WORKDIR}/${BP}/bind + tar -xf bind.tar.gz + mv bind-9.11.14/ bind +} + +addtask unpak after do_unpack before do_patch + +#Enable shared libs per dhcp README +do_configure_prepend () { + cp configure.ac+lt configure.ac +} + +do_install_append () { + install -d ${D}${sysconfdir}/init.d + install -d ${D}${sysconfdir}/default + install -d ${D}${sysconfdir}/dhcp + install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server + install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server + + rm -f ${D}${sysconfdir}/dhclient.conf* + rm -f ${D}${sysconfdir}/dhcpd.conf* + install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf + install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf + + install -d ${D}${base_sbindir}/ + if [ "${sbindir}" != "${base_sbindir}" ]; then + mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/ + fi + install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script + #delete extra rpath + for dhcpFile in $(find ${D} -type f) + do + file ${dhcpFile} | grep ELF || continue + readelf -a ${dhcpFile} | grep rpath || continue + ${RPATH_DELETE} ${dhcpFile} + done +} + +PACKAGES += "dhcp-libs dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell" + +FILES_${PN} = "${base_sbindir}/dhclient \ + ${base_sbindir}/dhclient-script \ + ${sysconfdir}/dhcp/dhclient.conf \ + ${bindir}/omshell \ + ${sbindir}/dhcrelay \ + " +RDEPENDS_${PN}-dev = "" +RDEPENDS_${PN}-staticdev = "" +FILES_${PN}-libs = "${libdir}/libdhcpctl.so.0* ${libdir}/libomapi.so.0* ${libdir}/libdhcp.so.0*" + +FILES_${PN}-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server" +RRECOMMENDS_${PN}-server = "dhcp-server-config" + +FILES_${PN}-server-config = "${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf" + +FILES_${PN}-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay" + +FILES_${PN}-client = "${base_sbindir}/dhclient \ + ${base_sbindir}/dhclient-script \ + ${sysconfdir}/dhcp/dhclient.conf \ + ${base_sbindir}/dhclient-systemd-wrapper \ + " + +FILES_${PN}-omshell = "${bindir}/omshell" + +pkg_postinst_dhcp-server() { + mkdir -p $D/${localstatedir}/lib/dhcp + touch $D/${localstatedir}/lib/dhcp/dhcpd.leases + touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases +} + +pkg_postinst_dhcp-client() { + mkdir -p $D/${localstatedir}/lib/dhcp +} + +pkg_postrm_dhcp-server() { + rm -f $D/${localstatedir}/lib/dhcp/dhcpd.leases + rm -f $D/${localstatedir}/lib/dhcp/dhcpd6.leases + + if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then + echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty." + fi +} + +pkg_postrm_dhcp-client() { + rm -f $D/${localstatedir}/lib/dhcp/dhclient.leases + rm -f $D/${localstatedir}/lib/dhcp/dhclient6.leases + + if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then + echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty." + fi +} diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch b/meta-openeuler/recipes-core/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch new file mode 100644 index 0000000000000000000000000000000000000000..feb0754fff480805543e4169975c59da4a9d1bda --- /dev/null +++ b/meta-openeuler/recipes-core/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch @@ -0,0 +1,62 @@ +From 7107511fd209f08f9a96f8938041ae48f3295895 Mon Sep 17 00:00:00 2001 +From: Christopher Larson +Date: Tue, 15 Aug 2017 16:17:49 +0800 +Subject: [PATCH 07/11] Add configure argument to make the libxml2 dependency + explicit and determinisitic. + +Upstream-Status: Pending + +Signed-off-by: Christopher Larson + +Rebase to 4.3.6 + +Signed-off-by: Hongxu Jia +--- + configure.ac | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +Index: dhcp-4.4.1/configure.ac +=================================================================== +--- dhcp-4.4.1.orig/configure.ac ++++ dhcp-4.4.1/configure.ac +@@ -642,6 +642,17 @@ if test "$have_nanosleep" = "rt"; then + LIBS="-lrt $LIBS" + fi + ++AC_ARG_WITH(libxml2, ++ AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]), ++ with_libxml2="$withval", with_libxml2="no") ++ ++if test x$with_libxml2 != xno; then ++ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2], ++ [if test x$with_libxml2 != xauto; then ++ AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested]) ++ fi]) ++fi ++ + # check for /dev/random (declares HAVE_DEV_RANDOM) + AC_MSG_CHECKING(for random device) + AC_ARG_WITH(randomdev, +Index: dhcp-4.4.1/configure.ac+lt +=================================================================== +--- dhcp-4.4.1.orig/configure.ac+lt ++++ dhcp-4.4.1/configure.ac+lt +@@ -909,6 +909,18 @@ elif test "$want_libtool" = "yes" -a "$u + fi + AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes") + ++AC_ARG_WITH(libxml2, ++ AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]), ++ with_libxml2="$withval", with_libxml2="no") ++ ++if test x$with_libxml2 != xno; then ++ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],, ++ [if test x$with_libxml2 != xauto; then ++ AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested]) ++ fi]) ++fi ++ ++ + # OpenLDAP support. + AC_ARG_WITH(ldap, + AS_HELP_STRING([--with-ldap],[enable OpenLDAP support in dhcpd (default is no)]), diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/0013-fixup_use_libbind.patch b/meta-openeuler/recipes-core/dhcp/dhcp/0013-fixup_use_libbind.patch new file mode 100644 index 0000000000000000000000000000000000000000..fcec010bd01fae0695c7a159319731e34a32f517 --- /dev/null +++ b/meta-openeuler/recipes-core/dhcp/dhcp/0013-fixup_use_libbind.patch @@ -0,0 +1,64 @@ +lib and include path is hardcoded for use_libbind + +use libdir and includedir vars + +Upstream-Status: Pending +Signed-off-by: Armin Kuster + +Index: dhcp-4.4.1/configure.ac+lt +=================================================================== +--- dhcp-4.4.1.orig/configure.ac+lt ++++ dhcp-4.4.1/configure.ac+lt +@@ -801,22 +801,22 @@ no) + if test ! -d "$use_libbind"; then + AC_MSG_ERROR([Cannot find bind directory at $use_libbind]) + fi +- if test ! -d "$use_libbind/include" -o \ +- ! -f "$use_libbind/include/isc/buffer.h" ++ if test ! -d "$use_libbind/$includedir" -o \ ++ ! -f "$use_libbind/$includedir/isc/buffer.h" + then +- AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include]) ++ AC_MSG_ERROR([Cannot find bind includes at $use_libbind/$includedir]) + fi +- if test ! -d "$use_libbind/lib" -o \ +- \( ! -f "$use_libbind/lib/libisc.a" -a \ +- ! -f "$use_libbind/lib/libisc.la" \) ++ if test ! -d "$use_libbind/$libdir" -o \ ++ \( ! -f "$use_libbind/$libdir/libisc.a" -a \ ++ ! -f "$use_libbind/$libdir/libisc.la" \) + then +- AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib]) ++ AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/$libdir]) + fi + BINDDIR="$use_libbind" +- BINDLIBIRSDIR="$BINDDIR/lib" +- BINDLIBDNSDIR="$BINDDIR/lib" +- BINDLIBISCCFGDIR="$BINDDIR/lib" +- BINDLIBISCDIR="$BINDDIR/lib" ++ BINDLIBIRSDIR="$BINDDIR/$libdir" ++ BINDLIBDNSDIR="$BINDDIR/$libdir" ++ BINDLIBISCCFGDIR="$BINDDIR/$libdir" ++ BINDLIBISCDIR="$BINDDIR/$libdir" + DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind" + ;; + esac +@@ -856,14 +856,14 @@ AC_ARG_ENABLE(libtool, + + if test "$use_libbind" != "no"; then + if test "$want_libtool" = "yes" -a \ +- ! -f "$use_libbind/lib/libisc.la" ++ ! -f "$use_libbind/$libdir/libisc.la" + then +- AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib]) ++ AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/$libdir]) + fi + if test "$want_libtool" = "no" -a \ +- ! -f "$use_libbind/lib/libisc.a" ++ ! -f "$use_libbind/$libdir/libisc.a" + then +- AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib]) ++ AC_MSG_ERROR([Cannot find static libraries at $use_libbind/$libdir]) + fi + fi + diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/default-server b/meta-openeuler/recipes-core/dhcp/dhcp/default-server new file mode 100644 index 0000000000000000000000000000000000000000..0385d169922cf68e3db45347db7d44371b93380a --- /dev/null +++ b/meta-openeuler/recipes-core/dhcp/dhcp/default-server @@ -0,0 +1,7 @@ +# Defaults for dhcp initscript +# sourced by /etc/init.d/dhcp-server +# installed at /etc/default/dhcp-server by the maintainer scripts + +# On what interfaces should the DHCP server (dhcpd) serve DHCP requests? +# Separate multiple interfaces with spaces, e.g. "eth0 eth1". +INTERFACES="" diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/dhclient.conf b/meta-openeuler/recipes-core/dhcp/dhcp/dhclient.conf new file mode 100644 index 0000000000000000000000000000000000000000..0e6dcf96c218ee7d6a7eec85c3be3c59bf9dcd6c --- /dev/null +++ b/meta-openeuler/recipes-core/dhcp/dhcp/dhclient.conf @@ -0,0 +1,50 @@ +# Configuration file for /sbin/dhclient, which is included in Debian's +# dhcp3-client package. +# +# This is a sample configuration file for dhclient. See dhclient.conf's +# man page for more information about the syntax of this file +# and a more comprehensive list of the parameters understood by +# dhclient. +# +# Normally, if the DHCP server provides reasonable information and does +# not leave anything out (like the domain name, for example), then +# few changes must be made to this file, if any. +# + +#send host-name "andare.fugue.com"; +#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c; +#send dhcp-lease-time 3600; +#supersede domain-name "fugue.com home.vix.com"; +#prepend domain-name-servers 127.0.0.1; +request subnet-mask, broadcast-address, time-offset, routers, + domain-name, domain-name-servers, host-name, + netbios-name-servers, netbios-scope; +#require subnet-mask, domain-name-servers; +#timeout 60; +#retry 60; +#reboot 10; +#select-timeout 5; +#initial-interval 2; +#script "/etc/dhcp3/dhclient-script"; +#media "-link0 -link1 -link2", "link0 link1"; +#reject 192.33.137.209; + +#alias { +# interface "eth0"; +# fixed-address 192.5.5.213; +# option subnet-mask 255.255.255.255; +#} + +#lease { +# interface "eth0"; +# fixed-address 192.33.137.200; +# medium "link0 link1"; +# option host-name "andare.swiftmedia.com"; +# option subnet-mask 255.255.255.0; +# option broadcast-address 192.33.137.255; +# option routers 192.33.137.250; +# option domain-name-servers 127.0.0.1; +# renew 2 2000/1/12 00:00:01; +# rebind 2 2000/1/12 00:00:01; +# expire 2 2000/1/12 00:00:01; +#} diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/dhcpd.conf b/meta-openeuler/recipes-core/dhcp/dhcp/dhcpd.conf new file mode 100644 index 0000000000000000000000000000000000000000..0001c0f00e206ce7a6a3946e98b9ff71635c99c1 --- /dev/null +++ b/meta-openeuler/recipes-core/dhcp/dhcp/dhcpd.conf @@ -0,0 +1,108 @@ +# +# Sample configuration file for ISC dhcpd for Debian +# +# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $ +# + +# The ddns-updates-style parameter controls whether or not the server will +# attempt to do a DNS update when a lease is confirmed. We default to the +# behavior of the version 2 packages ('none', since DHCP v2 didn't +# have support for DDNS.) +ddns-update-style none; + +# option definitions common to all supported networks... +option domain-name "example.org"; +option domain-name-servers ns1.example.org, ns2.example.org; + +default-lease-time 600; +max-lease-time 7200; + +# If this DHCP server is the official DHCP server for the local +# network, the authoritative directive should be uncommented. +#authoritative; + +# Use this to send dhcp log messages to a different log file (you also +# have to hack syslog.conf to complete the redirection). +log-facility local7; + +# No service will be given on this subnet, but declaring it helps the +# DHCP server to understand the network topology. + +#subnet 10.152.187.0 netmask 255.255.255.0 { +#} + +# This is a very basic subnet declaration. + +#subnet 10.254.239.0 netmask 255.255.255.224 { +# range 10.254.239.10 10.254.239.20; +# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; +#} + +# This declaration allows BOOTP clients to get dynamic addresses, +# which we don't really recommend. + +#subnet 10.254.239.32 netmask 255.255.255.224 { +# range dynamic-bootp 10.254.239.40 10.254.239.60; +# option broadcast-address 10.254.239.31; +# option routers rtr-239-32-1.example.org; +#} + +# A slightly different configuration for an internal subnet. +#subnet 10.5.5.0 netmask 255.255.255.224 { +# range 10.5.5.26 10.5.5.30; +# option domain-name-servers ns1.internal.example.org; +# option domain-name "internal.example.org"; +# option routers 10.5.5.1; +# option broadcast-address 10.5.5.31; +# default-lease-time 600; +# max-lease-time 7200; +#} + +# Hosts which require special configuration options can be listed in +# host statements. If no address is specified, the address will be +# allocated dynamically (if possible), but the host-specific information +# will still come from the host declaration. + +#host passacaglia { +# hardware ethernet 0:0:c0:5d:bd:95; +# filename "vmunix.passacaglia"; +# server-name "toccata.fugue.com"; +#} + +# Fixed IP addresses can also be specified for hosts. These addresses +# should not also be listed as being available for dynamic assignment. +# Hosts for which fixed IP addresses have been specified can boot using +# BOOTP or DHCP. Hosts for which no fixed address is specified can only +# be booted with DHCP, unless there is an address range on the subnet +# to which a BOOTP client is connected which has the dynamic-bootp flag +# set. +#host fantasia { +# hardware ethernet 08:00:07:26:c0:a5; +# fixed-address fantasia.fugue.com; +#} + +# You can declare a class of clients and then do address allocation +# based on that. The example below shows a case where all clients +# in a certain class get addresses on the 10.17.224/24 subnet, and all +# other clients get addresses on the 10.0.29/24 subnet. + +#class "foo" { +# match if substring (option vendor-class-identifier, 0, 4) = "SUNW"; +#} + +#shared-network 224-29 { +# subnet 10.17.224.0 netmask 255.255.255.0 { +# option routers rtr-224.example.org; +# } +# subnet 10.0.29.0 netmask 255.255.255.0 { +# option routers rtr-29.example.org; +# } +# pool { +# allow members of "foo"; +# range 10.17.224.10 10.17.224.250; +# } +# pool { +# deny members of "foo"; +# range 10.0.29.10 10.0.29.230; +# } +#} diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/init-server b/meta-openeuler/recipes-core/dhcp/dhcp/init-server new file mode 100644 index 0000000000000000000000000000000000000000..5e693adf78559215654fd923c7bfcc8332d9dc4f --- /dev/null +++ b/meta-openeuler/recipes-core/dhcp/dhcp/init-server @@ -0,0 +1,44 @@ +#!/bin/sh +# +# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $ +# + +test -f /usr/sbin/dhcpd || exit 0 + +# It is not safe to start if we don't have a default configuration... +if [ ! -f /etc/default/dhcp-server ]; then + echo "/etc/default/dhcp-server does not exist! - Aborting..." + exit 0 +fi + +# Read init script configuration (so far only interfaces the daemon +# should listen on.) +. /etc/default/dhcp-server + +case "$1" in + start) + echo -n "Starting DHCP server: " + test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/ + test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases + start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES -user dhcp -group dhcp + echo "." + ;; + stop) + echo -n "Stopping DHCP server: dhcpd3" + start-stop-daemon -K -x /usr/sbin/dhcpd + echo "." + ;; + restart | force-reload) + $0 stop + sleep 2 + $0 start + if [ "$?" != "0" ]; then + exit 1 + fi + ;; + *) + echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}" + exit 1 +esac + +exit 0 diff --git a/meta-openeuler/recipes-core/dhcp/dhcp_4.4.2.bb b/meta-openeuler/recipes-core/dhcp/dhcp_4.4.2.bb new file mode 100644 index 0000000000000000000000000000000000000000..3ae90b51127c95f3ff134c38e74b58db17721846 --- /dev/null +++ b/meta-openeuler/recipes-core/dhcp/dhcp_4.4.2.bb @@ -0,0 +1,8 @@ +require dhcp.inc + +COMPONENT = "isc dhcp" + +LDFLAGS_append = " -pthread" + +PACKAGECONFIG ?= "" +PACKAGECONFIG[bind-httpstats] = "--with-libxml2,--without-libxml2,libxml2" diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common new file mode 100644 index 0000000000000000000000000000000000000000..0d7c5fa3f8cec69e67d217775b04fe56d2da20e8 --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common @@ -0,0 +1,3 @@ +[properties] +# On all known supported architectures the stack grows down +growing_stack = false diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc new file mode 100644 index 0000000000000000000000000000000000000000..c4648f58c78d5400e0052b2047d0f8e7fdb852b6 --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc @@ -0,0 +1,5 @@ +[properties] +have_c99_vsnprintf = true +have_c99_snprintf = true +have_unix98_printf = true +va_val_copy = true diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux new file mode 100644 index 0000000000000000000000000000000000000000..adad7e62eeb9e8d0f245ba319a9136cb28a3157c --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux @@ -0,0 +1,5 @@ +[properties] +have_proc_self_cmdline = true + +[binaries] +env = '/usr/bin/env' diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw new file mode 100644 index 0000000000000000000000000000000000000000..75f911ba1edcd498e2ce531bd3c5a9e93f1e91aa --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw @@ -0,0 +1,6 @@ +[properties] +have_c99_vsnprintf = false +have_c99_snprintf = false +have_unix98_printf = false +va_val_copy = true +have_proc_self_cmdline = false diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl new file mode 100644 index 0000000000000000000000000000000000000000..3049e5116ece7292fa550c29746aba88810b5ea9 --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl @@ -0,0 +1,6 @@ +[properties] +have_c99_vsnprintf = true +have_c99_snprintf = true +have_unix98_printf = true +va_val_copy = true +have_strlcpy = true diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/run-ptest b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/run-ptest new file mode 100644 index 0000000000000000000000000000000000000000..7a231b514b423467f7684772a8f83e2de2b085f9 --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/run-ptest @@ -0,0 +1,9 @@ +#! /bin/sh + +set -eux +if id -u glib2-test; then + userdel glib2-test +fi +useradd glib2-test +su glib2-test -c 'gnome-desktop-testing-runner glib' +userdel glib2-test diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0_2.68.1.bb b/meta-openeuler/recipes-core/glib-2.0/glib-2.0_2.68.1.bb new file mode 100644 index 0000000000000000000000000000000000000000..49ac75de97e85f5fa099f579f05227b9c5ff8fd8 --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/glib-2.0_2.68.1.bb @@ -0,0 +1,40 @@ +require glib.inc + +SRC_URI = "file://glib2/glib-${PV}.tar.xz \ + file://glib2/backport-correctly-use-3-parameters-for-clise-range.patch \ + file://glib2/backport-fix-a-memory-leak.patch \ + file://run-ptest \ +" + +SRC_URI[sha256sum] = "241654b96bd36b88aaa12814efc4843b578e55d47440103727959ac346944333" + +# Find any meson cross files in FILESPATH that are relevant for the current +# build (using siteinfo) and add them to EXTRA_OEMESON. +inherit siteinfo +def find_meson_cross_files(d): + if bb.data.inherits_class('native', d): + return "" + + thisdir = os.path.normpath(d.getVar("THISDIR")) + import collections + sitedata = siteinfo_data(d) + # filename -> found + files = collections.OrderedDict() + for path in d.getVar("FILESPATH").split(":"): + for element in sitedata: + filename = os.path.normpath(os.path.join(path, "meson.cross.d", element)) + sanitized_path = filename.replace(thisdir, "${THISDIR}") + if sanitized_path == filename: + if os.path.exists(filename): + bb.error("Cannot add '%s' to --cross-file, because it's not relative to THISDIR '%s' and sstate signature would contain this full path" % (filename, thisdir)) + continue + files[filename.replace(thisdir, "${THISDIR}")] = os.path.exists(filename) + + items = ["--cross-file=" + k for k,v in files.items() if v] + d.appendVar("EXTRA_OEMESON", " " + " ".join(items)) + items = ["%s:%s" % (k, "True" if v else "False") for k,v in files.items()] + d.appendVarFlag("do_configure", "file-checksums", " " + " ".join(items)) + +python () { + find_meson_cross_files(d) +} diff --git a/meta-openeuler/recipes-core/glib-2.0/glib.inc b/meta-openeuler/recipes-core/glib-2.0/glib.inc new file mode 100644 index 0000000000000000000000000000000000000000..1e6aa4566806a1b6378979fa107216c4da963df3 --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/glib.inc @@ -0,0 +1,202 @@ +SUMMARY = "A general-purpose utility library" +DESCRIPTION = "GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on." +HOMEPAGE = "https://developer.gnome.org/glib/" + +# pcre is under BSD; +# docs/reference/COPYING is with a 'public domain'-like license! +LICENSE = "LGPLv2.1+ & BSD & PD" +LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \ + file://glib/glib.h;beginline=4;endline=17;md5=b88abb7f3ad09607e71cb9d530155906 \ + file://gmodule/COPYING;md5=4fbd65380cdd255951079008b364516c \ + file://gmodule/gmodule.h;beginline=4;endline=17;md5=b88abb7f3ad09607e71cb9d530155906 \ + file://glib/pcre/pcre.h;beginline=8;endline=36;md5=3e2977dae4ad05217f58c446237298fc \ + file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc" +BUGTRACKER = "http://bugzilla.gnome.org" +SECTION = "libs" + +CVE_PRODUCT = "glib" + +BBCLASSEXTEND = "native nativesdk" + +DEPENDS = "glib-2.0-native \ + virtual/libintl \ + virtual/libiconv \ + libffi \ + zlib" + +PACKAGES += "${PN}-codegen ${PN}-utils ${PN}-bash-completion" + +LEAD_SONAME = "libglib-2.0.*" + +#inherit meson gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even bash-completion gio-module-cache manpages +inherit meson gettext pkgconfig ptest-gnome upstream-version-is-even gio-module-cache manpages + +DEPENDS_append_class-target = "${@' gtk-doc' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}" + +GTKDOC_MESON_OPTION = "gtk_doc" + +S = "${WORKDIR}/glib-${PV}" + +PACKAGECONFIG ??= "system-pcre libmount \ + ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" +# To use the system pcre it must be configured with --enable-unicode-properties +PACKAGECONFIG[system-pcre] = "-Dinternal_pcre=false,-Dinternal_pcre=true,libpcre" +PACKAGECONFIG[libmount] = "-Dlibmount=enabled,-Dlibmount=disabled,util-linux" +PACKAGECONFIG[manpages] = "-Dman=true, -Dman=false, libxslt-native xmlto-native" +# libelf is auto-detected without a configuration option +PACKAGECONFIG[libelf] = ",,elfutils" +PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false,dbus" + +EXTRA_OEMESON = "-Ddtrace=false -Dfam=false -Dsystemtap=false -Dselinux=disabled" + +do_configure_prepend() { + sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in +} + +FILES_${PN} = "${libdir}/lib*${SOLIBS} \ + ${libdir}/gio \ + ${libexecdir}/*gio-querymodules \ + ${datadir}/glib-2.0/schemas" + +FILES_${PN}-utils += "${bindir}/glib-genmarshal \ + ${bindir}/glib-gettextize \ + ${bindir}/glib-mkenums \ + ${bindir}/glib-compile-resources" + +FILES_${PN}-dev += "${libdir}/glib-2.0/include \ + ${libdir}/gio/modules/lib*${SOLIBSDEV} \ + ${libdir}/gio/modules/*.la \ + ${datadir}/glib-2.0/gettext/po/Makefile.in.in \ + ${datadir}/glib-2.0/schemas/gschema.dtd \ + ${datadir}/glib-2.0/valgrind/glib.supp \ + ${datadir}/gettext/its" +FILES_${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb" +FILES_${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py \ + ${bindir}/gdbus-codegen" +FILES_${PN}-utils = "${bindir}/*" +FILES_${PN}-bash-completion += "${datadir}/bash-completion/completions" + +SHAREDMIMEDEP = "shared-mime-info" +SHAREDMIMEDEP_class-native = "" +# When cross compiling for Windows we don't want to include this +SHAREDMIMEDEP_mingw32 = "" + +#RRECOMMENDS_${PN} += "${SHAREDMIMEDEP}" + +ARM_INSTRUCTION_SET_armv4 = "arm" +ARM_INSTRUCTION_SET_armv5 = "arm" +# Valgrind runtime detection works using hand-written assembly, which +# doesn't support mips16e +CPPFLAGS_append_class-target_mips16e = " -DNVALGRIND=1" + +# GLib generally requires gettext to be present so for USE_NLS to yes. For +# native builds as i18n is disabled globally we have to add a gettext-native dependency. +USE_NLS_class-target = "yes" +USE_NLS_class-nativesdk = "yes" +DEPENDS_append_class-native = " gettext-native" + +EXEEXT = "" +EXEEXT_mingw32 = ".exe" + +do_install_append () { + if [ -f ${D}${bindir}/gtester-report ]; then + sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python3|' + fi + + # Remove some unpackaged files + rm -rf ${D}${datadir}/glib-2.0/codegen/__pycache__ + rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc + rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo + + if [ -e ${D}${libdir}/charset.alias ]; then + rm -f ${D}${libdir}/charset.alias + fi + + # Make sure gio-querymodules is unique among multilibs + if test "x${MLPREFIX}" != "x"; then + mv ${D}${libexecdir}/gio-querymodules${EXEEXT} ${D}${libexecdir}/${MLPREFIX}gio-querymodules${EXEEXT} + fi + # Autotools does this, meson does not + mkdir -p ${D}${libdir}/gio/modules +} + +do_install_append_class-target () { + # Tests are only installed on targets, not native builds. Separating this out + # keeps glib-2.0-native from depending on DISTRO_FEATURES + if [ -f ${D}${datadir}/installed-tests/glib/gdbus-serialization.test ]; then + if ${@bb.utils.contains("DISTRO_FEATURES", "x11", "false", "true", d)}; then + rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test + fi + fi + if [ -f ${D}${datadir}/installed-tests/glib/static-link.test ]; then + if test "x${MLPREFIX}" != "x"; then + mv ${D}${datadir}/installed-tests/glib/static-link.test ${D}${datadir}/installed-tests/glib/${MLPREFIX}static-link.test + fi + fi +} + +# As we do not build python3 for windows, makes no sense to ship the script that's using it +do_install_append_mingw32() { + rm -f ${D}${bindir}/gtester-report +} + +CODEGEN_PYTHON_RDEPENDS = "python3 python3-distutils python3-xml" +CODEGEN_PYTHON_RDEPENDS_mingw32 = "" + +#RDEPENDS_${PN}-codegen += "${CODEGEN_PYTHON_RDEPENDS}" + +RDEPENDS_${PN}-ptest += "${PN}-utils" + +RDEPENDS_${PN}-ptest += "\ + coreutils \ + libgcc \ + dbus \ + gnome-desktop-testing \ + tzdata \ + tzdata-americas \ + tzdata-asia \ + tzdata-europe \ + tzdata-posix \ + shared-mime-info \ + ${PN}-locale-ja \ + ${PN}-locale-fr \ + ${PN}-locale-el \ + ${PN}-locale-hr \ + ${PN}-locale-lt \ + ${PN}-locale-pl \ + ${PN}-locale-ru \ + ${PN}-locale-th \ + python3-core \ + python3-modules \ + ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-dbusmock', '', d)} \ + ${PN}-codegen \ + " + +RDEPENDS_${PN}-ptest_append_libc-glibc = "\ + glibc-gconv-utf-16 \ + glibc-charmap-utf-8 \ + glibc-gconv-cp1255 \ + glibc-charmap-cp1255 \ + glibc-gconv-utf-32 \ + glibc-gconv-utf-7 \ + glibc-gconv-euc-jp \ + glibc-gconv-iso8859-1 \ + glibc-gconv-iso8859-15 \ + glibc-charmap-invariant \ + glibc-localedata-translit-cjk-variants \ + locale-base-tr-tr \ + locale-base-lt-lt \ + locale-base-ja-jp.euc-jp \ + locale-base-fa-ir \ + locale-base-ru-ru \ + locale-base-de-de \ + locale-base-hr-hr \ + locale-base-el-gr \ + locale-base-fr-fr \ + locale-base-es-es \ + locale-base-en-gb \ + locale-base-en-us \ + locale-base-pl-pl \ + locale-base-pl-pl.iso-8859-2 \ + " +DEPENDS_remove += "meson-native glib-2.0-native" diff --git a/meta-openeuler/recipes-core/lvm2/lvm2.inc b/meta-openeuler/recipes-core/lvm2/lvm2.inc new file mode 100644 index 0000000000000000000000000000000000000000..65c5609a242be0834951c0d9a8fae2c3ba292599 --- /dev/null +++ b/meta-openeuler/recipes-core/lvm2/lvm2.inc @@ -0,0 +1,64 @@ +HOMEPAGE = "https://www.sourceware.org/lvm2/" +SECTION = "utils" +DESCRIPTION = "LVM2 is a set of utilities to manage logical volumes in Linux." +LICENSE = "GPLv2 & LGPLv2.1 & BSD" + +LIC_FILES_CHKSUM = "file://COPYING;md5=12713b4d9386533feeb07d6e4831765a \ + file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \ + file://COPYING.BSD;md5=d7e19e89ea9f54c1af1aa83c7b7122e7 \ +" + +SRC_URI = "file://lvm2/LVM2.${PV}.tgz \ + file://lvm2/0001-lvm2-set-default-preferred_names.patch \ + file://lvm2/0002-lvm2-default-allow-changes-with-duplicate-pvs.patch \ + file://lvm2/0003-devs-check-for-no-dev-when-dropping-aliases.patch \ + file://lvm2/0004-bugfix-lvm2-add-SSD.patch \ + file://lvm2/0005-bugfix-add-timeout-when-fail-to-wait-udev.patch \ + file://lvm2/0006-bugfix-fix-the-code-maybe-lead-to-buffer-over-bound-access.patch \ + file://lvm2/0007-enhancement-modify-default-log-level-to-error-level.patch \ + file://lvm2/0008-enhancement-add-dfx-log.patch \ + file://lvm2/0009-enhancement-syslog-more-when-use-libdevmapper-so.patch \ + file://lvm2/0010-enhancement-log-it-when-disk-slow.patch \ + file://lvm2/0011-bugfix-lvm2-fix-the-reuse-of-va_list.patch \ +" + +SRC_URI[sha256sum] = "4a63bc8a084a8ae3c7bc5e6530cac264139d218575c64416c8b99e3fe039a05c" +DEPENDS += "util-linux libaio" + +S = "${WORKDIR}/LVM2.${PV}" + +inherit autotools-brokensep pkgconfig systemd license + +LVM2_PACKAGECONFIG = "dmeventd" +LVM2_PACKAGECONFIG_append_class-target = " \ + ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'udev', '', d)} \ +" + +# odirect is always enabled because there currently is a bug in +# lib/device/dev-io.c which prevents compiling without it. It is +# better to stick to configurations that were actually tested by +# upstream... +PACKAGECONFIG ??= "odirect ${LVM2_PACKAGECONFIG}" + +PACKAGECONFIG[dmeventd] = "--enable-dmeventd,--disable-dmeventd" +PACKAGECONFIG[odirect] = "--enable-o_direct,--disable-o_direct" +PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline" +PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux" +PACKAGECONFIG[udev] = "--enable-udev_sync --enable-udev_rules --with-udevdir=${nonarch_base_libdir}/udev/rules.d,--disable-udev_sync --disable-udev_rules,udev" + +# Unset user/group to unbreak install. +EXTRA_OECONF = "--with-user= \ + --with-group= \ + --enable-realtime \ + --enable-cmdlib \ + --enable-pkgconfig \ + --with-usrlibdir=${libdir} \ + --with-systemdsystemunitdir=${systemd_system_unitdir} \ + --disable-thin_check_needs_check \ + --with-thin-check=${sbindir}/thin_check \ + --with-thin-dump=${sbindir}/thin_dump \ + --with-thin-repair=${sbindir}/thin_repair \ + --with-thin-restore=${sbindir}/thin_restore \ +" + diff --git a/meta-openeuler/recipes-core/lvm2/lvm2_2.03.14.bb b/meta-openeuler/recipes-core/lvm2/lvm2_2.03.14.bb new file mode 100644 index 0000000000000000000000000000000000000000..a1b6e54abe660830966eddf326a50d0e554cf053 --- /dev/null +++ b/meta-openeuler/recipes-core/lvm2/lvm2_2.03.14.bb @@ -0,0 +1,53 @@ +require lvm2.inc + +DEPENDS += "autoconf-archive-native" + +MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf" + +CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe" + +do_install_append() { + # Install machine specific configuration file + install -d ${D}${sysconfdir}/lvm + sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + oe_runmake 'DESTDIR=${D}' install install_systemd_units + sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service + else + oe_runmake 'DESTDIR=${D}' install install_initscripts + mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d + rm -rf ${D}${sysconfdir}/rc.d + fi +} + +PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules" + +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \ + blk-availability.service" +SYSTEMD_AUTO_ENABLE = "disable" + +TARGET_CC_ARCH += "${LDFLAGS}" + +EXTRA_OECONF_append_class-nativesdk = " --with-confdir=${sysconfdir}" + +FILES_${PN} += "${libdir}/device-mapper/*.so" +FILES_${PN}-scripts = " \ + ${sbindir}/blkdeactivate \ + ${sbindir}/fsadm \ + ${sbindir}/lvmconf \ + ${sbindir}/lvmdump \ +" +# Specified explicitly for the udev rules, just in case that it does not get picked +# up automatically: +FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d" +RDEPENDS_${PN}-udevrules = "${PN}" +#RDEPENDS_${PN}_append_class-target = " libdevmapper" +RDEPENDS_${PN}_append_class-nativesdk = " libdevmapper" + +RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) bash" +RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})" + +CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/tzdata/timezone.inc b/meta-openeuler/recipes-core/tzdata/timezone.inc new file mode 100644 index 0000000000000000000000000000000000000000..44a6e7abe10212a7fbe202fa078bb8ba39388685 --- /dev/null +++ b/meta-openeuler/recipes-core/tzdata/timezone.inc @@ -0,0 +1,23 @@ +SUMMARY = "Timezone data" +DESCRIPTION = "The Time Zone Database contains code and data that represent \ +the history of local time for many representative locations around the globe." +HOMEPAGE = "http://www.iana.org/time-zones" +SECTION = "base" +LICENSE = "PD & BSD & BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=c679c9d6b02bc2757b3eaf8f53c43fba" + +SRC_URI = "file://tzdata/tzcode${PV}.tar.gz;name=tzcode \ + file://tzdata/tzdata${PV}.tar.gz;name=tzdata \ + file://tzdata/bugfix-0001-add-Beijing-timezone.patch \ + file://tzdata/remove-country-selection-from-tzselect-steps.patch \ + file://tzdata/remove-ROC-timezone.patch \ + file://tzdata/rename-Macau-to-Macao.patch \ + file://tzdata/remove-El_Aaiun-timezone.patch \ + file://tzdata/remove-Israel-timezone.patch \ + file://tzdata/skip-check_web-testcase.patch \ + " + +UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones" + +SRC_URI[tzcode.sha256sum] = "584666393a5424d13d27ec01183da17703273664742e049d4f62f62dab631775" +SRC_URI[tzdata.sha256sum] = "07ec42b737d0d3c6be9c337f8abb5f00554a0f9cc4fcf01a703d69403b6bb2b1" diff --git a/meta-openeuler/recipes-core/tzdata/tzcode-native_2021e.bb b/meta-openeuler/recipes-core/tzdata/tzcode-native_2021e.bb new file mode 100644 index 0000000000000000000000000000000000000000..8a96af199bdc4244d9be4cb1eb5664a8d1334aaf --- /dev/null +++ b/meta-openeuler/recipes-core/tzdata/tzcode-native_2021e.bb @@ -0,0 +1,16 @@ +require timezone.inc + +SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect" + +S = "${WORKDIR}" + +inherit native + +EXTRA_OEMAKE += "cc='${CC}'" + +do_install () { + install -d ${D}${bindir}/ + install -m 755 zic ${D}${bindir}/ + install -m 755 zdump ${D}${bindir}/ + install -m 755 tzselect ${D}${bindir}/ +} diff --git a/meta-openeuler/recipes-core/tzdata/tzdata_2021e.bb b/meta-openeuler/recipes-core/tzdata/tzdata_2021e.bb new file mode 100644 index 0000000000000000000000000000000000000000..b580ac4cc6feb8f586aac75fb55b2c670d7e9088 --- /dev/null +++ b/meta-openeuler/recipes-core/tzdata/tzdata_2021e.bb @@ -0,0 +1,210 @@ +require timezone.inc + +DEPENDS = "tzcode-native" + +#inherit allarch + +RCONFLICTS_${PN} = "timezones timezone-africa timezone-america timezone-antarctica \ + timezone-arctic timezone-asia timezone-atlantic \ + timezone-australia timezone-europe timezone-indian \ + timezone-iso3166.tab timezone-pacific timezone-zone.tab" + +S = "${WORKDIR}" + +DEFAULT_TIMEZONE ?= "Universal" +INSTALL_TIMEZONE_FILE ?= "1" + +TZONES= "africa antarctica asia australasia europe northamerica southamerica \ + factory etcetera backward \ + " +# pacificnew + +do_compile () { + for zone in ${TZONES}; do \ + ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \ + ${S}/${zone} ; \ + ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \ + ${S}/${zone} ; \ + ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \ + ${S}/${zone} ; \ + done +} + +do_install () { + install -d ${D}/$exec_prefix ${D}${datadir}/zoneinfo + cp -pPR ${S}/$exec_prefix ${D}/ + # libc is removing zoneinfo files from package + cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo + cp -pP "${S}/zone1970.tab" ${D}${datadir}/zoneinfo + cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo + cp -pP "${S}/leapseconds" ${D}${datadir}/zoneinfo + cp -pP "${S}/leap-seconds.list" ${D}${datadir}/zoneinfo + + # Install default timezone + if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then + install -d ${D}${sysconfdir} + if [ "${INSTALL_TIMEZONE_FILE}" = "1" ]; then + echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone + fi + ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime + else + bberror "DEFAULT_TIMEZONE is set to an invalid value." + exit 1 + fi + + chown -R root:root ${D} +} + +pkg_postinst_${PN} () { + etc_lt="$D${sysconfdir}/localtime" + src="$D${sysconfdir}/timezone" + + if [ -e ${src} ] ; then + tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}") + fi + + if [ ! -z "${tz}" -a ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then + echo "You have an invalid TIMEZONE setting in ${src}" + echo "Your ${etc_lt} has been reset to Universal; enjoy!" + tz="Universal" + echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}" + if [ -L ${etc_lt} ] ; then + rm -f "${etc_lt}" + fi + ln -s "${datadir}/zoneinfo/${tz}" "${etc_lt}" + fi +} + +# Packages primarily organized by directory with a major city +# in most time zones in the base package + +TZ_PACKAGES = " \ + tzdata-core tzdata-misc tzdata-posix tzdata-right tzdata-africa \ + tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \ + tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific" +PACKAGES = "${TZ_PACKAGES} ${PN}" + +FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*" +RPROVIDES_tzdata-africa = "tzdata-africa" + +FILES_tzdata-americas += "${datadir}/zoneinfo/America/* \ + ${datadir}/zoneinfo/US/* \ + ${datadir}/zoneinfo/Brazil/* \ + ${datadir}/zoneinfo/Canada/* \ + ${datadir}/zoneinfo/Mexico/* \ + ${datadir}/zoneinfo/Chile/*" +RPROVIDES_tzdata-americas = "tzdata-americas" + +FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*" +RPROVIDES_tzdata-antarctica = "tzdata-antarctica" + +FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*" +RPROVIDES_tzdata-arctic = "tzdata-arctic" + +FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/* \ + ${datadir}/zoneinfo/Indian/* \ + ${datadir}/zoneinfo/Mideast/*" +RPROVIDES_tzdata-asia = "tzdata-asia" + +FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*" +RPROVIDES_tzdata-atlantic = "tzdata-atlantic" + +FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*" +RPROVIDES_tzdata-australia = "tzdata-australia" + +FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*" +RPROVIDES_tzdata-europe = "tzdata-europe" + +FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*" +RPROVIDES_tzdata-pacific = "tzdata-pacific" + +FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*" +RPROVIDES_tzdata-posix = "tzdata-posix" + +FILES_tzdata-right += "${datadir}/zoneinfo/right/*" +RPROVIDES_tzdata-right = "tzdata-right" + +FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba \ + ${datadir}/zoneinfo/Egypt \ + ${datadir}/zoneinfo/Eire \ + ${datadir}/zoneinfo/Factory \ + ${datadir}/zoneinfo/GB-Eire \ + ${datadir}/zoneinfo/Hongkong \ + ${datadir}/zoneinfo/Iceland \ + ${datadir}/zoneinfo/Iran \ + ${datadir}/zoneinfo/Israel \ + ${datadir}/zoneinfo/Jamaica \ + ${datadir}/zoneinfo/Japan \ + ${datadir}/zoneinfo/Kwajalein \ + ${datadir}/zoneinfo/Libya \ + ${datadir}/zoneinfo/Navajo \ + ${datadir}/zoneinfo/Poland \ + ${datadir}/zoneinfo/Portugal \ + ${datadir}/zoneinfo/Singapore \ + ${datadir}/zoneinfo/Turkey" +RPROVIDES_tzdata-misc = "tzdata-misc" + +FILES_tzdata-core += " \ + ${sysconfdir}/localtime \ + ${sysconfdir}/timezone \ + ${datadir}/zoneinfo/leapseconds \ + ${datadir}/zoneinfo/leap-seconds.list \ + ${datadir}/zoneinfo/Pacific/Honolulu \ + ${datadir}/zoneinfo/America/Anchorage \ + ${datadir}/zoneinfo/America/Los_Angeles \ + ${datadir}/zoneinfo/America/Denver \ + ${datadir}/zoneinfo/America/Chicago \ + ${datadir}/zoneinfo/America/New_York \ + ${datadir}/zoneinfo/America/Caracas \ + ${datadir}/zoneinfo/America/Sao_Paulo \ + ${datadir}/zoneinfo/Europe/London \ + ${datadir}/zoneinfo/Europe/Paris \ + ${datadir}/zoneinfo/Africa/Cairo \ + ${datadir}/zoneinfo/Europe/Moscow \ + ${datadir}/zoneinfo/Asia/Dubai \ + ${datadir}/zoneinfo/Asia/Karachi \ + ${datadir}/zoneinfo/Asia/Dhaka \ + ${datadir}/zoneinfo/Asia/Bangkok \ + ${datadir}/zoneinfo/Asia/Hong_Kong \ + ${datadir}/zoneinfo/Asia/Tokyo \ + ${datadir}/zoneinfo/Australia/Darwin \ + ${datadir}/zoneinfo/Australia/Adelaide \ + ${datadir}/zoneinfo/Australia/Brisbane \ + ${datadir}/zoneinfo/Australia/Sydney \ + ${datadir}/zoneinfo/Pacific/Noumea \ + ${datadir}/zoneinfo/CET \ + ${datadir}/zoneinfo/CST6CDT \ + ${datadir}/zoneinfo/EET \ + ${datadir}/zoneinfo/EST \ + ${datadir}/zoneinfo/EST5EDT \ + ${datadir}/zoneinfo/GB \ + ${datadir}/zoneinfo/GMT \ + ${datadir}/zoneinfo/GMT+0 \ + ${datadir}/zoneinfo/GMT-0 \ + ${datadir}/zoneinfo/GMT0 \ + ${datadir}/zoneinfo/Greenwich \ + ${datadir}/zoneinfo/HST \ + ${datadir}/zoneinfo/MET \ + ${datadir}/zoneinfo/MST \ + ${datadir}/zoneinfo/MST7MDT \ + ${datadir}/zoneinfo/NZ \ + ${datadir}/zoneinfo/NZ-CHAT \ + ${datadir}/zoneinfo/PRC \ + ${datadir}/zoneinfo/PST8PDT \ + ${datadir}/zoneinfo/ROC \ + ${datadir}/zoneinfo/ROK \ + ${datadir}/zoneinfo/UCT \ + ${datadir}/zoneinfo/UTC \ + ${datadir}/zoneinfo/Universal \ + ${datadir}/zoneinfo/W-SU \ + ${datadir}/zoneinfo/WET \ + ${datadir}/zoneinfo/Zulu \ + ${datadir}/zoneinfo/zone.tab \ + ${datadir}/zoneinfo/zone1970.tab \ + ${datadir}/zoneinfo/iso3166.tab \ + ${datadir}/zoneinfo/Etc/*" + +CONFFILES_tzdata-core = "${sysconfdir}/localtime ${sysconfdir}/timezone" + +ALLOW_EMPTY_${PN} = "1" +RDEPENDS_${PN} = "${TZ_PACKAGES}"