42eb47f88f332784645b101e03ecccb0d50a1448
[pti/rtp.git] / meta-starlingx / meta-stx-integ / recipes-connectivity / nfs-utils / nfs-utils_%.bbappend
1 SRCREV_FORMAT = "opendev"
2 SRCREV_opendev = "d778e862571957ece3c404c0c37d325769772fde"
3 SUBPATH0 = "filesystem-scripts"
4 DSTSUFX0 = "stx-configfiles"
5 SUBPATH1 = "nfs-utils-config"
6 DSTSUFX1 = "stx-nfs-utils"
7
8 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
9
10 LICENSE_append = "& Apache-2.0"
11 LIC_FILES_CHKSUM += "\
12         file://stx-configfiles-LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
13         file://stx-nfs-utils-LICENSE;beginline=1;endline=10;md5=bbfb66ff81fec36fc2b2c9d98e01b1d8 \
14         "
15
16 SRC_URI += " \
17         git://opendev.org/starlingx/config-files.git;protocol=https;destsuffix=${DSTSUFX0};branch="r/stx.3.0";subpath=${SUBPATH0};name=opendev \
18         git://opendev.org/starlingx/config-files.git;protocol=https;destsuffix=${DSTSUFX1};branch="r/stx.3.0";subpath=${SUBPATH1};name=opendev \
19         file://nfsserver-remove-the-f-option-for-rpc.mountd.patch;patchdir=../${DSTSUFX1};striplevel=2 \
20 "
21
22 do_unpack_append() {
23     bb.build.exec_func('do_copy_config_files', d)
24 }
25
26 do_copy_config_files () {
27     cp -pf ${WORKDIR}/${DSTSUFX0}/LICENSE ${S}/stx-configfiles-LICENSE
28     cp -pf ${WORKDIR}/${DSTSUFX0}/filesystem-scripts-1.0/LICENSE ${S}/stx-filesystem-scripts-LICENSE
29     cp -pf ${WORKDIR}/${DSTSUFX1}/centos/nfs-utils-config.spec ${S}/stx-nfs-utils-LICENSE
30 }
31
32 inherit systemd
33
34 PACKAGES =+ "${PN}-config"
35 SYSTEMD_PACKAGES += "${PN}-config"
36 SYSTEMD_SERVICE_${PN}-config = "uexportfs.service nfscommon.service nfsserver.service"
37 SYSTEMD_AUTO_ENABLE_${PN} = "disable"
38 SYSTEMD_AUTO_ENABLE_${PN}-config = "enable"
39
40 DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit"
41
42 do_install_append() {
43         mv ${D}/${sbindir}/sm-notify ${D}/${sbindir}/nfs-utils-client_sm-notify
44         install -D -m 755 ${WORKDIR}/${DSTSUFX0}/filesystem-scripts-1.0/uexportfs ${D}/${sysconfdir}/init.d/uexportfs 
45
46         # install nfs.conf and enable udp proto
47         install -m 0755 ${S}/nfs.conf ${D}${sysconfdir}
48         sed -i -e 's/#\(\[nfsd\]\)/\1/' -e 's/#\( udp=\).*/\1y/' ${D}${sysconfdir}/nfs.conf
49
50         # add initial exports file
51         echo "# Initial exports for nfs" > ${D}${sysconfdir}/exports
52
53         # Libdir here is hardcoded in other scripts.
54         install -d -m 0755 ${D}/usr/lib/ocf/resource.d/platform/
55         install -D -m 755 ${WORKDIR}/${DSTSUFX0}/filesystem-scripts-1.0/nfsserver-mgmt \
56                 ${D}/usr/lib/ocf/resource.d/platform/nfsserver-mgmt
57         
58         install -p -D -m 755 ${WORKDIR}/${DSTSUFX0}/filesystem-scripts-1.0/nfs-mount ${D}/${bindir}/nfs-mount
59         install -D -m 755 ${WORKDIR}/${DSTSUFX0}/filesystem-scripts-1.0/uexportfs.service \
60                         ${D}/${systemd_system_unitdir}/uexportfs.service
61
62
63         install -d ${D}/${sysconfdir}/init.d
64         install -d ${D}/${systemd_system_unitdir}
65
66         install -m 755 -p -D ${WORKDIR}/${DSTSUFX1}/files/nfscommon      ${D}/${sysconfdir}/init.d
67         install -m 644 -p -D ${WORKDIR}/${DSTSUFX1}/files/nfscommon.service      ${D}/${systemd_system_unitdir}/
68
69         install -m 755 -p -D ${WORKDIR}/${DSTSUFX1}/files/nfsserver            ${D}/${sysconfdir}/init.d
70         install -m 644 -p -D ${WORKDIR}/${DSTSUFX1}/files/nfsserver.service    ${D}/${systemd_system_unitdir}
71         install -m 644 -p -D ${WORKDIR}/${DSTSUFX1}/files/nfsmount.conf        ${D}/${sysconfdir}/nfsmount.conf
72
73 }
74
75 FILES_${PN}-config = "\
76         ${systemd_system_unitdir}/nfscommon.service \
77         ${systemd_system_unitdir}/nfsserver.service \
78         ${systemd_system_unitdir}/uexportfs.service \
79         ${sysconfdir}/nfsmount.conf \
80         "
81 FILES_${PN}_append = " usr/lib/ocf/resource.d"