Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled

This commit is contained in:
domenico
2025-06-24 14:35:53 +02:00
commit c06fb25d1f
9263 changed files with 1750214 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=usbgadget
PKG_RELEASE:=1
PKG_LICENSE:=BSD-2-Clause
PKG_MAINTAINER:=Chuanhong Guo <gch981213@gmail.com>
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=@USB_GADGET_SUPPORT +kmod-usb-gadget +kmod-usb-lib-composite
TITLE:=init script to create USB gadgets
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
$(INSTALL_CONF) ./files/usbgadget.conf $(1)/etc/config/usbgadget
$(INSTALL_BIN) ./files/usbgadget.init $(1)/etc/init.d/usbgadget
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
# 1: short name
# 2: description
# 3: dependencies on other packages
define GadgetPreset
define Package/$(PKG_NAME)-$(1)
SECTION:=utils
CATEGORY:=Utilities
TITLE+= $(2) gadget preset
DEPENDS+= $(3)
endef
define Package/$(PKG_NAME)-$(1)/description
This package contains the USB gadget preset for $(3).
endef
define Package/$(PKG_NAME)-$(1)/install
$(INSTALL_DIR) $$(1)/usr/share/usbgadget
$(INSTALL_CONF) ./files/presets/$(1) $$(1)/usr/share/usbgadget
endef
$$(eval $$(call BuildPackage,$(PKG_NAME)-$(1)))
endef
$(eval $(call GadgetPreset,ncm,CDC-NCM,+kmod-usb-gadget-ncm))
$(eval $(call GadgetPreset,acm,CDC-ACM,+kmod-usb-gadget-serial))