Skip to content

Commit

Permalink
Merge pull request #37 from qnap-dev/feature/new-config-option
Browse files Browse the repository at this point in the history
feat: new config option by hero model
  • Loading branch information
edhongcy authored Sep 2, 2024
2 parents f1eaf3b + 7f12e98 commit a3cc9ae
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 24 deletions.
2 changes: 1 addition & 1 deletion qpkg.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
QPKG_NAME="QDK"
QPKG_VER="2.3.13"
QPKG_VER="2.3.14"
QPKG_AUTHOR="micke"
QPKG_LICENSE="GPLv2+"
QPKG_SUMMARY="QDK (QPKG Development Kit) is used to create QPKG packages."
Expand Down
2 changes: 1 addition & 1 deletion shared/qdk.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
QDK_VERSION=2.3.13
QDK_VERSION=2.3.14
QDK_PATH_P=`pwd | awk 'BEGIN { FS = "QDK" } ; { print $1 }'`
QDK_PATH="${QDK_PATH_P}/QDK"
2 changes: 1 addition & 1 deletion shared/scripts/code_signing.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
QPKG_NAME="QDK"
QPKG_VER="2.3.13"
QPKG_VER="2.3.14"
QNAP_CODE_SIGNING_SERVER_IP=codesigning.qnap.com.tw
QNAP_CODE_SIGNING_SERVER_PORT=5001
88 changes: 87 additions & 1 deletion shared/scripts/qinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# A QPKG installation script for QDK
#
# QDK V.2.3.13
# QDK V.2.3.14
#
# Copyright (C) 2009,2010 QNAP Systems, Inc.
# Copyright (C) 2010,2011 Michael Nordstrom
Expand Down Expand Up @@ -110,6 +110,17 @@ SYS_QPKG_CONF_FIELD_CONTAINER="Container"
SYS_QPKG_CONF_FIELD_EXEC_FILES="Exec_Files"
SYS_QPKG_CONF_FIELD_FW_VER_MIN="FW_Ver_Min"
SYS_QPKG_CONF_FIELD_FW_VER_MAX="FW_Ver_Max"
SYS_QPKG_CONF_FIELD_MOUNT_ACTION="Mount_Action"
SYS_QPKG_CONF_FIELD_UNMOUNT_ACTION="Unmount_Action"
SYS_QPKG_CONF_FIELD_SHARE_ADD_ACTION="Share_Add_Action"
SYS_QPKG_CONF_FIELD_SHARE_DEL_ACTION="Share_Del_Action"
SYS_QPKG_CONF_FIELD_ENTER_READDELETE_ACTION="Enter_ReadDelete_Action"
SYS_QPKG_CONF_FIELD_LEAVE_READDELETE_ACTION="Leave_ReadDelete_Action"
SYS_QPKG_CONF_FIELD_ACTION_TIMEOUT="Action_Timeout"
SYS_QPKG_CONF_FIELD_ENTER_HERO_LOW_SPACE="Enter_Hero_Low_space"
SYS_QPKG_CONF_FIELD_LEAVE_HERO_LOW_SPACE="Leave_Hero_Low_space"
SYS_QPKG_CONF_FIELD_ENTER_HERO_CRITICAL_LOW="Enter_Hero_Critical_Low"
SYS_QPKG_CONF_FIELD_LEAVE_HERO_CRITICAL_LOW="Leave_Hero_Critical_Low"
PREFIX="App Center"
# The following variables are assigned values at run-time.
SYS_HOSTNAME=$($CMD_HOSTNAME)
Expand Down Expand Up @@ -816,7 +827,71 @@ set_qpkg_fw_ver_max(){
set_qpkg_field $SYS_QPKG_CONF_FIELD_FW_VER_MAX "$QTS_MAX_VERSION"
fi
}
set_qpkg_mount_action(){
if [ -n "$QPKG_MOUNT_ACTION" ]; then
set_qpkg_field $SYS_QPKG_CONF_FIELD_MOUNT_ACTION "$QPKG_MOUNT_ACTION"
fi
}

set_qpkg_unmount_action(){
if [ -n "$QPKG_UNMOUNT_ACTION" ]; then
set_qpkg_field $SYS_QPKG_CONF_FIELD_UNMOUNT_ACTION "$QPKG_UNMOUNT_ACTION"
fi
}

set_qpkg_share_add_action(){
if [ -n "$QPKG_SHARE_ADD_ACTION" ]; then
set_qpkg_field $SYS_QPKG_CONF_FIELD_SHARE_ADD_ACTION "$QPKG_SHARE_ADD_ACTION"
fi
}

set_qpkg_share_del_action(){
if [ -n "$QPKG_SHARE_DEL_ACTION" ]; then
set_qpkg_field $SYS_QPKG_CONF_FIELD_SHARE_DEL_ACTION "$QPKG_SHARE_DEL_ACTION"
fi
}

set_qpkg_enter_readdelete_action(){
if [ -n "$QPKG_ENTER_READDELETE_ACTION" ]; then
set_qpkg_field $SYS_QPKG_CONF_FIELD_ENTER_READDELETE_ACTION "$QPKG_ENTER_READDELETE_ACTION"
fi
}

