Giter Site home page Giter Site logo

qdk's Introduction

QDK

The project is fork qnap SDK 2.2.4

QDK Download Link:

https://github.com/qnap-dev/QDK/releases/download/v2.3.13/QDK_2.3.13.zip

QPKG Development Guidelines


Description

QDK is used to build QPKG files/applications for QNAP Turbo NAS. A QPKG file makes it easy for anyone to install and remove packages. It also gives a package maintainer almost total control on how the package is installed on the NAS. The major design goal of QDK is to make it easy for the package maintainer to create simple QPKG files and at the same time also support more advanced packages. QDK started out as a simple modification of the first official release of the QPKG SDK, but now supersedes it. It includes many new features like architecture check at installation, support for digital signatures, different compression algorithms, a comprehensive option to check that other required QPKG packages are installed (or that conflicting packages are not installed), and a powerful build script.

Form QTS 4.2.0 on, no support Optware.

License

QDK is distributed under the GPL making it completely open and available for anyone to use.

Installation

Download and install the QPKG file and it will automatically create the system-wide configuration file, /etc/config/qdk.conf, and when enabled it also creates a symlink for qbuild in /usr/bin. The reference manual is included in a separate zip file. There is also a document (QDK Cookbook) with solutions to different common situations that you could run into when using QDK to build QPKG packages.

How to add icons in QPKG

Location of directory with icons for the packaged software. Default location is a directory named icons in $QDK_ROOT_DIR. The value must be a full path or a path relative to $QDK_ROOT_DIR. The icons shall be named ${QPKG_NAME}.gif, ${QPKG_NAME}_80.gif, and ${QPKG_NAME}_gray.gif.

  • ${QPKG_NAME}.gif is the image displayed in the web interface when the QPKG is enabled. It should be a GIF image of 64x64 pixels.

  • ${QPKG_NAME}_gray.gif is the image displayed in the web interface when the QPKG is disabled. It should be a GIF image of 64x64 pixels. It is usually a greyscale version of the ${QPKG_NAME}.gif image, but that is not a requirement.

  • ${QPKG_NAME}_80.gif is the image displayed in the pop-up dialog (with information about the QPKG and the buttons to enable, disable, and remove). It should be a GIF image of 80x80 pixels. If no icons are included then the QPKG is given default icons at installation.

How to create QPKG in docker

https://github.com/fcwu/docker-qdk2

https://github.com/qeek-dev/create-dpkg

How to install QDK on Ubuntu

sudo ./InstallToUbuntu.sh install

https://github.com/qnap-dev/qdk2/releases/download/v0.30/qdk2_0.30.trusty_amd64.deb

https://github.com/qnap-dev/qdk2/releases/download/v0.30/qdk2_0.30.xenial_amd64.deb

https://github.com/qnap-dev/qdk2/releases/download/v0.30/qdk2_0.30.bionic_amd64.deb

QDK Quick Start Guide

https://cheng-yuan-hong.gitbook.io/qdk-quick-start-guide/

Update new feature

2.3.13

-Add QPKG_FORCE_VISIBLE option in qpkg.cfg

2.3.12

-Add QPKG_REQUIRE_MSG option in qpkg.cfg

2.3.11

-Force to use codesigning.qnap.com:5001 instead of 172.17.21.68:5000
-Add preliminary support for newer code signing mechanism for 3rd party qpkg
-Fix one minor bug while handling anti-tampering error
-Fix qpkg install failed keep file in nas

2.3.10

-Support 3rd party self signed mechanism
-Do more check and error handling
-Use domain name instead of fixed ip address for code signing server (this is for qnap internal only)

2.3.9

-Some enhabcement and bug fix for code signing

2.3.8

-Add build_sign.csv sample file
-Fix some bug

2.3.7

-Fix the bug that sometimes the verification will fail

2.3.6

-Some changes for QNAP code signing and anti-tampering

2.3.5

-Added qnap internal code signing and anti-tampering support.(After QTS vserion 4.4.x support code signing and anti-tampering funtion.)

2.3.4

-Added code signing function for QNAP internal use only.

2.3.3

-Fixed install failed but app center show disable icon.

2.3.2

-Support Ubuntu.
-Fixed notification log.

2.3.1

-Change Notification level.

2.3.0

-Support Notification Center.
-Modify the info log error log and warning log description.

2.2.16

-Add new platform arm_64.

2.2.15

-Add "export QNAP_QPKG" in sample start script. It is for Resource Monitor to monitor the folk process.
-Add qbuild create md5sum file.
-Support png format.
-Change install log order.

