Skip to content

Commit

Permalink
[bot] AutoMerging: merge all upstream's changes:
Browse files Browse the repository at this point in the history
* https://github.com/coolsnowwolf/lede:
  UnblockNeteaseMusic: bump to latest git HEAD (coolsnowwolf#6935)
  Update config-5.4 (coolsnowwolf#6927)
  zram-swap: sync upstream source (coolsnowwolf#6930)
  • Loading branch information
github-actions[bot] committed Jun 5, 2021
2 parents 890e5a4 + 6f0e710 commit b8632e8
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 59 deletions.
60 changes: 29 additions & 31 deletions package/lean/UnblockNeteaseMusic/Makefile
Original file line number Diff line number Diff line change
@@ -1,59 +1,57 @@

#
# Copyright (C) 2015-2020 OpenWrt.org
# Copyright (C) 2021 ImmortalWrt
# <https://immortalwrt.org>
#
# This is free software, licensed under the GNU General Public License v3.
#
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=UnblockNeteaseMusic
PKG_VERSION:=0.25.3
PKG_RELEASE:=6

PKG_LICENSE:=MIT
PKG_BASE_VERSION:=0.25.3
PKG_RELEASE:=7

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/1715173329/UnblockNeteaseMusic.git
PKG_SOURCE_VERSION:=7fe969342c2a977f00a4a7b6a275ffae04ffffea
PKG_SOURCE_DATE:=2021-06-05
PKG_SOURCE_VERSION:=dc129707e96a5338eddac090ed4af9f0045604b5
PKG_MIRROR_HASH:=e99c784f20db0a48d46cd6b05050a6cf8d6a07b29011d1017b08727b40f66972

PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
PKG_VERSION:=$(PKG_BASE_VERSION)-$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION))

include $(INCLUDE_DIR)/package.mk
PKG_LICENSE:=MIT
PKG_LICENSE_FILE:=LICENSE

define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Revive Netease Cloud Music (NodeJS)
DEPENDS:=+node
URL:=https://github.com/nondanee/UnblockNeteaseMusic/releases
SUBMENU:=NeteaseMusic
PKGARCH:=all
endef
include $(INCLUDE_DIR)/package.mk

define Package/$(PKG_NAME)/description
Revive Netease Cloud Music (NodeJS)
define Package/UnblockNeteaseMusic
SECTION:=multimedia
CATEGORY:=Multimedia
TITLE:=Revive Netease Cloud Music (NodeJS)
URL:=https://github.com/nondanee/UnblockNeteaseMusic
DEPENDS:=+node +libopenssl
PKGARCH:=all
endef

define Build/Prepare
tar -xzvf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR)
mkdir -p $(PKG_BUILD_DIR)/$(PKG_NAME)
echo -e $(PKG_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)/core_ver
echo -e $(PKG_SOURCE_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)/local_ver
mkdir -p $(PKG_BUILD_DIR)
xzcat $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
endef

