Enable networking and console over the USB port

That one is much more friendly than the UART0 pin header.

Change-Id: I76affd2803eb2f18911eb71cbdfc1ffd6bf4fd76
diff --git a/board/czechlight/common/kconfig b/board/czechlight/common/kconfig
new file mode 100644
index 0000000..5004b78
--- /dev/null
+++ b/board/czechlight/common/kconfig
@@ -0,0 +1,3 @@
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_CDC_COMPOSITE=m
+# CONFIG_USB_G_NOKIA is not set
diff --git a/board/czechlight/common/overlay/etc/modules-load.d/usb-serial-gadget.conf b/board/czechlight/common/overlay/etc/modules-load.d/usb-serial-gadget.conf
new file mode 100644
index 0000000..41c481d
--- /dev/null
+++ b/board/czechlight/common/overlay/etc/modules-load.d/usb-serial-gadget.conf
@@ -0,0 +1,2 @@
+# composite module for serial console and Ethernet over the miniUSB port
+g_cdc
diff --git a/board/czechlight/common/overlay/etc/systemd/network/30-usbnet-apipa.network b/board/czechlight/common/overlay/etc/systemd/network/30-usbnet-apipa.network
new file mode 100644
index 0000000..807dcc4
--- /dev/null
+++ b/board/czechlight/common/overlay/etc/systemd/network/30-usbnet-apipa.network
@@ -0,0 +1,6 @@
+[Match]
+Name=usb0
+
+[Network]
+Description=miniUSB console
+LinkLocalAddressing=yes
diff --git a/board/czechlight/common/overlay/etc/systemd/system/serial-getty@ttyGS0.service b/board/czechlight/common/overlay/etc/systemd/system/serial-getty@ttyGS0.service
new file mode 120000
index 0000000..252308a
--- /dev/null
+++ b/board/czechlight/common/overlay/etc/systemd/system/serial-getty@ttyGS0.service
@@ -0,0 +1 @@
+/lib/systemd/system/serial-getty@.service
\ No newline at end of file
diff --git a/configs/czechlight_beaglebone_defconfig b/configs/czechlight_beaglebone_defconfig
index d9a1ed5..db32ccb 100644
--- a/configs/czechlight_beaglebone_defconfig
+++ b/configs/czechlight_beaglebone_defconfig
@@ -5,19 +5,24 @@
 BR2_GNU_MIRROR="http://ftp.fi.muni.cz/pub/gnu/"
 BR2_CPAN_MIRROR="http://ftp.fi.muni.cz/pub/CPAN/"
 BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TARGET_GENERIC_HOSTNAME="czechlight"
+BR2_TARGET_GENERIC_ISSUE="Welcome to CzechLight"
 BR2_TARGET_GENERIC_PASSWD_SHA256=y
 BR2_INIT_SYSTEMD=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyO0"
 BR2_SYSTEM_DHCP="eth0"
-BR2_TARGET_TZ_INFO=y
+BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_CZECHLIGHT_PATH)/board/czechlight/common/overlay/"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_CZECHLIGHT_PATH)/board/czechlight/beaglebone/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.9.18"
 BR2_LINUX_KERNEL_DEFCONFIG="omap2plus"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_CZECHLIGHT_PATH)/board/czechlight/common/kconfig"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_USE_CUSTOM_DTS=y
 BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_CZECHLIGHT_PATH)/board/czechlight/beaglebone/czechlight-bbb.dts"
+BR2_PACKAGE_AVAHI=y
+BR2_PACKAGE_AVAHI_DAEMON=y
 BR2_PACKAGE_OPENSSH=y
 BR2_PACKAGE_BASH=y
 # BR2_PACKAGE_SYSTEMD_HWDB is not set