From ad9a337795e222d9435d7ddfed846d5d3205d641 Mon Sep 17 00:00:00 2001 From: Vadim Vetrov Date: Mon, 2 Sep 2024 00:32:55 +0300 Subject: [PATCH] Add kernel module build unit --- kyoutubeUnblock/Makefile | 47 +++++++++++++++++++++++ kyoutubeUnblock/files/kmod_youtubeUnblock | 13 +++++++ youtubeUnblock/Makefile | 1 + 3 files changed, 61 insertions(+) create mode 100644 kyoutubeUnblock/Makefile create mode 100755 kyoutubeUnblock/files/kmod_youtubeUnblock diff --git a/kyoutubeUnblock/Makefile b/kyoutubeUnblock/Makefile new file mode 100644 index 0000000..89b4137 --- /dev/null +++ b/kyoutubeUnblock/Makefile @@ -0,0 +1,47 @@ +# This file is used by OpenWRT SDK buildsystem to package the application for routers. +# This file provides the kernel model version of youtubeUnblock + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=youtubeUnblock +PKG_VERSION:=0.3.2 +PKG_REV:=5870df44df86e2e642465b56a8392a3a77b4f9e0 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://github.com/Waujito/youtubeUnblock.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=$(PKG_REV) + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/youtubeUnblock + SECTION:=net + CATEGORY:=Networking + TITLE:=kmod youtubeUnblock + VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) + FILES:=$(PKG_BUILD_DIR)/kyoutubeUnblock.$(LINUX_KMOD_SUFFIX) + URL:=https://github.com/Waujito/youtubeUnblock + MAINTAINER:=Vadim Vetrov +endef + +define Build/Prepare + $(Build/Prepare/Default) + $(Build/Patch) +endef + +define Build/Compile + $(MAKE) -C $(LINUX_DIR) \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + M="$(PKG_BUILD_DIR)" \ + CONFIG_kyoutubeUnblock=m \ + modules +endef + +define KernelPackage/youtubeUnblock/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/kmod_youtubeUnblock $(1)/etc/init.d/kmod_youtubeUnblock +endef + +$(eval $(call KernelPackage,youtubeUnblock)) diff --git a/kyoutubeUnblock/files/kmod_youtubeUnblock b/kyoutubeUnblock/files/kmod_youtubeUnblock new file mode 100755 index 0000000..1506220 --- /dev/null +++ b/kyoutubeUnblock/files/kmod_youtubeUnblock @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +START=91 +STOP=91 + +# Openwrt init script. It just runs and stops the kernel module. + +start() { + modprobe kyoutubeUnblock +} + +stop() { + rmmod kyoutubeUnblock +} diff --git a/youtubeUnblock/Makefile b/youtubeUnblock/Makefile index ff6633d..9470b87 100644 --- a/youtubeUnblock/Makefile +++ b/youtubeUnblock/Makefile @@ -20,6 +20,7 @@ define Package/youtubeUnblock DEPENDS:=+libpthread URL:=https://github.com/Waujito/youtubeUnblock MAINTAINER:=Vadim Vetrov + VERSION:=$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) endef define Package/youtubeUnblock/description