define Build/Configure
echo -e $(PKG_BASE_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/core_ver
echo -e $(PKG_SOURCE_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/local_ver
endef

define Build/Compile
true
endef

define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)
cp -pR $(PKG_BUILD_DIR)/$(PKG_NAME)/* $(1)/usr/share/$(PKG_NAME)
define Package/UnblockNeteaseMusic/install
$(INSTALL_DIR) $(1)/usr/share/UnblockNeteaseMusic
$(CP) $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/* $(1)/usr/share/UnblockNeteaseMusic
endef

$(eval $(call BuildPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,UnblockNeteaseMusic))
14 changes: 10 additions & 4 deletions package/system/zram-swap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=zram-swap
PKG_VERSION:=1.1
PKG_RELEASE:=6
PKG_RELEASE:=8

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

Expand All @@ -18,14 +18,20 @@ include $(INCLUDE_DIR)/package.mk
define Package/zram-swap
SECTION:=utils
CATEGORY:=Base system
DEPENDS:=+kmod-zram +!(BUSYBOX_CONFIG_MKSWAP&&BUSYBOX_CONFIG_SWAPON&&BUSYBOX_CONFIG_SWAPOFF):swap-utils
DEPENDS:= \
+@BUSYBOX_CONFIG_FEATURE_SWAPON_DISCARD \
+@BUSYBOX_CONFIG_FEATURE_SWAPON_PRI \
+@BUSYBOX_CONFIG_MKSWAP \
+@BUSYBOX_CONFIG_SWAPOFF \
+@BUSYBOX_CONFIG_SWAPON \
+kmod-zram
TITLE:=ZRAM swap scripts
PKGARCH:=all
endef

define Package/zram-swap/description
A script to activate swaping on a compressed zram partition. This
could be used to increase the available memory, by using compressed
A script to activate swaping on a compressed zram partition. This
could be used to increase the available memory, by using compressed
memory.
endef

Expand Down
38 changes: 14 additions & 24 deletions package/system/zram-swap/files/zram.init
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ zram_applicable()
return 1
}

command -v mkswap >/dev/null || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'mkswap' not installed"
[ -x /sbin/mkswap ] || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox mkswap' not installed"
return 1
}

command -v swapon >/dev/null || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapon' not installed"
[ -x /sbin/swapon ] || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox swapon' not installed"
return 1
}

command -v swapoff >/dev/null || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapoff' not installed"
[ -x /sbin/swapoff ] || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox swapoff' not installed"
return 1
}
}
Expand Down Expand Up @@ -97,19 +97,6 @@ zram_comp_algo()
fi
}

zram_comp_streams()
{
local dev="$1"
local logical_cpus=$( grep -ci "^processor" /proc/cpuinfo )
[ $logical_cpus -gt 1 ] || return 1
local zram_comp_streams="$( uci -q get system.@system[0].zram_comp_streams )"
[ -n "$zram_comp_streams" ] && [ "$zram_comp_streams" -le "$logical_cpus" ] || zram_comp_streams=$logical_cpus
if [ -e /sys/block/$( basename $dev )/max_comp_streams ]; then
logger -s -t zram_comp_streams -p daemon.debug "Set max compression streams to '$zram_comp_streams' for zram '$dev'"
echo $zram_comp_streams > /sys/block/$( basename $dev )/max_comp_streams
fi
}

#print various stats info about zram swap device
zram_stats()
{
Expand All @@ -121,7 +108,6 @@ zram_stats()
printf "%-25s - %s\n" "Block device" $zdev
awk '{ printf "%-25s - %d MiB\n", "Device size", $1/1024/1024 }' <$zdev/disksize
printf "%-25s - %s\n" "Compression algo" "$(cat $zdev/comp_algorithm)"
printf "%-25s - %s\n" "Compression streams" "$( cat $zdev/max_comp_streams)"

awk 'BEGIN { fmt = "%-25s - %.2f %s\n"
fmt2 = "%-25s - %d\n"
Expand Down Expand Up @@ -164,6 +150,11 @@ zram_compact()

start()
{
[ -e /proc/swaps ] || {
logger -s -t zram_start -p daemon.crit "kernel doesn't support swap"
return 1
}

if [ $( grep -cs zram /proc/swaps ) -ne 0 ]; then
logger -s -t zram_start -p daemon.notice "[OK] zram swap is already mounted"
return 1
Expand All @@ -179,10 +170,9 @@ start()

zram_reset "$zram_dev" "enforcing defaults"
zram_comp_algo "$zram_dev"
zram_comp_streams "$zram_dev"
echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize"
mkswap "$zram_dev"
swapon -d $zram_priority "$zram_dev"
/sbin/mkswap "$zram_dev"
/sbin/swapon -d $zram_priority "$zram_dev"
}

stop()
Expand All @@ -191,7 +181,7 @@ stop()

for zram_dev in $( grep zram /proc/swaps |awk '{print $1}' ); do {
logger -s -t zram_stop -p daemon.debug "deactivate swap $zram_dev"
swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory back"
/sbin/swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory back"
local dev_index="$( echo $zram_dev | grep -o "[0-9]*$" )"
if [ $dev_index -ne 0 ]; then
logger -s -t zram_stop -p daemon.debug "removing zram $zram_dev"
Expand Down
1 change: 1 addition & 0 deletions target/linux/bcm27xx/bcm2711/config-5.4
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ CONFIG_CMA_SIZE_SEL_MBYTES=y
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
CONFIG_COMMON_CLK=y
CONFIG_COMMON_CLK_XGENE=y
CONFIG_COMPAT=y
CONFIG_CONFIGFS_FS=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_CONTIG_ALLOC=y
Expand Down

0 comments on commit b8632e8

Please sign in to comment.