Просмотр исходного кода

gemini: Activate serial USB console on the DNS-313

This brings up a serial console on the USB device port of
the DNS-313 by:

- Activating the usbgadget feature
- Selecting the usbgadget-acm package
- Adding an inittab that opens a console at ttyGS0 which is
  the device side of ttyACMn of a connected host

Link: http://patchwork.ozlabs.org/project/openwrt/patch/[email protected]/
Cc: Chuanhong Guo <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Linus Walleij 2 лет назад
Родитель
Сommit
719f378bfb

+ 1 - 1
target/linux/gemini/Makefile

@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 ARCH:=arm
 BOARD:=gemini
 BOARDNAME:=Cortina Systems CS351x
-FEATURES:=squashfs pci rtc usb dt gpio display ext4 rootfs-part boot-part
+FEATURES:=squashfs pci rtc usb usbgadget dt gpio display ext4 rootfs-part boot-part
 CPU_TYPE:=fa526
 SUBTARGETS:=generic
 

+ 11 - 0
target/linux/gemini/base-files/etc/board.d/02_usbgadget

@@ -0,0 +1,11 @@
+. /lib/functions.sh
+
+case "$(board_name)" in
+dlink,dns-313)
+	uci set usbgadget.@preset[0].name="acm"
+	uci set usbgadget.@preset[0].UDC="69000000.usb"
+	uci commit usbgadget
+	;;
+esac
+
+exit 0

+ 4 - 0
target/linux/gemini/base-files/etc/inittab

@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+::askconsole:/usr/libexec/login.sh
+ttyGS0::askfirst:/usr/libexec/login.sh

+ 1 - 1
target/linux/gemini/image/Makefile

@@ -170,7 +170,7 @@ define Device/dlink_dns-313
 	DEVICE_VENDOR := D-Link
 	DEVICE_MODEL := DNS-313 1-Bay Network Storage Enclosure
 	DEVICE_DTS := gemini-dlink-dns-313
-	DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES)
+	DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) usbgadget-acm
 	BLOCKSIZE := 1k
 	FILESYSTEMS := ext4
 	IMAGES := factory.bin.gz