summaryrefslogtreecommitdiffstats
path: root/recipes-ti/beagleboard
diff options
context:
space:
mode:
authorJoel A Fernandes <joelagnel@ti.com>2011-11-11 08:51:47 -0600
committerKoen Kooi <koen@dominion.thruhere.net>2011-11-11 16:11:19 +0100
commit77e42882310fdd5925bbeb7799f28ffd141d2ece (patch)
tree8e5afd2e682e176378a6d230e3d23afa6a9cf419 /recipes-ti/beagleboard
parent245e5c80cadfa81b3add7302de50b5a4283a8071 (diff)
downloadmeta-ti-77e42882310fdd5925bbeb7799f28ffd141d2ece.tar.gz
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>
Diffstat (limited to 'recipes-ti/beagleboard')
-rw-r--r--recipes-ti/beagleboard/gadget-init.bb6
-rwxr-xr-xrecipes-ti/beagleboard/gadget-init/g-ether-start-service.sh1
-rw-r--r--recipes-ti/beagleboard/gadget-init/network-gadget-init.service3
-rw-r--r--recipes-ti/beagleboard/gadget-init/udhcpd.rules2
4 files changed, 7 insertions, 5 deletions
diff --git a/recipes-ti/beagleboard/gadget-init.bb b/recipes-ti/beagleboard/gadget-init.bb
index 8ddefaa2..0d4682ef 100644
--- a/recipes-ti/beagleboard/gadget-init.bb
+++ b/recipes-ti/beagleboard/gadget-init.bb
@@ -1,6 +1,6 @@
1DESCRIPTION = "Units to initialize usb gadgets" 1DESCRIPTION = "Units to initialize usb gadgets"
2 2
3PR = "r10" 3PR = "r11"
4 4
5LICENSE = "MIT" 5LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" 6LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
@@ -15,6 +15,7 @@ SRC_URI = "file://storage-gadget-init.service \
15 file://99-hokey-pokey.rules \ 15 file://99-hokey-pokey.rules \
16 file://hokey-pokey.sh \ 16 file://hokey-pokey.sh \
17 file://bone-gmass-eject.rules \ 17 file://bone-gmass-eject.rules \
18 file://udhcpd.rules \
18 file://g-storage-reinsert.sh \ 19 file://g-storage-reinsert.sh \
19 file://g-ether-start-service.sh \ 20 file://g-ether-start-service.sh \
20 file://g-ether-load.sh \ 21 file://g-ether-load.sh \
@@ -50,7 +51,8 @@ FILES_${PN}-storage = "${base_libdir}/systemd/system/storage-gadget-init.service
50FILES_${PN}-network = "${base_libdir}/systemd/system/network-gadget-init.service \ 51FILES_${PN}-network = "${base_libdir}/systemd/system/network-gadget-init.service \
51 ${base_libdir}/systemd/system/basic.target.wants/network-gadget-init.service \ 52 ${base_libdir}/systemd/system/basic.target.wants/network-gadget-init.service \
52 ${bindir}/g-ether-load.sh \ 53 ${bindir}/g-ether-load.sh \
53 ${bindir}/g-ether-start-service.sh" 54 ${bindir}/g-ether-start-service.sh \
55 ${sysconfdir}/udev/rules.d/udhcpd.rules"
54 56
55FILES_${PN}-udhcpd = "${base_libdir}/systemd/system/udhcpd.service \ 57FILES_${PN}-udhcpd = "${base_libdir}/systemd/system/udhcpd.service \
56 ${base_libdir}/systemd/system/basic.target.wants/udhcpd.service \ 58 ${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 2db16c26..076a5fe8 100755
--- a/recipes-ti/beagleboard/gadget-init/g-ether-start-service.sh
+++ b/recipes-ti/beagleboard/gadget-init/g-ether-start-service.sh
@@ -6,6 +6,5 @@ then
6 then 6 then
7 /bin/systemctl stop storage-gadget-init.service 7 /bin/systemctl stop storage-gadget-init.service
8 /bin/systemctl start network-gadget-init.service 8 /bin/systemctl start network-gadget-init.service
9 /bin/systemctl start udhcpd.service
10 fi 9 fi
11fi 10fi
diff --git a/recipes-ti/beagleboard/gadget-init/network-gadget-init.service b/recipes-ti/beagleboard/gadget-init/network-gadget-init.service
index 1e226272..0ee29147 100644
--- a/recipes-ti/beagleboard/gadget-init/network-gadget-init.service
+++ b/recipes-ti/beagleboard/gadget-init/network-gadget-init.service
@@ -4,8 +4,7 @@ Conflicts=storage-gadget-init.service
4 4
5[Service] 5[Service]
6RemainAfterExit=yes 6RemainAfterExit=yes
7ExecStartPre=/usr/bin/g-ether-load.sh 7ExecStart=/usr/bin/g-ether-load.sh
8ExecStart=/sbin/ifconfig usb0 192.168.7.2 netmask 255.255.255.252
9ExecStop=/sbin/rmmod g_ether 8ExecStop=/sbin/rmmod g_ether
10 9
11[Install] 10[Install]
diff --git a/recipes-ti/beagleboard/gadget-init/udhcpd.rules b/recipes-ti/beagleboard/gadget-init/udhcpd.rules
new file mode 100644
index 00000000..db65f9ac
--- /dev/null
+++ b/recipes-ti/beagleboard/gadget-init/udhcpd.rules
@@ -0,0 +1,2 @@
1SUBSYSTEM=="net",ACTION=="add",KERNEL=="usb0",RUN+="/sbin/ifconfig usb0 192.168.7.2 netmask 255.255.255.252",RUN+="/bin/systemctl start udhcpd.service"
2SUBSYSTEM=="net",ACTION=="remove",KERNEL=="usb0",RUN+="/bin/systemctl stop udhcpd.service"