2.2.14

-Add QNAP display name in qpkg.cfg.(The QPKG name displayed on QTS Web UI)
-Add support maxmum QTS version limitation.
-Fix template sample code bug.

2.2.13

-Add QTS HTTP Proxy and set Proxy_Path function in qpkg.cfg.
-Add Timeout (in seconds) for QPKG Enable (first integer) and Timeout for QPKG Disable function in qpkg.cfg. (second integer) (since 4.1.0)
-Add Visible setting for If the QPKG has web UI, show this QPKG on the Main menu function in qpkg.cfg.

2.2.12

-Add QTS system main volume mount check.

2.2.11

-Modify install succeeded system logs. 

2.2.10

-Add installation log to system logs.

2.2.9

-Support volume select(This function work on minimum QTS 4.2.1)

2.2.8

-Add to support minimum QTS version limitation.
-Add QTS apache root path.

2.2.7

-Command qbuild could use build bumber

2.2.6

-Enhance recognition of different platforms

2.2.4

-New platform - support arm_x31, ce53xx(TS-269H) and arm_x41(TS-x31+,TAS-x68) architecture string.
-New option - “Web_SSL_Port” that can access Web via SSL port.
-Bug fix: support extract QPKG that builded by previous QDK.
-Add QPKG_DESKTOP_APP="1" option.

qdk's People

Contributors

bitstreamout avatar edhongcy avatar edhongsomezo avatar ericchouqnap avatar even-wei avatar jwalton avatar kevinlia1 avatar walkerlee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qdk's Issues

How to build a QPKG on a Linux machine (not a QNAP)?

From the documentation it doesn't become clear to me how to cross-build a QPKG on a Linux machine (not being a QNAP device).

How can I start cross building a QPKG?

Or is there a virtual (image of a) QNAP device available?

Does QDK support code signing certificates on Azure Key Vault?

We renewed our OV code signing certificate on Azure Key Vault because it had expired.

Regarding QDK support for code signing certificates on Azure Key Vault, we have only found an offline HSM option available, and not a Cloud HSM option like Azure Key Vault.

[ enhancement ] Icons

Hi Ed

Can it be possbile to use .png instead of .gif for icons files

each time i have to rename .png to .gif
gif is too limited compared png

Output is not deterministic

If you run:

$ qbuild
$ cp build/foo_unknown.qpkg /tmp
$ qbuild
$ diff /tmp/foo_unknown.qpkg build/foo_unknown.qpkg
Binary files /tmp/foo_unknown.qpkg and build/foo/unknown.qpkg differ

This causes problems when using build systems like bazel, as we'll end up with a cache miss. There are also many other reasons why reproducible builds are a desireable thing.

I'm not sure if I've tracked down all the reasons this happens, but there are a couple I've found.

built_version

The built_version file contains the time at which the build happened. It would be nice if we could pass in a timestamp when we run qbuild and record this timestamp in the built_version file. This would let us pass in, for example, the timestamp of the most recent git commit, so the contents of this file would be predictable.

Timestamps in archives.

Threre are timestamps being recorded in various tar archives. and these timestamps are not stable. For example, when we call create_control_package, this copies a number of files into the build.$$ folder (which updates their mtimes to the current time) then runs tar to create the control.tar file. We should either be preserving the attributes of these files (with cp -a for example), or passing the --mtime option to tar.

The built_version file is another offender here, as we create it right before generating the control package. If we allow passing in a build timestamp, we could either touch this file with that timestamp or again use tar --mtime "${BUILD_TIMESTAMP}" ... to force the mtime of this file.

There are some places where we are implicitly recording timestamps too. For example, when creating the data archive with 7z we run:

/bin/tar $tar_verbose -cf - -C build.$$ . | /usr/local/sbin/7z a -si tmp.$$/data.tar.7z

and here 7z will record the current timestamp because of the -si option. We can work around this with:

/bin/tar $tar_verbose -cf tmp.$$/data.tar -C build.$$ . 
touch -d "${BUILD_TIME}" tmp.$$/data.tar
/usr/local/sbin/7z a tmp.$$/data.tar tmp.$$/data.tar.7z

which will explicitly set the timestamp in the 7z file. There's a similar problem with gzip compression, which can be worked around in much the same way.

Incorrect gzip tail

add_qpkg_tail() in qbuild is addind to qpkg something that recognaized by tar as trailing garbage.
So force tar to return warning "/bin/tar: Exiting with failure status due to previous errors"

