mirror of
https://git.yoctoproject.org/meta-ti
synced 2026-05-07 11:59:49 +00:00
udhcpd: Fixes and new udev rule
This moves the logic to configure and start dhcp to a udev rule which is a better place than a systemd service Also fixes a bug where stopping and starting network service would cause dhcp to fail. Signed-off-by: Joel A Fernandes <joelagnel@ti.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
This commit is contained in:
committed by
Koen Kooi
parent
245e5c80ca
commit
77e4288231
@@ -1,6 +1,6 @@
|
|||||||
DESCRIPTION = "Units to initialize usb gadgets"
|
DESCRIPTION = "Units to initialize usb gadgets"
|
||||||
|
|
||||||
PR = "r10"
|
PR = "r11"
|
||||||
|
|
||||||
LICENSE = "MIT"
|
LICENSE = "MIT"
|
||||||
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
|
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
|
||||||
@@ -15,6 +15,7 @@ SRC_URI = "file://storage-gadget-init.service \
|
|||||||
file://99-hokey-pokey.rules \
|
file://99-hokey-pokey.rules \
|
||||||
file://hokey-pokey.sh \
|
file://hokey-pokey.sh \
|
||||||
file://bone-gmass-eject.rules \
|
file://bone-gmass-eject.rules \
|
||||||
|
file://udhcpd.rules \
|
||||||
file://g-storage-reinsert.sh \
|
file://g-storage-reinsert.sh \
|
||||||
file://g-ether-start-service.sh \
|
file://g-ether-start-service.sh \
|
||||||
file://g-ether-load.sh \
|
file://g-ether-load.sh \
|
||||||
@@ -50,7 +51,8 @@ FILES_${PN}-storage = "${base_libdir}/systemd/system/storage-gadget-init.service
|
|||||||
FILES_${PN}-network = "${base_libdir}/systemd/system/network-gadget-init.service \
|
FILES_${PN}-network = "${base_libdir}/systemd/system/network-gadget-init.service \
|
||||||
${base_libdir}/systemd/system/basic.target.wants/network-gadget-init.service \
|
${base_libdir}/systemd/system/basic.target.wants/network-gadget-init.service \
|
||||||
${bindir}/g-ether-load.sh \
|
${bindir}/g-ether-load.sh \
|
||||||
${bindir}/g-ether-start-service.sh"
|
${bindir}/g-ether-start-service.sh \
|
||||||
|
${sysconfdir}/udev/rules.d/udhcpd.rules"
|
||||||
|
|
||||||
FILES_${PN}-udhcpd = "${base_libdir}/systemd/system/udhcpd.service \
|
FILES_${PN}-udhcpd = "${base_libdir}/systemd/system/udhcpd.service \
|
||||||
${base_libdir}/systemd/system/basic.target.wants/udhcpd.service \
|
${base_libdir}/systemd/system/basic.target.wants/udhcpd.service \
|
||||||
|
|||||||
@@ -6,6 +6,5 @@ then
|
|||||||
then
|
then
|
||||||
/bin/systemctl stop storage-gadget-init.service
|
/bin/systemctl stop storage-gadget-init.service
|
||||||
/bin/systemctl start network-gadget-init.service
|
/bin/systemctl start network-gadget-init.service
|
||||||
/bin/systemctl start udhcpd.service
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ Conflicts=storage-gadget-init.service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStartPre=/usr/bin/g-ether-load.sh
|
ExecStart=/usr/bin/g-ether-load.sh
|
||||||
ExecStart=/sbin/ifconfig usb0 192.168.7.2 netmask 255.255.255.252
|
|
||||||
ExecStop=/sbin/rmmod g_ether
|
ExecStop=/sbin/rmmod g_ether
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
SUBSYSTEM=="net",ACTION=="add",KERNEL=="usb0",RUN+="/sbin/ifconfig usb0 192.168.7.2 netmask 255.255.255.252",RUN+="/bin/systemctl start udhcpd.service"
|
||||||
|
SUBSYSTEM=="net",ACTION=="remove",KERNEL=="usb0",RUN+="/bin/systemctl stop udhcpd.service"
|
||||||
Reference in New Issue
Block a user