aboutsummaryrefslogtreecommitdiff
path: root/recipes-misc/de10-nano-usb-gadget/files
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-misc/de10-nano-usb-gadget/files')
-rw-r--r--recipes-misc/de10-nano-usb-gadget/files/de10-nano-gadget-init.service10
-rw-r--r--recipes-misc/de10-nano-usb-gadget/files/de10-nano-gadget-init.sh10
-rw-r--r--recipes-misc/de10-nano-usb-gadget/files/udhcpd.conf5
3 files changed, 25 insertions, 0 deletions
diff --git a/recipes-misc/de10-nano-usb-gadget/files/de10-nano-gadget-init.service b/recipes-misc/de10-nano-usb-gadget/files/de10-nano-gadget-init.service
new file mode 100644
index 0000000..4e7f7de
--- /dev/null
+++ b/recipes-misc/de10-nano-usb-gadget/files/de10-nano-gadget-init.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Start usb mass storage gadget
+After=dev-mmcblk0p1.device
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/de10-nano-gadget-init.sh
+
+[Install]
+WantedBy=basic.target
diff --git a/recipes-misc/de10-nano-usb-gadget/files/de10-nano-gadget-init.sh b/recipes-misc/de10-nano-usb-gadget/files/de10-nano-gadget-init.sh
new file mode 100644
index 0000000..4bfa204
--- /dev/null
+++ b/recipes-misc/de10-nano-usb-gadget/files/de10-nano-gadget-init.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+modprobe g_multi file=/usr/share/de10-nano-usb-gadget/fat_image.img
+
+sleep 5
+
+rm /var/lib/misc/udhcpd.leases
+/sbin/ifconfig usb0 hw ether 00:07:ed:01:02:03
+/sbin/ifconfig usb0 192.168.7.1 netmask 255.255.255.0
+/usr/sbin/udhcpd -fS -I 192.168.7.1 /etc/udhcpd.conf
diff --git a/recipes-misc/de10-nano-usb-gadget/files/udhcpd.conf b/recipes-misc/de10-nano-usb-gadget/files/udhcpd.conf
new file mode 100644
index 0000000..78102f6
--- /dev/null
+++ b/recipes-misc/de10-nano-usb-gadget/files/udhcpd.conf
@@ -0,0 +1,5 @@
+start 192.168.7.5
+end 192.168.7.6
+interface usb0
+max_leases 1
+option subnet 255.255.255.0