So "sh ./aa.qpkg" is return
"aa 0.1 installation failed. Data file error.
Installation Abort."

This occurse only in terminal package installation.
If I comment add_qpkg_tail in qbuild the future installation is done also in terminal mode.

return code for package service script?

Hey guys, is there a way to get the return-code of the service script integrated into the QPKG when the package installation is complete?

Example: a QPKG is installed and executes the integrated service script start - but if the start process fails, the script return-code does not appear to be returned to the installer. So, the installer shows everything went fine, but the service isn't running.

I manually install a few QPKGs at the CLI and would like to be able to test that the service was started without issue.

Thank you.

QDK 2.3.0: QPKG failed to install due to missing Optware package (but it is installed)

I just built my QPKG with v.2.3.0 of the QDK but it won't installl ("Failed to install myqpkg. You must first install and enable JRE, OPT/busybox." The same QPKG worked fine when built with QDK 2.216.

In qpkg.cfg I defined
QPKG_REQUIRE="JRE, OPT/busybox"
If I limit QPKG_REQUIRE to "JRE", the installation works just fine.

What did I do wrong? I have Entware installed which provides - amongst other - busybox via opkg.

Thanks for looking at it or helping me to adjust my requirement.

Missing dependency in InstallToUbuntu.sh for rsync

apt-get install -y build-essential wget bsdmainutils curl python openssl

While building a QPKG with QDK in a Docker image I encountered the problem, that the contents of shared data wouldn't be copied in to the final package. There was no error output. Inspecting the qbuild script I found out, that there is a dependency to rsync.

It would be nice if you would add it to the required installed packages, installed by apt-get.

Why run a `rsync` when uninstalling QPKG?

Hi guys,

Just noticed this today in the .uninstall.sh for one of my QDK-built QPKGS:

# Remove QPKG directory, init-scripts, and icons.
if which rsync >/dev/null 2>&1; then
/bin/mkdir -p /tmp/qpkg_blankdir
rsync -a --delete /tmp/qpkg_blankdir "/share/CACHEDEV1_DATA/.qpkg/nzbToMedia"
/bin/rm -fr "/share/CACHEDEV1_DATA/.qpkg/nzbToMedia"
fi
/bin/rm -fr "/share/CACHEDEV1_DATA/.qpkg/nzbToMedia"

Why does the uninstaller perform an rsync from an empty directory in /tmp when the QPKG is being removed? Seems a rather odd thing to do.

Thank you.

Minimal sample is not installable

Creating and installing a sample QPGK does not work.
Create a qpkg called MyQPKG

qbuild --create-env MyQPKG
cd MyQPKG/
qbuild

Download MyQPKG_1.qpkg and install it via the web interface.
This leads to the error:
Failed to install MyQPKG. Downgrade QTS to 5.0.0 or an older compatible version.

`qbuild --extract` seems to be slightly broken

$ curl -o MalwareRemover-5.6.1.6.20220729_172738-x86_64.zip https://download.qnap.com/QPKG/MalwareRemover-5.6.1.6.20220729_172738-x86_64.zip
$ unzip MalwareRemover-5.6.1.6.20220729_172738-x86_64.zip
$ qbuild --extract ./MalwareRemover-5.6.1.6.20220729_172738-x86_64.qpkg
./
./data.tar.gz
./qpkg.cfg
./qinstall.sh

gzip: stdin: decompression OK, trailing garbage ignored
./package_routines
/bin/tar: Child returned status 2
/bin/tar: Error is not recoverable: exiting now

If I try this on QPKGs I build myself, I often see it succeed, but then when I try to unpack data.tar.gz it will be corrupt or files will be truncated.

Problem signing QPKG

When building a qpkg, there seems to be no problem signing:

qbuild -v
Creating archive with data files for x86_64...
Adding shared files...
Adding architecture specific files...
Adding icons...
Adding configuration files...
Adding built version...
Adapt the data package files (such as file owner)
Creating compressed tar archive...
Creating archive with control files...
Adding built information...
Creating QPKG package...
QPKG package name set to ##################
Packaging optional extra data files...
Adding header script...
Adding content...
control data...
data archive...
Adding signature...

You need a passphrase to unlock the secret key for
user: #####################################
4096-bit RSA key, ID ############, created 2021-02-01

Adding tail data...
Adding QPKG checksum: ############

but still, I get a Digital Signature Warning when installing...
What am I missing ?

releases GitHub

Hi Ed,

please propose release on Github .tar.gz . zip .qpkg (precompile)

thanks again,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.