summaryrefslogtreecommitdiff
path: root/recipes-core/usb-rndis/usb-rndis-systemd.bb
blob: d229123e014412ddfa700b699f829294c4bfdf36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
SECTION = "network"
SUMMARY = "RNDIS usb client configuration and startup"
RDEPENDS_${PN} = ""
# The license is meant for this recipe and the files it installs.
# RNDIS is part of the kernel, udhcpd is part of busybox
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"

PR = "r1"

# Tegra Kernels:
# The kernel provides with CONFIG_USB_G_ANDROID a composite gadget driver among other with RNDIS functionality.
# Others:
# The kernel provides with  CONFIG_USB_ETH_RNDIS a USB gadget driver which provides RNDIS functionality.

# This package contains systemd files to configure RNDIS at startup, configures a fix IP localy and provides a dhcp server on the new interface.
# Local IP is 192.168.11.2, remote IP is 192.168.11.1

inherit allarch systemd

SRC_URI_COMMON = " \
    file://start-rndis.sh \
    file://usb-rndis.service \
    file://udhcpd-usb-rndis.conf \
"

SRC_URI = " \
    ${SRC_URI_COMMON} \
"

SRC_URI_tegra = " \
    ${SRC_URI_COMMON} \
    file://usb-rndis.rules \
    file://usb-rndis-udhcpd.service \
"

do_install() {
    install -d ${D}/${sysconfdir} ${D}/${bindir}
    install -m 0755 ${WORKDIR}/start-rndis.sh ${D}/${bindir}/
    install -m 0644 ${WORKDIR}/udhcpd-usb-rndis.conf ${D}/${sysconfdir}/

    install -d ${D}${systemd_unitdir}/system/
    install -m 0644 ${WORKDIR}/usb-rndis.service ${D}${systemd_unitdir}/system
}

do_install_append_tegra() {
    install -d ${D}/${sysconfdir}/udev/rules.d
    install -m 0644 ${WORKDIR}/usb-rndis.rules ${D}/${sysconfdir}/udev/rules.d
    install -m 0644 ${WORKDIR}/usb-rndis-udhcpd.service ${D}${systemd_unitdir}/system
}

FILES_${PN} += "${systemd_unitdir}/system"

NATIVE_SYSTEMD_SUPPORT = "1"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "usb-rndis.service"
SYSTEMD_AUTO_ENABLE_mx6 = "disable"