├── .travis.yml ├── Makefile ├── README.md ├── deploy.sh └── files └── vlmcsd.init /.travis.yml: -------------------------------------------------------------------------------- 1 | #filename:.travis.yml 2 | dist: xenial 3 | sudo: false 4 | cache: 5 | bundler: true 6 | directories: 7 | - cache/ 8 | notifications: 9 | email: false 10 | language: c 11 | compiler: gcc 12 | env: 13 | global: 14 | - PACKAGE=vlmcsd 15 | - GH_USER=cokebar 16 | - GH_REPO=openwrt-vlmcsd 17 | matrix: 18 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/ar71xx/nand/openwrt-sdk-18.06.8-ar71xx-nand_gcc-7.3.0_musl.Linux-x86_64.tar.xz 19 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/ramips/mt7620/openwrt-sdk-18.06.8-ramips-mt7620_gcc-7.3.0_musl.Linux-x86_64.tar.xz 20 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/brcm63xx/generic/openwrt-sdk-18.06.8-brcm63xx-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz 21 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/bcm53xx/generic/openwrt-sdk-18.06.8-bcm53xx_gcc-7.3.0_musl_eabi.Linux-x86_64.tar.xz 22 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/brcm47xx/generic/openwrt-sdk-18.06.8-brcm47xx-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz 23 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/mvebu/cortexa9/openwrt-sdk-18.06.8-mvebu-cortexa9_gcc-7.3.0_musl_eabi.Linux-x86_64.tar.xz 24 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/mvebu/cortexa53/openwrt-sdk-18.06.8-mvebu-cortexa53_gcc-7.3.0_musl.Linux-x86_64.tar.xz 25 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/mvebu/cortexa72/openwrt-sdk-18.06.8-mvebu-cortexa72_gcc-7.3.0_musl.Linux-x86_64.tar.xz 26 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/x86/generic/openwrt-sdk-18.06.8-x86-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz 27 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/x86/64/openwrt-sdk-18.06.8-x86-64_gcc-7.3.0_musl.Linux-x86_64.tar.xz 28 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/kirkwood/generic/openwrt-sdk-18.06.8-kirkwood_gcc-7.3.0_musl_eabi.Linux-x86_64.tar.xz 29 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/brcm2708/bcm2708/openwrt-sdk-18.06.8-brcm2708-bcm2708_gcc-7.3.0_musl_eabi.Linux-x86_64.tar.xz 30 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/brcm2708/bcm2709/openwrt-sdk-18.06.8-brcm2708-bcm2709_gcc-7.3.0_musl_eabi.Linux-x86_64.tar.xz 31 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/mpc85xx/generic/openwrt-sdk-18.06.8-mpc85xx-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz 32 | - SDK_URL=https://downloads.openwrt.org/releases/18.06.8/targets/ipq806x/generic/openwrt-sdk-18.06.8-ipq806x_gcc-7.3.0_musl_eabi.Linux-x86_64.tar.xz 33 | install: 34 | - mkdir -p $TRAVIS_BUILD_DIR/local ; cd $TRAVIS_BUILD_DIR/local 35 | - wget "http://archive.ubuntu.com/ubuntu/pool/main/c/ccache/ccache_3.7.7-1_amd64.deb" 36 | - dpkg -x *.deb . 37 | - mkdir -p $TRAVIS_BUILD_DIR/cache ; cd $TRAVIS_BUILD_DIR/cache 38 | - wget -c $SDK_URL 39 | - mkdir -p $TRAVIS_BUILD_DIR/sdk ; cd $TRAVIS_BUILD_DIR/sdk 40 | - export FILE=$TRAVIS_BUILD_DIR/cache/$(basename $SDK_URL) 41 | - file $FILE 42 | - tar Jxf $FILE && SDK_DIR="openwrt-sdk-*" 43 | - cd $TRAVIS_BUILD_DIR/sdk/$SDK_DIR 44 | - mkdir package/$PACKAGE 45 | - ln -s $TRAVIS_BUILD_DIR/Makefile package/$PACKAGE/ 46 | - ln -s $TRAVIS_BUILD_DIR/files package/$PACKAGE/ 47 | script: 48 | - export PATH=$TRAVIS_BUILD_DIR/local/usr/bin:$PATH 49 | - cd $TRAVIS_BUILD_DIR/sdk/$SDK_DIR 50 | - export SDK_DIR=$(basename `pwd`) 51 | - export PATH=$TRAVIS_BUILD_DIR/sdk/$SDK_DIR/staging_dir/host/bin:$PATH 52 | - pushd staging_dir/toolchain-* 53 | - TOOLCHAIN_DIR=$(basename `pwd`) 54 | - export PATH=$TRAVIS_BUILD_DIR/sdk/$SDK_DIR/staging_dir/$TOOLCHAIN_DIR/bin:$PATH 55 | - popd 56 | - ./scripts/feeds update packages >/dev/null 57 | - make defconfig 58 | - make package/vlmcsd/compile V=s 59 | - find $TRAVIS_BUILD_DIR/sdk/$SDK_DIR/bin/ 60 | - find . -name *vlmcsd*.ipk -exec cp {} $TRAVIS_BUILD_DIR \; 61 | - cd $TRAVIS_BUILD_DIR/ 62 | - chmod a+x $TRAVIS_BUILD_DIR/deploy.sh 63 | after_success: "$TRAVIS_BUILD_DIR/deploy.sh" 64 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/rules.mk 2 | 3 | PKG_NAME:=vlmcsd 4 | PKG_VERSION:=svn1113 5 | PKG_RELEASE:=1 6 | 7 | PKG_MAINTAINER:=HotBird64 8 | PKG_LICENSE:=MIT 9 | PKG_LICENSE_FILES:=LICENSE 10 | 11 | PKG_SOURCE:=$(PKG_VERSION).tar.gz 12 | PKG_SOURCE_URL:=https://github.com/cokebar/vlmcsd/archive 13 | PKG_MD5SUM:=ea19cc1346fba447daced0224b670423 14 | 15 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) 16 | PKG_BUILD_PARALLEL:=1 17 | 18 | include $(INCLUDE_DIR)/package.mk 19 | 20 | define Package/vlmcsd 21 | SECTION:=net 22 | CATEGORY:=Network 23 | TITLE:=vlmcsd for OpenWRT 24 | URL:=http://forums.mydigitallife.info/threads/50234 25 | DEPENDS:=+libpthread 26 | endef 27 | 28 | define Package/vlmcsd/description 29 | vlmcsd is a KMS Emulator in C. 30 | endef 31 | 32 | MAKE_FLAGS += \ 33 | -C $(PKG_BUILD_DIR) 34 | 35 | define Package/vlmcsd/install 36 | $(INSTALL_DIR) $(1)/usr/bin 37 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vlmcsd $(1)/usr/bin/vlmcsd 38 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vlmcs $(1)/usr/bin/vlmcs 39 | $(INSTALL_DIR) $(1)/etc 40 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/etc/vlmcsd.ini $(1)/etc/vlmcsd.ini 41 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/etc/vlmcsd.kmd $(1)/etc/vlmcsd.kmd 42 | $(INSTALL_DIR) $(1)/etc/init.d 43 | $(INSTALL_BIN) ./files/vlmcsd.init $(1)/etc/init.d/vlmcsd 44 | endef 45 | 46 | $(eval $(call BuildPackage,vlmcsd)) 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | openwrt-vlmcsd 2 | ----- 3 | #### An OpenWRT package for vlmcsd. 4 | 5 | You can use [luci-app-vlmcsd](https://github.com/cokebar/luci-app-vlmcsd "") to control it. luci-app-vlmscd support KMS auto-activation. 6 | 7 | Travis CI: [![Build Status](https://travis-ci.org/cokebar/openwrt-vlmcsd.svg?branch=master)](https://travis-ci.org/cokebar/openwrt-vlmcsd) 8 | 9 | Using without luci-app-vlmcsd 10 | ----- 11 | If you don't use luci-app-vlmcsd and you want vlmcsd support KMS auto activation, you should modify the settings of dnsmasq manually: 12 | 13 | 1. Add the following line at the end of `/etc/dnsmasq.conf`: 14 | 15 |   `srv-host=_vlmcs._tcp.lan,hostname.lan,1688,0,100` 16 | 17 |   (replace "hostname.lan" with your actual host name, eg: openwrt.lan, or just replace it with your IP of LAN) 18 | 19 | 2. Restart dnsmasq: 20 | 21 | `/etc/init.d/dnsmasq restart` 22 | 23 | You can check if the dnsmasq setting works with the following cammand in Windows: 24 | 25 | `nslookup -type=srv _vlmcs._tcp.lan` 26 | 27 | The response should be your router's IP. 28 | 29 | 3. `/etc/init.d/vlmcsd enable && /etc/init.d/vlmcsd start && /etc/init.d/dnsmasq restart` 30 | 31 | Pre-compiled Download 32 | ----- 33 | Your can find pre-compiled ipk: 34 | https://github.com/cokebar/openwrt-vlmcsd/tree/gh-pages 35 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /tmp/ 4 | git clone https://${GH_USER}:${TOKEN}@github.com/${GH_USER}/${GH_REPO}.git --branch gh-pages \ 5 | --single-branch gh-pages > /dev/null 2>&1 || exit 1 # so that the key does not leak to the logs in case of errors 6 | cd gh-pages || exit 1 7 | git config user.name "cokebar" 8 | git config user.email "cokebar@cokebar.info" 9 | cp $TRAVIS_BUILD_DIR/*.ipk . 10 | #$TRAVIS_BUILD_DIR/sdk/$SDK_DIR/scripts/ipkg-make-index.sh . > Packages 11 | #gzip -c Packages > Packages.gz 12 | DATE=$(date "+%Y-%m-%d") 13 | cat > README.md < /dev/null 2>&1 || exit 1 22 | git push -fq origin gh-pages > /dev/null 2>&1 || exit 1 # so that the key does not leak to the logs in case of errors 23 | #git push -f origin gh-pages:gh-pages 24 | echo -e "Uploaded files to gh-pages\n" 25 | cd - 26 | -------------------------------------------------------------------------------- /files/vlmcsd.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=90 4 | 5 | start(){ 6 | if [ ! -f "/tmp/vlmcsd.pid" ]; then 7 | /usr/bin/vlmcsd -i /etc/vlmcsd.ini -j /etc/vlmcsd.kmd -p /tmp/vlmcsd.pid -l syslog -L 0.0.0.0:1688 -L [::]:1688 8 | echo "KMS Server has started." 9 | else 10 | echo "KMS Server has already started." 11 | fi 12 | } 13 | 14 | stop(){ 15 | if [ ! -f "/tmp/vlmcsd.pid" ]; then 16 | echo "KMS Server is not running." 17 | else 18 | pid=`cat /tmp/vlmcsd.pid` 19 | kill $pid 20 | rm -f /tmp/vlmcsd.pid 21 | echo "KMS Server has stopped." 22 | fi 23 | } 24 | 25 | restart(){ 26 | stop 27 | sleep 1 28 | start 29 | echo "KMS Server has restarted." 30 | } 31 | --------------------------------------------------------------------------------