set_qpkg_leave_readdelete_action(){
if [ -n "$QPKG_LEAVE_READDELETE_ACTION" ]; then
set_qpkg_field $SYS_QPKG_CONF_FIELD_LEAVE_READDELETE_ACTION "$QPKG_LEAVE_READDELETE_ACTION"
fi
}

set_qpkg_action_timeout(){
if [ -n "$QPKG_ACTION_TIMEOUT" ]; then
set_qpkg_field $SYS_QPKG_CONF_FIELD_ACTION_TIMEOUT "$QPKG_ACTION_TIMEOUT"
fi
}

set_qpkg_enter_hero_low_space(){
if [ -n "$QPKG_ENTER_HERO_LOW_SPACE_ACTION" ]; then
set_qpkg_field $SYS_QPKG_CONF_FIELD_ENTER_HERO_LOW_SPACE "$QPKG_ENTER_HERO_LOW_SPACE_ACTION"
fi
}

set_qpkg_leave_hero_low_space(){
if [ -n "$QPKG_LEAVE_HERO_LOW_SPACE_ACTION" ]; then
set_qpkg_field $SYS_QPKG_CONF_FIELD_LEAVE_HERO_LOW_SPACE "$QPKG_LEAVE_HERO_LOW_SPACE_ACTION"
fi
}

set_qpkg_enter_hero_critical_low(){
if [ -n "$QPKG_ENTER_HERO_CRITICAL_LOW_ACTION" ]; then
set_qpkg_field $SYS_QPKG_CONF_FIELD_ENTER_HERO_CRITICAL_LOW "$QPKG_ENTER_HERO_CRITICAL_LOW_ACTION"
fi
}

set_qpkg_leave_hero_critical_low(){
if [ -n "$QPKG_LEAVE_HERO_CRITICAL_LOW_ACTION" ]; then
set_qpkg_field $SYS_QPKG_CONF_FIELD_LEAVE_HERO_CRITICAL_LOW "$QPKG_LEAVE_HERO_CRITICAL_LOW_ACTION"
fi
}

############################################################
# Store the current status of the QPKG to be able to
Expand Down Expand Up @@ -860,6 +935,17 @@ register_qpkg(){
set_qpkg_exec_file
set_qpkg_fw_ver_min
set_qpkg_fw_ver_max
set_qpkg_mount_action
set_qpkg_unmount_action
set_qpkg_share_add_action
set_qpkg_share_del_action
set_qpkg_enter_readdelete_action
set_qpkg_leave_readdelete_action
set_qpkg_action_timeout
set_qpkg_enter_hero_low_space
set_qpkg_leave_hero_low_space
set_qpkg_enter_hero_critical_low
set_qpkg_leave_hero_critical_low
}

##################
Expand Down
42 changes: 22 additions & 20 deletions shared/template/qpkg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,28 @@ QTS_MINI_VERSION="4.1.0"
# 1: administrators, 2: all NAS users, 3(default): No limit
#QPKG_FORCE_VISIBLE="3"

# Location of icons for the packaged application.
#QDK_DATA_DIR_ICONS="icons"
# Location of files specific to arm-x19 packages.
#QDK_DATA_DIR_X19="arm-x19"
# Location of files specific to arm-x31 packages.
#QDK_DATA_DIR_X31="arm-x31"
# Location of files specific to arm-x41 packages.
#QDK_DATA_DIR_X41="arm_al"
# Location of files specific to x86 packages.
#QDK_DATA_DIR_X86="x86"
# Location of files specific to x86 (64-bit) packages.
#QDK_DATA_DIR_X86_64="x86_64"
# Location of files common to all architectures.
#QDK_DATA_DIR_SHARED="shared"
# Location of configuration files.
#QDK_DATA_DIR_CONFIG="config"
# Name of local data package.
#QDK_DATA_FILE=""
# Name of extra package (multiple definitions are allowed).
#QDK_EXTRA_FILE=""
# Storage share folder add/delete action
#QPKG_SHARE_ADD_ACTION=""
#QPKG_SHARE_DEL_ACTION=""

# Storage mount/unmount action
#QPKG_MOUNT_ACTION=""
#QPKG_UNMOUNT_ACTION=""

# Register action volume status into read delete or read only mode
#QPKG_ENTER_READDELETE_ACTION=""
#QPKG_LEAVE_READDELETE_ACTION=""

# For Hero FW 5.2.x
#QPKG_ENTER_HERO_LOW_SPACE_ACTION=""
#QPKG_LEAVE_HERO_LOW_SPACE_ACTION=""

#QPKG_ENTER_HERO_CRITICAL_LOW_ACTION=""
#QPKG_LEAVE_HERO_CRITICAL_LOW_ACTION=""

# Default timeout is 15 sec, if without this option
#QPKG_ACTION_TIMEOUT=""

# For QNAP code signing (currently can be done only inside QNAP)
# Uncomment the following four options if you want to enable code signing for this QPKG
#QNAP_CODE_SIGNING="0"
Expand Down

0 comments on commit a3cc9ae

Please sign in to comment.