From b13542fc0cfc80abeea110d4f83766acd007c4b5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 20:24:04 +0800 Subject: [PATCH] update 2022-09-07 20:24:04 --- linkease/Makefile | 4 +- luci-app-store/luasrc/controller/store.lua | 4 +- quickstart/Makefile | 3 +- quickstart/files/blockmount.init | 27 ++++++++++ quickstart/files/blockmount.sh | 61 +++++++++++++++------- quickstart/files/quickstart.uci-default | 14 ++--- 6 files changed, 78 insertions(+), 35 deletions(-) create mode 100755 quickstart/files/blockmount.init diff --git a/linkease/Makefile b/linkease/Makefile index bc887e83d..9b91f8ca8 100644 --- a/linkease/Makefile +++ b/linkease/Makefile @@ -10,11 +10,11 @@ include $(TOPDIR)/rules.mk PKG_ARCH_LINKEASE:=$(ARCH) PKG_NAME:=linkease -PKG_VERSION:=0.9.6 +PKG_VERSION:=0.9.7 PKG_RELEASE:=$(PKG_ARCH_LINKEASE)-1 PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://fw.koolcenter.com/binary/LinkEase/LinuxStorage/ -PKG_HASH:=bc6e5a1ef908636e4a0f5f7278d017b2961624550f9cc5e7301e2963b546b3e5 +PKG_HASH:=a3accdfe3ef293fb96f153e84ea91da7911f240d1ea13a2cc1bf4bb923682f87 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION) diff --git a/luci-app-store/luasrc/controller/store.lua b/luci-app-store/luasrc/controller/store.lua index 04d20a4d5..f3002dda3 100644 --- a/luci-app-store/luasrc/controller/store.lua +++ b/luci-app-store/luasrc/controller/store.lua @@ -128,7 +128,9 @@ function store_index() if luci.sys.call("which docker >/dev/null 2>&1") == 0 then features[#features+1] = "docker" end - + if luci.sys.call("[ -d /ext_overlay ] >/dev/null 2>&1") == 0 then + features[#features+1] = "sandbox" + end luci.template.render("store/main", {prefix=luci.dispatcher.build_url(unpack(page_index)),id=user_id(),lang=vue_lang(),features=features}) end diff --git a/quickstart/Makefile b/quickstart/Makefile index 745e226b6..c64a56dc8 100644 --- a/quickstart/Makefile +++ b/quickstart/Makefile @@ -11,7 +11,7 @@ PKG_ARCH_quickstart:=$(ARCH) PKG_NAME:=quickstart PKG_VERSION:=0.5.4 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://fw.koolcenter.com/binary/quickstart/ PKG_HASH:=78e69598982302e3cc1d59d1192b758b8b8d463c4bc88c6e5d0ed07242d1e9de @@ -56,6 +56,7 @@ define Package/$(PKG_NAME)/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/quickstart.$(PKG_ARCH_quickstart) $(1)/usr/sbin/quickstart $(INSTALL_BIN) ./files/blockphy.sh $(1)/usr/sbin/blockphy.sh $(INSTALL_BIN) ./files/blockmount.sh $(1)/usr/libexec/blockmount.sh + $(INSTALL_BIN) ./files/blockmount.init $(1)/etc/init.d/blockmount $(INSTALL_BIN) ./files/quickstart.init $(1)/etc/init.d/quickstart $(INSTALL_BIN) ./files/quickstart.uci-default $(1)/etc/uci-defaults/09-quickstart $(INSTALL_BIN) ./files/quickstart.hotplug $(1)/etc/hotplug.d/block/09-quickstart diff --git a/quickstart/files/blockmount.init b/quickstart/files/blockmount.init new file mode 100755 index 000000000..6a870f1c3 --- /dev/null +++ b/quickstart/files/blockmount.init @@ -0,0 +1,27 @@ +#!/bin/sh /etc/rc.common + +START=39 + +USE_PROCD=1 + +auto_mount() { + [ "`uci -q get fstab.@global[0].anon_mount`" = "1" ] && /usr/libexec/blockmount.sh + return 0 +} + +boot() { + auto_mount + start "$@" +} + +service_triggers() { + procd_add_reload_trigger "fstab" +} + +reload_service() { + auto_mount +} + +start_service() { + return 0 +} diff --git a/quickstart/files/blockmount.sh b/quickstart/files/blockmount.sh index a157f3c88..b0a547fcc 100755 --- a/quickstart/files/blockmount.sh +++ b/quickstart/files/blockmount.sh @@ -1,5 +1,7 @@ #!/bin/sh +DETECT=0 + if [ -z "$ACTION" ]; then log() { echo "$*" >&2 @@ -39,30 +41,35 @@ handle_part() { [ -n "$1" ] || return 1 # ignore mounted device, unknown fs type, swap or raid member - [ -n "$MOUNT" -o -z "$UUID" -o -z "$TYPE" \ + [ -z "$UUID" -o -z "$TYPE" \ -o "$TYPE" = "swap" \ -o "$TYPE" = "linux_raid_member" \ ] && return 0 - local DEVICENAME="${1#/dev/}" - local candidate="`/usr/sbin/blockphy.sh "$DEVICENAME"`" - [ -z "$candidate" ] && return 0 - candidate="/mnt/$candidate" - - # check if candidate mount point is busy - mountpoint -q "$candidate" && return 0 - - # check if configured - check_configured "$UUID" "$LABEL" "$1" "$candidate" || return 0 - - log "add mount $UUID => $candidate" - - uci -q batch <<-EOF >/dev/null - add fstab mount - set fstab.@mount[-1].uuid=$UUID - set fstab.@mount[-1].target=$candidate - set fstab.@mount[-1].enabled=1 + if [ "$DETECT" = "1" ]; then + [ -z "$MOUNT" ] && return 0 + log "add mount $UUID => $MOUNT" + uci -q batch <<-EOF >/dev/null + add fstab mount + set fstab.@mount[-1].uuid=$UUID + set fstab.@mount[-1].target=$MOUNT + set fstab.@mount[-1].enabled=0 EOF + elif [ -z "$MOUNT" ]; then + local DEVICENAME="${1#/dev/}" + local candidate="`/usr/sbin/blockphy.sh "$DEVICENAME"`" + [ -z "$candidate" ] && return 0 + candidate="/mnt/$candidate" + + # check if candidate mount point is busy + mountpoint -q "$candidate" && return 0 + + # check if configured + check_configured "$UUID" "$LABEL" "$1" "$candidate" || return 0 + + # log "add mount $UUID => $candidate" + mkdir -p "$candidate" && mount "$1" "$candidate" + fi } @@ -74,10 +81,24 @@ scan_all() { done } +if [ "$1" = "detect" ]; then + DETECT=1 + cat <<-EOF >/etc/config/fstab +config global + option anon_swap '0' + option anon_mount '1' + option auto_swap '1' + option auto_mount '1' + option delay_root '5' + option check_fs '0' + +EOF +fi + . /lib/functions.sh config_load fstab scan_all -uci commit fstab +[ "$DETECT" = "1" ] && uci commit fstab diff --git a/quickstart/files/quickstart.uci-default b/quickstart/files/quickstart.uci-default index 5df61c4c9..0f393b628 100644 --- a/quickstart/files/quickstart.uci-default +++ b/quickstart/files/quickstart.uci-default @@ -2,19 +2,11 @@ if [ "$PKG_UPGRADE" != 1 ]; then if [ ! -f /etc/config/fstab ]; then - cat <<-EOF >/etc/config/fstab -config global - option anon_swap '0' - option anon_mount '1' - option auto_swap '1' - option auto_mount '1' - option delay_root '5' - option check_fs '0' - -EOF - /usr/sbin/blockmount.sh 2>/dev/null + /usr/libexec/blockmount.sh detect 2>/dev/null fi else + /etc/init.d/blockmount enable + /etc/init.d/blockmount start /etc/init.d/quickstart enable /etc/init.d/quickstart start fi