packages: sync to new packages

This commit is contained in:
coolsnowwolf 2020-07-08 14:18:52 +08:00
parent 0916ff1b6f
commit c36ad692b4
2904 changed files with 216720 additions and 68234 deletions

View File

@ -1,35 +1,48 @@
# Contributing Guidelines
(See <http://wiki.openwrt.org/doc/devel/packages> for overall format and construction)
Ref: <https://openwrt.org/docs/guide-developer/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.
* Package a version which is still maintained by the upstream author and will be updated regularly with 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!
### Package Sources (archives and repositories)
* PKG_SOURCE should reference the smallest available archive. In order of preference: xz (most compressed), bzip2, gz and zip. As a last resort, downloads from source repositories can be used.
* PKG_SOURCE_URL should link to an official release archive. Use of HTTPS: is preferred. If a source archive is not available, a locally generated archive fetched using git, svn, cvs or in rare circumstances, hg or bzr.
* Convenience macros for popular mirrors are defined. Using these macros will make your package downloads more robust by mapping to a list of possible source mirrors for archive availability.
- @SF - Sourceforge (downloads.sourceforge.net) with 5 retries due to re-directs
- @GITHUB - Github (raw.githubusercontent.com) with 5 retries due to re-directs
- @GNU - 8 regional servers
- @GNOME - 8 regional servers
- @SAVANNAH - 8 regional servers
- @APACHE - 8 regional servers
- @KERNEL - Linux kernel archives & mirrors
* Please *DO NOT* use an archive which changes over time. A version labeled "latest" is not constant each download. Also, using the head of a branch will create unpredictable results which can be different each build.
#### 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`>)
* Provide an up-to-date Copyright notice or **none**. Copyright should not be assigned to OpenWrt unless you are explicitly requested by or working under contract to OpenWrt. Assigning a Copyright to yourself or organization you represent is acceptable.
* A (PKG_)MAINTAINER definition listing either yourself and/or another person responsible for this package (E.g.: PKG_MAINTAINER:= Joe D. Hacker `<jdh@jdhs-email-provider.org`>). Listing multiple maintainers is encouraged in order to keep the package active and up-to-date. Leaving this blank will also be accepted, however the review process may not be as quick as one with a maintainer.
* 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).
(E.g.: PKG_LICENSE:=GPL-2.0-or-later) 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>)
* Include Signed-off-by tag in the commit comments.
See: [Sign your work](https://openwrt.org/submitting-patches#sign_your_work)
### Advice on pull requests:
@ -74,7 +87,7 @@ Pull requests are the easiest way to contribute changes to git repos at Github.
* 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>)
(Complete list can be found at: <https://spdx.org/licenses>)
| Full Name | Identifier |
|---|:---|
@ -82,30 +95,30 @@ Pull requests are the easiest way to contribute changes to git repos at Github.
|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 1.0 (Perl)|Artistic-1.0-Perl|
|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 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 with attribution|BSD-3-Clause-Attribution|
|BSD 3-Clause Clear License|BSD-3-Clause-Clear|
|BSD 4-Clause "Original" or "Old" License|BSD-4-Clause|
|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+|
|BSD Protection License|BSD-Protection|
|GNU General Public License v1.0 only|GPL-1.0-only|
|GNU General Public License v1.0 or later|GPL-1.0-or-later|
|GNU General Public License v2.0 only|GPL-2.0-only|
|GNU General Public License v2.0 or later|GPL-2.0-or-later|
|GNU General Public License v3.0 only|GPL-3.0-only|
|GNU General Public License v3.0 or later|GPL-3.0-or-later|
|GNU Lesser General Public License v2.1 only|LGPL-2.1-only|
|GNU Lesser General Public License v2.1 or later|LGPL-2.1-or-later|
|GNU Lesser General Public License v3.0 only|LGPL-3.0-only|
|GNU Lesser General Public License v3.0 or later|LGPL-3.0-or-later|
|GNU Library General Public License v2 only|LGPL-2.0-only|
|GNU Library General Public License v2 or later|LGPL-2.0-or-later|
|Fair License|Fair|
|ISC License|ISC|
|MIT License|MIT|

View File

@ -4,11 +4,11 @@
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.
Installation of pre-built packages is handled directly by the **opkg** utility within your running OpenWrt system or by using the [OpenWrt SDK](https://openwrt.org/docs/guide-developer/using_the_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 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](https://openwrt.org/docs/guide-developer/build-system/install-buildsystem) on the OpenWrt support site.
This feed is enabled by default. To install all its package definitions, run:
```

53
admin/atop/Makefile Normal file
View File

@ -0,0 +1,53 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=atop
PKG_RELEASE:=1
PKG_VERSION:=2.5.0
PKG_LICENSE:=GPL-2.0-or-later
PKG_SOURCE_URL:=https://www.atoptool.nl/download/
PKG_HASH:=4b911057ce50463b6e8b3016c5963d48535c0cddeebc6eda817e292b22f93f33
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Toni Uhlig <matzeton@googlemail.com>
include $(INCLUDE_DIR)/package.mk
define Package/atop
SECTION:=admin
CATEGORY:=Administration
TITLE:=System and process monitor for Linux
DEPENDS:=+zlib +libncurses
URL:=https://www.atoptool.nl/
MAINTAINER:=Toni Uhlig <matzeton@googlemail.com>
endef
define Package/atop/description
Atop is an ASCII full-screen performance monitor for
Linux that is capable of reporting the activity of all
processes (even if processes have finished during the
interval), daily logging of system and process activity
for long-term analysis, highlighting overloaded system
resources by using colors, etcetera. At regular
intervals, it shows system-level activity related to the
CPU, memory, swap, disks (including LVM) and network
layers, and for every process (and thread) it shows e.g.
the CPU utilization, memory growth, disk utilization,
priority, username, state, and exit code. In combination
with the optional kernel module netatop, it even shows
network activity per process/thread.
endef
MAKE_FLAGS += \
CFLAGS+="-Wno-misleading-indentation -Wno-unused-const-variable -Wno-format-truncation"
define Package/atop/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/atop $(1)/usr/bin/
endef
$(eval $(call BuildPackage,atop))

View File

@ -0,0 +1,22 @@
diff --git a/Makefile b/Makefile
index 3bf5929..e065577 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@ VERS = $(shell ./atop -V 2>/dev/null| sed -e 's/^[^ ]* //' -e 's/ .*//')
all: atop atopsar atopacctd atopconvert
atop: atop.o $(ALLMODS) Makefile
- $(CC) -c version.c
+ $(CC) $(CFLAGS) -c version.c
$(CC) atop.o $(ALLMODS) -o atop -lncurses -lz -lm -lrt $(LDFLAGS)
atopsar: atop
@@ -45,7 +45,7 @@ atopconvert: atopconvert.o
$(CC) atopconvert.o -o atopconvert -lz $(LDFLAGS)
netlink.o: netlink.c
- $(CC) -I. -Wall -c netlink.c
+ $(CC) $(CFLAGS) -I. -Wall -c netlink.c
clean:
rm -f *.o atop atopacctd atopconvert

68
admin/backuppc/Makefile Normal file
View File

@ -0,0 +1,68 @@
# Copyright (C) 2018 OpenWrt
#
# Ideas used from the backuppc packaging in Debian GNU/Linux
#
include $(TOPDIR)/rules.mk
PKG_NAME:=backuppc
PKG_VERSION:=3.3.2
PKG_RELEASE:=3
PKG_SOURCE:=BackupPC-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/backuppc
PKG_HASH:=fbade2c8d8039297e826a75d2c39d5ac9a6f66e0c84c0cf8c4cef0bcf64d2152
PKG_BUILD_DIR:=$(BUILD_DIR)/BackupPC-$(PKG_VERSION)
PKG_MAINTAINER:=Carsten Wolff <carsten@wolffcarsten.de>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/backuppc
SECTION:=admin
CATEGORY:=Administration
TITLE:=high-performance, enterprise-grade system for backing up PCs
URL:=https://sourceforge.net/projects/backuppc/
DEPENDS:=+perl +perl-www +perl-cgi +perlbase-digest +perlbase-compress +perlbase-archive +perlbase-data +perlbase-storable +perlbase-getopt +perl-file-rsyncp +openssh-client +tar +bzip2 +samba4-client +rsync +iputils-ping
endef
define Package/backuppc/description
BackupPC is a disk based backup system featuring a clever pooling scheme and
compression to minimize disk storage and disk I/O. It can use SMB, rsync or tar
to access the clients without any additional client software and offers a
powerful http/cgi user interface.
endef
define Build/Configure
true
endef
define Build/Compile
$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) -Wall -o $(PKG_BUILD_DIR)/BackupPC_Admin ./files/setuidwrapper.c
endef
define Package/backuppc/install
$(INSTALL_DIR) $(strip $(1))/etc/init.d
$(INSTALL_BIN) ./files/backuppc.init $(strip $(1))/etc/init.d/backuppc
cd $(PKG_BUILD_DIR) && ./configure.pl --batch --html-dir-url=/backuppc/ \
--html-dir=/www/backuppc/ --cgi-dir=/www/cgi-bin/ --no-fhs --uid-ignore \
--dest-dir=$(strip $(1)) --install-dir /usr/share/backuppc \
--hostname=XXXXXX --data-dir=/data/backuppc --log-dir=/data/backuppc/log \
--bin-path perl=/usr/bin/perl --bin-path tar=/bin/tar \
--bin-path smbclient=/usr/sbin/smbclient --bin-path nmblookup=/usr/sbin/nmblookup \
--bin-path rsync=/usr/bin/rsync --bin-path ping=/usr/bin/ping --bin-path df=/bin/df \
--bin-path ssh=/usr/bin/ssh --bin-path gzip=/bin/gzip \
--bin-path sendmail=/usr/sbin/sendmail --bin-path bzip2=/usr/bin/bzip2
$(INSTALL_DIR) $(strip $(1))/usr/share/backuppc/conf
chmod 755 $(strip $(1))/data
mv $(strip $(1))/data/backuppc/conf/config.pl $(strip $(1))/usr/share/backuppc/conf/config.pl
patch --no-backup-if-mismatch $(strip $(1))/usr/share/backuppc/conf/config.pl ./files/fixup-config-pl.patch
mv $(strip $(1))/www/cgi-bin/BackupPC_Admin $(strip $(1))/usr/share/backuppc/bin/BackupPC_Admin_real
$(INSTALL_BIN) $(PKG_BUILD_DIR)/BackupPC_Admin $(strip $(1))/www/cgi-bin/BackupPC_Admin
$(INSTALL_DIR) $(strip $(1))/lib/upgrade/keep.d
$(INSTALL_DATA) files/backuppc.upgrade $(strip $(1))/lib/upgrade/keep.d/backuppc
endef
$(eval $(call BuildPackage,backuppc))

View File

@ -0,0 +1,66 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
START=95
STOP=10
USE_PROCD=1
BACKUPPC_BIN="/usr/share/backuppc/bin/BackupPC"
BACKUPPC_USER=backuppc
# it would be better if it was possible to do this at install time, but we
# can't, because in case of an openwrt image bundled with backuppc, all
# ownerships other than root are lost.
preconfigure() {
# create backuppc group and user if needed
if ! group_exists backuppc; then
group_add backuppc 864
fi
if ! user_exists backuppc; then
user_add backuppc 864 864 "BackupPC user" /data/backuppc /bin/sh
fi
# install default config if none exists, yet
if [ ! -e /data/backuppc/conf/config.pl ]; then
cp /usr/share/backuppc/conf/config.pl /data/backuppc/conf/config.pl
fi
# ensure proper ownerships and rights
chown backuppc:backuppc /data/backuppc /data/backuppc/* \
/www/cgi-bin/BackupPC_Admin
chmod 750 /data/backuppc /data/backuppc/*
chmod 755 /usr/share/backuppc/bin/BackupPC_Admin_real
# The CGI needs to be world-executable, because uhttpd-cgi.c:386 checks
# for exactly that. We don't want that, but can't avoid it, currently.
chmod 6751 /www/cgi-bin/BackupPC_Admin
chown -R :backuppc /data/backuppc/conf
chmod 2770 /data/backuppc/conf
# protect webinterface with a random password by default
if [ -x /usr/sbin/uhttpd ] && ! grep -q backuppc /etc/httpd.conf >/dev/null 2>&1; then
PASS=$(perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..8)')
PASSHASH=$(/usr/sbin/uhttpd -m "${PASS}")
echo "/cgi-bin/BackupPC_Admin:backuppc:${PASSHASH}" >> /etc/httpd.conf
uci set uhttpd.main.config=/etc/httpd.conf
/etc/init.d/uhttpd restart
# inform user
echo
echo "To protect access to the backuppc web interface, HTTP basic authentication in"
echo "uhttpd for http://$(/sbin/uci get "system.@system[0].hostname")/cgi-bin/BackupPC_Admin has been configured:"
echo "user: backuppc"
echo "pass: ${PASS}"
echo
echo "It is also recommended to follow the steps in"
echo "https://openwrt.org/docs/guide-user/services/webserver/uhttpd#securing_uhttpd"
echo "to secure access to uhttpd."
fi
}
start_service() {
# don't run preconfigure steps if called during image build
if [ -z "${IPKG_INSTROOT}" ]; then
preconfigure
fi
procd_open_instance
procd_set_param user $BACKUPPC_USER
procd_set_param reload_signal 1
procd_set_param command $BACKUPPC_BIN
}

View File

@ -0,0 +1,2 @@
/etc/httpd.conf
/data/backuppc/conf/

View File

@ -0,0 +1,67 @@
--- config.pl 2018-03-11 09:30:28.000000000 +0100
+++ config.pl.new 2018-04-05 08:40:29.180000000 +0200
@@ -41,7 +41,10 @@
#
# Host name on which the BackupPC server is running.
#
-$Conf{ServerHost} = 'XXXXXX';
+$ENV{'PATH'} = '/bin:/usr/bin';
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
+$Conf{ServerHost} = $ENV{'HOSTNAME'};
+chomp($Conf{ServerHost});
#
# TCP port number on which the BackupPC server listens for and accepts
@@ -223,7 +226,7 @@
#
# Full path to various commands for archiving
#
-$Conf{SplitPath} = '/usr/bin/split';
+$Conf{SplitPath} = '/usr/bin/split' if ( -x '/usr/bin/split' );
$Conf{ParPath} = '';
$Conf{CatPath} = '/bin/cat';
$Conf{GzipPath} = '/bin/gzip';
@@ -1572,7 +1575,7 @@
# Full path for ssh. Security caution: normal users should not
# allowed to write to this file or directory.
#
-$Conf{SshPath} = '/usr/bin/ssh';
+$Conf{SshPath} = '/usr/bin/ssh' if ( -x '/usr/bin/ssh' );
#
# Full path for nmblookup. Security caution: normal users should not
@@ -1874,7 +1877,7 @@
# Full path to the sendmail command. Security caution: normal users
# should not allowed to write to this file or directory.
#
-$Conf{SendmailPath} = '/usr/sbin/sendmail';
+$Conf{SendmailPath} = '/usr/sbin/sendmail' if ( -x '/usr/sbin/sendmail' );
#
# Minimum period between consecutive emails to a single user.
@@ -2028,13 +2031,13 @@
# $Conf{CgiAdminUsers} = 'craig celia';
# --> administrative users are only craig and celia'.
#
-$Conf{CgiAdminUserGroup} = '';
-$Conf{CgiAdminUsers} = '';
+$Conf{CgiAdminUserGroup} = 'backuppc';
+$Conf{CgiAdminUsers} = 'backuppc';
#
# URL of the BackupPC_Admin CGI script. Used for email messages.
#
-$Conf{CgiURL} = 'http://XXXXXX/cgi-bin//BackupPC_Admin';
+$Conf{CgiURL} = 'http://' . $Conf{ServerHost} . '/cgi-bin//BackupPC_Admin';
#
# Language to use. See lib/BackupPC/Lang for the list of supported
@@ -2076,7 +2079,7 @@
# dates (MM/DD), a value of 2 uses full YYYY-MM-DD format, and zero
# for international dates (DD/MM).
#
-$Conf{CgiDateFormatMMDD} = 1;
+$Conf{CgiDateFormatMMDD} = 2;
#
# If set, the complete list of hosts appears in the left navigation

View File

@ -0,0 +1,8 @@
#include <unistd.h>
int main(int argc, char* argv[])
{
execv("/usr/share/backuppc/bin/BackupPC_Admin_real", argv);
return 0;
}

View File

@ -0,0 +1,99 @@
--- a/bin/BackupPC_archive 2017-01-26 02:31:24.000000000 +0100
+++ b/bin/BackupPC_archive 2018-04-05 21:11:14.428000000 +0200
@@ -299,7 +299,7 @@
if ( $NeedPostCmd ) {
UserCommandRun("ArchivePostUserCmd");
if ( $? && $Conf{UserCmdCheckStatus} ) {
- $stat{hostError} = "RestorePreUserCmd returned error status $?";
+ $stat{hostError} = "ArchivePostUserCmd returned error status $?";
$stat{xferOK} = 0;
}
}
--- a/bin/BackupPC_dump 2017-01-26 02:31:24.000000000 +0100
+++ b/bin/BackupPC_dump 2018-04-05 21:12:23.640000000 +0200
@@ -1067,7 +1067,7 @@
# Send ALRMs to BackupPC_tarExtract if we are using it
#
if ( $tarPid > 0 ) {
- kill($bpc->sigName2num("ARLM"), $tarPid);
+ kill($bpc->sigName2num("ALRM"), $tarPid);
}
#
--- a/configure.pl 2017-01-26 02:31:24.000000000 +0100
+++ b/configure.pl 2018-04-05 21:39:24.668000000 +0200
@@ -333,7 +333,10 @@
$Conf{BackupPCUser} || "backuppc",
"backuppc-user");
if ( $opts{"set-perms"} ) {
- ($name, $passwd, $Uid, $Gid) = getpwnam($Conf{BackupPCUser});
+ #($name, $passwd, $Uid, $Gid) = getpwnam($Conf{BackupPCUser});
+ $name = 'backuppc';
+ $Uid=`id -u`;
+ $Gid=`id -g`;
last if ( $name ne "" );
print <<EOF;
@@ -800,6 +803,7 @@
#
# Figure out sensible arguments for the ping command
#
+$Conf{PingArgs} = '-c 1 $host';
if ( defined($Conf{PingArgs}) ) {
$Conf{PingCmd} = '$pingPath ' . $Conf{PingArgs};
} elsif ( !defined($Conf{PingCmd}) ) {
--- a/lib/BackupPC/CGI/View.pm 2017-01-26 02:31:24.000000000 +0100
+++ b/lib/BackupPC/CGI/View.pm 2018-04-05 21:46:22.664000000 +0200
@@ -46,7 +46,7 @@
my $compress = 0;
my $fh;
my $host = $In{host};
- my $num = $In{num};
+ my $num = ${EscHTML($In{num})};
my $type = $In{type};
my $linkHosts = 0;
my($file, $comment);
@@ -136,6 +136,10 @@
}
$s =~ s/[\n\r]+//g;
if ( $s =~ /smb: \\>/
+ || $s =~ /^tar:\d+\s/
+ || $s =~ /^ NTLMSSP_/
+ || $s =~ /^GENSEC backend /
+ || $s =~ /^doing parameter /
|| $s =~ /^\s*(\d+) \(\s*\d+\.\d kb\/s\) (.*)$/
|| $s =~ /^tar: dumped \d+ files/
|| $s =~ /^\s*added interface/i
--- a/lib/BackupPC/Lib.pm 2017-01-26 02:31:24.000000000 +0100
+++ b/lib/BackupPC/Lib.pm 2018-04-05 21:48:38.048000000 +0200
@@ -512,7 +512,8 @@
}
if ( $IODirentOk ) {
@entries = sort({ $a->{inode} <=> $b->{inode} } readdirent($fh));
- map { $_->{type} = 0 + $_->{type} } @entries; # make type numeric
+ #map { $_->{type} = 0 + $_->{type} } @entries; # make type numeric
+ map { $_->{type} = 0 + $_->{type}; $_->{type} = undef if ($_->{type} eq BPC_DT_UNKNOWN); } @entries; # make type numeric, unset unknown types
} else {
@entries = map { { name => $_} } readdir($fh);
}
--- a/lib/BackupPC/Xfer/Smb.pm 2017-01-26 02:31:24.000000000 +0100
+++ b/lib/BackupPC/Xfer/Smb.pm 2018-04-05 21:57:16.616000000 +0200
@@ -219,7 +219,7 @@
#
# MAKSYM 14082016: The next regex will never match on Samba-4.3, as
# smbclient doesn't produce output required; keeping it for older Sambas
- if ( /^\s*(-?\d+) \(\s*\d+[.,]\d kb\/s\) (.*)$/ ) {
+ if ( /^\s*(-?\d+) \(\s*\d+[.,]\d kb\/s\) (.*)$/ || /^tar:(\d+)\s+\+\+\+ (.*)$/ ) {
my $sambaFileSize = $1;
my $pcFileName = $2;
(my $fileName = $pcFileName) =~ s/\\/\//g;
@@ -281,6 +281,9 @@
} elsif ( /smb: \\>/
|| /^\s*tar:\d+/ # MAKSYM 14082016: ignoring 2 more Samba-4.3 specific lines
|| /^\s*WARNING:/i
+ || /^ NTLMSSP_/
+ || /^GENSEC backend /
+ || /^doing parameter /
|| /^\s*added interface/i
|| /^\s*tarmode is now/i
|| /^\s*Total bytes written/i

View File

@ -9,13 +9,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=debootstrap
PKG_VERSION:=1.0.92
PKG_VERSION:=1.0.119~bpo10+1
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_HASH:=b48aeb76533f233ac45c8b5ddd452550b3998e67e32dba4137f320a1a7b3519e
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=Unique
PKG_LICENSE_FILES:=debian/copyright
@ -27,8 +28,8 @@ 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
URL:=https://wiki.debian.org/Debootstrap
DEPENDS:= +coreutils +coreutils-chroot +coreutils-sha1sum +ar +xz-utils +xz
endef
define Package/debootstrap/description

View File

@ -1,3 +1,4 @@
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -0,0 +1,10 @@
--- a/usr/share/debootstrap/functions
+++ b/usr/share/debootstrap/functions
@@ -77,7 +77,6 @@ progress_next () {
}
wgetprogress () {
- [ ! "$VERBOSE" ] && NVSWITCH="-nv"
local ret=0
if [ "$USE_DEBIANINSTALLER_INTERACTION" ] && [ "$PROGRESS_NEXT" ]; then
# The exit status of a pipeline is that of the last command in

61
admin/gkrellmd/Makefile Normal file
View File

@ -0,0 +1,61 @@
#
# Copyright (C) 2007-2018 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:=gkrellmd
PKG_VERSION:=2.3.11
PKG_RELEASE:=1
PKG_SOURCE:=gkrellm-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://gkrellm.srcbox.net/releases
PKG_HASH:=1ee0643ed9ed99f88c1504c89d9ccb20780cf29319c904b68e80a8e7c8678c06
PKG_BUILD_DIR:=$(BUILD_DIR)/gkrellm-$(PKG_VERSION)
PKG_MAINTAINER:=Peter Denison <openwrt@marshadder.org>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/gkrellmd
SECTION:=admin
CATEGORY:=Administration
DEPENDS:=+glib2
TITLE:=The GNU Krell Monitors Server
URL:=http://gkrellm.net/
endef
define Package/gkrellmd/description
Gkrellmd listens for connections from gkrellm clients. When
a gkrellm client connects to a gkrellmd server all builtin
monitors collect their data from the server.
endef
define Package/gkrellmd/conffiles
/etc/$(PKG_NAME).conf
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/server \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS) " \
without-libsensors="yes"
endef
define Package/gkrellmd/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/server/$(PKG_NAME) $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) $(PKG_BUILD_DIR)/server/$(PKG_NAME).conf $(1)/etc/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
endef
$(eval $(call BuildPackage,gkrellmd))

View File

@ -0,0 +1,16 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
START=60
BIN=gkrellmd
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
start() {
mkdir -p $RUN_D
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}

View File

@ -0,0 +1,35 @@
Index: gkrellm-2.3.10/server/gkrellmd.conf
===================================================================
--- gkrellm-2.3.10.orig/server/gkrellmd.conf 2008-03-09 10:19:26.000000000 +0100
+++ gkrellm-2.3.10/server/gkrellmd.conf 2008-03-09 10:19:26.000000000 +0100
@@ -4,7 +4,7 @@
# the client update frequency. Values may be from 1 to 10 and should be
# smaller values to reduce network traffic.
#
-#update-hz 3
+update-hz 10
# Limit number of simultaneous clients allowed to connect.
#
@@ -30,18 +30,18 @@
# Drop privileges after startup (you must start gkrellmd as root to do it).
# NOTE: Option ignored on Windows
#
-#user nobody
+user nobody
#group proc
# Create a PID file for the running gkrellmd. Default is no PID file.
# NOTE: Option ignored on Windows
#
-#pidfile /var/run/gkrellmd.pid
+pidfile /var/run/gkrellmd.pid
# Run in background and detach from the controlling terminal
# NOTE: Option ignored on Windows
#
-#detach
+detach
# Time interval between checks for various monitors. If nfs-interval
# is <= 0 then gkrellmd will not read data for nfs file system types.

View File

@ -9,16 +9,17 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=htop
PKG_VERSION:=2.2.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://hisham.hm/htop/releases/$(PKG_VERSION)/
PKG_SOURCE_URL:=https://hisham.hm/htop/releases/$(PKG_VERSION)/
PKG_HASH:=d9d6826f10ce3887950d709b53ee1d8c1849a70fa38e91d5896ad8cbc6ba3c57
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:htop:htop
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
@ -28,7 +29,7 @@ define Package/htop
CATEGORY:=Administration
TITLE:=Interactive processes viewer
DEPENDS:=+libncurses
URL:=http://htop.sourceforge.net/
URL:=https://hisham.hm/htop/
MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
endef

View File

@ -9,13 +9,14 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ipmitool
PKG_VERSION:=1.8.18
PKG_RELEASE:=1
PKG_RELEASE:=4
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
PKG_CPE_ID:=cpe:/a:ipmitool_project:ipmitool
include $(INCLUDE_DIR)/package.mk
@ -24,7 +25,7 @@ define Package/ipmitool
CATEGORY:=Administration
DEPENDS:=+libopenssl +libncurses +libreadline
TITLE:=Command-line interface to IPMI-enabled devices
URL:=http://sourceforge.net/projects/ipmitool/
URL:=https://github.com/ipmitool/ipmitool
MAINTAINER:=Alexander Couzens <lynxis@fe80.eu>
endef

View File

@ -0,0 +1,104 @@
From b57487e360916ab3eaa50aa6d021c73b6337a4a0 Mon Sep 17 00:00:00 2001
From: Dennis Schridde <dennis.schridde@uni-heidelberg.de>
Date: Wed, 30 Nov 2016 17:33:00 +0100
Subject: [PATCH 1/4] ID:461 - OpenSSL 1.1 compatibility - "error: storage size
of 'ctx' isn't known"
In OpenSSL 1.1 EVP_CIPHER_CTX became opaque, cf. `man 3ssl EVP_EncryptInit`
Fixes: ID:461
---
src/plugins/lanplus/lanplus_crypt_impl.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
index d5fac37..3c0df23 100644
--- a/src/plugins/lanplus/lanplus_crypt_impl.c
+++ b/src/plugins/lanplus/lanplus_crypt_impl.c
@@ -164,10 +164,10 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
uint8_t * output,
uint32_t * bytes_written)
{
- EVP_CIPHER_CTX ctx;
- EVP_CIPHER_CTX_init(&ctx);
- EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);
- EVP_CIPHER_CTX_set_padding(&ctx, 0);
+ EVP_CIPHER_CTX* ctx;
+ EVP_CIPHER_CTX_init(ctx);
+ EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
*bytes_written = 0;
@@ -191,7 +191,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
- if(!EVP_EncryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))
+ if(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
{
/* Error */
*bytes_written = 0;
@@ -201,7 +201,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
{
uint32_t tmplen;
- if(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))
+ if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
*bytes_written = 0;
return; /* Error */
@@ -210,7 +210,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
{
/* Success */
*bytes_written += tmplen;
- EVP_CIPHER_CTX_cleanup(&ctx);
+ EVP_CIPHER_CTX_cleanup(ctx);
}
}
}
@@ -239,10 +239,10 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
uint8_t * output,
uint32_t * bytes_written)
{
- EVP_CIPHER_CTX ctx;
- EVP_CIPHER_CTX_init(&ctx);
- EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);
- EVP_CIPHER_CTX_set_padding(&ctx, 0);
+ EVP_CIPHER_CTX* ctx;
+ EVP_CIPHER_CTX_init(ctx);
+ EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
if (verbose >= 5)
@@ -266,7 +266,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
- if (!EVP_DecryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))
+ if (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
{
/* Error */
lprintf(LOG_DEBUG, "ERROR: decrypt update failed");
@@ -277,7 +277,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
{
uint32_t tmplen;
- if (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))
+ if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
char buffer[1000];
ERR_error_string(ERR_get_error(), buffer);
@@ -290,7 +290,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
{
/* Success */
*bytes_written += tmplen;
- EVP_CIPHER_CTX_cleanup(&ctx);
+ EVP_CIPHER_CTX_cleanup(ctx);
}
}
--
2.16.1

View File

@ -0,0 +1,36 @@
From 77fe5635037ebaf411cae46cf5045ca819b5c145 Mon Sep 17 00:00:00 2001
From: Zdenek Styblik <stybla@turnovfree.net>
Date: Sun, 15 Jan 2017 15:11:25 +0100
Subject: [PATCH 2/4] ID:461 - Make compiler happier about changes related to
OpenSSL 1.1
Complaint was that ctx isn't initialized.
---
src/plugins/lanplus/lanplus_crypt_impl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
index 3c0df23..d12d0e3 100644
--- a/src/plugins/lanplus/lanplus_crypt_impl.c
+++ b/src/plugins/lanplus/lanplus_crypt_impl.c
@@ -164,7 +164,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
uint8_t * output,
uint32_t * bytes_written)
{
- EVP_CIPHER_CTX* ctx;
+ EVP_CIPHER_CTX *ctx = NULL;
EVP_CIPHER_CTX_init(ctx);
EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
EVP_CIPHER_CTX_set_padding(ctx, 0);
@@ -239,7 +239,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
uint8_t * output,
uint32_t * bytes_written)
{
- EVP_CIPHER_CTX* ctx;
+ EVP_CIPHER_CTX *ctx = NULL;
EVP_CIPHER_CTX_init(ctx);
EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
EVP_CIPHER_CTX_set_padding(ctx, 0);
--
2.16.1

View File

@ -0,0 +1,53 @@
From f004b4b7197fc83e7d47ec8cbcaefffa9a922717 Mon Sep 17 00:00:00 2001
From: Zdenek Styblik <stybla@turnovfree.net>
Date: Sun, 12 Mar 2017 14:00:35 +0100
Subject: [PATCH 3/4] ID:480 - ipmitool coredumps in EVP_CIPHER_CTX_init
IPMI tool coredumps due to changes introduced in ID:461. This shouldn't be
surprise as a NULL pointer is passed to init. Commit addresses this issue by
calling EVP_CIPHER_CTX_new() instead of EVP_CIPHER_CTX_init(), which is
deprecated, and by checking return value of call to former function.
---
src/plugins/lanplus/lanplus_crypt_impl.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
index d12d0e3..0e330c1 100644
--- a/src/plugins/lanplus/lanplus_crypt_impl.c
+++ b/src/plugins/lanplus/lanplus_crypt_impl.c
@@ -165,10 +165,13 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
uint32_t * bytes_written)
{
EVP_CIPHER_CTX *ctx = NULL;
- EVP_CIPHER_CTX_init(ctx);
+ ctx = EVP_CIPHER_CTX_new();
+ if (ctx == NULL) {
+ *bytes_written = 0;
+ return;
+ }
EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
EVP_CIPHER_CTX_set_padding(ctx, 0);
-
*bytes_written = 0;
@@ -240,11 +243,14 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
uint32_t * bytes_written)
{
EVP_CIPHER_CTX *ctx = NULL;
- EVP_CIPHER_CTX_init(ctx);
+ ctx = EVP_CIPHER_CTX_new();
+ if (ctx == NULL) {
+ *bytes_written = 0;
+ return;
+ }
EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
EVP_CIPHER_CTX_set_padding(ctx, 0);
-
if (verbose >= 5)
{
printbuf(iv, 16, "decrypting with this IV");
--
2.16.1

View File

@ -0,0 +1,144 @@
From 1664902525a1c3771b4d8b3ccab7ea1ba6b2bdd1 Mon Sep 17 00:00:00 2001
From: Holger Liebig <holger.liebig@ts.fujitsu.com>
Date: Tue, 4 Apr 2017 20:43:05 +0200
Subject: [PATCH 4/4] ID:480 - Call EVP_CIPHER_CTX_free() instead of
EVP_CIPHER_CTX_cleanup()
Call EVP_CIPHER_CTX_free() instead of EVP_CIPHER_CTX_cleanup() to fix memory
leak.
---
src/plugins/lanplus/lanplus_crypt_impl.c | 44 +++++++++++++++++---------------
1 file changed, 23 insertions(+), 21 deletions(-)
diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
index 0e330c1..9652a5e 100644
--- a/src/plugins/lanplus/lanplus_crypt_impl.c
+++ b/src/plugins/lanplus/lanplus_crypt_impl.c
@@ -165,13 +165,6 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
uint32_t * bytes_written)
{
EVP_CIPHER_CTX *ctx = NULL;
- ctx = EVP_CIPHER_CTX_new();
- if (ctx == NULL) {
- *bytes_written = 0;
- return;
- }
- EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
- EVP_CIPHER_CTX_set_padding(ctx, 0);
*bytes_written = 0;
@@ -185,6 +178,14 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
printbuf(input, input_length, "encrypting this data");
}
+ ctx = EVP_CIPHER_CTX_new();
+ if (ctx == NULL) {
+ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
+ return;
+ }
+ EVP_CIPHER_CTX_init(ctx);
+ EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
/*
* The default implementation adds a whole block of padding if the input
@@ -198,7 +199,6 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
{
/* Error */
*bytes_written = 0;
- return;
}
else
{
@@ -206,16 +206,17 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
+ /* Error */
*bytes_written = 0;
- return; /* Error */
}
else
{
/* Success */
*bytes_written += tmplen;
- EVP_CIPHER_CTX_cleanup(ctx);
}
}
+ /* performs cleanup and free */
+ EVP_CIPHER_CTX_free(ctx);
}
@@ -243,13 +244,6 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
uint32_t * bytes_written)
{
EVP_CIPHER_CTX *ctx = NULL;
- ctx = EVP_CIPHER_CTX_new();
- if (ctx == NULL) {
- *bytes_written = 0;
- return;
- }
- EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
- EVP_CIPHER_CTX_set_padding(ctx, 0);
if (verbose >= 5)
{
@@ -258,12 +252,20 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
printbuf(input, input_length, "decrypting this data");
}
-
*bytes_written = 0;
if (input_length == 0)
return;
+ ctx = EVP_CIPHER_CTX_new();
+ if (ctx == NULL) {
+ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
+ return;
+ }
+ EVP_CIPHER_CTX_init(ctx);
+ EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
+
/*
* The default implementation adds a whole block of padding if the input
* data is perfectly aligned. We would like to keep that from happening.
@@ -277,7 +279,6 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
/* Error */
lprintf(LOG_DEBUG, "ERROR: decrypt update failed");
*bytes_written = 0;
- return;
}
else
{
@@ -285,20 +286,21 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
+ /* Error */
char buffer[1000];
ERR_error_string(ERR_get_error(), buffer);
lprintf(LOG_DEBUG, "the ERR error %s", buffer);
lprintf(LOG_DEBUG, "ERROR: decrypt final failed");
*bytes_written = 0;
- return; /* Error */
}
else
{
/* Success */
*bytes_written += tmplen;
- EVP_CIPHER_CTX_cleanup(ctx);
}
}
+ /* performs cleanup and free */
+ EVP_CIPHER_CTX_free(ctx);
if (verbose >= 5)
{
--
2.16.1

View File

@ -0,0 +1,47 @@
From cf39da53236abf02d39c6a98a645488933f3e861 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Tue, 21 Aug 2018 19:29:07 -0700
Subject: [PATCH] ipmitool: Fix compile with deprecated APIs disabled.
From the man page:
EVP_CIPHER_CTX was made opaque in OpenSSL 1.1.0. As a result,
EVP_CIPHER_CTX_reset() appeared and EVP_CIPHER_CTX_cleanup() disappeared.
EVP_CIPHER_CTX_init() remains as an alias for EVP_CIPHER_CTX_reset().
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
src/plugins/lanplus/lanplus_crypt_impl.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
index 9652a5e..e94401e 100644
--- a/src/plugins/lanplus/lanplus_crypt_impl.c
+++ b/src/plugins/lanplus/lanplus_crypt_impl.c
@@ -183,7 +183,11 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
return;
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
EVP_CIPHER_CTX_init(ctx);
+#else
+ EVP_CIPHER_CTX_reset(ctx);
+#endif
EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
EVP_CIPHER_CTX_set_padding(ctx, 0);
@@ -262,7 +266,11 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
return;
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
EVP_CIPHER_CTX_init(ctx);
+#else
+ EVP_CIPHER_CTX_reset(ctx);
+#endif
EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
EVP_CIPHER_CTX_set_padding(ctx, 0);
--
2.7.4

View File

@ -0,0 +1,128 @@
From 960dbb956d9f9cb05b719087faed53c88dc80956 Mon Sep 17 00:00:00 2001
From: Chrostoper Ertl <chertl@microsoft.com>
Date: Thu, 28 Nov 2019 16:33:59 +0000
Subject: [PATCH 06/11] fru: Fix buffer overflow vulnerabilities
Partial fix for CVE-2020-5208, see
https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp
The `read_fru_area_section` function only performs size validation of
requested read size, and falsely assumes that the IPMI message will not
respond with more than the requested amount of data; it uses the
unvalidated response size to copy into `frubuf`. If the response is
larger than the request, this can result in overflowing the buffer.
The same issue affects the `read_fru_area` function.
---
lib/ipmi_fru.c | 33 +++++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
index cf00effc82a2..af99aa99444c 100644
--- a/lib/ipmi_fru.c
+++ b/lib/ipmi_fru.c
@@ -615,7 +615,10 @@ int
read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
uint32_t offset, uint32_t length, uint8_t *frubuf)
{
- uint32_t off = offset, tmp, finish;
+ uint32_t off = offset;
+ uint32_t tmp;
+ uint32_t finish;
+ uint32_t size_left_in_buffer;
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[4];
@@ -628,10 +631,12 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
finish = offset + length;
if (finish > fru->size) {
+ memset(frubuf + fru->size, 0, length - fru->size);
finish = fru->size;
lprintf(LOG_NOTICE, "Read FRU Area length %d too large, "
"Adjusting to %d",
offset + length, finish - offset);
+ length = finish - offset;
}
memset(&req, 0, sizeof(req));
@@ -667,6 +672,7 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
}
}
+ size_left_in_buffer = length;
do {
tmp = fru->access ? off >> 1 : off;
msg_data[0] = id;
@@ -707,9 +713,18 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
}
tmp = fru->access ? rsp->data[0] << 1 : rsp->data[0];
+ if(rsp->data_len < 1
+ || tmp > rsp->data_len - 1
+ || tmp > size_left_in_buffer)
+ {
+ printf(" Not enough buffer size");
+ return -1;
+ }
+
memcpy(frubuf, rsp->data + 1, tmp);
off += tmp;
frubuf += tmp;
+ size_left_in_buffer -= tmp;
/* sometimes the size returned in the Info command
* is too large. return 0 so higher level function
* still attempts to parse what was returned */
@@ -742,7 +757,9 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
uint32_t offset, uint32_t length, uint8_t *frubuf)
{
static uint32_t fru_data_rqst_size = 20;
- uint32_t off = offset, tmp, finish;
+ uint32_t off = offset;
+ uint32_t tmp, finish;
+ uint32_t size_left_in_buffer;
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[4];
@@ -755,10 +772,12 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
finish = offset + length;
if (finish > fru->size) {
+ memset(frubuf + fru->size, 0, length - fru->size);
finish = fru->size;
lprintf(LOG_NOTICE, "Read FRU Area length %d too large, "
"Adjusting to %d",
offset + length, finish - offset);
+ length = finish - offset;
}
memset(&req, 0, sizeof(req));
@@ -773,6 +792,8 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
if (fru->access && fru_data_rqst_size > 16)
#endif
fru_data_rqst_size = 16;
+
+ size_left_in_buffer = length;
do {
tmp = fru->access ? off >> 1 : off;
msg_data[0] = id;
@@ -804,8 +825,16 @@ read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
}
tmp = fru->access ? rsp->data[0] << 1 : rsp->data[0];
+ if(rsp->data_len < 1
+ || tmp > rsp->data_len - 1
+ || tmp > size_left_in_buffer)
+ {
+ printf(" Not enough buffer size");
+ return -1;
+ }
memcpy((frubuf + off)-offset, rsp->data + 1, tmp);
off += tmp;
+ size_left_in_buffer -= tmp;
/* sometimes the size returned in the Info command
* is too large. return 0 so higher level function
--
2.27.0

View File

@ -0,0 +1,48 @@
From 910e5782b7d9f222d4e34d3505d0d636ff757103 Mon Sep 17 00:00:00 2001
From: Chrostoper Ertl <chertl@microsoft.com>
Date: Thu, 28 Nov 2019 16:44:18 +0000
Subject: [PATCH 07/11] fru: Fix buffer overflow in ipmi_spd_print_fru
Partial fix for CVE-2020-5208, see
https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp
The `ipmi_spd_print_fru` function has a similar issue as the one fixed
by the previous commit in `read_fru_area_section`. An initial request is
made to get the `fru.size`, which is used as the size for the allocation
of `spd_data`. Inside a loop, further requests are performed to get the
copy sizes which are not checked before being used as the size for a
copy into the buffer.
---
lib/dimm_spd.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/dimm_spd.c b/lib/dimm_spd.c
index 41e30dbb4bda..68f3b4fa1eff 100644
--- a/lib/dimm_spd.c
+++ b/lib/dimm_spd.c
@@ -1621,7 +1621,7 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
struct ipmi_rq req;
struct fru_info fru;
uint8_t *spd_data, msg_data[4];
- int len, offset;
+ uint32_t len, offset;
msg_data[0] = id;
@@ -1697,6 +1697,13 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
}
len = rsp->data[0];
+ if(rsp->data_len < 1
+ || len > rsp->data_len - 1
+ || len > fru.size - offset)
+ {
+ printf(" Not enough buffer size");
+ return -1;
+ }
memcpy(&spd_data[offset], rsp->data + 1, len);
offset += len;
} while (offset < fru.size);
--
2.27.0

View File

@ -0,0 +1,48 @@
From 4f7778ed232a92bde388f38917b94f458a82c78e Mon Sep 17 00:00:00 2001
From: Chrostoper Ertl <chertl@microsoft.com>
Date: Thu, 28 Nov 2019 16:51:49 +0000
Subject: [PATCH 08/11] session: Fix buffer overflow in ipmi_get_session_info
Partial fix for CVE-2020-5208, see
https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp
The `ipmi_get_session_info` function does not properly check the
response `data_len`, which is used as a copy size, allowing stack buffer
overflow.
---
lib/ipmi_session.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lib/ipmi_session.c b/lib/ipmi_session.c
index 141f0f4ec8dd..b9af1fd75d40 100644
--- a/lib/ipmi_session.c
+++ b/lib/ipmi_session.c
@@ -309,8 +309,10 @@ ipmi_get_session_info(struct ipmi_intf * intf,
}
else
{
- memcpy(&session_info, rsp->data, rsp->data_len);
- print_session_info(&session_info, rsp->data_len);
+ memcpy(&session_info, rsp->data,
+ __min(rsp->data_len, sizeof(session_info)));
+ print_session_info(&session_info,
+ __min(rsp->data_len, sizeof(session_info)));
}
break;
@@ -341,8 +343,10 @@ ipmi_get_session_info(struct ipmi_intf * intf,
break;
}
- memcpy(&session_info, rsp->data, rsp->data_len);
- print_session_info(&session_info, rsp->data_len);
+ memcpy(&session_info, rsp->data,
+ __min(rsp->data_len, sizeof(session_info)));
+ print_session_info(&session_info,
+ __min(rsp->data_len, sizeof(session_info)));
} while (i <= session_info.session_slot_count);
break;
--
2.27.0

View File

@ -0,0 +1,37 @@
From 743dd4faa302f22950e4438cf684e1e398eb47eb Mon Sep 17 00:00:00 2001
From: Chrostoper Ertl <chertl@microsoft.com>
Date: Thu, 28 Nov 2019 16:56:38 +0000
Subject: [PATCH 09/11] channel: Fix buffer overflow
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Partial fix for CVE-2020-5208, see
https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp
The `ipmi_get_channel_cipher_suites` function does not properly check
the final responses `data_len`, which can lead to stack buffer overflow
on the final copy.
---
lib/ipmi_channel.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/ipmi_channel.c b/lib/ipmi_channel.c
index fab2e5483d12..8cd7c59a4273 100644
--- a/lib/ipmi_channel.c
+++ b/lib/ipmi_channel.c
@@ -413,7 +413,10 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf *intf, const char *payload_type,
lprintf(LOG_ERR, "Unable to Get Channel Cipher Suites");
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode
+ || rsp->data_len < 1
+ || rsp->data_len > sizeof(uint8_t) + 0x10)
+ {
lprintf(LOG_ERR, "Get Channel Cipher Suites failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
--
2.27.0

View File

@ -0,0 +1,88 @@
From e048e9c65a52f0879d482531e70735c1d314d43a Mon Sep 17 00:00:00 2001
From: Chrostoper Ertl <chertl@microsoft.com>
Date: Thu, 28 Nov 2019 17:06:39 +0000
Subject: [PATCH 10/11] lanp: Fix buffer overflows in get_lan_param_select
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Partial fix for CVE-2020-5208, see
https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp
The `get_lan_param_select` function is missing a validation check on the
responses `data_len`, which it then returns to caller functions, where
stack buffer overflow can occur.
---
lib/ipmi_lanp.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/ipmi_lanp.c b/lib/ipmi_lanp.c
index 65d881bc5890..022c7f1605ed 100644
--- a/lib/ipmi_lanp.c
+++ b/lib/ipmi_lanp.c
@@ -1809,7 +1809,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (p == NULL) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
/* set new ipaddr */
memcpy(data+3, temp, 4);
printf("Setting LAN Alert %d IP Address to %d.%d.%d.%d\n", alert,
@@ -1824,7 +1824,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (p == NULL) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
/* set new macaddr */
memcpy(data+7, temp, 6);
printf("Setting LAN Alert %d MAC Address to "
@@ -1838,7 +1838,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (p == NULL) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
if (strncasecmp(argv[1], "def", 3) == 0 ||
strncasecmp(argv[1], "default", 7) == 0) {
@@ -1864,7 +1864,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (p == NULL) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
if (strncasecmp(argv[1], "on", 2) == 0 ||
strncasecmp(argv[1], "yes", 3) == 0) {
@@ -1889,7 +1889,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (p == NULL) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
if (strncasecmp(argv[1], "pet", 3) == 0) {
printf("Setting LAN Alert %d destination to PET Trap\n", alert);
@@ -1917,7 +1917,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (p == NULL) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
if (str2uchar(argv[1], &data[2]) != 0) {
lprintf(LOG_ERR, "Invalid time: %s", argv[1]);
@@ -1933,7 +1933,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
if (p == NULL) {
return (-1);
}
- memcpy(data, p->data, p->data_len);
+ memcpy(data, p->data, __min(p->data_len, sizeof(data)));
if (str2uchar(argv[1], &data[3]) != 0) {
lprintf(LOG_ERR, "Invalid retry: %s", argv[1]);
--
2.27.0

View File

@ -0,0 +1,137 @@
From 98b47424cf548f58c4d295fa8235210406ea85ca Mon Sep 17 00:00:00 2001
From: Chrostoper Ertl <chertl@microsoft.com>
Date: Thu, 28 Nov 2019 17:13:45 +0000
Subject: [PATCH 11/11] fru, sdr: Fix id_string buffer overflows
Final part of the fixes for CVE-2020-5208, see
https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp
9 variants of stack buffer overflow when parsing `id_string` field of
SDR records returned from `CMD_GET_SDR` command.
SDR record structs have an `id_code` field, and an `id_string` `char`
array.
The length of `id_string` is calculated as `(id_code & 0x1f) + 1`,
which can be larger than expected 16 characters (if `id_code = 0xff`,
then length will be `(0xff & 0x1f) + 1 = 32`).
In numerous places, this can cause stack buffer overflow when copying
into fixed buffer of size `17` bytes from this calculated length.
---
lib/ipmi_fru.c | 2 +-
lib/ipmi_sdr.c | 40 ++++++++++++++++++++++++----------------
2 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
index af99aa99444c..98bc9840955a 100644
--- a/lib/ipmi_fru.c
+++ b/lib/ipmi_fru.c
@@ -3062,7 +3062,7 @@ ipmi_fru_print(struct ipmi_intf * intf, struct sdr_record_fru_locator * fru)
return 0;
memset(desc, 0, sizeof(desc));
- memcpy(desc, fru->id_string, fru->id_code & 0x01f);
+ memcpy(desc, fru->id_string, __min(fru->id_code & 0x01f, sizeof(desc)));
desc[fru->id_code & 0x01f] = 0;
printf("FRU Device Description : %s (ID %d)\n", desc, fru->device_id);
diff --git a/lib/ipmi_sdr.c b/lib/ipmi_sdr.c
index 2a9cbe3087af..62aac08a9002 100644
--- a/lib/ipmi_sdr.c
+++ b/lib/ipmi_sdr.c
@@ -2084,7 +2084,7 @@ ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
return -1;
memset(desc, 0, sizeof (desc));
- snprintf(desc, (sensor->id_code & 0x1f) + 1, "%s", sensor->id_string);
+ snprintf(desc, sizeof(desc), "%.*s", (sensor->id_code & 0x1f) + 1, sensor->id_string);
if (verbose) {
printf("Sensor ID : %s (0x%x)\n",
@@ -2135,7 +2135,7 @@ ipmi_sdr_print_sensor_mc_locator(struct ipmi_intf *intf,
return -1;
memset(desc, 0, sizeof (desc));
- snprintf(desc, (mc->id_code & 0x1f) + 1, "%s", mc->id_string);
+ snprintf(desc, sizeof(desc), "%.*s", (mc->id_code & 0x1f) + 1, mc->id_string);
if (verbose == 0) {
if (csv_output)
@@ -2228,7 +2228,7 @@ ipmi_sdr_print_sensor_generic_locator(struct ipmi_intf *intf,
char desc[17];
memset(desc, 0, sizeof (desc));
- snprintf(desc, (dev->id_code & 0x1f) + 1, "%s", dev->id_string);
+ snprintf(desc, sizeof(desc), "%.*s", (dev->id_code & 0x1f) + 1, dev->id_string);
if (!verbose) {
if (csv_output)
@@ -2285,7 +2285,7 @@ ipmi_sdr_print_sensor_fru_locator(struct ipmi_intf *intf,
char desc[17];
memset(desc, 0, sizeof (desc));
- snprintf(desc, (fru->id_code & 0x1f) + 1, "%s", fru->id_string);
+ snprintf(desc, sizeof(desc), "%.*s", (fru->id_code & 0x1f) + 1, fru->id_string);
if (!verbose) {
if (csv_output)
@@ -2489,35 +2489,43 @@ ipmi_sdr_print_name_from_rawentry(struct ipmi_intf *intf, uint16_t id,
int rc =0;
char desc[17];
+ const char *id_string;
+ uint8_t id_code;
memset(desc, ' ', sizeof (desc));
switch ( type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
record.full = (struct sdr_record_full_sensor *) raw;
- snprintf(desc, (record.full->id_code & 0x1f) +1, "%s",
- (const char *)record.full->id_string);
+ id_code = record.full->id_code;
+ id_string = record.full->id_string;
break;
+
case SDR_RECORD_TYPE_COMPACT_SENSOR:
record.compact = (struct sdr_record_compact_sensor *) raw ;
- snprintf(desc, (record.compact->id_code & 0x1f) +1, "%s",
- (const char *)record.compact->id_string);
+ id_code = record.compact->id_code;
+ id_string = record.compact->id_string;
break;
+
case SDR_RECORD_TYPE_EVENTONLY_SENSOR:
record.eventonly = (struct sdr_record_eventonly_sensor *) raw ;
- snprintf(desc, (record.eventonly->id_code & 0x1f) +1, "%s",
- (const char *)record.eventonly->id_string);
- break;
+ id_code = record.eventonly->id_code;
+ id_string = record.eventonly->id_string;
+ break;
+
case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR:
record.mcloc = (struct sdr_record_mc_locator *) raw ;
- snprintf(desc, (record.mcloc->id_code & 0x1f) +1, "%s",
- (const char *)record.mcloc->id_string);
+ id_code = record.mcloc->id_code;
+ id_string = record.mcloc->id_string;
break;
+
default:
rc = -1;
- break;
- }
+ }
+ if (!rc) {
+ snprintf(desc, sizeof(desc), "%.*s", (id_code & 0x1f) + 1, id_string);
+ }
- lprintf(LOG_INFO, "ID: 0x%04x , NAME: %-16s", id, desc);
+ lprintf(LOG_INFO, "ID: 0x%04x , NAME: %-16s", id, desc);
return rc;
}
--
2.27.0

View File

@ -8,17 +8,18 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=monit
PKG_VERSION:=5.24.0
PKG_VERSION:=5.26.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_HASH:=754d1f0e165e5a26d4639a6a83f44ccf839e381f2622e0946d5302fa1f2d2414
PKG_SOURCE_URL:=https://mmonit.com/monit/dist
PKG_HASH:=87fc4568a3af9a2be89040efb169e3a2e47b262f99e78d5ddde99dd89f02f3c2
PKG_LICENSE:=AGPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:tildeslash:monit
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
@ -61,6 +62,7 @@ endef
CONFIGURE_ARGS += \
--without-pam \
ac_cv_ipv6=$(if $(CONFIG_IPV6),yes,no) \
libmonit_cv_setjmp_available=yes \
libmonit_cv_vsnprintf_c99_conformant=yes

View File

@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -13852,14 +13852,7 @@ fi
@@ -14436,14 +14436,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; }
@ -16,3 +16,21 @@
cat >>confdefs.h <<_ACEOF
--- a/configure.ac
+++ b/configure.ac
@@ -501,14 +501,7 @@ fi
# Find the right directory to put the root-mode PID file in
AC_MSG_CHECKING([pid file location])
-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"
AC_DEFINE_UNQUOTED([PIDDIR], "$piddir",
[Define to the pid storage directory.])

View File

@ -8,13 +8,15 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=muninlite
PKG_VERSION:=1.0.4
PKG_RELEASE:=8
PKG_VERSION:=2.0.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
PKG_HASH:=736482dd6d6849d014d975b1f5794f20dda6e123dbba2d8c2f169c8e787e6f7e
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_URL:=https://github.com/munin-monitoring/$(PKG_NAME)/releases/download/$(PKG_VERSION)/
PKG_HASH:=8277ccd146b4fc5b57602dba3f5612c7d6f840b4c3ee2ff3756ff4b3d8527966
PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
@ -24,8 +26,7 @@ define Package/muninlite
CATEGORY:=Administration
DEPENDS:=+xinetd
TITLE:=Munin node implemented in shell
URL:=http://sourceforge.net/projects/muninlite/
PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
URL:=https://github.com/munin-monitoring/muninlite
endef
define Package/muninlite/Default/description
@ -35,20 +36,14 @@ endef
define Package/muninlite/install
$(INSTALL_DIR) $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/munin-node $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/muninlite $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/xinetd.d
$(INSTALL_DATA) ./files/etc/xinetd.d/munin $(1)/etc/xinetd.d/
$(INSTALL_DATA) ./files/etc/xinetd.d/muninlite $(1)/etc/xinetd.d/
$(INSTALL_DIR) $(1)/etc/munin/plugins
endef
define Package/muninlite/conffiles
/etc/xinetd.d/munin
endef
define Build/Configure
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)
/etc/xinetd.d/muninlite
endef
$(eval $(call BuildPackage,muninlite))

View File

@ -1,10 +0,0 @@
service munin
{
socket_type = stream
protocol = tcp
wait = no
user = root
group = root
server = /usr/sbin/munin-node
disable = no
}

View File

@ -0,0 +1,10 @@
service muninlite
{
socket_type = stream
protocol = tcp
wait = no
user = root
group = root
server = /usr/sbin/muninlite
disable = no
}

View File

@ -1,10 +0,0 @@
--- 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
}

View File

@ -1,11 +0,0 @@
--- 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

View File

@ -1,21 +0,0 @@
--- 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() {

View File

@ -1,12 +0,0 @@
--- 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
}

View File

@ -1,20 +0,0 @@
--- 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"

View File

@ -1,24 +0,0 @@
--- 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 $@; };"

View File

@ -1,22 +0,0 @@
--- 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)
}

View File

@ -1,20 +0,0 @@
--- 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"

86
admin/netatop/Makefile Normal file
View File

@ -0,0 +1,86 @@
#
# This is free software, licensed under the GNU General Public License v2.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=netatop
PKG_RELEASE:=1
PKG_VERSION:=3.1
PKG_LICENSE:=GPL-2.0
PKG_SOURCE_URL:=https://www.atoptool.nl/download/
PKG_HASH:=736f43572c31a90748f023f0a5a814bff58d44c0c3f060d776cfd6e6e8435c62
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Toni Uhlig <matzeton@googlemail.com>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
define KernelPackage/netatop
URL:=https://www.atoptool.nl/
CATEGORY:=Kernel modules
SUBMENU:=Netfilter Extensions
TITLE:=netatop netfilter module
FILES:= \
$(PKG_BUILD_DIR)/module/netatop.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoProbe,netatop)
endef
define KernelPackage/netatop/description
The optional kernel module netatop can be loaded to gather statistics about
the TCP and UDP packets that have been transmitted/received per process and
per thread. As soon as atop discovers that this module is active, it shows
the columns SNET and RNET in the generic screen for the number of transmitted
and received packets per process. When the 'n' key is pressed, it shows
detailed counters about the number packets transmitted/received via TCP and
UDP, the average sizes of these packets, and the total bandwidth consumed
for input and output per process/thread.
endef
define Package/netatop
SECTION:=admin
CATEGORY:=Administration
TITLE:=network counter for atop
DEPENDS:=+zlib +kmod-netatop
URL:=https://www.atoptool.nl/
endef
define Package/netatop/description
The daemon netatopd is packaged with the netatop kernel module. This
daemon takes care that information is gathered about processes that are
finished. For every finished process that has transferred network packets,
a binary record is written to a dedicated logfile. The added records in the
logfile are read by atop with every sample to show information about the
network activity of finished processes as well.
endef
NETATOP_KMOD_MAKEOPTS= \
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
KERNDIR="$(LINUX_DIR)"
NETATOP_DAEMON_MAKEOPTS= \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
define Build/Compile/netatop
$(MAKE) -C $(PKG_BUILD_DIR)/module \
$(NETATOP_KMOD_MAKEOPTS) \
netatop.$(LINUX_KMOD_SUFFIX)
$(MAKE) -C $(PKG_BUILD_DIR)/daemon \
$(NETATOP_DAEMON_MAKEOPTS) \
all
endef
define Build/Compile
$(call Build/Compile/netatop)
endef
define Package/netatop/install
$(INSTALL_DIR) $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/daemon/netatopd $(1)/usr/sbin/
endef
$(eval $(call KernelPackage,netatop))
$(eval $(call BuildPackage,netatop))

View File

@ -0,0 +1,13 @@
diff --git a/daemon/Makefile b/daemon/Makefile
index e028e95..1233855 100644
--- a/daemon/Makefile
+++ b/daemon/Makefile
@@ -6,7 +6,7 @@ THISDIR = $(shell pwd)
all: netatopd
netatopd: netatopd.o Makefile
- $(CC) netatopd.o -o netatopd -lz
+ $(CC) $(LDFLAGS) netatopd.o -o netatopd -lz
clean:
rm -f *.o netatopd

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netdata
PKG_VERSION:=1.22.0
PKG_VERSION:=1.20.0
PKG_RELEASE:=1
PKG_MAINTAINER:=Josef Schlehofer <pepe.schlehofer@gmail.com>, Daniel Engberg <daniel.engberg.lists@pyret.net>
@ -18,7 +18,7 @@ PKG_CPE_ID:=cpe:/a:my-netdata:netdata
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/netdata/netdata/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=skip
PKG_HASH:=c739e0fa8d6d7f433c0c7c8016b763e8f70519d67f0b5e7eca9ee5318f210d90
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
@ -30,7 +30,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/netdata
SECTION:=admin
CATEGORY:=Administration
DEPENDS:=+zlib +libuuid +libmnl +libjson-c +libuv
DEPENDS:=+zlib +libuuid +libuv +libmnl +libjson-c
TITLE:=Real-time performance monitoring tool
URL:=https://www.netdata.cloud/
endef
@ -50,6 +50,7 @@ TARGET_LDFLAGS += -Wl,--gc-sections
CONFIGURE_ARGS += \
--with-zlib \
--with-math \
--disable-x86-sse \
--enable-lto \
--without-libcap \
--disable-https \
@ -61,19 +62,10 @@ CONFIGURE_ARGS += \
--disable-backend-prometheus-remote-write \
--enable-jsonc
ifneq ($(ARCH),x86_64)
CONFIGURE_ARGS += --disable-x86-sse
endif
define Package/netdata/conffiles
/etc/netdata/
endef
define Package/netdata/extra_provides
echo 'libcrypto.so.1.1';\
echo 'libssl.so.1.1';
endef
define Package/netdata/install
$(INSTALL_DIR) $(1)/etc/netdata/custom-plugins.d
$(CP) $(PKG_INSTALL_DIR)/etc/netdata $(1)/etc

View File

@ -25,8 +25,5 @@
node.d = no
python.d = no
[plugin:proc:ipc]
semaphore totals = no
[health]
enabled = no

34
admin/nyx/Makefile Normal file
View File

@ -0,0 +1,34 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=nyx
PKG_VERSION:=2.1.0
PKG_RELEASE:=2
PYPI_NAME:=nyx
PKG_HASH:=88521488d1c9052e457b9e66498a4acfaaa3adf3adc5a199892632f129a5390b
PKG_MAINTAINER:=Javier Marcet <javier@marcet.info>
PKG_LICENSE:=GPL-3.0-only
PKG_LICENSE_FILES:=LICENSE
include ../../lang/python/pypi.mk
include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python3-package.mk
define Package/nyx
SECTION:=admin
CATEGORY:=Administration
URL:=https://nyx.torproject.org/
TITLE:=Terminal status monitor for Tor
DEPENDS:=+python3 +python3-stem
endef
define Package/nyx/description
Nyx is a command-line monitor for Tor. With this you can get detailed real-time
information about your relay such as bandwidth usage, connections, logs, and
much more.
endef
$(eval $(call Py3Package,nyx))
$(eval $(call BuildPackage,nyx))
$(eval $(call BuildPackage,nyx-src))

View File

@ -8,7 +8,6 @@ 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
@ -24,7 +23,7 @@ define Package/openwisp-config/default
TITLE:=Remote configuration management agent ($(2) variant)
CATEGORY:=Administration
SECTION:=admin
SUBMENU:=openwisp
SUBMENU:=OpenWISP
DEPENDS:=+curl +lua +libuci-lua +luafilesystem $(3)
VARIANT:=$(1)
MAINTAINER:=Federico Capoano <f.capoano@cineca.it>

23
admin/schroot/Config.in Normal file
View File

@ -0,0 +1,23 @@
menu "Configuration"
config SCHROOT_BTRFS
bool "Enable support for btrfs snapshots"
select PACKAGE_btrfs-progs
default n
config SCHROOT_LOOPBACK
bool "Enable support for loopback mounts"
select PACKAGE_losetup
default n
config SCHROOT_LVM
bool "Enable support for LVM snapshots"
select PACKAGE_lvm2
default n
config SCHROOT_UUID
bool "Enable support for UUIDs"
select PACKAGE_libuuid
default n
endmenu

82
admin/schroot/Makefile Normal file
View File

@ -0,0 +1,82 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=schroot
PKG_VERSION:=1.6.10
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.xz
PKG_SOURCE_URL:=http://deb.debian.org/debian/pool/main/s/schroot
PKG_HASH:=3ce8dfd9cb97b099e4b6d4ccec421d6cc8c9ef84574681e928a12badb5643d0b
PKG_MAINTAINER:=Javier Marcet <javier@marcet.info>
PKG_LICENSE:=GPL-3.0-only
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/nls.mk
include $(INCLUDE_DIR)/package.mk
define Package/schroot
SECTION:=admin
CATEGORY:=Administration
TITLE:=Securely enter a chroot and run a command or login shell.
DEPENDS:=$(ICONV_DEPENDS) \
+boost +boost-filesystem +boost-iostreams +boost-program_options +boost-regex \
+SCHROOT_BTRFS:btrfs-progs \
+SCHROOT_LOOPBACK:losetup \
+SCHROOT_LVM:lvm2 \
+SCHROOT_UUID:libuuid
URL:=https://salsa.debian.org/debian/schroot
endef
define Package/schroot/description
Securely enter a chroot and run a command or login shell.
endef
define Package/sudo/conffiles
/etc/schroot/
endef
define Package/schroot/config
source "$(SOURCE)/Config.in"
endef
PKG_CONFIG_DEPENDS := \
CONFIG_SCHROOT_BTRFS \
CONFIG_SCHROOT_LOOPBACK \
CONFIG_SCHROOT_LVM \
CONFIG_SCHROOT_UUID
CONFIGURE_ARGS += \
$(if $(CONFIG_SCHROOT_BTRFS),--enable,--disable)-btrfs-snapshot \
$(if $(CONFIG_SCHROOT_LOOPBACK),--enable,--disable)-loopback \
$(if $(CONFIG_SCHROOT_LVM),--enable,--disable)-lvm-snapshot \
$(if $(CONFIG_SCHROOT_UUID),--enable,--disable)-uuid \
--enable-block-device \
--enable-union \
--disable-dchroot \
--disable-dchroot-dsa \
--disable-csbuild \
--disable-debug \
--disable-pam \
--disable-doxygen \
--disable-rpath
define Package/schroot/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_SUID) $(PKG_INSTALL_DIR)/usr/bin/schroot $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/schroot
$(CP) -R $(PKG_INSTALL_DIR)/etc/schroot/* $(1)/etc/schroot
$(INSTALL_DIR) $(1)/usr/lib/schroot
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libsbuild.* $(1)/usr/lib/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/schroot/* $(1)/usr/lib/schroot/
$(INSTALL_DIR) $(1)/usr/share/schroot
$(CP) -R $(PKG_INSTALL_DIR)/usr/share/schroot/* $(1)/usr/share/schroot/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/schroot.init $(1)/etc/init.d/schroot
endef
$(eval $(call BuildPackage,schroot))

View File

@ -0,0 +1,10 @@
#!/bin/sh /etc/rc.common
START=94
start() {
[ -d /var/lib/schroot ] || {
mkdir -p /var/lib/schroot/mount /var/lib/schroot/session /var/lib/schroot/unpack /var/lib/schroot/union/overlay /var/lib/schroot/union/underlay
chmod 0700 /var/lib/schroot
}
}

View File

@ -0,0 +1,219 @@
--- ./configure.ac-orig 2019-12-09 12:56:45.217308628 +0100
+++ ./configure.ac 2019-12-09 12:57:18.667492923 +0100
@@ -284,22 +284,8 @@ if test -z "$DOXYGEN"; then
HAVE_DOXYGEN="no"
fi
HAVE_LVM="yes"
-AC_PATH_PROG([LVCREATE], [lvcreate], [], [$PATH:/sbin:/usr/sbin])
-AC_PATH_PROG([LVREMOVE], [lvremove], [], [$PATH:/sbin:/usr/sbin])
-if test -z "$LVCREATE" || test -z "$LVREMOVE"; then
- HAVE_LVM="no"
-fi
HAVE_BTRFS="yes"
-AC_PATH_PROG([BTRFS], [btrfs], [], [$PATH:/sbin:/usr/sbin])
-AC_PATH_PROG([BTRFSCTL], [btrfsctl], [], [$PATH:/sbin:/usr/sbin])
-if test -z "$BTRFS" || test -z "$BTRFSCTL"; then
- HAVE_BTRFS="no"
-fi
HAVE_LOOPBACK="yes"
-AC_PATH_PROG([LOSETUP], [losetup], [], [$PATH:/sbin:/usr/sbin])
-if test -z "$LOSETUP"; then
- HAVE_LOOPBACK="no"
-fi
# Check for host platform
@@ -336,7 +322,6 @@ PKG_CHECK_MODULES([UUID], [uuid],
[HAVE_UUID=yes],
[HAVE_UUID=no])
-AM_PATH_CPPUNIT([1.10.0], [HAVE_CPPUNIT=yes])
AM_CONDITIONAL([USE_UNIT_TESTS], [test -n "$HAVE_CPPUNIT"])
SCHROOT_CFLAGS="$UUID_CFLAGS"
@@ -688,42 +673,25 @@ if test "$BOOST_PROGRAM_OPTIONS_VALIDATI
fi
dnl Note the use of quadrigraphs to quote [ and ] in regexes.
-AH_TEMPLATE(HAVE_REGEX_REGEX, [Set if the <regex> header file includes std::regex])
AH_TEMPLATE(HAVE_BOOST_REGEX, [Set if the <boost/regex.hpp> header file includes boost::regex])
-AC_MSG_CHECKING([for std::regex])
-define([testprog], [AC_LANG_PROGRAM([#include <regex>],
- [std::regex foo("^foo@<:@bar@:>@$");
- std::regex bar("^foo@<:@bar@:>@$", std::regex::extended);
- std::regex check("^@<:@^:/,.@:>@@<:@^:/,@:>@*$", std::regex::extended);])])
-AC_RUN_IFELSE(testprog,
- [AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_REGEX_REGEX, 1)],
- [dnl Check if std::regex is present but broken.
-define([testprog], [AC_LANG_PROGRAM([#include <regex>],
- [std::regex foo("^foo@<:@bar@:>@$");
- std::regex bar("^foo@<:@bar@:>@$", std::regex::extended);])])
+AC_MSG_CHECKING([for boost::regex in -lboost_regex])
+saved_LIBS="${LIBS}"
+LIBS="${saved_LIBS} -lboost_regex"
+define([testprog], [AC_LANG_PROGRAM([#include <boost/regex.hpp>],
+ [boost::regex("^foo@<:@bar@:>@$");
+ boost::regex bar("^foo@<:@bar@:>@$", boost::regex::extended);])])
AC_LINK_IFELSE(testprog,
- [AC_MSG_RESULT([broken])],
- [AC_MSG_RESULT([no])])
- AC_MSG_CHECKING([for boost::regex in -lboost_regex])
- saved_LIBS="${LIBS}"
- LIBS="${saved_LIBS} -lboost_regex"
- define([testprog], [AC_LANG_PROGRAM([#include <boost/regex.hpp>],
- [boost::regex("^foo@<:@bar@:>@$");
- boost::regex bar("^foo@<:@bar@:>@$", boost::regex::extended);])])
- AC_LINK_IFELSE(testprog,
- [AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_BOOST_REGEX, 1)
- BOOST_LIBS="${BOOST_LIBS} -lboost_regex"],
- [LIBS="${saved_LIBS} -lboost_regex-mt"
- AC_LINK_IFELSE(testprog,
- [AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_BOOST_REGEX, 1)
- BOOST_LIBS="${BOOST_LIBS} -lboost_regex-mt"],
- [AC_MSG_RESULT([no])
- AC_MSG_FAILURE([libboost_regex (Boost C++ Libraries) is not installed, but is required by schroot])])])
- LIBS="${saved_LIBS}"
-])
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_BOOST_REGEX, 1)
+ BOOST_LIBS="${BOOST_LIBS} -lboost_regex"],
+ [LIBS="${saved_LIBS} -lboost_regex-mt"
+ AC_LINK_IFELSE(testprog,
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_BOOST_REGEX, 1)
+ BOOST_LIBS="${BOOST_LIBS} -lboost_regex-mt"],
+ [AC_MSG_RESULT([no])
+ AC_MSG_FAILURE([libboost_regex (Boost C++ Libraries) is not installed, but is required by schroot])])])
+LIBS="${saved_LIBS}"
AC_MSG_CHECKING([for boost::iostreams in -lboost_iostreams])
saved_LIBS="${LIBS}"
--- ./bin/schroot-base/schroot-base-run.h-orig 2019-12-09 04:23:51.881428446 +0100
+++ ./bin/schroot-base/schroot-base-run.h 2019-12-09 04:24:14.934887089 +0100
@@ -61,8 +61,8 @@ namespace schroot_base
std::cout.imbue(std::locale());
std::cerr.imbue(std::locale());
- bindtextdomain (SBUILD_MESSAGE_CATALOGUE, SCHROOT_LOCALE_DIR);
- textdomain (SBUILD_MESSAGE_CATALOGUE);
+ //bindtextdomain (SBUILD_MESSAGE_CATALOGUE, SCHROOT_LOCALE_DIR);
+ //textdomain (SBUILD_MESSAGE_CATALOGUE);
typename options_type::ptr opts(new options_type);
main_type kit(opts);
--- ./sbuild/sbuild-feature.h-orig 2019-12-09 04:23:51.881428446 +0100
+++ ./sbuild/sbuild-feature.h 2019-12-09 04:24:14.934887089 +0100
@@ -24,6 +24,7 @@
#include <string>
#include <boost/format.hpp>
+#include <libintl.h>
namespace sbuild
{
--- ./etc/setup.d/20copyfiles-orig 2018-11-03 14:26:12.000000000 +0100
+++ ./etc/setup.d/20copyfiles 2019-12-09 13:56:45.277145648 +0100
@@ -39,9 +39,9 @@ copy_file()
if [ -e "$2" ]; then
# Device and inode
- da=$(/usr/bin/stat --format="%d %i" "$1")
+ da=$(/bin/stat --format="%d %i" "$1")
# This one can fail since it might not exist yet
- db=$(/usr/bin/stat --format="%d %i" "$2" 2>/dev/null || :)
+ db=$(/bin/stat --format="%d %i" "$2" 2>/dev/null || :)
if [ "$da" = "$db" ]; then
COPY="false"
--- ./etc/setup.d/20nssdatabases-orig 2018-11-03 14:26:12.000000000 +0100
+++ ./etc/setup.d/20nssdatabases 2019-12-09 13:57:34.397419039 +0100
@@ -29,7 +29,7 @@ set -e
dup_nss()
{
info "Copying $1 database to $2"
- getent "$1" > "$2"
+ cat "/etc/$1" > "$2"
}
if [ $STAGE = "setup-start" ] || [ $STAGE = "setup-recover" ]; then
@@ -42,9 +42,9 @@ if [ $STAGE = "setup-start" ] || [ $STAG
fi
# Device and inode
- dr=$(/usr/bin/stat --format="%d %i" "/etc/$db")
+ dr=$(/bin/stat --format="%d %i" "/etc/$db")
# This one can fail since it might not exist yet
- dc=$(/usr/bin/stat --format="%d %i" "${CHROOT_PATH}/etc/$db" 2>/dev/null || :)
+ dc=$(/bin/stat --format="%d %i" "${CHROOT_PATH}/etc/$db" 2>/dev/null || :)
# If the database inside and outside the chroot is the
# same, it's very likely that dup_nss would blank the
diff -X /home/jmarcet/.rsync-filter -pru ./etc/profile-templates/all/all/nssdatabases ./etc/profile-templates/all/all/nssdatabases
--- ./etc/profile-templates/all/all/nssdatabases 2018-11-03 14:26:12.000000000 +0100
+++ ./etc/profile-templates/all/all/nssdatabases 2019-12-09 14:03:12.799297723 +0100
@@ -4,4 +4,4 @@
passwd
shadow
-group
-gshadow
+#group
+#gshadow
diff -X /home/jmarcet/.rsync-filter -pru ./etc/profile-templates/buildd/all/nssdatabases ./etc/profile-templates/buildd/all/nssdatabases
--- ./etc/profile-templates/buildd/all/nssdatabases 2018-11-03 14:26:12.000000000 +0100
+++ ./etc/profile-templates/buildd/all/nssdatabases 2019-12-09 14:03:12.802631074 +0100
@@ -4,4 +4,4 @@
passwd
shadow
-group
-gshadow
+#group
+#gshadow
diff -X /home/jmarcet/.rsync-filter -pru ./etc/profile-templates/default/all/nssdatabases ./etc/profile-templates/default/all/nssdatabases
--- ./etc/profile-templates/default/all/nssdatabases 2018-11-03 14:26:12.000000000 +0100
+++ ./etc/profile-templates/default/all/nssdatabases 2019-12-09 14:03:12.809297778 +0100
@@ -1,4 +1,4 @@
services
protocols
-networks
+#networks
hosts
diff -X /home/jmarcet/.rsync-filter -pru ./etc/profile-templates/desktop/all/nssdatabases ./etc/profile-templates/desktop/all/nssdatabases
--- ./etc/profile-templates/desktop/all/nssdatabases 2018-11-03 14:26:12.000000000 +0100
+++ ./etc/profile-templates/desktop/all/nssdatabases 2019-12-09 14:03:12.812631129 +0100
@@ -1,4 +1,4 @@
services
protocols
-networks
+#networks
hosts
diff -X /home/jmarcet/.rsync-filter -pru ./etc/profile-templates/default/linux/fstab ./etc/profile-templates/default/linux/fstab
--- ./etc/profile-templates/default/linux/fstab 2018-11-03 14:26:12.000000000 +0100
+++ ./etc/profile-templates/default/linux/fstab 2019-12-09 14:18:46.970887080 +0100
@@ -7,7 +7,7 @@
# to run additional services in the chroot. However, note that this
# may potentially cause undesirable behaviour on upgrades, such as
# killing services on the host.
-#/run /run none rw,bind 0 0
+/run /run none rw,bind 0 0
#/run/lock /run/lock none rw,bind 0 0
-#/dev/shm /dev/shm none rw,bind 0 0
-#/run/shm /run/shm none rw,bind 0 0
+/tmp/shm /dev/shm none rw,bind 0 0
+/tmp/shm /run/shm none rw,bind 0 0
diff -X /home/jmarcet/.rsync-filter -pru ./etc/profile-templates/desktop/linux/fstab ./etc/profile-templates/desktop/linux/fstab
--- ./etc/profile-templates/desktop/linux/fstab 2018-11-03 14:26:12.000000000 +0100
+++ ./etc/profile-templates/desktop/linux/fstab 2019-12-09 14:22:14.148555674 +0100
@@ -12,7 +12,7 @@
# to run additional services in the chroot. However, note that this
# may potentially cause undesirable behaviour on upgrades, such as
# killing services on the host.
-#/run /run none rw,bind 0 0
+/run /run none rw,bind 0 0
#/run/lock /run/lock none rw,bind 0 0
-#/dev/shm /dev/shm none rw,bind 0 0
-#/run/shm /run/shm none rw,bind 0 0
+/tmp/shm /dev/shm none rw,bind 0 0
+/tmp/shm /run/shm none rw,bind 0 0

View File

@ -8,15 +8,19 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sudo
PKG_VERSION:=1.8.21p2
PKG_VERSION:=1.8.31
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_SOURCE_URL:=https://www.sudo.ws/dist
PKG_HASH:=7ea8d97a3cee4c844e0887ea7a1bd80eb54cc98fd77966776cb1a80653ad454f
PKG_MAINTAINER:=
PKG_LICENSE:=ISC
PKG_LICENSE_FILES:=doc/LICENSE
PKG_CPE_ID:=cpe:/a:todd_miller:sudo
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=sudo/host
@ -27,8 +31,7 @@ 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>
URL:=https://www.sudo.ws/
endef
define Package/sudo/description

View File

@ -1,7 +1,6 @@
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@
--- a/lib/util/Makefile.in
+++ b/lib/util/Makefile.in
@@ -200,10 +200,10 @@ libsudo_util.la: $(LTOBJS) @LT_LDDEP@
esac
siglist.c: mksiglist
@ -13,4 +12,4 @@ diff -rupN sudo-1.8.11p2.orig/lib/util/Makefile.in sudo-1.8.11p2/lib/util/Makefi
+ mksigname > $@
mksiglist: $(srcdir)/mksiglist.c $(srcdir)/mksiglist.h $(incdir)/sudo_compat.h $(top_builddir)/config.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mksiglist.c -o $@
$(CC) $(CPPFLAGS) $(CFLAGS) $(srcdir)/mksiglist.c -o $@

View File

@ -1,7 +1,6 @@
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@
--- a/Makefile.in
+++ b/Makefile.in
@@ -64,7 +64,7 @@ SHELL = @SHELL@
SED = @SED@
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c

View File

@ -1,12 +0,0 @@
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.
*/

View File

@ -1,26 +1,33 @@
include $(TOPDIR)/rules.mk
include $(TOPDIR)/rules.mk
PKG_NAME:=syslog-ng
PKG_VERSION:=3.9.1
PKG_RELEASE:=3
PKG_VERSION:=3.27.1
PKG_RELEASE:=2
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>
PKG_LICENSE:=LGPL-2.1-or-later GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING LGPL.txt GPL.txt
PKG_CPE_ID:=cpe:/a:balabit:syslog-ng
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_SOURCE_URL:=https://github.com/syslog-ng/syslog-ng/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
PKG_HASH:=c54c633c97f7fd8dd68261cfd784a76211e6e52965178e3aa4d0e32b899d61b3
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_CONFIG_DEPENDS:= \
CONFIG_IPV6 \
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/
URL:=https://www.syslog-ng.com/products/open-source-log-management/
DEPENDS:=+libpcre +glib2 +libopenssl +libpthread +librt +zlib +libdbi +libjson-c +libcurl +libuuid
endef
define Package/syslog-ng/description
@ -32,6 +39,7 @@ endef
define Package/syslog-ng/conffiles
/etc/syslog-ng.conf
/etc/syslog-ng.d/
/etc/scl.conf
endef
define Build/Configure
@ -39,39 +47,67 @@ define Build/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_ARGS += \
--disable-afsnmp \
$(call autoconf_bool,CONFIG_IPV6,ipv6) \
--disable-tcp-wrapper \
--disable-spoof-source \
--disable-sql \
--disable-linux-caps \
--with-jsonc=system \
--enable-json=yes \
--enable-http=yes \
--disable-smtp \
--disable-redis \
--disable-dependency-tracking \
--disable-python \
--disable-geoip2 \
--disable-java \
--disable-java-modules \
--with-librabbitmq-client=no \
--with-mongoc=no
CONFIGURE_VARS += \
LIBDBI_CFLAGS="-I$(STAGING_DIR)/usr/include"
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)"
cd $(PKG_BUILD_DIR); make DESTDIR=$(1) install
$(call libtool_remove_files,$(1)) # This removes .la files in folder (including subfolders) /usr/lib
rm -rf $(1)/usr/lib/pkgconfig \
$(1)/usr/lib/*.a \
$(1)/usr/include \
$(1)/var
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/syslog-ng.init $(1)/etc/init.d/syslog-ng
$(INSTALL_DIR) $(1)/etc/syslog-ng.d
$(INSTALL_DATA) ./files/syslog-ng.conf $(1)/etc
$(INSTALL_DIR) $(1)/etc/syslog-ng.d/
$(call libtool_remove_files,$(1))
touch $(1)/etc/syslog-ng.d/.keep
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) ./files/logread $(1)/sbin
$(INSTALL_DIR) $(1)/usr/share/syslog-ng/include/
$(CP) -r ./files/scl $(1)/usr/share/syslog-ng/include/
endef
define Package/syslog-ng/postinst
#!/bin/sh
[ -n "$$IPKG_INSTROOT" ] || {
/etc/init.d/syslog-ng enable
/etc/init.d/syslog-ng restart
}
endef
define Package/syslog-ng/prerm
#!/bin/sh
[ -n "$$IPKG_INSTROOT" ] || {
/etc/init.d/syslog-ng disable
/etc/init.d/syslog-ng stop
}
endef
$(eval $(call BuildPackage,syslog-ng))

View File

@ -0,0 +1,76 @@
#!/bin/sh
# Shell script compatibility wrapper for /sbin/logread
#
# Copyright (C) 2019 Dirk Brenken <dev@brenken.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
logfile="/var/log/messages"
if [ ! -f "${logfile}" ]
then
printf "%s\n" "Error: logfile not found!"
exit 2
fi
usage()
{
printf "%s\n" "Usage: logread [options]"
printf "%s\n" "Options:"
printf "%5s %-10s%s\n" "-l" "<count>" "Got only the last 'count' messages"
printf "%5s %-10s%s\n" "-e" "<pattern>" "Filter messages with a regexp"
printf "%5s %-10s%s\n" "-f" "" "Follow log messages"
printf "%5s %-10s%s\n" "-h" "" "Print this help message"
}
if [ -z "${1}" ]
then
cat "${logfile}"
exit 0
else
while [ "${1}" ]
do
case "${1}" in
-l)
shift
count="${1//[^0-9]/}"
tail -n "${count:-50}" "${logfile}"
exit 0
;;
-e)
shift
pattern="${1}"
grep -E "${pattern}" "${logfile}"
exit 0
;;
-f)
tail -f "${logfile}"
exit 0
;;
-fe)
shift
pattern="${1}"
tail -f "${logfile}" | grep -E "${pattern}"
exit 0
;;
-h|*)
usage
exit 1
;;
esac
shift
done
fi

View File

@ -0,0 +1,6 @@
#!/bin/sh
if [ "$(sysctl net.ipv6.conf.lo.disable_ipv6 | cut -d' ' -f 3)" = "0" ]; then
echo 'network(ip("::1") port(514) transport(udp) ip-protocol(6) )'
else
echo 'network(ip("127.0.0.1") port(514) transport(udp) ip-protocol(4) )'
fi

View File

@ -0,0 +1 @@
@module confgen context(source) name(network_localhost) exec("`scl-root`/network_localhost/detect.sh")

View File

@ -1,24 +1,45 @@
@version:3.9
#############################################################################
# OpenWrt syslog-ng.conf specific file
# which collects all local logs into a single file called /var/log/messages.
# More details about these settings can be found here:
# https://www.syslog-ng.com/technical-documents/list/syslog-ng-open-source-edition
@version: 3.26
@include "scl.conf"
options {
chain_hostnames(no);
chain_hostnames(no); # Enable or disable the chained hostname format.
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);
keep_hostname(yes); # Enable or disable hostname rewriting.
log_fifo_size(256); # The number of messages that the output queue can store.
log_msg_size(1024); # Maximum length of a message in bytes.
stats_freq(0); # The period between two STATS messages (sent by syslog-ng, containing statistics about dropped logs) in seconds.
flush_lines(0); # How many lines are flushed to a destination at a time.
use_fqdn(no); # Add Fully Qualified Domain Name instead of short hostname.
};
# syslog-ng gets messages from syslog-ng (internal) and from /dev/log
source src {
internal();
unix-dgram("/dev/log");
};
source net {
udp(ip(0.0.0.0) port(514));
network_localhost();
};
source s_network {
default-network-drivers(
# NOTE: TLS support
#
# the default-network-drivers() source driver opens the TLS
# enabled ports as well, however without an actual key/cert
# pair they will not operate and syslog-ng would display a
# warning at startup.
#
#tls(key-file("/path/to/ssl-private-key") cert-file("/path/to/ssl-cert"))
);
};
source kernel {
@ -34,8 +55,13 @@ log {
source(net);
source(kernel);
destination(messages);
# uncomment this line to open port 514 to receive messages
#source(s_network);
};
# put any customization files in this directory
@include "/etc/syslog-ng.d/"
#
# Finally, include any user settings last so that s/he can override or
# supplement all "canned" settings inherited from the distribution.
#
@include "/etc/syslog-ng.d/" # Put any customization files in this directory

View File

@ -1,31 +1,17 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2016 OpenWrt.org
# Copyright (C) 2006-2019 OpenWrt.org
START=20
PROG=/usr/sbin/syslog-ng
PROG2=/usr/sbin/syslog-ng-ctl
START=50
SERVICE_USE_PID=1
SERVICE_PID_FILE=/var/run/syslog-ng.pid
USE_PROCD=1
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
start_service() {
[ -f /etc/syslog-ng.conf ] || return 1
procd_open_instance
procd_set_param command /usr/sbin/syslog-ng --foreground
procd_close_instance
}
stop() {
service_stop $PROG
}
reload() {
$PROG2 reload
reload_service() {
/usr/sbin/syslog-ng-ctl reload
}

View File

@ -1,35 +0,0 @@
--- 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);
}

View File

@ -8,32 +8,73 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=zabbix
PKG_VERSION:=3.2.7
PKG_RELEASE:=2
PKG_VERSION:=5.0.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_HASH:=3ea0c299bd69bc728177128740f0476bc1a2c1de438330df5bbd8f5fc6090712
PKG_SOURCE_URL:=@SF/zabbix
PKG_SOURCE_URL:=https://cdn.zabbix.com/zabbix/sources/stable/5.0/
PKG_HASH:=20a19e5cf2354ffcbbe24521b04becfc9875e57289c00da71999de60c4a853b6
PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:zabbix:zabbix
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
PKG_CONFIG_DEPENDS:= \
CONFIG_ZABBIX_GNUTLS \
CONFIG_ZABBIX_OPENSSL \
CONFIG_ZABBIX_MYSQL \
CONFIG_ZABBIX_POSTGRESQL
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/zabbix-agentd/config
comment "SSL support"
choice
prompt "Selected SSL library"
default ZABBIX_NOSSL
config ZABBIX_OPENSSL
bool "OpenSSL"
config ZABBIX_GNUTLS
bool "GnuTLS"
config ZABBIX_NOSSL
bool "No SSL support"
endchoice
endef
define Package/zabbix-server/config
comment "Database Software"
choice
prompt "Selected Database Software"
default ZABBIX_POSTGRESQL
config ZABBIX_MYSQL
bool "MySQL/MariaDB"
config ZABBIX_POSTGRESQL
bool "PostgreSQL"
endchoice
endef
define Package/zabbix/Default
SECTION:=admin
CATEGORY:=Administration
SUBMENU:=Zabbix
TITLE:=Zabbix
URL:=http://www.zabbix.com/
SUBMENU:=zabbix
MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
URL:=https://www.zabbix.com/
USERID:=zabbix=53:zabbix=53
DEPENDS += $(ICONV_DEPENDS)
DEPENDS += $(ICONV_DEPENDS) +libpcre +zlib +ZABBIX_GNUTLS:libgnutls +ZABBIX_OPENSSL:libopenssl
endef
define Package/zabbix-agentd
@ -50,13 +91,13 @@ endef
define Package/zabbix-extra-network
$(call Package/zabbix/Default)
TITLE+= discovery/userparameters for network
DEPENDS = +zabbix-agentd +libuci-lua +lua
DEPENDS = +zabbix-agentd +libubus-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
DEPENDS = +zabbix-agentd +libiwinfo-lua +libubus-lua +lua
endef
define Package/zabbix-sender
@ -72,31 +113,39 @@ endef
define Package/zabbix-server
$(call Package/zabbix/Default)
TITLE+= server
DEPENDS += +libsqlite3
DEPENDS += +ZABBIX_POSTGRESQL:libpq +ZABBIX_MYSQL:libmariadbclient +libevent2
endef
define Package/zabbix-server-frontend
$(call Package/zabbix/Default)
TITLE+= server-frontend
DEPENDS += +php7 +php7-cgi +ZABBIX_POSTGRESQL:php7-mod-pgsql +ZABBIX_MYSQL:php7-mod-mysqli \
+php7-mod-gd +php7-mod-bcmath +php7-mod-ctype +php7-mod-xmlreader +php7-mod-xmlwriter \
+php7-mod-session +php7-mod-sockets +php7-mod-mbstring +php7-mod-gettext
endef
define Package/zabbix-proxy
$(call Package/zabbix/Default)
TITLE+= proxy
DEPENDS += +libsqlite3
DEPENDS += +ZABBIX_POSTGRESQL:libpq +ZABBIX_MYSQL:libmariadbclient +libevent2
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.
See https://openwrt.org/docs/guide-user/services/network_monitoring/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.
See https://openwrt.org/docs/guide-user/services/network_monitoring/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.
See https://openwrt.org/docs/guide-user/services/network_monitoring/zabbix for ready to use zabbix templates.
endef
CONFIGURE_ARGS+= \
@ -105,7 +154,16 @@ CONFIGURE_ARGS+= \
--enable-proxy \
$(call autoconf_bool,CONFIG_IPV6,ipv6) \
--disable-java \
--with-sqlite3="$(STAGING_DIR)/usr"
$(if $(CONFIG_ZABBIX_MYSQL),--with-mysql) \
$(if $(CONFIG_ZABBIX_POSTGRESQL),--with-postgresql) \
--with-libevent=$(STAGING_DIR)/usr/include/libevent \
--with-libpcre=$(STAGING_DIR)/usr/include \
--with-zlib=$(STAGING_DIR)/usr/include \
$(if $(CONFIG_ZABBIX_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr") \
$(if $(CONFIG_ZABBIX_OPENSSL),--with-openssl="$(STAGING_DIR)/usr")
CONFIGURE_VARS += \
ac_cv_header_sys_sysinfo_h=no
MAKE_FLAGS += ARCH="linux"
@ -201,10 +259,28 @@ endef
define Package/zabbix-extra-network/install
$(call Package/zabbix/install/zabbix.conf.d,$(1),network)
$(INSTALL_DIR) $(1)/usr/share/acl.d
$(INSTALL_DATA) ./files/zabbix-network-ubus-acl.json $(1)/usr/share/acl.d/zabbix-network.json
endef
define Package/zabbix-extra-network/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
killall -HUP ubusd
fi
endef
define Package/zabbix-extra-wifi/install
$(call Package/zabbix/install/zabbix.conf.d,$(1),wifi)
$(INSTALL_DIR) $(1)/usr/share/acl.d
$(INSTALL_DATA) ./files/zabbix-wifi-ubus-acl.json $(1)/usr/share/acl.d/zabbix-wifi.json
endef
define Package/zabbix-extra-wifi/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
killall -HUP ubusd
fi
endef
define Package/zabbix-sender/install
@ -220,6 +296,11 @@ define Package/zabbix-server/install
$(call Package/zabbix/install/etc,$(1),server)
endef
define Package/zabbix-server-frontend/install
$(INSTALL_DIR) $(1)/www/zabbix
$(CP) $(PKG_BUILD_DIR)/ui/* $(1)/www/zabbix
endef
define Package/zabbix-proxy/install
$(call Package/zabbix/install/sbin,$(1),proxy)
$(call Package/zabbix/install/etc,$(1),proxy)
@ -231,5 +312,6 @@ $(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-server-frontend))
$(eval $(call BuildPackage,zabbix-proxy))
$(eval $(call BuildPackage,zabbix-get))

View File

@ -1,7 +1,7 @@
#see http://wiki.openwrt.org/doc/howto/zabbix for ready to use templates
#see https://openwrt.org/docs/guide-user/services/network_monitoring/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
# https://standards.ieee.org/getieee802/download/802.11-2012.pdf
# example: for mac80211.ACKFailureCount search for dot11ACKFailureCount (page 2145)
# mac80211 phy discovery (like 'phy0')

View File

@ -1,9 +1,6 @@
#see http://wiki.openwrt.org/doc/howto/zabbix for ready to use templates
#see https://openwrt.org/docs/guide-user/services/network_monitoring/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.."]}")'
UserParameter=netowrt.discovery,lua -l ubus -e 'u=ubus.connect();list="{\"data\":[";dump=u:call("network.interface", "dump", {});for _, intf in ipairs(dump.interface) do list=list.."{\"{#IF}\":\""..intf.device.."\", \"{#NET}\":\""..intf.interface.."\"},";end;list=string.gsub(list,",$","");print(list.."]}")'

View File

@ -1,8 +1,7 @@
#see http://wiki.openwrt.org/doc/howto/zabbix for ready to use templates
#see https://openwrt.org/docs/guide-user/services/network_monitoring/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.."]}")'

View File

@ -0,0 +1,8 @@
{
"user": "zabbix",
"access": {
"network.interface": {
"methods": [ "dump" ]
}
}
}

View File

@ -0,0 +1,8 @@
{
"user": "zabbix",
"access": {
"network.wireless": {
"methods": [ "status" ]
}
}
}

View File

@ -1,35 +0,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;

View File

@ -1,17 +0,0 @@
--- 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";

View File

@ -27,7 +27,7 @@
### Option: LogFileSize
# Maximum size of log file in MB.
# 0 - disable automatic log rotation.
@@ -114,6 +111,7 @@ Server=127.0.0.1
@@ -138,6 +135,7 @@ Server=127.0.0.1
# Range: 0-100
# Default:
# StartAgents=3
@ -35,7 +35,7 @@
##### Active checks related
@@ -129,8 +127,6 @@ Server=127.0.0.1
@@ -153,8 +151,6 @@ Server=127.0.0.1
# Default:
# ServerActive=
@ -44,7 +44,7 @@
### 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
@@ -164,8 +160,6 @@ ServerActive=127.0.0.1
# Default:
# Hostname=
@ -53,7 +53,7 @@
### 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
@@ -305,8 +299,8 @@ Hostname=Zabbix server
# Include=
# Include=/usr/local/etc/zabbix_agentd.userparams.conf

View File

@ -1,23 +0,0 @@
--- 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>

View File

@ -1,13 +1,11 @@
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[]
--- a/src/libs/zbxcommon/str.c
+++ b/src/libs/zbxcommon/str.c
@@ -54,7 +54,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);
}
#if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
printf("\n");

56
devel/asu/Makefile Normal file
View File

@ -0,0 +1,56 @@
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=asu
PKG_VERSION:=0.2.3
PKG_RELEASE:=3
PKG_LICENSE:=GPL-3.0
PYPI_NAME:=$(PKG_NAME)
PKG_HASH:=e60027cd531cc5b9b20d3321acc06fdf0cdd894004919800575b8235343ba8ef
PKG_BUILD_DEPENDS:=python3
include ../../lang/python/pypi.mk
include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python3-package.mk
IMAGEBUILDER_DEPENDS:= \
@x86_64 +bash +bzip2 +coreutils +coreutils-stat +diffutils +file \
+gawk +gcc +getopt +git +git-http +libncurses +make +patch +perl \
+perlbase-attributes +perlbase-findbin +perlbase-getopt \
+perlbase-thread +python3-light +tar +unzip +wget +xz +xzdiff \
+xzgrep +xzless +xz-utils +zlib-dev
define Package/asu
SECTION:=devel
CATEGORY:=Development
TITLE:=attended sysupgrade image server
MAINTAINER:=Paul Spooren <paul@spooren.de>
URL:=http://github.com/aparcar/gsoc17-attended-sysupgrade/
DEPENDS:=$(IMAGEBUILDER_DEPENDS) +pgsql-server +psqlodbcw \
+python3-ctypes +python3-distutils +python3-flask \
+gunicorn3 +python3-openssl +python3-pyodbc +python3-yaml \
+libustream-mbedtls +ca-certificates +gnupg
USERID:=asu:asu
endef
define Package/asu/description
Build server to deliver OpenWrt/LEDE sysupgrade images
endef
define Py3Package/asu/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/asu.defaults $(1)/etc/uci-defaults/99-asu
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/asu.init $(1)/etc/init.d/asu
$(INSTALL_DIR) $(1)/etc/asu
$(INSTALL_CONF) $(PKG_BUILD_DIR)/asu/utils/config.yml.default $(1)/etc/asu/config.yml
endef
$(eval $(call Py3Package,asu))
$(eval $(call BuildPackage,asu))

View File

@ -0,0 +1,22 @@
#!/bin/sh
asu_password=$(dd if=/dev/urandom bs=16 count=1 2>/dev/null | sha256sum | cut -d' ' -f1)
asu_tables="$(ls -1 /usr/lib/python*/site-packages/asu/utils/tables.sql | head -n 1)"
uci -q batch <<EOF
del postgresql.asu
set postgresql.asu=postgres-db
set postgresql.asu.name=asu
set postgresql.asu.user=asu
set postgresql.asu.pass='$asu_password'
set postgresql.asu.script='$asu_tables'
commit postgresql
EOF
sed -i "s/database_user.*/database_user: asu/" /etc/asu/config.yml
sed -i "s/database_pass.*/database_pass: $asu_password/" /etc/asu/config.yml
cp -r /usr/lib/python*/site-packages/asu/utils/distributions /etc/asu/
chown -R root:asu /etc/asu
chmod -R g+rX /etc/asu

40
devel/asu/files/asu.init Normal file
View File

@ -0,0 +1,40 @@
#!/bin/sh /etc/rc.common
START=99
STOP=01
USE_PROCD=1
PROG=/usr/bin/flask
start_service() {
. /lib/functions/postgresql.sh
local pgdata=$(uci get postgresql.config.PGDATA)
local i=0
while ! pg_server_ready "$pgdata"; do
sleep 1
[ $((i++)) -gt 30 ] && return 1
done
i=0
while ! pg_test_db asu asu; do
sleep 1
[ $((i++)) -gt 30 ] && return 1
done
FLASK_APP=asu $PROG loaddb
procd_open_instance asu_main
procd_set_param user asu
procd_set_param group asu
procd_set_param command gunicorn3 asu:app
procd_close_instance
procd_open_instance main_worker
procd_set_param user asu
procd_set_param group asu
procd_set_param env FLASK_APP=asu
procd_set_param command $PROG run_worker
procd_close_instance
}

View File

@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=autoconf
PKG_VERSION:=2.69
PKG_RELEASE:=2
PKG_RELEASE:=3
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_LICENSE:=GPL-3.0-or-later
PKG_INSTALL:=1

View File

@ -8,16 +8,19 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=automake
PKG_VERSION:=1.15
PKG_RELEASE:=4
PKG_VERSION:=1.16.2
PKG_RELEASE:=1
PKG_SOURCE_URL:=@GNU/automake
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=9908c75aabd49d13661d6dcb1bc382252d22cc77bf733a2d55e87f2aa2db8636
PKG_HASH:=ccc459de3d710e066ab9e12d2f119bd164a08c9341ca24ba22c9adaa179eedd0
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE:=GPL-3.0-or-later
PKG_CPE_ID:=cpe:/a:gnu:automake
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
@ -36,22 +39,24 @@ endef
FIX_PATHS = $(SED) '1c \#!/usr/bin/perl' -e 's| /[^ ]*/bin/perl| /usr/bin/perl|g'
AM_VERSION:=$(word 1,$(subst ., ,$(PKG_VERSION))).$(word 2,$(subst ., ,$(PKG_VERSION)))
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)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/automake-$(AM_VERSION) \
$(1)/usr/bin/automake-$(AM_VERSION)
$(LN) automake-$(AM_VERSION) $(1)/usr/bin/automake
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aclocal-$(AM_VERSION) \
$(1)/usr/bin/aclocal-$(AM_VERSION)
$(LN) aclocal-$(AM_VERSION) $(1)/usr/bin/aclocal
$(FIX_PATHS) $(1)/usr/bin/automake-$(AM_VERSION)
$(FIX_PATHS) $(1)/usr/bin/aclocal-$(AM_VERSION)
$(INSTALL_DIR) $(1)/usr/share/automake-$(AM_VERSION)
for dir in \
automake-$(PKG_VERSION) automake-$(PKG_VERSION)/Automake \
automake-$(PKG_VERSION)/am aclocal \
aclocal-$(PKG_VERSION) aclocal-$(PKG_VERSION)/internal \
automake-$(AM_VERSION) automake-$(AM_VERSION)/Automake \
automake-$(AM_VERSION)/am aclocal \
aclocal-$(AM_VERSION) aclocal-$(AM_VERSION)/internal \
; do \
$(INSTALL_DIR) $(1)/usr/share/$$$$dir; \
for file in $$$$(cd $(PKG_INSTALL_DIR) && \

View File

@ -8,15 +8,18 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=diffutils
PKG_VERSION:=3.6
PKG_RELEASE:=1
PKG_VERSION:=3.7
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/diffutils
PKG_HASH:=d621e8bdd4b573918c8145f7ae61817d1be9deb4c8d2328a65cea8e11d783bd6
PKG_HASH:=b3a7a6221c3dc916085f0d205abf6b8e1ba443d4dd965118da364a1dc1cb3a26
PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
@ -27,6 +30,10 @@ define Package/diffutils
DEPENDS:=+USE_GLIBC:librt
TITLE:=diffutils
URL:=http://www.gnu.org/software/diffutils/
ALTERNATIVES:=\
200:/usr/bin/cmp:/usr/bin/gnu-cmp \
200:/usr/bin/diff:/usr/bin/gnu-diff \
endef
define Package/diffutils/description
@ -35,28 +42,14 @@ define Package/diffutils/description
endef
CONFIGURE_VARS += \
gl_cv_func_getopt_gnu=yes \
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
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{sdiff,diff3} $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/diff $(1)/usr/bin/gnu-diff
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cmp $(1)/usr/bin/gnu-cmp
endef
$(eval $(call BuildPackage,diffutils))

34
devel/gcc/Config.in Normal file
View File

@ -0,0 +1,34 @@
# gcc library configuration
menu "Libraries"
depends on PACKAGE_gcc
config INCLUDE_STATIC_LIBC
bool "Include static libc on target"
help
Copies libc.a to target device
Increases the size of an already
very large package
default n
config INCLUDE_STATIC_LIBPTHREAD
bool "Include static libptread on target"
help
Copies libpthread.a to target device
Increases the size of an already
very large package
default n
config INCLUDE_STATIC_LIBSTDC
bool "Include static libstdc++ on target"
help
Copies libstdc++.a to target device
Increases the size of an already
very large package
default n
config INCLUDE_STATIC_LINK_SPEC
depends on INCLUDE_STATIC_LIBSTDC
bool "Generate spec file for easy static c++ linking on target"
help
Creates a spec file for gcc to eliminate the need for
-lstdc++, libgcc_pic and -static-libstdc flags when
statically linking c++ programs
default n
endmenu

View File

@ -6,19 +6,63 @@
#
include $(TOPDIR)/rules.mk
define Package/gcc/description
Build a native toolchain for compiling on target
device.
endef
define Package/gcc
SECTION:=devel
CATEGORY:=Development
TITLE:=gcc
MAINTAINER:=Noble Pepper <gccmaintain@noblepepper.com>
DEPENDS:= +binutils +libstdcpp @!arc
MENU:=1
endef
PKG_NAME:=gcc
PKG_VERSION:=5.4.0
PKG_RELEASE:=3
# PKG_VERSION=7.3.0
PKG_VERSION=7.4.0
PKG_RELEASE:=5
PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
PKG_HASH:=608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_INSTALL:=1
PKG_FIXUP:=libtool
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
PKG_CPE_ID:=cpe:/a:gnu:gcc
ifeq ($(PKG_VERSION),7.3.0)
PKG_HASH:=832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c
endif
ifeq ($(PKG_VERSION),7.4.0)
PKG_HASH:=eddde28d04f334aec1604456e536416549e9b1aa137fc69204e65eb0c009fe51
endif
define Package/gcc/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(CONFIG_INCLUDE_STATIC_LIBC),y)
COPY_STATIC_LIBC=cp -a $(TOOLCHAIN_DIR)/lib/libc.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
endif
ifeq ($(CONFIG_INCLUDE_STATIC_LIBPTHREAD),y)
COPY_STATIC_LIBPTHREAD=cp -a $(TOOLCHAIN_DIR)/lib/libpthread.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
endif
ifeq ($(CONFIG_INCLUDE_STATIC_LIBSTDC),y)
COPY_STATIC_LIBSTDC=cp -a $(TOOLCHAIN_DIR)/lib/libstdc++.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
endif
ifeq ($(CONFIG_INCLUDE_STATIC_LINK_SPEC),y)
INSTALL_STATIC_SPEC=g++ -dumpspecs |sed s/--start-group}\ %G\ %L\ /--start-group}\ %G\ %L\ -lstdc++\ -lgcc_pic\ / >/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/specs
REMOVE_STATIC_SPEC=rm /usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/specs
endif
include $(INCLUDE_DIR)/package.mk
TARGET_LANGUAGES:="c,c++"
BUGURL=https://dev.openwrt.org/
PKGVERSION=OpenWrt GCC $(PKG_VERSION)
@ -37,43 +81,30 @@ ifneq ($(CONFIG_SOFT_FLOAT),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
GMPSRC=gmp-6.1.0
define Download/gmp
URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
FILE:=$(GMPSRC).tar.bz2
HASH:=936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775
HASH:=498449a994efeba527885c10405993427995d3f86b8768d8cdf8d9dd7c6b73e8
endef
$(eval $(call Download,gmp))
MPCSRC=mpc-0.8.1
MPCSRC=mpc-1.0.3
define Download/mpc
URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
FILE:=$(MPCSRC).tar.gz
HASH:=e664603757251fd8a352848276497a4c79b7f8b21fd8aedd5cc0598a38fee3e4
HASH:=617decc6ea09889fb08ede330917a00b16809b8db88c29c31bfbb49cbf88ecc3
endef
$(eval $(call Download,mpc))
MPFRSRC=mpfr-2.4.2
MPFRSRC=mpfr-3.1.4
define Download/mpfr
URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
FILE:=$(MPFRSRC).tar.bz2
HASH:=c7e75a08a8d49d2082e4caee1591a05d11b9d5627514e678f02d66a124bcf2ba
HASH:=d3103a80cdad2407ed581f3618c4bed04e0c92d1cf771a65ead662cc397f7775
endef
$(eval $(call Download,mpfr))
@ -90,11 +121,11 @@ define Build/Prepare
# 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/
chmod u+w $(PKG_BUILD_DIR)/mpc/config.sub
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"
CONFIGURE_ARGS += CXXFLAGS_FOR_TARGET="-g -O2 -D_GLIBCXX_INCLUDE_NEXT_C_HEADERS"
define Build/Configure
(cd $(PKG_BUILD_DIR); rm -f config.cache; \
@ -118,6 +149,7 @@ define Build/Configure
--disable-libvtv \
--disable-libcilkrts \
--disable-libmudflap \
--disable-libmpx \
--disable-multilib \
--disable-libgomp \
--disable-libquadmath \
@ -128,6 +160,7 @@ define Build/Configure
--prefix=/usr \
--libexecdir=/usr/lib \
--with-local-prefix=/usr \
--with-stage1-ldflags=-lstdc++ \
$(ARM_FLOAT_OPTION) \
$(SOFT_FLOAT_CONFIG_OPTION) \
$(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
@ -149,7 +182,7 @@ ifeq ($(CONFIG_SOFT_FLOAT),y)
endif
ENVCFLAGS+="
ENVLDFLAGS:="-Wl,-rpath=/usr/lib -Wl,--dynamic-linker=/usr/lib/$(DYNLINKER) -L/usr/lib"
ENVLDFLAGS:="-Wl,-rpath=/usr/lib -Wl,--dynamic-linker=/usr/lib/$(DYNLINKER) -L/usr/lib, -lstdc++"
define Package/gcc/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
@ -165,6 +198,9 @@ define Package/gcc/install
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)
$(COPY_STATIC_LIBC)
$(COPY_STATIC_LIBPTHREAD)
$(COPY_STATIC_LIBSTDC)
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
@ -173,4 +209,14 @@ define Package/gcc/install
chmod +x $(1)/usr/bin/gcc_env.sh
endef
define Package/gcc/postinst
#!/bin/sh
$(INSTALL_STATIC_SPEC)
endef
define Package/gcc/postrm
#!/bin/sh
$(REMOVE_STATIC_SPEC)
endef
$(eval $(call BuildPackage,gcc))

View File

@ -1,8 +1,8 @@
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.
To save disk space, this GCC uses dynamic linking on the target box. There
are configuration options to include libstdc++.a, libc.a and libpthread.a
if staticly linked binaries are needed.
For now, this was only tested on arm (EABI) and mips targets. Others to be
done...

View File

@ -1,3 +1,15 @@
commit 31285a20390a5e53a74a2a71d1b5c82f366ddd5a
Author: Felix Fietkau <nbd@openwrt.org>
Date: Tue May 6 11:49:05 2014 +0000
gcc: revert an upstream patch that is causing a regression on powerpc
https://forum.openwrt.org/viewtopic.php?pid=232494#p232494
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40709
Revert of:
commit 275035b56823b26d5fb7e90fad945b998648edf2
@ -14,7 +26,7 @@ Date: Thu Sep 5 14:09:07 2013 +0000
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -665,35 +665,40 @@ choose_hard_reg_mode (unsigned int regno
@@ -637,35 +637,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)

View File

@ -1,3 +1,13 @@
commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e
Author: Felix Fietkau <nbd@openwrt.org>
Date: Sun Oct 19 21:45:51 2014 +0000
gcc: do not assume that the Mac OS X filesystem is case insensitive
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 42973
--- a/include/filenames.h
+++ b/include/filenames.h
@@ -43,11 +43,6 @@ extern "C" {

View File

@ -1,38 +0,0 @@
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

View File

@ -1,6 +1,18 @@
commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2
Author: Luka Perkov <luka@openwrt.org>
Date: Tue Feb 26 16:16:33 2013 +0000
gcc: don't build documentation
This closes #13039.
Signed-off-by: Luka Perkov <luka@openwrt.org>
SVN-Revision: 35807
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2941,18 +2941,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
@@ -3121,18 +3121,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
doc/gccint.info: $(TEXI_GCCINT_FILES)
doc/cppinternals.info: $(TEXI_CPPINT_FILES)

View File

@ -1,28 +0,0 @@
--- 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

View File

@ -1,23 +0,0 @@
--- 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

View File

@ -1,33 +0,0 @@
--- 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

View File

@ -0,0 +1,20 @@
Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790.
MIPS16 functions have a static assembler prologue which clobbers
registers v0 and v1. Add these register clobbers to function call
instructions.
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -3098,6 +3098,12 @@ mips_emit_call_insn (rtx pattern, rtx or
emit_insn (gen_update_got_version ());
}
+ if (TARGET_MIPS16 && TARGET_USE_GOT)
+ {
+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS16_PIC_TEMP);
+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS_PROLOGUE_TEMP (word_mode));
+ }
+
if (TARGET_MIPS16
&& TARGET_EXPLICIT_RELOCS
&& TARGET_CALL_CLOBBERED_GP)

View File

@ -1,309 +0,0 @@
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

View File

@ -1,43 +0,0 @@
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

View File

@ -1,35 +0,0 @@
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)

View File

@ -1,209 +0,0 @@
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

View File

@ -1,39 +0,0 @@
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

View File

@ -1,41 +0,0 @@
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"

View File

@ -1,31 +0,0 @@
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}"

View File

@ -1,30 +0,0 @@
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}

View File

@ -1,72 +0,0 @@
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 22 Apr 2015 14:24:11 +0000 (+0000)
Subject: libstdc++, libgfortran gthr workaround for musl
X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=1e5f711c11cb80ce609db9e9c1d8b2da0f7b5b61
libstdc++, libgfortran gthr workaround for musl
On behalf of szabolcs.nagy@arm.com
[libstdc++-v3/]
2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com>
* config/os/generic/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK): Define.
* configure.host (os_include_dir): Set to "os/generic" for linux-musl*.
[libgfortran/]
2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com>
* acinclude.m4 (GTHREAD_USE_WEAK): Define as 0 for *-*-musl*.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222329 138bc75d-0d04-0410-961f-82ee72b054a4
---
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -100,7 +100,7 @@ void foo (void);
[Define to 1 if the target supports #pragma weak])
fi
case "$host" in
- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
AC_DEFINE(GTHREAD_USE_WEAK, 0,
[Define to 0 if the target shouldn't use #pragma weak])
;;
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -26456,7 +26456,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>con
fi
case "$host" in
- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
$as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
--- a/libstdc++-v3/config/os/generic/os_defines.h
+++ b/libstdc++-v3/config/os/generic/os_defines.h
@@ -33,4 +33,9 @@
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
+// Disable the weak reference logic in gthr.h for os/generic because it
+// is broken on every platform unless there is implementation specific
+// workaround in gthr-posix.h and at link-time for static linking.
+#define _GLIBCXX_GTHREAD_USE_WEAK 0
+
#endif
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -273,6 +273,9 @@ case "${host_os}" in
freebsd*)
os_include_dir="os/bsd/freebsd"
;;
+ linux-musl*)
+ os_include_dir="os/generic"
+ ;;
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
if [ "$uclibc" = "yes" ]; then
os_include_dir="os/uclibc"

Some files were not shown because too many files have changed in this diff Show More