提交 d17588da 编写于 作者: C coolsnowwolf

first commit

上级 86d4ea83

要显示的变更太多。

To preserve performance only 1000 of 1000+ files are displayed.
Please make sure that the issue subject starts with `<package-name>: `
This repo here is only for packages maintained in this repo. For base packages residing in the same repo as the build system and maintained by core devs, please consider opening tickets there for more timely responses
- OpenWrt base system: https://bugs.openwrt.org
- Most LuCI packages: https://github.com/openwrt/luci/issues
# Issue template (remove lines from top till here)
Maintainer: @\<github-user> (find it by checking history of the package Makefile)
Environment: (put here arch, model, OpenWrt version)
Description:
```
Formating code blocks by wrapping them with pairs of ```
```
Maintainer: me / @\<github-user> (find it by checking history of the package Makefile)
Compile tested: (put here arch, model, OpenWrt version)
Run tested: (put here arch, model, OpenWrt version, tests done)
Description:
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: LEDE GnuPG key for unattended build jobs
mQINBFeXZ7wBEAC3QZ+jhWrdj2XW9AdZpZrgHETZCW7lXxI3pJ2kS4UXNq+40KR2
GJOdsXDnLb7ZiHNn6yio6qKLXFD/bimxK+22HSJlc3LSF2kKzNrgKoFR2rIKbL3c
Us7GpWY8VqGTrfwR6OQNcoWqa1n5/tK9xuqKhfpoA2Eci8K+w5YCzCmnOz2vzbgS
ptuFshTKYI2Z/DLQZyP+OQkEYPfCdani2KsISn4DTx8xFjmW/sb/zf0isemTwWyK
Oh76FTa0tYdjTtAv3JHqyr2XkddM/oUSc09baCOfhUdo7Ep5rUqKw7BQsjreBYoZ
WcL/hmlIksUrFlqo/HRpoBgCZpSjsF/Z9otZpSugMHVVlRCnAKQiWxWAd+V+y2FG
q79myPgiMkbkaIrCelrUhDFRQ5wTnfAppFolw+xtT9bwdkwxZDNBe6PCYuLqD8wg
jtDtt3q5UaUOMGJrMDKZ0Wi6ycdl/sM59kLfyBV4ybmYkwOLTlMvOATiyUZeJJZO
2bTKBvD+izsx3Ea4VLPWYSFmk6QwaOMtj6tcXwBgtljzqMJ0S9Gubmopy3WAkP/m
/6ETJpuIupqEtvbRTX4O/+qnBgY40aQX7B4NgJi2SypP/WML5v2B2amLlhTcN+we
ULWyH9KvfKny5mrtG5C9xq1eAgKtB2QEDEbRyz34DWVWGpqIY1mscaNv8wARAQAB
tFtMRURFIEJ1aWxkIFN5c3RlbSAoTEVERSBHbnVQRyBrZXkgZm9yIHVuYXR0ZW5k
ZWQgYnVpbGQgam9icykgPGxlZGUtYWRtQGxpc3RzLmluZnJhZGVhZC5vcmc+iQI4
BBMBAgAiBQJXl2e8AhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRDNhLzt
YmRx8aJ2D/9eRQWekaeX8eAcAgzguFS12ODlg23lJx00d0zLhZcA6LycYJRmFN+M
0tsVDZ6y7bLy1/h0YFYvYlJk4ZE+6sb4I/GSkMyqeZAy8whELYfEphXVYx0/wgyn
d57wE0lDo8/zmt3rK1eD0zJioN7cL3A/t3L++al4gwmqtTfUIl96AXc3YBe/rwXS
i7ShENVKYjTaMugP5BJ9kUZuaIjmXZWvREbURgBMWR7uR56XKJBwDBQMtHq2AoZs
2iNR3dG8r70Sb/cMSgAqhwDZfeV71r7+Pd+asvxYb0JeNNgZ2ss/BA5yapUKZLgu
hV6y7JSfHdb7q1t1j/wfqgYtQJB5K31JGxj+yaRxcF8LbvGZBNhaIJV+s4HmTeq4
yI20pCRNd8lLY80XAISTk8DPwgTLOvMPKbDYW4+/FC8J6qoD9DByQxDduUWn5uD4
LbVZ96v9+Ltf9LJzaxFVSE/dSsvgFNjo6u29ueG6aTxUIOc4Wi3mC0qNhqoyAbg6
Xg922EF/sd6hf3aQU9rpcPbcsNognGgrKfyREvMlBsQ9U3pRcKPlG05bfUcayXkh
59qIVU4kKCaW6LBy1fkBYyY3Nj5eoCAe9fm9ivi58FdI+7sKc2A1fMuVS83B370s
qAsu6v2rvqYz6nS5VFIWYJmL8kbUmf5FWwbucH7/jr9s3bB0wUHcI7kCDQRXl2h/
ARAAztMdT5ig5MKM02TFsmGvdc0SQVHPJymPTh6i/XwAbSeaTErvGLP3ke+2cdCj
MOes4steII5MU6aD57i1zU/6xhZ2Zr8sZ4fCOzfqoI4AOIeeuiO+I5by2P+M+vj2
v/U7KMWeixFjTkotWcvGGriP1jcRY1FHMrTfq/5lZYNHHzz/2zvszq02/WP+b/Gh
1Rf1yfr5DlXKw6Q+7fkCg8BWfLichTtHiR0OcO0mtD6ECxz+iqDElbSAeE9Q02fO
FTF4snHwCJvykHQ4EKudEoXcIEOR8TyH2tKorD821E/DSV9OA9XIBpDHavFQ3GCs
29GQcqci46nOLn/LWqgTB86sgH4mnQrGsceVYzf8avM8c8TyxkufBd/k01lPn1sK
/573AWdFRXVmOCMmlxPcI8k1+iGH1C7z0aX43NvhEI3xfbgTK8E/7Klrn/5xXUu2
UBYov0gKaZRy3LpGF/ySR1pvnHZmUP58my2LDfWDHdHrGmkjLaqyk/+qC9NKwUQB
S7jV7Mm15B0bkR7grLx+vN5lXVeGwyDL2dbRT0+cH8loHb+lBOR8AbDm4SJXdaRd
DtPyq85KN+jm+9NToRz+oydL9rmguU5zRcIDtaFiYr7ZtkLJU3U02rp0uf/DdytF
tzS/YEbpgg2Ui37q55ml707zJL2DvBffy/F2kiNpVfZ4u5cAEQEAAYkEPgQYAQIA
CQUCV5dofwIbAgIpCRDNhLztYmRx8cFdIAQZAQIABgUCV5dofwAKCRD5NSWoi2mQ
KQ/PD/9c/snQ2iok9H9PFinYmuOA6tf4Nbn0yX9oOTslDJ8ot6SB4OXGXGeT0lvq
ytbYVeAlifBElYRVFYZt76dbjhqmsmDMZsYHbaXIYLZSPuTETVE3pZrpWhm9Qkhb
eEyihAofgWleBmJcd8VXnrzsNkJGNokA6gqZ/ldqJtzMwkeHM58DHo/gFNNNlxe8
M83PHA0rN48F6DU4tZeEvz+/QGrnn4DWcBhmWo+2ZLvTLI4cB9389j8ks7FFFXLi
1gnWigWr29uGv8iZpAneY6414cZW3G79wTIwAATRvIvrI9pcvriUrMdOycTcwXOa
d9eXq/mJdg8dEpKiIA8Vc9UNdT93aZt8r610LbORmdq+wFjEhWvh7xKu9hFm/3UM
QUaVl3jsIlqZT4G8es+RLHnKVOzLMRovqRKRbsCsXxIxsVqxzhKQ5+wLCpisVNfH
51WCTSLoAz7s0jKLCSzueUIbhV2vNBM5lFLNCl35UgN1aYuRusI7GyqkPT/A8VWj
xVxn7o2SBIwyu4hZ4jFsq3qHOygIuRtdOHRX1vREmp7FA3+fVnx0CJUilfnGjhf/
oydfEC6GuWUn9kTEf2eJsONwQ9gPQ9QC9cFGRFRrVwQcejr7V+DBZSdzY8YLvn7R
qR3MmlXdpWijqj7noi2C+kbVqbLiX/LWe2axgKE+UTB7lGdl7v25D/99uFIzJmqA
dhEAEQgb17L7kOV0MOBwFtZ6fElJaQEQV49JiQmgTzALDgXD0ACpT5qoQYCBTwuz
m2D93ekfMnzxF8PmwW6a2czrG1KoRir2EayhgEoOJuWHLneb5nUc7X3krGNSJ3my
+lMw2QA3wIX7EAS6JJUnZFp7wawecdCekRF9ZE1Z/ZBiUZR17DkbAoYjEYZFxiXA
cG6sFEM9uTG+y91RcQPq8tY+jw2d76ZjHSnoKjnP2VxsmtiWQ7yLj/5tjrVzQftI
bbQQTK4V4O4aV2Y1wgkDbNPNJ6t0biQkHQv+4vaLMonOfMgGdWdYJ4hE9nlt61Aq
GidOnyMxOb+2XpVypOoOPcTyTqe8BUjCcvHQwukZLk3XE7OQoR0wZBFhOr4JCYzT
xIz9XYrSykZgkZMp8O4zbP+j1ZTXtJEvvPHjOS1HkL1O1H+W98dnl+oQMNQhHvvE
6UfWEolfuWvBpfP12pUnRQAAyCBql4JAFeoCJEdJGkz8oFOFxv0kCpd7JM1gWEs2
u0w61+5MelmliHImWiyhgV4XyKW6jeKWIpe9E5L7b8SPI5HHdT7opy3G7aD1XI3k
jdaIiMnJbq0nSvc5VqRE7Uv0EEcepvFeiuYHYydluxRyNf/ts2JskfEnsOc1JiS+
GPeIoGmFL85qtFOzc4sqYQGhLj9iMRfmNw==
=W2Tk
-----END PGP PUBLIC KEY BLOCK-----
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: LEDE 17.01 "Reboot" public key
mQINBFh9DQ8BEACmjR9z4mEXjTWBTcqHI8U38III55qStU4zX4mtYEm8KjaNyBu0
F8ghe22IAPQcHuvQh0lzr2AoTYi+ZAUlHrLb3s+YdJJD2KoSD1nXW8PgtoT92tai
utJjSKsB2ZWJc4nskAYXTkDmhTuuHBEg9hvljhXkrPxmcEDN/v1f5fv82U8JLYwt
g1mGJmW7SsdKtkJbAmEMCi/MFFA2fxLNV33qGhzm4UeAsUrLIGBjbCtU/BK8Im28
eAF9VP08OUK/QX7te6K6qumvuEIIc/GG4yatdbxltS1SjWYMS0vpqXm4v50CoMaB
/XCcdq1zlIyIxQW9UF6xJDLhsHv/3iOginR/vRDbdRWk/YPwlx/d9h9GK309YhXu
GUK/lrBHIZwZ4VEowYjK76isXmRuU9ZeTK9SeKdIyLzYg5NIXW9cvGR+4NKIqfmE
xxbVupm7Vc+3n4KUdS2t9SLXdkG+YYmyDabftyuACU2+xeHyKcUBn4yxbrcBp5Rs
5RgOIn/2BtiEQNSc8AagU1ie57VGErrwrpdW/Cmxrs+KG7Io8Pwv+nG9M53DqPwb
Zuun75iuni9wAR5IVUsUWdIoalb/I4ht58FDOt2iS/KdVwi8yyCHS8gH1J3MzZWP
Yy9k0pgup54CTXGv/KzDOAsPZzkwNiziWIVE0N49bZFkO0CXgAufOAEtewARAQAB
tFNMRURFIFJlbGVhc2UgQnVpbGRlciAoMTcuMDEgIlJlYm9vdCIgU2lnbmluZyBL
ZXkpIDxsZWRlLWRldkBsaXN0cy5sZWRlLXByb2plY3Qub3JnPokCPgQTAQIAKAUC
WH0NDwIbAwUJA8JnAAYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQgzxgENUr
u2tMaA//aRvfrOoMTVtjw+Pru+hBC7IhkusJ70x8gUxSPmHZX0+KvIvILyAeVEho
TW5lMwwo6b66GcBmP53qu/rech8HyunyyDUYFEvdE/ym3uO6NpE/3N/Z69TJiC+k
1imElx5njTZkH/qZSClqN8j6ehspywnSKWNfSOM/9K1G7qtWgiqIaDYa+sdtRHjx
oh4dtKiauUced0C1i7V1vT1ko8iZKWFiwj9GJSaoVxyUwI2fG3iV2qdcinPCL0nU
BfVIhU5cXMZ6VtVg5Ly6NqUbrhZzVVl8DMnu5z4MOLZWseob4LhK5W0v+DUTezJS
Cvei+woJ3SIy0CLXe6eDKwbCS5kCaoNbExeTnSz7/Mg14NjREhtWkq79rnHrH9MV
QAXyjmd3q0D5sDLzk8nQ3fGaH1Zg+o+VECkwEwz4ypctXqRAcHyIkYHmv8rFYlQY
dJlfs1NgZzk9EWfZ0/RLUdqNx6beKm27r2W1j+gcaM01sk5q9TPZeuNHh8psFlCD
b5mq6XBstA9NwN9pg5zS+UkfjjMU5FiBIEVv4Lt/dblNkjID/+XUBkHpSAz13GDW
k0ElkSBgBvz8TSm68EUGTfTVhK21x+1x15/8AUoV8V+4txncMhnJNmrEcKolnMeF
96xgcoHpPszlHxjiwS6hrFPDyhfYwU9plDI7ojcIleqK98XjRHY=
=aN5O
-----END PGP PUBLIC KEY BLOCK-----
git:
depth: 10
quiet: true
language: c
dist: trusty
sudo: false
cache:
directories:
- $HOME/sdk
before_script:
- ./.travis_do.sh download_sdk
script:
- ./.travis_do.sh test_packages
#!/bin/bash
#
# MIT Alexander Couzens <lynxis@fe80.eu>
set -e
SDK_HOME="$HOME/sdk"
SDK_PATH=https://downloads.lede-project.org/snapshots/targets/ar71xx/generic/
SDK=-sdk-ar71xx-generic_
PACKAGES_DIR="$PWD"
echo_red() { printf "\033[1;31m$*\033[m\n"; }
echo_green() { printf "\033[1;32m$*\033[m\n"; }
echo_blue() { printf "\033[1;34m$*\033[m\n"; }
exec_status() {
PATTERN="$1"
shift
while :;do sleep 590;echo "still running (please don't kill me Travis)";done &
("$@" 2>&1) | tee logoutput
R=${PIPESTATUS[0]}
kill $! && wait $! 2>/dev/null
if [ $R -ne 0 ]; then
echo_red "=> '$*' failed (return code $R)"
return 1
fi
if grep -qE "$PATTERN" logoutput; then
echo_red "=> '$*' failed (log matched '$PATTERN')"
return 1
fi
echo_green "=> '$*' successful"
return 0
}
get_sdk_file() {
if [ -e "$SDK_HOME/sha256sums" ] ; then
grep -- "$SDK" "$SDK_HOME/sha256sums" | awk '{print $2}' | sed 's/*//g'
else
false
fi
}
# download will run on the `before_script` step
# The travis cache will be used (all files under $HOME/sdk/). Meaning
# We don't have to download the file again
download_sdk() {
mkdir -p "$SDK_HOME"
cd "$SDK_HOME"
echo_blue "=== download SDK"
wget "$SDK_PATH/sha256sums" -O sha256sums
wget "$SDK_PATH/sha256sums.gpg" -O sha256sums.asc
# LEDE Build System (LEDE GnuPG key for unattended build jobs)
gpg --import $PACKAGES_DIR/.keys/626471F1.asc
echo '54CC74307A2C6DC9CE618269CD84BCED626471F1:6:' | gpg --import-ownertrust
# LEDE Release Builder (17.01 "Reboot" Signing Key)
gpg --import $PACKAGES_DIR/.keys/D52BBB6B.asc
echo 'B09BE781AE8A0CD4702FDCD3833C6010D52BBB6B:6:' | gpg --import-ownertrust
echo_blue "=== Verifying sha256sums signature"
gpg --verify sha256sums.asc
echo_blue "=== Verified sha256sums signature."
if ! grep -- "$SDK" sha256sums > sha256sums.small ; then
echo_red "=== Can not find $SDK file in sha256sums."
echo_red "=== Is \$SDK out of date?"
false
fi
# if missing, outdated or invalid, download again
if ! sha256sum -c ./sha256sums.small ; then
local sdk_file
sdk_file="$(get_sdk_file)"
echo_blue "=== sha256 doesn't match or SDK file wasn't downloaded yet."
echo_blue "=== Downloading a fresh version"
wget "$SDK_PATH/$sdk_file" -O "$sdk_file"
fi
# check again and fail here if the file is still bad
echo_blue "Checking sha256sum a second time"
if ! sha256sum -c ./sha256sums.small ; then
echo_red "=== SDK can not be verified!"
false
fi
echo_blue "=== SDK is up-to-date"
}
# test_package will run on the `script` step.
# test_package call make download check for very new/modified package
test_packages2() {
local commit_range=$TRAVIS_COMMIT_RANGE
if [ -z "$TRAVIS_PULL_REQUEST_SHA" ]; then
echo_blue "Using only the latest commit, since we're not in a Pull Request"
commit_range=HEAD~1
fi
# search for new or modified packages. PKGS will hold a list of package like 'admin/muninlite admin/monit ...'
PKGS=$(git diff --diff-filter=d --name-only "$commit_range" | grep 'Makefile$' | grep -v '/files/' | awk -F'/Makefile' '{ print $1 }')
if [ -z "$PKGS" ] ; then
echo_blue "No new or modified packages found!"
return 0
fi
echo_blue "=== Found new/modified packages:"
for pkg in $PKGS ; do
echo "===+ $pkg"
done
echo_blue "=== Setting up SDK"
tmp_path=$(mktemp -d)
cd "$tmp_path"
tar Jxf "$SDK_HOME/$(get_sdk_file)" --strip=1
# use github mirrors to spare lede servers
cat > feeds.conf <<EOF
src-git base https://github.com/lede-project/source.git
src-link packages $PACKAGES_DIR
src-git luci https://github.com/openwrt/luci.git
EOF
# enable BUILD_LOG
sed -i '1s/^/config BUILD_LOG\n\tbool\n\tdefault y\n\n/' Config-build.in
./scripts/feeds update -a > /dev/null
./scripts/feeds install -a > /dev/null
make defconfig > /dev/null
echo_blue "=== Setting up SDK done"
RET=0
# E.g: pkg_dir => admin/muninlite
# pkg_name => muninlite
for pkg_dir in $PKGS ; do
pkg_name=$(echo "$pkg_dir" | awk -F/ '{ print $NF }')
echo_blue "=== $pkg_name: Starting quick tests"
exec_status '^ERROR' make "package/$pkg_name/download" V=s || RET=1
exec_status '^ERROR' make "package/$pkg_name/check" V=s || RET=1
echo_blue "=== $pkg_name: quick tests done"
done
[ $RET -ne 0 ] && return $RET
for pkg_dir in $PKGS ; do
pkg_name=$(echo "$pkg_dir" | awk -F/ '{ print $NF }')
echo_blue "=== $pkg_name: Starting compile test"
# we can't enable verbose built else we often hit Travis limits
# on log size and the job get killed
exec_status '^ERROR' make "package/$pkg_name/compile" -j3 || RET=1
echo_blue "=== $pkg_name: compile test done"
echo_blue "=== $pkg_name: begin compile logs"
for f in $(find logs/package/feeds/packages/$pkg_name/ -type f); do
echo_blue "Printing last 200 lines of $f"
tail -n200 "$f"
done
echo_blue "=== $pkg_name: end compile logs"
echo_blue "=== $pkg_name: begin packages sizes"
du -ba bin/
echo_blue "=== $pkg_name: end packages sizes"
done
return $RET
}
test_commits() {
RET=0
if [ -z "$TRAVIS_PULL_REQUEST_SHA" ]; then
echo_blue "Skipping commits tests (not in a Pull Request)"
return 0
fi
for commit in $(git rev-list ${TRAVIS_COMMIT_RANGE/.../..}); do
echo_blue "=== Checking commit '$commit'"
if git show --format='%P' -s $commit | grep -qF ' '; then
echo_red "Pull request should not include merge commits"
RET=1
fi
author="$(git show -s --format=%aN $commit)"
if echo $author | grep -q '\S\+\s\+\S\+'; then
echo_green "Author name ($author) seems ok"
else
echo_red "Author name ($author) need to be your real name 'firstname lastname'"
RET=1
fi
subject="$(git show -s --format=%s $commit)"
if echo "$subject" | grep -q -e '^[0-9A-Za-z,/_-]\+: ' -e '^Revert '; then
echo_green "Commit subject line seems ok ($subject)"
else
echo_red "Commit subject line MUST start with '<package name>: ' ($subject)"
RET=1
fi
body="$(git show -s --format=%b $commit)"
sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)"
if echo "$body" | grep -qF "$sob"; then
echo_green "Signed-off-by match author"
else
echo_red "Signed-off-by is missing or doesn't match author (should be '$sob')"
RET=1
fi
done
return $RET
}
test_packages() {
test_commits && test_packages2 || return 1
}
echo_blue "=== Travis ENV"
env
echo_blue "=== Travis ENV"
if [ -n "$TRAVIS_PULL_REQUEST_SHA" ]; then
while true; do
# if clone depth is too small, git rev-list / diff return incorrect or empty results
C="$(git rev-list ${TRAVIS_COMMIT_RANGE/.../..} | tail -n1)" 2>/dev/null
[ -n "$C" -a "$C" != "a22de9b74cf9579d1ce7e6cf1845b4afa4277b00" ] && break
echo_blue "Fetching 50 commits more"
git fetch origin --deepen=50
done
fi
if [ $# -ne 1 ] ; then
cat <<EOF
Usage: $0 (download_sdk|test_packages)
download_sdk - download the SDK to $HOME/sdk.tar.xz
test_packages - do a make check on the package
EOF
exit 1
fi
$@
# Contributing Guidelines
(See <http://wiki.openwrt.org/doc/devel/packages> for overall format and construction)
### Basic guidelines
All packages you commit or submit by pull-request should follow these simple guidelines:
* Package a version which is still maintained by the upstream author.
* Will be updated regularly to maintained and supported versions.
* Have no dependencies outside the OpenWrt core packages or this repository feed.
* Have been tested to compile with the correct includes and dependencies. Please also test with "Compile with full language support" found under "General Build Settings" set if language support is relevant to your package.
* Do NOT use a rolling source file (e.g. foo-latest.tar.gz) or the head of a branch as source for the package since that would create unpredictable builds which change over time.
* Best of all -- it works as expected!
#### Makefile contents should contain:
* An up-to-date copyright notice. Use OpenWrt if no other present or supply your own.
* A (PKG_)MAINTAINER definition listing either yourself or another person in the field.
(E.g.: PKG_MAINTAINER:= Joe D. Hacker `<jdh@jdhs-email-provider.org`>)
* A PKG_LICENSE tag declaring the main license of the package.
(E.g.: PKG_LICENSE:=GPL-2.0+) Please use SPDX identifiers if possible (see list at the bottom).
* An optional PKG_LICENSE_FILES tag including the filenames of the license-files in the source-package.
(E.g.: PKG_LICENSE_FILES:=COPYING)
* PKG_RELEASE should be initially set to 1 or reset to 1 if the software version is changed. You should increment it if the package itself has changed. For example, modifying a support script, changing configure options like --disable* or --enable* switches, or if you changed something in the package which causes the resulting binaries to be different. Changes like correcting md5sums, changing mirror URLs, adding a maintainer field or updating a comment or copyright year in a Makefile do not require a change to PKG_RELEASE.
* Avoid reuse of PKG_NAME in call, define and eval lines to improve readability.
#### Commits in your pull-requests should:
* Have a useful description prefixed with the package name
(E.g.: "foopkg: Add libzot dependency")
* Include Signed-off-by in the comment
(See <https://dev.openwrt.org/wiki/SubmittingPatches#a10.Signyourwork>)
### Advice on pull requests:
Pull requests are the easiest way to contribute changes to git repos at Github. They are the preferred contribution method, as they offer a nice way for commenting and amending the proposed changes.
* You need a local "fork" of the Github repo.
* Use a "feature branch" for your changes. That separates the changes in the pull request from your other changes and makes it easy to edit/amend commits in the pull request. Workflow using "feature_x" as the example:
- Update your local git fork to the tip (of the master, usually)
- Create the feature branch with `git checkout -b feature_x`
- Edit changes and commit them locally
- Push them to your Github fork by `git push -u origin feature_x`. That creates the "feature_x" branch at your Github fork and sets it as the remote of this branch
- When you now visit Github, you should see a proposal to create a pull request
* If you later need to add new commits to the pull request, you can simply commit the changes to the local branch and then use `git push` to automatically update the pull request.
* If you need to change something in the existing pull request (e.g. to add a missing signed-off-by line to the commit message), you can use `git push -f` to overwrite the original commits. That is easy and safe when using a feature branch. Example workflow:
- Checkout the feature branch by `git checkout feature_x`
- Edit changes and commit them locally. If you are just updating the commit message in the last commit, you can use `git commit --amend` to do that
- If you added several new commits or made other changes that require cleaning up, you can use `git rebase -i HEAD~X` (X = number of commits to edit) to possibly squash some commits
- Push the changed commits to Github with `git push -f` to overwrite the original commits in the "feature_x" branch with the new ones. The pull request gets automatically updated
### If you have commit access:
* Do NOT use git push --force.
* Do NOT commit to other maintainer's packages without their consent.
* Use Pull Requests if you are unsure and to suggest changes to other maintainers.
#### Gaining commit access:
* We will gladly grant commit access to responsible contributors who have made
useful pull requests and / or feedback or patches to this repository or
OpenWrt in general. Please include your request for commit access in your
next pull request or ticket.
### Release Branches:
* Branches named "for-XX.YY" (e.g. for-14.07) are release branches.
* These branches are built with the respective OpenWrt release and are created
during the release stabilisation phase.
* Please ONLY cherry-pick or commit security and bug-fixes to these branches.
* Do NOT add new packages and do NOT do major upgrades of packages here.
* If you are unsure if your change is suitable, please use a pull request.
### Common LICENSE tags (short list)
(Complete list can be found at: <http://spdx.org/licenses>)
| Full Name | Identifier |
|---|:---|
|Apache License 1.0|Apache-1.0|
|Apache License 1.1|Apache-1.1|
|Apache License 2.0|Apache-2.0|
|Artistic License 1.0|Artistic-1.0|
|Artistic License 1.0 (Perl)|Artistic-1.0-Perl|
|Artistic License 1.0 w/clause 8|Artistic-1.0-cl8|
|Artistic License 2.0|Artistic-2.0|
|BSD 2-clause "Simplified" License|BSD-2-Clause|
|BSD 2-clause FreeBSD License|BSD-2-Clause-FreeBSD|
|BSD 2-clause NetBSD License|BSD-2-Clause-NetBSD|
|BSD 3-clause "New" or "Revised" License|BSD-3-Clause|
|BSD 3-clause Clear License|BSD-3-Clause-Clear|
|BSD 4-clause "Original" or "Old" License|BSD-4-Clause|
|BSD Protection License|BSD-Protection|
|BSD with attribution|BSD-3-Clause-Attribution|
|BSD-4-Clause (University of California-Specific)|BSD-4-Clause-UC|
|GNU General Public License v1.0 only|GPL-1.0|
|GNU General Public License v1.0 or later|GPL-1.0+|
|GNU General Public License v2.0 only|GPL-2.0|
|GNU General Public License v2.0 or later|GPL-2.0+|
|GNU General Public License v3.0 only|GPL-3.0|
|GNU General Public License v3.0 or later|GPL-3.0+|
|GNU Lesser General Public License v2.1 only|LGPL-2.1|
|GNU Lesser General Public License v2.1 or later|LGPL-2.1+|
|GNU Lesser General Public License v3.0 only|LGPL-3.0|
|GNU Lesser General Public License v3.0 or later|LGPL-3.0+|
|GNU Library General Public License v2 only|LGPL-2.0|
|GNU Library General Public License v2 or later|LGPL-2.0+|
|Fair License|Fair|
|ISC License|ISC|
|MIT License|MIT|
|No Limit Public License|NLPL|
|OpenSSL License|OpenSSL|
|X11 License|X11|
|zlib License|Zlib|
此差异已折叠。
# packages # OpenWrt packages feed
Community maintained packages for OpenWrt.
## Description
This is the OpenWrt "packages"-feed containing community-maintained build scripts, options and patches for applications, modules and libraries used within OpenWrt.
Installation of pre-built packages is handled directly by the **opkg** utility within your running OpenWrt system or by using the [OpenWrt SDK](http://wiki.openwrt.org/doc/howto/obtain.firmware.sdk) on a build system.
## Usage
This repository is intended to be layered on-top of an OpenWrt buildroot. If you do not have an OpenWrt buildroot installed, see the documentation at: [OpenWrt Buildroot – Installation](http://wiki.openwrt.org/doc/howto/buildroot.exigence) on the OpenWrt support site.
This feed is enabled by default. To install all its package definitions, run:
```
./scripts/feeds update packages
./scripts/feeds install -a -p packages
```
## License
See [LICENSE](LICENSE) file.
## Package Guidelines
See [CONTRIBUTING.md](CONTRIBUTING.md) file.
#
# Copyright (C) 2010 Gianluigi Tiesi <sherpya@netfarm.it>
# Copyright (C) 2011-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=debootstrap
PKG_VERSION:=1.0.92
PKG_RELEASE:=1
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap
PKG_HASH:=fa58c00529912d2cc187aa5434962376bd5ec00d3e7e9693f505a27b8848fdcf
PKG_LICENSE:=Unique
PKG_LICENSE_FILES:=debian/copyright
UNPACK_CMD=ar -p "$(DL_DIR)/$(PKG_SOURCE)" data.tar.xz | xzcat | tar -C $(1) -xf -
include $(INCLUDE_DIR)/package.mk
define Package/debootstrap
SECTION:=admin
CATEGORY:=Administration
TITLE:=Bootstrap a basic Debian system
URL:=http://wiki.debian.org/Debootstrap
DEPENDS:= +coreutils +coreutils-chroot +coreutils-sha1sum +ar +xz
endef
define Package/debootstrap/description
debootstrap is used to create a Debian base system from scratch, without
requiring the availability of dpkg or apt. It does this by downloading .deb
files from a mirror site, and carefully unpacking them into a directory which
can eventually be chrooted into.
endef
define Build/Compile
# file pkgdetails.c was imported from debian package base-installer version 1.130
$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) ./files/pkgdetails.c -o $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails
endef
define Package/debootstrap/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/sbin/$(PKG_NAME) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/share/debootstrap
$(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails $(1)/usr/share/debootstrap
$(INSTALL_DATA) $(PKG_BUILD_DIR)/usr/share/debootstrap/functions $(1)/usr/share/debootstrap
$(INSTALL_DIR) $(1)/usr/share/debootstrap/scripts
$(CP) $(PKG_BUILD_DIR)/usr/share/debootstrap/scripts/* $(1)/usr/share/debootstrap/scripts
endef
$(eval $(call BuildPackage,debootstrap))
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
#include <errno.h>
#define MAX_LINE 1000
#define MAX_PKGS 100
char *checksum_field=NULL;
static void oom_die(void)
{
fputs("Out of memory!\n", stderr);
exit(1);
}
static char *xvasprintf(const char *fmt, va_list ap) {
char *ret;
if (vasprintf (&ret, fmt, ap) < 0) {
if (errno == ENOMEM)
oom_die();
return NULL;
}
return ret;
}
static char *xasprintf(const char *fmt, ...) {
va_list ap;
char *ret;
va_start(ap, fmt);
ret = xvasprintf(fmt, ap);
va_end(ap);
return ret;
}
static char *fieldcpy(char *dst, char *fld) {
while (*fld && *fld != ':')
fld++;
if (!*(fld++))
return NULL;
while (isspace(*fld)) fld++;
return strcpy(dst, fld);
}
static void outputdeps(char *deps) {
char *pch = deps;
while (1) {
while (isspace(*pch)) pch++;
if (!*pch) break;
while (*pch && *pch != '(' && *pch != '|' && *pch != ','
&& !isspace(*pch))
{
fputc(*pch++, stdout);
}
fputc('\n', stdout);
while (*pch && *pch++ != ',') (void)NULL;
}
}
static void dogetdeps(char *pkgsfile, char **in_pkgs, int pkgc) {
char buf[MAX_LINE];
char cur_pkg[MAX_LINE];
char cur_deps[MAX_LINE];
char cur_predeps[MAX_LINE];
char prev_pkg[MAX_LINE];
char *pkgs[MAX_PKGS];
int i;
int skip;
FILE *f;
int output_pkg = -1;
cur_pkg[0] = cur_deps[0] = cur_predeps[0] = prev_pkg[0] = '\0';
for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i];
f = fopen(pkgsfile, "r");
if (f == NULL) {
perror(pkgsfile);
exit(1);
}
skip = 1;
while (fgets(buf, sizeof(buf), f)) {
if (*buf && buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0';
if (strncasecmp(buf, "Package:", 8) == 0) {
int any = 0;
skip = 1;
fieldcpy(cur_pkg, buf);
if (strcmp(cur_pkg, prev_pkg) != 0) {
if (output_pkg != -1)
pkgs[output_pkg] = NULL;
if (cur_deps[0])
outputdeps(cur_deps);
if (cur_predeps[0])
outputdeps(cur_predeps);
strcpy(prev_pkg, cur_pkg);
}
cur_deps[0] = cur_predeps[0] = '\0';
output_pkg = -1;
for (i = 0; i < pkgc; i++) {
if (!pkgs[i]) continue;
any = 1;
if (strcmp(cur_pkg, pkgs[i]) == 0) {
skip = 0;
output_pkg = i;
break;
}
}
if (!any) break;
} else if (!skip && strncasecmp(buf, "Depends:", 8) == 0)
fieldcpy(cur_deps, buf);
else if (!skip && strncasecmp(buf, "Pre-Depends:", 12) == 0)
fieldcpy(cur_predeps, buf);
}
if (cur_deps[0])
outputdeps(cur_deps);
if (cur_predeps[0])
outputdeps(cur_predeps);
fclose(f);
}
static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile,
char *fieldname, char **in_pkgs, int pkgc)
{
char buf[MAX_LINE];
char cur_field[MAX_LINE];
char cur_pkg[MAX_LINE];
char cur_ver[MAX_LINE];
char cur_arch[MAX_LINE];
char cur_size[MAX_LINE];
char cur_checksum[MAX_LINE];
char cur_filename[MAX_LINE];
char prev_pkg[MAX_LINE];
char *pkgs[MAX_PKGS];
int i;
FILE *f;
char *output = NULL;
int output_pkg = -1;
cur_field[0] = cur_pkg[0] = cur_ver[0] = cur_arch[0] = cur_filename[0] = prev_pkg[0] = '\0';
for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i];
f = fopen(pkgsfile, "r");
if (f == NULL) {
perror(pkgsfile);
exit(1);
}
while (fgets(buf, sizeof(buf), f)) {
if (*buf && buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0';
if (strncasecmp(buf, fieldname, strlen(fieldname)) == 0) {
fieldcpy(cur_field, buf);
}
if (strncasecmp(buf, "Package:", 8) == 0) {
fieldcpy(cur_pkg, buf);
if (strcmp(cur_pkg, prev_pkg) != 0) {
if (output)
fputs(output, stdout);
if (uniq && output_pkg != -1)
pkgs[output_pkg] = NULL;
strcpy(prev_pkg, cur_pkg);
}
free(output);
output = NULL;
output_pkg = -1;
} else if (strncasecmp(buf, "Version:", 8) == 0) {
fieldcpy(cur_ver, buf);
} else if (strncasecmp(buf, "Architecture:", 13) == 0) {
fieldcpy(cur_arch, buf);
} else if (strncasecmp(buf, "Size:", 5) == 0) {
fieldcpy(cur_size, buf);
} else if (strncasecmp(buf, checksum_field, strlen(checksum_field)) == 0
&& buf[strlen(checksum_field)] == ':') {
fieldcpy(cur_checksum, buf);
} else if (strncasecmp(buf, "Filename:", 9) == 0) {
fieldcpy(cur_filename, buf);
} else if (!*buf) {
int any = 0;
for (i = 0; i < pkgc; i++) {
if (!pkgs[i]) continue;
any = 1;
if (strcmp(cur_field, pkgs[i]) == 0) {
free(output);
output = xasprintf("%s %s %s %s %s %s %s\n", cur_pkg, cur_ver, cur_arch, mirror, cur_filename, cur_checksum, cur_size);
output_pkg = i;
break;
}
}
if (!any) break;
cur_field[0] = '\0';
}
}
if (output)
fputs(output, stdout);
if (uniq && output_pkg != -1)
pkgs[output_pkg] = NULL;
fclose(f);
/* any that weren't found are returned as "pkg -" */
if (uniq) {
for (i = 0; i < pkgc; i++) {
if (pkgs[i]) {
printf("%s -\n", pkgs[i]);
}
}
}
}
static void dopkgstanzas(char *pkgsfile, char **pkgs, int pkgc)
{
char buf[MAX_LINE];
char *accum;
size_t accum_size = 0, accum_alloc = MAX_LINE * 2;
char cur_pkg[MAX_LINE];
FILE *f;
accum = malloc(accum_alloc);
if (!accum)
oom_die();
f = fopen(pkgsfile, "r");
if (f == NULL) {
perror(pkgsfile);
free(accum);
exit(1);
}
while (fgets(buf, sizeof(buf), f)) {
if (*buf) {
size_t len = strlen(buf);
if (accum_size + len + 1 > accum_alloc) {
accum_alloc = (accum_size + len + 1) * 2;
accum = realloc(accum, accum_alloc);
if (!accum)
oom_die();
}
strcpy(accum + accum_size, buf);
accum_size += len;
}
if (*buf && buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0';
if (strncasecmp(buf, "Package:", 8) == 0) {
fieldcpy(cur_pkg, buf);
} else if (!*buf) {
int i;
for (i = 0; i < pkgc; i++) {
if (!pkgs[i]) continue;
if (strcmp(cur_pkg, pkgs[i]) == 0) {
fputs(accum, stdout);
if (accum[accum_size - 1] != '\n')
fputs("\n\n", stdout);
else if (accum[accum_size - 2] != '\n')
fputc('\n', stdout);
break;
}
}
*accum = '\0';
accum_size = 0;
}
}
fclose(f);
free(accum);
}
static int dotranslatewgetpercent(int low, int high, int end, char *str) {
int ch;
int val, lastval;
/* print out anything that looks like a % on its own line, appropriately
* scaled */
lastval = val = 0;
while ( (ch = getchar()) != EOF ) {
if (isdigit(ch)) {
val *= 10; val += ch - '0';
} else if (ch == '%') {
float f = (float) val / 100.0 * (high - low) + low;
if (str) {
printf("P: %d %d %s\n", (int) f, end, str);
} else {
printf("P: %d %d\n", (int) f, end);
}
lastval = val;
} else {
val = 0;
}
}
return lastval == 100;
}
int main(int argc, char *argv[]) {
checksum_field=getenv("DEBOOTSTRAP_CHECKSUM_FIELD");
if (checksum_field == NULL) {
checksum_field="MD5sum";
}
if ((argc == 6 || argc == 5) && strcmp(argv[1], "WGET%") == 0) {
if (dotranslatewgetpercent(atoi(argv[2]), atoi(argv[3]),
atoi(argv[4]), argc == 6 ? argv[5] : NULL))
{
exit(0);
} else {
exit(1);
}
} else if (argc >= 4 && strcmp(argv[1], "GETDEPS") == 0) {
int i;
for (i = 3; argc - i > MAX_PKGS; i += MAX_PKGS) {
dogetdeps(argv[2], argv+i, MAX_PKGS);
}
dogetdeps(argv[2], argv+i, argc-i);
exit(0);
} else if (argc >= 5 && strcmp(argv[1], "PKGS") == 0) {
int i;
for (i = 4; argc - i > MAX_PKGS; i += MAX_PKGS) {
dopkgmirrorpkgs(1, argv[2], argv[3], "Package:", argv+i, MAX_PKGS);
}
dopkgmirrorpkgs(1, argv[2], argv[3], "Package:", argv+i, argc-i);
exit(0);
} else if (argc >= 6 && strcmp(argv[1], "FIELD") == 0) {
int i;
for (i = 5; argc - i > MAX_PKGS; i += MAX_PKGS) {
dopkgmirrorpkgs(0, argv[3], argv[4], argv[2], argv+i, MAX_PKGS);
}
dopkgmirrorpkgs(0, argv[3], argv[4], argv[2], argv+i, argc-i);
exit(0);
} else if (argc >= 4 && strcmp(argv[1], "STANZAS") == 0) {
int i;
for (i = 3; argc - i > MAX_PKGS; i += MAX_PKGS) {
dopkgstanzas(argv[2], argv+i, MAX_PKGS);
}
dopkgstanzas(argv[2], argv+i, argc-i);
exit(0);
} else {
fprintf(stderr, "usage: %s PKGS mirror packagesfile pkgs..\n", argv[0]);
fprintf(stderr, " or: %s FIELD field mirror packagesfile pkgs..\n",
argv[0]);
fprintf(stderr, " or: %s GETDEPS packagesfile pkgs..\n", argv[0]);
fprintf(stderr, " or: %s STANZAS packagesfile pkgs..\n", argv[0]);
fprintf(stderr, " or: %s WGET%% low high end reason\n", argv[0]);
exit(1);
}
}
#
# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=htop
PKG_VERSION:=2.2.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://hisham.hm/htop/releases/$(PKG_VERSION)/
PKG_HASH:=d9d6826f10ce3887950d709b53ee1d8c1849a70fa38e91d5896ad8cbc6ba3c57
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/htop
SECTION:=admin
CATEGORY:=Administration
TITLE:=Interactive processes viewer
DEPENDS:=+libncurses
URL:=http://htop.sourceforge.net/
MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
endef
define Package/htop/description
Htop is an ncursed-based process viewer similar to top, but
it allows to scroll the list vertically and horizontally to
see all processes and their full command lines.
endef
CONFIGURE_ARGS += \
--disable-unicode \
--disable-hwloc
CONFIGURE_VARS += \
ac_cv_file__proc_stat=yes \
ac_cv_file__proc_meminfo=yes
define Package/htop/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
endef
$(eval $(call BuildPackage,htop))
#
# Copyright (C) 2017 Alexander Couzens <lynxis@fe80.eu>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ipmitool
PKG_VERSION:=1.8.18
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
PKG_HASH:=0c1ba3b1555edefb7c32ae8cd6a3e04322056bc087918f07189eeedfc8b81e01
PKG_LICENSE:=BSD-3-clause
PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/package.mk
define Package/ipmitool
SECTION:=admin
CATEGORY:=Administration
DEPENDS:=+libopenssl +libncurses +libreadline
TITLE:=Command-line interface to IPMI-enabled devices
URL:=http://sourceforge.net/projects/ipmitool/
MAINTAINER:=Alexander Couzens <lynxis@fe80.eu>
endef
define Package/ipmitool/Default/description
Command-line interface to IPMI-enabled devices
endef
define Package/ipmitool/install
$(INSTALL_DIR) $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ipmievd $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ipmitool $(1)/usr/sbin/
endef
define Package/ipmitool/conffiles
endef
CONFIGURE_ARGS += \
--enable-intf-lan \
--enable-intf-lanplus \
--enable-intf-serial \
--enable-intf-free \
--enable-intf-open \
--enable-intf-imb \
--enable-ipmishell
$(eval $(call BuildPackage,ipmitool))
#
# Copyright (C) 2006-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=monit
PKG_VERSION:=5.24.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_HASH:=754d1f0e165e5a26d4639a6a83f44ccf839e381f2622e0946d5302fa1f2d2414
PKG_SOURCE_URL:=https://mmonit.com/monit/dist
PKG_LICENSE:=AGPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/monit/Default
SECTION:=admin
CATEGORY:=Administration
DEPENDS:= +libpthread +zlib
TITLE:=System services monitoring utility
URL:=https://mmonit.com/monit/
MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
endef
define Package/monit/Default/description
An utility for monitoring services on a Unix system
endef
define Package/monit
$(call Package/monit/Default)
DEPENDS+= +libopenssl
TITLE+= (with SSL support)
VARIANT:=ssl
endef
define Package/monit/description
$(call Package/monit/Default/description)
This package is built with SSL support.
endef
define Package/monit-nossl
$(call Package/monit/Default)
TITLE+= (without SSL support)
VARIANT:=nossl
endef
define Package/monit-nossl/description
$(call Package/monit/Default/description)
This package is built without SSL support.
endef
CONFIGURE_ARGS += \
--without-pam \
libmonit_cv_setjmp_available=yes \
libmonit_cv_vsnprintf_c99_conformant=yes
ifeq ($(BUILD_VARIANT),ssl)
CONFIGURE_ARGS += \
--with-ssl \
--with-ssl-dir="$(STAGING_DIR)/usr"
endif
ifeq ($(BUILD_VARIANT),nossl)
CONFIGURE_ARGS += \
--without-ssl
endif
define Package/monit/conffiles
/etc/monitrc
endef
define Package/monit/install
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) $(PKG_BUILD_DIR)/monitrc $(1)/etc/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/monit.init $(1)/etc/init.d/monit
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/monit $(1)/usr/bin/
endef
Package/monit-nossl/conffiles = $(Package/monit/conffiles)
Package/monit-nossl/install = $(Package/monit/install)
$(eval $(call BuildPackage,monit))
$(eval $(call BuildPackage,monit-nossl))
#!/bin/sh /etc/rc.common
# Copyright (C) 2014 OpenWrt.org
START=60
USE_PROCD=1
PROG=/usr/bin/monit
start_service() {
[ -f /etc/monitrc ] || { echo "monit: /etc/monitrc is missing"; return 1; }
chmod 0600 /etc/monitrc
procd_open_instance
# -I runs in foreground, as procd requires
procd_set_param command "$PROG" -I
procd_close_instance
}
--- a/configure
+++ b/configure
@@ -13852,14 +13852,7 @@ fi
# Find the right directory to put the root-mode PID file in
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pid file location" >&5
$as_echo_n "checking pid file location... " >&6; }
-if test -d "/run"
-then
- piddir="/run"
-elif test -d "/var/run"; then
- piddir="/var/run"
-elif test -d "/etc"; then
- piddir="/etc"
-fi
+piddir="/var/run"
cat >>confdefs.h <<_ACEOF
#
# Copyright (C) 2006-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=muninlite
PKG_VERSION:=1.0.4
PKG_RELEASE:=8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
PKG_HASH:=736482dd6d6849d014d975b1f5794f20dda6e123dbba2d8c2f169c8e787e6f7e
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/muninlite
SECTION:=admin
CATEGORY:=Administration
DEPENDS:=+xinetd
TITLE:=Munin node implemented in shell
URL:=http://sourceforge.net/projects/muninlite/
PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
endef
define Package/muninlite/Default/description
Munin node implemented in shell.
Munin is a monitoring system for Unix networks.
endef
define Package/muninlite/install
$(INSTALL_DIR) $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/munin-node $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/xinetd.d
$(INSTALL_DATA) ./files/etc/xinetd.d/munin $(1)/etc/xinetd.d/
endef
define Package/muninlite/conffiles
/etc/xinetd.d/munin
endef
define Build/Configure
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)
endef
$(eval $(call BuildPackage,muninlite))
service munin
{
socket_type = stream
protocol = tcp
wait = no
user = root
group = root
server = /usr/sbin/munin-node
disable = no
}
--- a/plugins/df
+++ b/plugins/df
@@ -19,6 +19,6 @@ fetch_df() {
do
PINFO=$(df -P $PART | tail -1);
PNAME=$(echo $PINFO | cut -d\ -f1 | sed 's/[\/.-]/_/g')
- echo "$PNAME.value" $(echo $PINFO | cut -f5 -d\ | sed -e 's/\%//g')
+ echo "$PNAME.value" $(echo $PINFO | sed -e 's/\%//g' -e 's/ */ /g' | cut -f5 -d' ')
done
}
--- a/munin-node.in
+++ b/munin-node.in
@@ -113,7 +113,7 @@ PLUGINS=$RES
# ===== MAIN LOOP =====
FUNCTIONS="list nodes config fetch version quit"
-HOSTNAME=$(hostname -f 2>/dev/null || hostname)
+HOSTNAME=$(/sbin/uci get "system.@system[0].hostname" 2>/dev/null || cat /proc/sys/kernel/hostname)
echo "# munin node at $HOSTNAME"
while read arg0 arg1
do
--- a/plugins/if_
+++ b/plugins/if_
@@ -15,10 +15,14 @@ config_if() {
echo "up.min 0"
echo "up.negative down"
echo "up.cdef up,8,*"
- if ethtool $1 | grep -q Speed; then
- MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000))
- echo "up.max $MAX"
- echo "down.max $MAX"
+ if [ -n "$(which ethtool)" ]; then
+ if [ -x "$(which ethtool)" ]; then
+ if ethtool $1 | grep -q Speed; then
+ MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000))
+ echo "up.max $MAX"
+ echo "down.max $MAX"
+ fi
+ fi
fi
}
fetch_if() {
--- a/plugins/uptime
+++ b/plugins/uptime
@@ -4,8 +4,7 @@ config_uptime() {
echo "graph_vlabel uptime in days"
echo "uptime.label uptime"
echo "uptime.draw AREA"
- echo "uptime.cdef uptime,86400,/"
}
fetch_uptime() {
- echo "uptime.value" $(cut -d\ -f1 /proc/uptime)
+ awk '{printf "uptime.value %.2f",$1/86400; print ""}' /proc/uptime
}
--- a/munin-node.in
+++ b/munin-node.in
@@ -72,7 +72,7 @@ RES=""
for PLUG in $PLUGINS
do
if [ "$PLUG" = "if_" ]; then
- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
+ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
do
INTERRES=$(echo $INTER | sed 's/\./VLAN/')
RES="$RES if_$INTERRES"
@@ -80,7 +80,7 @@ do
eval "config_if_${INTERRES}() { config_if $INTER $@; };"
done
elif [ "$PLUG" = "if_err_" ]; then
- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
+ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
do
INTERRES=$(echo $INTER | sed 's/\./VLAN/')
RES="$RES if_err_$INTERRES"
--- a/munin-node.in
+++ b/munin-node.in
@@ -72,17 +72,17 @@ RES=""
for PLUG in $PLUGINS
do
if [ "$PLUG" = "if_" ]; then
- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
+ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
do
- INTERRES=$(echo $INTER | sed 's/\./VLAN/')
+ INTERRES=$(echo $INTER | sed -e 's/\./VLAN/' -e 's/\-/_/')
RES="$RES if_$INTERRES"
eval "fetch_if_${INTERRES}() { fetch_if $INTER $@; };"
eval "config_if_${INTERRES}() { config_if $INTER $@; };"
done
elif [ "$PLUG" = "if_err_" ]; then
- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
+ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
do
- INTERRES=$(echo $INTER | sed 's/\./VLAN/')
+ INTERRES=$(echo $INTER | sed -e 's/\./VLAN/' -e 's/\-/_/')
RES="$RES if_err_$INTERRES"
eval "fetch_if_err_${INTERRES}() { fetch_if_err $INTER $@; };"
eval "config_if_err_${INTERRES}() { config_if_err $INTER $@; };"
--- a/plugins/if_
+++ b/plugins/if_
@@ -26,7 +26,7 @@ config_if() {
fi
}
fetch_if() {
- IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ / /g')
+ IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ */ /g' -e 's/^[ \t]*//')
echo "down.value" $(echo $IINFO | cut -d\ -f1)
echo "up.value" $(echo $IINFO | cut -d\ -f9)
}
--- a/plugins/if_err_
+++ b/plugins/if_err_
@@ -15,7 +15,7 @@ config_if_err() {
echo "trans.warning 1"
}
fetch_if_err() {
- IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ / /g')
+ IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ */ /g' -e 's/^[ \t]*//')
echo "rcvd.value" $(echo $IINFO | cut -d\ -f3)
echo "trans.value" $(echo $IINFO | cut -d\ -f11)
}
--- a/munin-node.in
+++ b/munin-node.in
@@ -72,7 +72,7 @@ RES=""
for PLUG in $PLUGINS
do
if [ "$PLUG" = "if_" ]; then
- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
+ for INTER in $(grep -E '^ *(ppp|eth|wlan|ath|ra|ipsec|tap|br-)[^:]{1,}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
do
INTERRES=$(echo $INTER | sed -e 's/\./VLAN/' -e 's/\-/_/')
RES="$RES if_$INTERRES"
@@ -80,7 +80,7 @@ do
eval "config_if_${INTERRES}() { config_if $INTER $@; };"
done
elif [ "$PLUG" = "if_err_" ]; then
- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
+ for INTER in $(grep -E '^ *(ppp|eth|wlan|ath|ra|ipsec|tap|br-)[^:]{1,}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g');
do
INTERRES=$(echo $INTER | sed -e 's/\./VLAN/' -e 's/\-/_/')
RES="$RES if_err_$INTERRES"
#
# Copyright (C) 2008-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=netdata
PKG_VERSION:=1.10.0
PKG_RELEASE:=1
PKG_MAINTAINER:=
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/firehol/netdata/releases/download/v$(PKG_VERSION)
PKG_HASH:=0514fc002c5c5fb730156b3fe928965b22327833c6c17e22b7097eda657e77a2
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
define Package/netdata
SECTION:=admin
CATEGORY:=Administration
DEPENDS:=+zlib +libuuid +libmnl
TITLE:=Real-time performance monitoring tool
URL:=https://my-netdata.io/
endef
define Package/netdata/description
netdata is a highly optimized Linux daemon providing real-time performance
monitoring for Linux systems, applications and SNMP devices over the web.
endef
TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
TARGET_CFLAGS += -ffunction-sections -fdata-sections -O3
TARGET_LDFLAGS += -Wl,--gc-sections
CONFIGURE_ARGS += --with-zlib --with-math --disable-x86-sse --disable-lto
define Package/netdata/conffiles
/etc/netdata/
endef
define Package/netdata/install
mkdir -p $(1)/etc/netdata
$(CP) $(PKG_INSTALL_DIR)/etc/netdata $(1)/etc
$(CP) ./files/netdata.conf $(1)/etc/netdata
mkdir -p $(1)/usr/share/netdata
$(CP) $(PKG_INSTALL_DIR)/usr/share/netdata $(1)/usr/share
rm -rf $(1)/usr/share/netdata/web/images
rm -rf $(1)/usr/share/netdata/web/old
rm $(1)/usr/share/netdata/web/demo*html
rm $(1)/usr/share/netdata/web/fonts/*.svg
rm $(1)/usr/share/netdata/web/fonts/*.ttf
rm $(1)/usr/share/netdata/web/fonts/*.woff
mkdir -p $(1)/usr/lib/netdata
$(CP) $(PKG_INSTALL_DIR)/usr/lib/netdata $(1)/usr/lib
rm $(1)/usr/lib/netdata/python.d/python-modules-installer.sh
chmod 4755 $(1)/usr/lib/netdata/plugins.d/apps.plugin
mkdir -p $(1)/etc/init.d
$(INSTALL_BIN) ./files/netdata.init $(1)/etc/init.d/netdata
mkdir -p $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/netdata $(1)/usr/sbin
endef
$(eval $(call BuildPackage,netdata))
# netdata configuration
#
# You can download the latest version of this file, using:
#
# wget -O /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
# or
# curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
#
# You can uncomment and change any of the options below.
# The value shown in the commented settings, is the default value.
#
# global netdata configuration
[global]
# glibc malloc arena max for plugins = 1
# hostname = LEDE
# history = 4036
update every = 2
# config directory = /etc/netdata
# log directory = /var/log/netdata
# web files directory = /usr/share/netdata/web
# cache directory = /var/cache/netdata
# lib directory = /var/lib/netdata
# home directory = /var/cache/netdata
# plugins directory = "/usr/lib/netdata/plugins.d" "/etc/netdata/custom-plugins.d"
# memory mode = save
# host access prefix =
memory deduplication (ksm) = no
# TZ environment variable = :/etc/localtime
# timezone = UTC
# debug flags = 0x0000000000000000
debug log = syslog
error log = syslog
access log = none
# errors flood protection period = 1200
# errors to trigger flood protection = 200
run as user = root
# OOM score = 1000
# process scheduling policy = idle
# process nice level = 19
# pthread stack size = 81920
# cleanup obsolete charts after seconds = 3600
# gap when lost iterations above = 1
# cleanup orphan hosts after seconds = 3600
# delete obsolete charts files = yes
# delete orphan hosts files = yes
[web]
# mode = static-threaded
# listen backlog = 4096
# default port = 19999
# bind to = *
# web files owner = nobody
# web files group = nogroup
# disconnect idle clients after seconds = 60
# timeout for first request = 60
# respect do not track policy = no
# x-frame-options response header =
allow connections from = localhost 10.* 192.168.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.*
allow dashboard from = localhost 10.* 192.168.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.*
# allow badges from = *
# allow streaming from = *
# allow netdata.conf from = localhost fd* 10.* 192.168.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.*
# enable gzip compression = yes
# gzip compression strategy = default
# gzip compression level = 3
# web server threads = 2
# web server max sockets = 512
[plugins]
# PATH environment variable = /usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
# PYTHONPATH environment variable =
# proc = yes
# diskspace = yes
# cgroups = yes
# tc = yes
# idlejitter = yes
# enable running new plugins = yes
# check for new plugins every = 60
apps = no
charts.d = no
fping = no
node.d = no
python.d = no
[health]
enabled = no
# in memory max health log entries = 1000
# script to execute on alarm = /usr/lib/netdata/plugins.d/alarm-notify.sh
# health configuration directory = /etc/netdata/health.d
# run at least every seconds = 10
# postpone alarms during hibernation for seconds = 60
# rotate log every lines = 2000
[statsd]
enabled = no
# update every (flushInterval) = 1
# udp messages to process at once = 10
# create private charts for metrics matching = *
# max private charts allowed = 200
# max private charts hard limit = 1000
# private charts memory mode = save
# private charts history = 4036
# decimal detail = 1000
# disconnect idle tcp clients after seconds = 600
# private charts hidden = no
# histograms and timers percentile (percentThreshold) = 95.00000
# add dimension for number of events received = yes
# gaps on gauges (deleteGauges) = no
# gaps on counters (deleteCounters) = no
# gaps on meters (deleteMeters) = no
# gaps on sets (deleteSets) = no
# gaps on histograms (deleteHistograms) = no
# gaps on timers (deleteTimers) = no
# statsd server max TCP sockets = 256
# listen backlog = 4096
# default port = 8125
# bind to = udp:localhost tcp:localhost
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
APPBINARY=/usr/sbin/netdata
CONFIGFILE=/etc/netdata/netdata.conf
start_service() {
mkdir -m 0755 -p /var/cache/netdata
chown nobody /var/cache/netdata
mkdir -m 0755 -p /var/lib/netdata
chown nobody /var/lib/netdata
mkdir -m 0755 -p /var/log/netdata
chown nobody /var/log/netdata
procd_open_instance
procd_set_param command $APPBINARY -nd -c $CONFIGFILE
procd_set_param file $CONFIGFILE
procd_set_param respawn
procd_close_instance
}
--- a/conf.d/charts.d.conf
+++ b/conf.d/charts.d.conf
@@ -30,7 +30,7 @@
# the default enable/disable for all charts.d collectors
# the default is "yes"
-# enable_all_charts="yes"
+enable_all_charts="no"
# BY DEFAULT ENABLED MODULES
# ap=yes
--- a/conf.d/python.d.conf
+++ b/conf.d/python.d.conf
@@ -7,7 +7,7 @@
#
# Enable / disable the whole python.d.plugin (all its modules)
-enabled: yes
+enabled: no
# Prevent log flood
# Define how many log messages can be written to log file in one log_interval
# openwisp.org
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=openwisp-config
PKG_VERSION:=0.4.5
PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/openwisp/openwisp-config.git
PKG_SOURCE_VERSION:=0.4.5
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_MIRROR_HASH:=017a8ed35ebfda2805426e7da02559d5cc2845ee9ded60fdae8e848d377424fb
PKG_LICENSE:=GPL-3.0
PKGARCH:=all
include $(INCLUDE_DIR)/package.mk
define Package/openwisp-config/default
TITLE:=Remote configuration management agent ($(2) variant)
CATEGORY:=Administration
SECTION:=admin
SUBMENU:=openwisp
DEPENDS:=+curl +lua +libuci-lua +luafilesystem $(3)
VARIANT:=$(1)
MAINTAINER:=Federico Capoano <f.capoano@cineca.it>
URL:=http://openwisp.org
endef
Package/openwisp-config-openssl=$(call Package/openwisp-config/default,openssl,OpenSSL,+ca-certificates +libopenssl)
Package/openwisp-config-mbedtls=$(call Package/openwisp-config/default,mbedtls,mbedTLS,+ca-certificates +libmbedtls)
Package/openwisp-config-cyassl=$(call Package/openwisp-config/default,cyassl,CyaSSL,+ca-certificates +libcyassl)
Package/openwisp-config-nossl=$(call Package/openwisp-config/default,nossl,No SSL)
define Build/Compile
endef
define Package/openwisp-config-$(BUILD_VARIANT)/conffiles
/etc/config/openwisp
endef
ifeq ($(BUILD_VARIANT),openssl)
CONFIG_OPENWISP_UCI:=ssl
endif
ifeq ($(BUILD_VARIANT),mbedtls)
CONFIG_OPENWISP_UCI:=ssl
endif
ifeq ($(BUILD_VARIANT),cyassl)
CONFIG_OPENWISP_UCI:=ssl
endif
ifeq ($(BUILD_VARIANT),nossl)
CONFIG_OPENWISP_UCI:=nossl
endif
define Package/openwisp-config-$(BUILD_VARIANT)/install
$(INSTALL_DIR) \
$(1)/usr/sbin \
$(1)/etc/init.d \
$(1)/etc/config \
$(1)/etc/openwisp \
$(1)/usr/lib/lua/openwisp
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/openwisp.agent \
$(1)/usr/sbin/openwisp_config
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/openwisp.init \
$(1)/etc/init.d/openwisp_config
$(INSTALL_CONF) $(PKG_BUILD_DIR)/openwisp-config/files/openwisp-$(CONFIG_OPENWISP_UCI).config \
$(1)/etc/config/openwisp
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-reload-config \
$(1)/usr/sbin/openwisp-reload-config
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/lib/openwisp/utils.lua \
$(1)/usr/lib/lua/openwisp/utils.lua
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-store-unmanaged.lua \
$(1)/usr/sbin/openwisp-store-unmanaged
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-restore-unmanaged.lua \
$(1)/usr/sbin/openwisp-restore-unmanaged
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-remove-default-wifi.lua \
$(1)/usr/sbin/openwisp-remove-default-wifi
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-uci-autoname.lua \
$(1)/usr/sbin/openwisp-uci-autoname
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-update-config.lua \
$(1)/usr/sbin/openwisp-update-config
$(CP) $(PKG_BUILD_DIR)/VERSION $(1)/etc/openwisp/
endef
$(eval $(call BuildPackage,openwisp-config-openssl))
$(eval $(call BuildPackage,openwisp-config-mbedtls))
$(eval $(call BuildPackage,openwisp-config-cyassl))
$(eval $(call BuildPackage,openwisp-config-nossl))
#
# Copyright (C) 2006-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=sudo
PKG_VERSION:=1.8.21p2
PKG_RELEASE:=1
PKG_LICENSE:=ISC
PKG_LICENSE_FILES:=doc/LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.sudo.ws/dist
PKG_HASH:=74c5746cd33a814e2431c39faf0d76f7f8a697379bd073862e3b156cf0d76368
PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=sudo/host
include $(INCLUDE_DIR)/package.mk
define Package/sudo
SECTION:=admin
CATEGORY:=Administration
TITLE:=Delegate authority to run commands
URL:=http://www.sudo.ws/
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
endef
define Package/sudo/description
Sudo (su "do") allows a system administrator to delegate authority to
give certain users (or groups of users) the ability to run some (or
all) commands as root or another user while providing an audit trail of
the commands and their arguments.
endef
define Package/sudo/conffiles
/etc/sudoers
/etc/sudoers.d/
endef
CONFIGURE_ARGS+= \
--without-pam \
--disable-pam-session \
--with-editor=/bin/vi \
--without-lecture \
--disable-zlib \
--with-rundir=/var/lib/sudo \
--with-vardir=/var/lib/sudo
CONFIGURE_VARS+= \
sudo_cv_uid_t_len=10 \
sudo_cv_func_unsetenv_void=no
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
cd $(HOST_BUILD_DIR)/lib/util; \
$(MAKE) mksiglist; $(MAKE) mksigname
endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
$(CP) $(HOST_BUILD_DIR)/lib/util/mksig{list,name} $(STAGING_DIR_HOSTPKG)/bin/
endef
$(eval $(call HostBuild))
define Package/sudo/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/sudo $(1)/usr/bin/
chmod 4755 $(1)/usr/bin/sudo
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/visudo $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc
$(CP) $(PKG_INSTALL_DIR)/etc/sudoers $(1)/etc/
chmod 0440 $(1)/etc/sudoers
$(INSTALL_DIR) $(1)/etc/sudoers.d
$(INSTALL_DIR) $(1)/usr/lib/sudo
$(CP) $(PKG_INSTALL_DIR)/usr/lib/sudo/*.so* $(1)/usr/lib/sudo/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/sudo.init $(1)/etc/init.d/sudo
endef
define Package/sudo/postinst
#!/bin/sh
[ -n "$$IPKG_INSTROOT" ] || {
/etc/init.d/sudo enable
/etc/init.d/sudo start
}
endef
$(eval $(call BuildPackage,sudo))
#!/bin/sh /etc/rc.common
# Copyright (C) 2014 OpenWrt.org
START=99
start() {
[ -d /var/lib/sudo ] || {
mkdir -m 0755 -p /var/lib/sudo
chmod 0700 /var/lib/sudo
}
}
diff -rupN sudo-1.8.11p2.orig/lib/util/Makefile.in sudo-1.8.11p2/lib/util/Makefile.in
--- sudo-1.8.11p2.orig/lib/util/Makefile.in 2014-10-07 22:26:20.000000000 +0200
+++ sudo-1.8.11p2/lib/util/Makefile.in 2014-12-09 21:44:35.610041162 +0100
@@ -142,10 +142,10 @@ libsudo_util.la: $(LTOBJS) @LT_LDDEP@
esac
siglist.c: mksiglist
- ./mksiglist > $@
+ mksiglist > $@
signame.c: mksigname
- ./mksigname > $@
+ mksigname > $@
mksiglist: $(srcdir)/mksiglist.c $(srcdir)/mksiglist.h $(incdir)/sudo_compat.h $(top_builddir)/config.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mksiglist.c -o $@
diff -rupN sudo-1.8.11p2.orig/Makefile.in sudo-1.8.11p2/Makefile.in
--- sudo-1.8.11p2.orig/Makefile.in 2014-10-07 22:26:20.000000000 +0200
+++ sudo-1.8.11p2/Makefile.in 2014-12-09 22:00:27.256934143 +0100
@@ -62,7 +62,7 @@ SHELL = @SHELL@
SED = @SED@
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
-INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
+INSTALL_OWNER =
ECHO_N = @ECHO_N@
ECHO_C = @ECHO_C@
diff -rupN sudo-1.8.14p3.orig/include/sudo_util.h sudo-1.8.14p3/include/sudo_util.h
--- sudo-1.8.14p3.orig/include/sudo_util.h 2015-07-22 14:22:49.000000000 +0200
+++ sudo-1.8.14p3/include/sudo_util.h 2015-08-30 18:41:24.509814946 +0200
@@ -23,6 +23,8 @@
# include "compat/stdbool.h"
#endif /* HAVE_STDBOOL_H */
+#include <sys/types.h>
+
/*
* Macros for operating on struct timeval.
*/
include $(TOPDIR)/rules.mk
PKG_NAME:=syslog-ng
PKG_VERSION:=3.9.1
PKG_RELEASE:=3
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/balabit/syslog-ng/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
PKG_HASH:=5678856a550ae790618fabde9d1447f932ce7a9080d55dca8fc5df1202c70a17
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/syslog-ng
SECTION:=admin
CATEGORY:=Administration
DEPENDS:=+libpcre +glib2 +libeventlog +libopenssl +libuuid +libcurl
TITLE:=A powerful syslog daemon
URL:=http://www.balabit.com/network-security/syslog-ng/opensource-logging-system/
endef
define Package/syslog-ng/description
syslog-ng reads and logs messages to the system console, log
files, other machines and/or users as specified by its
configuration file.
endef
define Package/syslog-ng/conffiles
/etc/syslog-ng.conf
/etc/syslog-ng.d/
endef
define Build/Configure
$(SED) 's,-I/usr/include,,' $(PKG_BUILD_DIR)/configure
$(Build/Configure/Default)
endef
CONFIGURE_ARGS += \
$(call autoconf_bool,CONFIG_IPV6,ipv6) \
--disable-dependency-tracking \
--disable-amqp \
--disable-tcp-wrapper \
--disable-glibtest \
--disable-mongodb \
--disable-java \
--disable-json \
--disable-python \
--disable-spoof-source \
--disable-sql \
--disable-linux-caps \
--disable-smtp \
--disable-redis \
--enable-prce \
TARGET_CPPFLAGS += \
-I$(STAGING_DIR)/usr/include/eventlog
CONFIGURE_VARS += \
LIBDBI_CFLAGS="-I$(STAGING_DIR)/usr/include"
define Package/syslog-ng/install
$(INSTALL_DIR) $(1)/usr/lib
$(MAKE) -C $(PKG_BUILD_DIR) \
install-sbinPROGRAMS install-libLTLIBRARIES \
install-moduleLTLIBRARIES DESTDIR="$(1)"
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/syslog-ng.init $(1)/etc/init.d/syslog-ng
$(INSTALL_DATA) ./files/syslog-ng.conf $(1)/etc
$(INSTALL_DIR) $(1)/etc/syslog-ng.d/
$(call libtool_remove_files,$(1))
endef
$(eval $(call BuildPackage,syslog-ng))
@version:3.9
options {
chain_hostnames(no);
create_dirs(yes);
flush_lines(0);
keep_hostname(yes);
log_fifo_size(256);
log_msg_size(1024);
stats_freq(0);
flush_lines(0);
use_fqdn(no);
};
source src {
internal();
unix-dgram("/dev/log");
};
source net {
udp(ip(0.0.0.0) port(514));
};
source kernel {
file("/proc/kmsg" program_override("kernel"));
};
destination messages {
file("/var/log/messages");
};
log {
source(src);
source(net);
source(kernel);
destination(messages);
};
# put any customization files in this directory
@include "/etc/syslog-ng.d/"
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2016 OpenWrt.org
START=20
PROG=/usr/sbin/syslog-ng
PROG2=/usr/sbin/syslog-ng-ctl
SERVICE_USE_PID=1
SERVICE_PID_FILE=/var/run/syslog-ng.pid
config_file=/etc/syslog-ng.conf
start() {
[ -f $config_file ] || return 1
if ! $PROG -s 2>/dev/null ; then
echo "Couldn't parse $(basename $config_file)" >&2
exit 1
fi
service_start $PROG --process-mode background \
-p $SERVICE_PID_FILE
}
stop() {
service_stop $PROG
}
reload() {
$PROG2 reload
}
--- a/lib/crypto.c 2016-12-21 07:57:44.000000000 -0700
+++ b/lib/crypto.c 2017-03-24 13:19:34.188259018 -0600
@@ -51,11 +51,20 @@
}
}
+#if OPENSSL_VERSION_NUMBER < 0x10000000
static unsigned long
ssl_thread_id(void)
{
return (unsigned long) get_thread_id();
}
+
+#else
+static void
+ssl_thread_id2(CRYPTO_THREADID *id)
+{
+ CRYPTO_THREADID_set_numeric(id, get_thread_id());
+}
+#endif
static void
crypto_init_threading(void)
@@ -68,7 +76,11 @@
{
g_static_mutex_init(&ssl_locks[i]);
}
+#if OPENSSL_VERSION_NUMBER < 0x10000000
CRYPTO_set_id_callback(ssl_thread_id);
+#else
+ CRYPTO_THREADID_set_callback(ssl_thread_id2);
+#endif
CRYPTO_set_locking_callback(ssl_locking_callback);
}
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=zabbix
PKG_VERSION:=3.2.7
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_HASH:=3ea0c299bd69bc728177128740f0476bc1a2c1de438330df5bbd8f5fc6090712
PKG_SOURCE_URL:=@SF/zabbix
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/zabbix/Default
SECTION:=admin
CATEGORY:=Administration
TITLE:=Zabbix
URL:=http://www.zabbix.com/
SUBMENU:=zabbix
MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
USERID:=zabbix=53:zabbix=53
DEPENDS += $(ICONV_DEPENDS)
endef
define Package/zabbix-agentd
$(call Package/zabbix/Default)
TITLE+= agentd
endef
define Package/zabbix-extra-mac80211
$(call Package/zabbix/Default)
TITLE+= discovery/userparameters for mac80211
DEPENDS = +zabbix-agentd @PACKAGE_MAC80211_DEBUGFS @KERNEL_DEBUG_FS
endef
define Package/zabbix-extra-network
$(call Package/zabbix/Default)
TITLE+= discovery/userparameters for network
DEPENDS = +zabbix-agentd +libuci-lua +lua
endef
define Package/zabbix-extra-wifi
$(call Package/zabbix/Default)
TITLE+= discovery/userparameters for wifi
DEPENDS = +zabbix-agentd +libiwinfo-lua +libuci-lua +lua
endef
define Package/zabbix-sender
$(call Package/zabbix/Default)
TITLE+= sender
endef
define Package/zabbix-get
$(call Package/zabbix/Default)
TITLE+= get
endef
define Package/zabbix-server
$(call Package/zabbix/Default)
TITLE+= server
DEPENDS += +libsqlite3
endef
define Package/zabbix-proxy
$(call Package/zabbix/Default)
TITLE+= proxy
DEPENDS += +libsqlite3
endef
define Package/zabbix-extra-mac80211/description
An extra package for zabbix-agentd that adds a discovery rule for mac80211 wifi phy and many userparameters.
It contains an suid helper to allow zabbix-agentd to still run as zabbix user and not as root.
See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates.
endef
define Package/zabbix-extra-network/description
An extra package for zabbix-agentd that adds a discovery rule for openwrt network interfaces.
The idea here is to discover only interfaces listed in /etc/config/network (discover br-lan and not eth0.1 and wlan0)
See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates.
endef
define Package/zabbix-extra-wifi/description
An extra package for zabbix-agentd that adds a discovery rule for wifi interfaces and many userparameters.
As it uses libiwinfo, it works with all wifi devices supported by openwrt.
See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates.
endef
CONFIGURE_ARGS+= \
--enable-agent \
--enable-server \
--enable-proxy \
$(call autoconf_bool,CONFIG_IPV6,ipv6) \
--disable-java \
--with-sqlite3="$(STAGING_DIR)/usr"
MAKE_FLAGS += ARCH="linux"
define Package/zabbix/install/sbin
$(INSTALL_DIR) \
$(1)/usr/sbin
$(INSTALL_BIN) \
$(PKG_INSTALL_DIR)/usr/sbin/zabbix_$(2) \
$(1)/usr/sbin/
endef
define Package/zabbix/install/bin
$(INSTALL_DIR) \
$(1)/usr/bin
$(INSTALL_BIN) \
$(PKG_INSTALL_DIR)/usr/bin/zabbix_$(2) \
$(1)/usr/bin/
endef
define Package/zabbix/install/etc
$(INSTALL_DIR) \
$(1)/etc
$(INSTALL_CONF) \
$(PKG_INSTALL_DIR)/etc/zabbix_$(2).conf \
$(1)/etc/
endef
define Package/zabbix/install/init.d
$(INSTALL_DIR) \
$(1)/etc/init.d
$(INSTALL_BIN) \
./files/zabbix_$(2).init \
$(1)/etc/init.d/zabbix_$(2)
endef
define Package/zabbix/install/zabbix.conf.d
$(INSTALL_DIR) \
$(1)/etc/zabbix_agentd.conf.d
$(INSTALL_BIN) \
./files/$(2) \
$(1)/etc/zabbix_agentd.conf.d/$(2)
endef
define Package/zabbix-agentd/conffiles
/etc/zabbix_agentd.conf
endef
define Package/zabbix-server/conffiles
/etc/zabbix_server.conf
endef
define Package/zabbix-proxy/conffiles
/etc/zabbix_proxy.conf
endef
ifdef CONFIG_PACKAGE_zabbix-extra-mac80211
define Build/Prepare/zabbix-extra-mac80211
mkdir -p $(PKG_BUILD_DIR)/zabbix-extra-mac80211
$(CP) ./files/zabbix_helper_mac80211.c $(PKG_BUILD_DIR)/zabbix-extra-mac80211/
endef
define Build/Compile/zabbix-extra-mac80211
$(TARGET_CC) $(TARGET_CFLAGS) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211.c -o $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211
endef
endif
define Build/Prepare
$(call Build/Prepare/Default)
$(call Build/Prepare/zabbix-extra-mac80211)
endef
define Build/Compile
$(call Build/Compile/Default)
$(call Build/Compile/zabbix-extra-mac80211)
endef
define Package/zabbix-agentd/install
$(INSTALL_DIR) $(1)/etc/zabbix_agentd.conf.d
$(call Package/zabbix/install/sbin,$(1),agentd)
$(call Package/zabbix/install/etc,$(1),agentd)
$(call Package/zabbix/install/init.d,$(1),agentd)
endef
define Package/zabbix-extra-mac80211/install
$(call Package/zabbix/install/zabbix.conf.d,$(1),mac80211)
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211 $(1)/usr/bin/
chmod 4755 $(1)/usr/bin/zabbix_helper_mac80211
endef
define Package/zabbix-extra-network/install
$(call Package/zabbix/install/zabbix.conf.d,$(1),network)
endef
define Package/zabbix-extra-wifi/install
$(call Package/zabbix/install/zabbix.conf.d,$(1),wifi)
endef
define Package/zabbix-sender/install
$(call Package/zabbix/install/bin,$(1),sender)
endef
define Package/zabbix-get/install
$(call Package/zabbix/install/bin,$(1),get)
endef
define Package/zabbix-server/install
$(call Package/zabbix/install/sbin,$(1),server)
$(call Package/zabbix/install/etc,$(1),server)
endef
define Package/zabbix-proxy/install
$(call Package/zabbix/install/sbin,$(1),proxy)
$(call Package/zabbix/install/etc,$(1),proxy)
endef
$(eval $(call BuildPackage,zabbix-agentd))
$(eval $(call BuildPackage,zabbix-extra-mac80211))
$(eval $(call BuildPackage,zabbix-extra-network))
$(eval $(call BuildPackage,zabbix-extra-wifi))
$(eval $(call BuildPackage,zabbix-sender))
$(eval $(call BuildPackage,zabbix-server))
$(eval $(call BuildPackage,zabbix-proxy))
$(eval $(call BuildPackage,zabbix-get))
#see http://wiki.openwrt.org/doc/howto/zabbix for ready to use templates
# If you want to know the exact meaning of an UserParameter, you can search in the ieee80211 standard:
# http://standards.ieee.org/getieee802/download/802.11-2012.pdf
# example: for mac80211.ACKFailureCount search for dot11ACKFailureCount (page 2145)
# mac80211 phy discovery (like 'phy0')
# example: {"data":[{"{#PHY}":"phy0"}]}
#
UserParameter=mac80211.phydiscovery,zabbix_helper_mac80211 discovery
#phy statistics (you need {#PHY} as parameter)
#
UserParameter=mac80211.ACKFailureCount[*],zabbix_helper_mac80211 $1 dot11ACKFailureCount
UserParameter=mac80211.FCSErrorCount[*],zabbix_helper_mac80211 $1 dot11FCSErrorCount
UserParameter=mac80211.RTSFailureCount[*],zabbix_helper_mac80211 $1 dot11RTSFailureCount
UserParameter=mac80211.RTSSuccessCount[*],zabbix_helper_mac80211 $1 dot11RTSSuccessCount
# hidden behind MAC80211_DEBUG_COUNTERS
UserParameter=mac80211.FailedCount[*],zabbix_helper_mac80211 $1 dot11FailedCount
UserParameter=mac80211.FrameDuplicateCount[*],zabbix_helper_mac80211 $1 dot11FrameDuplicateCount
UserParameter=mac80211.MulticastReceivedFrameCount[*],zabbix_helper_mac80211 $1 dot11MulticastReceivedFrameCount
UserParameter=mac80211.MulticastTransmittedFrameCount[*],zabbix_helper_mac80211 $1 dot11MulticastTransmittedFrameCount
UserParameter=mac80211.MultipleRetryCount[*],zabbix_helper_mac80211 $1 dot11MultipleRetryCount
UserParameter=mac80211.ReceivedFragmentCount[*],zabbix_helper_mac80211 $1 dot11ReceivedFragmentCount
UserParameter=mac80211.RetryCount[*],zabbix_helper_mac80211 $1 dot11RetryCount
UserParameter=mac80211.TransmittedFragmentCount[*],zabbix_helper_mac80211 $1 dot11TransmittedFragmentCount
UserParameter=mac80211.TransmittedFrameCount[*],zabbix_helper_mac80211 $1 dot11TransmittedFrameCount
#see http://wiki.openwrt.org/doc/howto/zabbix for ready to use templates
# network interface discovery
# example: {"data":[{"{#IF}":"lo", "{#NET}":"loopback"},{"{#IF}":"br-lan", "{#NET}":"lan"},{"{#IF}":"eth0.1", "{#NET}":"wan"}]}
#
UserParameter=netowrt.discovery,lua -l uci -e 'x = uci.cursor(nil, "/var/state");list = "{\"data\":[";x:foreach("network", "interface", function(s) list=list.."{\"{#IF}\":\""..s.ifname.."\", \"{#NET}\":\""..s[".name"].."\"}," end); list=string.gsub(list,",$",""); print(list.."]}")'
#see http://wiki.openwrt.org/doc/howto/zabbix for ready to use templates
# wifi interface discovery
# example: {"data":[{"{#IF}":"wlan0", "{#MODE}":"ap", "{#SSID}":"Openwrt", "{#NET}":"lan", "{#DEV}":"radio0", "{#ENC}":"psk2+ccmp", "{#TYPE}":"mac80211", "{#HWMODE}":"11ng", "{#CHANNEL}":"11", "{#BSSID}":"xx:xx:xx:xx:xx:xx"}]}
# ubus call only work as root so you need to run zabbix as root to use wifi.ifdiscovery
UserParameter=wifi.ifdiscovery, lua -l ubus -l iwinfo -e 'u=ubus.connect();list="{\"data\":[";stat=u:call("network.wireless", "status", {});for dev, dev_table in pairs(stat) do for i, iface in pairs(dev_table["interfaces"]) do c=iface["config"];i=iface["ifname"];t=iwinfo.type(i);iw=iwinfo[t];e = iw.encryption(i);e = e and e.description or "None";n = table.concat(c["network"]," ");list=list.."{\"{#IF}\":\""..i.."\", \"{#MODE}\":\""..iw.mode(i).."\", \"{#SSID}\":\""..c["ssid"].."\", \"{#NET}\":\""..n.."\", \"{#DEV}\":\""..dev.."\", \"{#ENC}\":\""..e.."\", \"{#TYPE}\":\""..t.."\", \"{#HWMODE}\":\"".."?".."\", \"{#CHANNEL}\":\""..iw.channel(i).."\", \"{#BSSID}\":\""..iw.bssid(i).."\"},";end;end;list=string.gsub(list,",$","");print(list.."]}")'
#iwinfo info (you need {#IF} as parameter, like 'wlan0')
UserParameter=wifi.iwinfo.channel[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].channel('$1'))"
UserParameter=wifi.iwinfo.frequency[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].frequency('$1'))"
UserParameter=wifi.iwinfo.txpower[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].txpower('$1'))"
UserParameter=wifi.iwinfo.bitrate[*],lua -l iwinfo -e "b = iwinfo[iwinfo.type('$1')].bitrate('$1'); print(b or '0')"
UserParameter=wifi.iwinfo.signal[*],lua -l iwinfo -e "s = iwinfo[iwinfo.type('$1')].signal('$1'); print(s or '-255')"
UserParameter=wifi.iwinfo.noise[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].noise('$1'))"
UserParameter=wifi.iwinfo.quality[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].quality('$1'))"
UserParameter=wifi.iwinfo.quality_max[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].quality_max('$1'))"
UserParameter=wifi.iwinfo.mode[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].mode('$1'))"
UserParameter=wifi.iwinfo.ssid[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].ssid('$1'))"
UserParameter=wifi.iwinfo.bssid[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].bssid('$1'))"
UserParameter=wifi.iwinfo.country[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].country('$1'))"
UserParameter=wifi.iwinfo.nbusers[*],lua -l iwinfo -e "n = 0; for _,_ in pairs(iwinfo[iwinfo.type('$1')].assoclist('$1')) do n = n + 1 end; print(n)"
UserParameter=wifi.iwinfo.encryption[*],lua -l iwinfo -e "e = iwinfo[iwinfo.type('$1')].encryption('$1'); print(e and e.description or 'None')"
UserParameter=wifi.iwinfo.hwmode[*],lua -l iwinfo -e "x=iwinfo[iwinfo.type('$1')].hwmodelist('$1'); print((x.a and 'a' or '')..(x.b and 'b' or '')..(x.g and 'g' or '')..(x.n and 'n' or ''))"
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2011 OpenWrt.org
START=60
USE_PROCD=1
PROG=/usr/sbin/zabbix_agentd
CONFIG=/etc/zabbix_agentd.conf
start_service() {
# Sometimes the agentd config was installed in /etc/zabbix/zabbix_agentd.conf
[ -f /etc/zabbix/zabbix_agentd.conf ] && mv /etc/zabbix/zabbix_agentd.conf ${CONFIG}
[ -f ${CONFIG} ] || return 1
procd_open_instance
procd_set_param command ${PROG} -c ${CONFIG} -f
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <dirent.h>
#include <stdbool.h>
int discovery()
{
DIR *dir;
struct dirent *ent;
bool comma = false;
if ((dir = opendir ("/sys/kernel/debug/ieee80211/")) != NULL) {
printf("{\"data\":[");
while ((ent = readdir (dir)) != NULL) {
if (strcmp(".", ent->d_name) && strcmp("..", ent->d_name)) {
if (comma)
printf(",");
printf("{\"{#PHY}\":\"%s\"}", ent->d_name);
comma = true;
}
}
printf("]}\n");
closedir(dir);
} else {
perror("");
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
int get_param(char *phy, char *stat)
{
char *filename = NULL;
FILE *f = NULL;
phy = basename(phy);
stat = basename(stat);
if (asprintf(&filename, "/sys/kernel/debug/ieee80211/%s/statistics/%s", phy, stat) > 0)
f = fopen(filename, "r");
if (f != NULL) {
char temp[256];
while (fgets(temp, 256, f) != NULL)
printf("%s",temp);
fclose(f);
} else {
perror("");
return EXIT_FAILURE;
}
free(filename);
return EXIT_SUCCESS;
}
int usage(char *name)
{
fprintf(stderr, "Usage:\n");
fprintf(stderr, " %s discovery\n", name);
fprintf(stderr, " => print mac80211.phydiscovery discovery rule\n");
fprintf(stderr, " %s PHY STAT\n", name);
fprintf(stderr, " => cat /sys/kernel/debug/ieee80211/PHY/statistics/STAT as root\n");
return EXIT_FAILURE;
}
int main(int argc, char *argv[])
{
switch (argc) {
case 2:
return discovery();
case 3:
return get_param(argv[1], argv[2]);
default:
return usage(argv[0]);
}
}
--- a/configure.ac
+++ b/configure.ac
@@ -161,6 +161,10 @@ if test "x$found_resolv" != "xyes"; then
AC_MSG_ERROR([Unable to do DNS lookups (libresolv check failed)])
fi
LIBS="${LIBS} ${RESOLV_LIBS}"
+AC_SEARCH_LIBS([res_mkquery], [], [AC_DEFINE([HAVE_RES_MKQUERY], 1, [Define if res_mkquery exists])])
+AC_SEARCH_LIBS([__res_mkquery], [], [AC_DEFINE([HAVE_RES_MKQUERY], 1, [Define if res_mkquery exists])])
+AC_SEARCH_LIBS([res_send], [], [AC_DEFINE([HAVE_RES_SEND], 1, [Define if res_send exists])])
+AC_SEARCH_LIBS([__res_send], [], [AC_DEFINE([HAVE_RES_SEND], 1, [Define if res_send exists])])
dnl *****************************************************************
dnl * *
--- a/src/libs/zbxsysinfo/common/net.c
+++ b/src/libs/zbxsysinfo/common/net.c
@@ -471,6 +471,7 @@ static int dns_query(AGENT_REQUEST *requ
return SYSINFO_RET_FAIL;
}
+#if defined(HAVE_RES_MKQUERY) && defined(HAVE_RES_SEND)
if (-1 == (res = res_mkquery(QUERY, zone, C_IN, type, NULL, 0, NULL, buf, sizeof(buf))))
{
SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Cannot create DNS query: %s", zbx_strerror(errno)));
@@ -505,6 +506,11 @@ static int dns_query(AGENT_REQUEST *requ
_res.retry = retry;
res = res_send(buf, res, answer.buffer, sizeof(answer.buffer));
+#else /* defined(HAVE_RES_QUERY) && defined(HAVE_RES_SEND) */
+ /* retrand and retry are ignored */
+ if (-1 == (res = res_query(zone, C_IN, type, answer.buffer, sizeof(answer.buffer))))
+ return SYSINFO_RET_FAIL;
+#endif
_res.options = saved_options;
_res.retrans = saved_retrans;
--- a/src/libs/zbxsysinfo/linux/cpu.c
+++ b/src/libs/zbxsysinfo/linux/cpu.c
@@ -22,6 +22,45 @@
#include "stats.h"
#include "log.h"
+
+/* uclibc and dietlibc do not have this junk -ReneR */
+#if defined (__UCLIBC__) || defined (__dietlibc__)
+static int getloadavg (double loadavg[], int nelem)
+{
+ int fd;
+
+ fd = open ("/proc/loadavg", O_RDONLY);
+ if (fd < 0)
+ return -1;
+ else
+ {
+ char buf[65], *p;
+ ssize_t nread;
+ int i;
+
+ nread = read (fd, buf, sizeof buf - 1);
+ close (fd);
+ if (nread <= 0)
+ return -1;
+ buf[nread - 1] = '\0';
+
+ if (nelem > 3)
+ nelem = 3;
+ p = buf;
+ for (i = 0; i < nelem; ++i)
+ {
+ char *endp;
+ loadavg[i] = strtod (p, &endp);
+ if (endp == p)
+ return -1;
+ p = endp;
+ }
+
+ return i;
+ }
+}
+#endif
+
int SYSTEM_CPU_NUM(AGENT_REQUEST *request, AGENT_RESULT *result)
{
char *type;
--- a/src/libs/zbxnix/daemon.c
+++ b/src/libs/zbxnix/daemon.c
@@ -300,11 +300,14 @@ int daemon_start(int allow_root, const c
if (0 == allow_root && 0 == getuid()) /* running as root? */
{
+#if 0
+/* allow changing user and foreground */
if (0 != (flags & ZBX_TASK_FLAG_FOREGROUND))
{
zbx_error("cannot run as root!");
exit(EXIT_FAILURE);
}
+#endif
if (NULL == user)
user = "zabbix";
--- a/conf/zabbix_agentd.conf
+++ b/conf/zabbix_agentd.conf
@@ -3,12 +3,11 @@
############ GENERAL PARAMETERS #################
-### Option: PidFile
-# Name of PID file.
-#
-# Mandatory: no
-# Default:
-# PidFile=/tmp/zabbix_agentd.pid
+# We do not need PidFile with procd
+# PidFile=/var/run/zabbix_agentd.pid
+
+# use syslog
+LogType=system
### Option: LogType
# Specifies where log messages are written to:
@@ -27,8 +26,6 @@
# Default:
# LogFile=
-LogFile=/tmp/zabbix_agentd.log
-
### Option: LogFileSize
# Maximum size of log file in MB.
# 0 - disable automatic log rotation.
@@ -114,6 +111,7 @@ Server=127.0.0.1
# Range: 0-100
# Default:
# StartAgents=3
+StartAgents=1
##### Active checks related
@@ -129,8 +127,6 @@ Server=127.0.0.1
# Default:
# ServerActive=
-ServerActive=127.0.0.1
-
### Option: Hostname
# Unique, case sensitive hostname.
# Required for active checks and must match hostname as configured on the server.
@@ -140,8 +136,6 @@ ServerActive=127.0.0.1
# Default:
# Hostname=
-Hostname=Zabbix server
-
### Option: HostnameItem
# Item used for generating Hostname if it is undefined. Ignored if Hostname is defined.
# Does not support UserParameters or aliases.
@@ -259,8 +253,8 @@ Hostname=Zabbix server
# Include=
# Include=/usr/local/etc/zabbix_agentd.userparams.conf
-# Include=/usr/local/etc/zabbix_agentd.conf.d/
# Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf
+Include=/etc/zabbix_agentd.conf.d/
####### USER-DEFINED MONITORED PARAMETERS #######
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,7 @@ AC_CHECK_HEADERS(stdio.h stdlib.h string
syslog.h time.h errno.h sys/types.h sys/stat.h netinet/in.h \
math.h sys/socket.h dirent.h ctype.h \
mtent.h fcntl.h sys/param.h arpa/inet.h \
- sys/vfs.h sys/pstat.h sys/sysinfo.h sys/statvfs.h sys/statfs.h \
+ sys/vfs.h sys/pstat.h sys/statvfs.h sys/statfs.h \
sys/socket.h sys/loadavg.h arpa/inet.h \
sys/vmmeter.h strings.h vm/vm_param.h \
sys/time.h kstat.h sys/syscall.h sys/sysmacros.h \
@@ -63,6 +63,11 @@ AC_CHECK_HEADERS(stdio.h stdlib.h string
Winber.h lber.h ws2tcpip.h inttypes.h sys/file.h grp.h \
execinfo.h libperfstat.h sys/systemcfg.h sys/mnttab.h mntent.h sys/times.h \
dlfcn.h sys/utsname.h)
+AC_CHECK_HEADERS(sys/sysinfo.h, [], [], [
+#ifdef HAVE_LINUX_KERNEL_H
+# include <linux/kernel.h>
+#endif
+])
AC_CHECK_HEADERS(resolv.h, [], [], [
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
Index: zabbix-3.2.7/src/libs/zbxcommon/str.c
===================================================================
--- zabbix-3.2.7.orig/src/libs/zbxcommon/str.c
+++ zabbix-3.2.7/src/libs/zbxcommon/str.c
@@ -51,7 +51,7 @@ static const char help_message_footer[]
void version(void)
{
printf("%s (Zabbix) %s\n", title_message, ZABBIX_VERSION);
- printf("Revision %s %s, compilation time: %s %s\n\n", ZABBIX_REVISION, ZABBIX_REVDATE, __DATE__, __TIME__);
+ printf("Revision %s %s\n\n", ZABBIX_REVISION, ZABBIX_REVDATE);
puts(copyright_message);
}
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=autoconf
PKG_VERSION:=2.69
PKG_RELEASE:=2
PKG_SOURCE_URL:=@GNU/autoconf
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-3.0+
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
CONFIGURE_VARS += M4=m4 EMACS=no
define Package/autoconf
SECTION:=devel
CATEGORY:=Development
TITLE:=autoconf
URL:=https://www.gnu.org/software/autoconf/
DEPENDS:=+m4 +perl +perlbase-data +perlbase-file +perlbase-getopt \
+perlbase-dynaloader +perlbase-text
endef
define Package/autoconf/description
Autoconf is an extensible package of M4 macros that produce shell scripts to
automatically configure software source code packages.
endef
define Build/Install
$(SED) 's/@PERL@/\/usr\/bin\/perl/g' $(PKG_BUILD_DIR)/bin/Makefile.in
$(call Build/Install/Default)
endef
define Package/autoconf/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/share/autoconf
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/autoconf/INSTALL \
$(1)/usr/share/autoconf/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/autoconf/autom4te.cfg \
$(1)/usr/share/autoconf/
$(INSTALL_DIR) $(1)/usr/share/autoconf/Autom4te
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/autoconf/Autom4te/* \
$(1)/usr/share/autoconf/Autom4te/
$(INSTALL_DIR) $(1)/usr/share/autoconf/autoconf
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/autoconf/autoconf/* \
$(1)/usr/share/autoconf/autoconf/
$(INSTALL_DIR) $(1)/usr/share/autoconf/autoscan
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/autoconf/autoscan/* \
$(1)/usr/share/autoconf/autoscan/
$(INSTALL_DIR) $(1)/usr/share/autoconf/autotest
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/autoconf/autotest/* \
$(1)/usr/share/autoconf/autotest/
$(INSTALL_DIR) $(1)/usr/share/autoconf/m4sugar
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/autoconf/m4sugar/* \
$(1)/usr/share/autoconf/m4sugar/
endef
$(eval $(call BuildPackage,autoconf))
#
# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=automake
PKG_VERSION:=1.15
PKG_RELEASE:=4
PKG_SOURCE_URL:=@GNU/automake
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=9908c75aabd49d13661d6dcb1bc382252d22cc77bf733a2d55e87f2aa2db8636
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-3.0+
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/automake
SECTION:=devel
CATEGORY:=Development
TITLE:=automake
URL:=https://www.gnu.org/software/automake/
DEPENDS:=+autoconf +perlbase-thread +perlbase-attributes
endef
define Package/automake/description
Automake is a tool for automatically generating Makefile.in files compliant
with the GNU Coding Standards.
endef
FIX_PATHS = $(SED) '1c \#!/usr/bin/perl' -e 's| /[^ ]*/bin/perl| /usr/bin/perl|g'
define Package/automake/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/automake-$(PKG_VERSION) \
$(1)/usr/bin/automake-$(PKG_VERSION)
$(LN) automake-$(PKG_VERSION) $(1)/usr/bin/automake
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aclocal-$(PKG_VERSION) \
$(1)/usr/bin/aclocal-$(PKG_VERSION)
$(LN) aclocal-$(PKG_VERSION) $(1)/usr/bin/aclocal
$(FIX_PATHS) $(1)/usr/bin/automake-$(PKG_VERSION)
$(FIX_PATHS) $(1)/usr/bin/aclocal-$(PKG_VERSION)
$(INSTALL_DIR) $(1)/usr/share/automake-$(PKG_VERSION)
for dir in \
automake-$(PKG_VERSION) automake-$(PKG_VERSION)/Automake \
automake-$(PKG_VERSION)/am aclocal \
aclocal-$(PKG_VERSION) aclocal-$(PKG_VERSION)/internal \
; do \
$(INSTALL_DIR) $(1)/usr/share/$$$$dir; \
for file in $$$$(cd $(PKG_INSTALL_DIR) && \
find usr/share/$$$$dir -maxdepth 1 -type f); do \
$(INSTALL_DATA) $$(PKG_INSTALL_DIR)/$$$$file \
$(1)/$$$$file; \
done; \
done
endef
$(eval $(call BuildPackage,automake))
#
# Copyright (C) 2008-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=diffutils
PKG_VERSION:=3.6
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/diffutils
PKG_HASH:=d621e8bdd4b573918c8145f7ae61817d1be9deb4c8d2328a65cea8e11d783bd6
PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
PKG_LICENSE:=GPL-3.0
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/diffutils
SECTION:=devel
CATEGORY:=Development
DEPENDS:=+USE_GLIBC:librt
TITLE:=diffutils
URL:=http://www.gnu.org/software/diffutils/
endef
define Package/diffutils/description
The Diffutils package contains programs that show the differences between
files or directories.
endef
CONFIGURE_VARS += \
ac_cv_func_mempcpy=n
TARGET_CFLAGS += --std=gnu99
define Package/diffutils/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{sdiff,diff3,diff,cmp} $(1)/usr/bin/
endef
define Package/diffutils/preinst
#!/bin/sh
for x in sdiff diff3 diff cmp; do
[ -L "$${IPKG_INSTROOT}/usr/bin/$$x" ] && rm -f "$${IPKG_INSTROOT}/usr/bin/$$x"
done
exit 0
endef
define Package/diffutils/postrm
#!/bin/sh
for x in sdiff diff3 diff cmp; do
/bin/busybox $$x -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/bin/$$x
done
exit 0
endef
$(eval $(call BuildPackage,diffutils))
#
# Copyright (C) 2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=gcc
PKG_VERSION:=5.4.0
PKG_RELEASE:=3
PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
PKG_HASH:=608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_INSTALL:=1
PKG_FIXUP:=libtool
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
TARGET_LANGUAGES:="c,c++"
BUGURL=https://dev.openwrt.org/
PKGVERSION=OpenWrt GCC $(PKG_VERSION)
TARGET_CPPFLAGS += -D_GLIBCXX_INCLUDE_NEXT_C_HEADERS
# not using sstrip here as this fucks up the .so's somehow
STRIP:=$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)strip
RSTRIP:= \
NM="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)nm" \
STRIP="$(STRIP)" \
STRIP_KMOD="$(STRIP) --strip-debug" \
$(SCRIPT_DIR)/rstrip.sh
ifneq ($(CONFIG_SOFT_FLOAT),y)
ifeq ($(CONFIG_arm),y)
ARM_FLOAT_OPTION:= --with-float=hard
endif
endif
define Package/gcc
SECTION:=devel
CATEGORY:=Development
TITLE:=gcc
MAINTAINER:=Noble Pepper <gccmaintain@noblepepper.com>
DEPENDS:= +binutils +libstdcpp
endef
define Package/gcc/description
build a native toolchain for compiling on target
endef
GMPSRC=gmp-4.3.2
define Download/gmp
URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
FILE:=$(GMPSRC).tar.bz2
HASH:=936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775
endef
$(eval $(call Download,gmp))
MPCSRC=mpc-0.8.1
define Download/mpc
URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
FILE:=$(MPCSRC).tar.gz
HASH:=e664603757251fd8a352848276497a4c79b7f8b21fd8aedd5cc0598a38fee3e4
endef
$(eval $(call Download,mpc))
MPFRSRC=mpfr-2.4.2
define Download/mpfr
URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
FILE:=$(MPFRSRC).tar.bz2
HASH:=c7e75a08a8d49d2082e4caee1591a05d11b9d5627514e678f02d66a124bcf2ba
endef
$(eval $(call Download,mpfr))
define Build/Prepare
$(PKG_UNPACK)
# we have to download and unpack additional stuff before patching
tar -C $(PKG_BUILD_DIR) -xvjf $(DL_DIR)/$(GMPSRC).tar.bz2
ln -sf $(PKG_BUILD_DIR)/$(GMPSRC) $(PKG_BUILD_DIR)/gmp
tar -C $(PKG_BUILD_DIR) -xvzf $(DL_DIR)/$(MPCSRC).tar.gz
ln -sf $(PKG_BUILD_DIR)/$(MPCSRC) $(PKG_BUILD_DIR)/mpc
tar -C $(PKG_BUILD_DIR) -xvjf $(DL_DIR)/$(MPFRSRC).tar.bz2
ln -sf $(PKG_BUILD_DIR)/$(MPFRSRC) $(PKG_BUILD_DIR)/mpfr
$(Build/Patch)
# poor man's fix for `none-openwrt-linux' not recognized when building with musl
cp $(PKG_BUILD_DIR)/config.sub $(PKG_BUILD_DIR)/mpfr/
cp $(PKG_BUILD_DIR)/config.sub $(PKG_BUILD_DIR)/gmp/
cp $(PKG_BUILD_DIR)/config.sub $(PKG_BUILD_DIR)/mpc/
endef
TARGET_CXX += -std=gnu++03
CONFIGURE_ARGS += CXX_FOR_TARGET="$(TARGET_CXX)" CXXFLAGS_FOR_TARGET="-g -O2 -D_GLIBCXX_INCLUDE_NEXT_C_HEADERS"
define Build/Configure
(cd $(PKG_BUILD_DIR); rm -f config.cache; \
SHELL="$(BASH)" \
$(TARGET_CONFIGURE_OPTS) \
$(PKG_BUILD_DIR)/configure \
$(CONFIGURE_ARGS) \
--build=$(GNU_HOST_NAME) \
--host=$(REAL_GNU_TARGET_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
--enable-languages=$(TARGET_LANGUAGES) \
--with-bugurl=$(BUGURL) \
--with-pkgversion="$(PKGVERSION)" \
--enable-shared \
$(if $(CONFIG_LIBC_USE_GLIBC),--enable,--disable)-__cxa_atexit \
--with-default-libstdcxx-abi=gcc4-compatible \
--enable-target-optspace \
--with-gnu-ld \
--disable-nls \
--disable-libsanitizer \
--disable-libvtv \
--disable-libcilkrts \
--disable-libmudflap \
--disable-multilib \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-decimal-float \
--disable-libstdcxx-pch \
--with-host-libstdcxx=-lstdc++ \
--prefix=/usr \
--libexecdir=/usr/lib \
--with-local-prefix=/usr \
$(ARM_FLOAT_OPTION) \
$(SOFT_FLOAT_CONFIG_OPTION) \
$(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
);
endef
define Build/Compile
export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install
endef
ENVCFLAGS:="$(TARGET_OPTIMIZATION) $(EXTRA_OPTIMIZATION)
ifeq ($(CONFIG_SOFT_FLOAT),y)
ifeq ($(CONFIG_arm),y)
ENVCFLAGS+= -mfloat-abi=soft
else
ENVCFLAGS+= -msoft-float
endif
endif
ENVCFLAGS+="
ENVLDFLAGS:="-Wl,-rpath=/usr/lib -Wl,--dynamic-linker=/usr/lib/$(DYNLINKER) -L/usr/lib"
define Package/gcc/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
cp -ar $(PKG_INSTALL_DIR)/usr/include $(1)/usr
cp -a $(PKG_INSTALL_DIR)/usr/bin/{$(REAL_GNU_TARGET_NAME)-{g++,gcc},cpp,gcov} $(1)/usr/bin
ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/c++
ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/g++
ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-c++
ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/gcc
ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc-$(PKG_VERSION)
cp -ar $(PKG_INSTALL_DIR)/usr/lib/gcc $(1)/usr/lib
cp -ar $(TOOLCHAIN_DIR)/include $(1)/usr
cp -a $(TOOLCHAIN_DIR)/lib/*.{o,so*} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
cp -a $(TOOLCHAIN_DIR)/lib/*nonshared*.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
cp -a $(TOOLCHAIN_DIR)/lib/libm.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
rm -f $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/libgo*
rm -f $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/libcc1*
echo '#!/bin/sh' > $(1)/usr/bin/gcc_env.sh
echo 'export LDFLAGS=$(ENVLDFLAGS)' >> $(1)/usr/bin/gcc_env.sh
echo 'export CFLAGS=$(ENVCFLAGS)' >> $(1)/usr/bin/gcc_env.sh
chmod +x $(1)/usr/bin/gcc_env.sh
endef
$(eval $(call BuildPackage,gcc))
Native GCC that runs on target.
To save disk space, this GCC only supports dynamic linking on the target box,
there are no static libraries shipped except libgcc.a on those architectures
that need it.
For now, this was only tested on arm (EABI) and mips targets. Others to be
done...
Christian Beier <cb@shoutrlabs.com>
Revert of:
commit 275035b56823b26d5fb7e90fad945b998648edf2
Author: bergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu Sep 5 14:09:07 2013 +0000
PR target/58139
* reginfo.c (choose_hard_reg_mode): Scan through all mode classes
looking for widest mode.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -665,35 +665,40 @@ choose_hard_reg_mode (unsigned int regno
mode = GET_MODE_WIDER_MODE (mode))
if ((unsigned) hard_regno_nregs[regno][mode] == nregs
&& HARD_REGNO_MODE_OK (regno, mode)
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
+ if (found_mode != VOIDmode)
+ return found_mode;
+
for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
if ((unsigned) hard_regno_nregs[regno][mode] == nregs
&& HARD_REGNO_MODE_OK (regno, mode)
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
+ if (found_mode != VOIDmode)
+ return found_mode;
+
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
if ((unsigned) hard_regno_nregs[regno][mode] == nregs
&& HARD_REGNO_MODE_OK (regno, mode)
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
+ if (found_mode != VOIDmode)
+ return found_mode;
+
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
if ((unsigned) hard_regno_nregs[regno][mode] == nregs
&& HARD_REGNO_MODE_OK (regno, mode)
- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
if (found_mode != VOIDmode)
--- a/include/filenames.h
+++ b/include/filenames.h
@@ -43,11 +43,6 @@ extern "C" {
# define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
# define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
#else /* not DOSish */
-# if defined(__APPLE__)
-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
-# endif
-# endif /* __APPLE__ */
# define HAS_DRIVE_SPEC(f) (0)
# define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c)
# define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f)
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -75,9 +75,10 @@
+ (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */
/* Verify the guess. */
+#ifndef __LP64__
extern char test_real_width
[sizeof (REAL_VALUE_TYPE) <= REAL_WIDTH * sizeof (HOST_WIDE_INT) ? 1 : -1];
-
+#endif
/* Calculate the format for CONST_DOUBLE. We need as many slots as
are necessary to overlay a REAL_VALUE_TYPE on them. This could be
as many as four (32-bit HOST_WIDE_INT, 128-bit REAL_VALUE_TYPE).
diff -Naurd mpfr-2.4.2-a/mpfr-longlong.h mpfr-2.4.2-b/mpfr-longlong.h
--- -a/mpfr-2.4.2/mpfr-longlong.h 2009-11-30 02:43:08.000000000 +0000
+++ -b/mpfr-2.4.2/mpfr-longlong.h 2009-12-18 12:04:29.000000000 +0000
@@ -1011,7 +1011,15 @@
#endif /* __m88000__ */
#if defined (__mips) && W_TYPE_SIZE == 32
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UDItype _r; \
+ _r = (UDItype) u * v; \
+ (w1) = _r >> 32; \
+ (w0) = (USItype) _r; \
+ } while (0)
+#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
#define umul_ppmm(w1, w0, u, v) \
__asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
#else
@@ -1024,7 +1032,16 @@
#endif /* __mips */
#if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
+typedef unsigned int UTItype __attribute__ ((mode (TI)));
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UTItype _r; \
+ _r = (UTItype) u * v; \
+ (w1) = _r >> 64; \
+ (w0) = (UDItype) _r; \
+ } while (0)
+#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
#define umul_ppmm(w1, w0, u, v) \
__asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
#else
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2941,18 +2941,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
doc/gccint.info: $(TEXI_GCCINT_FILES)
doc/cppinternals.info: $(TEXI_CPPINT_FILES)
-doc/%.info: %.texi
- if [ x$(BUILD_INFO) = xinfo ]; then \
- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
- -I $(gcc_docdir)/include -o $@ $<; \
- fi
+doc/%.info:
# Duplicate entry to handle renaming of gccinstall.info
-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
- if [ x$(BUILD_INFO) = xinfo ]; then \
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
- -I $(gcc_docdir)/include -o $@ $<; \
- fi
+doc/gccinstall.info:
doc/cpp.dvi: $(TEXI_CPP_FILES)
doc/gcc.dvi: $(TEXI_GCC_FILES)
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -225,6 +225,12 @@ prepare_call_address (tree fndecl_or_typ
&& targetm.small_register_classes_for_mode_p (FUNCTION_MODE))
? force_not_mem (memory_address (FUNCTION_MODE, funexp))
: memory_address (FUNCTION_MODE, funexp));
+ else if (flag_pic && !flag_plt && fndecl_or_type
+ && TREE_CODE (fndecl_or_type) == FUNCTION_DECL
+ && !targetm.binds_local_p (fndecl_or_type))
+ {
+ funexp = force_reg (Pmode, funexp);
+ }
else if (! sibcallp)
{
#ifndef NO_FUNCTION_CSE
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1779,6 +1779,10 @@ fpie
Common Report Var(flag_pie,1) Negative(fPIC)
Generate position-independent code for executables if possible (small mode)
+fplt
+Common Report Var(flag_plt) Init(1)
+Use PLT for PIC calls (-fno-plt: load the address from GOT at call site)
+
fplugin=
Common Joined RejectNegative Var(common_deferred_options) Defer
Specify a plugin to load
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -8001,9 +8001,17 @@ mask_low_and_shift_p (machine_mode mode,
bool
and_operands_ok (machine_mode mode, rtx op1, rtx op2)
{
- return (memory_operand (op1, mode)
- ? and_load_operand (op2, mode)
- : and_reg_operand (op2, mode));
+ if (!memory_operand (op1, mode))
+ return and_reg_operand (op2, mode);
+
+ if (!and_load_operand (op2, mode))
+ return false;
+
+ if (!TARGET_MIPS16 || si_mask_operand(op2, mode))
+ return true;
+
+ op1 = XEXP (op1, 0);
+ return !(REG_P (op1) && REGNO (op1) == STACK_POINTER_REGNUM);
}
/* The canonical form of a mask-low-and-shift-left operation is
--- a/contrib/regression/objs-gcc.sh
+++ b/contrib/regression/objs-gcc.sh
@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
then
make all-gdb all-dejagnu all-ld || exit 1
make install-gdb install-dejagnu install-ld || exit 1
+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
make bootstrap || exit 1
make install || exit 1
--- a/libjava/classpath/ltconfig
+++ b/libjava/classpath/ltconfig
@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
case $host_os in
-linux-gnu*) ;;
+linux-gnu*|linux-uclibc*) ;;
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
version_type=linux
need_lib_prefix=no
need_version=no
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 8 May 2015 08:25:47 +0000 (+0000)
Subject: [PATCH 2/13] musl libc config
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a9173ceabaf29c16f8ef226fbf98af373a4b2ceb
[PATCH 2/13] musl libc config
2015-05-08 Gregor Richards <gregor.richards@uwaterloo.ca>
Szabolcs Nagy <szabolcs.nagy@arm.com>
* config.gcc (LIBC_MUSL): New tm_defines macro.
* config/linux.h (OPTION_MUSL): Define.
(MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER32,)
(MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32,)
(INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,)
(INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,)
(INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define.
* config/linux.opt (mmusl): New option.
* doc/invoke.texi (GNU/Linux Options): Document -mmusl.
* configure.ac (gcc_cv_libc_provides_ssp): Add *-*-musl*.
(gcc_cv_target_dl_iterate_phdr): Add *-linux-musl*.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222904 138bc75d-0d04-0410-961f-82ee72b054a4
---
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -575,7 +575,7 @@ case ${target} in
esac
# Common C libraries.
-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
# 32-bit x86 processors supported by --with-arch=. Each processor
# MUST be separated by exactly one space.
@@ -720,6 +720,9 @@ case ${target} in
*-*-*uclibc*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
;;
+ *-*-*musl*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
+ ;;
*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
;;
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTI
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
#else
#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
#endif
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
@@ -50,21 +52,25 @@ see the files COPYING3 and COPYING.RUNTI
} while (0)
/* Determine which dynamic linker to use depending on whether GLIBC or
- uClibc or Bionic is the default C library and whether
- -muclibc or -mglibc or -mbionic has been passed to change the default. */
+ uClibc or Bionic or musl is the default C library and whether
+ -muclibc or -mglibc or -mbionic or -mmusl has been passed to change
+ the default. */
-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
+#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
+ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
#if DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
#elif DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
#elif DEFAULT_LIBC == LIBC_BIONIC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
+#elif DEFAULT_LIBC == LIBC_MUSL
+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
+ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
#else
#error "Unsupported DEFAULT_LIBC"
#endif /* DEFAULT_LIBC */
@@ -81,24 +87,100 @@ see the files COPYING3 and COPYING.RUNTI
#define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
#define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
#define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32"
+/* Should be redefined for each target that supports musl. */
+#define MUSL_DYNAMIC_LINKER "/dev/null"
+#define MUSL_DYNAMIC_LINKER32 "/dev/null"
+#define MUSL_DYNAMIC_LINKER64 "/dev/null"
+#define MUSL_DYNAMIC_LINKERX32 "/dev/null"
#define GNU_USER_DYNAMIC_LINKER \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
- BIONIC_DYNAMIC_LINKER)
+ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
#define GNU_USER_DYNAMIC_LINKER32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
- BIONIC_DYNAMIC_LINKER32)
+ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
#define GNU_USER_DYNAMIC_LINKER64 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
- BIONIC_DYNAMIC_LINKER64)
+ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
#define GNU_USER_DYNAMIC_LINKERX32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
- BIONIC_DYNAMIC_LINKERX32)
+ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
/* Whether we have Bionic libc runtime */
#undef TARGET_HAS_BIONIC
#define TARGET_HAS_BIONIC (OPTION_BIONIC)
+/* musl avoids problematic includes by rearranging the include directories.
+ * Unfortunately, this is mostly duplicated from cppdefault.c */
+#if DEFAULT_LIBC == LIBC_MUSL
+#define INCLUDE_DEFAULTS_MUSL_GPP \
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+
+#ifdef LOCAL_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_LOCAL \
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
+#else
+#define INCLUDE_DEFAULTS_MUSL_LOCAL
+#endif
+
+#ifdef PREFIX_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_PREFIX \
+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
+#else
+#define INCLUDE_DEFAULTS_MUSL_PREFIX
+#endif
+
+#ifdef CROSS_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_CROSS \
+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
+#else
+#define INCLUDE_DEFAULTS_MUSL_CROSS
+#endif
+
+#ifdef TOOL_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_TOOL \
+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
+#else
+#define INCLUDE_DEFAULTS_MUSL_TOOL
+#endif
+
+#ifdef NATIVE_SYSTEM_HEADER_DIR
+#define INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
+#else
+#define INCLUDE_DEFAULTS_MUSL_NATIVE
+#endif
+
+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
+# undef INCLUDE_DEFAULTS_MUSL_LOCAL
+# define INCLUDE_DEFAULTS_MUSL_LOCAL
+# undef INCLUDE_DEFAULTS_MUSL_NATIVE
+# define INCLUDE_DEFAULTS_MUSL_NATIVE
+#else
+# undef INCLUDE_DEFAULTS_MUSL_CROSS
+# define INCLUDE_DEFAULTS_MUSL_CROSS
+#endif
+
+#undef INCLUDE_DEFAULTS
+#define INCLUDE_DEFAULTS \
+ { \
+ INCLUDE_DEFAULTS_MUSL_GPP \
+ INCLUDE_DEFAULTS_MUSL_PREFIX \
+ INCLUDE_DEFAULTS_MUSL_CROSS \
+ INCLUDE_DEFAULTS_MUSL_TOOL \
+ INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
+ { 0, 0, 0, 0, 0, 0 } \
+ }
+#endif
+
#if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
/* This is a *uclinux* target. We don't define below macros to normal linux
versions, because doing so would require *uclinux* targets to include
--- a/gcc/config/linux.opt
+++ b/gcc/config/linux.opt
@@ -28,5 +28,9 @@ Target Report RejectNegative Var(linux_l
Use GNU C library
muclibc
-Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
+Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mmusl)
Use uClibc C library
+
+mmusl
+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mbionic)
+Use musl C library
--- a/gcc/configure
+++ b/gcc/configure
@@ -27833,6 +27833,9 @@ if test "${gcc_cv_libc_provides_ssp+set}
else
gcc_cv_libc_provides_ssp=no
case "$target" in
+ *-*-musl*)
+ # All versions of musl provide stack protector
+ gcc_cv_libc_provides_ssp=yes;;
*-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
# glibc 2.4 and later provides __stack_chk_fail and
# either __stack_chk_guard, or TLS access to stack guard canary.
@@ -27865,6 +27868,7 @@ fi
# <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
# simply assert that glibc does provide this, which is true for all
# realistically usable GNU/Hurd configurations.
+ # All supported versions of musl provide it as well
gcc_cv_libc_provides_ssp=yes;;
*-*-darwin* | *-*-freebsd*)
ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
@@ -27961,6 +27965,9 @@ case "$target" in
gcc_cv_target_dl_iterate_phdr=no
fi
;;
+ *-linux-musl*)
+ gcc_cv_target_dl_iterate_phdr=yes
+ ;;
esac
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5287,6 +5287,9 @@ AC_CACHE_CHECK(__stack_chk_fail in targe
gcc_cv_libc_provides_ssp,
[gcc_cv_libc_provides_ssp=no
case "$target" in
+ *-*-musl*)
+ # All versions of musl provide stack protector
+ gcc_cv_libc_provides_ssp=yes;;
*-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
# glibc 2.4 and later provides __stack_chk_fail and
# either __stack_chk_guard, or TLS access to stack guard canary.
@@ -5313,6 +5316,7 @@ AC_CACHE_CHECK(__stack_chk_fail in targe
# <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
# simply assert that glibc does provide this, which is true for all
# realistically usable GNU/Hurd configurations.
+ # All supported versions of musl provide it as well
gcc_cv_libc_provides_ssp=yes;;
*-*-darwin* | *-*-freebsd*)
AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
@@ -5386,6 +5390,9 @@ case "$target" in
gcc_cv_target_dl_iterate_phdr=no
fi
;;
+ *-linux-musl*)
+ gcc_cv_target_dl_iterate_phdr=yes
+ ;;
esac
GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -667,7 +667,7 @@ Objective-C and Objective-C++ Dialects}.
-mcpu=@var{cpu}}
@emph{GNU/Linux Options}
-@gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
+@gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol
-tno-android-cc -tno-android-ld}
@emph{H8/300 Options}
@@ -15340,13 +15340,19 @@ These @samp{-m} options are defined for
@item -mglibc
@opindex mglibc
Use the GNU C library. This is the default except
-on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
+on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
+@samp{*-*-linux-*android*} targets.
@item -muclibc
@opindex muclibc
Use uClibc C library. This is the default on
@samp{*-*-linux-*uclibc*} targets.
+@item -mmusl
+@opindex mmusl
+Use the musl C library. This is the default on
+@samp{*-*-linux-*musl*} targets.
+
@item -mbionic
@opindex mbionic
Use Bionic C library. This is the default on
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 27 May 2015 13:17:11 +0000 (+0000)
Subject: [PATCH 4/13] arm musl support
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=de799bd087ab9a179768fea75bd195a31d3432a4
[PATCH 4/13] arm musl support
On behalf of szabolcs.nagy@arm.com
2015-05-27 Gregor Richards <gregor.richards@uwaterloo.ca>
* config/arm/linux-eabi.h (MUSL_DYNAMIC_LINKER): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223749 138bc75d-0d04-0410-961f-82ee72b054a4
---
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -77,6 +77,23 @@
%{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
%{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+/* For ARM musl currently supports four dynamic linkers:
+ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
+ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
+ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
+ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
+ musl does not support the legacy OABI mode.
+ All the dynamic linkers live in /lib.
+ We default to soft-float, EL. */
+#undef MUSL_DYNAMIC_LINKER
+#if TARGET_BIG_ENDIAN_DEFAULT
+#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
+#else
+#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
+#endif
+#define MUSL_DYNAMIC_LINKER \
+ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
+
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
use the GNU/Linux version, not the generic BPABI version. */
#undef LINK_SPEC
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 8 May 2015 15:16:50 +0000 (+0000)
Subject: [PATCH 6/13] mips musl support
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2550b6a866c887472b587bef87d433c51cf1ebc8
[PATCH 6/13] mips musl support
2015-05-08 Gregor Richards <gregor.richards@uwaterloo.ca>
Szabolcs Nagy <szabolcs.nagy@arm.com>
* config/mips/linux.h (MUSL_DYNAMIC_LINKER32): Define.
(MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERN32): Define.
(GNU_USER_DYNAMIC_LINKERN32): Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222915 138bc75d-0d04-0410-961f-82ee72b054a4
---
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -37,7 +37,13 @@ along with GCC; see the file COPYING3.
#define UCLIBC_DYNAMIC_LINKERN32 \
"%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
+#undef MUSL_DYNAMIC_LINKER32
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips%{EL:el}%{msoft-float:-sf}.so.1"
+#undef MUSL_DYNAMIC_LINKER64
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips64%{EL:el}%{msoft-float:-sf}.so.1"
+#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mipsn32%{EL:el}%{msoft-float:-sf}.so.1"
+
#define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
#define GNU_USER_DYNAMIC_LINKERN32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
- BIONIC_DYNAMIC_LINKERN32)
+ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
gcc/Changelog:
2015-04-24 Gregor Richards <gregor.richards@uwaterloo.ca>
Szabolcs Nagy <szabolcs.nagy@arm.com>
* config.gcc (secure_plt): Add *-linux*-musl*.
* config/rs6000/linux64.h (MUSL_DYNAMIC_LINKER32): Define.
(MUSL_DYNAMIC_LINKER64): Define.
(GNU_USER_DYNAMIC_LINKER32): Update.
(GNU_USER_DYNAMIC_LINKER64): Update.
(CHOOSE_DYNAMIC_LINKER): Update.
* config/rs6000/secureplt.h (LINK_SECURE_PLT_DEFAULT_SPEC): Define.
* config/rs6000/sysv4.h (GNU_USER_DYNAMIC_LINKER): Update.
(MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER_E,)
(INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,)
(INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,)
(INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define.
(LINK_SECURE_PLT_DEFAULT_SPEC): Define.
(CHOOSE_DYNAMIC_LINKER, LINK_TARGET_SPEC, LINK_OS_LINUX_SPEC): Update.
* config/rs6000/sysv4le.h (MUSL_DYNAMIC_LINKER_E): Define.
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -365,17 +365,21 @@ extern int dot_symbols;
#endif
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1"
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E ".so.1"
#if DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
#elif DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
+#elif DEFAULT_LIBC == LIBC_MUSL
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
#else
#error "Unsupported DEFAULT_LIBC"
#endif
#define GNU_USER_DYNAMIC_LINKER32 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
#define GNU_USER_DYNAMIC_LINKER64 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
#undef DEFAULT_ASM_ENDIAN
#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
--- a/gcc/config/rs6000/secureplt.h
+++ b/gcc/config/rs6000/secureplt.h
@@ -18,3 +18,4 @@ along with GCC; see the file COPYING3.
<http://www.gnu.org/licenses/>. */
#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -537,6 +537,9 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
#ifndef CC1_SECURE_PLT_DEFAULT_SPEC
#define CC1_SECURE_PLT_DEFAULT_SPEC ""
#endif
+#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
+#define LINK_SECURE_PLT_DEFAULT_SPEC ""
+#endif
/* Pass -G xxx to the compiler. */
#undef CC1_SPEC
@@ -574,7 +577,8 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
%{R*} \
%(link_shlib) \
%{!T*: %(link_start) } \
-%(link_os)"
+%(link_os)" \
+"%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
/* Shared libraries are not default. */
#define LINK_SHLIB_SPEC "\
@@ -757,17 +761,22 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
#define LINK_START_LINUX_SPEC ""
+#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","")
+
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1"
#if DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+#elif DEFAULT_LIBC == LIBC_MUSL
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
#else
#error "Unsupported DEFAULT_LIBC"
#endif
#define GNU_USER_DYNAMIC_LINKER \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
@@ -889,6 +898,7 @@ ncrtn.o%s"
{ "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
{ "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
+ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
{ "cpp_os_ads", CPP_OS_ADS_SPEC }, \
{ "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
@@ -943,3 +953,72 @@ ncrtn.o%s"
/* This target uses the sysv4.opt file. */
#define TARGET_USES_SYSV4_OPT 1
+/* Include order changes for musl, same as in generic linux.h. */
+#if DEFAULT_LIBC == LIBC_MUSL
+#define INCLUDE_DEFAULTS_MUSL_GPP \
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+
+#ifdef LOCAL_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_LOCAL \
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
+#else
+#define INCLUDE_DEFAULTS_MUSL_LOCAL
+#endif
+
+#ifdef PREFIX_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_PREFIX \
+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
+#else
+#define INCLUDE_DEFAULTS_MUSL_PREFIX
+#endif
+
+#ifdef CROSS_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_CROSS \
+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
+#else
+#define INCLUDE_DEFAULTS_MUSL_CROSS
+#endif
+
+#ifdef TOOL_INCLUDE_DIR
+#define INCLUDE_DEFAULTS_MUSL_TOOL \
+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
+#else
+#define INCLUDE_DEFAULTS_MUSL_TOOL
+#endif
+
+#ifdef NATIVE_SYSTEM_HEADER_DIR
+#define INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
+#else
+#define INCLUDE_DEFAULTS_MUSL_NATIVE
+#endif
+
+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
+# undef INCLUDE_DEFAULTS_MUSL_LOCAL
+# define INCLUDE_DEFAULTS_MUSL_LOCAL
+# undef INCLUDE_DEFAULTS_MUSL_NATIVE
+# define INCLUDE_DEFAULTS_MUSL_NATIVE
+#else
+# undef INCLUDE_DEFAULTS_MUSL_CROSS
+# define INCLUDE_DEFAULTS_MUSL_CROSS
+#endif
+
+#undef INCLUDE_DEFAULTS
+#define INCLUDE_DEFAULTS \
+ { \
+ INCLUDE_DEFAULTS_MUSL_GPP \
+ INCLUDE_DEFAULTS_MUSL_PREFIX \
+ INCLUDE_DEFAULTS_MUSL_CROSS \
+ INCLUDE_DEFAULTS_MUSL_TOOL \
+ INCLUDE_DEFAULTS_MUSL_NATIVE \
+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
+ { 0, 0, 0, 0, 0, 0 } \
+ }
+#endif
--- a/gcc/config/rs6000/sysv4le.h
+++ b/gcc/config/rs6000/sysv4le.h
@@ -31,3 +31,5 @@
/* Little-endian PowerPC64 Linux uses the ELF v2 ABI by default. */
#define LINUX64_DEFAULT_ABI_ELFv2
+#undef MUSL_DYNAMIC_LINKER_E
+#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","le")
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2416,6 +2416,10 @@ powerpc*-*-linux*)
powerpc*-*-linux*paired*)
tm_file="${tm_file} rs6000/750cl.h" ;;
esac
+ case ${target} in
+ *-linux*-musl*)
+ enable_secureplt=yes ;;
+ esac
if test x${enable_secureplt} = xyes; then
tm_file="rs6000/secureplt.h ${tm_file}"
fi
gcc/Changelog:
2015-04-27 Gregor Richards <gregor.richards@uwaterloo.ca>
Szabolcs Nagy <szabolcs.nagy@arm.com>
* config/sh/linux.h (MUSL_DYNAMIC_LINKER): Define.
(MUSL_DYNAMIC_LINKER_E, MUSL_DYNAMIC_LINKER_FP): Define.
--- a/gcc/config/sh/linux.h
+++ b/gcc/config/sh/linux.h
@@ -43,6 +43,28 @@ along with GCC; see the file COPYING3.
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN
+#define MUSL_DYNAMIC_LINKER_E "%{mb:eb}"
+#else
+#define MUSL_DYNAMIC_LINKER_E "%{!ml:eb}"
+#endif
+
+#if TARGET_CPU_DEFAULT & ( MASK_HARD_SH2A_DOUBLE | MASK_SH4 )
+/* "-nofpu" if any nofpu option is specified */
+#define MUSL_DYNAMIC_LINKER_FP \
+ "%{m1|m2|m2a-nofpu|m3|m4-nofpu|m4-100-nofpu|m4-200-nofpu|m4-300-nofpu|" \
+ "m4-340|m4-400|m4-500|m4al|m5-32media-nofpu|m5-64media-nofpu|" \
+ "m5-compact-nofpu:-nofpu}"
+#else
+/* "-nofpu" if none of the hard fpu options are specified */
+#define MUSL_DYNAMIC_LINKER_FP \
+ "%{m2a|m4|m4-100|m4-200|m4-300|m4a|m5-32media|m5-64media|m5-compact:;:-nofpu}"
+#endif
+
+#undef MUSL_DYNAMIC_LINKER
+#define MUSL_DYNAMIC_LINKER \
+ "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP ".so.1"
+
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
#undef SUBTARGET_LINK_EMUL_SUFFIX
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 15 May 2015 13:20:01 +0000 (+0000)
Subject: [PATCH 9/13] x86 musl support
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=5551c8d927c17f60837f15f8dfe46f945ba3fa9c
[PATCH 9/13] x86 musl support
On behalf of Szabolcs Nagy.
2015-05-15 Gregor Richards <gregor.richards@uwaterloo.ca>
* config/i386/linux.h (MUSL_DYNAMIC_LINKER): Define.
* config/i386/linux64.h (MUSL_DYNAMIC_LINKER32): Define.
(MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223218 138bc75d-0d04-0410-961f-82ee72b054a4
---
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -21,3 +21,6 @@ along with GCC; see the file COPYING3.
#define GNU_USER_LINK_EMULATION "elf_i386"
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
+#undef MUSL_DYNAMIC_LINKER
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -30,3 +30,10 @@ see the files COPYING3 and COPYING.RUNTI
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
+
+#undef MUSL_DYNAMIC_LINKER32
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
+#undef MUSL_DYNAMIC_LINKER64
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
+#undef MUSL_DYNAMIC_LINKERX32
+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
From: jgreenhalgh <jgreenhalgh@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 27 May 2015 16:46:39 +0000 (+0000)
Subject: [PATCH 3/13] aarch64 musl support
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=b3ff21cf0531be91bc3fb8200296a7633090ec78
[PATCH 3/13] aarch64 musl support
gcc/Changelog:
2015-05-27 Gregor Richards <gregor.richards@uwaterloo.ca>
Szabolcs Nagy <szabolcs.nagy@arm.com>
* config/aarch64/aarch64-linux.h (MUSL_DYNAMIC_LINKER): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223766 138bc75d-0d04-0410-961f-82ee72b054a4
---
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -23,6 +23,9 @@
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+#undef MUSL_DYNAMIC_LINKER
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+
#undef ASAN_CC1_SPEC
#define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 22 Apr 2015 14:18:16 +0000 (+0000)
Subject: fixincludes update for musl support
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2dc727de2e87c2756a514cbb43cea23c99deaa3d
fixincludes update for musl support
On behalf of Szabolcs.Nagy@arm.com
2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca>
* mkfixinc.sh: Add *-musl* with no fixes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222327 138bc75d-0d04-0410-961f-82ee72b054a4
---
--- a/fixincludes/mkfixinc.sh
+++ b/fixincludes/mkfixinc.sh
@@ -19,7 +19,8 @@ case $machine in
powerpc-*-eabi* | \
powerpc-*-rtems* | \
powerpcle-*-eabisim* | \
- powerpcle-*-eabi* )
+ powerpcle-*-eabi* | \
+ *-musl* )
# IF there is no include fixing,
# THEN create a no-op fixer and exit
(echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
此差异已折叠。
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -727,7 +727,9 @@ proper position among the other output f
#endif
#ifndef LINK_SSP_SPEC
-#ifdef TARGET_LIBC_PROVIDES_SSP
+#if DEFAULT_LIBC == LIBC_MUSL
+#define LINK_SSP_SPEC "-lssp_nonshared"
+#elif defined(TARGET_LIBC_PROVIDES_SSP)
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit:}"
#else
此差异已折叠。
此差异已折叠。
此差异已折叠。
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -369,8 +369,8 @@ extern int dot_symbols;
#endif
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
-#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1"
-#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E ".so.1"
+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
#if DEFAULT_LIBC == LIBC_UCLIBC
#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
#elif DEFAULT_LIBC == LIBC_GLIBC
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -765,7 +765,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1"
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
#if DEFAULT_LIBC == LIBC_UCLIBC
#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
#elif DEFAULT_LIBC == LIBC_MUSL
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册