Skip to content

Commit

Permalink
Resolved merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 23, 2019
2 parents 6d61620 + 0f0c3f1 commit 500ffb9
Show file tree
Hide file tree
Showing 13 changed files with 389 additions and 274 deletions.
61 changes: 29 additions & 32 deletions .github/workflows/openwrt-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ on:
types: [published]

jobs:

build:

runs-on: ubuntu-latest

steps:
Expand All @@ -29,35 +31,29 @@ jobs:
with:
ref: master

- name: Initialization environment
- name: Space cleanup
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi `docker images -q`
echo "Deleting files, please wait ..."
sudo rm -rf /usr/share/dotnet /etc/apt/sources.list.d/*
sudo rm -rf \
/usr/share/dotnet \
/etc/mysql \
/etc/php
sudo -E apt-get -y purge \
azure-cli \
ghc* \
zulu* \
hhvm \
llvm* \
firefox \
google* \
dotnet* \
powershell \
openjdk* \
mysql* \
php*
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d
sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php*
sudo -E apt-get update
sudo -E apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
# 利用挂载在 /mnt/ 的 14G 额外空间:
# sudo mkdir -p -m 777 /mnt/openwrt/bin /mnt/openwrt/build_dir/host /mnt/openwrt/build_dir/hostpkg /mnt/openwrt/dl /mnt/openwrt/feeds /mnt/openwrt/staging_dir
# ln -s /mnt/openwrt/bin ./bin
# mkdir -p ./build_dir/host && ln -s /mnt/openwrt/build_dir/host ./build_dir/host
# mkdir -p ./build_dir/host && ln -s /mnt/openwrt/build_dir/hostpkg ./build_dir/hostpkg
# ln -s /mnt/openwrt/dl ./dl
# ln -s /mnt/openwrt/feeds ./feeds
# ln -s /mnt/openwrt/staging_dir ./staging_dir
df -h
- name: Update feeds
run: |
#git clone https://github.com/rosywrt/luci
Expand Down Expand Up @@ -217,24 +213,25 @@ jobs:
- name: Make download
run: |
make download -j8
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
- name: Compile firmware
run: |
echo -e "$(nproc) thread build."
make -j$(nproc) V=s
- name: Assemble artifact
run: |
rm -rf ./artifact/
mkdir -p ./artifact/
find ./bin/targets/ -name "*combined*img*" | xargs -i mv -f {} ./artifact/
find ./bin/targets/ -name "*sysupgrade*bin*" | xargs -i mv -f {} ./artifact/
make -j$(nproc) || make -j1 V=s
echo "======================="
echo "Space usage:"
echo "======================="
df -h
echo "======================="
du -h --max-depth=1 ./ --exclude=build_dir --exclude=bin
du -h --max-depth=1 ./build_dir
du -h --max-depth=1 ./bin
- name: Prepare artifact
run: find ./bin/targets/ -type d -name "packages" | xargs rm -rf {}

- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: OpenWrt firmware
path: ./artifact/
path: ./bin/targets/
4 changes: 2 additions & 2 deletions include/prereq-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $(eval $(call SetupHostCommand,gcc, \
gcc7 --version | grep gcc, \
gcc8 --version | grep gcc, \
gcc9 --version | grep gcc, \
gcc --version | grep Apple.LLVM ))
gcc --version | grep -E 'Apple.(LLVM|clang)' ))

$(eval $(call TestHostCommand,working-gcc, \
\nPlease reinstall the GNU C Compiler (4.8 or later) - \
Expand All @@ -56,7 +56,7 @@ $(eval $(call SetupHostCommand,g++, \
g++7 --version | grep g++, \
g++8 --version | grep g++, \
g++9 --version | grep g++, \
g++ --version | grep Apple.LLVM ))
g++ --version | grep -E 'Apple.(LLVM|clang)' ))

$(eval $(call TestHostCommand,working-g++, \
\nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
Expand Down
4 changes: 2 additions & 2 deletions package/lean/luci-app-kodexplorer/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2018-2019 Lienol
# Copyright (C) 2018-2020 Lienol <[email protected]>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
Expand All @@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for KodExplorer
LUCI_DEPENDS:=+nginx +zoneinfo-asia +php7 +php7-fpm +php7-mod-curl +php7-mod-gd +php7-mod-iconv +php7-mod-json +php7-mod-mbstring +php7-mod-opcache +php7-mod-session +php7-mod-zip
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=5-20190518
PKG_RELEASE:=10-20191217

include $(TOPDIR)/feeds/luci/luci.mk

Expand Down
62 changes: 35 additions & 27 deletions package/lean/luci-app-kodexplorer/luasrc/controller/kodexplorer.lua
Original file line number Diff line number Diff line change
@@ -1,46 +1,54 @@
-- Copyright 2018-2020 Lienol <[email protected]>
module("luci.controller.kodexplorer", package.seeall)

local http = require "luci.http"
local api = require "luci.model.cbi.kodexplorer.api"

function index()
if not nixio.fs.access("/etc/config/kodexplorer") then
return
end

entry({"admin","nas","kodexplorer"},cbi("kodexplorer/settings"),_("KodExplorer"),3).dependent=true

entry({"admin","nas","kodexplorer","check"},call("action_check")).leaf=true
entry({"admin","nas","kodexplorer","download"},call("action_download")).leaf=true
entry({"admin","nas","kodexplorer","status"},call("act_status")).leaf=true
if not nixio.fs.access("/etc/config/kodexplorer") then return end

entry({"admin", "nas"}, firstchild(), "NAS", 44).dependent = false
entry({"admin", "nas", "kodexplorer"}, cbi("kodexplorer/settings"),
_("KodExplorer"), 3).dependent = true

entry({"admin", "nas", "kodexplorer", "check"}, call("action_check")).leaf =
true
entry({"admin", "nas", "kodexplorer", "download"}, call("action_download")).leaf =
true
entry({"admin", "nas", "kodexplorer", "status"}, call("act_status")).leaf =
true
end

local function http_write_json(content)
http.prepare_content("application/json")
http.write_json(content or { code = 1 })
http.prepare_content("application/json")
http.write_json(content or {code = 1})
end

function act_status()
local e={}
e.nginx_status=luci.sys.call("ps -w | grep nginx | grep kodexplorer | grep -v grep > /dev/null") == 0
e.php_status=luci.sys.call("ps -w | grep php | grep kodexplorer | grep -v grep > /dev/null") == 0
http_write_json(e)
local e = {}
e.nginx_status = luci.sys.call(
"ps -w | grep nginx | grep kodexplorer | grep -v grep > /dev/null") ==
0
e.php_status = luci.sys.call(
"ps -w | grep php | grep kodexplorer | grep -v grep > /dev/null") ==
0
http_write_json(e)
end

function action_check()
local json = api.to_check()
http_write_json(json)
local json = api.to_check()
http_write_json(json)
end

function action_download()
local json = nil
local task = http.formvalue("task")
if task == "extract" then
json = api.to_extract(http.formvalue("file"))
elseif task == "move" then
json = api.to_move(http.formvalue("file"))
else
json = api.to_download(http.formvalue("url"))
end
http_write_json(json)
local json = nil
local task = http.formvalue("task")
if task == "extract" then
json = api.to_extract(http.formvalue("file"))
elseif task == "move" then
json = api.to_move(http.formvalue("file"))
else
json = api.to_download(http.formvalue("url"))
end
http_write_json(json)
end
Loading

0 comments on commit 500ffb9

Please sign in to comment.