summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 245e5c8)
raw | patch | inline | side by side (parent: 245e5c8)
author | Joel A Fernandes <joelagnel@ti.com> | |
Fri, 11 Nov 2011 14:51:47 +0000 (08:51 -0600) | ||
committer | Koen Kooi <koen@dominion.thruhere.net> | |
Fri, 11 Nov 2011 15:11:19 +0000 (16:11 +0100) |
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>
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>
index 8ddefaa24caca7688ccdaa3b10523a79e94a7352..0d4682ef618b342f9c50c136c78bc54be1df787d 100644 (file)
DESCRIPTION = "Units to initialize usb gadgets"
-PR = "r10"
+PR = "r11"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
file://99-hokey-pokey.rules \
file://hokey-pokey.sh \
file://bone-gmass-eject.rules \
+ file://udhcpd.rules \
file://g-storage-reinsert.sh \
file://g-ether-start-service.sh \
file://g-ether-load.sh \
FILES_${PN}-network = "${base_libdir}/systemd/system/network-gadget-init.service \
${base_libdir}/systemd/system/basic.target.wants/network-gadget-init.service \
${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 \
${base_libdir}/systemd/system/basic.target.wants/udhcpd.service \
diff --git a/recipes-ti/beagleboard/gadget-init/g-ether-start-service.sh b/recipes-ti/beagleboard/gadget-init/g-ether-start-service.sh
index 2db16c26081d3830fabf33cf58bed826c53aff04..076a5fe8df8722852630d4a07a51206a52366e55 100755 (executable)
then
/bin/systemctl stop storage-gadget-init.service
/bin/systemctl start network-gadget-init.service
- /bin/systemctl start udhcpd.service
fi
fi
diff --git a/recipes-ti/beagleboard/gadget-init/network-gadget-init.service b/recipes-ti/beagleboard/gadget-init/network-gadget-init.service
index 1e226272efa64cfb1728eaeac267107312db7ab5..0ee291472c5c50e62653a7711cb261b3959a0dbd 100644 (file)
[Service]
RemainAfterExit=yes
-ExecStartPre=/usr/bin/g-ether-load.sh
-ExecStart=/sbin/ifconfig usb0 192.168.7.2 netmask 255.255.255.252
+ExecStart=/usr/bin/g-ether-load.sh
ExecStop=/sbin/rmmod g_ether
[Install]
diff --git a/recipes-ti/beagleboard/gadget-init/udhcpd.rules b/recipes-ti/beagleboard/gadget-init/udhcpd.rules
--- /dev/null
@@ -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"