diff options
Diffstat (limited to 'poky/meta/recipes-extended')
496 files changed, 32250 insertions, 0 deletions
diff --git a/poky/meta/recipes-extended/acpica/acpica_20170303.bb b/poky/meta/recipes-extended/acpica/acpica_20170303.bb new file mode 100644 index 000000000..51ae77b78 --- /dev/null +++ b/poky/meta/recipes-extended/acpica/acpica_20170303.bb @@ -0,0 +1,53 @@ +SUMMARY = "ACPICA tools for the development and debug of ACPI tables" +DESCRIPTION = "The ACPI Component Architecture (ACPICA) project provides an \ +OS-independent reference implementation of the Advanced Configuration and \ +Power Interface Specification (ACPI). ACPICA code contains those portions of \ +ACPI meant to be directly integrated into the host OS as a kernel-resident \ +subsystem, and a small set of tools to assist in developing and debugging \ +ACPI tables." + +HOMEPAGE = "http://www.acpica.org/" +SECTION = "console/tools" + +LICENSE = "BSD | GPLv2" +LIC_FILES_CHKSUM = "file://generate/unix/readme.txt;md5=204407e197c1a01154a48f6c6280c3aa" + +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" + +DEPENDS = "bison flex" + +SRC_URI = "https://acpica.org/sites/acpica/files/acpica-unix2-${PV}.tar.gz \ + file://rename-yy_scan_string-manually.patch \ + file://manipulate-fds-instead-of-FILE.patch;striplevel=2 \ + file://0001-Linux-add-support-for-X32-ABI-compilation.patch \ + " +SRC_URI[md5sum] = "48ef4314fb4ffdd0c96f14dcf20544e1" +SRC_URI[sha256sum] = "b2d81e84107ac9a02be86ea43cbea7afa8fd4b4150270bc88c2d4c9fea0b8aad" +UPSTREAM_CHECK_URI = "https://acpica.org/downloads" + +S = "${WORKDIR}/acpica-unix2-${PV}" + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN} = "acpixtract" + +EXTRA_OEMAKE = "CC='${CC}' 'OPT_CFLAGS=-Wall'" + +do_install() { + install -D -p -m0755 generate/unix/bin*/iasl ${D}${bindir}/iasl + install -D -p -m0755 generate/unix/bin*/acpibin ${D}${bindir}/acpibin + install -D -p -m0755 generate/unix/bin*/acpiexec ${D}${bindir}/acpiexec + install -D -p -m0755 generate/unix/bin*/acpihelp ${D}${bindir}/acpihelp + install -D -p -m0755 generate/unix/bin*/acpinames ${D}${bindir}/acpinames + install -D -p -m0755 generate/unix/bin*/acpisrc ${D}${bindir}/acpisrc + install -D -p -m0755 generate/unix/bin*/acpixtract ${D}${bindir}/acpixtract +} + +# iasl*.bb is a subset of this recipe, so RREPLACE it +PROVIDES = "iasl" +RPROVIDES_${PN} += "iasl" +RREPLACES_${PN} += "iasl" +RCONFLICTS_${PN} += "iasl" + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/acpica/files/0001-Linux-add-support-for-X32-ABI-compilation.patch b/poky/meta/recipes-extended/acpica/files/0001-Linux-add-support-for-X32-ABI-compilation.patch new file mode 100644 index 000000000..df7420006 --- /dev/null +++ b/poky/meta/recipes-extended/acpica/files/0001-Linux-add-support-for-X32-ABI-compilation.patch @@ -0,0 +1,31 @@ +From d22241efc0708c9799f17a20eabb52a48d6d6ea1 Mon Sep 17 00:00:00 2001 +From: Anuj Mittal <anuj.mittal@intel.com> +Date: Tue, 2 Jan 2018 12:35:32 +0800 +Subject: [PATCH] Linux: add support for X32 ABI compilation + +X32 follows ILP32 model. Check for ILP32 as well when checking for +x86_64 to ensure the defines are correct for X32 ABI. + +Upstream-Status: Submitted [https://github.com/acpica/acpica/pull/348] + +Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> +--- + source/include/platform/aclinux.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h +index 75b1d82..6b8ff73 100644 +--- a/source/include/platform/aclinux.h ++++ b/source/include/platform/aclinux.h +@@ -315,7 +315,7 @@ + #define ACPI_FLUSH_CPU_CACHE() + #define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread)) + +-#if defined(__ia64__) || defined(__x86_64__) ||\ ++#if defined(__ia64__) || (defined(__x86_64__) && !defined(__ILP32__)) ||\ + defined(__aarch64__) || defined(__PPC64__) ||\ + defined(__s390x__) + #define ACPI_MACHINE_WIDTH 64 +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch b/poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch new file mode 100644 index 000000000..5610ed9be --- /dev/null +++ b/poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch @@ -0,0 +1,72 @@ +From 69171c22f3872ecb4c1ab27985e93ca44084595e Mon Sep 17 00:00:00 2001 +From: Fan Xin <fan.xin@jp.fujitsu.com> +Date: Mon, 5 Jun 2017 13:26:38 +0900 +Subject: [PATCH] aslfiles.c: manipulate fds instead of FILE + +Copying what stdout/stderr point to is not portable and fails with +musl because FILE is an undefined struct. + +Instead, use lower-level Unix functions to modify the file that stderr +writes into. This works on the platforms that Yocto targets. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> + +Rebase on acpica 20170303 + +Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com> +--- + acpica-unix2-20170303/source/compiler/aslfiles.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/acpica-unix2-20170303/source/compiler/aslfiles.c b/acpica-unix2-20170303/source/compiler/aslfiles.c +index 809090c..97898b1 100644 +--- a/acpica-unix2-20170303/source/compiler/aslfiles.c ++++ b/acpica-unix2-20170303/source/compiler/aslfiles.c +@@ -44,6 +44,10 @@ + #include "aslcompiler.h" + #include "acapps.h" + #include "dtcompiler.h" ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <fcntl.h> ++#include <unistd.h> + + #define _COMPONENT ACPI_COMPILER + ACPI_MODULE_NAME ("aslfiles") +@@ -607,6 +611,8 @@ FlOpenMiscOutputFiles ( + + if (Gbl_DebugFlag) + { ++ int fd; ++ + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG); + if (!Filename) + { +@@ -618,10 +624,10 @@ FlOpenMiscOutputFiles ( + /* Open the debug file as STDERR, text mode */ + + Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename; +- Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = +- freopen (Filename, "w+t", stderr); + +- if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle) ++ fd = open(Filename, O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); ++ if (fd < 0 || ++ dup2(fd, fileno(stderr))) + { + /* + * A problem with freopen is that on error, we no longer +@@ -635,6 +641,8 @@ FlOpenMiscOutputFiles ( + exit (1); + } + ++ Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = stderr; ++ + AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); + AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT); + } +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/acpica/files/rename-yy_scan_string-manually.patch b/poky/meta/recipes-extended/acpica/files/rename-yy_scan_string-manually.patch new file mode 100644 index 000000000..b62ca25ba --- /dev/null +++ b/poky/meta/recipes-extended/acpica/files/rename-yy_scan_string-manually.patch @@ -0,0 +1,64 @@ +From 2ab61e6ad5a9cfcde838379bc36babfaaa61afb8 Mon Sep 17 00:00:00 2001 +From: Patrick Ohly <patrick.ohly@intel.com> +Date: Fri, 20 Jan 2017 13:50:17 +0100 +Subject: [PATCH] rename yy_scan_string manually + +flex 2.6.0 used to generate code where yy_scan_string was mapped +to <custom prefix>_scan_string directly in the generated .c code. + +For example, generate/unix/iasl/obj/prparserlex.c: + +int +PrInitLexer ( + char *String) +{ + + LexBuffer = PrParser_scan_string (String); + return (LexBuffer == NULL); +} + +flex 2.6.3 no longer does that, leading to a compiler warning +and link error about yy_scan_string(). + +Both versions generate a preamble in the beginning of prparserlex.c +that maps several yy_* names, but yy_scan_string is not among those: + +... +... + +Upstream-Status: Inappropriate [workaround for https://github.com/westes/flex/issues/164] +Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> +--- + source/compiler/dtparser.l | 2 +- + source/compiler/prparser.l | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/source/compiler/dtparser.l b/source/compiler/dtparser.l +index 3f4c2f3..eaa43ff 100644 +--- a/source/compiler/dtparser.l ++++ b/source/compiler/dtparser.l +@@ -120,7 +120,7 @@ DtInitLexer ( + char *String) + { + +- LexBuffer = yy_scan_string (String); ++ LexBuffer = DtParser_scan_string (String); + return (LexBuffer == NULL); + } + +diff --git a/source/compiler/prparser.l b/source/compiler/prparser.l +index 10bd130..9cb3573 100644 +--- a/source/compiler/prparser.l ++++ b/source/compiler/prparser.l +@@ -127,7 +127,7 @@ PrInitLexer ( + char *String) + { + +- LexBuffer = yy_scan_string (String); ++ LexBuffer = PrParser_scan_string (String); + return (LexBuffer == NULL); + } + +-- +2.11.0 + diff --git a/poky/meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb b/poky/meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb new file mode 100644 index 000000000..38164d557 --- /dev/null +++ b/poky/meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb @@ -0,0 +1,24 @@ +SUMMARY = "Tool for creating HTML, PDF, EPUB, man pages" +DESCRIPTION = "AsciiDoc is a text document format for writing short documents, \ +articles, books and UNIX man pages." + +HOMEPAGE = "http://asciidoc.org/" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ + file://COPYRIGHT;md5=029ad5428ba5efa20176b396222d4069" + +SRC_URI = "http://downloads.sourceforge.net/project/${BPN}/${BPN}/${PV}/${BP}.tar.gz" +SRC_URI[md5sum] = "c59018f105be8d022714b826b0be130a" +SRC_URI[sha256sum] = "78db9d0567c8ab6570a6eff7ffdf84eadd91f2dfc0a92a2d0105d323cab4e1f0" + +UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/asciidoc/files/" + +inherit autotools-brokensep + +export DESTDIR = "${D}" +DEPENDS_class-native = "docbook-xml-dtd4-native" +RDEPENDS_${PN} += "python" +BBCLASSEXTEND = "native" + +CLEANBROKEN = "1" diff --git a/poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch b/poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch new file mode 100644 index 000000000..7fdecc7fd --- /dev/null +++ b/poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch @@ -0,0 +1,59 @@ +From f446686916e503dfb9fb928252d1b72a07573b29 Mon Sep 17 00:00:00 2001 +From: Dengke Du <dengke.du@windriver.com> +Date: Tue, 18 Jul 2017 03:42:56 -0400 +Subject: [PATCH] remove glibc assumption + +glibc time.h header has an undocumented __isleap macro +that we are using anf musl is missing it. +Since it is undocumented & does not appear +on any other libc, stop using it and just define the macro in +locally instead. + +Upstream-Status: Submitted [ https://lists.debian.org/debian-accessibility/2017/07/msg00044.html ] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Signed-off-by: Dengke Du <dengke.du@windriver.com> +--- + parsetime.y | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/parsetime.y b/parsetime.y +index 7005e88..324e6d3 100644 +--- a/parsetime.y ++++ b/parsetime.y +@@ -8,6 +8,9 @@ + + #define YYDEBUG 1 + ++#define is_leap_year(y) \ ++ ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0)) ++ + struct tm exectm; + static int isgmt; + static int yearspec; +@@ -217,8 +220,8 @@ date : month_name day_number + mnum == 12) && dnum > 31) + || ((mnum == 4 || mnum == 6 || mnum == 9 || + mnum == 11) && dnum > 30) +- || (mnum == 2 && dnum > 29 && __isleap(ynum+1900)) +- || (mnum == 2 && dnum > 28 && !__isleap(ynum+1900)) ++ || (mnum == 2 && dnum > 29 && is_leap_year(ynum+1900)) ++ || (mnum == 2 && dnum > 28 && !is_leap_year(ynum+1900)) + ) + { + yyerror("Error in day of month"); +@@ -261,8 +264,8 @@ date : month_name day_number + mnum == 12) && dnum > 31) + || ((mnum == 4 || mnum == 6 || mnum == 9 || + mnum == 11) && dnum > 30) +- || (mnum == 2 && dnum > 29 && __isleap(ynum+1900)) +- || (mnum == 2 && dnum > 28 && !__isleap(ynum+1900)) ++ || (mnum == 2 && dnum > 29 && is_leap_year(ynum+1900)) ++ || (mnum == 2 && dnum > 28 && !is_leap_year(ynum+1900)) + ) + { + yyerror("Error in day of month"); +-- +2.8.1 + diff --git a/poky/meta/recipes-extended/at/at/atd.init b/poky/meta/recipes-extended/at/at/atd.init new file mode 100644 index 000000000..eca379b3c --- /dev/null +++ b/poky/meta/recipes-extended/at/at/atd.init @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Starts at daemon +# + +umask 077 + +# Source function library. +. /etc/init.d/functions + +start() { + echo -n "Starting atd: " + start-stop-daemon --start --quiet --pidfile /var/run/atd.pid --background --exec /usr/sbin/atd -- -f + echo "OK" +} +stop() { + echo -n "Stopping atd: " + start-stop-daemon --stop --quiet --pidfile /var/run/atd.pid + echo "OK" +} +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + status) + status /usr/sbin/atd + ;; + *) + echo $"Usage: $0 {start|stop|restart|status}" + exit 1 +esac + +exit $? + diff --git a/poky/meta/recipes-extended/at/at/atd.service b/poky/meta/recipes-extended/at/at/atd.service new file mode 100644 index 000000000..6dc844504 --- /dev/null +++ b/poky/meta/recipes-extended/at/at/atd.service @@ -0,0 +1,9 @@ +[Unit] +Description=Job spooling tools +After=syslog.target + +[Service] +ExecStart=@SBINDIR@/atd -f + +[Install] +WantedBy=multi-user.target diff --git a/poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch b/poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch new file mode 100644 index 000000000..1e5efef12 --- /dev/null +++ b/poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch @@ -0,0 +1,25 @@ +Upstream-Status: Pending + +--- at-3.1.12/configure.ac 2011-06-23 14:51:03.653572945 +0800 ++++ at-3.1.12/configure.ac.new 2011-06-27 16:12:14.903572945 +0800 +@@ -81,10 +81,18 @@ + AC_FUNC_VPRINTF + AC_FUNC_GETLOADAVG + AC_CHECK_FUNCS(getcwd mktime strftime setreuid setresuid sigaction waitpid) ++ ++AC_ARG_WITH([pam], ++ [AS_HELP_STRING([--without-pam], [without PAM support])]) ++ ++if test "x$with_pam" != xno; then + AC_CHECK_HEADERS(security/pam_appl.h, [ + PAMLIB="-lpam" +- AC_DEFINE(HAVE_PAM, 1, [Define to 1 for PAM support]) +-]) ++ AC_DEFINE(HAVE_PAM, 1, [Define to 1 for PAM support])], ++ [if test "x$with_pam" = xyes; then ++ AC_MSG_ERROR([PAM selected but security/pam_misc.h not found]) ++ fi]) ++fi + + dnl Checking for programs + diff --git a/poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch b/poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch new file mode 100644 index 000000000..d5ef0032b --- /dev/null +++ b/poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch @@ -0,0 +1,30 @@ +Upstream-Status: Inappropriate [licensing] + +posixtm.[ch] files are replaced with gplv2 version from these locations: + +http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/posixtm.c;hb=5661ab9d49512b4cf3c19caa11bb581d8ce561ba +http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/posixtm.h;hb=5661ab9d49512b4cf3c19caa11bb581d8ce561ba + +update the Copyright file information to reflect the replaced files. + +Date: 2010/08/31 +Nitin A Kamble nitin.a.kamble@intel.com + +Index: at-3.1.12/Copyright +=================================================================== +--- at-3.1.12.orig/Copyright ++++ at-3.1.12/Copyright +@@ -31,10 +31,10 @@ The files posixtm.c and posixtm.h have t + Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004, + 2005, 2006, 2007 Free Software Foundation Inc. + +- This program is free software: you can redistribute it and/or modify ++ 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 3 of the License, or +- (at your option) any later version. ++ the Free Software Foundation; either version 2, 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 diff --git a/poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch b/poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch new file mode 100644 index 000000000..100f8898e --- /dev/null +++ b/poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch @@ -0,0 +1,35 @@ +make -j was failing sometimesa like this +| ccache i586-poky-linux-gcc -march=i586 --sysroot=/home/nitin/build/build0/tmp/sysroots/i586-poky-linux -I. -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types -o atd atd.o daemon.o -lfl -lpam -Wl,-O1 -Wl,--as-needed +| parsetime.l:5:19: fatal error: y.tab.h: No such file or directory +| compilation terminated. +| make: *** [lex.yy.o] Error 1 +| make: *** Waiting for unfinished jobs.... + +Fixed the issue by adding a dependency in the makefile. +Nitin <nitin.a.kamble@intel.com> +2010/09/02 + +Upstream-Status: Pending + +Signed-off-by: Scott Garman <scott.a.garman@intel.com> + +--- + Makefile.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Makefile.in b/Makefile.in +index dd3c2f8..7897e45 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -82,6 +82,8 @@ y.tab.c y.tab.h: parsetime.y + lex.yy.c: parsetime.l + $(LEX) -i parsetime.l + ++parsetime.l: y.tab.h ++ + atd.service: atd.service.in + sed -e 's![@]sbindir[@]!$(sbindir)!g' < $< > $@ + +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch b/poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch new file mode 100644 index 000000000..d6056dcef --- /dev/null +++ b/poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch @@ -0,0 +1,32 @@ +From 150b63a936af71b992a3a7b0fc2d2497e51fc800 Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Wed, 28 Jan 2015 23:52:00 -0800 +Subject: [PATCH] Makefile: fix for parallel build + +Fixed: +y.tab.c:1001:0: error: unterminated #if + +Let "$(YACC) -d parsetime.y" only run once will fix the problem. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + Makefile | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +Index: at-3.1.20/Makefile.in +=================================================================== +--- at-3.1.20.orig/Makefile.in ++++ at-3.1.20/Makefile.in +@@ -76,7 +76,9 @@ at: $(ATOBJECTS) + atd: $(RUNOBJECTS) + $(CC) $(LDFLAGS) -o atd $(RUNOBJECTS) $(LIBS) $(PAMLIB) $(SELINUXLIB) + +-y.tab.c y.tab.h: parsetime.y ++y.tab.h: y.tab.c ++ ++y.tab.c: parsetime.y + $(YACC) -d parsetime.y + + lex.yy.c: parsetime.l diff --git a/poky/meta/recipes-extended/at/at/pam.conf.patch b/poky/meta/recipes-extended/at/at/pam.conf.patch new file mode 100644 index 000000000..b5ceb9ae8 --- /dev/null +++ b/poky/meta/recipes-extended/at/at/pam.conf.patch @@ -0,0 +1,27 @@ +oe doesn't support "@include", use the concrete directive instead. + +Upstream-Status: Pending + +Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> +Index: at-3.1.15/pam.conf +=================================================================== +--- at-3.1.15.orig/pam.conf ++++ at-3.1.15/pam.conf +@@ -1,10 +1,11 @@ + # + # The PAM configuration file for the at daemon + # ++ ++auth required pam_env.so ++auth include common-auth ++account include common-account ++session include common-session-noninteractive ++session required pam_limits.so ++session required pam_loginuid.so + +-auth required pam_env.so +-@include common-auth +-@include common-account +-session required pam_loginuid.so +-@include common-session-noninteractive +-session required pam_limits.so diff --git a/poky/meta/recipes-extended/at/at/posixtm.c b/poky/meta/recipes-extended/at/at/posixtm.c new file mode 100644 index 000000000..5514ba4fe --- /dev/null +++ b/poky/meta/recipes-extended/at/at/posixtm.c @@ -0,0 +1,328 @@ +/* Parse dates for touch and date. + + Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004, + 2005, 2006, 2007 Free Software Foundation Inc. + + 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Yacc-based version written by Jim Kingdon and David MacKenzie. + Rewritten by Jim Meyering. */ + +#include <config.h> + +#include "posixtm.h" + +#include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <string.h> + +#if USE_UNLOCKED_IO +# include "unlocked-io.h" +#endif + +/* ISDIGIT differs from isdigit, as follows: + - Its arg may be any int or unsigned int; it need not be an unsigned char + or EOF. + - It's typically faster. + POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to + isdigit unless it's important to use the locale's definition + of `digit' even when the host does not conform to POSIX. */ +#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) + +time_t mktime (); + +/* + POSIX requires: + + touch -t [[CC]YY]mmddhhmm[.ss] FILE... + 8, 10, or 12 digits, followed by optional .ss + (PDS_LEADING_YEAR | PDS_CENTURY | PDS_SECONDS) + + touch mmddhhmm[YY] FILE... (obsoleted by POSIX 1003.1-2001) + 8 or 10 digits, YY (if present) must be in the range 69-99 + (PDS_TRAILING_YEAR | PDS_PRE_2000) + + date mmddhhmm[[CC]YY] + 8, 10, or 12 digits + (PDS_TRAILING_YEAR | PDS_CENTURY) + +*/ + +static int +year (struct tm *tm, const int *digit_pair, size_t n, unsigned int syntax_bits) +{ + switch (n) + { + case 1: + tm->tm_year = *digit_pair; + /* Deduce the century based on the year. + POSIX requires that 00-68 be interpreted as 2000-2068, + and that 69-99 be interpreted as 1969-1999. */ + if (digit_pair[0] <= 68) + { + if (syntax_bits & PDS_PRE_2000) + return 1; + tm->tm_year += 100; + } + break; + + case 2: + if (! (syntax_bits & PDS_CENTURY)) + return 1; + tm->tm_year = digit_pair[0] * 100 + digit_pair[1] - 1900; + break; + + case 0: + { + time_t now; + struct tm *tmp; + + /* Use current year. */ + time (&now); + tmp = localtime (&now); + if (! tmp) + return 1; + tm->tm_year = tmp->tm_year; + } + break; + + default: + abort (); + } + + return 0; +} + +static int +posix_time_parse (struct tm *tm, const char *s, unsigned int syntax_bits) +{ + const char *dot = NULL; + int pair[6]; + int *p; + size_t i; + + size_t s_len = strlen (s); + size_t len = (((syntax_bits & PDS_SECONDS) && (dot = strchr (s, '.'))) + ? (size_t) (dot - s) + : s_len); + + if (len != 8 && len != 10 && len != 12) + return 1; + + if (dot) + { + if (!(syntax_bits & PDS_SECONDS)) + return 1; + + if (s_len - len != 3) + return 1; + } + + for (i = 0; i < len; i++) + if (!ISDIGIT (s[i])) + return 1; + + len /= 2; + for (i = 0; i < len; i++) + pair[i] = 10 * (s[2*i] - '0') + s[2*i + 1] - '0'; + + p = pair; + if (syntax_bits & PDS_LEADING_YEAR) + { + if (year (tm, p, len - 4, syntax_bits)) + return 1; + p += len - 4; + len = 4; + } + + /* Handle 8 digits worth of `MMDDhhmm'. */ + tm->tm_mon = *p++ - 1; + tm->tm_mday = *p++; + tm->tm_hour = *p++; + tm->tm_min = *p++; + len -= 4; + + /* Handle any trailing year. */ + if (syntax_bits & PDS_TRAILING_YEAR) + { + if (year (tm, p, len, syntax_bits)) + return 1; + } + + /* Handle seconds. */ + if (!dot) + { + tm->tm_sec = 0; + } + else + { + int seconds; + + ++dot; + if (!ISDIGIT (dot[0]) || !ISDIGIT (dot[1])) + return 1; + seconds = 10 * (dot[0] - '0') + dot[1] - '0'; + + tm->tm_sec = seconds; + } + + return 0; +} + +/* Parse a POSIX-style date, returning true if successful. */ + +bool +posixtime (time_t *p, const char *s, unsigned int syntax_bits) +{ + struct tm tm0 +#ifdef lint + /* Placate gcc-4's -Wuninitialized. + posix_time_parse fails to set all of tm0 only when it returns + nonzero (due to year() returning nonzero), and in that case, + this code doesn't use the tm0 at all. */ + = { 0, } +#endif + ; + struct tm tm1; + struct tm const *tm; + time_t t; + + if (posix_time_parse (&tm0, s, syntax_bits)) + return false; + + tm1 = tm0; + tm1.tm_isdst = -1; + t = mktime (&tm1); + + if (t != (time_t) -1) + tm = &tm1; + else + { + /* mktime returns -1 for errors, but -1 is also a valid time_t + value. Check whether an error really occurred. */ + tm = localtime (&t); + if (! tm) + return false; + } + + /* Reject dates like "September 31" and times like "25:61". */ + if ((tm0.tm_year ^ tm->tm_year) + | (tm0.tm_mon ^ tm->tm_mon) + | (tm0.tm_mday ^ tm->tm_mday) + | (tm0.tm_hour ^ tm->tm_hour) + | (tm0.tm_min ^ tm->tm_min) + | (tm0.tm_sec ^ tm->tm_sec)) + return false; + + *p = t; + return true; +} + +#ifdef TEST_POSIXTIME +/* + Test mainly with syntax_bits == 13 + (aka: (PDS_LEADING_YEAR | PDS_CENTURY | PDS_SECONDS)) + + This test data assumes Universal Time, e.g., TZ="UTC0". + + This test data also assumes that time_t is signed and is at least + 39 bits wide, so that it can represent all years from 0000 through + 9999. A host with 32-bit signed time_t can represent only time + stamps in the range 1901-12-13 20:45:52 through 2038-01-18 + 03:14:07 UTC, assuming POSIX time_t with no leap seconds, so test + cases outside this range will not work on such a host. + + Also, the first two lines of test data assume that the current + year is 2002. + +BEGIN-DATA +12131415.16 13 1039788916 Fri Dec 13 14:15:16 2002 +12131415.16 13 1039788916 Fri Dec 13 14:15:16 2002 +000001010000.00 13 -62167132800 Sun Jan 1 00:00:00 0000 +190112132045.52 13 -2147483648 Fri Dec 13 20:45:52 1901 +190112132045.53 13 -2147483647 Fri Dec 13 20:45:53 1901 +190112132046.52 13 -2147483588 Fri Dec 13 20:46:52 1901 +190112132145.52 13 -2147480048 Fri Dec 13 21:45:52 1901 +190112142045.52 13 -2147397248 Sat Dec 14 20:45:52 1901 +190201132045.52 13 -2144805248 Mon Jan 13 20:45:52 1902 +196912312359.59 13 -1 Wed Dec 31 23:59:59 1969 +197001010000.00 13 0 Thu Jan 1 00:00:00 1970 +197001010000.01 13 1 Thu Jan 1 00:00:01 1970 +197001010001.00 13 60 Thu Jan 1 00:01:00 1970 +197001010100.00 13 3600 Thu Jan 1 01:00:00 1970 +197001020000.00 13 86400 Fri Jan 2 00:00:00 1970 +197002010000.00 13 2678400 Sun Feb 1 00:00:00 1970 +197101010000.00 13 31536000 Fri Jan 1 00:00:00 1971 +197001000000.00 13 * * +197000010000.00 13 * * +197001010000.60 13 * * +197001010060.00 13 * * +197001012400.00 13 * * +197001320000.00 13 * * +197013010000.00 13 * * +203801190314.06 13 2147483646 Tue Jan 19 03:14:06 2038 +203801190314.07 13 2147483647 Tue Jan 19 03:14:07 2038 +203801190314.08 13 2147483648 Tue Jan 19 03:14:08 2038 +999912312359.59 13 253402300799 Fri Dec 31 23:59:59 9999 +1112131415 13 1323785700 Tue Dec 13 14:15:00 2011 +1112131415.16 13 1323785716 Tue Dec 13 14:15:16 2011 +201112131415.16 13 1323785716 Tue Dec 13 14:15:16 2011 +191112131415.16 13 -1831974284 Wed Dec 13 14:15:16 1911 +203712131415.16 13 2144326516 Sun Dec 13 14:15:16 2037 +3712131415.16 13 2144326516 Sun Dec 13 14:15:16 2037 +6812131415.16 13 3122633716 Thu Dec 13 14:15:16 2068 +6912131415.16 13 -1590284 Sat Dec 13 14:15:16 1969 +7012131415.16 13 29945716 Sun Dec 13 14:15:16 1970 +1213141599 2 945094500 Mon Dec 13 14:15:00 1999 +1213141500 2 976716900 Wed Dec 13 14:15:00 2000 +END-DATA + +*/ + +# define MAX_BUFF_LEN 1024 + +int +main (void) +{ + char buff[MAX_BUFF_LEN + 1]; + + buff[MAX_BUFF_LEN] = 0; + while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0]) + { + char time_str[MAX_BUFF_LEN]; + unsigned int syntax_bits; + time_t t; + if (sscanf (buff, "%s %u", time_str, &syntax_bits) != 2) + printf ("*\n"); + else + { + printf ("%-15s %2u ", time_str, syntax_bits); + if (posixtime (&t, time_str, syntax_bits)) + printf ("%12ld %s", (long int) t, ctime (&t)); + else + printf ("%12s %s", "*", "*\n"); + } + } + exit (0); + +} +#endif + +/* +Local Variables: +compile-command: "gcc -DTEST_POSIXTIME -g -O -Wall -W posixtm.c" +End: +*/ diff --git a/poky/meta/recipes-extended/at/at/posixtm.h b/poky/meta/recipes-extended/at/at/posixtm.h new file mode 100644 index 000000000..e91749d73 --- /dev/null +++ b/poky/meta/recipes-extended/at/at/posixtm.h @@ -0,0 +1,37 @@ +/* Parse dates for touch and date. + + Copyright (C) 1998, 2003, 2005, 2007 Free Software Foundation Inc. + + 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Yacc-based version written by Jim Kingdon and David MacKenzie. + Rewritten by Jim Meyering. */ + +#ifndef POSIXTM_H_ +# define POSIXTM_H_ + +# include <stdbool.h> +# include <time.h> + +/* POSIX Date Syntax flags. */ +# define PDS_LEADING_YEAR 1 +# define PDS_TRAILING_YEAR 2 +# define PDS_CENTURY 4 +# define PDS_SECONDS 8 +# define PDS_PRE_2000 16 + +bool posixtime (time_t *p, const char *s, unsigned int syntax_bits); + +#endif diff --git a/poky/meta/recipes-extended/at/at_3.1.20.bb b/poky/meta/recipes-extended/at/at_3.1.20.bb new file mode 100644 index 000000000..8fe3b437e --- /dev/null +++ b/poky/meta/recipes-extended/at/at_3.1.20.bb @@ -0,0 +1,72 @@ +SUMMARY = "Delayed job execution and batch processing" +HOMEPAGE = "http://blog.calhariz.com/" +DESCRIPTION = "At allows for commands to be run at a particular time. Batch will execute commands when \ +the system load levels drop to a particular level." +SECTION = "base" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4" +DEPENDS = "flex flex-native bison-native \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" + +RDEPENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_DEPS}', '', d)} \ +" + +PAM_DEPS = "libpam libpam-runtime pam-plugin-env pam-plugin-limits" + +RCONFLICTS_${PN} = "atd" +RREPLACES_${PN} = "atd" + +SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/a/${BPN}/${BPN}_${PV}.orig.tar.gz \ + file://fix_parallel_build_error.patch \ + file://posixtm.c \ + file://posixtm.h \ + file://file_replacement_with_gplv2.patch \ + file://atd.init \ + file://atd.service \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ + file://makefile-fix-parallel.patch \ + file://0001-remove-glibc-assumption.patch \ + " + +PAM_SRC_URI = "file://pam.conf.patch \ + file://configure-add-enable-pam.patch" + +SRC_URI[md5sum] = "e7bd7b785b2cbb17e133d6bdc0fb099e" +SRC_URI[sha256sum] = "0871923cab73050b98ace020664eb2ddc1e669e4166b5abb64d864d02fcefab9" + +UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/at/" + +EXTRA_OECONF += "ac_cv_path_SENDMAIL=/bin/true \ + --with-daemon_username=root \ + --with-daemon_groupname=root \ + --with-jobdir=/var/spool/at/jobs \ + --with-atspool=/var/spool/at/spool \ + ac_cv_header_security_pam_appl_h=${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'yes', 'no', d)} " + +inherit autotools-brokensep systemd update-rc.d + +INITSCRIPT_NAME = "atd" +INITSCRIPT_PARAMS = "defaults" + +SYSTEMD_SERVICE_${PN} = "atd.service" + +copy_sources() { + cp -f ${WORKDIR}/posixtm.[ch] ${S} +} +do_patch[postfuncs] += "copy_sources" + +do_install () { + oe_runmake -e "IROOT=${D}" install + + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/atd.init ${D}${sysconfdir}/init.d/atd + + # install systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/atd.service ${D}${systemd_unitdir}/system + sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/atd.service + + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then + install -D -m 0644 ${WORKDIR}/${BP}/pam.conf ${D}${sysconfdir}/pam.d/atd + fi +} diff --git a/poky/meta/recipes-extended/bash/bash.inc b/poky/meta/recipes-extended/bash/bash.inc new file mode 100644 index 000000000..9c2b065f9 --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash.inc @@ -0,0 +1,92 @@ +SUMMARY = "An sh-compatible command language interpreter" +HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html" +SECTION = "base/shell" + +DEPENDS = "ncurses bison-native virtual/libiconv" + +inherit autotools gettext texinfo update-alternatives ptest + +EXTRA_AUTORECONF += "--exclude=autoheader --exclude=aclocal" +EXTRA_OECONF = "--enable-job-control --without-bash-malloc" + +# If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the +# startup files, even if they are not interactive. +# This is what other major distros do. And this is what we wanted. See bug#5359 and bug#7137. +CFLAGS += "-DNON_INTERACTIVE_LOGIN_SHELLS" + +ALTERNATIVE_${PN} = "bash sh" +ALTERNATIVE_LINK_NAME[bash] = "${base_bindir}/bash" +ALTERNATIVE_TARGET[bash] = "${base_bindir}/bash" +ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh" +ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash.${BPN}" +ALTERNATIVE_PRIORITY = "100" + +RDEPENDS_${PN} += "base-files" +RDEPENDS_${PN}_class-nativesdk = "" +RDEPENDS_${PN}-ptest += "make" + +DEPENDS_append_libc-glibc = " virtual/libc-locale" +RDEPENDS_${PN}-ptest_append_libc-glibc = " locale-base-fr-fr locale-base-de-de" + +USERADD_PACKAGES = "${PN}-ptest" +USERADD_PARAM_${PN}-ptest = "--create-home --user-group test" + +CACHED_CONFIGUREVARS += "headersdir=${includedir}/${PN}" + +do_compile_ptest () { + oe_runmake buildtest +} + +do_install_append () { + # Move /usr/bin/bash to /bin/bash, if need + if [ "${base_bindir}" != "${bindir}" ]; then + mkdir -p ${D}${base_bindir} + mv ${D}${bindir}/bash ${D}${base_bindir} + fi +} +do_install_append_class-target () { + # Clean buildhost references in bashbug + sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \ + -e "s,-I${WORKDIR}/\S* ,,g" \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + ${D}${bindir}/bashbug + + # Clean buildhost references in bash.pc + sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \ + ${D}${libdir}/pkgconfig/bash.pc + + # Clean buildhost references in Makefile.inc + sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e 's:${HOSTTOOLS_DIR}/::g' \ + -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ + ${D}${libdir}/bash/Makefile.inc +} + +do_install_ptest () { + make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test + cp ${B}/Makefile ${D}${PTEST_PATH} + sed -i -e 's/^Makefile/_Makefile/' -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e "s,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,g" \ + -e 's:${HOSTTOOLS_DIR}/::g' \ + ${D}${PTEST_PATH}/Makefile +} + +pkg_postinst_${PN} () { + grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells +} + +pkg_postrm_${PN} () { + printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells +} + +PACKAGES += "${PN}-bashbug" +FILES_${PN} = "${bindir}/bash ${base_bindir}/bash.bash" +FILES_${PN}-bashbug = "${bindir}/bashbug" + +PACKAGE_BEFORE_PN += "${PN}-loadable" +RDEPENDS_${PN}-loadable += "${PN}" +FILES_${PN}-loadable += "${libdir}/bash/*" + +RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/bash', '', d)}" diff --git a/poky/meta/recipes-extended/bash/bash/0001-help-fix-printf-format-security-warning.patch b/poky/meta/recipes-extended/bash/bash/0001-help-fix-printf-format-security-warning.patch new file mode 100644 index 000000000..5405c84c7 --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash/0001-help-fix-printf-format-security-warning.patch @@ -0,0 +1,35 @@ +From e5837a42f8f48a6a721805ff8f7fcd32861d09ca Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com> +Date: Tue, 26 Jul 2016 13:09:47 +0100 +Subject: [PATCH] help: fix printf() format security warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +| ../../bash-4.3.30/builtins/../../bash-4.3.30/builtins/help.def: In function 'help_builtin': +| ../../bash-4.3.30/builtins/../../bash-4.3.30/builtins/help.def:130:7: error: format not a string literal and no format arguments [-Werror=format-security] +| printf (ngettext ("Shell commands matching keyword `", "Shell commands matching keywords `", (list->next ? 2 : 1))); +| ^~~~~~ + +Signed-off-by: André Draszik <adraszik@tycoint.com> +--- +Upstream-Status: Pending + builtins/help.def | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/builtins/help.def b/builtins/help.def +index 1894f17..cf624c6 100644 +--- a/builtins/help.def ++++ b/builtins/help.def +@@ -127,7 +127,7 @@ help_builtin (list) + + if (glob_pattern_p (list->word->word)) + { +- printf (ngettext ("Shell commands matching keyword `", "Shell commands matching keywords `", (list->next ? 2 : 1))); ++ printf ("%s", ngettext ("Shell commands matching keyword `", "Shell commands matching keywords `", (list->next ? 2 : 1))); + print_word_list (list, ", "); + printf ("'\n\n"); + } +-- +2.8.1 + diff --git a/poky/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch b/poky/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch new file mode 100644 index 000000000..9fb6ba972 --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch @@ -0,0 +1,35 @@ +From d3b6303a6853f612a56848ee4e59eaa0b0ab9489 Mon Sep 17 00:00:00 2001 +From: Zhang Xiao <xiao.zhang@windriver.com> +Date: Tue, 21 Feb 2017 11:30:14 +0800 +Subject: [PATCH] bash: memleak bug fix for builtin command read + +Built in command "read" with "-e" use Readline to obtain the line +in an interactive shell. In this process, a string "rlbuf" is +just allocated without free operation thus cause memory leak. Fix it. + +Upstream-Status: Submitted [http://lists.gnu.org/archive/html/bug-bash/2017-02/msg00061.html] + +Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com> +--- + builtins/read.def | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/builtins/read.def b/builtins/read.def +index 4397154..ee0c5a6 100644 +--- a/builtins/read.def ++++ b/builtins/read.def +@@ -674,6 +674,11 @@ add_char: + input_string[i] = '\0'; + CHECK_ALRM; + ++#if defined (READLINE) ++ if (edit) ++ xfree (rlbuf); ++#endif ++ + if (retval < 0) + { + t_errno = errno; +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/bash/bash/build-tests.patch b/poky/meta/recipes-extended/bash/bash/build-tests.patch new file mode 100644 index 000000000..73a81b60d --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash/build-tests.patch @@ -0,0 +1,55 @@ +Add 'ptest' target to Makefile, to run tests without checking dependencies. + +Upstream-Status: Pending +Signed-off-by: Anders Roxell <anders.roxell@enea.com> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + Makefile.in | 24 +++++++++++++++++++----- + 1 file changed, 19 insertions(+), 5 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +--- a/Makefile.in ++++ b/Makefile.in +@@ -848,20 +848,34 @@ maybe-clean: + fi + + recho$(EXEEXT): $(SUPPORT_SRC)recho.c +- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD} ++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $< + + zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c +- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD} ++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $< + + printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c +- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD} ++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $< + + xcase$(EXEEXT): $(SUPPORT_SRC)xcase.c +- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD} ++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $< + +-test tests check: force $(Program) $(TESTS_SUPPORT) ++test tests check: ++ @$(MAKE) install-test ++ @$(MAKE) runtest ++ ++install-test: buildtest ++ifeq ($(origin INSTALL_TEST_DIR), undefined) + @-test -d tests || mkdir tests + @cp $(TESTS_SUPPORT) tests ++else ++ @-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR) ++ @cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/ ++ @cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR) ++endif ++ ++buildtest: force $(Program) $(TESTS_SUPPORT) ++ ++runtest: + @( cd $(srcdir)/tests && \ + PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} ) + +-- +1.8.1.2 + diff --git a/poky/meta/recipes-extended/bash/bash/execute_cmd.patch b/poky/meta/recipes-extended/bash/bash/execute_cmd.patch new file mode 100644 index 000000000..9970b4d8f --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash/execute_cmd.patch @@ -0,0 +1,19 @@ +Upstream-Status: Inappropriate [embedded specific] + +Index: execute_cmd.c +=================================================================== +--- execute_cmd.c.orig ++++ execute_cmd.c +@@ -2459,7 +2459,11 @@ execute_pipeline (command, asynchronous, + /* If the `lastpipe' option is set with shopt, and job control is not + enabled, execute the last element of non-async pipelines in the + current shell environment. */ +- if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0) ++ if (lastpipe_opt && ++#if defined(JOB_CONTROL) ++ job_control == 0 && ++#endif ++ asynchronous == 0 && pipe_out == NO_PIPE && prev > 0) + { + lstdin = move_to_high_fd (0, 1, -1); + if (lstdin > 0) diff --git a/poky/meta/recipes-extended/bash/bash/fix-run-builtins.patch b/poky/meta/recipes-extended/bash/bash/fix-run-builtins.patch new file mode 100644 index 000000000..2fa388302 --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash/fix-run-builtins.patch @@ -0,0 +1,33 @@ +From 0c4cab9594c96c2dc435a8d9724605824bcbf917 Mon Sep 17 00:00:00 2001 +From: Dengke Du <dengke.du@windriver.com> +Date: Tue, 19 Apr 2016 02:57:45 -0400 +Subject: [PATCH] fix run-builtins failed + +FAIL: run-builtins +1. redirect the stderr output of command exec with -l option in + builtins.tests to /dev/null +2. ensure the system contain the locales "en_US.UTF-8" + +Upstream-Status: Pending + +Signed-off-by: Dengke Du <dengke.du@windriver.com> +--- + tests/builtins.tests | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/builtins.tests b/tests/builtins.tests +index 9d77520..63f3af8 100644 +--- a/tests/builtins.tests ++++ b/tests/builtins.tests +@@ -109,7 +109,7 @@ esac + + # test options to exec + (exec -a specialname ${THIS_SH} -c 'echo $0' ) +-(exec -l -a specialname ${THIS_SH} -c 'echo $0' ) ++(exec -l -a specialname ${THIS_SH} -c 'echo $0' ) 2> /dev/null + # test `clean' environment. if /bin/sh is bash, and the script version of + # printenv is run, there will be variables in the environment that bash + # sets on startup. Also test code that prefixes argv[0] with a dash. +-- +2.8.1 + diff --git a/poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch b/poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch new file mode 100644 index 000000000..9ac2461ab --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch @@ -0,0 +1,45 @@ +From d1cd4c31ea0ed7406a3ad4bdaa211f581063f655 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Tue, 15 Aug 2017 10:21:21 +0800 +Subject: [PATCH 2/2] fix run-execscript/run-test/ failed + +FAIL: run-execscript: +the test suite should not be run as root + +FAIL: run-test +the test suite should not be run as root + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + tests/run-execscript | 3 ++- + tests/run-test | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/tests/run-execscript b/tests/run-execscript +index de78644..38397c1 100644 +--- a/tests/run-execscript ++++ b/tests/run-execscript +@@ -5,5 +5,6 @@ echo "warning: \`/tmp/bash-notthere' not being found or \`/' being a directory" + echo "warning: produce diff output, please do not consider this a test failure" >&2 + echo "warning: if diff output differing only in the location of the bash" >&2 + echo "warning: binary appears, please do not consider this a test failure" >&2 +-${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1 ++rm -f ${BASH_TSTOUT} ++su -c "${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1" test + diff ${BASH_TSTOUT} exec.right && rm -f ${BASH_TSTOUT} +diff --git a/tests/run-test b/tests/run-test +index d68791c..d6317d2 100644 +--- a/tests/run-test ++++ b/tests/run-test +@@ -1,4 +1,5 @@ + unset GROUPS UID 2>/dev/null + +-${THIS_SH} ./test.tests >${BASH_TSTOUT} 2>&1 ++rm -f ${BASH_TSTOUT} ++su -c "${THIS_SH} ./test.tests > ${BASH_TSTOUT} 2>&1" test + diff ${BASH_TSTOUT} test.right && rm -f ${BASH_TSTOUT} +-- +1.8.3.1 + diff --git a/poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch b/poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch new file mode 100644 index 000000000..a9391d6ca --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch @@ -0,0 +1,26 @@ +On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by +the macros to wrap functions (e.g. read and open in unistd.h). Those wrappers +use the STRING() macro from unistd.h. A header in the bash sources overrides +the unistd.h macro to 'x' when HAVE_STRINGIZE is not defined, causing the +wrappers to generate calls to 'xread' and 'xopen', which do not exist, +resulting in a failure to link. + +Assume we have stringize support when cross-compiling, which works around the +issue. + +It may be best for upstream to either give up on supporting compilers without +stringize support, or to not define STRING() at all when FORTIFY_SOURCES is +defined, letting the unistd.h one be used, instead. + +Upstream-Status: Pending + +--- bash-4.2.orig/builtins/mkbuiltins.c ++++ bash-4.2/builtins/mkbuiltins.c +@@ -28,6 +28,7 @@ + # define HAVE_STDLIB_H + + # define HAVE_RENAME ++# define HAVE_STRINGIZE + #endif /* CROSS_COMPILING */ + + #if defined (HAVE_UNISTD_H) diff --git a/poky/meta/recipes-extended/bash/bash/pathexp-dep.patch b/poky/meta/recipes-extended/bash/bash/pathexp-dep.patch new file mode 100644 index 000000000..e05bbda31 --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash/pathexp-dep.patch @@ -0,0 +1,13 @@ +pathexp includes libintl.h but doesn't depend on it, thus a build race can occur. + +Upstream-Status: Submitted (https://savannah.gnu.org/patch/index.php?9503) +Signed-off-by: Ross Burton <ross.burton@intel.com> + +diff --git a/Makefile.in b/Makefile.in +index c7b62bc0..241cbf12 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -1281,2 +1281,3 @@ nojobs.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h + y.tab.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h ++pathexp.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h + pcomplete.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h diff --git a/poky/meta/recipes-extended/bash/bash/run-ptest b/poky/meta/recipes-extended/bash/bash/run-ptest new file mode 100644 index 000000000..c61fabd02 --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash/run-ptest @@ -0,0 +1,22 @@ +#!/bin/sh + +en_US=`locale -a | grep en_US*` +fr_FR=`locale -a | grep fr_FR*` +de_DE=`locale -a | grep de_DE*` + +if [ -z "$en_US" ] +then + echo "Warning: The en_US* locales is needed to run the intl.tests, please add it." +fi + +if [ -z "$fr_FR" ] +then + echo "Warning: The fr_FR* locales is needed to run the intl.tests, please add it." +fi + +if [ -z "$de_DE" ] +then + echo "Warning: The de_DE* locales is needed to run the intl.tests, please add it." +fi + +make -k THIS_SH=/bin/bash BUILD_DIR=`pwd` srcdir=`pwd` runtest diff --git a/poky/meta/recipes-extended/bash/bash/test-output.patch b/poky/meta/recipes-extended/bash/bash/test-output.patch new file mode 100644 index 000000000..0ffcc2458 --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash/test-output.patch @@ -0,0 +1,42 @@ +From 28eb06047ebd2deaa8c7cd2bf6655ef6a469dc14 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Tue, 15 Aug 2017 10:01:56 +0800 +Subject: [PATCH 1/2] Add FAIL/PASS output to test output. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Björn Stenberg <bjst@enea.com> +Upstream-Status: Pending + +Rebase to 4.4 +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + tests/run-all | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/tests/run-all b/tests/run-all +index 2882fe0..e21d026 100644 +--- a/tests/run-all ++++ b/tests/run-all +@@ -33,7 +33,16 @@ do + case $x in + $0|run-minimal|run-gprof) ;; + *.orig|*~) ;; +- *) echo $x ; sh $x ; rm -f ${BASH_TSTOUT} ;; ++ *) echo $x ++ output=`sh $x` ++ if [ -n "$output" ]; then ++ echo "$output" ++ echo "FAIL: $x" ++ else ++ echo "PASS: $x" ++ fi ++ rm -f ${BASH_TSTOUT} ++ ;; + esac + done + +-- +1.8.3.1 + diff --git a/poky/meta/recipes-extended/bash/bash_4.4.12.bb b/poky/meta/recipes-extended/bash/bash_4.4.12.bb new file mode 100644 index 000000000..9382a77af --- /dev/null +++ b/poky/meta/recipes-extended/bash/bash_4.4.12.bb @@ -0,0 +1,24 @@ +require bash.inc + +# GPLv2+ (< 4.0), GPLv3+ (>= 4.0) +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \ + file://execute_cmd.patch;striplevel=0 \ + file://mkbuiltins_have_stringize.patch \ + file://build-tests.patch \ + file://test-output.patch \ + file://fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch \ + file://run-ptest \ + file://fix-run-builtins.patch \ + file://0001-help-fix-printf-format-security-warning.patch \ + file://bash-memleak-bug-fix-for-builtin-command-read.patch \ + file://pathexp-dep.patch \ + " + +SRC_URI[tarball.md5sum] = "7c112970cbdcadfc331e10eeb5f6aa41" +SRC_URI[tarball.sha256sum] = "57d8432be54541531a496fd4904fdc08c12542f43605a9202594fa5d5f9f2331" + + +BBCLASSEXTEND = "nativesdk" diff --git a/poky/meta/recipes-extended/bc/bc_1.06.bb b/poky/meta/recipes-extended/bc/bc_1.06.bb new file mode 100644 index 000000000..d8c8a860f --- /dev/null +++ b/poky/meta/recipes-extended/bc/bc_1.06.bb @@ -0,0 +1,26 @@ +SUMMARY = "Arbitrary precision calculator language" +HOMEPAGE = "http://www.gnu.org/software/bc/bc.html" + +LICENSE = "GPLv2+ & LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://COPYING.LIB;md5=d8045f3b8f929c1cb29a1e3fd737b499 \ + file://bc/bcdefs.h;endline=31;md5=46dffdaf10a99728dd8ce358e45d46d8 \ + file://dc/dc.h;endline=25;md5=2f9c558cdd80e31b4d904e48c2374328 \ + file://lib/number.c;endline=31;md5=99434a0898abca7784acfd36b8191199" + +SECTION = "base" +DEPENDS = "flex" +PR = "r3" + +SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz \ + file://fix-segment-fault.patch " + +SRC_URI[md5sum] = "d44b5dddebd8a7a7309aea6c36fda117" +SRC_URI[sha256sum] = "4ef6d9f17c3c0d92d8798e35666175ecd3d8efac4009d6457b5c99cea72c0e33" + +inherit autotools texinfo update-alternatives + +ALTERNATIVE_${PN} = "dc" +ALTERNATIVE_PRIORITY = "100" + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/bc/files/fix-segment-fault.patch b/poky/meta/recipes-extended/bc/files/fix-segment-fault.patch new file mode 100644 index 000000000..20c0da2eb --- /dev/null +++ b/poky/meta/recipes-extended/bc/files/fix-segment-fault.patch @@ -0,0 +1,28 @@ +Upstream-Status: Pending + +when run command such as 'echo "a = 13" | bc -l', it segmentation faults. +This patch is from http://www.mail-archive.com/blfs-support@linuxfromscratch.org/msg04602.html. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> + +--- bc-1.06/lib/number.c.orig 2003-09-26 21:14:02.000000000 +0000 ++++ bc-1.06/lib/number.c 2003-09-26 21:14:26.000000000 +0000 +@@ -34,6 +34,7 @@ + #include <number.h> + #include <assert.h> + #include <stdlib.h> ++#include <string.h> + #include <ctype.h>/* Prototypes needed for external utility routines. */ + + #define bc_rt_warn rt_warn +--- bc-1.06/bc/load.c.orig 2003-09-26 21:14:14.000000000 +0000 ++++ bc-1.06/bc/load.c 2003-09-26 21:14:26.000000000 +0000 +@@ -156,7 +156,7 @@ + long label_no; + long vaf_name; /* variable, array or function number. */ + long func; +- program_counter save_adr; ++ static program_counter save_adr; + + /* Initialize. */ + str = code; diff --git a/poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch b/poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch new file mode 100644 index 000000000..fee368dac --- /dev/null +++ b/poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch @@ -0,0 +1,40 @@ +From 9cb1667f9d3a9bcfc3b83466cd8d3b79f0554ff0 Mon Sep 17 00:00:00 2001 +From: Azat Khuzhin <a3at.mail@gmail.com> +Date: Wed, 8 Jul 2015 01:37:09 +0300 +Subject: [PATCH 1/3] fix typos in manpage + +This patch is taken from +ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz + +Upstream-Status: Inappropriate [upstream is dead] +Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> + +--- + blktool.8 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/blktool.8 b/blktool.8 +index a1f5c96..45b7724 100644 +--- a/blktool.8 ++++ b/blktool.8 +@@ -191,7 +191,7 @@ Query or set device bus state (0 off, 1 on, 2 tristate) + Query the detected (or overridden, via -t) device class. + Typically this will result in 'ATA' or 'SCSI' for most devices. + Detection is based on device major; thus your SATA device may appear as +-'SCSI'. ++\&'SCSI'. + + .TP + .B cd-speed +@@ -237,7 +237,7 @@ Omitting the on/off argument will print the current state. + + .TP + .B media +-Lock in (or unlock) a removeable device. ++Lock in (or unlock) a removable device. + + .TP + .B multiple-count +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch b/poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch new file mode 100644 index 000000000..d08aba5f0 --- /dev/null +++ b/poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch @@ -0,0 +1,31 @@ +From ddb1071da2c78d8155aab62e9f0d46f69500200f Mon Sep 17 00:00:00 2001 +From: Azat Khuzhin <a3at.mail@gmail.com> +Date: Wed, 8 Jul 2015 01:42:24 +0300 +Subject: [PATCH 2/3] fix string error + +This patch is taken from +ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz + +Upstream-Status: Inappropriate [upstream is dead] +Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> + +--- + util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util.c b/util.c +index 1f3a9ca..2ccf56a 100644 +--- a/util.c ++++ b/util.c +@@ -28,7 +28,7 @@ void pdie(const char *msg, int perr) + if (perr) + perror(msg); + else +- fprintf(stderr, msg); ++ fprintf(stderr, "%s", msg); + if (blkdev >= 0) + close(blkdev); + exit(1); +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch b/poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch new file mode 100644 index 000000000..d7ed0b9f4 --- /dev/null +++ b/poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch @@ -0,0 +1,78 @@ +From 68faa63aaad81f4a289e4a03173ab4cf798deb53 Mon Sep 17 00:00:00 2001 +From: Azat Khuzhin <a3at.mail@gmail.com> +Date: Sat, 1 Nov 2014 22:24:32 +0300 +Subject: [PATCH 3/3] Fix 3-d argument for BLKROSET it must be 'const int *' + +Most of *SET ioctls have int type for 3-d argument, except BLKROSET. +So add bc_arg_type enum, build it into bool_comand and install arg_type +to bc_arg_int_ptr for BLKROSET only. + +Debian-bug-id: 641164 +Link: https://bugs.debian.org/641164 + +This patch is taken from +ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz + +Upstream-Status: Inappropriate [upstream is dead] +Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> + +--- + blktool.c | 11 +++++++++-- + blktool.h | 7 +++++++ + 2 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/blktool.c b/blktool.c +index fbefecd..221a195 100644 +--- a/blktool.c ++++ b/blktool.c +@@ -85,7 +85,7 @@ static struct bool_command bool_cmd_tbl[] = { + { { DEF_BOOL("pio-data"), dc_ata, DEF_HDIO(32BIT) }, + "16-bit", "32-bit" }, + { { DEF_BOOL("readonly"), dc_any, IOCNAME(BLKROGET), IOCNAME(BLKROSET) }, +- DEF_BOOLSTR }, ++ DEF_BOOLSTR, bc_arg_int_ptr }, + { { DEF_BOOL("unmask-irq"), dc_ata, DEF_HDIO(UNMASKINTR) }, + DEF_BOOLSTR }, + { { "wcache", ct_bool, handle_wcache, dc_any, +@@ -171,7 +171,14 @@ static void handle_bool(int argc, char **argv, struct command *cmd) + + } else if ((argc == 4) && (cmd->write_ioctl_name != NULL)) { + do_32 = parse_bool(argc, argv, bcm); +- if (ioctl(blkdev, cmd->write_ioctl, do_32)) ++ ++ int ret; ++ if (bcm->arg_type == bc_arg_int_ptr) { ++ ret = ioctl(blkdev, cmd->write_ioctl, &do_32); ++ } else { ++ ret = ioctl(blkdev, cmd->write_ioctl, do_32); ++ } ++ if (ret) + pdie(cmd->write_ioctl_name, 1); + } + else { +diff --git a/blktool.h b/blktool.h +index fce4387..85add83 100644 +--- a/blktool.h ++++ b/blktool.h +@@ -85,11 +85,18 @@ struct command { + const char *write_ioctl_name; + }; + ++enum bc_arg_type { ++ bc_arg_int, ++ bc_arg_int_ptr, ++}; ++ + struct bool_command { + struct command cmd; + + const char *str_false; + const char *str_true; ++ ++ enum bc_arg_type arg_type; + }; + + struct class_operations { +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/blktool/blktool_4-7.bb b/poky/meta/recipes-extended/blktool/blktool_4-7.bb new file mode 100644 index 000000000..4551c3233 --- /dev/null +++ b/poky/meta/recipes-extended/blktool/blktool_4-7.bb @@ -0,0 +1,28 @@ +SUMMARY = "Tune low-level block device parameters" +DESCRIPTION = "blktool is used for querying and/or changing settings \ +of a block device. It is like hdparm but a more general tool, as it \ +works on SCSI, IDE and SATA devices." +HOMEPAGE = "http://packages.debian.org/unstable/admin/blktool" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://blktool.c;beginline=7;endline=8;md5=a5e798ea98fd50972088968a15e5f373" + +DEPENDS = "glib-2.0" + +SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/b/${BPN}/${BPN}_4.orig.tar.gz;name=tarball \ + file://0001-fix-typos-in-manpage.patch \ + file://0002-fix-string-error.patch \ + file://0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch \ + " + +SRC_URI[tarball.md5sum] = "62edc09c9908107e69391c87f4f3fd40" +SRC_URI[tarball.sha256sum] = "b1e6d5912546d2a4b704ec65c2b9664aa3b4663e7d800e06803330335a2cb764" + +# for this package we're mostly interested in tracking debian patches, +# and not in the upstream version where all development has effectively stopped +UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/b/blktool/" +UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)" + +S = "${WORKDIR}/${BPN}-4.orig" + +inherit autotools pkgconfig diff --git a/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/CVE-2016-3189.patch b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/CVE-2016-3189.patch new file mode 100644 index 000000000..1d0c3a6dd --- /dev/null +++ b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/CVE-2016-3189.patch @@ -0,0 +1,18 @@ +Upstream-Status: Backport +https://bugzilla.suse.com/attachment.cgi?id=681334 + +CVE: CVE-2016-3189 +Signed-off-by: Armin Kuster <akuster@mvista.com> + +Index: bzip2-1.0.6/bzip2recover.c +=================================================================== +--- bzip2-1.0.6.orig/bzip2recover.c ++++ bzip2-1.0.6/bzip2recover.c +@@ -457,6 +457,7 @@ Int32 main ( Int32 argc, Char** argv ) + bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 ); + bsPutUInt32 ( bsWr, blockCRC ); + bsClose ( bsWr ); ++ outFile = NULL; + } + if (wrBlock >= rbCtr) break; + wrBlock++; diff --git a/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am new file mode 100644 index 000000000..dcf64584d --- /dev/null +++ b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am @@ -0,0 +1,73 @@ + +lib_LTLIBRARIES = libbz2.la +libbz2_la_LDFLAGS = -version-info 1:6:0 + +libbz2_la_SOURCES = blocksort.c \ + huffman.c \ + crctable.c \ + randtable.c \ + compress.c \ + decompress.c \ + bzlib.c + +bin_PROGRAMS = bzip2 bzip2recover + +bzip2_SOURCES = bzip2.c +bzip2_LDADD = libbz2.la +bzip2_DEPENDENCIES = libbz2.la + +include_HEADERS = bzlib.h + +bzip2recover_SOURCES = bzip2recover.c +bzip2recover_LDADD = libbz2.la +bzip2recover_DEPENDENCIES = libbz2.la + +bin_SCRIPTS = bzgrep bzmore bzdiff + +man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1 +EXTRA_DIST = $(man_MANS) + +runtest: + ./bzip2 -1 < sample1.ref > sample1.rb2 + ./bzip2 -2 < sample2.ref > sample2.rb2 + ./bzip2 -3 < sample3.ref > sample3.rb2 + ./bzip2 -d < sample1.bz2 > sample1.tst + ./bzip2 -d < sample2.bz2 > sample2.tst + ./bzip2 -ds < sample3.bz2 > sample3.tst + @if cmp sample1.bz2 sample1.rb2; then echo "PASS: sample1 compress";\ + else echo "FAIL: sample1 compress"; fi + @if cmp sample2.bz2 sample2.rb2; then echo "PASS: sample2 compress";\ + else echo "FAIL: sample2 compress"; fi + @if cmp sample3.bz2 sample3.rb2; then echo "PASS: sample3 compress";\ + else echo "FAIL: sample3 compress"; fi + @if cmp sample1.tst sample1.ref; then echo "PASS: sample1 decompress";\ + else echo "FAIL: sample1 decompress"; fi + @if cmp sample2.tst sample2.ref; then echo "PASS: sample2 decompress";\ + else echo "FAIL: sample2 decompress"; fi + @if cmp sample3.tst sample3.ref; then echo "PASS: sample3 decompress";\ + else echo "FAIL: sample3 decompress"; fi + +install-ptest: + sed -n '/^runtest:/,/^install-ptest:/{/^install-ptest:/!p}' \ + $(srcdir)/Makefile.am > $(DESTDIR)/Makefile + cp $(srcdir)/sample1.ref $(DESTDIR)/ + cp $(srcdir)/sample2.ref $(DESTDIR)/ + cp $(srcdir)/sample3.ref $(DESTDIR)/ + cp $(srcdir)/sample1.bz2 $(DESTDIR)/ + cp $(srcdir)/sample2.bz2 $(DESTDIR)/ + cp $(srcdir)/sample3.bz2 $(DESTDIR)/ + ln -s $(bindir)/bzip2 $(DESTDIR)/bzip2 + +install-exec-hook: + ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bunzip2$(EXEEXT) + ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bzcat$(EXEEXT) + ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzegrep$(EXEEXT) + ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzfgrep$(EXEEXT) + ln -s $(bindir)/bzmore$(EXEEXT) $(DESTDIR)$(bindir)/bzless$(EXEEXT) + ln -s $(bindir)/bzdiff$(EXEEXT) $(DESTDIR)$(bindir)/bzcmp$(EXEEXT) + +install-data-hook: + echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzegrep.1 + echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1 + echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1 + echo ".so man1/bzdiff.1" > $(DESTDIR)$(mandir)/man1/bzcmp.1 diff --git a/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac new file mode 100644 index 000000000..e2bf1bf11 --- /dev/null +++ b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac @@ -0,0 +1,11 @@ +AC_PREREQ([2.57]) + +AC_INIT(bzip2, 1.0.6) +AM_INIT_AUTOMAKE(foreign) +AM_MAINTAINER_MODE + +AC_PROG_CC +AC_PROG_LIBTOOL + +AC_OUTPUT([Makefile]) + diff --git a/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch new file mode 100644 index 000000000..ece90d94e --- /dev/null +++ b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch @@ -0,0 +1,55 @@ +From 8068659388127e8e63f2d2297ba2348c72b20705 Mon Sep 17 00:00:00 2001 +From: Wenzong Fan <wenzong.fan@windriver.com> +Date: Mon, 12 Oct 2015 03:19:51 -0400 +Subject: [PATCH] bzip2: fix bunzip2 -qt returns 0 for corrupt archives + +"bzip2 -t FILE" returns 2 if FILE exists, but is not a valid bzip2 file. +"bzip2 -qt FILE" returns 0 when this happens, although it does print out +an error message as is does so. + +This has been fix by Debian, just port changes from Debian patch file +"20-legacy.patch". + +Debian defect: +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=279025 + +Fix item from changelog: +http://archive.debian.net/changelogs/pool/main/b/bzip2/bzip2_1.0.2-7/changelog + + * Fixed "bunzip2 -qt returns 0 for corrupt archives" (Closes: #279025). + +Upstream-Status: Pending + +Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> +--- + bzip2.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/bzip2.c b/bzip2.c +index 6de9d1d..f2ce668 100644 +--- a/bzip2.c ++++ b/bzip2.c +@@ -2003,12 +2003,14 @@ IntNative main ( IntNative argc, Char *argv[] ) + testf ( aa->name ); + } + } +- if (testFailsExist && noisy) { +- fprintf ( stderr, +- "\n" +- "You can use the `bzip2recover' program to attempt to recover\n" +- "data from undamaged sections of corrupted files.\n\n" +- ); ++ if (testFailsExist) { ++ if (noisy) { ++ fprintf ( stderr, ++ "\n" ++ "You can use the `bzip2recover' program to attempt to recover\n" ++ "data from undamaged sections of corrupted files.\n\n" ++ ); ++ } + setExit(2); + exit(exitValue); + } +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest new file mode 100644 index 000000000..3b20fce1e --- /dev/null +++ b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest @@ -0,0 +1,2 @@ +#!/bin/sh +make -k runtest diff --git a/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb b/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb new file mode 100644 index 000000000..de668d6d2 --- /dev/null +++ b/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb @@ -0,0 +1,44 @@ +SUMMARY = "Very high-quality data compression program" +DESCRIPTION = "bzip2 compresses files using the Burrows-Wheeler block-sorting text compression algorithm, and \ +Huffman coding. Compression is generally considerably better than that achieved by more conventional \ +LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors." +HOMEPAGE = "http://www.bzip.org/" +SECTION = "console/utils" +LICENSE = "bzip2" +LIC_FILES_CHKSUM = "file://LICENSE;beginline=8;endline=37;md5=40d9d1eb05736d1bfc86cfdd9106e6b2" +PR = "r5" + +SRC_URI = "http://www.bzip.org/${PV}/${BP}.tar.gz \ + file://fix-bunzip2-qt-returns-0-for-corrupt-archives.patch \ + file://configure.ac;subdir=${BP} \ + file://Makefile.am;subdir=${BP} \ + file://run-ptest \ + file://CVE-2016-3189.patch \ + " + +SRC_URI[md5sum] = "00b516f4704d4a7cb50a1d97e6e8e15b" +SRC_URI[sha256sum] = "a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd" + +UPSTREAM_CHECK_URI = "http://www.bzip.org/downloads.html" + +PACKAGES =+ "libbz2" + +CFLAGS_append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=64" + +inherit autotools update-alternatives ptest relative_symlinks + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN} = "bunzip2 bzcat" + +#install binaries to bzip2-native under sysroot for replacement-native +EXTRA_OECONF_append_class-native = " --bindir=${STAGING_BINDIR_NATIVE}/${PN}" + +do_install_ptest () { + sed -i -e "s|^Makefile:|_Makefile:|" ${D}${PTEST_PATH}/Makefile +} + +FILES_libbz2 = "${libdir}/lib*${SOLIBS}" + +PROVIDES_append_class-native = " bzip2-replacement-native" +BBCLASSEXTEND = "native nativesdk" + diff --git a/poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb b/poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb new file mode 100644 index 000000000..87fa8eb60 --- /dev/null +++ b/poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb @@ -0,0 +1,44 @@ +require recipes-extended/chkconfig/chkconfig_1.3.58.bb + +SUMMARY = "${SUMMARY_chkconfig-alternatives}" +DESCRIPTION = "${DESCRIPTION_chkconfig-alternatives}" +DEPENDS = "" +PROVIDES += "virtual/update-alternatives-native" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +# The sysroot branch is 1.3.59 + some git commits from master + --sysroot +# support for alternatives. +SRC_URI = "git://github.com/kergoth/chkconfig;branch=sysroot" +S = "${WORKDIR}/git" +UPSTREAM_CHECK_GITTAGREGEX = "chkconfig-(?P<pver>(\d+(\.\d+)+))" + +SRCREV = "cd437ecbd8986c894442f8fce1e0061e20f04dee" +PV = "1.3.59+${SRCPV}" + +inherit native + +# We want our native recipes to build using the target paths rather than paths +# into the sysroot, as we may use them to construct the rootfs. As such, we +# only adjust the paths to match the metadata for the target, not native. +obey_variables () { + sed -i 's,ALTERNATIVES_ROOT,OPKG_OFFLINE_ROOT,' ${S}/alternatives.c +} + +do_compile () { + oe_runmake alternatives +} + +do_install () { + install -d ${D}${sysconfdir}/alternatives \ + ${D}${localstatedir}/lib/alternatives + + install -D -m 0755 alternatives ${D}${bindir}/alternatives + install -D -m 0644 alternatives.8 ${D}${mandir}/man8/alternatives.8 + + ln -s alternatives ${D}${bindir}/update-alternatives + ln -s alternatives.8 ${D}${mandir}/man8/update-alternatives.8 +} + +do_install_append_linuxstdbase() { + rm -rf ${D}${libdir}/lsb +} diff --git a/poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch b/poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch new file mode 100644 index 000000000..96d193879 --- /dev/null +++ b/poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch @@ -0,0 +1,33 @@ +caddr_t is a legacy BSD type which was rejected by the POSIX standard. +Use void * instead. + +sys/unitstd.h is not needed and moreover its not available on all C library +implementations e.g. musl + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Index: chkconfig-1.3.58/alternatives.c +=================================================================== +--- chkconfig-1.3.58.orig/alternatives.c ++++ chkconfig-1.3.58/alternatives.c +@@ -22,7 +22,6 @@ + #include <stdio.h> + #include <string.h> + #include <sys/stat.h> +-#include <sys/unistd.h> + #include <unistd.h> + + #define FLAGS_TEST (1 << 0) +Index: chkconfig-1.3.58/leveldb.c +=================================================================== +--- chkconfig-1.3.58.orig/leveldb.c ++++ chkconfig-1.3.58/leveldb.c +@@ -442,7 +442,7 @@ int parseServiceInfo(int fd, char * name + fstat(fd, &sb); + + bufstart = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0); +- if (bufstart == ((caddr_t) -1)) { ++ if (bufstart == ((void*) -1)) { + close(fd); + return -1; + } diff --git a/poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb b/poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb new file mode 100644 index 000000000..2f1f6c026 --- /dev/null +++ b/poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb @@ -0,0 +1,71 @@ +SUMMARY = "A system tool for maintaining the /etc/rc*.d hierarchy" +DESCRIPTION = "Chkconfig is a basic system utility. It updates and queries runlevel \ +information for system services. Chkconfig manipulates the numerous \ +symbolic links in /etc/rc.d, to relieve system administrators of some \ +of the drudgery of manually editing the symbolic links." + +RECIPE_NO_UPDATE_REASON = "Version 1.5 requires selinux" + +HOMEPAGE = "https://github.com/fedora-sysv" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018" + +DEPENDS = "libnewt popt" +PROVIDES += "virtual/update-alternatives" + +PR = "r7" + +S = "${WORKDIR}/${BPN}-${BPN}-${PV}" + +UPSTREAM_CHECK_URI = "https://github.com/fedora-sysv/${BPN}/releases" + +SRC_URI = "https://github.com/fedora-sysv/chkconfig/archive/chkconfig-${PV}.tar.gz \ + file://replace_caddr_t.patch \ + " + +SRC_URI[md5sum] = "3f51ac38a234be5278b3a2d9705eda5e" +SRC_URI[sha256sum] = "bf1e81f0d7cc999b536c9fe7877abf584a4082fd03c9d2597b6f090966579b40" + +inherit gettext + +# Makefile uses RPM_OPT_FLAGS to construct CFLAGS +# +EXTRA_OEMAKE = "\ + 'RPM_OPT_FLAGS=${CFLAGS}' \ + 'LDFLAGS=${LDFLAGS}' \ + 'BINDIR=${base_sbindir}' \ + 'SBINDIR=${sbindir}' \ + 'MANDIR=${mandir}' \ + 'ALTDIR=${localstatedir}/lib/alternatives' \ + 'ALTDATADIR=${sysconfdir}/alternatives' \ +" + +do_unpack[postfuncs] += "obey_variables" +do_unpack[vardeps] += "obey_variables" +obey_variables () { + sed -i -e 's,/etc,${sysconfdir},; s,/lib/systemd,${base_libdir}/systemd,' ${S}/leveldb.h + sed -i -e 's,/etc/alternatives,${sysconfdir}/alternatives,' \ + -e 's,/var/lib/alternatives,${localstatedir}/lib/alternatives,' \ + -e 's,/usr/share/locale,${datadir}/locale,' ${S}/alternatives.c +} + +do_install() { + oe_runmake 'DESTDIR=${D}' 'INSTALLNLSDIR=${D}${datadir}/locale' \ + 'BINDIR=${sbindir}' install + install -d ${D}${sysconfdir}/chkconfig.d +} + +PACKAGES =+ "${PN}-alternatives ${PN}-alternatives-doc" +SUMMARY_${PN}-alternatives = "Maintain symbolic links determining default commands" +DESCRIPTION_${PN}-alternatives = "alternatives creates, removes, maintains and displays \ +information about the symbolic links comprising the alternatives system." +SUMMARY_${PN}-alternatives-doc = "${SUMMARY_${PN}-alternatives} - Documentation files" +DESCRIPTION_${PN}-alternatives-doc = "${DESCRIPTION_${PN}-alternatives} \ +This package contains documentation." +RPROVIDES_${PN}-alternatives += "update-alternatives" +RCONFLICTS_${PN}-alternatives = "update-alternatives-opkg update-alternatives-dpkg" +FILES_${PN}-alternatives = "${sbindir}/alternatives ${sbindir}/update-alternatives \ + ${sysconfdir}/alternatives ${localstatedir}/lib/alternatives" +FILES_${PN}-alternatives-doc = "${mandir}/man8/alternatives.8 \ + ${mandir}/man8/update-alternatives.8" diff --git a/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch b/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch new file mode 100644 index 000000000..5c999197f --- /dev/null +++ b/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch @@ -0,0 +1,178 @@ +From dcee489f821c1260a0136fcdfdb6ff4dd11086ac Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Wed, 9 Dec 2015 17:58:03 +0200 +Subject: [PATCH] Fix CVE-2015-1197 + +Apply patch by Vitezslav Cizek of SuSE to fix CVE-2015-1197. +Upstream is dormant or no longer existing. To restore the old +behaviour use --extract-over-symlinks (Closes: #774669) +This issue has been discovered by Alexander Cherepanov. +Author: Vitezslav Cizek <vcizek@suse.cz> +Bug-Debian: https://bugs.debian.org/774669 + +Upstream-Status: Pending +CVE: CVE-2015-1197 +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> + +--- + doc/cpio.1 | 1 + + src/copyin.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/extern.h | 1 + + src/global.c | 3 +++ + src/main.c | 7 +++++++ + 5 files changed, 74 insertions(+) + +diff --git a/doc/cpio.1 b/doc/cpio.1 +index 2a68241..dc4676c 100644 +--- a/doc/cpio.1 ++++ b/doc/cpio.1 +@@ -49,6 +49,7 @@ cpio \- copy files to and from archives + [\fB\-\-no\-preserve\-owner\fR] [\fB\-\-message=\fIMESSAGE\fR] + [\fB\-\-force\-local\fR] [\fB\-\-no\-absolute\-filenames\fR] [\fB\-\-sparse\fR] + [\fB\-\-only\-verify\-crc\fR] [\fB\-\-to\-stdout\fR] [\fB\-\-quiet\fR] ++[\fB\-\-extract\-over\-symlinks\fR] + [\fB\-\-rsh\-command=\fICOMMAND\fR] + [\fIpattern\fR...] [\fB<\fR \fIarchive\fR] + +diff --git a/src/copyin.c b/src/copyin.c +index cde911e..053afe7 100644 +--- a/src/copyin.c ++++ b/src/copyin.c +@@ -695,6 +695,51 @@ copyin_link (struct cpio_file_stat *file_hdr, int in_file_des) + free (link_name); + } + ++ ++static int ++path_contains_symlink(char *path) ++{ ++ struct stat st; ++ char *slash; ++ char *nextslash; ++ ++ /* we got NULL pointer or empty string */ ++ if (!path || !*path) { ++ return false; ++ } ++ ++ slash = path; ++ ++ while ((nextslash = strchr(slash + 1, '/')) != NULL) { ++ slash = nextslash; ++ *slash = '\0'; ++ ++ if (lstat(path, &st) != 0) { ++ if (errno == ELOOP) { ++ /* ELOOP - too many symlinks */ ++ *slash = '/'; ++ return true; ++ } else if (errno == ENOMEM) { ++ /* No memory for lstat - terminate */ ++ xalloc_die(); ++ } else { ++ /* cannot lstat path - give up */ ++ *slash = '/'; ++ return false; ++ } ++ } ++ ++ if (S_ISLNK(st.st_mode)) { ++ *slash = '/'; ++ return true; ++ } ++ ++ *slash = '/'; ++ } ++ ++ return false; ++} ++ + static void + copyin_file (struct cpio_file_stat *file_hdr, int in_file_des) + { +@@ -1468,6 +1513,23 @@ process_copy_in () + { + /* Copy the input file into the directory structure. */ + ++ /* Can we write files over symlinks? */ ++ if (!extract_over_symlinks) ++ { ++ if (path_contains_symlink(file_hdr.c_name)) ++ { ++ /* skip the file */ ++ /* ++ fprintf(stderr, "Can't write over symlinks. Skipping %s\n", file_hdr.c_name); ++ tape_toss_input (in_file_des, file_hdr.c_filesize); ++ tape_skip_padding (in_file_des, file_hdr.c_filesize); ++ continue; ++ */ ++ /* terminate */ ++ error (1, 0, _("Can't write over symlinks: %s\n"), file_hdr.c_name); ++ } ++ } ++ + /* Do we need to rename the file? */ + if (rename_flag || rename_batch_file) + { +diff --git a/src/extern.h b/src/extern.h +index e27d662..d864bde 100644 +--- a/src/extern.h ++++ b/src/extern.h +@@ -96,6 +96,7 @@ extern char input_is_special; + extern char output_is_special; + extern char input_is_seekable; + extern char output_is_seekable; ++extern bool extract_over_symlinks; + extern int (*xstat) (); + extern void (*copy_function) (); + extern char *change_directory_option; +diff --git a/src/global.c b/src/global.c +index 57e505a..336fce4 100644 +--- a/src/global.c ++++ b/src/global.c +@@ -187,6 +187,9 @@ bool to_stdout_option = false; + /* The name this program was run with. */ + char *program_name; + ++/* Extract files over symbolic links */ ++bool extract_over_symlinks; ++ + /* A pointer to either lstat or stat, depending on whether + dereferencing of symlinks is done for input files. */ + int (*xstat) (); +diff --git a/src/main.c b/src/main.c +index a13861f..87cb309 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -59,6 +59,7 @@ enum cpio_options { + DEBUG_OPTION, + BLOCK_SIZE_OPTION, + TO_STDOUT_OPTION, ++ EXTRACT_OVER_SYMLINKS, + RENUMBER_INODES_OPTION, + IGNORE_DEVNO_OPTION, + DEVICE_INDEPENDENT_OPTION +@@ -243,6 +244,8 @@ static struct argp_option options[] = { + N_("Create leading directories where needed"), GRID+1 }, + {"no-preserve-owner", NO_PRESERVE_OWNER_OPTION, 0, 0, + N_("Do not change the ownership of the files"), GRID+1 }, ++ {"extract-over-symlinks", EXTRACT_OVER_SYMLINKS, 0, 0, ++ N_("Force writing over symbolic links"), GRID+1 }, + {"unconditional", 'u', NULL, 0, + N_("Replace all files unconditionally"), GRID+1 }, + {"sparse", SPARSE_OPTION, NULL, 0, +@@ -432,6 +435,10 @@ crc newc odc bin ustar tar (all-caps also recognized)"), arg)); + no_chown_flag = true; + break; + ++ case EXTRACT_OVER_SYMLINKS: /* --extract-over-symlinks */ ++ extract_over_symlinks = true; ++ break; ++ + case 'o': /* Copy-out mode. */ + if (copy_function != 0) + USAGE_ERROR ((0, 0, _("Mode already defined"))); +-- +2.6.2 + diff --git a/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch new file mode 100644 index 000000000..6ae213942 --- /dev/null +++ b/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch @@ -0,0 +1,30 @@ +From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Apr 2015 17:02:13 -0700 +Subject: [PATCH] Unset need_charset_alias when building for musl + +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 +which actually shoudl be fixed in gnulib and then all downstream +projects will get it eventually. For now we apply the fix to +coreutils + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/gnulib.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: cpio-2.11/gnu/Makefile.am +=================================================================== +--- cpio-2.11.orig/gnu/Makefile.am ++++ cpio-2.11/gnu/Makefile.am +@@ -734,7 +734,7 @@ install-exec-localcharset: all-local + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ diff --git a/poky/meta/recipes-extended/cpio/cpio_2.12.bb b/poky/meta/recipes-extended/cpio/cpio_2.12.bb new file mode 100644 index 000000000..405a90e03 --- /dev/null +++ b/poky/meta/recipes-extended/cpio/cpio_2.12.bb @@ -0,0 +1,12 @@ +require cpio_v2.inc + +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949" + +SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \ + file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ + file://0001-Fix-CVE-2015-1197.patch \ + " + +SRC_URI[md5sum] = "fc207561a86b63862eea4b8300313e86" +SRC_URI[sha256sum] = "08a35e92deb3c85d269a0059a27d4140a9667a6369459299d08c17f713a92e73" diff --git a/poky/meta/recipes-extended/cpio/cpio_v2.inc b/poky/meta/recipes-extended/cpio/cpio_v2.inc new file mode 100644 index 000000000..31adb717d --- /dev/null +++ b/poky/meta/recipes-extended/cpio/cpio_v2.inc @@ -0,0 +1,43 @@ +SUMMARY = "GNU cpio is a program to manage archives of files" +DESCRIPTION = "GNU cpio is a tool for creating and extracting archives, or copying files from one place to \ +another. It handles a number of cpio formats as well as reading and writing tar files." +HOMEPAGE = "http://www.gnu.org/software/cpio/" +SECTION = "base" + +DEPENDS = "texinfo-native" + +SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \ + " + +inherit autotools gettext texinfo + +S = "${WORKDIR}/cpio-${PV}" + +EXTRA_OECONF += "DEFAULT_RMT_DIR=${base_sbindir}" + +do_install () { + autotools_do_install + if [ "${base_bindir}" != "${bindir}" ]; then + install -d ${D}${base_bindir}/ + mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio" + rmdir ${D}${bindir}/ + fi +} + +PACKAGES =+ "${PN}-rmt" + +FILES_${PN}-rmt = "${base_sbindir}/rmt*" + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_${PN} = "cpio" +ALTERNATIVE_${PN}-rmt = "rmt" + +ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio" + +ALTERNATIVE_PRIORITY[rmt] = "50" +ALTERNATIVE_LINK_NAME[rmt] = "${base_sbindir}/rmt" + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/cracklib/cracklib/0001-Apply-patch-to-fix-CVE-2016-6318.patch b/poky/meta/recipes-extended/cracklib/cracklib/0001-Apply-patch-to-fix-CVE-2016-6318.patch new file mode 100644 index 000000000..b251ac905 --- /dev/null +++ b/poky/meta/recipes-extended/cracklib/cracklib/0001-Apply-patch-to-fix-CVE-2016-6318.patch @@ -0,0 +1,105 @@ +From 47e5dec521ab6243c9b249dd65b93d232d90d6b1 Mon Sep 17 00:00:00 2001 +From: Jan Dittberner <jan@dittberner.info> +Date: Thu, 25 Aug 2016 17:13:49 +0200 +Subject: [PATCH] Apply patch to fix CVE-2016-6318 + +This patch fixes an issue with a stack-based buffer overflow when +parsing large GECOS field. See +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6318 and +https://security-tracker.debian.org/tracker/CVE-2016-6318 for more +information. + +Upstream-Status: Backport [https://github.com/cracklib/cracklib/commit/47e5dec521ab6243c9b249dd65b93d232d90d6b1] +CVE: CVE-2016-6318 +Signed-off-by: Dengke Du <dengke.du@windriver.com> +--- + lib/fascist.c | 57 ++++++++++++++++++++++++++++++++----------------------- + 1 file changed, 33 insertions(+), 24 deletions(-) + +diff --git a/lib/fascist.c b/lib/fascist.c +index a996509..d4deb15 100644 +--- a/lib/fascist.c ++++ b/lib/fascist.c +@@ -502,7 +502,7 @@ FascistGecosUser(char *password, const char *user, const char *gecos) + char gbuffer[STRINGSIZE]; + char tbuffer[STRINGSIZE]; + char *uwords[STRINGSIZE]; +- char longbuffer[STRINGSIZE * 2]; ++ char longbuffer[STRINGSIZE]; + + if (gecos == NULL) + gecos = ""; +@@ -583,38 +583,47 @@ FascistGecosUser(char *password, const char *user, const char *gecos) + { + for (i = 0; i < j; i++) + { +- strcpy(longbuffer, uwords[i]); +- strcat(longbuffer, uwords[j]); +- +- if (GTry(longbuffer, password)) ++ if (strlen(uwords[i]) + strlen(uwords[j]) < STRINGSIZE) + { +- return _("it is derived from your password entry"); +- } ++ strcpy(longbuffer, uwords[i]); ++ strcat(longbuffer, uwords[j]); + +- strcpy(longbuffer, uwords[j]); +- strcat(longbuffer, uwords[i]); ++ if (GTry(longbuffer, password)) ++ { ++ return _("it is derived from your password entry"); ++ } + +- if (GTry(longbuffer, password)) +- { +- return _("it's derived from your password entry"); +- } ++ strcpy(longbuffer, uwords[j]); ++ strcat(longbuffer, uwords[i]); + +- longbuffer[0] = uwords[i][0]; +- longbuffer[1] = '\0'; +- strcat(longbuffer, uwords[j]); ++ if (GTry(longbuffer, password)) ++ { ++ return _("it's derived from your password entry"); ++ } ++ } + +- if (GTry(longbuffer, password)) ++ if (strlen(uwords[j]) < STRINGSIZE - 1) + { +- return _("it is derivable from your password entry"); ++ longbuffer[0] = uwords[i][0]; ++ longbuffer[1] = '\0'; ++ strcat(longbuffer, uwords[j]); ++ ++ if (GTry(longbuffer, password)) ++ { ++ return _("it is derivable from your password entry"); ++ } + } + +- longbuffer[0] = uwords[j][0]; +- longbuffer[1] = '\0'; +- strcat(longbuffer, uwords[i]); +- +- if (GTry(longbuffer, password)) ++ if (strlen(uwords[i]) < STRINGSIZE - 1) + { +- return _("it's derivable from your password entry"); ++ longbuffer[0] = uwords[j][0]; ++ longbuffer[1] = '\0'; ++ strcat(longbuffer, uwords[i]); ++ ++ if (GTry(longbuffer, password)) ++ { ++ return _("it's derivable from your password entry"); ++ } + } + } + } +-- +2.8.1 + diff --git a/poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch b/poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch new file mode 100644 index 000000000..adbe7dfff --- /dev/null +++ b/poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch @@ -0,0 +1,339 @@ +From 8a6e43726ad0ae41bd1cc2c248d91deb31459357 Mon Sep 17 00:00:00 2001 +From: Lei Maohui <leimaohui@cn.fujitsu.com> +Date: Tue, 9 Jun 2015 11:11:48 +0900 +Subject: [PATCH] packlib.c: support dictionary byte order dependent + +The previous dict files are NOT byte-order independent, in fact they are +probably ARCHITECTURE SPECIFIC. +Create the dict files in big endian, and convert to host endian while +load them. This could fix the endian issue on multiple platform. + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +Upstream-Status: Pending + +We can't use the endian.h, htobe* and be*toh functions because they are +not available on older versions of glibc, such as that found in RHEL +5.9. + +Change to checking endian and directly calling bswap_* as defined in +byteswap.h. + +Signed-off-by: Mark Hatle <mark.hatle@windriver.com> + +Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com> +--- + lib/packlib.c | 214 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 210 insertions(+), 4 deletions(-) + +diff --git a/lib/packlib.c b/lib/packlib.c +index f851424..3aac805 100644 +--- a/lib/packlib.c ++++ b/lib/packlib.c +@@ -16,6 +16,12 @@ + #ifdef HAVE_STDINT_H + #include <stdint.h> + #endif ++ ++#ifndef _BSD_SOURCE ++#define _BSD_SOURCE /* See feature_test_macros(7) */ ++#endif ++#include <endian.h> ++#include <byteswap.h> + #include "packer.h" + + static const char vers_id[] = "packlib.c : v2.3p2 Alec Muffett 18 May 1993"; +@@ -45,6 +51,185 @@ typedef struct + char data_get[NUMWORDS][MAXWORDLEN]; + } PWDICT64; + ++enum{ ++ en_is32, ++ en_is64 ++}; ++ ++static int ++IheaderHostToBigEndian(char *pHeader, int nBitType) ++{ ++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader; ++ ++ pHeader64->pih_magic = bswap_64(pHeader64->pih_magic); ++ pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords); ++ pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen); ++ pHeader64->pih_pad = bswap_16(pHeader64->pih_pad); ++ ++#if DEBUG ++ printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n", ++ pHeader64->pih_magic, pHeader64->pih_numwords, ++ pHeader64->pih_blocklen, pHeader64->pih_pad); ++#endif ++ } ++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ struct pi_header *pHeader32 = (struct pi_header*)pHeader; ++ ++ pHeader32->pih_magic = bswap_32(pHeader32->pih_magic); ++ pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords); ++ pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen); ++ pHeader32->pih_pad = bswap_16(pHeader32->pih_pad); ++ ++#if DEBUG ++ printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n", ++ pHeader32->pih_magic, pHeader32->pih_numwords, ++ pHeader32->pih_blocklen, pHeader32->pih_pad); ++#endif ++ } ++ else if (__BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType); ++ return (-1); ++ } ++ ++ return 0; ++} ++ ++static int ++IheaderBigEndianToHost(char *pHeader, int nBitType) ++{ ++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader; ++ ++ pHeader64->pih_magic = bswap_64(pHeader64->pih_magic); ++ pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords); ++ pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen); ++ pHeader64->pih_pad = bswap_16(pHeader64->pih_pad); ++ ++#if DEBUG ++ printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n", ++ pHeader64->pih_magic, pHeader64->pih_numwords, ++ pHeader64->pih_blocklen, pHeader64->pih_pad); ++#endif ++ } ++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ struct pi_header *pHeader32 = (struct pi_header*)pHeader; ++ ++ pHeader32->pih_magic = bswap_32(pHeader32->pih_magic); ++ pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords); ++ pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen); ++ pHeader32->pih_pad = bswap_16(pHeader32->pih_pad); ++ ++#if DEBUG ++ printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n", ++ pHeader32->pih_magic, pHeader32->pih_numwords, ++ pHeader32->pih_blocklen, pHeader32->pih_pad); ++#endif ++ } ++ else if (__BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType); ++ return (-1); ++ } ++ ++ return 0; ++} ++ ++static int ++HwmsHostToBigEndian(char *pHwms, int nLen,int nBitType) ++{ ++ int i = 0; ++ ++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ uint64_t *pHwms64 = (uint64_t*)pHwms; ++ ++ for (i = 0; i < nLen / sizeof(uint64_t); i++) ++ { ++ *pHwms64 = bswap_64(*pHwms64); ++ *pHwms64++; ++ } ++ ++ } ++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ uint32_t *pHwms32 = (uint32_t*)pHwms; ++ ++ for (i = 0; i < nLen / sizeof(uint32_t); i++) ++ { ++ *pHwms32 = bswap_32(*pHwms32); ++ *pHwms32++; ++ } ++ ++ } ++ else if (__BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType); ++ return (-1); ++ } ++ ++#if DEBUG ++ for (i = 0; i < nLen; i+=8) ++ { ++ printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n", ++ nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF, ++ pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF, ++ pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF); ++ } ++#endif ++ ++ return 0; ++} ++ ++static int ++HwmsBigEndianToHost(char *pHwms, int nLen, int nBitType) ++{ ++ int i = 0; ++ ++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ uint64_t *pHwms64 = (uint64_t*)pHwms; ++ ++ for (i = 0; i < nLen / sizeof(uint64_t); i++) ++ { ++ *pHwms64++ = bswap_64(*pHwms64); ++ } ++ ++ } ++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ uint32_t *pHwms32 = (uint32_t*)pHwms; ++ ++ for (i = 0; i < nLen / sizeof(uint32_t); i++) ++ { ++ *pHwms32 = bswap_32(*pHwms32); ++ *pHwms32++; ++ } ++ ++ } ++ else if (__BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType); ++ return (-1); ++ } ++ ++#if DEBUG ++ for (i = 0; i < nLen; i+=8) ++ { ++ printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n", ++ nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF, ++ pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF, ++ pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF); ++ } ++#endif ++ ++ return 0; ++} + + static int + _PWIsBroken64(FILE *ifp) +@@ -57,6 +242,7 @@ _PWIsBroken64(FILE *ifp) + return 0; + } + ++ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64); + return (pdesc64.header.pih_magic == PIH_MAGIC); + } + +@@ -149,7 +335,11 @@ PWOpen(prefix, mode) + pdesc.header.pih_blocklen = NUMWORDS; + pdesc.header.pih_numwords = 0; + +- fwrite((char *) &pdesc.header, sizeof(pdesc.header), 1, ifp); ++ struct pi_header tmpheader32; ++ ++ memcpy(&tmpheader32, &pdesc.header, sizeof(pdesc.header)); ++ IheaderHostToBigEndian((char *) &tmpheader32, en_is32); ++ fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, ifp); + } else + { + pdesc.flags &= ~PFOR_WRITE; +@@ -173,6 +363,7 @@ PWOpen(prefix, mode) + return NULL; + } + ++ IheaderBigEndianToHost((char *) &pdesc.header, en_is32); + if ((pdesc.header.pih_magic == 0) || (pdesc.header.pih_numwords == 0)) + { + /* uh-oh. either a broken "64-bit" file or a garbage file. */ +@@ -195,6 +386,7 @@ PWOpen(prefix, mode) + } + return NULL; + } ++ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64); + if (pdesc64.header.pih_magic != PIH_MAGIC) + { + /* nope, not "64-bit" after all */ +@@ -290,6 +482,7 @@ PWOpen(prefix, mode) + { + pdesc.flags &= ~PFOR_USEHWMS; + } ++ HwmsBigEndianToHost((char*)pdesc64.hwms, sizeof(pdesc64.hwms), en_is64); + for (i = 0; i < sizeof(pdesc.hwms) / sizeof(pdesc.hwms[0]); i++) + { + pdesc.hwms[i] = pdesc64.hwms[i]; +@@ -299,6 +492,7 @@ PWOpen(prefix, mode) + { + pdesc.flags &= ~PFOR_USEHWMS; + } ++ HwmsBigEndianToHost((char*)pdesc.hwms, sizeof(pdesc.hwms), en_is32); + #if DEBUG + for (i=1; i<=0xff; i++) + { +@@ -332,7 +526,11 @@ PWClose(pwp) + return (-1); + } + +- if (!fwrite((char *) &pwp->header, sizeof(pwp->header), 1, pwp->ifp)) ++ struct pi_header tmpheader32; ++ ++ memcpy(&tmpheader32, &pwp->header, sizeof(pwp->header)); ++ IheaderHostToBigEndian((char *) &tmpheader32, en_is32); ++ if (!fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, pwp->ifp)) + { + fprintf(stderr, "index magic fwrite failed\n"); + return (-1); +@@ -351,7 +549,12 @@ PWClose(pwp) + printf("hwm[%02x] = %d\n", i, pwp->hwms[i]); + #endif + } +- fwrite(pwp->hwms, 1, sizeof(pwp->hwms), pwp->wfp); ++ ++ PWDICT tmp_pwp; ++ ++ memcpy(&tmp_pwp, pwp, sizeof(PWDICT)); ++ HwmsHostToBigEndian(tmp_pwp.hwms, sizeof(tmp_pwp.hwms), en_is32); ++ fwrite(tmp_pwp.hwms, 1, sizeof(tmp_pwp.hwms), pwp->wfp); + } + } + +@@ -405,7 +608,8 @@ PutPW(pwp, string) + + datum = (uint32_t) ftell(pwp->dfp); + +- fwrite((char *) &datum, sizeof(datum), 1, pwp->ifp); ++ uint32_t tmpdatum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum; ++ fwrite((char *) &tmpdatum, sizeof(tmpdatum), 1, pwp->ifp); + + fputs(pwp->data_put[0], pwp->dfp); + putc(0, pwp->dfp); +@@ -464,6 +668,7 @@ GetPW(pwp, number) + perror("(index fread failed)"); + return NULL; + } ++ datum64 = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_64(datum64) : datum64; + datum = datum64; + } else { + if (fseek(pwp->ifp, sizeof(struct pi_header) + (thisblock * sizeof(uint32_t)), 0)) +@@ -477,6 +682,7 @@ GetPW(pwp, number) + perror("(index fread failed)"); + return NULL; + } ++ datum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum; + } + + int r = 1; +-- +1.8.4.2 + diff --git a/poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch b/poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch new file mode 100644 index 000000000..6210e8212 --- /dev/null +++ b/poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch @@ -0,0 +1,53 @@ +From 06f9a88b5dd5597f9198ea0cb34f5e96f180e6e3 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Sat, 27 Apr 2013 16:02:30 +0800 +Subject: [PATCH] craklib:fix testnum and teststr failed + +Error log: +... +$ ./testnum +(null).pwd.gz: No such file or directory +PWOpen: No such file or directory + +$ ./util/teststr +(null).pwd.gz: No such file or directory +PWOpen: No such file or directory +... +Set DEFAULT_CRACKLIB_DICT as the path of PWOpen + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +Upstream-Status: Pending +--- + util/testnum.c | 2 +- + util/teststr.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/util/testnum.c b/util/testnum.c +index ae2246d..ca210ff 100644 +--- a/util/testnum.c ++++ b/util/testnum.c +@@ -20,7 +20,7 @@ main () + PWDICT *pwp; + char buffer[STRINGSIZE]; + +- if (!(pwp = PWOpen (NULL, "r"))) ++ if (!(pwp = PWOpen (DEFAULT_CRACKLIB_DICT, "r"))) + { + perror ("PWOpen"); + return (-1); +diff --git a/util/teststr.c b/util/teststr.c +index 2a31fa4..9fb9cda 100644 +--- a/util/teststr.c ++++ b/util/teststr.c +@@ -15,7 +15,7 @@ main () + PWDICT *pwp; + char buffer[STRINGSIZE]; + +- if (!(pwp = PWOpen (NULL, "r"))) ++ if (!(pwp = PWOpen (DEFAULT_CRACKLIB_DICT, "r"))) + { + perror ("PWOpen"); + return (-1); +-- +1.7.10.4 + diff --git a/poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb b/poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb new file mode 100644 index 000000000..82995219d --- /dev/null +++ b/poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb @@ -0,0 +1,29 @@ +SUMMARY = "Password strength checker library" +HOMEPAGE = "http://sourceforge.net/projects/cracklib" + +LICENSE = "LGPLv2.1+" +LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06" + +DEPENDS = "cracklib-native zlib" + +EXTRA_OECONF = "--without-python --libdir=${base_libdir}" + +SRC_URI = "${SOURCEFORGE_MIRROR}/cracklib/cracklib-${PV}.tar.gz \ + file://0001-packlib.c-support-dictionary-byte-order-dependent.patch \ + file://0001-Apply-patch-to-fix-CVE-2016-6318.patch \ + file://0002-craklib-fix-testnum-and-teststr-failed.patch" + +SRC_URI[md5sum] = "376790a95c1fb645e59e6e9803c78582" +SRC_URI[sha256sum] = "59ab0138bc8cf90cccb8509b6969a024d5e58d2d02bcbdccbb9ba9b88be3fa33" + +UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/cracklib/files/cracklib/" +UPSTREAM_CHECK_REGEX = "/cracklib/(?P<pver>(\d+[\.\-_]*)+)/" + +inherit autotools gettext + +do_install_append_class-target() { + create-cracklib-dict -o ${D}${datadir}/cracklib/pw_dict ${D}${datadir}/cracklib/cracklib-small +} + +BBCLASSEXTEND = "native nativesdk" + diff --git a/poky/meta/recipes-extended/cronie/cronie/crond.init b/poky/meta/recipes-extended/cronie/cronie/crond.init new file mode 100755 index 000000000..53b8514ca --- /dev/null +++ b/poky/meta/recipes-extended/cronie/cronie/crond.init @@ -0,0 +1,58 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: crond crontab +# Default-Start: 2345 +# Default-Stop: 016 +# Short-Description: run cron daemon +# Description: cron is a standard UNIX program that runs user-specified +# programs at periodic scheduled times. vixie cron adds a +# number of features to the basic UNIX cron, including better +# security and more powerful configuration options. +### END INIT INFO + +CROND=/usr/sbin/crond +CONFIG=/etc/sysconfig/crond + +[ -f $CONFIG ] || exit 1 +[ -x $CROND ] || exit 1 + +. $CONFIG + +# Source function library. +. /etc/init.d/functions + +case "$1" in + start) + echo -n "Starting crond: " + start-stop-daemon --start --quiet --exec $CROND -- $CRONDARGS + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + stop) + echo -n "Stopping crond: " + start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + status) + status crond + exit $? + ;; + restart) + $0 stop && sleep 1 && $0 start + ;; + *) + echo "Usage: /etc/init.d/crond {start|stop|status|restart}" + exit 1 +esac + +exit 0 + diff --git a/poky/meta/recipes-extended/cronie/cronie/crond.service b/poky/meta/recipes-extended/cronie/cronie/crond.service new file mode 100644 index 000000000..d435a6eb3 --- /dev/null +++ b/poky/meta/recipes-extended/cronie/cronie/crond.service @@ -0,0 +1,11 @@ +[Unit] +Description=Periodic Command Scheduler + +[Service] +EnvironmentFile=/etc/sysconfig/crond +ExecStart=@SBINDIR@/crond -n $CRONDARGS +ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch b/poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch new file mode 100644 index 000000000..6c928165c --- /dev/null +++ b/poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch @@ -0,0 +1,22 @@ +password-auth is the Fedora's common pam configure file, use oe common pam +configure files instead. + +Upstream-Status: Pending + +Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> +Index: cronie-1.5.1/pam/crond +=================================================================== +--- cronie-1.5.1.orig/pam/crond ++++ cronie-1.5.1/pam/crond +@@ -4,8 +4,8 @@ + # + # Although no PAM authentication is called, auth modules + # are used for credential setting +-auth include password-auth ++auth include common-auth + account required pam_access.so +-account include password-auth ++account include common-account + session required pam_loginuid.so +-session include password-auth ++session include common-session-noninteractive diff --git a/poky/meta/recipes-extended/cronie/cronie/crontab b/poky/meta/recipes-extended/cronie/cronie/crontab new file mode 100644 index 000000000..22c4feb2d --- /dev/null +++ b/poky/meta/recipes-extended/cronie/cronie/crontab @@ -0,0 +1,14 @@ +# /etc/crontab: system-wide crontab +# Unlike any other crontab you don't have to run the `crontab' +# command to install the new version when you edit this file +# and files in /etc/cron.d. These files also have username fields, +# that none of the other crontabs do. + +SHELL=/bin/sh +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +# m h dom mon dow user command +# 1 * * * * root cd / && run-parts /etc/cron.hourly +# 30 7 * * * root cd / && run-parts /etc/cron.daily +# 42 7 * * 7 root cd / && run-parts /etc/cron.weekly +# 55 7 1 * * root cd / && run-parts /etc/cron.monthly diff --git a/poky/meta/recipes-extended/cronie/cronie_1.5.1.bb b/poky/meta/recipes-extended/cronie/cronie_1.5.1.bb new file mode 100644 index 000000000..cfb8c2105 --- /dev/null +++ b/poky/meta/recipes-extended/cronie/cronie_1.5.1.bb @@ -0,0 +1,83 @@ +SUMMARY = "Cron daemon for executing programs at set times" +DESCRIPTION = "Cronie contains the standard UNIX daemon crond that runs \ +specified programs at scheduled times and related tools. It is based on the \ +original cron and has security and configuration enhancements like the \ +ability to use pam and SELinux." +HOMEPAGE = "https://github.com/cronie-crond/cronie/" +BUGTRACKER = "https://bugzilla.redhat.com" + +# Internet Systems Consortium License +LICENSE = "ISC & BSD-3-Clause & BSD-2-Clause & GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=dd2a592170760e1386c769e1043b3722 \ + file://src/cron.c;endline=20;md5=b425c334265026177128353a142633b4 \ + file://src/popen.c;beginline=3;endline=31;md5=edd50742d8def712e9472dba353668a9" + +SECTION = "utils" + +UPSTREAM_CHECK_URI = "https://github.com/cronie-crond/${BPN}/releases/" + +SRC_URI = "https://github.com/cronie-crond/cronie/releases/download/cronie-${PV}/cronie-${PV}.tar.gz \ + file://crond.init \ + file://crontab \ + file://crond.service \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}" + +PAM_SRC_URI = "file://crond_pam_config.patch" +PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid" + +SRC_URI[md5sum] = "910e6effcc032998b0a49fbd46322e18" +SRC_URI[sha256sum] = "6c73666102a6b5d35e2eaf1bd06925f2d4b0cef8d3323c37286dda3089a85338" + +inherit autotools update-rc.d useradd systemd + +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" + +PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit," +PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,${PAM_DEPS}" + +INITSCRIPT_NAME = "crond" +INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ." + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM_${PN} = "--system crontab" + +SYSTEMD_SERVICE_${PN} = "crond.service" + +do_install_append () { + install -d ${D}${sysconfdir}/sysconfig/ + install -d ${D}${sysconfdir}/init.d/ + install -m 0644 ${S}/crond.sysconfig ${D}${sysconfdir}/sysconfig/crond + install -m 0755 ${WORKDIR}/crond.init ${D}${sysconfdir}/init.d/crond + + # install systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/crond.service ${D}${systemd_unitdir}/system + sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ + -e 's,@SBINDIR@,${sbindir},g' \ + ${D}${systemd_unitdir}/system/crond.service + + # below are necessary for a complete cron environment + install -d ${D}${localstatedir}/spool/cron + install -m 0755 ${WORKDIR}/crontab ${D}${sysconfdir}/ + mkdir -p ${D}${sysconfdir}/cron.d + mkdir -p ${D}${sysconfdir}/cron.hourly + mkdir -p ${D}${sysconfdir}/cron.daily + mkdir -p ${D}${sysconfdir}/cron.weekly + mkdir -p ${D}${sysconfdir}/cron.monthly + touch ${D}${sysconfdir}/cron.deny + + # below setting is necessary to allow normal user using crontab + + # setgid for crontab binary + chown root:crontab ${D}${bindir}/crontab + chmod 2755 ${D}${bindir}/crontab + + # allow 'crontab' group write to /var/spool/cron + chown root:crontab ${D}${localstatedir}/spool/cron + chmod 770 ${D}${localstatedir}/spool/cron + + chmod 600 ${D}${sysconfdir}/crontab +} + +FILES_${PN} += "${sysconfdir}/cron*" +CONFFILES_${PN} += "${sysconfdir}/crontab" diff --git a/poky/meta/recipes-extended/cups/cups.inc b/poky/meta/recipes-extended/cups/cups.inc new file mode 100644 index 000000000..ac4d225c1 --- /dev/null +++ b/poky/meta/recipes-extended/cups/cups.inc @@ -0,0 +1,110 @@ +SUMMARY = "An Internet printing system for Unix" +HOMEPAGE = "https://www.cups.org/" +SECTION = "console/utils" +LICENSE = "GPLv2 & LGPLv2" +DEPENDS = "gnutls libpng jpeg dbus dbus-glib zlib libusb" + +SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.tar.gz \ + file://use_echo_only_in_init.patch \ + file://0001-don-t-try-to-run-generated-binaries.patch \ + file://cups_serverbin.patch \ + " + +UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases" +UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar" + +LEAD_SONAME = "libcupsdriver.so" + +CLEANBROKEN = "1" + +inherit autotools-brokensep binconfig useradd systemd pkgconfig + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM_${PN} = "--system lpadmin" + +SYSTEMD_SERVICE_${PN} = "org.cups.cupsd.socket org.cups.cupsd.path org.cups.cupsd.service org.cups.cups-lpd.socket org.cups.cups-lpd@.service" + +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}" +PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi" +PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl" +PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam" +PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd" +PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd" + +EXTRA_OECONF = " \ + --enable-gnutls \ + --enable-dbus \ + --enable-browsing \ + --disable-gssapi \ + --enable-debug \ + --disable-relro \ + --enable-libusb \ + --without-php \ + --without-perl \ + --without-python \ + --without-java \ + DSOFLAGS='${LDFLAGS}' \ + " + +EXTRA_AUTORECONF += "--exclude=autoheader" + +do_compile () { + echo "all:" > man/Makefile + echo "libs:" >> man/Makefile + echo "install:" >> man/Makefile + echo "install-data:" >> man/Makefile + echo "install-exec:" >> man/Makefile + echo "install-headers:" >> man/Makefile + echo "install-libs:" >> man/Makefile + + oe_runmake +} + +do_install () { + oe_runmake "DSTROOT=${D}" install + + # Remove /var/run from package as cupsd will populate it on startup + rm -fr ${D}/${localstatedir}/run + rmdir ${D}/${libdir}/${BPN}/driver + + # Fix the pam configuration file permissions + if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then + chmod 0644 ${D}${sysconfdir}/pam.d/cups + fi + + # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES + if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then + rm -rf ${D}${sysconfdir}/init.d/ + rm -rf ${D}${sysconfdir}/rc* + fi +} + +PACKAGES =+ "${PN}-lib ${PN}-libimage" + +RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}" +FILES_${PN} += "${libdir}/cups/backend \ + ${libdir}/cups/cgi-bin \ + ${libdir}/cups/filter \ + ${libdir}/cups/monitor \ + ${libdir}/cups/notifier \ + ${libdir}/cups/daemon \ + " + +FILES_${PN}-lib = "${libdir}/libcups.so.*" + +FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*" + +#package the html for the webgui inside the main packages (~1MB uncompressed) + +FILES_${PN} += "${datadir}/doc/cups/images \ + ${datadir}/doc/cups/*html \ + ${datadir}/doc/cups/*.css \ + ${datadir}/icons/ \ + " +CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf" + +SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" +cups_sysroot_preprocess () { + sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:' +} diff --git a/poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch b/poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch new file mode 100644 index 000000000..db013cf08 --- /dev/null +++ b/poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch @@ -0,0 +1,69 @@ +Upstream-Status: Inappropriate [embedded specific] + +From 90069586167b930befce7303aea57078f04b4ed8 Mon Sep 17 00:00:00 2001 +From: Koen Kooi <koen@dominion.thruhere.net> +Date: Sun, 30 Jan 2011 16:37:27 +0100 +Subject: [PATCH] don't try to run generated binaries + +Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> +--- + ppdc/Makefile | 30 +++++++++++++++--------------- + 1 files changed, 15 insertions(+), 15 deletions(-) + +Index: cups-2.2.6/ppdc/Makefile +=================================================================== +--- cups-2.2.6.orig/ppdc/Makefile ++++ cups-2.2.6/ppdc/Makefile +@@ -228,8 +228,8 @@ genstrings: genstrings.o libcupsppdc.a + $(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o genstrings genstrings.o \ + libcupsppdc.a ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \ + $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) +- echo Generating localization strings... +- ./genstrings >sample.c ++# echo Generating localization strings... ++# ./genstrings >sample.c + + + # +@@ -246,9 +246,9 @@ ppdc-static: ppdc.o libcupsppdc.a ../cu + $(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdc-static ppdc.o libcupsppdc.a \ + ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ + $(COMMONLIBS) $(LIBZ) +- echo Testing PPD compiler... +- ./ppdc-static -l en,fr -I ../data foo.drv +- ./ppdc-static -l en,fr -z -I ../data foo.drv ++# echo Testing PPD compiler... ++# ./ppdc-static -l en,fr -I ../data foo.drv ++# ./ppdc-static -l en,fr -z -I ../data foo.drv + + + # +@@ -274,17 +274,17 @@ ppdi-static: ppdc-static ppdi.o libcups + $(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdi-static ppdi.o libcupsppdc.a \ + ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ + $(COMMONLIBS) $(LIBZ) +- echo Testing PPD importer... +- $(RM) -r ppd ppd2 sample-import.drv +- ./ppdc-static -l en -I ../data sample.drv +- ./ppdi-static -I ../data -o sample-import.drv ppd/* +- ./ppdc-static -l en -I ../data -d ppd2 sample-import.drv +- if diff -r ppd ppd2 >/dev/null; then \ +- echo PPD import OK; \ +- else \ +- echo PPD import FAILED; \ +- exit 1; \ +- fi ++# echo Testing PPD importer... ++# $(RM) -r ppd ppd2 sample-import.drv ++# ./ppdc-static -l en -I ../data sample.drv ++# ./ppdi-static -I ../data -o sample-import.drv ppd/* ++# ./ppdc-static -l en -I ../data -d ppd2 sample-import.drv ++# if diff -r ppd ppd2 >/dev/null; then \ ++# echo PPD import OK; \ ++# else \ ++# echo PPD import FAILED; \ ++# exit 1; \ ++# fi + + + # diff --git a/poky/meta/recipes-extended/cups/cups/cups_serverbin.patch b/poky/meta/recipes-extended/cups/cups/cups_serverbin.patch new file mode 100644 index 000000000..f7b44a7bc --- /dev/null +++ b/poky/meta/recipes-extended/cups/cups/cups_serverbin.patch @@ -0,0 +1,32 @@ +Make CUPS_SERVERBIN relative to libdir otherwise on 64bit arches +e.g. ppc64 where base libdir is lib64 this does not go well + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Inappropriate [OE config specific] + +Index: cups-1.4.6/config-scripts/cups-directories.m4 +=================================================================== +--- cups-1.4.6.orig/config-scripts/cups-directories.m4 2009-04-12 16:04:51.000000000 -0700 ++++ cups-1.4.6/config-scripts/cups-directories.m4 2012-07-21 12:12:05.896405923 -0700 +@@ -397,7 +397,7 @@ + *) + # All others + INSTALL_SYSV="install-sysv" +- CUPS_SERVERBIN="$exec_prefix/lib/cups" ++ CUPS_SERVERBIN="$libdir/cups" + ;; + esac + +Index: cups-1.4.6/configure +=================================================================== +--- cups-1.4.6.orig/configure 2012-07-21 12:13:34.512405950 -0700 ++++ cups-1.4.6/configure 2012-07-21 12:14:05.724406017 -0700 +@@ -11181,7 +11181,7 @@ + *) + # All others + INSTALL_SYSV="install-sysv" +- CUPS_SERVERBIN="$exec_prefix/lib/cups" ++ CUPS_SERVERBIN="$libdir/cups" + ;; + esac + diff --git a/poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch b/poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch new file mode 100644 index 000000000..696f1374d --- /dev/null +++ b/poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch @@ -0,0 +1,15 @@ +Upstream-Status: Inappropriate [embedded specific] + +Index: cups-1.6.1/scheduler/cups.sh.in +=================================================================== +--- cups-1.6.1.orig/scheduler/cups.sh.in ++++ cups-1.6.1/scheduler/cups.sh.in +@@ -67,7 +67,7 @@ case "`uname`" in + ECHO_ERROR=: + ;; + +- Linux*) ++ DisableLinux*) + IS_ON=/bin/true + if test -f /etc/init.d/functions; then + . /etc/init.d/functions diff --git a/poky/meta/recipes-extended/cups/cups_2.2.6.bb b/poky/meta/recipes-extended/cups/cups_2.2.6.bb new file mode 100644 index 000000000..3aa934bc0 --- /dev/null +++ b/poky/meta/recipes-extended/cups/cups_2.2.6.bb @@ -0,0 +1,6 @@ +require cups.inc + +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f212b4338db0da8cb892e94bf2949460" + +SRC_URI[md5sum] = "e91c26d8d97b5a1630a962f530f02192" +SRC_URI[sha256sum] = "40385778c2b3bdf55030d1c999734e22774c79e3425d91339ce677825620169b" diff --git a/poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb b/poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb new file mode 100644 index 000000000..65a99fc28 --- /dev/null +++ b/poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb @@ -0,0 +1,22 @@ +SUMMARY = "Collection of autoconf m4 macros" +SECTION = "base" +HOMEPAGE = "http://sourceforge.net/projects/cwautomacros.berlios/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a" + +SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}.berlios/${BP}.tar.bz2" +SRC_URI[md5sum] = "074afcb50d0a8bff10786a2954b2b02d" +SRC_URI[sha256sum] = "3115603b891f3a163c0bbb5fea2f3742113a183fa6745ee5e89e5f6d0e9f6121" + +do_configure() { + : +} + +do_install() { + oe_runmake CWAUTOMACROSPREFIX=${D}${prefix} install + + # cleanup buildpaths in autogen.sh + sed -i -e 's,${D},,g' ${D}${prefix}/share/cwautomacros/scripts/autogen.sh +} + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-Unset-need_charset_alias-when-building-for-musl.patch new file mode 100644 index 000000000..ba1a4bab4 --- /dev/null +++ b/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-Unset-need_charset_alias-when-building-for-musl.patch @@ -0,0 +1,33 @@ +From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Apr 2015 17:02:13 -0700 +Subject: [PATCH] Unset need_charset_alias when building for musl + +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 +which actually shoudl be fixed in gnulib and then all downstream +projects will get it eventually. For now we apply the fix to +coreutils + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/gnulib.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/gnulib.mk b/lib/gnulib.mk +index e1d74db..c0e92dd 100644 +--- a/lib/gnulib.mk ++++ b/lib/gnulib.mk +@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-explicitly-disable-replacing-getopt.patch b/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-explicitly-disable-replacing-getopt.patch new file mode 100644 index 000000000..351f87cab --- /dev/null +++ b/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-explicitly-disable-replacing-getopt.patch @@ -0,0 +1,30 @@ +Subject: explicitly disable replacing getopt + +Explicitly disable replacing getopt to avoid compilation error like below. + + xstrtol-error.c:84:26: error: invalid use of undefined type 'struct rpl_option' + +Upstream-Status: Inappropriate [workaround] +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + m4/getopt.m4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/m4/getopt.m4 b/m4/getopt.m4 +index 3ebc7b7..8934426 100644 +--- a/m4/getopt.m4 ++++ b/m4/getopt.m4 +@@ -22,8 +22,8 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX], + fi + ]) + if test $REPLACE_GETOPT = 1; then +- dnl Arrange for getopt.h to be created. +- gl_GETOPT_SUBSTITUTE_HEADER ++ dnl Explicitly disable replacing getopt ++ : + fi + ]) + +-- +2.11.0 + diff --git a/poky/meta/recipes-extended/diffutils/diffutils-3.6/run-ptest b/poky/meta/recipes-extended/diffutils/diffutils-3.6/run-ptest new file mode 100644 index 000000000..695c5e8a7 --- /dev/null +++ b/poky/meta/recipes-extended/diffutils/diffutils-3.6/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +make -C tests check-TESTS diff --git a/poky/meta/recipes-extended/diffutils/diffutils.inc b/poky/meta/recipes-extended/diffutils/diffutils.inc new file mode 100644 index 000000000..c9e313058 --- /dev/null +++ b/poky/meta/recipes-extended/diffutils/diffutils.inc @@ -0,0 +1,13 @@ +SUMMARY = "Diffutils contains tools used for finding differences between files" +HOMEPAGE = "https://www.gnu.org/software/diffutils/diffutils.html" +DESCRIPTION = "Diffutils contains the GNU diff, diff3, \ +sdiff, and cmp utilities. These programs are usually \ +used for creating patch files." +SECTION = "base" + +inherit autotools texinfo update-alternatives gettext + +ALTERNATIVE_${PN} = "diff cmp" +ALTERNATIVE_PRIORITY = "100" + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/diffutils/diffutils_3.6.bb b/poky/meta/recipes-extended/diffutils/diffutils_3.6.bb new file mode 100644 index 000000000..deadd62c6 --- /dev/null +++ b/poky/meta/recipes-extended/diffutils/diffutils_3.6.bb @@ -0,0 +1,39 @@ +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +require diffutils.inc + +SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \ + file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ + file://run-ptest \ +" +SRC_URI_append_libc-glibc = " file://0001-explicitly-disable-replacing-getopt.patch" + +SRC_URI[md5sum] = "07cf286672ced26fba54cd0313bdc071" +SRC_URI[sha256sum] = "d621e8bdd4b573918c8145f7ae61817d1be9deb4c8d2328a65cea8e11d783bd6" + +EXTRA_OECONF += "ac_cv_path_PR_PROGRAM=${bindir}/pr --without-libsigsegv-prefix" + +# Fix "Argument list too long" error when len(TMPDIR) = 410 +acpaths = "-I ./m4" + +inherit ptest + +do_install_ptest() { + t=${D}${PTEST_PATH} + install -D ${S}/build-aux/test-driver $t/build-aux/test-driver + cp -r ${S}/tests $t/ + install ${B}/tests/Makefile $t/tests/ + sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e 's:${HOSTTOOLS_DIR}/::g' \ + -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ + -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ + -e 's|^Makefile:|_Makefile:|' \ + -e 's|bash|sh|' \ + -e 's|^top_srcdir = \(.*\)|top_srcdir = ..\/|' \ + -e 's|^srcdir = \(.*\)|srcdir = .|' \ + -e 's|"`$(built_programs)`"|diff|' \ + -e 's|gawk|awk|g' \ + -i $t/tests/Makefile +} diff --git a/poky/meta/recipes-extended/ed/ed_1.14.2.bb b/poky/meta/recipes-extended/ed/ed_1.14.2.bb new file mode 100644 index 000000000..87d03b10b --- /dev/null +++ b/poky/meta/recipes-extended/ed/ed_1.14.2.bb @@ -0,0 +1,35 @@ +SUMMARY = "Line-oriented text editor" +HOMEPAGE = "http://www.gnu.org/software/ed/" + +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7 \ + file://ed.h;endline=20;md5=4e36b7a40e137f42aee718165590d125 \ + file://main.c;endline=17;md5=c5b8f78f115df187af76868a2aead16a" + +SECTION = "base" + +# LSB states that ed should be in /bin/ +bindir = "${base_bindir}" + +# Upstream regularly removes previous releases from https://ftp.gnu.org/gnu/ed/ +SRC_URI = "${GNU_MIRROR}/ed/${BP}.tar.lz" +UPSTREAM_CHECK_URI = "${GNU_MIRROR}/ed/" + +SRC_URI[md5sum] = "273d04778b2a51f7c3cbfcd2001876bf" +SRC_URI[sha256sum] = "f57962ba930d70d02fc71d6be5c5f2346b16992a455ab9c43be7061dec9810db" + +EXTRA_OEMAKE = "-e MAKEFLAGS=" + +inherit texinfo + +do_configure() { + ${S}/configure +} + +do_install() { + oe_runmake 'DESTDIR=${D}' install + # Info dir listing isn't interesting at this point so remove it if it exists. + if [ -e "${D}${infodir}/dir" ]; then + rm -f ${D}${infodir}/dir + fi +} diff --git a/poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch b/poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch new file mode 100644 index 000000000..de3810404 --- /dev/null +++ b/poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch @@ -0,0 +1,20 @@ +ptest needs buildtest-TESTS and runtest-TESTS targets. +serial-tests is required to generate those targets. + +Signed-off-by: Tudor Florea <tudor.florea@enea.com> +Upstream-Status: Inappropriate +(default automake behavior incompatible with ptest) + +Index: ethtool-4.13/configure.ac +=================================================================== +--- ethtool-4.13.orig/configure.ac ++++ ethtool-4.13/configure.ac +@@ -2,7 +2,7 @@ dnl Process this file with autoconf to p + AC_INIT(ethtool, 4.13, netdev@vger.kernel.org) + AC_PREREQ(2.52) + AC_CONFIG_SRCDIR([ethtool.c]) +-AM_INIT_AUTOMAKE([gnu]) ++AM_INIT_AUTOMAKE([gnu serial-tests]) + AC_CONFIG_HEADERS([ethtool-config.h]) + + AM_MAINTAINER_MODE diff --git a/poky/meta/recipes-extended/ethtool/ethtool/run-ptest b/poky/meta/recipes-extended/ethtool/ethtool/run-ptest new file mode 100644 index 000000000..1e245da11 --- /dev/null +++ b/poky/meta/recipes-extended/ethtool/ethtool/run-ptest @@ -0,0 +1,2 @@ +#!/bin/sh +make -k runtest-TESTS diff --git a/poky/meta/recipes-extended/ethtool/ethtool_4.13.bb b/poky/meta/recipes-extended/ethtool/ethtool_4.13.bb new file mode 100644 index 000000000..c862a5795 --- /dev/null +++ b/poky/meta/recipes-extended/ethtool/ethtool_4.13.bb @@ -0,0 +1,30 @@ +SUMMARY = "Display or change ethernet card settings" +DESCRIPTION = "A small utility for examining and tuning the settings of your ethernet-based network interfaces." +HOMEPAGE = "http://www.kernel.org/pub/software/network/ethtool/" +SECTION = "console/network" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://ethtool.c;beginline=4;endline=17;md5=c19b30548c582577fc6b443626fc1216" + +SRC_URI = "${KERNELORG_MIRROR}/software/network/ethtool/ethtool-${PV}.tar.gz \ + file://run-ptest \ + file://avoid_parallel_tests.patch \ + " + +SRC_URI[md5sum] = "2ba44eb0ca96752392e9bf8dc83ba302" +SRC_URI[sha256sum] = "d311c4b557c44c5248ac5436b9e19c391a60d8e4830b6a7f41be16d89c0556de" + +inherit autotools ptest +RDEPENDS_${PN}-ptest += "make" + +do_compile_ptest() { + oe_runmake buildtest-TESTS +} + +do_install_ptest () { + cp ${B}/Makefile ${D}${PTEST_PATH} + install ${B}/test-cmdline ${D}${PTEST_PATH} + install ${B}/test-features ${D}${PTEST_PATH} + install ${B}/ethtool ${D}${PTEST_PATH}/ethtool + sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile +} diff --git a/poky/meta/recipes-extended/findutils/findutils.inc b/poky/meta/recipes-extended/findutils/findutils.inc new file mode 100644 index 000000000..ad3642923 --- /dev/null +++ b/poky/meta/recipes-extended/findutils/findutils.inc @@ -0,0 +1,16 @@ +SUMMARY = "find, locate, and xargs binaries" +DESCRIPTION = "The GNU Find Utilities are the basic directory searching utilities of the GNU operating system. \ +These programs are typically used in conjunction with other programs to provide modular and powerful directory \ +search and file locating capabilities to other commands." +HOMEPAGE = "http://www.gnu.org/software/findutils/" +BUGTRACKER = "http://savannah.gnu.org/bugs/?group=findutils" +SECTION = "console/utils" + +SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz" + +inherit autotools gettext texinfo update-alternatives upstream-version-is-even + +ALTERNATIVE_${PN} = "find xargs" +ALTERNATIVE_PRIORITY = "100" + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch new file mode 100644 index 000000000..8729e1b44 --- /dev/null +++ b/poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch @@ -0,0 +1,30 @@ +From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Apr 2015 17:02:13 -0700 +Subject: [PATCH] Unset need_charset_alias when building for musl + +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 +which actually shoudl be fixed in gnulib and then all downstream +projects will get it eventually. For now we apply the fix to +coreutils + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/gnulib.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: findutils-4.5.14/gl/lib/Makefile.am +=================================================================== +--- findutils-4.5.14.orig/gl/lib/Makefile.am ++++ findutils-4.5.14/gl/lib/Makefile.am +@@ -1220,7 +1220,7 @@ install-exec-localcharset: all-local + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ diff --git a/poky/meta/recipes-extended/findutils/findutils_4.6.0.bb b/poky/meta/recipes-extended/findutils/findutils_4.6.0.bb new file mode 100644 index 000000000..072d3b3c0 --- /dev/null +++ b/poky/meta/recipes-extended/findutils/findutils_4.6.0.bb @@ -0,0 +1,17 @@ +require findutils.inc + +# GPLv2+ (<< 4.2.32), GPLv3+ (>= 4.2.32) +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949" + +DEPENDS = "bison-native" + +SRC_URI += "file://0001-Unset-need_charset_alias-when-building-for-musl.patch" + +SRC_URI[md5sum] = "9936aa8009438ce185bea2694a997fc1" +SRC_URI[sha256sum] = "ded4c9f73731cd48fec3b6bdaccce896473b6d8e337e9612e16cf1431bb1169d" + +# http://savannah.gnu.org/bugs/?27299 +CACHED_CONFIGUREVARS += "${@bb.utils.contains('DISTRO_FEATURES', 'libc-posix-clang-wchar', 'gl_cv_func_wcwidth_works=yes', '', d)}" + +EXTRA_OECONF += "ac_cv_path_SORT=${bindir}/sort" diff --git a/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8327.patch b/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8327.patch new file mode 100644 index 000000000..aaedc88aa --- /dev/null +++ b/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8327.patch @@ -0,0 +1,23 @@ +Upstream-Status: Backport + + +http://bzr.linuxfoundation.org/loggerhead/openprinting/cups-filters/revision/7406 + +Hand applied change to util.c. Fix was for cups-filters but also applied to foomatic-filters. + +CVE: CVE-2015-8327 +Signed-off-by: Armin Kuster <akuster@mvista.com> + +Index: util.c +=================================================================== +--- a/util.c ++++ b/util.c +@@ -31,7 +31,7 @@ + #include <assert.h> + + +-const char* shellescapes = "|;<>&!$\'\"#*?()[]{}"; ++const char* shellescapes = "|;<>&!$\'\"`#*?()[]{}"; + + const char * temp_dir() + { diff --git a/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8560.patch b/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8560.patch new file mode 100644 index 000000000..dc973c459 --- /dev/null +++ b/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8560.patch @@ -0,0 +1,23 @@ +Upstream-Status: Backport + + +http://bzr.linuxfoundation.org/loggerhead/openprinting/cups-filters/revision/7419 + +Hand applied change to util.c. Fix was for cups-filters but also applied to foomatic-filters. + +CVE: CVE-2015-8560 +Signed-off-by: Armin Kuster <akuster@mvista.com> + +Index: util.c +=================================================================== +--- a/util.c ++++ b/util.c +@@ -31,7 +31,7 @@ + #include <assert.h> + + +-const char* shellescapes = "|<>&!$\'\"#*?()[]{}"; ++const char* shellescapes = "|;<>&!$\'\"#*?()[]{}"; + + const char * temp_dir() + { diff --git a/poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb b/poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb new file mode 100644 index 000000000..742c9a5cf --- /dev/null +++ b/poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb @@ -0,0 +1,44 @@ +SUMMARY = "OpenPrinting printer support - filters" +HOMEPAGE = "https://wiki.linuxfoundation.org/openprinting/start" +DESCRIPTION = "Foomatic is a printer database designed to make it easier to set up \ +common printers for use with UNIX-like operating systems.\ +It provides the "glue" between a print spooler (like CUPS or lpr) and \ +the printer, by processing files sent to the printer. \ + \ +This package consists of filters used by the printer spoolers \ +to convert the incoming PostScript data into the printer's native \ +format using a printer-specific, but spooler-independent PPD file. \ +" + +DEPENDS += "cups perl libxml2" +PR = "r1" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://${WORKDIR}/foomatic-filters-${PV}/COPYING;md5=393a5ca445f6965873eca0259a17f833" + +SRC_URI = "http://www.openprinting.org/download/foomatic/foomatic-filters-${PV}.tar.gz" + +SRC_URI += "file://CVE-2015-8560.patch \ + file://CVE-2015-8327.patch \ + " + +SRC_URI[md5sum] = "b05f5dcbfe359f198eef3df5b283d896" +SRC_URI[sha256sum] = "a2e2e53e502571e88eeb9010c45a0d54671f15707ee104f5c9c22b59ea7a33e3" + +UPSTREAM_CHECK_REGEX = "foomatic-filters-(?P<pver>((\d|\d\d)\.*)+)\.tar\.gz" + +inherit autotools pkgconfig + +EXTRA_OECONF += "--disable-file-converter-check --with-file-converter=texttops" + +do_configure_prepend() { + export PERL="${bindir}/env perl" + export CUPS_SERVERBIN=${exec_prefix}/lib/cups # /usr/lib NOT libdir +} + +do_install_append_linuxstdbase() { + install -d ${D}${exec_prefix}/lib/cups/filter + ln -sf ${bindir}/foomatic-rip ${D}${exec_prefix}/lib/cups/filter +} + +FILES_${PN} += "${exec_prefix}/lib/cups/ ${exec_prefix}/lib/ppr/" diff --git a/poky/meta/recipes-extended/gawk/gawk/run-ptest b/poky/meta/recipes-extended/gawk/gawk/run-ptest new file mode 100644 index 000000000..d23f0bf6d --- /dev/null +++ b/poky/meta/recipes-extended/gawk/gawk/run-ptest @@ -0,0 +1,10 @@ +#!/bin/sh + +cd test +for i in `grep -vE "@|^$|#|Gt-dummy" Maketests |awk -F: '{print $1}'`; \ + do LC_ALL=${GAWKLOCALE:-C} LANG=${GAWKLOCALE:-C} srcdir=`pwd` AWK=gawk CMP=cmp \ + make -f Maketests $i >$i.tmp 2>&1; \ + grep -q "Error" $i.tmp; \ + if [ $? -eq 0 ]; then echo "FAIL: $i"; \ + else echo "PASS: $i"; rm -f $i.tmp; fi; \ +done diff --git a/poky/meta/recipes-extended/gawk/gawk_4.2.0.bb b/poky/meta/recipes-extended/gawk/gawk_4.2.0.bb new file mode 100644 index 000000000..27f79a2be --- /dev/null +++ b/poky/meta/recipes-extended/gawk/gawk_4.2.0.bb @@ -0,0 +1,48 @@ +SUMMARY = "GNU awk text processing utility" +DESCRIPTION = "The GNU version of awk, a text processing utility. \ +Awk interprets a special-purpose programming language to do \ +quick and easy text pattern matching and reformatting jobs." +HOMEPAGE = "https://www.gnu.org/software/gawk/" +BUGTRACKER = "bug-gawk@gnu.org" +SECTION = "console/utils" + +# gawk <= 3.1.5: GPLv2 +# gawk >= 3.1.6: GPLv3 +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +DEPENDS += "readline" + +PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr" + +SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \ + file://run-ptest \ +" + +SRC_URI[md5sum] = "0b598c31bc703d66082bd958d4189980" +SRC_URI[sha256sum] = "c88046c6e8396ee548bcb941e16def809b7b55b60a1044b5dd254094f347c7d9" + +inherit autotools gettext texinfo update-alternatives + +FILES_${PN} += "${datadir}/awk" +FILES_${PN}-dev += "${libdir}/${BPN}/*.la" + +ALTERNATIVE_${PN} = "awk" +ALTERNATIVE_TARGET[awk] = "${bindir}/gawk" +ALTERNATIVE_PRIORITY = "100" + +do_install_append() { + # remove the link since we don't package it + rm ${D}${bindir}/awk +} + +inherit ptest + +do_install_ptest() { + mkdir ${D}${PTEST_PATH}/test + for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests inclib.awk; \ + do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \ + done +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch b/poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch new file mode 100644 index 000000000..c3e44fe86 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch @@ -0,0 +1,38 @@ +From 5ef8b85bc98f3bd9a15d5f47e24d3e23ae27c265 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Mon, 18 Jan 2016 01:00:30 -0500 +Subject: [PATCH] configure.ac: do not check local png source + +In oe-core, it did not need to compile local libpng +source in ghostscript, so do not check local png +source, and directly check the existance of shared +libpng library. + +Upstream-Status: Inappropriate [OE-Core specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index bf6d3f5..01df03f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -930,11 +930,11 @@ AC_SUBST(ZLIBDIR) + AC_SUBST(FT_SYS_ZLIB) + + dnl png for the png output device; it also requires zlib +-LIBPNGDIR=src ++LIBPNGDIR=$srcdir/libpng + PNGDEVS='' + PNGDEVS_ALL='png48 png16m pnggray pngmono pngmonod png256 png16 pngalpha' + AC_MSG_CHECKING([for local png library source]) +-if test -f $srcdir/libpng/pngread.c; then ++if false; then + AC_MSG_RESULT([yes]) + SHARE_LIBPNG=0 + LIBPNGDIR=$srcdir/libpng +-- +2.8.1 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-11714.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-11714.patch new file mode 100644 index 000000000..84983c5ae --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-11714.patch @@ -0,0 +1,61 @@ +From 671fd59eb657743aa86fbc1895cb15872a317caa Mon Sep 17 00:00:00 2001 +From: Chris Liddell <chris.liddell@artifex.com> +Date: Thu, 6 Jul 2017 14:54:02 +0100 +Subject: [PATCH] Bug 698158: prevent trying to reloc a freed object + +In the token reader, we pass the scanner state structure around as a +t_struct ref on the Postscript operand stack. + +But we explicitly free the scanner state when we're done, which leaves a +dangling reference on the operand stack and, unless that reference gets +overwritten before the next garbager run, we can end up with the garbager +trying to deal with an already freed object - that can cause a crash, or +memory corruption. +--- + psi/ztoken.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +--- end of original header + +CVE: CVE-2017-11714 + +Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git] + +Signed-off-by: Joe Slater <joe.slater@windriver.com> + +diff --git a/psi/ztoken.c b/psi/ztoken.c +index 4dba7c5..af1ceeb 100644 +--- a/psi/ztoken.c ++++ b/psi/ztoken.c +@@ -107,6 +107,12 @@ token_continue(i_ctx_t *i_ctx_p, scanner_state * pstate, bool save) + int code; + ref token; + ++ /* Since we might free pstate below, and we're dealing with ++ * gc memory referenced by the stack, we need to explicitly ++ * remove the reference to pstate from the stack, otherwise ++ * the garbager will fall over ++ */ ++ make_null(osp); + /* Note that gs_scan_token may change osp! */ + pop(1); /* remove the file or scanner state */ + again: +@@ -183,8 +189,14 @@ ztokenexec_continue(i_ctx_t *i_ctx_p) + static int + tokenexec_continue(i_ctx_t *i_ctx_p, scanner_state * pstate, bool save) + { +- os_ptr op; ++ os_ptr op = osp; + int code; ++ /* Since we might free pstate below, and we're dealing with ++ * gc memory referenced by the stack, we need to explicitly ++ * remove the reference to pstate from the stack, otherwise ++ * the garbager will fall over ++ */ ++ make_null(osp); + /* Note that gs_scan_token may change osp! */ + pop(1); + again: +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-5951.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-5951.patch new file mode 100644 index 000000000..62cc1342a --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-5951.patch @@ -0,0 +1,44 @@ +From bfa6b2ecbe48edc69a7d9d22a12419aed25960b8 Mon Sep 17 00:00:00 2001 +From: Chris Liddell <chris.liddell@artifex.com> +Date: Thu, 6 Apr 2017 16:44:54 +0100 +Subject: [PATCH] Bug 697548: use the correct param list enumerator + +When we encountered dictionary in a ref_param_list, we were using the enumerator +for the "parent" param_list, rather than the enumerator for the param_list +we just created for the dictionary. That parent was usually the stack +list enumerator, and caused a segfault. + +Using the correct enumerator works better. + +Upstream-Status: Backport +CVE: CVE-2017-5951 + +Signed-off-by: Catalin Enache <catalin.enache@windriver.com> +--- + psi/iparam.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/psi/iparam.c b/psi/iparam.c +index 4e63b6d..b2fa85f 100644 +--- a/psi/iparam.c ++++ b/psi/iparam.c +@@ -770,12 +770,13 @@ ref_param_read_typed(gs_param_list * plist, gs_param_name pkey, + gs_param_enumerator_t enumr; + gs_param_key_t key; + ref_type keytype; ++ dict_param_list *dlist = (dict_param_list *) pvalue->value.d.list; + + param_init_enumerator(&enumr); +- if (!(*((iparam_list *) plist)->enumerate) +- ((iparam_list *) pvalue->value.d.list, &enumr, &key, &keytype) ++ if (!(*(dlist->enumerate)) ++ ((iparam_list *) dlist, &enumr, &key, &keytype) + && keytype == t_integer) { +- ((dict_param_list *) pvalue->value.d.list)->int_keys = 1; ++ dlist->int_keys = 1; + pvalue->type = gs_param_type_dict_int_keys; + } + } +-- +2.10.2 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7207.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7207.patch new file mode 100644 index 000000000..a05dc02c6 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7207.patch @@ -0,0 +1,39 @@ +From 0e88bee1304993668fede72498d656a2dd33a35e Mon Sep 17 00:00:00 2001 +From: Ken Sharp <ken.sharp@artifex.com> +Date: Mon, 20 Mar 2017 09:34:11 +0000 +Subject: [PATCH] Ensure a device has raster memory, before trying to read it. + +Bug #697676 "Null pointer dereference in mem_get_bits_rectangle()" + +This is only possible by abusing/mis-using Ghostscript-specific +language extensions, so cannot happen in a general PostScript program. + +Nevertheless, Ghostscript should not crash. So this commit checks the +memory device to see if raster memory has been allocated, before trying +to read from it. + +Upstream-Status: Backport +CVE: CVE-2017-7207 + +Author: Ken Sharp <ken.sharp@artifex.com> +Signed-off-by: Catalin Enache <catalin.enache@windriver.com> +--- + base/gdevmem.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/base/gdevmem.c b/base/gdevmem.c +index 41108ba..183f96d 100644 +--- a/base/gdevmem.c ++++ b/base/gdevmem.c +@@ -605,6 +605,8 @@ mem_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, + GB_PACKING_CHUNKY | GB_COLORS_NATIVE | GB_ALPHA_NONE; + return_error(gs_error_rangecheck); + } ++ if (mdev->line_ptrs == 0x00) ++ return_error(gs_error_rangecheck); + if ((w <= 0) | (h <= 0)) { + if ((w | h) < 0) + return_error(gs_error_rangecheck); +-- +2.10.2 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7975.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7975.patch new file mode 100644 index 000000000..e406086e8 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7975.patch @@ -0,0 +1,37 @@ +From b39be1019b4acc1aa50c6026463c543332e95a31 Mon Sep 17 00:00:00 2001 +From: Catalin Enache <catalin.enache@windriver.com> +Date: Mon, 8 May 2017 16:18:14 +0300 + +Subject: [PATCH] Bug 697693: Prevent SEGV due to integer overflow. + +While building a Huffman table, the start and end points were susceptible +to integer overflow. + +Thank you to Jiaqi for finding this issue and suggesting a patch. + +Upstream-Status: Backport +CVE: CVE-2017-7975 + +Signed-off-by: Catalin Enache <catalin.enache@windriver.com> + +Contents of this patch were extracted from a larger patch which addressed +two CVE's. The context (location of {) was also modified to apply to +ghostscript 9.21. + +Signed-off-by: Joe Slater <joe.slater@windriver.com> + + +--- a/jbig2dec/jbig2_huffman.c ++++ b/jbig2dec/jbig2_huffman.c +@@ -421,8 +421,8 @@ jbig2_build_huffman_table(Jbig2Ctx *ctx, + + if (PREFLEN == CURLEN) { + int RANGELEN = lines[CURTEMP].RANGELEN; +- int start_j = CURCODE << shift; +- int end_j = (CURCODE + 1) << shift; ++ uint32_t start_j = CURCODE << shift; ++ uint32_t end_j = (CURCODE + 1) << shift; + byte eflags = 0; + + if (end_j > max_j) { + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9216.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9216.patch new file mode 100644 index 000000000..1caeb3ef5 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9216.patch @@ -0,0 +1,36 @@ +From 3ebffb1d96ba0cacec23016eccb4047dab365853 Mon Sep 17 00:00:00 2001 +From: Shailesh Mistry <shailesh.mistry@hotmail.co.uk> +Date: Wed, 24 May 2017 19:29:57 +0100 +Subject: [PATCH] Bug 697934: Fix SEGV due to error code being ignored. + +The return code from jbig2_decode_text_region was being ignored so the +code continued to try and parse the invalid file using incomplete/empty +structures. + +Upstream-Status: Backport +CVE: CVE-2017-9216 + +Signed-off-by: Catalin Enache <catalin.enache@windriver.com> +--- + jbig2dec/jbig2_symbol_dict.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/jbig2dec/jbig2_symbol_dict.c b/jbig2dec/jbig2_symbol_dict.c +index 3cc1731..672425d 100644 +--- a/jbig2dec/jbig2_symbol_dict.c ++++ b/jbig2dec/jbig2_symbol_dict.c +@@ -493,8 +493,10 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx, + } + + /* multiple symbols are handled as a text region */ +- jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts, ++ code = jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts, + n_refagg_dicts, image, data, size, GR_stats, as, ws); ++ if (code < 0) ++ goto cleanup4; + + SDNEWSYMS->glyphs[NSYMSDECODED] = image; + refagg_dicts[0]->glyphs[params->SDNUMINSYMS + NSYMSDECODED] = jbig2_image_clone(ctx, SDNEWSYMS->glyphs[NSYMSDECODED]); +-- +2.10.2 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9611.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9611.patch new file mode 100644 index 000000000..58ef04d1f --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9611.patch @@ -0,0 +1,34 @@ +From c7c55972758a93350882c32147801a3485b010fe Mon Sep 17 00:00:00 2001 +From: Chris Liddell <chris.liddell@artifex.com> +Date: Mon, 12 Jun 2017 13:08:40 +0100 +Subject: [PATCH] Bug 698024: bounds check zone pointer in Ins_MIRP() + +--- + base/ttinterp.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- end of original header + +CVE: CVE-2017-9611 + +Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git] + +Signed-off-by: Joe Slater <joe.slater@windriver.com> + +diff --git a/base/ttinterp.c b/base/ttinterp.c +index e56aec6..f6a6d95 100644 +--- a/base/ttinterp.c ++++ b/base/ttinterp.c +@@ -3858,7 +3858,8 @@ static int nInstrCount=0; + /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ + + if ( BOUNDS( args[0], CUR.zp1.n_points ) || +- BOUNDS( args[1]+1, CUR.cvtSize+1 ) ) ++ BOUNDS( args[1]+1, CUR.cvtSize+1 ) || ++ BOUNDS(CUR.GS.rp0, CUR.zp0.n_points) ) + { + CUR.error = TT_Err_Invalid_Reference; + return; +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9612.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9612.patch new file mode 100644 index 000000000..b737cc56b --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9612.patch @@ -0,0 +1,35 @@ +From 98f6da60b9d463c617e631fc254cf6d66f2e8e3c Mon Sep 17 00:00:00 2001 +From: Chris Liddell <chris.liddell@artifex.com> +Date: Mon, 12 Jun 2017 13:15:17 +0100 +Subject: [PATCH] Bug 698026: bounds check zone pointers in Ins_IP() + +--- + base/ttinterp.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- end of original header + +CVE: CVE-2017-9612 + +Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git] + +Signed-off-by: Joe Slater <joe.slater@windriver.com> + +diff --git a/base/ttinterp.c b/base/ttinterp.c +index f6a6d95..e7c9d68 100644 +--- a/base/ttinterp.c ++++ b/base/ttinterp.c +@@ -4129,7 +4129,9 @@ static int nInstrCount=0; + Int point; + (void)args; + +- if ( CUR.top < CUR.GS.loop ) ++ if ( CUR.top < CUR.GS.loop || ++ BOUNDS(CUR.GS.rp1, CUR.zp0.n_points) || ++ BOUNDS(CUR.GS.rp2, CUR.zp1.n_points)) + { + CUR.error = TT_Err_Invalid_Reference; + return; +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9726.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9726.patch new file mode 100644 index 000000000..3e6c65699 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9726.patch @@ -0,0 +1,33 @@ +From 7755e67116e8973ee0e3b22d653df026a84fa01b Mon Sep 17 00:00:00 2001 +From: Chris Liddell <chris.liddell@artifex.com> +Date: Thu, 15 Jun 2017 08:58:31 +0100 +Subject: [PATCH] Bug 698055: bounds check zone pointer in Ins_MDRP + +--- + base/ttinterp.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- end of original header + +CVE: CVE-2017-9726 + +Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git] + +Signed-off-by: Joe Slater <joe.slater@windriver.com> +diff --git a/base/ttinterp.c b/base/ttinterp.c +index e7c9d68..af457e8 100644 +--- a/base/ttinterp.c ++++ b/base/ttinterp.c +@@ -3770,7 +3770,8 @@ static int nInstrCount=0; + + point = (Int)args[0]; + +- if ( BOUNDS( args[0], CUR.zp1.n_points ) ) ++ if ( BOUNDS( args[0], CUR.zp1.n_points ) || ++ BOUNDS( CUR.GS.rp0, CUR.zp0.n_points) ) + { + /* Current version of FreeType silently ignores this out of bounds error + * and drops the instruction, see bug #691121 +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9727.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9727.patch new file mode 100644 index 000000000..a2f7bfa50 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9727.patch @@ -0,0 +1,35 @@ +From 937ccd17ac65935633b2ebc06cb7089b91e17e6b Mon Sep 17 00:00:00 2001 +From: Chris Liddell <chris.liddell@artifex.com> +Date: Thu, 15 Jun 2017 09:05:20 +0100 +Subject: [PATCH] Bug 698056: make bounds check in gx_ttfReader__Read more + robust + +--- + base/gxttfb.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- end of original header + +CVE: CVE-2017-9727 + +Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git] + +Signed-off-by: Joe Slater <joe.slater@windriver.com> + +diff --git a/base/gxttfb.c b/base/gxttfb.c +index 0e9a444..e1561af 100644 +--- a/base/gxttfb.c ++++ b/base/gxttfb.c +@@ -79,7 +79,8 @@ static void gx_ttfReader__Read(ttfReader *self, void *p, int n) + if (!r->error) { + if (r->extra_glyph_index != -1) { + q = r->glyph_data.bits.data + r->pos; +- r->error = (r->glyph_data.bits.size - r->pos < n ? ++ r->error = ((r->pos >= r->glyph_data.bits.size || ++ r->glyph_data.bits.size - r->pos < n) ? + gs_note_error(gs_error_invalidfont) : 0); + if (r->error == 0) + memcpy(p, q, n); +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9739.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9739.patch new file mode 100644 index 000000000..69a94df7b --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9739.patch @@ -0,0 +1,37 @@ +From c501a58f8d5650c8ba21d447c0d6f07eafcb0f15 Mon Sep 17 00:00:00 2001 +From: Chris Liddell <chris.liddell@artifex.com> +Date: Fri, 16 Jun 2017 08:29:25 +0100 +Subject: [PATCH] Bug 698063: Bounds check Ins_JMPR + +--- + base/ttinterp.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- end of original header + +CVE: CVE-2017-9739 + +Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git] + +Signed-off-by: Joe Slater <joe.slater@windriver.com> + +diff --git a/base/ttinterp.c b/base/ttinterp.c +index af457e8..adf3f0c 100644 +--- a/base/ttinterp.c ++++ b/base/ttinterp.c +@@ -1794,6 +1794,12 @@ static int nInstrCount=0; + + static void Ins_JMPR( INS_ARG ) + { ++ if ( BOUNDS(CUR.IP + args[0], CUR.codeSize ) ) ++ { ++ CUR.error = TT_Err_Invalid_Reference; ++ return; ++ } ++ + CUR.IP += (Int)(args[0]); + CUR.step_ins = FALSE; + +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9835.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9835.patch new file mode 100644 index 000000000..7c65690c6 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9835.patch @@ -0,0 +1,125 @@ +From cfde94be1d4286bc47633c6e6eaf4e659bd78066 Mon Sep 17 00:00:00 2001 +From: Chris Liddell <chris.liddell@artifex.com> +Date: Wed, 7 Jun 2017 14:55:12 +0100 +Subject: [PATCH] Bug 697985: bounds check the array allocations methods + +The clump allocator has four allocation functions that use 'number of elements' +and 'size of elements' parameters (rather than a simple 'number of bytes'). + +Those need specific bounds checking. +--- + base/gsalloc.c | 42 ++++++++++++++++++++++++++++-------------- + 1 file changed, 28 insertions(+), 14 deletions(-) + +--- end of original header + +CVE: CVE-2017-9835 + +Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git] + +Signed-off-by: Joe Slater <joe.slater@windriver.com> + +diff --git a/base/gsalloc.c b/base/gsalloc.c +index 741ba00..10c04dd 100644 +--- a/base/gsalloc.c ++++ b/base/gsalloc.c +@@ -1248,19 +1248,32 @@ i_alloc_struct_immovable(gs_memory_t * mem, gs_memory_type_ptr_t pstype, + alloc_trace("|+<.", imem, cname, pstype, size, obj); + return obj; + } ++ ++static inline bool ++alloc_array_check_size(ulong num_elements, ulong elt_size, ulong *lsize) ++{ ++ int64_t s = (int64_t)num_elements * elt_size; ++ if (s > max_uint) { ++ return false; ++ } ++ *lsize = (ulong)s; ++ return true; ++} ++ + static byte * + i_alloc_byte_array(gs_memory_t * mem, uint num_elements, uint elt_size, + client_name_t cname) + { + gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem; + obj_header_t *obj; +- ++ ulong lsize; + #ifdef MEMENTO + if (Memento_failThisEvent()) + return NULL; + #endif +- +- obj = alloc_obj(imem, (ulong) num_elements * elt_size, ++ if (alloc_array_check_size(num_elements, elt_size, &lsize) == false) ++ return NULL; ++ obj = alloc_obj(imem, lsize, + &st_bytes, ALLOC_DIRECT, cname); + + if_debug6m('A', mem, "[a%d:+b.]%s -bytes-*(%lu=%u*%u) = 0x%lx\n", +@@ -1275,13 +1288,14 @@ i_alloc_byte_array_immovable(gs_memory_t * mem, uint num_elements, + { + gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem; + obj_header_t *obj; +- ++ ulong lsize; + #ifdef MEMENTO + if (Memento_failThisEvent()) + return NULL; + #endif +- +- obj = alloc_obj(imem, (ulong) num_elements * elt_size, ++ if (alloc_array_check_size(num_elements, elt_size, &lsize) == false) ++ return NULL; ++ obj = alloc_obj(imem, lsize, + &st_bytes, ALLOC_IMMOVABLE | ALLOC_DIRECT, + cname); + +@@ -1297,7 +1311,7 @@ i_alloc_struct_array(gs_memory_t * mem, uint num_elements, + { + gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem; + obj_header_t *obj; +- ++ ulong lsize; + #ifdef MEMENTO + if (Memento_failThisEvent()) + return NULL; +@@ -1311,9 +1325,9 @@ i_alloc_struct_array(gs_memory_t * mem, uint num_elements, + return NULL; /* fail */ + } + #endif +- obj = alloc_obj(imem, +- (ulong) num_elements * pstype->ssize, +- pstype, ALLOC_DIRECT, cname); ++ if (alloc_array_check_size(num_elements, pstype->ssize, &lsize) == false) ++ return NULL; ++ obj = alloc_obj(imem, lsize, pstype, ALLOC_DIRECT, cname); + if_debug7m('A', mem, "[a%d:+<.]%s %s*(%lu=%u*%u) = 0x%lx\n", + alloc_trace_space(imem), client_name_string(cname), + struct_type_name_string(pstype), +@@ -1327,16 +1341,16 @@ i_alloc_struct_array_immovable(gs_memory_t * mem, uint num_elements, + { + gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem; + obj_header_t *obj; +- ++ ulong lsize; + #ifdef MEMENTO + if (Memento_failThisEvent()) + return NULL; + #endif + + ALLOC_CHECK_SIZE(mem,pstype); +- obj = alloc_obj(imem, +- (ulong) num_elements * pstype->ssize, +- pstype, ALLOC_IMMOVABLE | ALLOC_DIRECT, cname); ++ if (alloc_array_check_size(num_elements, pstype->ssize, &lsize) == false) ++ return NULL; ++ obj = alloc_obj(imem, lsize, pstype, ALLOC_IMMOVABLE | ALLOC_DIRECT, cname); + if_debug7m('A', mem, "[a%d|+<.]%s %s*(%lu=%u*%u) = 0x%lx\n", + alloc_trace_space(imem), client_name_string(cname), + struct_type_name_string(pstype), +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h new file mode 100644 index 000000000..a05de29de --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 8 +#define ARCH_ALIGN_PTR_MOD 8 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 3 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 8 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 0 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h new file mode 100644 index 000000000..e8772cd95 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 4 +#define ARCH_ALIGN_PTR_MOD 4 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 2 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 4 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 0 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h new file mode 100644 index 000000000..359097f35 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 4 +#define ARCH_ALIGN_PTR_MOD 4 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 2 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 4 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 1 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch new file mode 100644 index 000000000..c4794e7d8 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch @@ -0,0 +1,19 @@ +Remove hardcode path refer to host to avoid host contamination. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- +diff --git a/devices/devs.mak b/devices/devs.mak +index 3070d2e..df663f0 100644 +--- a/devices/devs.mak ++++ b/devices/devs.mak +@@ -546,7 +546,7 @@ $(DEVOBJ)gdevxalt.$(OBJ) : $(DEVSRC)gdevxalt.c $(GDEVX) $(math__h) $(memory__h)\ + ### NON PORTABLE, ONLY UNIX WITH GCC SUPPORT + + $(DEVOBJ)X11.so : $(x11alt_) $(x11_) $(DEVS_MAK) $(MAKEDIRS) +- $(CCLD) $(LDFLAGS) -shared -o $(DEVOBJ)X11.so $(x11alt_) $(x11_) -L/usr/X11R6/lib -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS) ++ $(CCLD) $(LDFLAGS) -shared -o $(DEVOBJ)X11.so $(x11alt_) $(x11_) -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS) + + ###### --------------- Memory-buffered printer devices --------------- ###### + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch new file mode 100644 index 000000000..d97d4ecd7 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch @@ -0,0 +1,36 @@ +base/genht.c: add a preprocessor define to allow fopen calling + +The commit in upstream: +http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=773c69e46e70bdd5482676437dafd2ca83397643 + +Replace all fopen calls with gp_fopen and add a preprocessor define so +that any unintential calls directly to fopen will cause an error. + +Only exceptions are those in the platform specific code, and mkromfs.c. +This patch add a preprocessor define to allow fopen calling in base/genht.c. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + base/genht.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/base/genht.c b/base/genht.c +index 4b04085..cc82fff 100644 +--- a/base/genht.c ++++ b/base/genht.c +@@ -16,6 +16,10 @@ + + /* Generate C code for compiling halftones into ROM. */ + #include "malloc_.h" ++ ++/* prevent gp.h from defining fopen */ ++#define fopen fopen ++ + #include "stdio_.h" + #include "string_.h" + #include "gscdefs.h" +-- +1.8.1.2 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch new file mode 100644 index 000000000..a1c9368cc --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch @@ -0,0 +1,31 @@ +Subject: [PATCH] Don't build-depend on libgcrypt, as nothing is used from it + +Backported from http://www.cups.org/strfiles.php/3308/cups-no-gcrypt.patch + +This addresses the cryto dependency seen during build. + +Upstream-Status: Backport + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> + +Rebase the patch to ghostscript-9.15 +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + cups/libs/cups/http-private.h | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/cups/libs/cups/http-private.h b/cups/libs/cups/http-private.h +index 99a85c3..a674852 100644 +--- a/cups/libs/cups/http-private.h ++++ b/cups/libs/cups/http-private.h +@@ -80,7 +80,6 @@ typedef int socklen_t; + # elif defined HAVE_GNUTLS + # include <gnutls/gnutls.h> + # include <gnutls/x509.h> +-# include <gcrypt.h> + # elif defined(HAVE_CDSASSL) + # include <CoreFoundation/CoreFoundation.h> + # include <Security/Security.h> +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch new file mode 100644 index 000000000..b4c14ea23 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch @@ -0,0 +1,29 @@ +Import patch from windriver linux for cross compilation, and split patches +into oe way under different directories such as i586, powerpc etc according +to Richard's opinion. + +Upstream-Status: Pending + +Signed-off-by: Kang Kai <kai.kang@windriver.com> +Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> + +# Author: Chi Xu <chi.xu@windriver.com> +# Date: Feb 26 2010 +# Summary: Generate arch.h for ppc32 +# + +Index: ghostscript-9.21/base/lib.mak +=================================================================== +--- ghostscript-9.21.orig/base/lib.mak ++++ ghostscript-9.21/base/lib.mak +@@ -73,8 +73,8 @@ arch_h=$(GLGEN)arch.h + stdpre_h=$(GLSRC)stdpre.h + stdint__h=$(GLSRC)stdint_.h $(std_h) + +-$(GLGEN)arch.h : $(GENARCH_XE) +- $(EXP)$(GENARCH_XE) $(GLGEN)arch.h $(TARGET_ARCH_FILE) ++##$(GLGEN)arch.h : $(GENARCH_XE) ++## $(EXP)$(GENARCH_XE) $(GLGEN)arch.h $(TARGET_ARCH_FILE) + + # Platform interfaces + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch new file mode 100644 index 000000000..3ec395640 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch @@ -0,0 +1,40 @@ +From 14937d9247330065359ca0fb648c28dfa5c3b224 Mon Sep 17 00:00:00 2001 +From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com> +Date: Tue, 13 Dec 2016 18:16:41 +0900 +Subject: [PATCH] ghostscript-9.15-parallel-make + +From 767bdf8a412b0cce2b734998e9b7e55abeaf932c Mon Sep 17 00:00:00 2001 +From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com> +Date: Tue, 13 Dec 2016 17:55:54 +0900 +Subject: [PATCH] Robert Yang <liezhi.yang@windriver.com> Date: Fri, 30 Jan +2015 00:40:22 -0800 Subject: [PATCH] contrib.mak: fix for parallel build + +Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com> +Upstream-Status: Pending +--- + contrib/contrib.mak | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/contrib/contrib.mak b/contrib/contrib.mak +index 55415b3..0b6b5ae 100644 +--- a/contrib/contrib.mak ++++ b/contrib/contrib.mak +@@ -1099,6 +1099,7 @@ $(DEVOBJ)dviprlib.$(OBJ) : $(JAPSRC)dviprlib.c $(JAPSRC)dviprlib.h \ + $(DEVCC) $(O_)$@ $(C_) $(JAPSRC)dviprlib.c + + extra-dmprt-install: install-libdata ++ mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib + $(INSTALL_DATA) $(JAPSRC)dmp_init.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1 + $(INSTALL_DATA) $(JAPSRC)dmp_site.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1 + $(INSTALL_DATA) $(JAPSRC)escp_24.src $(DESTDIR)$(gsdatadir)$(D)lib || exit 1 +@@ -1267,6 +1268,7 @@ $(DEVOBJ)gdevalps.$(OBJ) : $(JAPSRC)gdevalps.c $(PDEVH) \ + ### ----------------- Additional .upp files ---------------- ### + + extra-upp-install: install-libdata ++ mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib + for f in $(CONTRIBSRC)uniprint$(D)*.upp; do \ + $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)$(D)lib || exit 1; \ + done +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch new file mode 100644 index 000000000..d78648200 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch @@ -0,0 +1,30 @@ +From 5d5c83c89be0cff29dde2267fa168e6f7146be8c Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Mon, 4 May 2015 22:31:48 -0700 +Subject: [PATCH] base/gendev.c: fix for -Werror=return-type + +Fixed: +base/gendev.c:80:1: error: return type defaults to 'int' [-Werror=return-type] + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + base/gendev.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/base/gendev.c b/base/gendev.c +index 68a745f..8058b5a 100644 +--- a/base/gendev.c ++++ b/base/gendev.c +@@ -77,6 +77,7 @@ static const char *indent_item = ""; + /* Forward definitions */ + void add_entry(config *, const char *, const char *, bool); + ++int + main(int argc, char *argv[]) + { + config conf; +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-native-fix-disable-system-libtiff.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-native-fix-disable-system-libtiff.patch new file mode 100644 index 000000000..bff3e6176 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-native-fix-disable-system-libtiff.patch @@ -0,0 +1,37 @@ +ghostscript-native:fix disable-system-libtiff + +Modify configure to add the check to make sure +ghostscrip could work while system-libtiff is +disabled. + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Updated to apply to ghostscript 9.21. + +Signed-off-by: Joe Slater <joe.slater@windriver.com> + +Upstream-Status: Pending + + + +--- a/configure.ac ++++ b/configure.ac +@@ -1259,6 +1259,7 @@ case "x$with_system_libtiff" in + esac + + if test x"$SHARE_LIBTIFF" = x"0" ; then ++ if test -e $LIBTIFFDIR/configure; then + echo "Running libtiff configure script..." + olddir=`pwd` + if ! test -d "$LIBTIFFCONFDIR" ; then +@@ -1272,6 +1273,10 @@ if test x"$SHARE_LIBTIFF" = x"0" ; then + cd "$olddir" + echo + echo "Continuing with Ghostscript configuration..." ++ else ++ AC_MSG_NOTICE([Could not find local copy of libtiff. ++Disabling tiff output devices.]) ++ fi + fi + + AC_SUBST(SHARE_LIBTIFF) diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-prevent_recompiling.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-prevent_recompiling.patch new file mode 100644 index 000000000..f2c6d04e0 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-prevent_recompiling.patch @@ -0,0 +1,96 @@ +Just use commands provided by ghostscript-native, preventing recompile them when +compile ghostscript. +Way to enable cross compile. + +Upstream-Status: Pending + +Signed-off-by: Kang Kai <kai.kang@windriver.com> +Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> + +Rebase to 9.19 +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Rebase to 9.21 +Signed-off-by: Joe Slater <joe.slater@windriver.com> + +--- a/base/unix-aux.mak ++++ b/base/unix-aux.mak +@@ -66,45 +66,45 @@ $(GLOBJ)gp_sysv.$(OBJ): $(GLSRC)gp_sysv. + + # -------------------------- Auxiliary programs --------------------------- # + +-$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(UNIX_AUX_MAK) $(MAKEDIRS) +- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(ECHOGS_XE) $(GLSRC)echogs.c $(AUXEXTRALIBS) +- ++#$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(UNIX_AUX_MAK) $(MAKEDIRS) ++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(ECHOGS_XE) $(GLSRC)echogs.c $(AUXEXTRALIBS) ++# + # On the RS/6000 (at least), compiling genarch.c with gcc with -O + # produces a buggy executable. +-$(GENARCH_XE): $(GLSRC)genarch.c $(AK) $(GENARCH_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS) +- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS) +- +-$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS) +- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS) +- +-$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS) +- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS) +- +-$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS) +- $(CCAUX_) $(GENHT_CFLAGS) $(O_)$(GENHT_XE) $(GLSRC)genht.c $(AUXEXTRALIBS) +- ++#$(GENARCH_XE): $(GLSRC)genarch.c $(AK) $(GENARCH_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS) ++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS) ++# ++#$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS) ++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS) ++# ++#$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS) ++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS) ++# ++#$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS) ++# $(CCAUX_) $(GENHT_CFLAGS) $(O_)$(GENHT_XE) $(GLSRC)genht.c $(AUXEXTRALIBS) ++# + # To get GS to use the system zlib, you remove/hide the gs/zlib directory + # which means that the mkromfs build can't find the zlib source it needs. + # So it's split into two targets, one using the zlib source directly..... +-MKROMFS_OBJS_0=$(MKROMFS_ZLIB_OBJS) $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \ +- $(AUX)gscdefs.$(OBJ) $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \ +- $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) $(AUX)memento.$(OBJ) +- +-$(MKROMFS_XE)_0: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_0) $(UNIX_AUX_MAK) $(MAKEDIRS) +- $(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_0 $(MKROMFS_OBJS_0) $(AUXEXTRALIBS) +- ++#MKROMFS_OBJS_0=$(MKROMFS_ZLIB_OBJS) $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \ ++# $(AUX)gscdefs.$(OBJ) $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \ ++# $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) $(AUX)memento.$(OBJ) ++# ++#$(MKROMFS_XE)_0: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_0) $(UNIX_AUX_MAK) $(MAKEDIRS) ++# $(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_0 $(MKROMFS_OBJS_0) $(AUXEXTRALIBS) ++# + # .... and one using the zlib library linked via the command line +-MKROMFS_OBJS_1=$(AUX)gscdefs.$(OBJ) \ +- $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \ +- $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \ +- $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) +- +-$(MKROMFS_XE)_1: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_1) $(UNIX_AUX_MAK) $(MAKEDIRS) +- $(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_1 $(MKROMFS_OBJS_1) $(AUXEXTRALIBS) +- +-$(MKROMFS_XE): $(MKROMFS_XE)_$(SHARE_ZLIB) $(UNIX_AUX_MAK) $(MAKEDIRS) +- $(CP_) $(MKROMFS_XE)_$(SHARE_ZLIB) $(MKROMFS_XE) +- ++#MKROMFS_OBJS_1=$(AUX)gscdefs.$(OBJ) \ ++# $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \ ++# $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \ ++# $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) ++# ++#$(MKROMFS_XE)_1: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_1) $(UNIX_AUX_MAK) $(MAKEDIRS) ++# $(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_1 $(MKROMFS_OBJS_1) $(AUXEXTRALIBS) ++# ++#$(MKROMFS_XE): $(MKROMFS_XE)_$(SHARE_ZLIB) $(UNIX_AUX_MAK) $(MAKEDIRS) ++# $(CP_) $(MKROMFS_XE)_$(SHARE_ZLIB) $(MKROMFS_XE) ++# + # Query the environment to construct gconfig_.h. + # These are all defined conditionally (except the JasPER one), so that + # they can be overridden by settings from the configure script. diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h new file mode 100644 index 000000000..5817b7a6d --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h @@ -0,0 +1,41 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 4 +#define ARCH_ALIGN_PTR_MOD 4 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 4 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 2 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 4 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 0 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/i686 b/poky/meta/recipes-extended/ghostscript/ghostscript/i686 new file mode 120000 index 000000000..87aaca590 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/i686 @@ -0,0 +1 @@ +i586
\ No newline at end of file diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h new file mode 100644 index 000000000..63232fdfa --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 4 +#define ARCH_ALIGN_PTR_MOD 4 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 4 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 2 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 4 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 1 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h new file mode 100644 index 000000000..3ec810168 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 4 +#define ARCH_ALIGN_PTR_MOD 4 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 4 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 2 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 4 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 0 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32eb/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32eb/objarch.h new file mode 100644 index 000000000..0d0a16bfa --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32eb/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 8 +#define ARCH_ALIGN_PTR_MOD 8 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 3 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 8 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 1 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32el/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32el/objarch.h new file mode 100644 index 000000000..a05de29de --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32el/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 8 +#define ARCH_ALIGN_PTR_MOD 8 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 3 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 8 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 0 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64eb/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64eb/objarch.h new file mode 100644 index 000000000..0d0a16bfa --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64eb/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 8 +#define ARCH_ALIGN_PTR_MOD 8 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 3 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 8 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 1 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64el/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64el/objarch.h new file mode 100644 index 000000000..a05de29de --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64el/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 8 +#define ARCH_ALIGN_PTR_MOD 8 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 3 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 8 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 0 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32eb/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32eb/objarch.h new file mode 100644 index 000000000..b8b637cca --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32eb/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 4 +#define ARCH_ALIGN_PTR_MOD 4 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 2 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 4 +#define ARCH_SIZEOF_PTR 4 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 1 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32el/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32el/objarch.h new file mode 100644 index 000000000..29f90ddf8 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32el/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 4 +#define ARCH_ALIGN_PTR_MOD 4 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 2 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 4 +#define ARCH_SIZEOF_PTR 4 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 0 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mkdir-p.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/mkdir-p.patch new file mode 100644 index 000000000..5a7eab1c2 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mkdir-p.patch @@ -0,0 +1,36 @@ +ghostscript: allow directories to be created more than once + +When doing parallel builds, we might try to create directories +more than once. This should not cause an error. + +Upstream-Status: Pending + +Signed-off-by: Joe Slater <joe.slater@windriver.com> + + +--- a/base/unix-end.mak ++++ b/base/unix-end.mak +@@ -17,15 +17,14 @@ + UNIX_END_MAK=$(GLSRC)unix-end.mak $(TOP_MAKEFILES) + # Define the rule for building standard configurations. + directories: $(UNIX_END_MAK) +- @if test "$(BINDIR)" != "" -a ! -d $(BINDIR); then mkdir $(BINDIR); fi +- @if test "$(GLGENDIR)" != "" -a ! -d $(GLGENDIR); then mkdir $(GLGENDIR); fi +- @if test "$(GLOBJDIR)" != "" -a ! -d $(GLOBJDIR); then mkdir $(GLOBJDIR); fi +- @if test "$(DEVGENDIR)" != "" -a ! -d $(DEVGENDIR); then mkdir $(DEVGENDIR); fi +- @if test "$(DEVOBJDIR)" != "" -a ! -d $(DEVOBJDIR); then mkdir $(DEVOBJDIR); fi +- @if test "$(AUXDIR)" != "" -a ! -d $(AUXDIR); then mkdir $(AUXDIR); fi +- @if test "$(PSGENDIR)" != "" -a ! -d $(PSGENDIR); then mkdir $(PSGENDIR); fi +- @if test "$(PSGENDIR)" != "" -a ! -d $(PSGENDIR)/cups; then mkdir $(PSGENDIR)/cups; fi +- @if test "$(PSOBJDIR)" != "" -a ! -d $(PSOBJDIR); then mkdir $(PSOBJDIR); fi ++ @if test "$(BINDIR)" != "" -a ! -d $(BINDIR); then mkdir -p $(BINDIR); fi ++ @if test "$(GLGENDIR)" != "" -a ! -d $(GLGENDIR); then mkdir -p $(GLGENDIR); fi ++ @if test "$(GLOBJDIR)" != "" -a ! -d $(GLOBJDIR); then mkdir -p $(GLOBJDIR); fi ++ @if test "$(DEVGENDIR)" != "" -a ! -d $(DEVGENDIR); then mkdir -p $(DEVGENDIR); fi ++ @if test "$(DEVOBJDIR)" != "" -a ! -d $(DEVOBJDIR); then mkdir -p $(DEVOBJDIR); fi ++ @if test "$(AUXDIR)" != "" -a ! -d $(AUXDIR); then mkdir -p $(AUXDIR); fi ++ @if test "$(PSGENDIR)" != "" -a ! -d $(PSGENDIR)/cups; then mkdir -p $(PSGENDIR)/cups; fi ++ @if test "$(PSOBJDIR)" != "" -a ! -d $(PSOBJDIR); then mkdir -p $(PSOBJDIR); fi + + + gs: .gssubtarget $(UNIX_END_MAK) diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h new file mode 100644 index 000000000..3ec810168 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 4 +#define ARCH_ALIGN_PTR_MOD 4 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 4 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 2 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 4 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 0 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h new file mode 100644 index 000000000..359097f35 --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 4 +#define ARCH_ALIGN_PTR_MOD 4 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 2 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 4 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 1 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h new file mode 100644 index 000000000..0d0a16bfa --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 8 +#define ARCH_ALIGN_PTR_MOD 8 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 3 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 8 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 1 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h new file mode 100644 index 000000000..a05de29de --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h @@ -0,0 +1,40 @@ +/* Parameters derived from machine and compiler architecture. */ +/* This file is generated mechanically by genarch.c. */ + + /* ---------------- Scalar alignments ---------------- */ + +#define ARCH_ALIGN_SHORT_MOD 2 +#define ARCH_ALIGN_INT_MOD 4 +#define ARCH_ALIGN_LONG_MOD 8 +#define ARCH_ALIGN_PTR_MOD 8 +#define ARCH_ALIGN_FLOAT_MOD 4 +#define ARCH_ALIGN_DOUBLE_MOD 8 + + /* ---------------- Scalar sizes ---------------- */ + +#define ARCH_LOG2_SIZEOF_CHAR 0 +#define ARCH_LOG2_SIZEOF_SHORT 1 +#define ARCH_LOG2_SIZEOF_INT 2 +#define ARCH_LOG2_SIZEOF_LONG 3 +#define ARCH_LOG2_SIZEOF_LONG_LONG 3 +#define ARCH_SIZEOF_GX_COLOR_INDEX 8 +#define ARCH_SIZEOF_PTR 8 +#define ARCH_SIZEOF_FLOAT 4 +#define ARCH_SIZEOF_DOUBLE 8 +#define ARCH_FLOAT_MANTISSA_BITS 24 +#define ARCH_DOUBLE_MANTISSA_BITS 53 + + /* ---------------- Unsigned max values ---------------- */ + +#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0) +#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0) +#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0) +#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0) + + /* ---------------- Miscellaneous ---------------- */ + +#define ARCH_IS_BIG_ENDIAN 0 +#define ARCH_PTRS_ARE_SIGNED 0 +#define ARCH_FLOATS_ARE_IEEE 1 +#define ARCH_ARITH_RSHIFT 2 +#define ARCH_DIV_NEG_POS_TRUNCATES 1 diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript_9.21.bb b/poky/meta/recipes-extended/ghostscript/ghostscript_9.21.bb new file mode 100644 index 000000000..50ec7e20c --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript_9.21.bb @@ -0,0 +1,136 @@ +SUMMARY = "The GPL Ghostscript PostScript/PDF interpreter" +DESCRIPTION = "Ghostscript is used for PostScript/PDF preview and printing. Usually as \ +a back-end to a program such as ghostview, it can display PostScript and PDF \ +documents in an X11 environment. \ +\ +Furthermore, it can render PostScript and PDF files as graphics to be printed \ +on non-PostScript printers. Supported printers include common \ +dot-matrix, inkjet and laser models. \ +" +HOMEPAGE = "http://www.ghostscript.com" +SECTION = "console/utils" + +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://LICENSE;md5=70dc2bac4d0ce4448da873cd86b123fc" + +DEPENDS = "ghostscript-native tiff jpeg fontconfig cups libpng" +DEPENDS_class-native = "libpng-native" + +UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases" +UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar" + +SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs921/${BPN}-${PV}.tar.gz \ + file://ghostscript-9.15-parallel-make.patch \ + file://ghostscript-9.16-Werror-return-type.patch \ + file://do-not-check-local-libpng-source.patch \ + file://avoid-host-contamination.patch \ + file://mkdir-p.patch \ +" + +SRC_URI = "${SRC_URI_BASE} \ + file://ghostscript-9.21-prevent_recompiling.patch \ + file://ghostscript-9.02-genarch.patch \ + file://objarch.h \ + file://cups-no-gcrypt.patch \ + file://CVE-2017-7207.patch \ + file://CVE-2017-5951.patch \ + file://CVE-2017-7975.patch \ + file://CVE-2017-9216.patch \ + file://CVE-2017-9611.patch \ + file://CVE-2017-9612.patch \ + file://CVE-2017-9739.patch \ + file://CVE-2017-9726.patch \ + file://CVE-2017-9727.patch \ + file://CVE-2017-9835.patch \ + file://CVE-2017-11714.patch \ + " + +SRC_URI_class-native = "${SRC_URI_BASE} \ + file://ghostscript-9.21-native-fix-disable-system-libtiff.patch \ + file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \ + " + +SRC_URI[md5sum] = "5f213281761d2750fcf27476c404d17f" +SRC_URI[sha256sum] = "02bceadbc4dddeb6f2eec9c8b1623d945d355ca11b8b4df035332b217d58ce85" + +# Put something like +# +# PACKAGECONFIG_append_pn-ghostscript = " x11" +# +# in local.conf to enable building with X11. Be careful. The order +# of the overrides matters! +# +#PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" +PACKAGECONFIG_class-native = "" + +PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \ + --without-x, virtual/libx11 libxext libxt gtk+3\ + " + +EXTRA_OECONF = "--with-system-libtiff --without-jbig2dec \ + --with-fontpath=${datadir}/fonts \ + --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \ + --with-cups-datadir=${datadir}/cups \ + CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \ + " + +EXTRA_OECONF_append_mipsarcho32 = " --with-large_color_index=0" + +# Explicity disable libtiff, fontconfig, +# freetype, cups for ghostscript-native +EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \ + --without-jbig2dec \ + --with-fontpath=${datadir}/fonts \ + --without-libidn --disable-fontconfig \ + --disable-freetype --disable-cups" + +# This has been fixed upstream but for now we need to subvert the check for time.h +# http://bugs.ghostscript.com/show_bug.cgi?id=692443 +# http://bugs.ghostscript.com/show_bug.cgi?id=692426 +CFLAGS += "-DHAVE_SYS_TIME_H=1" +BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1" + +inherit autotools + +do_configure_prepend () { + mkdir -p obj + mkdir -p soobj + if [ -e ${WORKDIR}/objarch.h ]; then + cp ${WORKDIR}/objarch.h obj/arch.h + fi +} + +do_configure_append () { + # copy tools from the native ghostscript build + if [ "${PN}" != "ghostscript-native" ]; then + mkdir -p obj/aux soobj + for i in genarch genconf mkromfs echogs gendev genht; do + cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i + done + fi +} + +do_install_append () { + mkdir -p ${D}${datadir}/ghostscript/${PV}/ + cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/ + cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/ +} + +do_compile_class-native () { + mkdir -p obj + for i in genarch genconf mkromfs echogs gendev genht; do + oe_runmake obj/aux/$i + done +} + +do_install_class-native () { + install -d ${D}${bindir}/ghostscript-${PV} + for i in genarch genconf mkromfs echogs gendev genht; do + install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i + done +} + +BBCLASSEXTEND = "native" + +# ghostscript does not supports "arc" +COMPATIBLE_HOST = "^(?!arc).*" diff --git a/poky/meta/recipes-extended/go-examples/go-helloworld_0.1.bb b/poky/meta/recipes-extended/go-examples/go-helloworld_0.1.bb new file mode 100644 index 000000000..ab70ea98a --- /dev/null +++ b/poky/meta/recipes-extended/go-examples/go-helloworld_0.1.bb @@ -0,0 +1,20 @@ +DESCRIPTION = "This is a simple example recipe that cross-compiles a Go program." +SECTION = "examples" +HOMEPAGE = "https://golang.org/" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "git://${GO_IMPORT}" +SRCREV = "46695d81d1fae905a270fb7db8a4d11a334562fe" +UPSTREAM_CHECK_COMMITS = "1" + +GO_IMPORT = "github.com/golang/example" +GO_INSTALL = "${GO_IMPORT}/hello" + +inherit go + +# This is just to make clear where this example is +do_install_append() { + mv ${D}${bindir}/hello ${D}${bindir}/${BPN} +} diff --git a/poky/meta/recipes-extended/gperf/gperf_3.1.bb b/poky/meta/recipes-extended/gperf/gperf_3.1.bb new file mode 100644 index 000000000..f61b2a329 --- /dev/null +++ b/poky/meta/recipes-extended/gperf/gperf_3.1.bb @@ -0,0 +1,18 @@ +DESCRIPTION = "GNU gperf is a perfect hash function generator" +HOMEPAGE = "http://www.gnu.org/software/gperf" +SUMMARY = "Generate a perfect hash function from a set of keywords" +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://src/main.cc;beginline=8;endline=19;md5=dec8f611845d047387ed56b5b85fa99b" + +SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz" +SRC_URI[md5sum] = "9e251c0a618ad0824b51117d5d9db87e" +SRC_URI[sha256sum] = "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2" + +inherit autotools + +# The nested configures don't find the parent aclocal.m4 out of the box, so tell +# it where to look explicitly (mirroring the behaviour of upstream's Makefile.devel). +EXTRA_AUTORECONF += " -I ${S} --exclude=aclocal" + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch new file mode 100644 index 000000000..ba1a4bab4 --- /dev/null +++ b/poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch @@ -0,0 +1,33 @@ +From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Apr 2015 17:02:13 -0700 +Subject: [PATCH] Unset need_charset_alias when building for musl + +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 +which actually shoudl be fixed in gnulib and then all downstream +projects will get it eventually. For now we apply the fix to +coreutils + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/gnulib.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/gnulib.mk b/lib/gnulib.mk +index e1d74db..c0e92dd 100644 +--- a/lib/gnulib.mk ++++ b/lib/gnulib.mk +@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/grep/grep_3.1.bb b/poky/meta/recipes-extended/grep/grep_3.1.bb new file mode 100644 index 000000000..71810dc65 --- /dev/null +++ b/poky/meta/recipes-extended/grep/grep_3.1.bb @@ -0,0 +1,47 @@ +SUMMARY = "GNU grep utility" +HOMEPAGE = "http://savannah.gnu.org/projects/grep/" +BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep" +SECTION = "console/utils" +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=8006d9c814277c1bfc4ca22af94b59ee" + +SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \ + file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ + " + +SRC_URI[md5sum] = "feca7b3e7c7f4aab2b42ecbfc513b070" +SRC_URI[sha256sum] = "db625c7ab3bb3ee757b3926a5cfa8d9e1c3991ad24707a83dde8a5ef2bf7a07e" + +inherit autotools gettext texinfo pkgconfig + +# Fix "Argument list too long" error when len(TMPDIR) = 410 +acpaths = "-I ./m4" + +do_configure_prepend () { + rm -f ${S}/m4/init.m4 +} + +do_install () { + autotools_do_install + if [ "${base_bindir}" != "${bindir}" ]; then + install -d ${D}${base_bindir} + mv ${D}${bindir}/grep ${D}${base_bindir}/grep + mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep + mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep + rmdir ${D}${bindir}/ + fi +} + +inherit update-alternatives + +PACKAGECONFIG ??= "pcre" +PACKAGECONFIG[pcre] = "--enable-perl-regexp,--disable-perl-regexp,libpcre" + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_${PN} = "grep egrep fgrep" +ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep" +ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep" +ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep" + +export CONFIG_SHELL="/bin/sh" diff --git a/poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch new file mode 100644 index 000000000..b61b43281 --- /dev/null +++ b/poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch @@ -0,0 +1,30 @@ +From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Apr 2015 17:02:13 -0700 +Subject: [PATCH] Unset need_charset_alias when building for musl + +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 +which actually shoudl be fixed in gnulib and then all downstream +projects will get it eventually. For now we apply the fix to +coreutils + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/gnulib.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: groff-1.22.3/src/libs/gnulib/lib/Makefile.am +=================================================================== +--- groff-1.22.3.orig/src/libs/gnulib/lib/Makefile.am ++++ groff-1.22.3/src/libs/gnulib/lib/Makefile.am +@@ -113,7 +113,7 @@ install-exec-localcharset: all-local + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ diff --git a/poky/meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch b/poky/meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch new file mode 100644 index 000000000..f1db5b065 --- /dev/null +++ b/poky/meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch @@ -0,0 +1,102 @@ +From 5b574542070db286c89b3827e8f15ed4b3b39034 Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Thu, 6 Apr 2017 01:46:00 -0700 +Subject: [PATCH] replace "perl -w" with "use warnings" + +The shebang's max length is usually 128 as defined in +/usr/include/linux/binfmts.h: + #define BINPRM_BUF_SIZE 128 + +There would be errors when @PERL@ is longer than 128, use +'/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w' +doesn't work: + +/usr/bin/env: perl -w: No such file or directory + +So replace "perl -w" with "use warnings" to make it work. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + font/devpdf/util/BuildFoundries.pl | 3 ++- + src/devices/gropdf/gropdf.pl | 3 ++- + src/devices/gropdf/pdfmom.pl | 3 ++- + src/utils/afmtodit/afmtodit.pl | 3 ++- + 4 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/font/devpdf/util/BuildFoundries.pl b/font/devpdf/util/BuildFoundries.pl +index 39f2f0d..a2bfd8e 100644 +--- a/font/devpdf/util/BuildFoundries.pl ++++ b/font/devpdf/util/BuildFoundries.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl -w ++#!/usr/bin/perl + # + # BuildFoundries : Given a Foundry file generate groff and download files + # Deri James : Monday 07 Feb 2011 +@@ -22,6 +22,7 @@ + # along with this program. If not, see <http://www.gnu.org/licenses/>. + + use strict; ++use warnings; + + my $where=shift||''; + my $devps=shift||'../devps'; +diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl +index 035d123..b933b32 100644 +--- a/src/devices/gropdf/gropdf.pl ++++ b/src/devices/gropdf/gropdf.pl +@@ -1,4 +1,4 @@ +-#!@PERL@ -w ++#!@PERL@ + # + # gropdf : PDF post processor for groff + # +@@ -21,6 +21,7 @@ + # along with this program. If not, see <http://www.gnu.org/licenses/>. + + use strict; ++use warnings; + use Getopt::Long qw(:config bundling); + use Compress::Zlib; + +diff --git a/src/devices/gropdf/pdfmom.pl b/src/devices/gropdf/pdfmom.pl +index beec820..4b46ea4 100644 +--- a/src/devices/gropdf/pdfmom.pl ++++ b/src/devices/gropdf/pdfmom.pl +@@ -1,4 +1,4 @@ +-#!@PERL@ -w ++#!@PERL@ + # + # pdfmom : Frontend to run groff -mom to produce PDFs + # Deri James : Friday 16 Mar 2012 +@@ -24,6 +24,7 @@ + # along with this program. If not, see <http://www.gnu.org/licenses/>. + + use strict; ++use warnings; + use File::Temp qw/tempfile/; + my @cmd; + my $dev='pdf'; +diff --git a/src/utils/afmtodit/afmtodit.pl b/src/utils/afmtodit/afmtodit.pl +index 4f2ce83..5c078ff 100644 +--- a/src/utils/afmtodit/afmtodit.pl ++++ b/src/utils/afmtodit/afmtodit.pl +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl -w ++#! /usr/bin/perl + # -*- Perl -*- + # Copyright (C) 1989-2014 Free Software Foundation, Inc. + # Written by James Clark (jjc@jclark.com) +@@ -19,6 +19,7 @@ + # along with this program. If not, see <http://www.gnu.org/licenses/>. + + use strict; ++use warnings; + + @afmtodit.tables@ + +-- +2.10.2 + diff --git a/poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch b/poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch new file mode 100644 index 000000000..c73328a18 --- /dev/null +++ b/poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch @@ -0,0 +1,34 @@ +Correct the install path of man.local to fix following error: + /yocto/build/tmp/sysroots/x86_64-linux/usr/share/groff/1.22.2/tmac/an-old.tmac:690: warning: can't find macro file `man.local' + +Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com> +Upstream-Status: Pending + +diff --git a/tmac/Makefile.sub b/tmac/Makefile.sub +index 1506232..f1468c5 100644 +--- a/tmac/Makefile.sub ++++ b/tmac/Makefile.sub +@@ -121,9 +121,9 @@ install_data: $(NORMALFILES) $(SPECIALFILES) man.local \ + $(RM) $(DESTDIR)$(mdocdir)/$$f; \ + $(INSTALL_DATA) $$f-s $(DESTDIR)$(mdocdir)/$$f; \ + done +- -test -f $(DESTDIR)$(localtmacdir)/man.local \ ++ -test -f $(DESTDIR)$(tmacdir)/man.local \ + || $(INSTALL_DATA) $(srcdir)/man.local \ +- $(DESTDIR)$(localtmacdir)/man.local ++ $(DESTDIR)$(tmacdir)/man.local + -test -f $(DESTDIR)$(localtmacdir)/mdoc.local \ + || $(INSTALL_DATA) mdoc.local-s $(DESTDIR)$(localtmacdir)/mdoc.local + +@@ -164,9 +164,9 @@ uninstall_sub: + $(RM) $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac + $(RM) $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac + $(RM) $(DESTDIR)$(tmacdir)/www.tmac +- -if cmp -s $(DESTDIR)$(localtmacdir)/man.local \ ++ -if cmp -s $(DESTDIR)$(tmacdir)/man.local \ + $(srcdir)/man.local; then \ +- $(RM) $(DESTDIR)$(localtmacdir)/man.local; \ ++ $(RM) $(DESTDIR)$(tmacdir)/man.local; \ + fi + -if cmp -s $(DESTDIR)$(localtmacdir)/mdoc.local \ + $(srcdir)/mdoc.local; then \ diff --git a/poky/meta/recipes-extended/groff/groff_1.22.3.bb b/poky/meta/recipes-extended/groff/groff_1.22.3.bb new file mode 100644 index 000000000..7472f5982 --- /dev/null +++ b/poky/meta/recipes-extended/groff/groff_1.22.3.bb @@ -0,0 +1,84 @@ +SUMMARY = "GNU Troff software" +DESCRIPTION = "The groff (GNU troff) software is a typesetting package which reads plain text mixed with \ +formatting commands and produces formatted output." +SECTION = "base" +HOMEPAGE = "http://www.gnu.org/software/groff/" +LICENSE = "GPLv3" + +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \ + file://groff-1.22.2-correct-man.local-install-path.patch \ + file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ + file://0001-replace-perl-w-with-use-warnings.patch \ +" + +SRC_URI[md5sum] = "cc825fa64bc7306a885f2fb2268d3ec5" +SRC_URI[sha256sum] = "3a48a9d6c97750bfbd535feeb5be0111db6406ddb7bb79fc680809cda6d828a5" + +DEPENDS = "groff-native" +DEPENDS_class-native = "" +RDEPENDS_${PN} += "perl sed" + +inherit autotools texinfo + +EXTRA_OECONF = "--without-x" +PARALLEL_MAKE = "" + +CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" + +do_configure_prepend() { + if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then + sed -i \ + -e '/^GROFFBIN=/s:=.*:=${STAGING_BINDIR_NATIVE}/groff:' \ + -e '/^TROFFBIN=/s:=.*:=${STAGING_BINDIR_NATIVE}/troff:' \ + -e '/^GROFF_BIN_PATH=/s:=.*:=${STAGING_BINDIR_NATIVE}:' \ + -e '/^GROFF_BIN_DIR=/s:=.*:=${STAGING_BINDIR_NATIVE}:' \ + ${S}/contrib/*/Makefile.sub \ + ${S}/doc/Makefile.in \ + ${S}/doc/Makefile.sub + fi +} + +do_configure_append() { + # generate gnulib configure script + olddir=`pwd` + cd ${S}/src/libs/gnulib/ + ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed." + cd ${olddir} +} + +do_install_append() { + # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location + # for target as /usr/bin/perl, so fix it to /usr/bin/perl. + for i in afmtodit mmroff gropdf pdfmom grog; do + if [ -f ${D}${bindir}/$i ]; then + sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i + fi + done + if [ -e ${D}${libdir}/charset.alias ]; then + rm -rf ${D}${libdir}/charset.alias + fi + + # awk is located at /usr/bin/, not /bin/ + SPECIAL_AWK=`find ${D} -name special.awk` + if [ -f ${SPECIAL_AWK} ]; then + sed -i -e 's:#!.*awk:#! ${USRBINPATH}/awk:' ${SPECIAL_AWK} + fi + + # not ship /usr/bin/glilypond and its releated files in embedded target system + rm -rf ${D}${bindir}/glilypond + rm -rf ${D}${libdir}/groff/glilypond + rm -rf ${D}${mandir}/man1/glilypond* +} + +do_install_append_class-native() { + create_cmdline_wrapper ${D}/${bindir}/groff \ + -F${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/font \ + -M${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/tmac +} + +FILES_${PN} += "${libdir}/${BPN}/site-tmac \ + ${libdir}/${BPN}/groffer/" + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/gzip/files/run-ptest b/poky/meta/recipes-extended/gzip/files/run-ptest new file mode 100644 index 000000000..cf7c64949 --- /dev/null +++ b/poky/meta/recipes-extended/gzip/files/run-ptest @@ -0,0 +1,6 @@ +#!/bin/sh + +cd src/tests + +make check + diff --git a/poky/meta/recipes-extended/gzip/gzip-1.9/wrong-path-fix.patch b/poky/meta/recipes-extended/gzip/gzip-1.9/wrong-path-fix.patch new file mode 100644 index 000000000..7c37bc8d2 --- /dev/null +++ b/poky/meta/recipes-extended/gzip/gzip-1.9/wrong-path-fix.patch @@ -0,0 +1,36 @@ +fix MakeMaker issues with using wrong SHELL/GREP + +A set of substitution is being processed to all target scripts with sed by +replacing some key words with the detected values at configure time, this +is exactly not compliant with cross compling, and will cause missing path +errors at run time like: +"/usr/bin/zgrep: line 230: /usr/bin/grep: No such file or directory" + +Fixed by removing unneeded substitution and using real runtime paths +instead. + +Signed-off-by: Ming Liu <ming.liu@windriver.com> + +Upstream-Status: Pending + +--- + Makefile.am | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index d4ecc3f..e4657d2 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -82,8 +82,7 @@ SUFFIXES = .in + .in: + $(AM_V_GEN)rm -f $@-t $@ \ + && sed \ +- -e 's|/bin/sh|$(SHELL)|g' \ +- -e 's|[@]GREP@|$(GREP)|g' \ ++ -e 's|[@]GREP@|$(base_bindir)/grep|g' \ + -e 's|[@]VERSION@|$(VERSION)|g' \ + $(srcdir)/$@.in >$@-t \ + && chmod a=rx $@-t \ +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/gzip/gzip.inc b/poky/meta/recipes-extended/gzip/gzip.inc new file mode 100644 index 000000000..04f8f95dd --- /dev/null +++ b/poky/meta/recipes-extended/gzip/gzip.inc @@ -0,0 +1,33 @@ +SUMMARY = "Standard GNU compressor" +DESCRIPTION = "GNU Gzip is a popular data compression program originally written by Jean-loup Gailly for the GNU \ +project. Mark Adler wrote the decompression part" +HOMEPAGE = "http://www.gnu.org/software/gzip/" +SECTION = "console/utils" +# change to GPLv3+ in 2007/07. Previous GPLv2 version is 1.3.12 + +inherit autotools texinfo +export DEFS="NO_ASM" + +EXTRA_OEMAKE_class-target = "GREP=${base_bindir}/grep" +EXTRA_OECONF_append_libc-musl = " gl_cv_func_fflush_stdin=yes " + +do_install_append () { + if [ "${base_bindir}" != "${bindir}" ]; then + # Rename and move files into /bin (FHS), which is typical place for gzip + install -d ${D}${base_bindir} + mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip + mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip + mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat + mv ${D}${bindir}/uncompress ${D}${base_bindir}/uncompress + fi +} + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN} = "gunzip gzip zcat" +ALTERNATIVE_LINK_NAME[gunzip] = "${base_bindir}/gunzip" +ALTERNATIVE_LINK_NAME[gzip] = "${base_bindir}/gzip" +ALTERNATIVE_LINK_NAME[zcat] = "${base_bindir}/zcat" + +export CONFIG_SHELL="/bin/sh" diff --git a/poky/meta/recipes-extended/gzip/gzip_1.9.bb b/poky/meta/recipes-extended/gzip/gzip_1.9.bb new file mode 100644 index 000000000..a8eeba138 --- /dev/null +++ b/poky/meta/recipes-extended/gzip/gzip_1.9.bb @@ -0,0 +1,38 @@ +require gzip.inc + +LICENSE = "GPLv3+" + +SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \ + file://run-ptest" +SRC_URI_append_class-target = " file://wrong-path-fix.patch" + +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://gzip.h;beginline=8;endline=20;md5=6e47caaa630e0c8bf9f1bc8d94a8ed0e" + +PROVIDES_append_class-native = " gzip-replacement-native" + +BBCLASSEXTEND = "native" + +inherit ptest + +do_install_ptest() { + mkdir -p ${D}${PTEST_PATH}/src/build-aux + cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/src/build-aux/ + mkdir -p ${D}${PTEST_PATH}/src/tests + cp -r ${S}/tests/* ${D}${PTEST_PATH}/src/tests + sed -e 's/^abs_srcdir = ..*/abs_srcdir = \.\./' \ + -e 's/^top_srcdir = ..*/top_srcdir = \.\./' \ + -e 's/^GREP = ..*/GREP = grep/' \ + -e 's/^AWK = ..*/AWK = awk/' \ + -e 's/^srcdir = ..*/srcdir = \./' \ + -e 's/^Makefile: ..*/Makefile: /' \ + -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e 's:${HOSTTOOLS_DIR}/::g' \ + -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ + ${B}/tests/Makefile > ${D}${PTEST_PATH}/src/tests/Makefile +} + +SRC_URI[md5sum] = "929d6a6b832f75b28e3eeeafb30c1d9b" +SRC_URI[sha256sum] = "5d2d3a3432ef32f24cdb060d278834507b481a75adeca18850c73592f778f6ad" + diff --git a/poky/meta/recipes-extended/hdparm/hdparm/wiper.sh-fix-stat-path.patch b/poky/meta/recipes-extended/hdparm/hdparm/wiper.sh-fix-stat-path.patch new file mode 100644 index 000000000..4af1b617e --- /dev/null +++ b/poky/meta/recipes-extended/hdparm/hdparm/wiper.sh-fix-stat-path.patch @@ -0,0 +1,38 @@ +From e233006ee212109d2a1401dac37a9a851cc493d8 Mon Sep 17 00:00:00 2001 +From: Yi Zhao <yi.zhao@windriver.com> +Date: Thu, 14 Dec 2017 15:23:47 +0800 +Subject: [PATCH] wiper.sh: fix stat path + +Fix the stat path for OE. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +--- + wiper/wiper.sh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/wiper/wiper.sh b/wiper/wiper.sh +index 79eddc8..9ef2840 100755 +--- a/wiper/wiper.sh ++++ b/wiper/wiper.sh +@@ -97,7 +97,6 @@ function find_prog(){ + hash -r ## Refresh bash's cached PATH entries + HDPARM=`find_prog /sbin/hdparm` || exit 1 + FIND=`find_prog /usr/bin/find` || exit 1 +-STAT=`find_prog /usr/bin/stat` || exit 1 + GAWK=`find_prog /usr/bin/gawk` || exit 1 + BLKID=`find_prog /sbin/blkid` || exit 1 + GREP=`find_prog /bin/grep` || exit 1 +@@ -105,7 +104,7 @@ ID=`find_prog /usr/bin/id` || exit 1 + LS=`find_prog /bin/ls` || exit 1 + DF=`find_prog /bin/df` || exit 1 + RM=`find_prog /bin/rm` || exit 1 +-STAT=`find_prog /usr/bin/stat` || exit 1 ++STAT=`find_prog /bin/stat` || exit 1 + + [ $verbose -gt 1 ] && HDPARM="$HDPARM --verbose" + +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/hdparm/hdparm_9.53.bb b/poky/meta/recipes-extended/hdparm/hdparm_9.53.bb new file mode 100644 index 000000000..4c3ec5c48 --- /dev/null +++ b/poky/meta/recipes-extended/hdparm/hdparm_9.53.bb @@ -0,0 +1,43 @@ +SUMMARY = "Utility for viewing/manipulating IDE disk drive/driver parameters" +HOMEPAGE = "http://sourceforge.net/projects/hdparm/" +DESCRIPTION = "hdparm is a Linux shell utility for viewing \ +and manipulating various IDE drive and driver parameters." +SECTION = "console/utils" + +LICENSE = "BSD & GPLv2" +LICENSE_${PN} = "BSD" +LICENSE_${PN}-dbg = "BSD" +LICENSE_wiper = "GPLv2" + +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=495d03e50dc6c89d6a30107ab0df5b03 \ + file://debian/copyright;md5=a82d7ba3ade9e8ec902749db98c592f3 \ + file://wiper/GPLv2.txt;md5=fcb02dc552a041dee27e4b85c7396067 \ + file://wiper/wiper.sh;beginline=7;endline=31;md5=b7bc642addc152ea307505bf1a296f09" + + +PACKAGES =+ "wiper" + +FILES_wiper = "${bindir}/wiper.sh" + +RDEPENDS_wiper = "bash gawk coreutils" + +SRC_URI = "${SOURCEFORGE_MIRROR}/hdparm/${BP}.tar.gz \ + file://wiper.sh-fix-stat-path.patch \ + " + +SRC_URI[md5sum] = "1e54b52e0c8cb79389d4d47eacba411d" +SRC_URI[sha256sum] = "2673f591df6916c6a1faec07069a7eb1cb8ee307615a615d808192fb0c0265e5" + +EXTRA_OEMAKE = 'STRIP="echo" LDFLAGS="${LDFLAGS}"' + +inherit update-alternatives + +ALTERNATIVE_${PN} = "hdparm" +ALTERNATIVE_LINK_NAME[hdparm] = "${base_sbindir}/hdparm" +ALTERNATIVE_PRIORITY = "100" + +do_install () { + install -d ${D}/${base_sbindir} ${D}/${mandir}/man8 ${D}/${bindir} + oe_runmake 'DESTDIR=${D}' 'sbindir=${base_sbindir}' install + cp ${S}/wiper/wiper.sh ${D}/${bindir} +} diff --git a/poky/meta/recipes-extended/images/core-image-full-cmdline.bb b/poky/meta/recipes-extended/images/core-image-full-cmdline.bb new file mode 100644 index 000000000..4d69073d9 --- /dev/null +++ b/poky/meta/recipes-extended/images/core-image-full-cmdline.bb @@ -0,0 +1,12 @@ +DESCRIPTION = "A console-only image with more full-featured Linux system \ +functionality installed." + +IMAGE_FEATURES += "splash ssh-server-openssh" + +IMAGE_INSTALL = "\ + packagegroup-core-boot \ + packagegroup-core-full-cmdline \ + ${CORE_IMAGE_EXTRA_INSTALL} \ + " + +inherit core-image diff --git a/poky/meta/recipes-extended/images/core-image-kernel-dev.bb b/poky/meta/recipes-extended/images/core-image-kernel-dev.bb new file mode 100644 index 000000000..a40b3aa95 --- /dev/null +++ b/poky/meta/recipes-extended/images/core-image-kernel-dev.bb @@ -0,0 +1,20 @@ +DESCRIPTION = "A development image that builds the kernel and packages that are \ +sensitive to kernel updates and version changes" + +# Could also be core-image-basic, but we'll keep this small for now +require recipes-core/images/core-image-minimal.bb + +KERNEL_DEV_UTILS ?= "dropbear connman" +KERNEL_DEV_TOOLS ?= "packagegroup-core-tools-profile packagegroup-core-buildessential kernel-devsrc" +KERNEL_DEV_MODULE ?= "kernel-modules" + +CORE_IMAGE_EXTRA_INSTALL += "${KERNEL_DEV_MODULE} \ + ${KERNEL_DEV_UTILS} \ + ${KERNEL_DEV_TOOLS} \ + " + +# We need extra space for things like kernel builds, etc. +IMAGE_ROOTFS_EXTRA_SPACE_append = " + 3000000" + +# Let's define our own subset to test, we can later add a on-target kernel build even! +DEFAULT_TEST_SUITES = "ping ssh df connman syslog scp date parselogs" diff --git a/poky/meta/recipes-extended/images/core-image-lsb-dev.bb b/poky/meta/recipes-extended/images/core-image-lsb-dev.bb new file mode 100644 index 000000000..d2dc9e2b5 --- /dev/null +++ b/poky/meta/recipes-extended/images/core-image-lsb-dev.bb @@ -0,0 +1,7 @@ +require core-image-lsb.bb + +DESCRIPTION = "Basic image without X support suitable for development work. It \ +can be used for customization and implementations that conform to Linux \ +Standard Base (LSB)." + +IMAGE_FEATURES += "dev-pkgs" diff --git a/poky/meta/recipes-extended/images/core-image-lsb-sdk.bb b/poky/meta/recipes-extended/images/core-image-lsb-sdk.bb new file mode 100644 index 000000000..a3d602edd --- /dev/null +++ b/poky/meta/recipes-extended/images/core-image-lsb-sdk.bb @@ -0,0 +1,12 @@ +require core-image-lsb.bb + +DESCRIPTION = "Basic image without X support suitable for Linux Standard Base \ +(LSB) implementations. It includes the full meta-toolchain, plus development \ +headers and libraries to form a standalone SDK." + +IMAGE_FEATURES += "tools-sdk dev-pkgs tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks" + +IMAGE_INSTALL += "kernel-devsrc" + +# Reduce this to try and keep below the 4GB image size for now +IMAGE_OVERHEAD_FACTOR = "1.2" diff --git a/poky/meta/recipes-extended/images/core-image-lsb.bb b/poky/meta/recipes-extended/images/core-image-lsb.bb new file mode 100644 index 000000000..ab61c6e6d --- /dev/null +++ b/poky/meta/recipes-extended/images/core-image-lsb.bb @@ -0,0 +1,14 @@ +DESCRIPTION = "An image containing packages that are required to conform \ +to the Linux Standard Base (LSB) specification." + +IMAGE_FEATURES += "splash ssh-server-openssh hwcodecs package-management" + +IMAGE_INSTALL = "\ + ${CORE_IMAGE_BASE_INSTALL} \ + packagegroup-core-full-cmdline \ + packagegroup-core-lsb \ + " + +inherit core-image distro_features_check + +REQUIRED_DISTRO_FEATURES = "pam" diff --git a/poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb b/poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb new file mode 100644 index 000000000..09a6d1604 --- /dev/null +++ b/poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb @@ -0,0 +1,23 @@ +DESCRIPTION = "Small image capable of booting a device with custom install scripts, \ +adding a second rootfs, used for testing." + +# use -testfs live-install scripts +PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install-testfs initramfs-live-install-efi-testfs busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" + +# Do not pollute the initrd image with rootfs features +IMAGE_FEATURES = "" + +export IMAGE_BASENAME = "core-image-testmaster-initramfs" +IMAGE_LINGUAS = "" + +LICENSE = "MIT" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" +inherit core-image + +IMAGE_ROOTFS_SIZE = "8192" +IMAGE_ROOTFS_EXTRA_SPACE = "0" +BAD_RECOMMENDATIONS += "busybox-syslog" + +# Use the same restriction as initramfs-live-install-testfs +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" diff --git a/poky/meta/recipes-extended/images/core-image-testmaster.bb b/poky/meta/recipes-extended/images/core-image-testmaster.bb new file mode 100644 index 000000000..78295c5f0 --- /dev/null +++ b/poky/meta/recipes-extended/images/core-image-testmaster.bb @@ -0,0 +1,18 @@ +DESCRIPTION = "A master image to be deployed on a target useful for testing other images" + +IMAGE_FEATURES += "ssh-server-openssh package-management" + +inherit core-image + +# the deploy code requires bash and +# normal linux utilities not busybox ones +IMAGE_INSTALL += "\ + bash coreutils util-linux tar gzip bzip2 kmod \ + python-modules python-misc \ + e2fsprogs e2fsprogs-mke2fs parted \ + " +# we need a particular initramfs for live images +# that pulls custom install scripts which take +# care of partitioning for us +INITRD_IMAGE = "core-image-testmaster-initramfs" + diff --git a/poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch b/poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch new file mode 100644 index 000000000..03c36ccbc --- /dev/null +++ b/poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch @@ -0,0 +1,47 @@ +From c46db7c2e1f63ec525835553587e70c635565310 Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Tue, 21 Feb 2017 11:16:31 +0200 +Subject: [PATCH] configure: Add option to enable/disable libnfnetlink + +This changes the configure behaviour from autodetecting +for libnfnetlink to having an option to disable it explicitly + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- + configure.ac | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index eda7871..03ddc50 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -63,6 +63,9 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH], + AC_ARG_ENABLE([nftables], + AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]), + [enable_nftables="$enableval"], [enable_nftables="yes"]) ++AC_ARG_ENABLE([libnfnetlink], ++ AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]), ++ [enable_libnfnetlink="$enableval"], [enable_libnfnetlink="yes"]) + AC_ARG_ENABLE([connlabel], + AS_HELP_STRING([--disable-connlabel], + [Do not build libnetfilter_conntrack]), +@@ -115,9 +118,10 @@ if test "x$enable_bpfc" = "xyes" || test "x$enable_nfsynproxy" = "xyes"; then + AC_CHECK_LIB(pcap, pcap_compile,, AC_MSG_ERROR(missing libpcap library required by bpf compiler or nfsynproxy tool)) + fi + +-PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0], +- [nfnetlink=1], [nfnetlink=0]) +-AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1]) ++AS_IF([test "x$enable_libnfnetlink" = "xyes"], [ ++ PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0]) ++ ]) ++AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "x$enable_libnfnetlink" = "xyes"]) + + if test "x$enable_nftables" = "xyes"; then + PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0]) +-- +2.4.0 + diff --git a/poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch b/poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch new file mode 100644 index 000000000..7842c6408 --- /dev/null +++ b/poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch @@ -0,0 +1,51 @@ +From 26090b3dbcdf6a11e60535da949b726a6e86426d Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Tue, 21 Feb 2017 11:49:07 +0200 +Subject: [PATCH] configure.ac: + only-check-conntrack-when-libnfnetlink-enabled.patch + +Package libnetfilter-conntrack depends on package libnfnetlink. iptables +checks package libnetfilter-conntrack whatever its package config +libnfnetlink is enabled or not. When libnfnetlink is disabled but +package libnetfilter-conntrack exists, it fails randomly with: + +In file included from +.../iptables/1.4.21-r0/iptables-1.4.21/extensions/libxt_connlabel.c:8:0: + +.../tmp/sysroots/qemumips/usr/include/libnetfilter_conntrack/libnetfilter_conntrack.h:14:42: +fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory + +compilation terminated. +GNUmakefile:96: recipe for target 'libxt_connlabel.oo' failed +Only check libnetfilter-conntrack when libnfnetlink is enabled to fix it. + +Upstream-Status: Pending + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- + configure.ac | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 03ddc50..523caea 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -172,10 +172,12 @@ if test "$nftables" != 1; then + fi + + if test "x$enable_connlabel" = "xyes"; then +- PKG_CHECK_MODULES([libnetfilter_conntrack], ++ nfconntrack=0 ++ AS_IF([test "x$enable_libnfnetlink" = "xyes"], [ ++ PKG_CHECK_MODULES([libnetfilter_conntrack], + [libnetfilter_conntrack >= 1.0.6], + [nfconntrack=1], [nfconntrack=0]) +- ++ ]) + if test "$nfconntrack" -ne 1; then + blacklist_modules="$blacklist_modules connlabel"; + echo "WARNING: libnetfilter_conntrack not found, connlabel match will not be built"; +-- +2.4.0 + diff --git a/poky/meta/recipes-extended/iptables/iptables_1.6.2.bb b/poky/meta/recipes-extended/iptables/iptables_1.6.2.bb new file mode 100644 index 000000000..38a83d2b3 --- /dev/null +++ b/poky/meta/recipes-extended/iptables/iptables_1.6.2.bb @@ -0,0 +1,47 @@ +SUMMARY = "Tools for managing kernel packet filtering capabilities" +DESCRIPTION = "iptables is the userspace command line program used to configure and control network packet \ +filtering code in Linux." +HOMEPAGE = "http://www.netfilter.org/" +BUGTRACKER = "http://bugzilla.netfilter.org/" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\ + file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc" + +RRECOMMENDS_${PN} = "kernel-module-x-tables \ + kernel-module-ip-tables \ + kernel-module-iptable-filter \ + kernel-module-iptable-nat \ + kernel-module-nf-defrag-ipv4 \ + kernel-module-nf-conntrack \ + kernel-module-nf-conntrack-ipv4 \ + kernel-module-nf-nat \ + kernel-module-ipt-masquerade" +FILES_${PN} =+ "${libdir}/xtables/ ${datadir}/xtables" + +SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \ + file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \ + file://0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch \ +" + +SRC_URI[md5sum] = "7d2b7847e4aa8832a18437b8a4c1873d" +SRC_URI[sha256sum] = "55d02dfa46263343a401f297d44190f2a3e5113c8933946f094ed40237053733" + +inherit autotools pkgconfig + +EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR} \ + " +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" + +PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," + +# libnfnetlink recipe is in meta-networking layer +PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libnfnetlink libnetfilter-conntrack" + +# libnftnl recipe is in meta-networking layer(previously known as libnftables) +PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl" + +do_configure_prepend() { + # Remove some libtool m4 files + # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive. + rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 +} diff --git a/poky/meta/recipes-extended/iputils/files/0001-Fix-build-on-MUSL.patch b/poky/meta/recipes-extended/iputils/files/0001-Fix-build-on-MUSL.patch new file mode 100644 index 000000000..ce8cfebbb --- /dev/null +++ b/poky/meta/recipes-extended/iputils/files/0001-Fix-build-on-MUSL.patch @@ -0,0 +1,95 @@ +From c6c5966d9fae27bc2f0a34ab59b999555111bd2d Mon Sep 17 00:00:00 2001 +From: Aric Belsito <lluixhi@gmail.com> +Date: Sun, 29 Oct 2017 23:17:03 +0100 +Subject: [PATCH] Fix build on MUSL + +Add missing AI_IDN and NI_IDN declarations. + +Bug: https://bugs.gentoo.org/503914 + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + arping.c | 7 +++++++ + ping.h | 11 +++++++++++ + tracepath.c | 8 ++++++++ + traceroute6.c | 4 ++++ + 4 files changed, 30 insertions(+) + +diff --git a/arping.c b/arping.c +index 1a3f40b..531d29d 100644 +--- a/arping.c ++++ b/arping.c +@@ -45,6 +45,13 @@ struct sysfs_devattr_values; + #ifdef USE_IDN + #include <idna.h> + #include <locale.h> ++ ++#ifndef AI_IDN ++#define AI_IDN 0x0040 ++#endif ++#ifndef AI_CANONIDN ++#define AI_CANONIDN 0x0080 ++#endif + #endif + + #include "SNAPSHOT.h" +diff --git a/ping.h b/ping.h +index 749f3ff..227315f 100644 +--- a/ping.h ++++ b/ping.h +@@ -38,6 +38,17 @@ + #include <locale.h> + #include <idna.h> + #include <stringprep.h> ++ ++#ifndef AI_IDN ++#define AI_IDN 0x0040 ++#endif ++#ifndef AI_CANONIDN ++#define AI_CANONIDN 0x0080 ++#endif ++#ifndef NI_IDN ++#define NI_IDN 32 ++#endif ++ + #define getaddrinfo_flags (AI_CANONNAME | AI_IDN | AI_CANONIDN) + #define getnameinfo_flags NI_IDN + #else +diff --git a/tracepath.c b/tracepath.c +index 74a829d..dcec5b9 100644 +--- a/tracepath.c ++++ b/tracepath.c +@@ -30,6 +30,14 @@ + #ifdef USE_IDN + #include <idna.h> + #include <locale.h> ++ ++#ifndef AI_IDN ++#define AI_IDN 0x0040 ++#endif ++#ifndef NI_IDN ++#define NI_IDN 32 ++#endif ++ + #define getnameinfo_flags NI_IDN + #else + #define getnameinfo_flags 0 +diff --git a/traceroute6.c b/traceroute6.c +index 48fc5c5..8d1eebf 100644 +--- a/traceroute6.c ++++ b/traceroute6.c +@@ -251,6 +251,10 @@ + #include <idna.h> + #include <locale.h> + ++#ifndef NI_IDN ++#define NI_IDN 32 ++#endif ++ + #define getnameinfo_flags NI_IDN + #else + #define getnameinfo_flags 0 +-- +2.15.1 + diff --git a/poky/meta/recipes-extended/iputils/iputils_s20161105.bb b/poky/meta/recipes-extended/iputils/iputils_s20161105.bb new file mode 100644 index 000000000..0125739b0 --- /dev/null +++ b/poky/meta/recipes-extended/iputils/iputils_s20161105.bb @@ -0,0 +1,62 @@ +SUMMARY = "Network monitoring tools" +DESCRIPTION = "Utilities for the IP protocol, including traceroute6, \ +tracepath, tracepath6, ping, ping6 and arping." +HOMEPAGE = "https://github.com/iputils/iputils" +SECTION = "console/network" + +LICENSE = "BSD & GPLv2+" + +LIC_FILES_CHKSUM = "file://ping.c;beginline=1;endline=35;md5=f9ceb201733e9a6cf8f00766dd278d82 \ + file://tracepath.c;beginline=1;endline=10;md5=0ecea2bf60bff2f3d840096d87647f3d \ + file://arping.c;beginline=1;endline=11;md5=fe84301b5c2655c950f8b92a057fafa6 \ + file://tftpd.c;beginline=1;endline=32;md5=28834bf8a91a5b8a92755dbee709ef96 " + +DEPENDS = "gnutls libcap libgcrypt" + +SRC_URI = "git://github.com/iputils/iputils \ + file://0001-Fix-build-on-MUSL.patch \ + " +S = "${WORKDIR}/git" +SRCREV = "bffc0e957b98d626ab4cea218c89251201425442" + +UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>s\d+)" + +EXTRA_OEMAKE = "-e MAKEFLAGS=" + +PACKAGECONFIG ?= "" +PACKAGECONFIG[libidn] = "USE_IDN=yes,USE_IDN=no,libidn" + +do_compile () { + oe_runmake 'CC=${CC} -D_GNU_SOURCE' VPATH="${STAGING_LIBDIR}:${STAGING_DIR_HOST}/${base_libdir}" ${PACKAGECONFIG_CONFARGS} all +} + +do_install () { + install -m 0755 -d ${D}${base_bindir} + # SUID root programs + install -m 4555 ping ${D}${base_bindir}/ping + install -m 4555 traceroute6 ${D}${base_bindir}/ + install -m 4555 clockdiff ${D}${base_bindir}/ + # Other programgs + for i in arping tracepath; do + install -m 0755 $i ${D}${base_bindir}/ + done +} + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_${PN}-ping = "ping" +ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping" + +PACKAGES += "${PN}-ping ${PN}-arping ${PN}-tracepath ${PN}-traceroute6 ${PN}-clockdiff" + +ALLOW_EMPTY_${PN} = "1" +RDEPENDS_${PN} += "${PN}-ping ${PN}-arping ${PN}-tracepath ${PN}-traceroute6 ${PN}-clockdiff" + +FILES_${PN} = "" +FILES_${PN}-ping = "${base_bindir}/ping.${BPN}" +FILES_${PN}-arping = "${base_bindir}/arping" +FILES_${PN}-tracepath = "${base_bindir}/tracepath" +FILES_${PN}-traceroute6 = "${base_bindir}/traceroute6" +FILES_${PN}-clockdiff = "${base_bindir}/clockdiff" diff --git a/poky/meta/recipes-extended/less/less_529.bb b/poky/meta/recipes-extended/less/less_529.bb new file mode 100644 index 000000000..c86f75483 --- /dev/null +++ b/poky/meta/recipes-extended/less/less_529.bb @@ -0,0 +1,42 @@ +SUMMARY = "Text file viewer similar to more" +DESCRIPTION = "Less is a program similar to more, i.e. a terminal \ +based program for viewing text files and the output from other \ +programs. Less offers many features beyond those that more does." +HOMEPAGE = "http://www.greenwoodsoftware.com/" +SECTION = "console/utils" + +# (GPLv2+ (<< 418), GPLv3+ (>= 418)) | less +# Including email author giving permissing to use BSD +# +# From: Mark Nudelman <markn@greenwoodsoftware.com> +# To: Elizabeth Flanagan <elizabeth.flanagan@intel.com +# Date: 12/19/11 +# +# Hi Elizabeth, +# Using a generic BSD license for less is fine with me. +# Thanks, +# +# --Mark +# + +LICENSE = "GPLv3+ | BSD-2-Clause" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://LICENSE;md5=2ef3e4b8dafc85612bc5254b8081e234" +DEPENDS = "ncurses" + +SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz \ + " + +SRC_URI[md5sum] = "32018b53a1f7319ab54349baf80e6aa8" +SRC_URI[sha256sum] = "dba42cd4c38174b7bd0d426d8a39df2be6bcc1ec18946a4642713290f6bf9a0b" + +UPSTREAM_CHECK_URI = "http://www.greenwoodsoftware.com/less/download.html" + +inherit autotools update-alternatives + +do_install () { + oe_runmake 'bindir=${D}${bindir}' 'mandir=${D}${mandir}' install +} + +ALTERNATIVE_${PN} = "less" +ALTERNATIVE_PRIORITY = "100" diff --git a/poky/meta/recipes-extended/libaio/libaio/00_arches.patch b/poky/meta/recipes-extended/libaio/libaio/00_arches.patch new file mode 100644 index 000000000..9d6447d98 --- /dev/null +++ b/poky/meta/recipes-extended/libaio/libaio/00_arches.patch @@ -0,0 +1,607 @@ +Upstream-Status: Inappropriate [embedded specific] + +from openembedded, added by Qing He <qing.he@intel.com> + +Index: libaio-0.3.110/src/syscall-m68k.h +=================================================================== +--- /dev/null ++++ libaio-0.3.110/src/syscall-m68k.h +@@ -0,0 +1,78 @@ ++#define __NR_io_setup 241 ++#define __NR_io_destroy 242 ++#define __NR_io_getevents 243 ++#define __NR_io_submit 244 ++#define __NR_io_cancel 245 ++ ++#define io_syscall1(type,fname,sname,atype,a) \ ++type fname(atype a) \ ++{ \ ++register long __res __asm__ ("%d0") = __NR_##sname; \ ++register long __a __asm__ ("%d1") = (long)(a); \ ++__asm__ __volatile__ ("trap #0" \ ++ : "+d" (__res) \ ++ : "d" (__a) ); \ ++return (type) __res; \ ++} ++ ++#define io_syscall2(type,fname,sname,atype,a,btype,b) \ ++type fname(atype a,btype b) \ ++{ \ ++register long __res __asm__ ("%d0") = __NR_##sname; \ ++register long __a __asm__ ("%d1") = (long)(a); \ ++register long __b __asm__ ("%d2") = (long)(b); \ ++__asm__ __volatile__ ("trap #0" \ ++ : "+d" (__res) \ ++ : "d" (__a), "d" (__b) \ ++ ); \ ++return (type) __res; \ ++} ++ ++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \ ++type fname(atype a,btype b,ctype c) \ ++{ \ ++register long __res __asm__ ("%d0") = __NR_##sname; \ ++register long __a __asm__ ("%d1") = (long)(a); \ ++register long __b __asm__ ("%d2") = (long)(b); \ ++register long __c __asm__ ("%d3") = (long)(c); \ ++__asm__ __volatile__ ("trap #0" \ ++ : "+d" (__res) \ ++ : "d" (__a), "d" (__b), \ ++ "d" (__c) \ ++ ); \ ++return (type) __res; \ ++} ++ ++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \ ++type fname (atype a, btype b, ctype c, dtype d) \ ++{ \ ++register long __res __asm__ ("%d0") = __NR_##sname; \ ++register long __a __asm__ ("%d1") = (long)(a); \ ++register long __b __asm__ ("%d2") = (long)(b); \ ++register long __c __asm__ ("%d3") = (long)(c); \ ++register long __d __asm__ ("%d4") = (long)(d); \ ++__asm__ __volatile__ ("trap #0" \ ++ : "+d" (__res) \ ++ : "d" (__a), "d" (__b), \ ++ "d" (__c), "d" (__d) \ ++ ); \ ++return (type) __res; \ ++} ++ ++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \ ++type fname (atype a,btype b,ctype c,dtype d,etype e) \ ++{ \ ++register long __res __asm__ ("%d0") = __NR_##sname; \ ++register long __a __asm__ ("%d1") = (long)(a); \ ++register long __b __asm__ ("%d2") = (long)(b); \ ++register long __c __asm__ ("%d3") = (long)(c); \ ++register long __d __asm__ ("%d4") = (long)(d); \ ++register long __e __asm__ ("%d5") = (long)(e); \ ++__asm__ __volatile__ ("trap #0" \ ++ : "+d" (__res) \ ++ : "d" (__a), "d" (__b), \ ++ "d" (__c), "d" (__d), "d" (__e) \ ++ ); \ ++return (type) __res; \ ++} ++ +Index: libaio-0.3.110/src/syscall.h +=================================================================== +--- libaio-0.3.110.orig/src/syscall.h ++++ libaio-0.3.110/src/syscall.h +@@ -28,6 +28,12 @@ + #include "syscall-sparc.h" + #elif defined(__aarch64__) + #include "syscall-arm64.h" ++#elif defined(__m68k__) ++#include "syscall-m68k.h" ++#elif defined(__hppa__) ++#include "syscall-parisc.h" ++#elif defined(__mips__) ++#include "syscall-mips.h" + #else + #warning "using generic syscall method" + #include "syscall-generic.h" +Index: libaio-0.3.110/src/syscall-mips.h +=================================================================== +--- /dev/null ++++ libaio-0.3.110/src/syscall-mips.h +@@ -0,0 +1,223 @@ ++/* ++ * This file is subject to the terms and conditions of the GNU General Public ++ * License. See the file "COPYING" in the main directory of this archive ++ * for more details. ++ * ++ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle ++ * Copyright (C) 1999, 2000 Silicon Graphics, Inc. ++ * ++ * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto ++ * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A ++ */ ++ ++#ifndef _MIPS_SIM_ABI32 ++#define _MIPS_SIM_ABI32 1 ++#define _MIPS_SIM_NABI32 2 ++#define _MIPS_SIM_ABI64 3 ++#endif ++ ++#if _MIPS_SIM == _MIPS_SIM_ABI32 ++ ++/* ++ * Linux o32 style syscalls are in the range from 4000 to 4999. ++ */ ++#define __NR_Linux 4000 ++#define __NR_io_setup (__NR_Linux + 241) ++#define __NR_io_destroy (__NR_Linux + 242) ++#define __NR_io_getevents (__NR_Linux + 243) ++#define __NR_io_submit (__NR_Linux + 244) ++#define __NR_io_cancel (__NR_Linux + 245) ++ ++#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ ++ ++#if _MIPS_SIM == _MIPS_SIM_ABI64 ++ ++/* ++ * Linux 64-bit syscalls are in the range from 5000 to 5999. ++ */ ++#define __NR_Linux 5000 ++#define __NR_io_setup (__NR_Linux + 200) ++#define __NR_io_destroy (__NR_Linux + 201) ++#define __NR_io_getevents (__NR_Linux + 202) ++#define __NR_io_submit (__NR_Linux + 203) ++#define __NR_io_cancel (__NR_Linux + 204) ++#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ ++ ++#if _MIPS_SIM == _MIPS_SIM_NABI32 ++ ++/* ++ * Linux N32 syscalls are in the range from 6000 to 6999. ++ */ ++#define __NR_Linux 6000 ++#define __NR_io_setup (__NR_Linux + 200) ++#define __NR_io_destroy (__NR_Linux + 201) ++#define __NR_io_getevents (__NR_Linux + 202) ++#define __NR_io_submit (__NR_Linux + 203) ++#define __NR_io_cancel (__NR_Linux + 204) ++#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ ++ ++#define io_syscall1(type,fname,sname,atype,a) \ ++type fname(atype a) \ ++{ \ ++ register unsigned long __a0 asm("$4") = (unsigned long) a; \ ++ register unsigned long __a3 asm("$7"); \ ++ unsigned long __v0; \ ++ \ ++ __asm__ volatile ( \ ++ ".set\tnoreorder\n\t" \ ++ "li\t$2, %3\t\t\t# " #fname "\n\t" \ ++ "syscall\n\t" \ ++ "move\t%0, $2\n\t" \ ++ ".set\treorder" \ ++ : "=&r" (__v0), "=r" (__a3) \ ++ : "r" (__a0), "i" (__NR_##sname) \ ++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \ ++ "memory"); \ ++ \ ++ if (__a3 == 0) \ ++ return (type) __v0; \ ++ return (type) -1; \ ++} ++ ++#define io_syscall2(type,fname,sname,atype,a,btype,b) \ ++type fname(atype a, btype b) \ ++{ \ ++ register unsigned long __a0 asm("$4") = (unsigned long) a; \ ++ register unsigned long __a1 asm("$5") = (unsigned long) b; \ ++ register unsigned long __a3 asm("$7"); \ ++ unsigned long __v0; \ ++ \ ++ __asm__ volatile ( \ ++ ".set\tnoreorder\n\t" \ ++ "li\t$2, %4\t\t\t# " #fname "\n\t" \ ++ "syscall\n\t" \ ++ "move\t%0, $2\n\t" \ ++ ".set\treorder" \ ++ : "=&r" (__v0), "=r" (__a3) \ ++ : "r" (__a0), "r" (__a1), "i" (__NR_##sname) \ ++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \ ++ "memory"); \ ++ \ ++ if (__a3 == 0) \ ++ return (type) __v0; \ ++ return (type) -1; \ ++} ++ ++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \ ++type fname(atype a, btype b, ctype c) \ ++{ \ ++ register unsigned long __a0 asm("$4") = (unsigned long) a; \ ++ register unsigned long __a1 asm("$5") = (unsigned long) b; \ ++ register unsigned long __a2 asm("$6") = (unsigned long) c; \ ++ register unsigned long __a3 asm("$7"); \ ++ unsigned long __v0; \ ++ \ ++ __asm__ volatile ( \ ++ ".set\tnoreorder\n\t" \ ++ "li\t$2, %5\t\t\t# " #fname "\n\t" \ ++ "syscall\n\t" \ ++ "move\t%0, $2\n\t" \ ++ ".set\treorder" \ ++ : "=&r" (__v0), "=r" (__a3) \ ++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \ ++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \ ++ "memory"); \ ++ \ ++ if (__a3 == 0) \ ++ return (type) __v0; \ ++ return (type) -1; \ ++} ++ ++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \ ++type fname(atype a, btype b, ctype c, dtype d) \ ++{ \ ++ register unsigned long __a0 asm("$4") = (unsigned long) a; \ ++ register unsigned long __a1 asm("$5") = (unsigned long) b; \ ++ register unsigned long __a2 asm("$6") = (unsigned long) c; \ ++ register unsigned long __a3 asm("$7") = (unsigned long) d; \ ++ unsigned long __v0; \ ++ \ ++ __asm__ volatile ( \ ++ ".set\tnoreorder\n\t" \ ++ "li\t$2, %5\t\t\t# " #fname "\n\t" \ ++ "syscall\n\t" \ ++ "move\t%0, $2\n\t" \ ++ ".set\treorder" \ ++ : "=&r" (__v0), "+r" (__a3) \ ++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \ ++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \ ++ "memory"); \ ++ \ ++ if (__a3 == 0) \ ++ return (type) __v0; \ ++ return (type) -1; \ ++} ++ ++#if (_MIPS_SIM == _MIPS_SIM_ABI32) ++ ++/* ++ * Using those means your brain needs more than an oil change ;-) ++ */ ++ ++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \ ++type fname(atype a, btype b, ctype c, dtype d, etype e) \ ++{ \ ++ register unsigned long __a0 asm("$4") = (unsigned long) a; \ ++ register unsigned long __a1 asm("$5") = (unsigned long) b; \ ++ register unsigned long __a2 asm("$6") = (unsigned long) c; \ ++ register unsigned long __a3 asm("$7") = (unsigned long) d; \ ++ unsigned long __v0; \ ++ \ ++ __asm__ volatile ( \ ++ ".set\tnoreorder\n\t" \ ++ "lw\t$2, %6\n\t" \ ++ "subu\t$29, 32\n\t" \ ++ "sw\t$2, 16($29)\n\t" \ ++ "li\t$2, %5\t\t\t# " #fname "\n\t" \ ++ "syscall\n\t" \ ++ "move\t%0, $2\n\t" \ ++ "addiu\t$29, 32\n\t" \ ++ ".set\treorder" \ ++ : "=&r" (__v0), "+r" (__a3) \ ++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname), \ ++ "m" ((unsigned long)e) \ ++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \ ++ "memory"); \ ++ \ ++ if (__a3 == 0) \ ++ return (type) __v0; \ ++ return (type) -1; \ ++} ++ ++#endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */ ++ ++#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) ++ ++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \ ++type fname (atype a,btype b,ctype c,dtype d,etype e) \ ++{ \ ++ register unsigned long __a0 asm("$4") = (unsigned long) a; \ ++ register unsigned long __a1 asm("$5") = (unsigned long) b; \ ++ register unsigned long __a2 asm("$6") = (unsigned long) c; \ ++ register unsigned long __a3 asm("$7") = (unsigned long) d; \ ++ register unsigned long __a4 asm("$8") = (unsigned long) e; \ ++ unsigned long __v0; \ ++ \ ++ __asm__ volatile ( \ ++ ".set\tnoreorder\n\t" \ ++ "li\t$2, %6\t\t\t# " #fname "\n\t" \ ++ "syscall\n\t" \ ++ "move\t%0, $2\n\t" \ ++ ".set\treorder" \ ++ : "=&r" (__v0), "+r" (__a3) \ ++ : "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "i" (__NR_##sname) \ ++ : "$2", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \ ++ "memory"); \ ++ \ ++ if (__a3 == 0) \ ++ return (type) __v0; \ ++ return (type) -1; \ ++} ++ ++#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */ ++ +Index: libaio-0.3.110/src/syscall-parisc.h +=================================================================== +--- /dev/null ++++ libaio-0.3.110/src/syscall-parisc.h +@@ -0,0 +1,146 @@ ++/* ++ * Linux system call numbers. ++ * ++ * Cary Coutant says that we should just use another syscall gateway ++ * page to avoid clashing with the HPUX space, and I think he's right: ++ * it will would keep a branch out of our syscall entry path, at the ++ * very least. If we decide to change it later, we can ``just'' tweak ++ * the LINUX_GATEWAY_ADDR define at the bottom and make __NR_Linux be ++ * 1024 or something. Oh, and recompile libc. =) ++ * ++ * 64-bit HPUX binaries get the syscall gateway address passed in a register ++ * from the kernel at startup, which seems a sane strategy. ++ */ ++ ++#define __NR_Linux 0 ++#define __NR_io_setup (__NR_Linux + 215) ++#define __NR_io_destroy (__NR_Linux + 216) ++#define __NR_io_getevents (__NR_Linux + 217) ++#define __NR_io_submit (__NR_Linux + 218) ++#define __NR_io_cancel (__NR_Linux + 219) ++ ++#define SYS_ify(syscall_name) __NR_##syscall_name ++ ++/* Assume all syscalls are done from PIC code just to be ++ * safe. The worst case scenario is that you lose a register ++ * and save/restore r19 across the syscall. */ ++#define PIC ++ ++/* Definition taken from glibc 2.3.3 ++ * sysdeps/unix/sysv/linux/hppa/sysdep.h ++ */ ++ ++#ifdef PIC ++/* WARNING: CANNOT BE USED IN A NOP! */ ++# define K_STW_ASM_PIC " copy %%r19, %%r4\n" ++# define K_LDW_ASM_PIC " copy %%r4, %%r19\n" ++# define K_USING_GR4 "%r4", ++#else ++# define K_STW_ASM_PIC " \n" ++# define K_LDW_ASM_PIC " \n" ++# define K_USING_GR4 ++#endif ++ ++/* GCC has to be warned that a syscall may clobber all the ABI ++ registers listed as "caller-saves", see page 8, Table 2 ++ in section 2.2.6 of the PA-RISC RUN-TIME architecture ++ document. However! r28 is the result and will conflict with ++ the clobber list so it is left out. Also the input arguments ++ registers r20 -> r26 will conflict with the list so they ++ are treated specially. Although r19 is clobbered by the syscall ++ we cannot say this because it would violate ABI, thus we say ++ r4 is clobbered and use that register to save/restore r19 ++ across the syscall. */ ++ ++#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \ ++ "%r20", "%r29", "%r31" ++ ++#undef K_INLINE_SYSCALL ++#define K_INLINE_SYSCALL(name, nr, args...) ({ \ ++ long __sys_res; \ ++ { \ ++ register unsigned long __res __asm__("r28"); \ ++ K_LOAD_ARGS_##nr(args) \ ++ /* FIXME: HACK stw/ldw r19 around syscall */ \ ++ __asm__ volatile( \ ++ K_STW_ASM_PIC \ ++ " ble 0x100(%%sr2, %%r0)\n" \ ++ " ldi %1, %%r20\n" \ ++ K_LDW_ASM_PIC \ ++ : "=r" (__res) \ ++ : "i" (SYS_ify(name)) K_ASM_ARGS_##nr \ ++ : "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr \ ++ ); \ ++ __sys_res = (long)__res; \ ++ } \ ++ __sys_res; \ ++}) ++ ++#define K_LOAD_ARGS_0() ++#define K_LOAD_ARGS_1(r26) \ ++ register unsigned long __r26 __asm__("r26") = (unsigned long)(r26); \ ++ K_LOAD_ARGS_0() ++#define K_LOAD_ARGS_2(r26,r25) \ ++ register unsigned long __r25 __asm__("r25") = (unsigned long)(r25); \ ++ K_LOAD_ARGS_1(r26) ++#define K_LOAD_ARGS_3(r26,r25,r24) \ ++ register unsigned long __r24 __asm__("r24") = (unsigned long)(r24); \ ++ K_LOAD_ARGS_2(r26,r25) ++#define K_LOAD_ARGS_4(r26,r25,r24,r23) \ ++ register unsigned long __r23 __asm__("r23") = (unsigned long)(r23); \ ++ K_LOAD_ARGS_3(r26,r25,r24) ++#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22) \ ++ register unsigned long __r22 __asm__("r22") = (unsigned long)(r22); \ ++ K_LOAD_ARGS_4(r26,r25,r24,r23) ++#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21) \ ++ register unsigned long __r21 __asm__("r21") = (unsigned long)(r21); \ ++ K_LOAD_ARGS_5(r26,r25,r24,r23,r22) ++ ++/* Even with zero args we use r20 for the syscall number */ ++#define K_ASM_ARGS_0 ++#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26) ++#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25) ++#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24) ++#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23) ++#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22) ++#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21) ++ ++/* The registers not listed as inputs but clobbered */ ++#define K_CLOB_ARGS_6 ++#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21" ++#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22" ++#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23" ++#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24" ++#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25" ++#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26" ++ ++#define io_syscall1(type,fname,sname,type1,arg1) \ ++type fname(type1 arg1) \ ++{ \ ++ return K_INLINE_SYSCALL(sname, 1, arg1); \ ++} ++ ++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \ ++type fname(type1 arg1, type2 arg2) \ ++{ \ ++ return K_INLINE_SYSCALL(sname, 2, arg1, arg2); \ ++} ++ ++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \ ++type fname(type1 arg1, type2 arg2, type3 arg3) \ ++{ \ ++ return K_INLINE_SYSCALL(sname, 3, arg1, arg2, arg3); \ ++} ++ ++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ ++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ ++{ \ ++ return K_INLINE_SYSCALL(sname, 4, arg1, arg2, arg3, arg4); \ ++} ++ ++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ ++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ ++{ \ ++ return K_INLINE_SYSCALL(sname, 5, arg1, arg2, arg3, arg4, arg5); \ ++} ++ +Index: libaio-0.3.110/src/syscall-arm.h +=================================================================== +--- libaio-0.3.110.orig/src/syscall-arm.h ++++ libaio-0.3.110/src/syscall-arm.h +@@ -114,3 +114,119 @@ type fname(type1 arg1, type2 arg2, type3 + return (type) __res_r0; \ + } + ++/* ++ * linux/include/asm-arm/unistd.h ++ * ++ * Copyright (C) 2001-2005 Russell King ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * Please forward _all_ changes to this file to rmk@arm.linux.org.uk, ++ * no matter what the change is. Thanks! ++ */ ++ ++#define __NR_OABI_SYSCALL_BASE 0x900000 ++ ++#if defined(__thumb__) || defined(__ARM_EABI__) ++#define __NR_SYSCALL_BASE 0 ++#else ++#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE ++#endif ++ ++#define __NR_io_setup (__NR_SYSCALL_BASE+243) ++#define __NR_io_destroy (__NR_SYSCALL_BASE+244) ++#define __NR_io_getevents (__NR_SYSCALL_BASE+245) ++#define __NR_io_submit (__NR_SYSCALL_BASE+246) ++#define __NR_io_cancel (__NR_SYSCALL_BASE+247) ++ ++#define __sys2(x) #x ++#define __sys1(x) __sys2(x) ++ ++#if defined(__thumb__) || defined(__ARM_EABI__) ++#define __SYS_REG(name) register long __sysreg __asm__("r7") = __NR_##name; ++#define __SYS_REG_LIST(regs...) "r" (__sysreg) , ##regs ++#define __syscall(name) "swi\t0" ++#else ++#define __SYS_REG(name) ++#define __SYS_REG_LIST(regs...) regs ++#define __syscall(name) "swi\t" __sys1(__NR_##name) "" ++#endif ++ ++#define io_syscall1(type,fname,sname,type1,arg1) \ ++type fname(type1 arg1) { \ ++ __SYS_REG(sname) \ ++ register long __r0 __asm__("r0") = (long)arg1; \ ++ register long __res_r0 __asm__("r0"); \ ++ __asm__ __volatile__ ( \ ++ __syscall(sname) \ ++ : "=r" (__res_r0) \ ++ : __SYS_REG_LIST( "0" (__r0) ) \ ++ : "memory" ); \ ++ return (type) __res_r0; \ ++} ++ ++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \ ++type fname(type1 arg1,type2 arg2) { \ ++ __SYS_REG(sname) \ ++ register long __r0 __asm__("r0") = (long)arg1; \ ++ register long __r1 __asm__("r1") = (long)arg2; \ ++ register long __res_r0 __asm__("r0"); \ ++ __asm__ __volatile__ ( \ ++ __syscall(sname) \ ++ : "=r" (__res_r0) \ ++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) \ ++ : "memory" ); \ ++ return (type) __res_r0; \ ++} ++ ++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \ ++type fname(type1 arg1,type2 arg2,type3 arg3) { \ ++ __SYS_REG(sname) \ ++ register long __r0 __asm__("r0") = (long)arg1; \ ++ register long __r1 __asm__("r1") = (long)arg2; \ ++ register long __r2 __asm__("r2") = (long)arg3; \ ++ register long __res_r0 __asm__("r0"); \ ++ __asm__ __volatile__ ( \ ++ __syscall(sname) \ ++ : "=r" (__res_r0) \ ++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) \ ++ : "memory" ); \ ++ return (type) __res_r0; \ ++} ++ ++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\ ++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ ++ __SYS_REG(sname) \ ++ register long __r0 __asm__("r0") = (long)arg1; \ ++ register long __r1 __asm__("r1") = (long)arg2; \ ++ register long __r2 __asm__("r2") = (long)arg3; \ ++ register long __r3 __asm__("r3") = (long)arg4; \ ++ register long __res_r0 __asm__("r0"); \ ++ __asm__ __volatile__ ( \ ++ __syscall(sname) \ ++ : "=r" (__res_r0) \ ++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) \ ++ : "memory" ); \ ++ return (type) __res_r0; \ ++} ++ ++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ ++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) {\ ++ __SYS_REG(sname) \ ++ register long __r0 __asm__("r0") = (long)arg1; \ ++ register long __r1 __asm__("r1") = (long)arg2; \ ++ register long __r2 __asm__("r2") = (long)arg3; \ ++ register long __r3 __asm__("r3") = (long)arg4; \ ++ register long __r4 __asm__("r4") = (long)arg5; \ ++ register long __res_r0 __asm__("r0"); \ ++ __asm__ __volatile__ ( \ ++ __syscall(sname) \ ++ : "=r" (__res_r0) \ ++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ ++ "r" (__r3), "r" (__r4) ) \ ++ : "memory" ); \ ++ return (type) __res_r0; \ ++} ++ diff --git a/poky/meta/recipes-extended/libaio/libaio/destdir.patch b/poky/meta/recipes-extended/libaio/libaio/destdir.patch new file mode 100644 index 000000000..0f90406be --- /dev/null +++ b/poky/meta/recipes-extended/libaio/libaio/destdir.patch @@ -0,0 +1,17 @@ +Upstream-Status: Pending + +from openembedded, added by Qing He <qing.he@intel.com> + +Index: libaio-0.3.110/Makefile +=================================================================== +--- libaio-0.3.110.orig/Makefile ++++ libaio-0.3.110/Makefile +@@ -15,7 +15,7 @@ all: + @$(MAKE) -C src + + install: +- @$(MAKE) -C src install prefix=$(prefix) includedir=$(includedir) libdir=$(libdir) ++ @$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir) + + check: + @$(MAKE) -C harness check diff --git a/poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch b/poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch new file mode 100644 index 000000000..bba7e554a --- /dev/null +++ b/poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch @@ -0,0 +1,65 @@ +From: Nathan Rossi <nathan.rossi@xilinx.com> +Date: Tue, 27 Jan 2015 14:59:35 +1000 +Subject: [PATCH] Generic arch dectection for padding defines + +When available use the GNU C defines for endian and bitwidth to +determine the padding required. This reduces the need to define the +padding selection for every architecture. + +Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com> +Signed-off-by: Jeff Moyer <jmoyer@redhat.com> +Upstream-Status: Backport +--- + src/libaio.h | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/src/libaio.h b/src/libaio.h +index 1223146..4a4e0f5 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -52,14 +52,18 @@ typedef enum io_iocb_cmd { + /* little endian, 32 bits */ + #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \ + defined(__sh__) || defined(__bfin__) || defined(__MIPSEL__) || \ +- defined(__cris__) ++ defined(__cris__) || \ ++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ ++ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 4) + #define PADDED(x, y) x; unsigned y + #define PADDEDptr(x, y) x; unsigned y + #define PADDEDul(x, y) unsigned long x; unsigned y + + /* little endian, 64 bits */ + #elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) || \ +- (defined(__aarch64__) && defined(__AARCH64EL__)) ++ (defined(__aarch64__) && defined(__AARCH64EL__)) || \ ++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ ++ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 8) + #define PADDED(x, y) x, y + #define PADDEDptr(x, y) x + #define PADDEDul(x, y) unsigned long x +@@ -67,7 +71,9 @@ typedef enum io_iocb_cmd { + /* big endian, 64 bits */ + #elif defined(__powerpc64__) || defined(__s390x__) || \ + (defined(__sparc__) && defined(__arch64__)) || \ +- (defined(__aarch64__) && defined(__AARCH64EB__)) ++ (defined(__aarch64__) && defined(__AARCH64EB__)) || \ ++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ ++ __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_LONG__ == 8) + #define PADDED(x, y) unsigned y; x + #define PADDEDptr(x,y) x + #define PADDEDul(x, y) unsigned long x +@@ -76,7 +82,9 @@ typedef enum io_iocb_cmd { + #elif defined(__PPC__) || defined(__s390__) || \ + (defined(__arm__) && defined(__ARMEB__)) || \ + defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \ +- defined(__hppa__) || defined(__frv__) || defined(__avr32__) ++ defined(__hppa__) || defined(__frv__) || defined(__avr32__) || \ ++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ ++ __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_LONG__ == 4) + #define PADDED(x, y) unsigned y; x + #define PADDEDptr(x, y) unsigned y; x + #define PADDEDul(x, y) unsigned y; unsigned long x +-- +2.1.1 + diff --git a/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch b/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch new file mode 100644 index 000000000..9c6850c08 --- /dev/null +++ b/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch @@ -0,0 +1,62 @@ +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Phil Staub <Phil.Staub@windriver.com> + +Index: libaio-0.3.109/src/syscall-mips.h +=================================================================== +--- libaio-0.3.109.orig/src/syscall-mips.h ++++ libaio-0.3.109/src/syscall-mips.h +@@ -76,7 +76,7 @@ type fname(atype a) \ + \ + if (__a3 == 0) \ + return (type) __v0; \ +- return (type) -1; \ ++ return (type) (-(__v0)); \ + } + + #define io_syscall2(type,fname,sname,atype,a,btype,b) \ +@@ -100,7 +100,7 @@ type fname(atype a, btype b) \ + \ + if (__a3 == 0) \ + return (type) __v0; \ +- return (type) -1; \ ++ return (type) (-(__v0)); \ + } + + #define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \ +@@ -125,7 +125,7 @@ type fname(atype a, btype b, ctype c) \ + \ + if (__a3 == 0) \ + return (type) __v0; \ +- return (type) -1; \ ++ return (type) (-(__v0)); \ + } + + #define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \ +@@ -150,7 +150,7 @@ type fname(atype a, btype b, ctype c, dt + \ + if (__a3 == 0) \ + return (type) __v0; \ +- return (type) -1; \ ++ return (type) (-(__v0)); \ + } + + #if (_MIPS_SIM == _MIPS_SIM_ABI32) +@@ -186,7 +186,7 @@ type fname(atype a, btype b, ctype c, dt + \ + if (__a3 == 0) \ + return (type) __v0; \ +- return (type) -1; \ ++ return (type) (-(__v0)); \ + } + + #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */ +@@ -216,7 +216,7 @@ type fname (atype a,btype b,ctype c,dtyp + \ + if (__a3 == 0) \ + return (type) __v0; \ +- return (type) -1; \ ++ return (type) (-(__v0)); \ + } + + #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */ diff --git a/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch b/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch new file mode 100644 index 000000000..dc4ba505b --- /dev/null +++ b/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch @@ -0,0 +1,61 @@ +Upstream-Status: Pending + +Properly load arguments 5 an 6 for x86-64 syscall +Use asm ("r10") and asm ("r8") to load arguments 5 an 6 for x86-64 +syscall so that it works with both x32 and x86-64. + +Received this patch from H.J. Lu <hjl.tools@gmail.com> + +Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> +2011/12/02 + +--- libaio-0.3.109/src/syscall-x86_64.h.x32 2009-10-09 11:17:02.000000000 -0700 ++++ libaio-0.3.109/src/syscall-x86_64.h 2011-12-02 09:09:07.537603224 -0800 +@@ -1,8 +1,18 @@ ++#ifndef __NR_io_setup + #define __NR_io_setup 206 ++#endif ++#ifndef __NR_io_destroy + #define __NR_io_destroy 207 ++#endif ++#ifndef __NR_io_getevents + #define __NR_io_getevents 208 ++#endif ++#ifndef __NR_io_submit + #define __NR_io_submit 209 ++#endif ++#ifndef __NR_io_cancel + #define __NR_io_cancel 210 ++#endif + + #define __syscall_clobber "r11","rcx","memory" + #define __syscall "syscall" +@@ -42,10 +52,11 @@ return __res; \ + type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ + { \ + long __res; \ +-__asm__ volatile ("movq %5,%%r10 ;" __syscall \ ++register long __a4 asm ("r10") = (long) arg4; \ ++__asm__ volatile (__syscall \ + : "=a" (__res) \ + : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \ +- "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \ ++ "d" ((long)(arg3)),"r" (__a4)); \ + return __res; \ + } + +@@ -54,10 +65,11 @@ return __res; \ + type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ + { \ + long __res; \ +-__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall \ ++register long __a4 asm ("r10") = (long) arg4; \ ++register long __a5 asm ("r8") = (long) arg5; \ ++__asm__ volatile ( __syscall \ + : "=a" (__res) \ + : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \ +- "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) : \ +- __syscall_clobber,"r8","r10" ); \ ++ "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \ + return __res; \ + } diff --git a/poky/meta/recipes-extended/libaio/libaio/system-linkage.patch b/poky/meta/recipes-extended/libaio/libaio/system-linkage.patch new file mode 100644 index 000000000..0b1f47569 --- /dev/null +++ b/poky/meta/recipes-extended/libaio/libaio/system-linkage.patch @@ -0,0 +1,37 @@ +From 94bba6880b1f10c6b3bf33a17ac40935d65a81ae Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Fri, 6 Nov 2015 15:19:46 +0000 +Subject: [PATCH] Don't remove the system libraries and startup files from + libaio, as in some build configurations these are required. For example, + including conf/include/security_flags.inc on PPC results in: + +io_queue_init.os: In function `io_queue_init': +tmp/work/ppce300c3-poky-linux/libaio/0.3.110-r0/libaio-0.3.110/src/io_queue_init.c:33: +undefined reference to `__stack_chk_fail_local' + +Upstream-Status: Pending +Signed-off-by: Ross Burton <ross.burton@intel.com> +--- + src/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index eadb336..56ab701 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -3,10 +3,10 @@ includedir=$(prefix)/include + libdir=$(prefix)/lib + + CFLAGS ?= -g -fomit-frame-pointer -O2 +-CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC ++CFLAGS += -Wall -I. -fPIC + SO_CFLAGS=-shared $(CFLAGS) + L_CFLAGS=$(CFLAGS) +-LINK_FLAGS= ++LINK_FLAGS=$(LDFLAGS) + LINK_FLAGS+=$(LDFLAGS) + + soname=libaio.so.1 +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/libaio/libaio_0.3.110.bb b/poky/meta/recipes-extended/libaio/libaio_0.3.110.bb new file mode 100644 index 000000000..75975d4ab --- /dev/null +++ b/poky/meta/recipes-extended/libaio/libaio_0.3.110.bb @@ -0,0 +1,26 @@ +SUMMARY = "Asynchronous I/O library" +DESCRIPTION = "Asynchronous input/output library that uses the kernels native interface" +HOMEPAGE = "http://lse.sourceforge.net/io/aio.html" + +LICENSE = "LGPLv2.1+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499" + +SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/liba/${BPN}/${BPN}_${PV}.orig.tar.gz \ + file://generic-arch-dectection-for-padding-defines.patch \ + file://00_arches.patch \ + file://destdir.patch \ + file://libaio_fix_for_x32.patch \ + file://libaio_fix_for_mips_syscalls.patch \ + file://system-linkage.patch \ + " + +SRC_URI[md5sum] = "2a35602e43778383e2f4907a4ca39ab8" +SRC_URI[sha256sum] = "e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e" + +UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/liba/libaio/" + +EXTRA_OEMAKE =+ "prefix=${prefix} includedir=${includedir} libdir=${libdir}" + +do_install () { + oe_runmake install DESTDIR=${D} +} diff --git a/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14166.patch b/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14166.patch new file mode 100644 index 000000000..e85fec40a --- /dev/null +++ b/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14166.patch @@ -0,0 +1,37 @@ +libarchive-3.3.2: Fix CVE-2017-14166 + +[No upstream tracking] -- https://github.com/libarchive/libarchive/pull/935 + +archive_read_support_format_xar: heap-based buffer overflow in xml_data + +Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/fa7438a0ff4033e4741c807394a9af6207940d71] +CVE: CVE-2017-14166 +Bug: 935 +Signed-off-by: Andrej Valek <andrej.valek@siemens.com> + +diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c +index 7a22beb..93eeacc 100644 +--- a/libarchive/archive_read_support_format_xar.c ++++ b/libarchive/archive_read_support_format_xar.c +@@ -1040,6 +1040,9 @@ atol10(const char *p, size_t char_cnt) + uint64_t l; + int digit; + ++ if (char_cnt == 0) ++ return (0); ++ + l = 0; + digit = *p - '0'; + while (digit >= 0 && digit < 10 && char_cnt-- > 0) { +@@ -1054,7 +1057,10 @@ atol8(const char *p, size_t char_cnt) + { + int64_t l; + int digit; +- ++ ++ if (char_cnt == 0) ++ return (0); ++ + l = 0; + while (char_cnt-- > 0) { + if (*p >= '0' && *p <= '7') diff --git a/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch b/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch new file mode 100644 index 000000000..72e154643 --- /dev/null +++ b/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch @@ -0,0 +1,37 @@ +From 5562545b5562f6d12a4ef991fae158bf4ccf92b6 Mon Sep 17 00:00:00 2001 +From: Joerg Sonnenberger <joerg@bec.de> +Date: Sat, 9 Sep 2017 17:47:32 +0200 +Subject: [PATCH] Avoid a read off-by-one error for UTF16 names in RAR + archives. + +Reported-By: OSS-Fuzz issue 573 + +CVE: CVE-2017-14502 + +Upstream-Status: Backport + +Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> +--- + libarchive/archive_read_support_format_rar.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c +index cbb14c3..751de69 100644 +--- a/libarchive/archive_read_support_format_rar.c ++++ b/libarchive/archive_read_support_format_rar.c +@@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_entry *entry, + return (ARCHIVE_FATAL); + } + filename[filename_size++] = '\0'; +- filename[filename_size++] = '\0'; ++ /* ++ * Do not increment filename_size here as the computations below ++ * add the space for the terminating NUL explicitly. ++ */ ++ filename[filename_size] = '\0'; + + /* Decoded unicode form is UTF-16BE, so we have to update a string + * conversion object for it. */ +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/libarchive/libarchive/bug929.patch b/poky/meta/recipes-extended/libarchive/libarchive/bug929.patch new file mode 100644 index 000000000..2f3254c8d --- /dev/null +++ b/poky/meta/recipes-extended/libarchive/libarchive/bug929.patch @@ -0,0 +1,38 @@ +libarchive-3.3.2: Fix bug929 + +[No upstream tracking] -- https://github.com/libarchive/libarchive/pull/929 + +archive_read_support_format_cpio: header_newc(): Avoid overflow when reading corrupt +cpio archive + +A cpio "newc" archive with a namelength of "FFFFFFFF", if read on a +system with a 32-bit size_t, would result in namelength + name_pad +overflowing 32 bits and libarchive attempting to copy 2^32-1 bytes +from a 2-byte buffer, with appropriately hilarious results. + +Check for this overflow and fail; there's no legitimate reason for a +cpio archive to contain a file with a name over 4 billion characters +in length. + +Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/bac4659e0b970990e7e3f3a3d239294e96311630] +Bug: 929 +Signed-off-by: Andrej Valek <andrej.valek@siemens.com> + +diff --git a/libarchive/archive_read_support_format_cpio.c b/libarchive/archive_read_support_format_cpio.c +index ad9f782..1faa64d 100644 +--- a/libarchive/archive_read_support_format_cpio.c ++++ b/libarchive/archive_read_support_format_cpio.c +@@ -633,6 +633,13 @@ header_newc(struct archive_read *a, struct cpio *cpio, + /* Pad name to 2 more than a multiple of 4. */ + *name_pad = (2 - *namelength) & 3; + ++ /* Make sure that the padded name length fits into size_t. */ ++ if ((size_t)(*namelength + *name_pad) < *namelength) { ++ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, ++ "cpio archive has invalid namelength"); ++ return (ARCHIVE_FATAL); ++ } ++ + /* + * Note: entry_bytes_remaining is at least 64 bits and + * therefore guaranteed to be big enough for a 33-bit file diff --git a/poky/meta/recipes-extended/libarchive/libarchive/non-recursive-extract-and-list.patch b/poky/meta/recipes-extended/libarchive/libarchive/non-recursive-extract-and-list.patch new file mode 100644 index 000000000..cd7be5127 --- /dev/null +++ b/poky/meta/recipes-extended/libarchive/libarchive/non-recursive-extract-and-list.patch @@ -0,0 +1,153 @@ +From 47f7566f6829c2b14e21bbbba699916de4998c72 Mon Sep 17 00:00:00 2001 +From: Patrick Ohly <patrick.ohly@intel.com> +Date: Mon, 24 Oct 2016 12:54:48 +0200 +Subject: [PATCH 1/1] non-recursive extract and list + +Sometimes it makes sense to extract or list a directory contained in +an archive without also doing the same for the content of the +directory, i.e. allowing -n (= --no-recursion) in combination with the +x and t modes. + +bsdtar uses the match functionality in libarchive to track include +matches. A new libarchive API call +archive_match_include_directories_recursively() gets introduced to +influence the matching behavior, with the default behavior as before. + +Non-recursive matching can be achieved by anchoring the path match at +both start and end. Asking for a directory which itself isn't in the +archive when in non-recursive mode is an error and handled by the +existing mechanism for tracking unused inclusion entries. + +Upstream-Status: Submitted [https://github.com/libarchive/libarchive/pull/812] + +Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> + +--- + libarchive/archive.h | 2 ++ + libarchive/archive_match.c | 30 +++++++++++++++++++++++++++++- + tar/bsdtar.1 | 3 +-- + tar/bsdtar.c | 12 ++++++++++-- + 4 files changed, 42 insertions(+), 5 deletions(-) + +diff --git a/libarchive/archive.h b/libarchive/archive.h +index 32710201..59fb4aa6 100644 +--- a/libarchive/archive.h ++++ b/libarchive/archive.h +@@ -1093,6 +1093,8 @@ __LA_DECL int archive_match_excluded(struct archive *, + */ + __LA_DECL int archive_match_path_excluded(struct archive *, + struct archive_entry *); ++/* Control recursive inclusion of directory content when directory is included. Default on. */ ++__LA_DECL int archive_match_include_directories_recursively(struct archive *, int _enabled); + /* Add exclusion pathname pattern. */ + __LA_DECL int archive_match_exclude_pattern(struct archive *, const char *); + __LA_DECL int archive_match_exclude_pattern_w(struct archive *, +diff --git a/libarchive/archive_match.c b/libarchive/archive_match.c +index be72066e..bb6a3407 100644 +--- a/libarchive/archive_match.c ++++ b/libarchive/archive_match.c +@@ -93,6 +93,9 @@ struct archive_match { + /* exclusion/inclusion set flag. */ + int setflag; + ++ /* Recursively include directory content? */ ++ int recursive_include; ++ + /* + * Matching filename patterns. + */ +@@ -223,6 +226,7 @@ archive_match_new(void) + return (NULL); + a->archive.magic = ARCHIVE_MATCH_MAGIC; + a->archive.state = ARCHIVE_STATE_NEW; ++ a->recursive_include = 1; + match_list_init(&(a->inclusions)); + match_list_init(&(a->exclusions)); + __archive_rb_tree_init(&(a->exclusion_tree), &rb_ops_mbs); +@@ -471,6 +475,28 @@ archive_match_path_excluded(struct archive *_a, + } + + /* ++ * When recursive inclusion of directory content is enabled, ++ * an inclusion pattern that matches a directory will also ++ * include everything beneath that directory. Enabled by default. ++ * ++ * For compatibility with GNU tar, exclusion patterns always ++ * match if a subset of the full patch matches (i.e., they are ++ * are not rooted at the beginning of the path) and thus there ++ * is no corresponding non-recursive exclusion mode. ++ */ ++int ++archive_match_include_directories_recursively(struct archive *_a, int _enabled) ++{ ++ struct archive_match *a; ++ ++ archive_check_magic(_a, ARCHIVE_MATCH_MAGIC, ++ ARCHIVE_STATE_NEW, "archive_match_include_directories_recursively"); ++ a = (struct archive_match *)_a; ++ a->recursive_include = _enabled; ++ return (ARCHIVE_OK); ++} ++ ++/* + * Utility functions to get statistic information for inclusion patterns. + */ + int +@@ -781,7 +807,9 @@ static int + match_path_inclusion(struct archive_match *a, struct match *m, + int mbs, const void *pn) + { +- int flag = PATHMATCH_NO_ANCHOR_END; ++ int flag = a->recursive_include ? ++ PATHMATCH_NO_ANCHOR_END : /* Prefix match is good enough. */ ++ 0; /* Full match required. */ + int r; + + if (mbs) { +diff --git a/tar/bsdtar.1 b/tar/bsdtar.1 +index 132e1145..1dd2a847 100644 +--- a/tar/bsdtar.1 ++++ b/tar/bsdtar.1 +@@ -386,8 +386,7 @@ and the default behavior in c, r, and u modes or if + .Nm + is run in x mode as root. + .It Fl n , Fl Fl norecurse , Fl Fl no-recursion +-(c, r, u modes only) +-Do not recursively archive the contents of directories. ++Do not recursively archive (c, r, u), extract (x) or list (t) the contents of directories. + .It Fl Fl newer Ar date + (c, r, u modes only) + Only include files and directories newer than the specified date. +diff --git a/tar/bsdtar.c b/tar/bsdtar.c +index 11dedbf9..d014cc3e 100644 +--- a/tar/bsdtar.c ++++ b/tar/bsdtar.c +@@ -794,8 +794,6 @@ main(int argc, char **argv) + break; + } + } +- if (bsdtar->flags & OPTFLAG_NO_SUBDIRS) +- only_mode(bsdtar, "-n", "cru"); + if (bsdtar->flags & OPTFLAG_STDOUT) + only_mode(bsdtar, "-O", "xt"); + if (bsdtar->flags & OPTFLAG_UNLINK_FIRST) +@@ -845,6 +843,16 @@ main(int argc, char **argv) + only_mode(bsdtar, buff, "cru"); + } + ++ /* ++ * When creating an archive from a directory tree, the directory ++ * walking code will already avoid entering directories when ++ * recursive inclusion of directory content is disabled, therefore ++ * changing the matching behavior has no effect for creation modes. ++ * It is relevant for extraction or listing. ++ */ ++ archive_match_include_directories_recursively(bsdtar->matching, ++ !(bsdtar->flags & OPTFLAG_NO_SUBDIRS)); ++ + /* Filename "-" implies stdio. */ + if (strcmp(bsdtar->filename, "-") == 0) + bsdtar->filename = NULL; +-- +2.11.0 + diff --git a/poky/meta/recipes-extended/libarchive/libarchive_3.3.2.bb b/poky/meta/recipes-extended/libarchive/libarchive_3.3.2.bb new file mode 100644 index 000000000..5daca2731 --- /dev/null +++ b/poky/meta/recipes-extended/libarchive/libarchive_3.3.2.bb @@ -0,0 +1,71 @@ +SUMMARY = "Support for reading various archive formats" +DESCRIPTION = "C library and command-line tools for reading and writing tar, cpio, zip, ISO, and other archive formats" +HOMEPAGE = "http://www.libarchive.org/" +SECTION = "devel" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=ed99aca006bc346974bb745a35336425" + +DEPENDS = "e2fsprogs-native" + +PACKAGECONFIG ?= "zlib bz2 xz lzo" + +PACKAGECONFIG_append_class-target = "\ + libxml2 \ + ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \ +" + +DEPENDS_BZIP2 = "bzip2-replacement-native" +DEPENDS_BZIP2_class-target = "bzip2" + +PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," +PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr," +PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib," +PACKAGECONFIG[bz2] = "--with-bz2lib,--without-bz2lib,${DEPENDS_BZIP2}," +PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz," +PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl," +PACKAGECONFIG[libxml2] = "--with-xml2,--without-xml2,libxml2," +PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat," +PACKAGECONFIG[lzo] = "--with-lzo2,--without-lzo2,lzo," +PACKAGECONFIG[nettle] = "--with-nettle,--without-nettle,nettle," +PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4," + +EXTRA_OECONF += "--enable-largefile" + +SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \ + file://bug929.patch \ + file://CVE-2017-14166.patch \ + file://CVE-2017-14502.patch \ + file://non-recursive-extract-and-list.patch \ + " + +SRC_URI[md5sum] = "4583bd6b2ebf7e0e8963d90879eb1b27" +SRC_URI[sha256sum] = "ed2dbd6954792b2c054ccf8ec4b330a54b85904a80cef477a1c74643ddafa0ce" + +inherit autotools update-alternatives pkgconfig + +CPPFLAGS += "-I${WORKDIR}/extra-includes" + +do_configure[cleandirs] += "${WORKDIR}/extra-includes" +do_configure_prepend() { + # We just need the headers for some type constants, so no need to + # build all of e2fsprogs for the target + cp -R ${STAGING_INCDIR_NATIVE}/ext2fs ${WORKDIR}/extra-includes/ +} + +ALTERNATIVE_PRIORITY = "80" + +PACKAGES =+ "bsdtar" +FILES_bsdtar = "${bindir}/bsdtar" + +ALTERNATIVE_bsdtar = "tar" +ALTERNATIVE_LINK_NAME[tar] = "${base_bindir}/tar" +ALTERNATIVE_TARGET[tar] = "${bindir}/bsdtar" + +PACKAGES =+ "bsdcpio" +FILES_bsdcpio = "${bindir}/bsdcpio" + +ALTERNATIVE_bsdcpio = "cpio" +ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio" +ALTERNATIVE_TARGET[cpio] = "${bindir}/bsdcpio" + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch b/poky/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch new file mode 100644 index 000000000..2d5faabb2 --- /dev/null +++ b/poky/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch @@ -0,0 +1,694 @@ +From 7148adf34dae30345c2e4d9d437838a45ba6f6e8 Mon Sep 17 00:00:00 2001 +From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de> +Date: Wed, 1 Feb 2017 11:06:39 +0100 +Subject: [PATCH] Fix -Wformat warnings + +--- +Upstream-Status: Backport +Signed-off-by: Khem Raj <raj.khem@gmail.com> + + examples/example.c | 6 +++--- + examples/example3.c | 4 ++-- + examples/example4.c | 4 ++-- + examples/example5.c | 2 +- + src/idn.c | 2 +- + tests/tst_idna.c | 25 +++++++++++++------------ + tests/tst_idna2.c | 8 ++++---- + tests/tst_idna3.c | 8 ++++---- + tests/tst_nfkc.c | 8 ++++---- + tests/tst_pr29.c | 12 ++++++------ + tests/tst_punycode.c | 13 +++++++------ + tests/tst_strerror.c | 20 ++++++++++---------- + tests/tst_stringprep.c | 12 ++++++------ + tests/tst_tld.c | 20 ++++++++++---------- + tests/utils.c | 6 +++--- + 15 files changed, 76 insertions(+), 74 deletions(-) + +diff --git a/examples/example.c b/examples/example.c +index 6e91783..24f64e0 100644 +--- a/examples/example.c ++++ b/examples/example.c +@@ -55,7 +55,7 @@ main (void) + + printf ("Before locale2utf8 (length %ld): ", (long int) strlen (buf)); + for (i = 0; i < strlen (buf); i++) +- printf ("%02x ", buf[i] & 0xFF); ++ printf ("%02x ", (unsigned) buf[i] & 0xFF); + printf ("\n"); + + p = stringprep_locale_to_utf8 (buf); +@@ -69,7 +69,7 @@ main (void) + + printf ("Before stringprep (length %ld): ", (long int) strlen (buf)); + for (i = 0; i < strlen (buf); i++) +- printf ("%02x ", buf[i] & 0xFF); ++ printf ("%02x ", (unsigned) buf[i] & 0xFF); + printf ("\n"); + + rc = stringprep (buf, BUFSIZ, 0, stringprep_nameprep); +@@ -79,7 +79,7 @@ main (void) + { + printf ("After stringprep (length %ld): ", (long int) strlen (buf)); + for (i = 0; i < strlen (buf); i++) +- printf ("%02x ", buf[i] & 0xFF); ++ printf ("%02x ", (unsigned) buf[i] & 0xFF); + printf ("\n"); + } + +diff --git a/examples/example3.c b/examples/example3.c +index fc11c1c..ffb9042 100644 +--- a/examples/example3.c ++++ b/examples/example3.c +@@ -56,7 +56,7 @@ main (void) + + printf ("Read string (length %ld): ", (long int) strlen (buf)); + for (i = 0; i < strlen (buf); i++) +- printf ("%02x ", buf[i] & 0xFF); ++ printf ("%02x ", (unsigned) buf[i] & 0xFF); + printf ("\n"); + + rc = idna_to_ascii_lz (buf, &p, 0); +@@ -68,7 +68,7 @@ main (void) + + printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p); + for (i = 0; i < strlen (p); i++) +- printf ("%02x ", p[i] & 0xFF); ++ printf ("%02x ", (unsigned) p[i] & 0xFF); + printf ("\n"); + + free (p); +diff --git a/examples/example4.c b/examples/example4.c +index 1b319c9..a3315a1 100644 +--- a/examples/example4.c ++++ b/examples/example4.c +@@ -56,7 +56,7 @@ main (void) + + printf ("Read string (length %ld): ", (long int) strlen (buf)); + for (i = 0; i < strlen (buf); i++) +- printf ("%02x ", buf[i] & 0xFF); ++ printf ("%02x ", (unsigned) buf[i] & 0xFF); + printf ("\n"); + + rc = idna_to_unicode_lzlz (buf, &p, 0); +@@ -68,7 +68,7 @@ main (void) + + printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p); + for (i = 0; i < strlen (p); i++) +- printf ("%02x ", p[i] & 0xFF); ++ printf ("%02x ", (unsigned) p[i] & 0xFF); + printf ("\n"); + + free (p); +diff --git a/examples/example5.c b/examples/example5.c +index df55798..29d40b9 100644 +--- a/examples/example5.c ++++ b/examples/example5.c +@@ -68,7 +68,7 @@ main (void) + + printf ("Read string (length %ld): ", (long int) strlen (buf)); + for (i = 0; i < strlen (buf); i++) +- printf ("%02x ", buf[i] & 0xFF); ++ printf ("%02x ", (unsigned) buf[i] & 0xFF); + printf ("\n"); + + p = stringprep_locale_to_utf8 (buf); +diff --git a/src/idn.c b/src/idn.c +index be1c7d1..13eb3c9 100644 +--- a/src/idn.c ++++ b/src/idn.c +@@ -419,7 +419,7 @@ main (int argc, char *argv[]) + size_t i; + for (i = 0; p[i]; i++) + fprintf (stderr, "output[%lu] = U+%04x\n", +- (unsigned long) i, p[i]); ++ (unsigned long) i, (unsigned) p[i]); + } + + fprintf (stdout, "%s\n", p); +diff --git a/tests/tst_idna.c b/tests/tst_idna.c +index 415764e..4ac046f 100644 +--- a/tests/tst_idna.c ++++ b/tests/tst_idna.c +@@ -220,13 +220,14 @@ doit (void) + char label[100]; + uint32_t *ucs4label = NULL; + uint32_t tmp[100]; +- size_t len, len2, i; ++ size_t len, len2; + int rc; ++ unsigned i; + + for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++) + { + if (debug) +- printf ("IDNA entry %ld: %s\n", i, idna[i].name); ++ printf ("IDNA entry %u: %s\n", i, idna[i].name); + + if (debug) + { +@@ -237,7 +238,7 @@ doit (void) + rc = idna_to_ascii_4i (idna[i].in, idna[i].inlen, label, idna[i].flags); + if (rc != idna[i].toasciirc) + { +- fail ("IDNA entry %ld failed: %d\n", i, rc); ++ fail ("IDNA entry %u failed: %d\n", i, rc); + if (debug) + printf ("FATAL\n"); + continue; +@@ -256,7 +257,7 @@ doit (void) + if (strlen (idna[i].out) != strlen (label) || + strcasecmp (idna[i].out, label) != 0) + { +- fail ("IDNA entry %ld failed\n", i); ++ fail ("IDNA entry %u failed\n", i); + if (debug) + printf ("ERROR\n"); + } +@@ -273,8 +274,8 @@ doit (void) + + if (debug) + { +- printf ("in: %s (%ld==%ld)\n", idna[i].out, strlen (idna[i].out), +- len); ++ printf ("in: %s (%d==%d)\n", idna[i].out, (int) strlen (idna[i].out), ++ (int) len); + ucs4print (ucs4label, len); + } + +@@ -282,20 +283,20 @@ doit (void) + rc = idna_to_unicode_44i (ucs4label, len, tmp, &len2, idna[i].flags); + if (debug) + { +- printf ("expected out (%ld):\n", ++ printf ("expected out (%lu):\n", + rc == IDNA_SUCCESS ? idna[i].inlen : len); + if (rc == IDNA_SUCCESS) + ucs4print (idna[i].in, idna[i].inlen); + else + ucs4print (ucs4label, len); + +- printf ("computed out (%ld):\n", len2); ++ printf ("computed out (%d):\n", (int) len2); + ucs4print (tmp, len2); + } + + if (rc != idna[i].tounicoderc) + { +- fail ("IDNA entry %ld failed: %d\n", i, rc); ++ fail ("IDNA entry %u failed: %d\n", i, rc); + if (debug) + printf ("FATAL\n"); + continue; +@@ -309,11 +310,11 @@ doit (void) + if (debug) + { + if (rc == IDNA_SUCCESS) +- printf ("len=%ld len2=%ld\n", len2, idna[i].inlen); ++ printf ("len=%d len2=%d\n", (int) len2, (int) idna[i].inlen); + else +- printf ("len=%ld len2=%ld\n", len, len2); ++ printf ("len=%d len2=%d\n", (int) len, (int) len2); + } +- fail ("IDNA entry %ld failed\n", i); ++ fail ("IDNA entry %u failed\n", i); + if (debug) + printf ("ERROR\n"); + } +diff --git a/tests/tst_idna2.c b/tests/tst_idna2.c +index 65b3a4d..38932ca 100644 +--- a/tests/tst_idna2.c ++++ b/tests/tst_idna2.c +@@ -461,14 +461,14 @@ static const struct idna idna[] = { + void + doit (void) + { +- size_t i; ++ unsigned i; + char *out; + int rc; + + for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++) + { + if (debug) +- printf ("IDNA2 entry %ld\n", i); ++ printf ("IDNA2 entry %u\n", i); + + if (debug) + { +@@ -487,7 +487,7 @@ doit (void) + IDNA_USE_STD3_ASCII_RULES); + if (rc != IDNA_SUCCESS && strlen (idna[i].out) > 0) + { +- fail ("IDNA2 entry %ld failed: %d\n", i, rc); ++ fail ("IDNA2 entry %u failed: %d\n", i, rc); + continue; + } + +@@ -504,7 +504,7 @@ doit (void) + if (strlen (idna[i].out) != strlen (out) || + strcasecmp (idna[i].out, out) != 0) + { +- fail ("IDNA2 entry %ld failed\n", i); ++ fail ("IDNA2 entry %u failed\n", i); + if (debug) + printf ("ERROR\n"); + } +diff --git a/tests/tst_idna3.c b/tests/tst_idna3.c +index a189378..f65628c 100644 +--- a/tests/tst_idna3.c ++++ b/tests/tst_idna3.c +@@ -59,13 +59,13 @@ doit (void) + { + int rc; + char *out = NULL; +- size_t i; ++ unsigned i; + + for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++) + { + rc = idna_to_unicode_8z8z (idna[i].in, &out, 0); + if (rc != IDNA_SUCCESS) +- fail ("IDNA3[%ld] failed %d\n", i, rc); ++ fail ("IDNA3[%u] failed %d\n", i, rc); + + if (debug && rc == IDNA_SUCCESS) + { +@@ -75,9 +75,9 @@ doit (void) + } + + if (strcmp (out, idna[i].out) != 0) +- fail ("IDNA3[%ld] failed\n", i); ++ fail ("IDNA3[%u] failed\n", i); + else if (debug) +- printf ("IDNA3[%ld] success\n", i); ++ printf ("IDNA3[%u] success\n", i); + + if (out) + idn_free (out); +diff --git a/tests/tst_nfkc.c b/tests/tst_nfkc.c +index d150fec..f5af9c6 100644 +--- a/tests/tst_nfkc.c ++++ b/tests/tst_nfkc.c +@@ -68,18 +68,18 @@ void + doit (void) + { + char *out; +- size_t i; ++ unsigned i; + + for (i = 0; i < sizeof (nfkc) / sizeof (nfkc[0]); i++) + { + if (debug) +- printf ("NFKC entry %ld\n", i); ++ printf ("NFKC entry %u\n", i); + + out = stringprep_utf8_nfkc_normalize (nfkc[i].in, + (ssize_t) strlen (nfkc[i].in)); + if (out == NULL) + { +- fail ("NFKC entry %ld failed fatally\n", i); ++ fail ("NFKC entry %u failed fatally\n", i); + continue; + } + +@@ -114,7 +114,7 @@ doit (void) + if (strlen (nfkc[i].out) != strlen (out) || + memcmp (nfkc[i].out, out, strlen (out)) != 0) + { +- fail ("NFKC entry %ld failed\n", i); ++ fail ("NFKC entry %u failed\n", i); + if (debug) + printf ("ERROR\n"); + } +diff --git a/tests/tst_pr29.c b/tests/tst_pr29.c +index 3dc5466..11d0ede 100644 +--- a/tests/tst_pr29.c ++++ b/tests/tst_pr29.c +@@ -91,7 +91,7 @@ static const struct tv tv[] = { + void + doit (void) + { +- size_t i; ++ unsigned i; + int rc; + + for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) +@@ -100,7 +100,7 @@ doit (void) + { + uint32_t *p, *q; + +- printf ("PR29 entry %ld: %s\n", i, tv[i].name); ++ printf ("PR29 entry %u: %s\n", i, tv[i].name); + + printf ("in:\n"); + ucs4print (tv[i].in, tv[i].inlen); +@@ -120,7 +120,7 @@ doit (void) + rc = pr29_4 (tv[i].in, tv[i].inlen); + if (rc != tv[i].rc) + { +- fail ("PR29 entry %ld failed (expected %d): %d\n", i, tv[i].rc, rc); ++ fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc, rc); + if (debug) + printf ("FATAL\n"); + continue; +@@ -129,7 +129,7 @@ doit (void) + rc = pr29_4z (tv[i].in); + if (rc != tv[i].rc) + { +- fail ("PR29 entry %ld failed (expected %d): %d\n", i, tv[i].rc, rc); ++ fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc, rc); + if (debug) + printf ("FATAL\n"); + continue; +@@ -142,7 +142,7 @@ doit (void) + p = stringprep_ucs4_to_utf8 (tv[i].in, (ssize_t) tv[i].inlen, + &items_read, &items_written); + if (p == NULL) +- fail ("FAIL: stringprep_ucs4_to_utf8(tv[%ld]) == NULL\n", i); ++ fail ("FAIL: stringprep_ucs4_to_utf8(tv[%u]) == NULL\n", i); + if (debug) + hexprint (p, strlen (p)); + +@@ -150,7 +150,7 @@ doit (void) + free (p); + if (rc != tv[i].rc) + { +- fail ("PR29 entry %ld failed (expected %d): %d\n", ++ fail ("PR29 entry %u failed (expected %d): %d\n", + i, tv[i].rc, rc); + if (debug) + printf ("FATAL\n"); +diff --git a/tests/tst_punycode.c b/tests/tst_punycode.c +index 493b8a2..997744a 100644 +--- a/tests/tst_punycode.c ++++ b/tests/tst_punycode.c +@@ -173,7 +173,8 @@ doit (void) + char *p; + uint32_t *q; + int rc; +- size_t i, outlen; ++ size_t outlen; ++ unsigned i; + + p = malloc (sizeof (*p) * BUFSIZ); + if (p == NULL) +@@ -186,7 +187,7 @@ doit (void) + for (i = 0; i < sizeof (punycode) / sizeof (punycode[0]); i++) + { + if (debug) +- printf ("PUNYCODE entry %ld: %s\n", i, punycode[i].name); ++ printf ("PUNYCODE entry %u: %s\n", i, punycode[i].name); + + if (debug) + { +@@ -199,7 +200,7 @@ doit (void) + NULL, &outlen, p); + if (rc != punycode[i].rc) + { +- fail ("punycode_encode() entry %ld failed: %d\n", i, rc); ++ fail ("punycode_encode() entry %u failed: %d\n", i, rc); + if (debug) + printf ("FATAL\n"); + continue; +@@ -221,7 +222,7 @@ doit (void) + if (strlen (punycode[i].out) != strlen (p) || + memcmp (punycode[i].out, p, strlen (p)) != 0) + { +- fail ("punycode() entry %ld failed\n", i); ++ fail ("punycode() entry %u failed\n", i); + if (debug) + printf ("ERROR\n"); + } +@@ -241,7 +242,7 @@ doit (void) + &outlen, q, NULL); + if (rc != punycode[i].rc) + { +- fail ("punycode() entry %ld failed: %d\n", i, rc); ++ fail ("punycode() entry %u failed: %d\n", i, rc); + if (debug) + printf ("FATAL\n"); + continue; +@@ -262,7 +263,7 @@ doit (void) + if (punycode[i].inlen != outlen || + memcmp (punycode[i].in, q, outlen) != 0) + { +- fail ("punycode_decode() entry %ld failed\n", i); ++ fail ("punycode_decode() entry %u failed\n", i); + if (debug) + printf ("ERROR\n"); + } +diff --git a/tests/tst_strerror.c b/tests/tst_strerror.c +index 71fff59..730f5e4 100644 +--- a/tests/tst_strerror.c ++++ b/tests/tst_strerror.c +@@ -110,7 +110,7 @@ doit (void) + /* Iterate through all error codes. */ + + { +- size_t i; ++ unsigned i; + const char *last_p = NULL; + + for (i = 0;; i++) +@@ -126,13 +126,13 @@ doit (void) + break; + } + if (debug) +- printf ("idna %ld: %s\n", i, p); ++ printf ("idna %u: %s\n", i, p); + last_p = p; + } + } + + { +- size_t i; ++ unsigned i; + const char *last_p = NULL; + + for (i = 0;; i++) +@@ -141,13 +141,13 @@ doit (void) + if (p == last_p) + break; + if (debug) +- printf ("pr29 %ld: %s\n", i, p); ++ printf ("pr29 %u: %s\n", i, p); + last_p = p; + } + } + + { +- size_t i; ++ unsigned i; + const char *last_p = NULL; + + for (i = 0;; i++) +@@ -156,13 +156,13 @@ doit (void) + if (p == last_p) + break; + if (debug) +- printf ("punycode %ld: %s\n", i, p); ++ printf ("punycode %u: %s\n", i, p); + last_p = p; + } + } + + { +- size_t i; ++ unsigned i; + const char *last_p = NULL; + + for (i = 0;; i++) +@@ -183,13 +183,13 @@ doit (void) + break; + } + if (debug) +- printf ("stringprep %ld: %s\n", i, p); ++ printf ("stringprep %u: %s\n", i, p); + last_p = p; + } + } + + { +- size_t i; ++ unsigned i; + const char *last_p = NULL; + + for (i = 0;; i++) +@@ -198,7 +198,7 @@ doit (void) + if (p == last_p) + break; + if (debug) +- printf ("tld %ld: %s\n", i, p); ++ printf ("tld %u: %s\n", i, p); + last_p = p; + } + } +diff --git a/tests/tst_stringprep.c b/tests/tst_stringprep.c +index 149ce6f..7c9ab06 100644 +--- a/tests/tst_stringprep.c ++++ b/tests/tst_stringprep.c +@@ -205,7 +205,7 @@ doit (void) + { + char *p; + int rc; +- size_t i; ++ unsigned i; + + if (!stringprep_check_version (STRINGPREP_VERSION)) + fail ("stringprep_check_version failed (header %s runtime %s)\n", +@@ -224,7 +224,7 @@ doit (void) + for (i = 0; i < sizeof (strprep) / sizeof (strprep[0]); i++) + { + if (debug) +- printf ("STRINGPREP entry %ld\n", i); ++ printf ("STRINGPREP entry %u\n", i); + + if (debug) + { +@@ -247,12 +247,12 @@ doit (void) + continue; + else if (l == NULL) + { +- fail ("bad UTF-8 in entry %ld\n", i); ++ fail ("bad UTF-8 in entry %u\n", i); + continue; + } + else if (strcmp (strprep[i].in, x) != 0) + { +- fail ("bad UTF-8 in entry %ld\n", i); ++ fail ("bad UTF-8 in entry %u\n", i); + if (debug) + { + puts ("expected:"); +@@ -274,7 +274,7 @@ doit (void) + "Nameprep", strprep[i].flags); + if (rc != strprep[i].rc) + { +- fail ("stringprep() entry %ld failed: %d\n", i, rc); ++ fail ("stringprep() entry %u failed: %d\n", i, rc); + if (debug) + printf ("FATAL\n"); + if (rc == STRINGPREP_OK) +@@ -302,7 +302,7 @@ doit (void) + if (strlen (strprep[i].out) != strlen (p) || + memcmp (strprep[i].out, p, strlen (p)) != 0) + { +- fail ("stringprep() entry %ld failed\n", i); ++ fail ("stringprep() entry %ld failed\n", (long) i); + if (debug) + printf ("ERROR\n"); + } +diff --git a/tests/tst_tld.c b/tests/tst_tld.c +index 2f8e12e..d038c79 100644 +--- a/tests/tst_tld.c ++++ b/tests/tst_tld.c +@@ -80,7 +80,7 @@ const Tld_table * my_tld_tables[] = + void + doit (void) + { +- size_t i; ++ unsigned i; + const Tld_table *tldtable; + char *out; + size_t errpos; +@@ -206,7 +206,7 @@ doit (void) + for (i = 0; i < sizeof (tld) / sizeof (tld[0]); i++) + { + if (debug) +- printf ("TLD entry %ld: %s\n", i, tld[i].name); ++ printf ("TLD entry %u: %s\n", i, tld[i].name); + + if (debug) + { +@@ -217,7 +217,7 @@ doit (void) + tldtable = tld_default_table (tld[i].tld, NULL); + if (tldtable == NULL) + { +- fail ("TLD entry %ld tld_get_table (%s)\n", i, tld[i].tld); ++ fail ("TLD entry %u tld_get_table (%s)\n", i, tld[i].tld); + if (debug) + printf ("FATAL\n"); + continue; +@@ -226,7 +226,7 @@ doit (void) + rc = tld_check_4t (tld[i].in, tld[i].inlen, &errpos, tldtable); + if (rc != tld[i].rc) + { +- fail ("TLD entry %ld failed: %d\n", i, rc); ++ fail ("TLD entry %u failed: %d\n", i, rc); + if (debug) + printf ("FATAL\n"); + continue; +@@ -237,7 +237,7 @@ doit (void) + + if (rc != tld[i].rc) + { +- fail ("TLD entry %ld failed\n", i); ++ fail ("TLD entry %u failed\n", i); + if (debug) + printf ("ERROR\n"); + } +@@ -245,12 +245,12 @@ doit (void) + { + if (debug) + printf ("returned errpos %ld expected errpos %ld\n", +- errpos, tld[i].errpos); ++ (long) errpos, (long) tld[i].errpos); + + if (tld[i].errpos != errpos) + { +- fail ("TLD entry %ld failed because errpos %ld != %ld\n", i, +- tld[i].errpos, errpos); ++ fail ("TLD entry %u failed because errpos %ld != %ld\n", i, ++ (long) tld[i].errpos, (long) errpos); + if (debug) + printf ("ERROR\n"); + } +@@ -262,12 +262,12 @@ doit (void) + rc = tld_check_8z (tld[i].example, &errpos, NULL); + if (rc != tld[i].rc) + { +- fail ("TLD entry %ld failed\n", i); ++ fail ("TLD entry %u failed\n", i); + if (debug) + printf ("ERROR\n"); + } + if (debug) +- printf ("TLD entry %ld tld_check_8z (%s)\n", i, tld[i].example); ++ printf ("TLD entry %u tld_check_8z (%s)\n", i, tld[i].example); + } + } + } +diff --git a/tests/utils.c b/tests/utils.c +index 717ee01..5577dc3 100644 +--- a/tests/utils.c ++++ b/tests/utils.c +@@ -49,7 +49,7 @@ escapeprint (const char *str, size_t len) + { + size_t i; + +- printf (" (length %ld bytes):\n\t", len); ++ printf (" (length %ld bytes):\n\t", (long) len); + for (i = 0; i < len; i++) + { + if (((str[i] & 0xFF) >= 'A' && (str[i] & 0xFF) <= 'Z') || +@@ -58,7 +58,7 @@ escapeprint (const char *str, size_t len) + || (str[i] & 0xFF) == ' ' || (str[i] & 0xFF) == '.') + printf ("%c", (str[i] & 0xFF)); + else +- printf ("\\x%02X", (str[i] & 0xFF)); ++ printf ("\\x%02X", (unsigned) (str[i] & 0xFF)); + if ((i + 1) % 16 == 0 && (i + 1) < len) + printf ("'\n\t'"); + } +@@ -73,7 +73,7 @@ hexprint (const char *str, size_t len) + printf ("\t;; "); + for (i = 0; i < len; i++) + { +- printf ("%02x ", (str[i] & 0xFF)); ++ printf ("%02x ", (unsigned) (str[i] & 0xFF)); + if ((i + 1) % 8 == 0) + printf (" "); + if ((i + 1) % 16 == 0 && i + 1 < len) +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/libidn/libidn/0001-idn-format-security-warnings.patch b/poky/meta/recipes-extended/libidn/libidn/0001-idn-format-security-warnings.patch new file mode 100644 index 000000000..5adc7d9fd --- /dev/null +++ b/poky/meta/recipes-extended/libidn/libidn/0001-idn-format-security-warnings.patch @@ -0,0 +1,181 @@ +From 82f98dcbc429bbe89a9837c533cbcbc02e77c790 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com> +Date: Tue, 28 Jun 2016 12:43:31 +0100 +Subject: [PATCH] idn: fix printf() format security warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +| ../../libidn-1.32/src/idn.c: In function 'main': +| ../../libidn-1.32/src/idn.c:172:7: error: format not a string literal and no format arguments [-Werror=format-security] +| error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified")); +| ^~~~~ +| ../../libidn-1.32/src/idn.c:187:5: error: format not a string literal and no format arguments [-Werror=format-security] +| fprintf (stderr, _("Type each input string on a line by itself, " +| ^~~~~~~ +| ../../libidn-1.32/src/idn.c:202:4: error: format not a string literal and no format arguments [-Werror=format-security] +| error (EXIT_FAILURE, errno, _("input error")); +| ^~~~~ +| ../../libidn-1.32/src/idn.c:220:8: error: format not a string literal and no format arguments [-Werror=format-security] +| _("could not convert from UTF-8 to UCS-4")); +| ^ +| ../../libidn-1.32/src/idn.c:245:8: error: format not a string literal and no format arguments [-Werror=format-security] +| _("could not convert from UTF-8 to UCS-4")); +| ^ +| ../../libidn-1.32/src/idn.c:281:6: error: format not a string literal and no format arguments [-Werror=format-security] +| _("could not convert from UTF-8 to UCS-4")); +| ^ +| ../../libidn-1.32/src/idn.c:340:6: error: format not a string literal and no format arguments [-Werror=format-security] +| _("could not convert from UCS-4 to UTF-8")); +| ^ +| ../../libidn-1.32/src/idn.c:364:6: error: format not a string literal and no format arguments [-Werror=format-security] +| _("could not convert from UCS-4 to UTF-8")); +| ^ +| ../../libidn-1.32/src/idn.c:442:8: error: format not a string literal and no format arguments [-Werror=format-security] +| _("could not convert from UCS-4 to UTF-8")); +| ^ +| ../../libidn-1.32/src/idn.c:498:6: error: format not a string literal and no format arguments [-Werror=format-security] +| _("could not convert from UTF-8 to UCS-4")); +| ^ +| ../../libidn-1.32/src/idn.c:527:5: error: format not a string literal and no format arguments [-Werror=format-security] +| _("could not convert from UTF-8 to UCS-4")); +| ^ +| ../../libidn-1.32/src/idn.c:540:6: error: format not a string literal and no format arguments [-Werror=format-security] +| error (EXIT_FAILURE, 0, _("could not do NFKC normalization")); +| ^~~~~ +| ../../libidn-1.32/src/idn.c:551:5: error: format not a string literal and no format arguments [-Werror=format-security] +| _("could not convert from UTF-8 to UCS-4")); +| ^ + +Signed-off-by: André Draszik <adraszik@tycoint.com> +--- +Upstream-Status: Pending + + src/idn.c | 27 ++++++++++++++------------- + 1 file changed, 14 insertions(+), 13 deletions(-) + +diff --git a/src/idn.c b/src/idn.c +index be1c7d1..68e4291 100644 +--- a/src/idn.c ++++ b/src/idn.c +@@ -170,7 +170,7 @@ main (int argc, char *argv[]) + (args_info.idna_to_unicode_given ? 1 : 0) + + (args_info.nfkc_given ? 1 : 0) != 1) + { +- error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified")); ++ error (0, 0, "%s", _("only one of -s, -e, -d, -a, -u or -n can be specified")); + usage (EXIT_FAILURE); + } + +@@ -185,7 +185,7 @@ main (int argc, char *argv[]) + if (!args_info.quiet_given + && args_info.inputs_num == 0 + && isatty (fileno (stdin))) +- fprintf (stderr, _("Type each input string on a line by itself, " ++ fprintf (stderr, "%s", _("Type each input string on a line by itself, " + "terminated by a newline character.\n")); + + do +@@ -197,7 +197,7 @@ main (int argc, char *argv[]) + if (feof (stdin)) + break; + +- error (EXIT_FAILURE, errno, _("input error")); ++ error (EXIT_FAILURE, errno, "%s", _("input error")); + } + + if (strlen (line) > 0) +@@ -215,7 +215,7 @@ main (int argc, char *argv[]) + if (!q) + { + free (p); +- error (EXIT_FAILURE, 0, ++ error (EXIT_FAILURE, 0, "%s", + _("could not convert from UTF-8 to UCS-4")); + } + +@@ -240,7 +240,7 @@ main (int argc, char *argv[]) + if (!q) + { + free (r); +- error (EXIT_FAILURE, 0, ++ error (EXIT_FAILURE, 0, "%s", + _("could not convert from UTF-8 to UCS-4")); + } + +@@ -277,7 +277,7 @@ main (int argc, char *argv[]) + q = stringprep_utf8_to_ucs4 (p, -1, &len); + free (p); + if (!q) +- error (EXIT_FAILURE, 0, ++ error (EXIT_FAILURE, 0, "%s", + _("could not convert from UTF-8 to UCS-4")); + + if (args_info.debug_given) +@@ -336,7 +336,7 @@ main (int argc, char *argv[]) + r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL); + free (q); + if (!r) +- error (EXIT_FAILURE, 0, ++ error (EXIT_FAILURE, 0, "%s", + _("could not convert from UCS-4 to UTF-8")); + + p = stringprep_utf8_to_locale (r); +@@ -360,7 +360,7 @@ main (int argc, char *argv[]) + q = stringprep_utf8_to_ucs4 (p, -1, NULL); + free (p); + if (!q) +- error (EXIT_FAILURE, 0, ++ error (EXIT_FAILURE, 0, "%s", + _("could not convert from UCS-4 to UTF-8")); + + if (args_info.debug_given) +@@ -438,7 +438,7 @@ main (int argc, char *argv[]) + if (!q) + { + free (p); +- error (EXIT_FAILURE, 0, ++ error (EXIT_FAILURE, 0, "%s", + _("could not convert from UCS-4 to UTF-8")); + } + +@@ -494,7 +494,7 @@ main (int argc, char *argv[]) + r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL); + free (q); + if (!r) +- error (EXIT_FAILURE, 0, ++ error (EXIT_FAILURE, 0, "%s", + _("could not convert from UTF-8 to UCS-4")); + + p = stringprep_utf8_to_locale (r); +@@ -523,7 +523,7 @@ main (int argc, char *argv[]) + if (!q) + { + free (p); +- error (EXIT_FAILURE, 0, ++ error (EXIT_FAILURE, 0, "%s", + _("could not convert from UTF-8 to UCS-4")); + } + +@@ -537,7 +537,8 @@ main (int argc, char *argv[]) + r = stringprep_utf8_nfkc_normalize (p, -1); + free (p); + if (!r) +- error (EXIT_FAILURE, 0, _("could not do NFKC normalization")); ++ error (EXIT_FAILURE, 0, "%s", ++ _("could not do NFKC normalization")); + + if (args_info.debug_given) + { +@@ -547,7 +548,7 @@ main (int argc, char *argv[]) + if (!q) + { + free (r); +- error (EXIT_FAILURE, 0, ++ error (EXIT_FAILURE, 0, "%s", + _("could not convert from UTF-8 to UCS-4")); + } + +-- +2.8.1 + diff --git a/poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch b/poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch new file mode 100644 index 000000000..98ba4d6ff --- /dev/null +++ b/poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch @@ -0,0 +1,25 @@ +Upstream-Status: Inappropriate + +automake 1.12.x has deprecated AM_PROG_MKDIR_P , and throws a warning for that, +and the warnings are treated as errors because of the -Werror parameter. + +These AM_PROG_MKDIR_P are coming from gettext, and the latest gettext code has not +eliminated these deprecated macros yet. So disable the treatment of warnings +as errors until gettext is updated to remove the deprecated macros. + +Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> +2012/07/10 + +Index: libidn-1.24/configure.ac +=================================================================== +--- libidn-1.24.orig/configure.ac ++++ libidn-1.24/configure.ac +@@ -23,7 +23,7 @@ AC_COPYRIGHT([Copyright (c) 2002-2011 Si + AC_CONFIG_AUX_DIR([build-aux]) + AC_CONFIG_MACRO_DIR([m4]) + AC_CONFIG_HEADERS(config.h) +-AM_INIT_AUTOMAKE([1.10 -Wall -Werror -Wno-override]) ++AM_INIT_AUTOMAKE([1.10 -Wall -Wno-override]) + AM_SILENT_RULES([yes]) + + # Library code modified: REVISION++ diff --git a/poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch b/poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch new file mode 100644 index 000000000..0863530f2 --- /dev/null +++ b/poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch @@ -0,0 +1,23 @@ +Upstream-Status: Inappropriate [disable feature] + +Signed-off-by: Marko Lindqvist <cazfi74@gmail.com> +diff -Nurdd libidn-1.26/doc/Makefile.am libidn-1.26/doc/Makefile.am +--- libidn-1.26/doc/Makefile.am 2012-09-18 11:25:45.000000000 +0300 ++++ libidn-1.26/doc/Makefile.am 2013-02-08 07:41:24.591431462 +0200 +@@ -49,15 +49,9 @@ + + # Man pages. + +-dist_man_MANS = idn.1 $(gdoc_MANS) ++dist_man_MANS = $(gdoc_MANS) + MAINTAINERCLEANFILES = $(dist_man_MANS) + +-idn.1: $(top_srcdir)/src/idn.c $(top_srcdir)/src/idn.ggo \ +- $(top_srcdir)/configure.ac +- $(HELP2MAN) \ +- --name="Internationalized Domain Names command line tool" \ +- --output=$@ $(top_builddir)/src/idn$(EXEEXT) +- + # GDOC + + GDOC_BIN = $(srcdir)/gdoc diff --git a/poky/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch b/poky/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch new file mode 100644 index 000000000..546a6eaaf --- /dev/null +++ b/poky/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch @@ -0,0 +1,334 @@ +From 230930b3bc3e431b819eb45420cb42475d83ca93 Mon Sep 17 00:00:00 2001 +From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de> +Date: Wed, 1 Feb 2017 10:44:36 +0100 +Subject: [PATCH] Update intprops.h for gcc-7 compatibility + +--- +Upstream-Status: Backport +Signed-off-by: Khem Raj <raj.khem@gmail.com> + + gl/intprops.h | 65 ++++++++++++++++++++++++++++++-------------------- + lib/gltests/intprops.h | 65 ++++++++++++++++++++++++++++++-------------------- + 2 files changed, 78 insertions(+), 52 deletions(-) + +diff --git a/gl/intprops.h b/gl/intprops.h +index e1fce5c..eb06b69 100644 +--- a/gl/intprops.h ++++ b/gl/intprops.h +@@ -1,18 +1,18 @@ + /* intprops.h -- properties of integer types + +- Copyright (C) 2001-2016 Free Software Foundation, Inc. ++ Copyright (C) 2001-2017 Free Software Foundation, Inc. + + 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 3 of the License, or ++ under the terms of the GNU Lesser General Public License as published ++ by the Free Software Foundation; either version 2.1 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. ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU General Public License ++ You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + + /* Written by Paul Eggert. */ +@@ -47,12 +47,16 @@ + + /* Minimum and maximum values for integer types and expressions. */ + ++/* The width in bits of the integer type or expression T. ++ Padding bits are not supported; this is checked at compile-time below. */ ++#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) ++ + /* The maximum and minimum values for the integer type T. */ + #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) + #define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ +- : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) ++ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) + + /* The maximum and minimum values for the type of the expression E, + after integer promotion. E should not have side effects. */ +@@ -65,7 +69,13 @@ + ? _GL_SIGNED_INT_MAXIMUM (e) \ + : _GL_INT_NEGATE_CONVERT (e, 1)) + #define _GL_SIGNED_INT_MAXIMUM(e) \ +- (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1) ++ (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) ++ ++/* Work around OpenVMS incompatibility with C99. */ ++#if !defined LLONG_MAX && defined __INT64_MAX ++# define LLONG_MAX __INT64_MAX ++# define LLONG_MIN __INT64_MIN ++#endif + + /* This include file assumes that signed types are two's complement without + padding bits; the above macros have undefined behavior otherwise. +@@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX); + verify (TYPE_MINIMUM (long long int) == LLONG_MIN); + verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + #endif ++/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined. */ ++#ifdef UINT_WIDTH ++verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH); ++#endif + + /* Does the __typeof__ keyword work? This could be done by + 'configure', but for now it's easier to do it by hand. */ +-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ ++#if (2 <= __GNUC__ \ ++ || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) + # define _GL_HAVE___TYPEOF__ 1 + #else +@@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + signed, this macro may overestimate the true bound by one byte when + applied to unsigned types of size 2, 4, 16, ... bytes. */ + #define INT_STRLEN_BOUND(t) \ +- (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \ +- - _GL_SIGNED_TYPE_OR_EXPR (t)) \ ++ (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \ + + _GL_SIGNED_TYPE_OR_EXPR (t)) + + /* Bound on buffer size needed to represent an integer type or expression T, +@@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + ? (a) < (min) >> (b) \ + : (max) >> (b) < (a)) + +-/* True if __builtin_add_overflow (A, B, P) works when P is null. */ +-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__) ++/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */ ++#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__) ++ ++/* True if __builtin_add_overflow_p (A, B, C) works. */ ++#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) + + /* The _GL*_OVERFLOW macros have the same restrictions as the + *_RANGE_OVERFLOW macros, except that they do not assume that operands + (e.g., A and B) have the same type as MIN and MAX. Instead, they assume + that the result (e.g., A + B) has that type. */ +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL +-# define _GL_ADD_OVERFLOW(a, b, min, max) +- __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0) +-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) +- __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0) +-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) +- __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0) ++#if _GL_HAS_BUILTIN_OVERFLOW_P ++# define _GL_ADD_OVERFLOW(a, b, min, max) \ ++ __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0) ++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \ ++ __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0) ++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \ ++ __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0) + #else + # define _GL_ADD_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \ +@@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW) + #define INT_SUBTRACT_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW) +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL ++#if _GL_HAS_BUILTIN_OVERFLOW_P + # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a) + #else + # define INT_NEGATE_OVERFLOW(a) \ +@@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + #define INT_MULTIPLY_WRAPV(a, b, r) \ + _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW) + +-#ifndef __has_builtin +-# define __has_builtin(x) 0 +-#endif +- + /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 + https://llvm.org/bugs/show_bug.cgi?id=25390 +@@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + the operation. BUILTIN is the builtin operation, and OVERFLOW the + overflow predicate. Return 1 if the result overflows. See above + for restrictions. */ +-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow) ++#if _GL_HAS_BUILTIN_OVERFLOW + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r) + #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ +@@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + # else + # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ +- long int, LONG_MIN, LONG_MAX)) ++ long int, LONG_MIN, LONG_MAX) + # endif + #endif + +diff --git a/lib/gltests/intprops.h b/lib/gltests/intprops.h +index e1fce5c..eb06b69 100644 +--- a/lib/gltests/intprops.h ++++ b/lib/gltests/intprops.h +@@ -1,18 +1,18 @@ + /* intprops.h -- properties of integer types + +- Copyright (C) 2001-2016 Free Software Foundation, Inc. ++ Copyright (C) 2001-2017 Free Software Foundation, Inc. + + 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 3 of the License, or ++ under the terms of the GNU Lesser General Public License as published ++ by the Free Software Foundation; either version 2.1 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. ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU General Public License ++ You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + + /* Written by Paul Eggert. */ +@@ -47,12 +47,16 @@ + + /* Minimum and maximum values for integer types and expressions. */ + ++/* The width in bits of the integer type or expression T. ++ Padding bits are not supported; this is checked at compile-time below. */ ++#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) ++ + /* The maximum and minimum values for the integer type T. */ + #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) + #define TYPE_MAXIMUM(t) \ + ((t) (! TYPE_SIGNED (t) \ + ? (t) -1 \ +- : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) ++ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) + + /* The maximum and minimum values for the type of the expression E, + after integer promotion. E should not have side effects. */ +@@ -65,7 +69,13 @@ + ? _GL_SIGNED_INT_MAXIMUM (e) \ + : _GL_INT_NEGATE_CONVERT (e, 1)) + #define _GL_SIGNED_INT_MAXIMUM(e) \ +- (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1) ++ (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) ++ ++/* Work around OpenVMS incompatibility with C99. */ ++#if !defined LLONG_MAX && defined __INT64_MAX ++# define LLONG_MAX __INT64_MAX ++# define LLONG_MIN __INT64_MIN ++#endif + + /* This include file assumes that signed types are two's complement without + padding bits; the above macros have undefined behavior otherwise. +@@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX); + verify (TYPE_MINIMUM (long long int) == LLONG_MIN); + verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + #endif ++/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined. */ ++#ifdef UINT_WIDTH ++verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH); ++#endif + + /* Does the __typeof__ keyword work? This could be done by + 'configure', but for now it's easier to do it by hand. */ +-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ ++#if (2 <= __GNUC__ \ ++ || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) + # define _GL_HAVE___TYPEOF__ 1 + #else +@@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + signed, this macro may overestimate the true bound by one byte when + applied to unsigned types of size 2, 4, 16, ... bytes. */ + #define INT_STRLEN_BOUND(t) \ +- (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \ +- - _GL_SIGNED_TYPE_OR_EXPR (t)) \ ++ (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \ + + _GL_SIGNED_TYPE_OR_EXPR (t)) + + /* Bound on buffer size needed to represent an integer type or expression T, +@@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + ? (a) < (min) >> (b) \ + : (max) >> (b) < (a)) + +-/* True if __builtin_add_overflow (A, B, P) works when P is null. */ +-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__) ++/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */ ++#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__) ++ ++/* True if __builtin_add_overflow_p (A, B, C) works. */ ++#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) + + /* The _GL*_OVERFLOW macros have the same restrictions as the + *_RANGE_OVERFLOW macros, except that they do not assume that operands + (e.g., A and B) have the same type as MIN and MAX. Instead, they assume + that the result (e.g., A + B) has that type. */ +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL +-# define _GL_ADD_OVERFLOW(a, b, min, max) +- __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0) +-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) +- __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0) +-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) +- __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0) ++#if _GL_HAS_BUILTIN_OVERFLOW_P ++# define _GL_ADD_OVERFLOW(a, b, min, max) \ ++ __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0) ++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \ ++ __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0) ++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \ ++ __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0) + #else + # define _GL_ADD_OVERFLOW(a, b, min, max) \ + ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \ +@@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW) + #define INT_SUBTRACT_OVERFLOW(a, b) \ + _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW) +-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL ++#if _GL_HAS_BUILTIN_OVERFLOW_P + # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a) + #else + # define INT_NEGATE_OVERFLOW(a) \ +@@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + #define INT_MULTIPLY_WRAPV(a, b, r) \ + _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW) + +-#ifndef __has_builtin +-# define __has_builtin(x) 0 +-#endif +- + /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 + https://llvm.org/bugs/show_bug.cgi?id=25390 +@@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + the operation. BUILTIN is the builtin operation, and OVERFLOW the + overflow predicate. Return 1 if the result overflows. See above + for restrictions. */ +-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow) ++#if _GL_HAS_BUILTIN_OVERFLOW + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r) + #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS + # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ +@@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); + # else + # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ + _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ +- long int, LONG_MIN, LONG_MAX)) ++ long int, LONG_MIN, LONG_MAX) + # endif + #endif + +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch b/poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch new file mode 100644 index 000000000..db91317ca --- /dev/null +++ b/poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch @@ -0,0 +1,26 @@ +Upstream-Status: Pending + +This patch fixes following issue with automake 1.12 + +| automake: warnings are treated as errors +| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libidn.la': linking libtool libraries using a non-POSIX +| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac' + +Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> +2012/05/03 + +Index: libidn-1.33/configure.ac +=================================================================== +--- libidn-1.33.orig/configure.ac ++++ libidn-1.33/configure.ac +@@ -33,6 +33,10 @@ AC_SUBST(LT_CURRENT, 17) + AC_SUBST(LT_REVISION, 16) + AC_SUBST(LT_AGE, 6) + ++# automake 1.12 seems to require this, but automake 1.11 doesn't recognize it ++m4_pattern_allow([AM_PROG_AR]) ++AM_PROG_AR ++ + AC_PROG_CC + gl_EARLY + lgl_EARLY diff --git a/poky/meta/recipes-extended/libidn/libidn_1.33.bb b/poky/meta/recipes-extended/libidn/libidn_1.33.bb new file mode 100644 index 000000000..9e8bdbae1 --- /dev/null +++ b/poky/meta/recipes-extended/libidn/libidn_1.33.bb @@ -0,0 +1,44 @@ +SUMMARY = "Internationalized Domain Name support library" +DESCRIPTION = "Implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group." +HOMEPAGE = "http://www.gnu.org/software/libidn/" +SECTION = "libs" +LICENSE = "(LGPLv2.1+ | LGPLv3) & GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=df4be47940a91ee69556f5f71eed4aec \ + file://COPYING.LESSERv2;md5=4fbd65380cdd255951079008b364516c \ + file://COPYING.LESSERv3;md5=e6a600fd5e1d9cbde2d983680233ad02 \ + file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504 \ + file://lib/idna.h;endline=21;md5=37cffad24807f446a24de3e7371f20b9 \ + file://src/idn.c;endline=20;md5=09e97034a8877b3451cb65065fc2c06e" +DEPENDS = "virtual/libiconv" + +inherit pkgconfig autotools gettext texinfo gtk-doc + +SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \ + file://libidn_fix_for_automake-1.12.patch \ + file://avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch \ + file://dont-depend-on-help2man.patch \ + file://0001-idn-fix-printf-format-security-warnings.patch \ + file://gcc7-compatibility.patch \ + file://0001-idn-format-security-warnings.patch \ +" + +SRC_URI[md5sum] = "a9aa7e003665de9c82bd3f9fc6ccf308" +SRC_URI[sha256sum] = "44a7aab635bb721ceef6beecc4d49dfd19478325e1b47f3196f7d2acc4930e19" + +# command tool is under GPLv3+, while libidn itself is under LGPLv2.1+ or LGPLv3 +# so package command into a separate package +PACKAGES =+ "idn" +FILES_idn = "${bindir}/*" + +LICENSE_${PN} = "LGPLv2.1+ | LGPLv3" +LICENSE_idn = "GPLv3+" + +EXTRA_OECONF = "--disable-csharp" + +do_install_append() { + rm -rf ${D}${datadir}/emacs +} + +BBCLASSEXTEND = "native nativesdk" + diff --git a/poky/meta/recipes-extended/libmnl/libmnl_1.0.4.bb b/poky/meta/recipes-extended/libmnl/libmnl_1.0.4.bb new file mode 100644 index 000000000..23262e8c6 --- /dev/null +++ b/poky/meta/recipes-extended/libmnl/libmnl_1.0.4.bb @@ -0,0 +1,15 @@ +SUMMARY = "Minimalistic user-space Netlink utility library" +DESCRIPTION = "Minimalistic user-space library oriented to Netlink developers, providing \ + functions for common tasks in parsing, validating, and constructing both the Netlink header and TLVs." +HOMEPAGE = "http://www.netfilter.org/projects/libmnl/index.html" +SECTION = "libs" +LICENSE = "LGPLv2.1+" +LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" + +SRC_URI = "http://www.netfilter.org/projects/libmnl/files/libmnl-${PV}.tar.bz2;name=tar" +SRC_URI[tar.md5sum] = "be9b4b5328c6da1bda565ac5dffadb2d" +SRC_URI[tar.sha256sum] = "171f89699f286a5854b72b91d06e8f8e3683064c5901fb09d954a9ab6f551f81" + +inherit autotools pkgconfig + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/libnsl/libnsl2/0001-include-sys-cdefs.h-explicitly.patch b/poky/meta/recipes-extended/libnsl/libnsl2/0001-include-sys-cdefs.h-explicitly.patch new file mode 100644 index 000000000..bd647ac55 --- /dev/null +++ b/poky/meta/recipes-extended/libnsl/libnsl2/0001-include-sys-cdefs.h-explicitly.patch @@ -0,0 +1,68 @@ +From 508a0ff690dfebc17c4f55a5f81824ed549bed66 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 18 Apr 2017 09:13:33 -0700 +Subject: [PATCH 1/2] include sys/cdefs.h explicitly + +glibc includes this header indirectly but not musl + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + src/rpcsvc/nis.h | 1 + + src/rpcsvc/nislib.h | 1 + + src/rpcsvc/ypclnt.h | 1 + + src/rpcsvc/ypupd.h | 1 + + 4 files changed, 4 insertions(+) + +diff --git a/src/rpcsvc/nis.h b/src/rpcsvc/nis.h +index 933c4d9..88cbca0 100644 +--- a/src/rpcsvc/nis.h ++++ b/src/rpcsvc/nis.h +@@ -32,6 +32,7 @@ + #ifndef _RPCSVC_NIS_H + #define _RPCSVC_NIS_H 1 + ++#include <sys/cdefs.h> + #include <features.h> + #include <rpc/rpc.h> + #include <rpcsvc/nis_tags.h> +diff --git a/src/rpcsvc/nislib.h b/src/rpcsvc/nislib.h +index a59c19b..a53fab3 100644 +--- a/src/rpcsvc/nislib.h ++++ b/src/rpcsvc/nislib.h +@@ -19,6 +19,7 @@ + #ifndef __RPCSVC_NISLIB_H__ + #define __RPCSVC_NISLIB_H__ + ++#include <sys/cdefs.h> + #include <features.h> + + __BEGIN_DECLS +diff --git a/src/rpcsvc/ypclnt.h b/src/rpcsvc/ypclnt.h +index fe43fd4..a686b61 100644 +--- a/src/rpcsvc/ypclnt.h ++++ b/src/rpcsvc/ypclnt.h +@@ -20,6 +20,7 @@ + #ifndef __RPCSVC_YPCLNT_H__ + #define __RPCSVC_YPCLNT_H__ + ++#include <sys/cdefs.h> + #include <features.h> + + /* Some defines */ +diff --git a/src/rpcsvc/ypupd.h b/src/rpcsvc/ypupd.h +index d07fd4d..2c57301 100644 +--- a/src/rpcsvc/ypupd.h ++++ b/src/rpcsvc/ypupd.h +@@ -33,6 +33,7 @@ + #ifndef __RPCSVC_YPUPD_H__ + #define __RPCSVC_YPUPD_H__ + ++#include <sys/cdefs.h> + #include <features.h> + + #include <rpc/rpc.h> +-- +2.12.2 + diff --git a/poky/meta/recipes-extended/libnsl/libnsl2/0001-nis_call.c-Include-stdint.h-for-uintptr_t-definition.patch b/poky/meta/recipes-extended/libnsl/libnsl2/0001-nis_call.c-Include-stdint.h-for-uintptr_t-definition.patch new file mode 100644 index 000000000..e9ae51710 --- /dev/null +++ b/poky/meta/recipes-extended/libnsl/libnsl2/0001-nis_call.c-Include-stdint.h-for-uintptr_t-definition.patch @@ -0,0 +1,27 @@ +From d71cbeb3b76e54778a4d5eec6d387cce653537ca Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 9 Jun 2017 09:49:35 -0700 +Subject: [PATCH] nis_call.c: Include stdint.h for uintptr_t definition + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + src/nisplus/nis_call.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/nisplus/nis_call.c b/src/nisplus/nis_call.c +index 1a2b90c..1dc982d 100644 +--- a/src/nisplus/nis_call.c ++++ b/src/nisplus/nis_call.c +@@ -23,6 +23,7 @@ + #include <errno.h> + #include <fcntl.h> + #include <string.h> ++#include <stdint.h> + #include <libintl.h> + #include <rpc/rpc.h> + #include <rpc/auth.h> +-- +2.13.1 + diff --git a/poky/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch b/poky/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch new file mode 100644 index 000000000..75fda4b0f --- /dev/null +++ b/poky/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch @@ -0,0 +1,57 @@ +From 60282514ea01af004d7f9e66dd3929223b7d2e7b Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 18 Apr 2017 09:16:12 -0700 +Subject: [PATCH 2/2] Define glibc specific macros + +Check and define +rawmemchr, __asprintf, __mempcpy, __strtok_r +__always_inline, TEMP_FAILURE_RETRY + +if not existing. Helps compiling with musl + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + +diff --git a/src/rpcsvc/nis.h b/src/rpcsvc/nis.h +index 88cbca0..23fc20c 100644 +--- a/src/rpcsvc/nis.h ++++ b/src/rpcsvc/nis.h +@@ -57,6 +57,34 @@ __BEGIN_DECLS + * <kukuk@suse.de> + */ + ++#ifndef rawmemchr ++#define rawmemchr(s,c) memchr((s),(size_t)-1,(c)) ++#endif ++ ++#ifndef __asprintf ++#define __asprintf asprintf ++#endif ++ ++#ifndef __mempcpy ++#define __mempcpy mempcpy ++#endif ++ ++#ifndef __strtok_r ++#define __strtok_r strtok_r ++#endif ++ ++#ifndef __always_inline ++#define __always_inline __attribute__((__always_inline__)) ++#endif ++ ++#ifndef TEMP_FAILURE_RETRY ++#define TEMP_FAILURE_RETRY(exp) ({ \ ++typeof (exp) _rc; \ ++ do { \ ++ _rc = (exp); \ ++ } while (_rc == -1 && errno == EINTR); \ ++ _rc; }) ++#endif + + #ifndef __nis_object_h + #define __nis_object_h +-- +2.12.2 + diff --git a/poky/meta/recipes-extended/libnsl/libnsl2_git.bb b/poky/meta/recipes-extended/libnsl/libnsl2_git.bb new file mode 100644 index 000000000..a539148ca --- /dev/null +++ b/poky/meta/recipes-extended/libnsl/libnsl2_git.bb @@ -0,0 +1,37 @@ +# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com> +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "Library containing NIS functions using TI-RPC (IPv6 enabled)" +DESCRIPTION = "This library contains the public client interface for NIS(YP) and NIS+\ + it was part of glibc and now is standalone packages. it also supports IPv6" +HOMEPAGE = "https://github.com/thkukuk/libnsl" +LICENSE = "LGPL-2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" +SECTION = "libs" +DEPENDS = "libtirpc" +DEPENDS_append_libc-musl = " bsd-headers" + +PV = "1.0.5+git${SRCPV}" + +SRCREV = "dfa2f313524aff9243c4d8ce1bace73786478356" + +SRC_URI = "git://github.com/thkukuk/libnsl \ + file://0001-include-sys-cdefs.h-explicitly.patch \ + file://0002-Define-glibc-specific-macros.patch \ + file://0001-nis_call.c-Include-stdint.h-for-uintptr_t-definition.patch \ + " + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig gettext + +EXTRA_OECONF += "--libdir=${libdir}/nsl --includedir=${includedir}/nsl" + +do_install_append() { + install -d ${D}${libdir} + mv ${D}${libdir}/nsl/pkgconfig ${D}${libdir} +} + +FILES_${PN} += "${libdir}/nsl/*.so.*" +FILES_${PN}-dev += "${includedir}/nsl ${libdir}/nsl/*.so" +FILES_${PN}-staticdev += "${libdir}/nsl/*.a" diff --git a/poky/meta/recipes-extended/libpipeline/libpipeline_1.5.0.bb b/poky/meta/recipes-extended/libpipeline/libpipeline_1.5.0.bb new file mode 100644 index 000000000..14cc9e519 --- /dev/null +++ b/poky/meta/recipes-extended/libpipeline/libpipeline_1.5.0.bb @@ -0,0 +1,14 @@ +SUMMARY = "pipeline manipulation library" +DESCRIPTION = "This is a C library for setting up and running pipelines of processes, \ +without needing to involve shell command-line parsing which is often \ +error-prone and insecure." +HOMEPAGE = "http://libpipeline.nongnu.org/" +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +SRC_URI = "${SAVANNAH_GNU_MIRROR}/libpipeline/libpipeline-${PV}.tar.gz" +SRC_URI[md5sum] = "b7437a5020190cfa84f09c412db38902" +SRC_URI[sha256sum] = "0d72e12e4f2afff67fd7b9df0a24d7ba42b5a7c9211ac5b3dcccc5cd8b286f2b" + +inherit pkgconfig autotools + diff --git a/poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch b/poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch new file mode 100644 index 000000000..e5cb60dd5 --- /dev/null +++ b/poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch @@ -0,0 +1,251 @@ +From 47c6f1b4332a9e4935c48cca826786a6b8fe6f59 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?= + =?UTF-8?q?=E3=82=B3=E3=82=99=E3=83=B3=E3=83=8F=E3=82=9A=29?= + <ngompa13@gmail.com> +Date: Wed, 11 Nov 2015 20:32:17 -0500 +Subject: [PATCH 1/2] Add fallback fopencookie() implementation + +In environments where neither fopencookie() nor funopen() +are implemented, we need to provide a suitable implementation +of fopencookie() that we can use. + +Alex Kanavin: rebased CMakeLists.txt change to apply to latest upstream code. + +Upstream-Status: Denied [https://github.com/openSUSE/libsolv/pull/112] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> + +--- + ext/CMakeLists.txt | 7 ++ + ext/solv_xfopen.c | 10 +-- + ext/solv_xfopen_fallback_fopencookie.c | 123 +++++++++++++++++++++++++++++++++ + ext/solv_xfopen_fallback_fopencookie.h | 28 ++++++++ + 4 files changed, 164 insertions(+), 4 deletions(-) + create mode 100644 ext/solv_xfopen_fallback_fopencookie.c + create mode 100644 ext/solv_xfopen_fallback_fopencookie.h + +diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt +index b8917a2..fac6c32 100644 +--- a/ext/CMakeLists.txt ++++ b/ext/CMakeLists.txt +@@ -4,6 +4,13 @@ SET (libsolvext_SRCS + SET (libsolvext_HEADERS + tools_util.h solv_xfopen.h testcase.h) + ++IF (NOT HAVE_FOPENCOOKIE AND NOT HAVE_FUNOPEN) ++ SET (libsolvext_SRCS ${libsolvext_SRCS} ++ solv_xfopen_fallback_fopencookie.c) ++ SET (libsolvext_HEADERS ${libsolvext_HEADERS} ++ solv_xfopen_fallback_fopencookie.h) ++ENDIF (NOT HAVE_FOPENCOOKIE AND NOT HAVE_FUNOPEN) ++ + IF (ENABLE_RPMDB OR ENABLE_RPMPKG) + SET (libsolvext_SRCS ${libsolvext_SRCS} + pool_fileconflicts.c repo_rpmdb.c) +diff --git a/ext/solv_xfopen.c b/ext/solv_xfopen.c +index 2c64bb6..eb3a3ad 100644 +--- a/ext/solv_xfopen.c ++++ b/ext/solv_xfopen.c +@@ -12,6 +12,10 @@ + #include <string.h> + #include <fcntl.h> + ++#if !defined(HAVE_FUNOPEN) && !defined(HAVE_FOPENCOOKIE) ++#include "solv_xfopen_fallback_fopencookie.h" ++#endif ++ + #include "solv_xfopen.h" + #include "util.h" + +@@ -21,7 +25,7 @@ static FILE *cookieopen(void *cookie, const char *mode, + ssize_t (*cwrite)(void *, const char *, size_t), + int (*cclose)(void *)) + { +-#ifdef HAVE_FUNOPEN ++#if defined(HAVE_FUNOPEN) && !defined(HAVE_FOPENCOOKIE) + if (!cookie) + return 0; + return funopen(cookie, +@@ -30,7 +34,7 @@ static FILE *cookieopen(void *cookie, const char *mode, + (fpos_t (*)(void *, fpos_t, int))NULL, /* seekfn */ + cclose + ); +-#elif defined(HAVE_FOPENCOOKIE) ++#else + cookie_io_functions_t cio; + + if (!cookie) +@@ -42,8 +46,6 @@ static FILE *cookieopen(void *cookie, const char *mode, + cio.write = cwrite; + cio.close = cclose; + return fopencookie(cookie, *mode == 'w' ? "w" : "r", cio); +-#else +-# error Need to implement custom I/O + #endif + } + +diff --git a/ext/solv_xfopen_fallback_fopencookie.c b/ext/solv_xfopen_fallback_fopencookie.c +new file mode 100644 +index 0000000..0ce2571 +--- /dev/null ++++ b/ext/solv_xfopen_fallback_fopencookie.c +@@ -0,0 +1,123 @@ ++/* ++ * Provides a very limited fopencookie() for environments with a libc ++ * that lacks it. ++ * ++ * Author: zhasha ++ * Modified for libsolv by Neal Gompa ++ * ++ * This program is licensed under the BSD license, read LICENSE.BSD ++ * for further information. ++ * ++ */ ++ ++#define _LARGEFILE64_SOURCE 1 ++#include <pthread.h> ++#include <stdio.h> ++#include <stdlib.h> ++#include <unistd.h> ++#include <fcntl.h> ++#include <sys/types.h> ++#include <errno.h> ++#include "solv_xfopen_fallback_fopencookie.h" ++ ++extern int pipe2(int[2], int); ++ ++struct ctx { ++ int fd; ++ void *cookie; ++ struct cookie_io_functions_t io; ++ char buf[1024]; ++}; ++ ++static void *proxy(void *arg) ++{ ++ struct ctx *ctx = arg; ++ ssize_t r; ++ size_t n; ++ ++ pthread_detach(pthread_self()); ++ ++ while (1) { ++ r = ctx->io.read ? ++ (ctx->io.read)(ctx->cookie, ctx->buf, sizeof(ctx->buf)) : ++ read(ctx->fd, ctx->buf, sizeof(ctx->buf)); ++ if (r < 0) { ++ if (errno != EINTR) { break; } ++ continue; ++ } ++ if (r == 0) { break; } ++ ++ while (n > 0) { ++ r = ctx->io.write ? ++ (ctx->io.write)(ctx->cookie, ctx->buf + ((size_t)r - n), n) : ++ write(ctx->fd, ctx->buf + ((size_t)r - n), n); ++ if (r < 0) { ++ if (errno != EINTR) { break; } ++ continue; ++ } ++ if (r == 0) { break; } ++ ++ n -= (size_t)r; ++ } ++ if (n > 0) { break; } ++ } ++ ++ if (ctx->io.close) { (ctx->io.close)(ctx->cookie); } ++ close(ctx->fd); ++ return NULL; ++} ++ ++FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t io) ++{ ++ struct ctx *ctx = NULL; ++ int rd = 0, wr = 0; ++ int p[2] = { -1, -1 }; ++ FILE *f = NULL; ++ pthread_t dummy; ++ ++ switch (mode[0]) { ++ case 'a': ++ case 'r': rd = 1; break; ++ case 'w': wr = 1; break; ++ default: ++ errno = EINVAL; ++ return NULL; ++ } ++ switch (mode[1]) { ++ case '\0': break; ++ case '+': ++ if (mode[2] == '\0') { ++ errno = ENOTSUP; ++ return NULL; ++ } ++ default: ++ errno = EINVAL; ++ return NULL; ++ } ++ if (io.seek) { ++ errno = ENOTSUP; ++ return NULL; ++ } ++ ++ ctx = malloc(sizeof(*ctx)); ++ if (!ctx) { return NULL; } ++ if (pipe2(p, O_CLOEXEC) != 0) { goto err; } ++ if ((f = fdopen(p[wr], mode)) == NULL) { goto err; } ++ p[wr] = -1; ++ ctx->fd = p[rd]; ++ ctx->cookie = cookie; ++ ctx->io.read = rd ? io.read : NULL; ++ ctx->io.write = wr ? io.write : NULL; ++ ctx->io.seek = NULL; ++ ctx->io.close = io.close; ++ if (pthread_create(&dummy, NULL, proxy, ctx) != 0) { goto err; } ++ ++ return f; ++ ++err: ++ if (p[0] >= 0) { close(p[0]); } ++ if (p[1] >= 0) { close(p[1]); } ++ if (f) { fclose(f); } ++ free(ctx); ++ return NULL; ++} +diff --git a/ext/solv_xfopen_fallback_fopencookie.h b/ext/solv_xfopen_fallback_fopencookie.h +new file mode 100644 +index 0000000..6a7bfee +--- /dev/null ++++ b/ext/solv_xfopen_fallback_fopencookie.h +@@ -0,0 +1,28 @@ ++/* ++ * Provides a very limited fopencookie() for environments with a libc ++ * that lacks it. ++ * ++ * Author: zhasha ++ * Modified for libsolv by Neal Gompa ++ * ++ * This program is licensed under the BSD license, read LICENSE.BSD ++ * for further information. ++ * ++ */ ++ ++#ifndef SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H ++#define SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H ++ ++#include <stdio.h> ++#include <stdint.h> ++ ++typedef struct cookie_io_functions_t { ++ ssize_t (*read)(void *, char *, size_t); ++ ssize_t (*write)(void *, const char *, size_t); ++ int (*seek)(void *, off64_t, int); ++ int (*close)(void *); ++} cookie_io_functions_t; ++ ++FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t io); ++ ++#endif +-- +2.4.0 + diff --git a/poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch b/poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch new file mode 100644 index 000000000..93b8cc9c1 --- /dev/null +++ b/poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch @@ -0,0 +1,105 @@ +From 84e12bf7ece49073c559dfd58005132a6099a964 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?= + =?UTF-8?q?=E3=82=B3=E3=82=99=E3=83=B3=E3=83=8F=E3=82=9A=29?= + <ngompa13@gmail.com> +Date: Mon, 23 Nov 2015 18:19:41 -0500 +Subject: [PATCH 2/2] Fixes to internal fopencookie() implementation + +Credits to the fixes go to nsz on #musl on Freenode, +who gloriously fixed the implementation such that +the tests all pass. + +Upstream-Status: Denied [https://github.com/openSUSE/libsolv/pull/112] +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> + +--- + ext/solv_xfopen_fallback_fopencookie.c | 19 ++++++++++--------- + ext/solv_xfopen_fallback_fopencookie.h | 10 +++++----- + 2 files changed, 15 insertions(+), 14 deletions(-) + +diff --git a/ext/solv_xfopen_fallback_fopencookie.c b/ext/solv_xfopen_fallback_fopencookie.c +index 0ce2571..89426a9 100644 +--- a/ext/solv_xfopen_fallback_fopencookie.c ++++ b/ext/solv_xfopen_fallback_fopencookie.c +@@ -1,10 +1,10 @@ +-/* ++/* + * Provides a very limited fopencookie() for environments with a libc + * that lacks it. +- * +- * Author: zhasha ++ * ++ * Authors: zhasha & nsz + * Modified for libsolv by Neal Gompa +- * ++ * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information. + * +@@ -33,7 +33,7 @@ static void *proxy(void *arg) + { + struct ctx *ctx = arg; + ssize_t r; +- size_t n; ++ size_t n, k; + + pthread_detach(pthread_self()); + +@@ -47,17 +47,18 @@ static void *proxy(void *arg) + } + if (r == 0) { break; } + ++ n = r, k = 0; + while (n > 0) { + r = ctx->io.write ? +- (ctx->io.write)(ctx->cookie, ctx->buf + ((size_t)r - n), n) : +- write(ctx->fd, ctx->buf + ((size_t)r - n), n); ++ (ctx->io.write)(ctx->cookie, ctx->buf + k, n) : ++ write(ctx->fd, ctx->buf + k, n); + if (r < 0) { + if (errno != EINTR) { break; } + continue; + } + if (r == 0) { break; } + +- n -= (size_t)r; ++ n -= r, k += r; + } + if (n > 0) { break; } + } +@@ -77,8 +78,8 @@ FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t i + + switch (mode[0]) { + case 'a': +- case 'r': rd = 1; break; + case 'w': wr = 1; break; ++ case 'r': rd = 1; break; + default: + errno = EINVAL; + return NULL; +diff --git a/ext/solv_xfopen_fallback_fopencookie.h b/ext/solv_xfopen_fallback_fopencookie.h +index 6a7bfee..7223e3f 100644 +--- a/ext/solv_xfopen_fallback_fopencookie.h ++++ b/ext/solv_xfopen_fallback_fopencookie.h +@@ -1,13 +1,13 @@ +-/* ++/* + * Provides a very limited fopencookie() for environments with a libc + * that lacks it. +- * +- * Author: zhasha ++ * ++ * Authors: zhasha & nsz + * Modified for libsolv by Neal Gompa +- * ++ * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information. +- * ++ * + */ + + #ifndef SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H +-- +2.4.0 + diff --git a/poky/meta/recipes-extended/libsolv/libsolv_0.6.33.bb b/poky/meta/recipes-extended/libsolv/libsolv_0.6.33.bb new file mode 100644 index 000000000..0401ced24 --- /dev/null +++ b/poky/meta/recipes-extended/libsolv/libsolv_0.6.33.bb @@ -0,0 +1,30 @@ +SUMMARY = "Library for solving packages and reading repositories" +HOMEPAGE = "https://github.com/openSUSE/libsolv" +BUGTRACKER = "https://github.com/openSUSE/libsolv/issues" +SECTION = "devel" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8" + +DEPENDS = "expat zlib rpm" + +SRC_URI = "git://github.com/openSUSE/libsolv.git \ + " +SRC_URI_append_libc-musl = " file://0001-Add-fallback-fopencookie-implementation.patch \ + file://0002-Fixes-to-internal-fopencookie-implementation.patch \ + " + +SRCREV = "69f1803978ba7a46a57928fa4be6430792419e4e" +UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)" + +S = "${WORKDIR}/git" + +inherit cmake + +EXTRA_OECMAKE = "-DLIB=${baselib} -DMULTI_SEMANTICS=ON -DENABLE_RPMMD=ON -DENABLE_RPMDB=ON -DENABLE_COMPLEX_DEPS=ON" + +PACKAGES =+ "${PN}-tools ${PN}ext" + +FILES_${PN}-tools = "${bindir}/*" +FILES_${PN}ext = "${libdir}/${PN}ext.so.*" + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/libtirpc/libtirpc/0001-include-stdint.h-for-uintptr_t.patch b/poky/meta/recipes-extended/libtirpc/libtirpc/0001-include-stdint.h-for-uintptr_t.patch new file mode 100644 index 000000000..7e3e2f86a --- /dev/null +++ b/poky/meta/recipes-extended/libtirpc/libtirpc/0001-include-stdint.h-for-uintptr_t.patch @@ -0,0 +1,29 @@ +Upstream-Status: Backport +Signed-off-by: Ross Burton <ross.burton@intel.com> + +From acb9a37977cf0a9630eac74af9adebf35e38e719 Mon Sep 17 00:00:00 2001 +From: Thorsten Kukuk <kukuk@thkukuk.de> +Date: Tue, 14 Nov 2017 10:39:08 -0500 +Subject: [PATCH] Include stdint.h from xdr_sizeof.c to avoid missing + declaration errors. + +Signed-off-by: Thorsten Kukuk <kukuk@suse.de> +Signed-off-by: Steve Dickson <steved@redhat.com> +--- + src/xdr_sizeof.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/xdr_sizeof.c b/src/xdr_sizeof.c +index d23fbd1..79d6707 100644 +--- a/src/xdr_sizeof.c ++++ b/src/xdr_sizeof.c +@@ -39,6 +39,7 @@ + #include <rpc/xdr.h> + #include <sys/types.h> + #include <stdlib.h> ++#include <stdint.h> + #include "un-namespace.h" + + /* ARGSUSED */ +-- +1.8.3.1 diff --git a/poky/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch b/poky/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch new file mode 100644 index 000000000..7ae19cb31 --- /dev/null +++ b/poky/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch @@ -0,0 +1,64 @@ +Upstream-Status: Backport +Signed-off-by: Ross Burton <ross.burton@intel.com> + +From 5356b63005e9d8169e0399cb76f26fbd29a78dee Mon Sep 17 00:00:00 2001 +From: Joshua Kinard <kumba@gentoo.org> +Date: Wed, 23 Aug 2017 14:31:36 -0400 +Subject: [PATCH] Replace bzero() calls with equivalent memset() calls + +As annotated in the bzero(3) man page, bzero() was marked as LEGACY in +POSIX.1-2001 and removed in POSIX.1-2008, and should be replaced with +memset() calls to write zeros to a memory region. The attached patch +replaces two bzero() calls and one __bzero() call in libtirpc with +equivalent memset() calls. The latter replacement fixes a compile error +under uclibc-ng, which lacks a definition for __bzero() + +Signed-off-by: Joshua Kinard <kumba@gentoo.org> +Signed-off-by: Steve Dickson <steved@redhat.com> +--- + src/auth_time.c | 2 +- + src/des_impl.c | 2 +- + src/svc_auth_des.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/auth_time.c b/src/auth_time.c +index 7f83ab4..69400bc 100644 +--- a/src/auth_time.c ++++ b/src/auth_time.c +@@ -317,7 +317,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid) + sprintf(ipuaddr, "%d.%d.%d.%d.0.111", a1, a2, a3, a4); + useua = &ipuaddr[0]; + +- bzero((char *)&sin, sizeof(sin)); ++ memset(&sin, 0, sizeof(sin)); + if (uaddr_to_sockaddr(useua, &sin)) { + msg("unable to translate uaddr to sockaddr."); + if (needfree) +diff --git a/src/des_impl.c b/src/des_impl.c +index 9dbccaf..15bec2a 100644 +--- a/src/des_impl.c ++++ b/src/des_impl.c +@@ -588,7 +588,7 @@ _des_crypt (char *buf, unsigned len, struct desparams *desp) + } + tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0; + tbuf[0] = tbuf[1] = 0; +- __bzero (schedule, sizeof (schedule)); ++ memset (schedule, 0, sizeof (schedule)); + + return (1); + } +diff --git a/src/svc_auth_des.c b/src/svc_auth_des.c +index 2e90146..19a7c60 100644 +--- a/src/svc_auth_des.c ++++ b/src/svc_auth_des.c +@@ -356,7 +356,7 @@ cache_init() + + authdes_cache = (struct cache_entry *) + mem_alloc(sizeof(struct cache_entry) * AUTHDES_CACHESZ); +- bzero((char *)authdes_cache, ++ memset(authdes_cache, 0, + sizeof(struct cache_entry) * AUTHDES_CACHESZ); + + authdes_lru = (short *)mem_alloc(sizeof(short) * AUTHDES_CACHESZ); +-- +1.8.3.1 diff --git a/poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch b/poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch new file mode 100644 index 000000000..f93223feb --- /dev/null +++ b/poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch @@ -0,0 +1,878 @@ +musl does not provide sys/queue.h implementation. Borrow queue.h from +the NetBSD project +http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/queue.h?rev=1.68 + +Upstream-Status: Inappropriate [musl specific] + +Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks> +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- +diff -Naur libtirpc-1.0.1-orig/src/clnt_bcast.c libtirpc-1.0.1/src/clnt_bcast.c +--- libtirpc-1.0.1-orig/src/clnt_bcast.c 2015-10-30 17:15:14.000000000 +0200 ++++ libtirpc-1.0.1/src/clnt_bcast.c 2015-12-21 17:03:52.066008311 +0200 +@@ -40,7 +40,6 @@ + */ + #include <sys/socket.h> + #include <sys/types.h> +-#include <sys/queue.h> + + #include <net/if.h> + #include <netinet/in.h> +@@ -62,6 +61,7 @@ + #include <err.h> + #include <string.h> + ++#include "queue.h" + #include "rpc_com.h" + #include "debug.h" + +diff -Naur libtirpc-1.0.1-orig/tirpc/queue.h libtirpc-1.0.1/tirpc/queue.h +--- libtirpc-1.0.1-orig/tirpc/queue.h 1970-01-01 02:00:00.000000000 +0200 ++++ libtirpc-1.0.1/tirpc/queue.h 2015-12-21 17:02:44.427853905 +0200 +@@ -0,0 +1,846 @@ ++/* $NetBSD: queue.h,v 1.68 2014/11/19 08:10:01 uebayasi Exp $ */ ++ ++/* ++ * Copyright (c) 1991, 1993 ++ * The Regents of the University of California. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. Neither the name of the University nor the names of its contributors ++ * may be used to endorse or promote products derived from this software ++ * without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ * ++ * @(#)queue.h 8.5 (Berkeley) 8/20/94 ++ */ ++ ++#ifndef _SYS_QUEUE_H_ ++#define _SYS_QUEUE_H_ ++ ++/* ++ * This file defines five types of data structures: singly-linked lists, ++ * lists, simple queues, tail queues, and circular queues. ++ * ++ * A singly-linked list is headed by a single forward pointer. The ++ * elements are singly linked for minimum space and pointer manipulation ++ * overhead at the expense of O(n) removal for arbitrary elements. New ++ * elements can be added to the list after an existing element or at the ++ * head of the list. Elements being removed from the head of the list ++ * should use the explicit macro for this purpose for optimum ++ * efficiency. A singly-linked list may only be traversed in the forward ++ * direction. Singly-linked lists are ideal for applications with large ++ * datasets and few or no removals or for implementing a LIFO queue. ++ * ++ * A list is headed by a single forward pointer (or an array of forward ++ * pointers for a hash table header). The elements are doubly linked ++ * so that an arbitrary element can be removed without a need to ++ * traverse the list. New elements can be added to the list before ++ * or after an existing element or at the head of the list. A list ++ * may only be traversed in the forward direction. ++ * ++ * A simple queue is headed by a pair of pointers, one the head of the ++ * list and the other to the tail of the list. The elements are singly ++ * linked to save space, so elements can only be removed from the ++ * head of the list. New elements can be added to the list after ++ * an existing element, at the head of the list, or at the end of the ++ * list. A simple queue may only be traversed in the forward direction. ++ * ++ * A tail queue is headed by a pair of pointers, one to the head of the ++ * list and the other to the tail of the list. The elements are doubly ++ * linked so that an arbitrary element can be removed without a need to ++ * traverse the list. New elements can be added to the list before or ++ * after an existing element, at the head of the list, or at the end of ++ * the list. A tail queue may be traversed in either direction. ++ * ++ * A circle queue is headed by a pair of pointers, one to the head of the ++ * list and the other to the tail of the list. The elements are doubly ++ * linked so that an arbitrary element can be removed without a need to ++ * traverse the list. New elements can be added to the list before or after ++ * an existing element, at the head of the list, or at the end of the list. ++ * A circle queue may be traversed in either direction, but has a more ++ * complex end of list detection. ++ * ++ * For details on the use of these macros, see the queue(3) manual page. ++ */ ++ ++/* ++ * Include the definition of NULL only on NetBSD because sys/null.h ++ * is not available elsewhere. This conditional makes the header ++ * portable and it can simply be dropped verbatim into any system. ++ * The caveat is that on other systems some other header ++ * must provide NULL before the macros can be used. ++ */ ++#ifdef __NetBSD__ ++#include <sys/null.h> ++#endif ++ ++#if defined(QUEUEDEBUG) ++# if defined(_KERNEL) ++# define QUEUEDEBUG_ABORT(...) panic(__VA_ARGS__) ++# else ++# include <err.h> ++# define QUEUEDEBUG_ABORT(...) err(1, __VA_ARGS__) ++# endif ++#endif ++ ++/* ++ * Singly-linked List definitions. ++ */ ++#define SLIST_HEAD(name, type) \ ++struct name { \ ++ struct type *slh_first; /* first element */ \ ++} ++ ++#define SLIST_HEAD_INITIALIZER(head) \ ++ { NULL } ++ ++#define SLIST_ENTRY(type) \ ++struct { \ ++ struct type *sle_next; /* next element */ \ ++} ++ ++/* ++ * Singly-linked List access methods. ++ */ ++#define SLIST_FIRST(head) ((head)->slh_first) ++#define SLIST_END(head) NULL ++#define SLIST_EMPTY(head) ((head)->slh_first == NULL) ++#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) ++ ++#define SLIST_FOREACH(var, head, field) \ ++ for((var) = (head)->slh_first; \ ++ (var) != SLIST_END(head); \ ++ (var) = (var)->field.sle_next) ++ ++#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ ++ for ((var) = SLIST_FIRST((head)); \ ++ (var) != SLIST_END(head) && \ ++ ((tvar) = SLIST_NEXT((var), field), 1); \ ++ (var) = (tvar)) ++ ++/* ++ * Singly-linked List functions. ++ */ ++#define SLIST_INIT(head) do { \ ++ (head)->slh_first = SLIST_END(head); \ ++} while (/*CONSTCOND*/0) ++ ++#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ ++ (elm)->field.sle_next = (slistelm)->field.sle_next; \ ++ (slistelm)->field.sle_next = (elm); \ ++} while (/*CONSTCOND*/0) ++ ++#define SLIST_INSERT_HEAD(head, elm, field) do { \ ++ (elm)->field.sle_next = (head)->slh_first; \ ++ (head)->slh_first = (elm); \ ++} while (/*CONSTCOND*/0) ++ ++#define SLIST_REMOVE_AFTER(slistelm, field) do { \ ++ (slistelm)->field.sle_next = \ ++ SLIST_NEXT(SLIST_NEXT((slistelm), field), field); \ ++} while (/*CONSTCOND*/0) ++ ++#define SLIST_REMOVE_HEAD(head, field) do { \ ++ (head)->slh_first = (head)->slh_first->field.sle_next; \ ++} while (/*CONSTCOND*/0) ++ ++#define SLIST_REMOVE(head, elm, type, field) do { \ ++ if ((head)->slh_first == (elm)) { \ ++ SLIST_REMOVE_HEAD((head), field); \ ++ } \ ++ else { \ ++ struct type *curelm = (head)->slh_first; \ ++ while(curelm->field.sle_next != (elm)) \ ++ curelm = curelm->field.sle_next; \ ++ curelm->field.sle_next = \ ++ curelm->field.sle_next->field.sle_next; \ ++ } \ ++} while (/*CONSTCOND*/0) ++ ++ ++/* ++ * List definitions. ++ */ ++#define LIST_HEAD(name, type) \ ++struct name { \ ++ struct type *lh_first; /* first element */ \ ++} ++ ++#define LIST_HEAD_INITIALIZER(head) \ ++ { NULL } ++ ++#define LIST_ENTRY(type) \ ++struct { \ ++ struct type *le_next; /* next element */ \ ++ struct type **le_prev; /* address of previous next element */ \ ++} ++ ++/* ++ * List access methods. ++ */ ++#define LIST_FIRST(head) ((head)->lh_first) ++#define LIST_END(head) NULL ++#define LIST_EMPTY(head) ((head)->lh_first == LIST_END(head)) ++#define LIST_NEXT(elm, field) ((elm)->field.le_next) ++ ++#define LIST_FOREACH(var, head, field) \ ++ for ((var) = ((head)->lh_first); \ ++ (var) != LIST_END(head); \ ++ (var) = ((var)->field.le_next)) ++ ++#define LIST_FOREACH_SAFE(var, head, field, tvar) \ ++ for ((var) = LIST_FIRST((head)); \ ++ (var) != LIST_END(head) && \ ++ ((tvar) = LIST_NEXT((var), field), 1); \ ++ (var) = (tvar)) ++ ++#define LIST_MOVE(head1, head2) do { \ ++ LIST_INIT((head2)); \ ++ if (!LIST_EMPTY((head1))) { \ ++ (head2)->lh_first = (head1)->lh_first; \ ++ LIST_INIT((head1)); \ ++ } \ ++} while (/*CONSTCOND*/0) ++ ++/* ++ * List functions. ++ */ ++#if defined(QUEUEDEBUG) ++#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field) \ ++ if ((head)->lh_first && \ ++ (head)->lh_first->field.le_prev != &(head)->lh_first) \ ++ QUEUEDEBUG_ABORT("LIST_INSERT_HEAD %p %s:%d", (head), \ ++ __FILE__, __LINE__); ++#define QUEUEDEBUG_LIST_OP(elm, field) \ ++ if ((elm)->field.le_next && \ ++ (elm)->field.le_next->field.le_prev != \ ++ &(elm)->field.le_next) \ ++ QUEUEDEBUG_ABORT("LIST_* forw %p %s:%d", (elm), \ ++ __FILE__, __LINE__); \ ++ if (*(elm)->field.le_prev != (elm)) \ ++ QUEUEDEBUG_ABORT("LIST_* back %p %s:%d", (elm), \ ++ __FILE__, __LINE__); ++#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field) \ ++ (elm)->field.le_next = (void *)1L; \ ++ (elm)->field.le_prev = (void *)1L; ++#else ++#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field) ++#define QUEUEDEBUG_LIST_OP(elm, field) ++#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field) ++#endif ++ ++#define LIST_INIT(head) do { \ ++ (head)->lh_first = LIST_END(head); \ ++} while (/*CONSTCOND*/0) ++ ++#define LIST_INSERT_AFTER(listelm, elm, field) do { \ ++ QUEUEDEBUG_LIST_OP((listelm), field) \ ++ if (((elm)->field.le_next = (listelm)->field.le_next) != \ ++ LIST_END(head)) \ ++ (listelm)->field.le_next->field.le_prev = \ ++ &(elm)->field.le_next; \ ++ (listelm)->field.le_next = (elm); \ ++ (elm)->field.le_prev = &(listelm)->field.le_next; \ ++} while (/*CONSTCOND*/0) ++ ++#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ ++ QUEUEDEBUG_LIST_OP((listelm), field) \ ++ (elm)->field.le_prev = (listelm)->field.le_prev; \ ++ (elm)->field.le_next = (listelm); \ ++ *(listelm)->field.le_prev = (elm); \ ++ (listelm)->field.le_prev = &(elm)->field.le_next; \ ++} while (/*CONSTCOND*/0) ++ ++#define LIST_INSERT_HEAD(head, elm, field) do { \ ++ QUEUEDEBUG_LIST_INSERT_HEAD((head), (elm), field) \ ++ if (((elm)->field.le_next = (head)->lh_first) != LIST_END(head))\ ++ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ ++ (head)->lh_first = (elm); \ ++ (elm)->field.le_prev = &(head)->lh_first; \ ++} while (/*CONSTCOND*/0) ++ ++#define LIST_REMOVE(elm, field) do { \ ++ QUEUEDEBUG_LIST_OP((elm), field) \ ++ if ((elm)->field.le_next != NULL) \ ++ (elm)->field.le_next->field.le_prev = \ ++ (elm)->field.le_prev; \ ++ *(elm)->field.le_prev = (elm)->field.le_next; \ ++ QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \ ++} while (/*CONSTCOND*/0) ++ ++#define LIST_REPLACE(elm, elm2, field) do { \ ++ if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \ ++ (elm2)->field.le_next->field.le_prev = \ ++ &(elm2)->field.le_next; \ ++ (elm2)->field.le_prev = (elm)->field.le_prev; \ ++ *(elm2)->field.le_prev = (elm2); \ ++ QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \ ++} while (/*CONSTCOND*/0) ++ ++/* ++ * Simple queue definitions. ++ */ ++#define SIMPLEQ_HEAD(name, type) \ ++struct name { \ ++ struct type *sqh_first; /* first element */ \ ++ struct type **sqh_last; /* addr of last next element */ \ ++} ++ ++#define SIMPLEQ_HEAD_INITIALIZER(head) \ ++ { NULL, &(head).sqh_first } ++ ++#define SIMPLEQ_ENTRY(type) \ ++struct { \ ++ struct type *sqe_next; /* next element */ \ ++} ++ ++/* ++ * Simple queue access methods. ++ */ ++#define SIMPLEQ_FIRST(head) ((head)->sqh_first) ++#define SIMPLEQ_END(head) NULL ++#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == SIMPLEQ_END(head)) ++#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) ++ ++#define SIMPLEQ_FOREACH(var, head, field) \ ++ for ((var) = ((head)->sqh_first); \ ++ (var) != SIMPLEQ_END(head); \ ++ (var) = ((var)->field.sqe_next)) ++ ++#define SIMPLEQ_FOREACH_SAFE(var, head, field, next) \ ++ for ((var) = ((head)->sqh_first); \ ++ (var) != SIMPLEQ_END(head) && \ ++ ((next = ((var)->field.sqe_next)), 1); \ ++ (var) = (next)) ++ ++/* ++ * Simple queue functions. ++ */ ++#define SIMPLEQ_INIT(head) do { \ ++ (head)->sqh_first = NULL; \ ++ (head)->sqh_last = &(head)->sqh_first; \ ++} while (/*CONSTCOND*/0) ++ ++#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ ++ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ ++ (head)->sqh_last = &(elm)->field.sqe_next; \ ++ (head)->sqh_first = (elm); \ ++} while (/*CONSTCOND*/0) ++ ++#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ ++ (elm)->field.sqe_next = NULL; \ ++ *(head)->sqh_last = (elm); \ ++ (head)->sqh_last = &(elm)->field.sqe_next; \ ++} while (/*CONSTCOND*/0) ++ ++#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ ++ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ ++ (head)->sqh_last = &(elm)->field.sqe_next; \ ++ (listelm)->field.sqe_next = (elm); \ ++} while (/*CONSTCOND*/0) ++ ++#define SIMPLEQ_REMOVE_HEAD(head, field) do { \ ++ if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ ++ (head)->sqh_last = &(head)->sqh_first; \ ++} while (/*CONSTCOND*/0) ++ ++#define SIMPLEQ_REMOVE_AFTER(head, elm, field) do { \ ++ if (((elm)->field.sqe_next = (elm)->field.sqe_next->field.sqe_next) \ ++ == NULL) \ ++ (head)->sqh_last = &(elm)->field.sqe_next; \ ++} while (/*CONSTCOND*/0) ++ ++#define SIMPLEQ_REMOVE(head, elm, type, field) do { \ ++ if ((head)->sqh_first == (elm)) { \ ++ SIMPLEQ_REMOVE_HEAD((head), field); \ ++ } else { \ ++ struct type *curelm = (head)->sqh_first; \ ++ while (curelm->field.sqe_next != (elm)) \ ++ curelm = curelm->field.sqe_next; \ ++ if ((curelm->field.sqe_next = \ ++ curelm->field.sqe_next->field.sqe_next) == NULL) \ ++ (head)->sqh_last = &(curelm)->field.sqe_next; \ ++ } \ ++} while (/*CONSTCOND*/0) ++ ++#define SIMPLEQ_CONCAT(head1, head2) do { \ ++ if (!SIMPLEQ_EMPTY((head2))) { \ ++ *(head1)->sqh_last = (head2)->sqh_first; \ ++ (head1)->sqh_last = (head2)->sqh_last; \ ++ SIMPLEQ_INIT((head2)); \ ++ } \ ++} while (/*CONSTCOND*/0) ++ ++#define SIMPLEQ_LAST(head, type, field) \ ++ (SIMPLEQ_EMPTY((head)) ? \ ++ NULL : \ ++ ((struct type *)(void *) \ ++ ((char *)((head)->sqh_last) - offsetof(struct type, field)))) ++ ++/* ++ * Tail queue definitions. ++ */ ++#define _TAILQ_HEAD(name, type, qual) \ ++struct name { \ ++ qual type *tqh_first; /* first element */ \ ++ qual type *qual *tqh_last; /* addr of last next element */ \ ++} ++#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) ++ ++#define TAILQ_HEAD_INITIALIZER(head) \ ++ { TAILQ_END(head), &(head).tqh_first } ++ ++#define _TAILQ_ENTRY(type, qual) \ ++struct { \ ++ qual type *tqe_next; /* next element */ \ ++ qual type *qual *tqe_prev; /* address of previous next element */\ ++} ++#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) ++ ++/* ++ * Tail queue access methods. ++ */ ++#define TAILQ_FIRST(head) ((head)->tqh_first) ++#define TAILQ_END(head) (NULL) ++#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) ++#define TAILQ_LAST(head, headname) \ ++ (*(((struct headname *)((head)->tqh_last))->tqh_last)) ++#define TAILQ_PREV(elm, headname, field) \ ++ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) ++#define TAILQ_EMPTY(head) (TAILQ_FIRST(head) == TAILQ_END(head)) ++ ++ ++#define TAILQ_FOREACH(var, head, field) \ ++ for ((var) = ((head)->tqh_first); \ ++ (var) != TAILQ_END(head); \ ++ (var) = ((var)->field.tqe_next)) ++ ++#define TAILQ_FOREACH_SAFE(var, head, field, next) \ ++ for ((var) = ((head)->tqh_first); \ ++ (var) != TAILQ_END(head) && \ ++ ((next) = TAILQ_NEXT(var, field), 1); (var) = (next)) ++ ++#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ ++ for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));\ ++ (var) != TAILQ_END(head); \ ++ (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) ++ ++#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, prev) \ ++ for ((var) = TAILQ_LAST((head), headname); \ ++ (var) != TAILQ_END(head) && \ ++ ((prev) = TAILQ_PREV((var), headname, field), 1); (var) = (prev)) ++ ++/* ++ * Tail queue functions. ++ */ ++#if defined(QUEUEDEBUG) ++#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field) \ ++ if ((head)->tqh_first && \ ++ (head)->tqh_first->field.tqe_prev != &(head)->tqh_first) \ ++ QUEUEDEBUG_ABORT("TAILQ_INSERT_HEAD %p %s:%d", (head), \ ++ __FILE__, __LINE__); ++#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field) \ ++ if (*(head)->tqh_last != NULL) \ ++ QUEUEDEBUG_ABORT("TAILQ_INSERT_TAIL %p %s:%d", (head), \ ++ __FILE__, __LINE__); ++#define QUEUEDEBUG_TAILQ_OP(elm, field) \ ++ if ((elm)->field.tqe_next && \ ++ (elm)->field.tqe_next->field.tqe_prev != \ ++ &(elm)->field.tqe_next) \ ++ QUEUEDEBUG_ABORT("TAILQ_* forw %p %s:%d", (elm), \ ++ __FILE__, __LINE__); \ ++ if (*(elm)->field.tqe_prev != (elm)) \ ++ QUEUEDEBUG_ABORT("TAILQ_* back %p %s:%d", (elm), \ ++ __FILE__, __LINE__); ++#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field) \ ++ if ((elm)->field.tqe_next == NULL && \ ++ (head)->tqh_last != &(elm)->field.tqe_next) \ ++ QUEUEDEBUG_ABORT("TAILQ_PREREMOVE head %p elm %p %s:%d",\ ++ (head), (elm), __FILE__, __LINE__); ++#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) \ ++ (elm)->field.tqe_next = (void *)1L; \ ++ (elm)->field.tqe_prev = (void *)1L; ++#else ++#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field) ++#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field) ++#define QUEUEDEBUG_TAILQ_OP(elm, field) ++#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field) ++#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) ++#endif ++ ++#define TAILQ_INIT(head) do { \ ++ (head)->tqh_first = TAILQ_END(head); \ ++ (head)->tqh_last = &(head)->tqh_first; \ ++} while (/*CONSTCOND*/0) ++ ++#define TAILQ_INSERT_HEAD(head, elm, field) do { \ ++ QUEUEDEBUG_TAILQ_INSERT_HEAD((head), (elm), field) \ ++ if (((elm)->field.tqe_next = (head)->tqh_first) != TAILQ_END(head))\ ++ (head)->tqh_first->field.tqe_prev = \ ++ &(elm)->field.tqe_next; \ ++ else \ ++ (head)->tqh_last = &(elm)->field.tqe_next; \ ++ (head)->tqh_first = (elm); \ ++ (elm)->field.tqe_prev = &(head)->tqh_first; \ ++} while (/*CONSTCOND*/0) ++ ++#define TAILQ_INSERT_TAIL(head, elm, field) do { \ ++ QUEUEDEBUG_TAILQ_INSERT_TAIL((head), (elm), field) \ ++ (elm)->field.tqe_next = TAILQ_END(head); \ ++ (elm)->field.tqe_prev = (head)->tqh_last; \ ++ *(head)->tqh_last = (elm); \ ++ (head)->tqh_last = &(elm)->field.tqe_next; \ ++} while (/*CONSTCOND*/0) ++ ++#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ ++ QUEUEDEBUG_TAILQ_OP((listelm), field) \ ++ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != \ ++ TAILQ_END(head)) \ ++ (elm)->field.tqe_next->field.tqe_prev = \ ++ &(elm)->field.tqe_next; \ ++ else \ ++ (head)->tqh_last = &(elm)->field.tqe_next; \ ++ (listelm)->field.tqe_next = (elm); \ ++ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ ++} while (/*CONSTCOND*/0) ++ ++#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ ++ QUEUEDEBUG_TAILQ_OP((listelm), field) \ ++ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ ++ (elm)->field.tqe_next = (listelm); \ ++ *(listelm)->field.tqe_prev = (elm); \ ++ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ ++} while (/*CONSTCOND*/0) ++ ++#define TAILQ_REMOVE(head, elm, field) do { \ ++ QUEUEDEBUG_TAILQ_PREREMOVE((head), (elm), field) \ ++ QUEUEDEBUG_TAILQ_OP((elm), field) \ ++ if (((elm)->field.tqe_next) != TAILQ_END(head)) \ ++ (elm)->field.tqe_next->field.tqe_prev = \ ++ (elm)->field.tqe_prev; \ ++ else \ ++ (head)->tqh_last = (elm)->field.tqe_prev; \ ++ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ ++ QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \ ++} while (/*CONSTCOND*/0) ++ ++#define TAILQ_REPLACE(head, elm, elm2, field) do { \ ++ if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != \ ++ TAILQ_END(head)) \ ++ (elm2)->field.tqe_next->field.tqe_prev = \ ++ &(elm2)->field.tqe_next; \ ++ else \ ++ (head)->tqh_last = &(elm2)->field.tqe_next; \ ++ (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \ ++ *(elm2)->field.tqe_prev = (elm2); \ ++ QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \ ++} while (/*CONSTCOND*/0) ++ ++#define TAILQ_CONCAT(head1, head2, field) do { \ ++ if (!TAILQ_EMPTY(head2)) { \ ++ *(head1)->tqh_last = (head2)->tqh_first; \ ++ (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ ++ (head1)->tqh_last = (head2)->tqh_last; \ ++ TAILQ_INIT((head2)); \ ++ } \ ++} while (/*CONSTCOND*/0) ++ ++/* ++ * Singly-linked Tail queue declarations. ++ */ ++#define STAILQ_HEAD(name, type) \ ++struct name { \ ++ struct type *stqh_first; /* first element */ \ ++ struct type **stqh_last; /* addr of last next element */ \ ++} ++ ++#define STAILQ_HEAD_INITIALIZER(head) \ ++ { NULL, &(head).stqh_first } ++ ++#define STAILQ_ENTRY(type) \ ++struct { \ ++ struct type *stqe_next; /* next element */ \ ++} ++ ++/* ++ * Singly-linked Tail queue access methods. ++ */ ++#define STAILQ_FIRST(head) ((head)->stqh_first) ++#define STAILQ_END(head) NULL ++#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) ++#define STAILQ_EMPTY(head) (STAILQ_FIRST(head) == STAILQ_END(head)) ++ ++/* ++ * Singly-linked Tail queue functions. ++ */ ++#define STAILQ_INIT(head) do { \ ++ (head)->stqh_first = NULL; \ ++ (head)->stqh_last = &(head)->stqh_first; \ ++} while (/*CONSTCOND*/0) ++ ++#define STAILQ_INSERT_HEAD(head, elm, field) do { \ ++ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ ++ (head)->stqh_last = &(elm)->field.stqe_next; \ ++ (head)->stqh_first = (elm); \ ++} while (/*CONSTCOND*/0) ++ ++#define STAILQ_INSERT_TAIL(head, elm, field) do { \ ++ (elm)->field.stqe_next = NULL; \ ++ *(head)->stqh_last = (elm); \ ++ (head)->stqh_last = &(elm)->field.stqe_next; \ ++} while (/*CONSTCOND*/0) ++ ++#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ ++ if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ ++ (head)->stqh_last = &(elm)->field.stqe_next; \ ++ (listelm)->field.stqe_next = (elm); \ ++} while (/*CONSTCOND*/0) ++ ++#define STAILQ_REMOVE_HEAD(head, field) do { \ ++ if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ ++ (head)->stqh_last = &(head)->stqh_first; \ ++} while (/*CONSTCOND*/0) ++ ++#define STAILQ_REMOVE(head, elm, type, field) do { \ ++ if ((head)->stqh_first == (elm)) { \ ++ STAILQ_REMOVE_HEAD((head), field); \ ++ } else { \ ++ struct type *curelm = (head)->stqh_first; \ ++ while (curelm->field.stqe_next != (elm)) \ ++ curelm = curelm->field.stqe_next; \ ++ if ((curelm->field.stqe_next = \ ++ curelm->field.stqe_next->field.stqe_next) == NULL) \ ++ (head)->stqh_last = &(curelm)->field.stqe_next; \ ++ } \ ++} while (/*CONSTCOND*/0) ++ ++#define STAILQ_FOREACH(var, head, field) \ ++ for ((var) = ((head)->stqh_first); \ ++ (var); \ ++ (var) = ((var)->field.stqe_next)) ++ ++#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ ++ for ((var) = STAILQ_FIRST((head)); \ ++ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ ++ (var) = (tvar)) ++ ++#define STAILQ_CONCAT(head1, head2) do { \ ++ if (!STAILQ_EMPTY((head2))) { \ ++ *(head1)->stqh_last = (head2)->stqh_first; \ ++ (head1)->stqh_last = (head2)->stqh_last; \ ++ STAILQ_INIT((head2)); \ ++ } \ ++} while (/*CONSTCOND*/0) ++ ++#define STAILQ_LAST(head, type, field) \ ++ (STAILQ_EMPTY((head)) ? \ ++ NULL : \ ++ ((struct type *)(void *) \ ++ ((char *)((head)->stqh_last) - offsetof(struct type, field)))) ++ ++ ++#ifndef _KERNEL ++/* ++ * Circular queue definitions. Do not use. We still keep the macros ++ * for compatibility but because of pointer aliasing issues their use ++ * is discouraged! ++ */ ++ ++/* ++ * __launder_type(): We use this ugly hack to work around the the compiler ++ * noticing that two types may not alias each other and elide tests in code. ++ * We hit this in the CIRCLEQ macros when comparing 'struct name *' and ++ * 'struct type *' (see CIRCLEQ_HEAD()). Modern compilers (such as GCC ++ * 4.8) declare these comparisons as always false, causing the code to ++ * not run as designed. ++ * ++ * This hack is only to be used for comparisons and thus can be fully const. ++ * Do not use for assignment. ++ * ++ * If we ever choose to change the ABI of the CIRCLEQ macros, we could fix ++ * this by changing the head/tail sentinal values, but see the note above ++ * this one. ++ */ ++static __inline const void * __launder_type(const void *); ++static __inline const void * ++__launder_type(const void *__x) ++{ ++ __asm __volatile("" : "+r" (__x)); ++ return __x; ++} ++ ++#if defined(QUEUEDEBUG) ++#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field) \ ++ if ((head)->cqh_first != CIRCLEQ_ENDC(head) && \ ++ (head)->cqh_first->field.cqe_prev != CIRCLEQ_ENDC(head)) \ ++ QUEUEDEBUG_ABORT("CIRCLEQ head forw %p %s:%d", (head), \ ++ __FILE__, __LINE__); \ ++ if ((head)->cqh_last != CIRCLEQ_ENDC(head) && \ ++ (head)->cqh_last->field.cqe_next != CIRCLEQ_ENDC(head)) \ ++ QUEUEDEBUG_ABORT("CIRCLEQ head back %p %s:%d", (head), \ ++ __FILE__, __LINE__); ++#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field) \ ++ if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) { \ ++ if ((head)->cqh_last != (elm)) \ ++ QUEUEDEBUG_ABORT("CIRCLEQ elm last %p %s:%d", \ ++ (elm), __FILE__, __LINE__); \ ++ } else { \ ++ if ((elm)->field.cqe_next->field.cqe_prev != (elm)) \ ++ QUEUEDEBUG_ABORT("CIRCLEQ elm forw %p %s:%d", \ ++ (elm), __FILE__, __LINE__); \ ++ } \ ++ if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) { \ ++ if ((head)->cqh_first != (elm)) \ ++ QUEUEDEBUG_ABORT("CIRCLEQ elm first %p %s:%d", \ ++ (elm), __FILE__, __LINE__); \ ++ } else { \ ++ if ((elm)->field.cqe_prev->field.cqe_next != (elm)) \ ++ QUEUEDEBUG_ABORT("CIRCLEQ elm prev %p %s:%d", \ ++ (elm), __FILE__, __LINE__); \ ++ } ++#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field) \ ++ (elm)->field.cqe_next = (void *)1L; \ ++ (elm)->field.cqe_prev = (void *)1L; ++#else ++#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field) ++#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field) ++#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field) ++#endif ++ ++#define CIRCLEQ_HEAD(name, type) \ ++struct name { \ ++ struct type *cqh_first; /* first element */ \ ++ struct type *cqh_last; /* last element */ \ ++} ++ ++#define CIRCLEQ_HEAD_INITIALIZER(head) \ ++ { CIRCLEQ_END(&head), CIRCLEQ_END(&head) } ++ ++#define CIRCLEQ_ENTRY(type) \ ++struct { \ ++ struct type *cqe_next; /* next element */ \ ++ struct type *cqe_prev; /* previous element */ \ ++} ++ ++/* ++ * Circular queue functions. ++ */ ++#define CIRCLEQ_INIT(head) do { \ ++ (head)->cqh_first = CIRCLEQ_END(head); \ ++ (head)->cqh_last = CIRCLEQ_END(head); \ ++} while (/*CONSTCOND*/0) ++ ++#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ ++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \ ++ QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \ ++ (elm)->field.cqe_next = (listelm)->field.cqe_next; \ ++ (elm)->field.cqe_prev = (listelm); \ ++ if ((listelm)->field.cqe_next == CIRCLEQ_ENDC(head)) \ ++ (head)->cqh_last = (elm); \ ++ else \ ++ (listelm)->field.cqe_next->field.cqe_prev = (elm); \ ++ (listelm)->field.cqe_next = (elm); \ ++} while (/*CONSTCOND*/0) ++ ++#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ ++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \ ++ QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \ ++ (elm)->field.cqe_next = (listelm); \ ++ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ ++ if ((listelm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \ ++ (head)->cqh_first = (elm); \ ++ else \ ++ (listelm)->field.cqe_prev->field.cqe_next = (elm); \ ++ (listelm)->field.cqe_prev = (elm); \ ++} while (/*CONSTCOND*/0) ++ ++#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ ++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \ ++ (elm)->field.cqe_next = (head)->cqh_first; \ ++ (elm)->field.cqe_prev = CIRCLEQ_END(head); \ ++ if ((head)->cqh_last == CIRCLEQ_ENDC(head)) \ ++ (head)->cqh_last = (elm); \ ++ else \ ++ (head)->cqh_first->field.cqe_prev = (elm); \ ++ (head)->cqh_first = (elm); \ ++} while (/*CONSTCOND*/0) ++ ++#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ ++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \ ++ (elm)->field.cqe_next = CIRCLEQ_END(head); \ ++ (elm)->field.cqe_prev = (head)->cqh_last; \ ++ if ((head)->cqh_first == CIRCLEQ_ENDC(head)) \ ++ (head)->cqh_first = (elm); \ ++ else \ ++ (head)->cqh_last->field.cqe_next = (elm); \ ++ (head)->cqh_last = (elm); \ ++} while (/*CONSTCOND*/0) ++ ++#define CIRCLEQ_REMOVE(head, elm, field) do { \ ++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \ ++ QUEUEDEBUG_CIRCLEQ_ELM((head), (elm), field) \ ++ if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \ ++ (head)->cqh_last = (elm)->field.cqe_prev; \ ++ else \ ++ (elm)->field.cqe_next->field.cqe_prev = \ ++ (elm)->field.cqe_prev; \ ++ if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \ ++ (head)->cqh_first = (elm)->field.cqe_next; \ ++ else \ ++ (elm)->field.cqe_prev->field.cqe_next = \ ++ (elm)->field.cqe_next; \ ++ QUEUEDEBUG_CIRCLEQ_POSTREMOVE((elm), field) \ ++} while (/*CONSTCOND*/0) ++ ++#define CIRCLEQ_FOREACH(var, head, field) \ ++ for ((var) = ((head)->cqh_first); \ ++ (var) != CIRCLEQ_ENDC(head); \ ++ (var) = ((var)->field.cqe_next)) ++ ++#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ ++ for ((var) = ((head)->cqh_last); \ ++ (var) != CIRCLEQ_ENDC(head); \ ++ (var) = ((var)->field.cqe_prev)) ++ ++/* ++ * Circular queue access methods. ++ */ ++#define CIRCLEQ_FIRST(head) ((head)->cqh_first) ++#define CIRCLEQ_LAST(head) ((head)->cqh_last) ++/* For comparisons */ ++#define CIRCLEQ_ENDC(head) (__launder_type(head)) ++/* For assignments */ ++#define CIRCLEQ_END(head) ((void *)(head)) ++#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) ++#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) ++#define CIRCLEQ_EMPTY(head) \ ++ (CIRCLEQ_FIRST(head) == CIRCLEQ_ENDC(head)) ++ ++#define CIRCLEQ_LOOP_NEXT(head, elm, field) \ ++ (((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \ ++ ? ((head)->cqh_first) \ ++ : (elm->field.cqe_next)) ++#define CIRCLEQ_LOOP_PREV(head, elm, field) \ ++ (((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \ ++ ? ((head)->cqh_last) \ ++ : (elm->field.cqe_prev)) ++#endif /* !_KERNEL */ ++ ++#endif /* !_SYS_QUEUE_H_ */ diff --git a/poky/meta/recipes-extended/libtirpc/libtirpc/export_key_secretkey_is_set.patch b/poky/meta/recipes-extended/libtirpc/libtirpc/export_key_secretkey_is_set.patch new file mode 100644 index 000000000..d7f496866 --- /dev/null +++ b/poky/meta/recipes-extended/libtirpc/libtirpc/export_key_secretkey_is_set.patch @@ -0,0 +1,31 @@ +Upstream-Status: Backport +Signed-off-by: Ross Burton <ross.burton@intel.com> + +From e51d67549b516b2dac6c71d92c8499f6e67125ad Mon Sep 17 00:00:00 2001 +From: Thorsten Kukuk <kukuk@thkukuk.de> +Date: Tue, 14 Nov 2017 10:43:53 -0500 +Subject: [PATCH] Fix typo in src/libtirpc.map + +Which prevents that key_secretkey_is_set will be exported. + +Signed-off-by: Thorsten Kukuk <kukuk@suse.de> +Signed-off-by: Steve Dickson <steved@redhat.com> +--- + src/libtirpc.map | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libtirpc.map b/src/libtirpc.map +index f385de5..21d6065 100644 +--- a/src/libtirpc.map ++++ b/src/libtirpc.map +@@ -298,7 +298,7 @@ TIRPC_0.3.2 { + key_gendes; + key_get_conv; + key_setsecret; +- key_secret_is_set; ++ key_secretkey_is_set; + key_setnet; + netname2host; + netname2user; +-- +1.8.3.1 diff --git a/poky/meta/recipes-extended/libtirpc/libtirpc_1.0.2.bb b/poky/meta/recipes-extended/libtirpc/libtirpc_1.0.2.bb new file mode 100644 index 000000000..99212600e --- /dev/null +++ b/poky/meta/recipes-extended/libtirpc/libtirpc_1.0.2.bb @@ -0,0 +1,33 @@ +SUMMARY = "Transport-Independent RPC library" +DESCRIPTION = "Libtirpc is a port of Suns Transport-Independent RPC library to Linux" +SECTION = "libs/network" +HOMEPAGE = "http://sourceforge.net/projects/libtirpc/" +BUGTRACKER = "http://sourceforge.net/tracker/?group_id=183075&atid=903784" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=f835cce8852481e4b2bbbdd23b5e47f3 \ + file://src/netname.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24" + +PROVIDES = "virtual/librpc" + +SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2 \ + file://export_key_secretkey_is_set.patch \ + file://0001-replace-__bzero-with-memset-API.patch \ + file://0001-include-stdint.h-for-uintptr_t.patch \ + " + +SRC_URI_append_libc-musl = " \ + file://Use-netbsd-queue.h.patch \ + " + +SRC_URI[md5sum] = "d5a37f1dccec484f9cabe2b97e54e9a6" +SRC_URI[sha256sum] = "723c5ce92706cbb601a8db09110df1b4b69391643158f20ff587e20e7c5f90f5" + +inherit autotools pkgconfig + +EXTRA_OECONF = "--disable-gssapi" + +do_install_append() { + chown root:root ${D}${sysconfdir}/netconfig +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch b/poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch new file mode 100644 index 000000000..79756b9a0 --- /dev/null +++ b/poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch @@ -0,0 +1,62 @@ +From d0537cb7f2dc5877700ad78dfd191515379d4edc Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 7 Jan 2016 02:22:51 +0000 +Subject: [PATCH 1/2] Check for issetugid() + +If secure version of getenv is not there then we can use +issetugid() as aid to call getenv() + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + configure.ac | 1 + + lib/config.c | 12 +++++++++++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 1ded1a2..ee19e1f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -125,6 +125,7 @@ AC_TYPE_OFF_T + AC_TYPE_SIZE_T + + AC_CHECK_FUNCS([__secure_getenv secure_getenv]) ++AC_CHECK_FUNCS([issetugid]) + + # Modify CFLAGS after all tests are run (some of them could fail because + # of the -Werror). +diff --git a/lib/config.c b/lib/config.c +index 29e7120..30f9daf 100644 +--- a/lib/config.c ++++ b/lib/config.c +@@ -44,8 +44,10 @@ + # define safe_getenv(string) secure_getenv(string) + #elif defined(HAVE___SECURE_GETENV) + # define safe_getenv(string) __secure_getenv(string) ++#elif defined(HAVE_ISSETUGID) ++# define safe_getenv(string) safe_getenv_issetugid(string) + #else +-# error Neither secure_getenv not __secure_getenv are available ++# error None of secure_getenv, __secure_getenv, or issetugid is available + #endif + + struct config_config { +@@ -59,6 +61,14 @@ struct config_key { + GList *values; + }; + ++static const char* ++safe_getenv_issetugid(const char* name) ++{ ++ if (issetugid ()) ++ return 0; ++ return getenv (name); ++} ++ + /* Compare two section names */ + static int + compare_section_names(gconstpointer a, gconstpointer b) +-- +2.7.0 + diff --git a/poky/meta/recipes-extended/libuser/libuser/0001-modules-files.c-parse_field-fix-string-formating-in-.patch b/poky/meta/recipes-extended/libuser/libuser/0001-modules-files.c-parse_field-fix-string-formating-in-.patch new file mode 100644 index 000000000..7c47df22e --- /dev/null +++ b/poky/meta/recipes-extended/libuser/libuser/0001-modules-files.c-parse_field-fix-string-formating-in-.patch @@ -0,0 +1,34 @@ +From a4857911ece5ebfcdef42aee4c070eb216f39597 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com> +Date: Fri, 13 May 2016 11:40:13 -0500 +Subject: [PATCH] modules/files.c: parse_field fix string formating in + g_warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[YOCTO #9547] + +Signed-off-by: AnÃbal Limón <anibal.limon@linux.intel.com> + +Upstream-Status: Pending +--- + modules/files.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/files.c b/modules/files.c +index 4ef0a57..35eafc9 100644 +--- a/modules/files.c ++++ b/modules/files.c +@@ -534,7 +534,7 @@ parse_field(const struct format_specifier *format, GValue *value, + string, &err); + if (ret == FALSE) { + g_assert(err != NULL); +- g_warning(lu_strerror(err)); ++ g_warning(lu_strerror(err), NULL); + lu_error_free(&err); + } + return ret; +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch b/poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch new file mode 100644 index 000000000..4bc0219f1 --- /dev/null +++ b/poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch @@ -0,0 +1,27 @@ +From 4b2f81f307ffeac12956e5c16e894e5ebb937ea5 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 7 Jan 2016 02:26:00 +0000 +Subject: [PATCH 2/2] remove unused execinfo.h + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + lib/error.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/lib/error.c b/lib/error.c +index a5ec30a..443e601 100644 +--- a/lib/error.c ++++ b/lib/error.c +@@ -18,7 +18,6 @@ + #include <config.h> + #include <sys/types.h> + #include <errno.h> +-#include <execinfo.h> + #include <libintl.h> + #include <stdarg.h> + #include <stdlib.h> +-- +2.7.0 + diff --git a/poky/meta/recipes-extended/libuser/libuser_0.62.bb b/poky/meta/recipes-extended/libuser/libuser_0.62.bb new file mode 100644 index 000000000..7ec54eb16 --- /dev/null +++ b/poky/meta/recipes-extended/libuser/libuser_0.62.bb @@ -0,0 +1,35 @@ +SUMMARY = "user and group account administration library" +DESCRIPTION = "The libuser library implements a standardized interface for manipulating and administering user \ +and group accounts" +HOMEPAGE = "https://pagure.io/libuser" +BUGTRACKER = "https://pagure.io/libuser/issues" + +LICENSE = "LGPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \ + file://lib/user.h;endline=19;md5=76b301f63c39fa992062395efbdc9558 \ + file://samples/testuser.c;endline=19;md5=3b87fa660fa3f4a6bb31d624afe30ba1" + +SECTION = "base" + +SRC_URI = "https://releases.pagure.org/libuser/libuser-${PV}.tar.xz \ + file://0001-Check-for-issetugid.patch \ + file://0002-remove-unused-execinfo.h.patch \ + file://0001-modules-files.c-parse_field-fix-string-formating-in-.patch \ + " + +SRC_URI[md5sum] = "63e5e5c551e99dc5302b40b80bd6d4f2" +SRC_URI[sha256sum] = "a58ff4fabb01a25043b142185a33eeea961109dd60d4b40b6a9df4fa3cace20b" + +DEPENDS = "popt libpam glib-2.0 python3" + +inherit distro_features_check +REQUIRED_DISTRO_FEATURES = "pam" + +inherit autotools gettext python3native python3-dir pkgconfig gtk-doc + +EXTRA_OEMAKE = "PYTHON_CPPFLAGS=-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}" + +PACKAGES += "${PN}-python " + +FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}" + diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd/0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch b/poky/meta/recipes-extended/lighttpd/lighttpd/0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch new file mode 100644 index 000000000..f17bdce2c --- /dev/null +++ b/poky/meta/recipes-extended/lighttpd/lighttpd/0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch @@ -0,0 +1,42 @@ +From 22afc5d9aaa215c3c87ba21c77d47da44ab3b113 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Fri, 26 Aug 2016 18:20:32 +0300 +Subject: [PATCH] Use pkg-config for pcre dependency instead of -config script. + +RP 2014/5/22 +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + configure.ac | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 5383cec..c29a902 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -651,10 +651,18 @@ AC_ARG_WITH([pcre], + ) + AC_MSG_RESULT([$WITH_PCRE]) + +-if test "$WITH_PCRE" != no; then +- if test "$WITH_PCRE" != yes; then +- PCRE_LIB="-L$WITH_PCRE/lib -lpcre" +- CPPFLAGS="$CPPFLAGS -I$WITH_PCRE/include" ++if test "$WITH_PCRE" != "no"; then ++ PKG_CHECK_MODULES(PCREPKG, [libpcre], [ ++ PCRE_LIB=${PCREPKG_LIBS} ++ CPPFLAGS="$CPPFLAGS ${PCREPKG_CFLAGS}" ++ ], [ ++ AC_MSG_ERROR([pcre pkgconfig not found, install the pcre-devel package or build with --without-pcre]) ++ ]) ++ ++ if test x"$PCRE_LIB" != x; then ++ AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre]) ++ AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h]) ++ AC_SUBST(PCRE_LIB) + else + AC_PATH_PROG([PCRECONFIG], [pcre-config]) + if test -n "$PCRECONFIG"; then +-- +2.15.0 + diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd b/poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd new file mode 100644 index 000000000..f5f1c377b --- /dev/null +++ b/poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd @@ -0,0 +1 @@ +<html><body><h1>It works!</h1></body></html> diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd new file mode 100644 index 000000000..bf89a60b7 --- /dev/null +++ b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd @@ -0,0 +1,34 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/lighttpd +NAME=lighttpd +DESC="Lighttpd Web Server" +OPTS="-f /etc/lighttpd.conf" + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start -x "$DAEMON" -- $OPTS + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop -x "$DAEMON" + echo "$NAME." + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + start-stop-daemon --stop -x "$DAEMON" + sleep 1 + start-stop-daemon --start -x "$DAEMON" -- $OPTS + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf new file mode 100644 index 000000000..6e8402d24 --- /dev/null +++ b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf @@ -0,0 +1,331 @@ +# lighttpd configuration file +# +# use it as a base for lighttpd 1.0.0 and above +# +# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $ + +############ Options you really have to take care of #################### + +## modules to load +# at least mod_access and mod_accesslog should be loaded +# all other module should only be loaded if really neccesary +# - saves some time +# - saves memory +server.modules = ( +# "mod_rewrite", +# "mod_redirect", +# "mod_alias", + "mod_access", +# "mod_cml", +# "mod_trigger_b4_dl", +# "mod_auth", +# "mod_status", +# "mod_setenv", +# "mod_fastcgi", +# "mod_proxy", +# "mod_simple_vhost", +# "mod_evhost", +# "mod_userdir", +# "mod_cgi", +# "mod_compress", +# "mod_ssi", +# "mod_usertrack", +# "mod_expire", +# "mod_secdownload", +# "mod_rrdtool", +# "mod_webdav", + "mod_accesslog" ) + +## a static document-root, for virtual-hosting take look at the +## server.virtual-* options +server.document-root = "/www/pages/" + +## where to send error-messages to +server.errorlog = "/www/logs/lighttpd.error.log" + +# files to check for if .../ is requested +index-file.names = ( "index.php", "index.html", + "index.htm", "default.htm" ) + +## set the event-handler (read the performance section in the manual) +# server.event-handler = "freebsd-kqueue" # needed on OS X + +# mimetype mapping +mimetype.assign = ( + ".pdf" => "application/pdf", + ".sig" => "application/pgp-signature", + ".spl" => "application/futuresplash", + ".class" => "application/octet-stream", + ".ps" => "application/postscript", + ".torrent" => "application/x-bittorrent", + ".dvi" => "application/x-dvi", + ".gz" => "application/x-gzip", + ".pac" => "application/x-ns-proxy-autoconfig", + ".swf" => "application/x-shockwave-flash", + ".tar.gz" => "application/x-tgz", + ".tgz" => "application/x-tgz", + ".tar" => "application/x-tar", + ".zip" => "application/zip", + ".mp3" => "audio/mpeg", + ".m3u" => "audio/x-mpegurl", + ".wma" => "audio/x-ms-wma", + ".wax" => "audio/x-ms-wax", + ".ogg" => "application/ogg", + ".wav" => "audio/x-wav", + ".gif" => "image/gif", + ".jpg" => "image/jpeg", + ".jpeg" => "image/jpeg", + ".png" => "image/png", + ".xbm" => "image/x-xbitmap", + ".xpm" => "image/x-xpixmap", + ".xwd" => "image/x-xwindowdump", + ".css" => "text/css", + ".html" => "text/html", + ".htm" => "text/html", + ".js" => "text/javascript", + ".asc" => "text/plain", + ".c" => "text/plain", + ".cpp" => "text/plain", + ".log" => "text/plain", + ".conf" => "text/plain", + ".text" => "text/plain", + ".txt" => "text/plain", + ".dtd" => "text/xml", + ".xml" => "text/xml", + ".mpeg" => "video/mpeg", + ".mpg" => "video/mpeg", + ".mov" => "video/quicktime", + ".qt" => "video/quicktime", + ".avi" => "video/x-msvideo", + ".asf" => "video/x-ms-asf", + ".asx" => "video/x-ms-asf", + ".wmv" => "video/x-ms-wmv", + ".bz2" => "application/x-bzip", + ".tbz" => "application/x-bzip-compressed-tar", + ".tar.bz2" => "application/x-bzip-compressed-tar" + ) + +# Use the "Content-Type" extended attribute to obtain mime type if possible +#mimetype.use-xattr = "enable" + + +## send a different Server: header +## be nice and keep it at lighttpd +# server.tag = "lighttpd" + +#### accesslog module +accesslog.filename = "/www/logs/access.log" +debug.log-request-handling = "enable" + + + + +## deny access the file-extensions +# +# ~ is for backupfiles from vi, emacs, joe, ... +# .inc is often used for code includes which should in general not be part +# of the document-root +url.access-deny = ( "~", ".inc" ) + +$HTTP["url"] =~ "\.pdf$" { + server.range-requests = "disable" +} + +## +# which extensions should not be handle via static-file transfer +# +# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi +static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) + +######### Options that are good to be but not neccesary to be changed ####### + +## bind to port (default: 80) +#server.port = 81 + +## bind to localhost (default: all interfaces) +#server.bind = "grisu.home.kneschke.de" + +## error-handler for status 404 +#server.error-handler-404 = "/error-handler.html" +#server.error-handler-404 = "/error-handler.php" + +## to help the rc.scripts +#server.pid-file = "/var/run/lighttpd.pid" + + +###### virtual hosts +## +## If you want name-based virtual hosting add the next three settings and load +## mod_simple_vhost +## +## document-root = +## virtual-server-root + virtual-server-default-host + virtual-server-docroot +## or +## virtual-server-root + http-host + virtual-server-docroot +## +#simple-vhost.server-root = "/home/weigon/wwwroot/servers/" +#simple-vhost.default-host = "grisu.home.kneschke.de" +#simple-vhost.document-root = "/pages/" + + +## +## Format: <errorfile-prefix><status-code>.html +## -> ..../status-404.html for 'File not found' +#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-" + +## virtual directory listings +#dir-listing.activate = "enable" + +## enable debugging +#debug.log-request-header = "enable" +#debug.log-response-header = "enable" +#debug.log-request-handling = "enable" +#debug.log-file-not-found = "enable" + +### only root can use these options +# +# chroot() to directory (default: no chroot() ) +#server.chroot = "/" + +## change uid to <uid> (default: don't care) +#server.username = "wwwrun" + +## change uid to <uid> (default: don't care) +#server.groupname = "wwwrun" + +#### compress module +#compress.cache-dir = "/tmp/lighttpd/cache/compress/" +#compress.filetype = ("text/plain", "text/html") + +#### proxy module +## read proxy.txt for more info +#proxy.server = ( ".php" => +# ( "localhost" => +# ( +# "host" => "192.168.0.101", +# "port" => 80 +# ) +# ) +# ) + +#### fastcgi module +## read fastcgi.txt for more info +## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini +#fastcgi.server = ( ".php" => +# ( "localhost" => +# ( +# "socket" => "/tmp/php-fastcgi.socket", +# "bin-path" => "/usr/local/bin/php" +# ) +# ) +# ) + +#### CGI module +#cgi.assign = ( ".pl" => "/usr/bin/perl", +# ".cgi" => "/usr/bin/perl" ) +# + +#### SSL engine +#ssl.engine = "enable" +#ssl.pemfile = "server.pem" + +#### status module +#status.status-url = "/server-status" +#status.config-url = "/server-config" + +#### auth module +## read authentication.txt for more info +#auth.backend = "plain" +#auth.backend.plain.userfile = "lighttpd.user" +#auth.backend.plain.groupfile = "lighttpd.group" + +#auth.backend.ldap.hostname = "localhost" +#auth.backend.ldap.base-dn = "dc=my-domain,dc=com" +#auth.backend.ldap.filter = "(uid=$)" + +#auth.require = ( "/server-status" => +# ( +# "method" => "digest", +# "realm" => "download archiv", +# "require" => "user=jan" +# ), +# "/server-config" => +# ( +# "method" => "digest", +# "realm" => "download archiv", +# "require" => "valid-user" +# ) +# ) + +#### url handling modules (rewrite, redirect, access) +#url.rewrite = ( "^/$" => "/server-status" ) +#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" ) + +#### both rewrite/redirect support back reference to regex conditional using %n +#$HTTP["host"] =~ "^www\.(.*)" { +# url.redirect = ( "^/(.*)" => "http://%1/$1" ) +#} + +# +# define a pattern for the host url finding +# %% => % sign +# %0 => domain name + tld +# %1 => tld +# %2 => domain name without tld +# %3 => subdomain 1 name +# %4 => subdomain 2 name +# +#evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/" + +#### expire module +#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes") + +#### ssi +#ssi.extension = ( ".shtml" ) + +#### rrdtool +#rrdtool.binary = "/usr/bin/rrdtool" +#rrdtool.db-name = "/var/www/lighttpd.rrd" + +#### setenv +#setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" ) +#setenv.add-response-header = ( "X-Secret-Message" => "42" ) + +## for mod_trigger_b4_dl +# trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db" +# trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" ) +# trigger-before-download.trigger-url = "^/trigger/" +# trigger-before-download.download-url = "^/download/" +# trigger-before-download.deny-url = "http://127.0.0.1/index.html" +# trigger-before-download.trigger-timeout = 10 + +## for mod_cml +## don't forget to add index.cml to server.indexfiles +# cml.extension = ".cml" +# cml.memcache-hosts = ( "127.0.0.1:11211" ) + +#### variable usage: +## variable name without "." is auto prefixed by "var." and becomes "var.bar" +#bar = 1 +#var.mystring = "foo" + +## integer add +#bar += 1 +## string concat, with integer cast as string, result: "www.foo1.com" +#server.name = "www." + mystring + var.bar + ".com" +## array merge +#index-file.names = (foo + ".php") + index-file.names +#index-file.names += (foo + ".php") + +#### include +#include /etc/lighttpd/lighttpd-inc.conf +## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf" +#include "lighttpd-inc.conf" + +#### include_shell +#include_shell "echo var.a=1" +## the above is same as: +#var.a=1 + +# include other config file fragments from lighttpd.d subdir +include_shell "find /etc/lighttpd.d -maxdepth 1 -name '*.conf' -exec cat {} \;" diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service new file mode 100644 index 000000000..66a907aa1 --- /dev/null +++ b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service @@ -0,0 +1,12 @@ +[Unit] +Description=Lightning Fast Webserver With Light System Requirements +After=network.target + +[Service] +ExecStartPre=@SBINDIR@/lighttpd -t -f @SYSCONFDIR@/lighttpd.conf +ExecStart=@SBINDIR@/lighttpd -D -f @SYSCONFDIR@/lighttpd.conf +ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target + diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb b/poky/meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb new file mode 100644 index 000000000..3c4444cf4 --- /dev/null +++ b/poky/meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb @@ -0,0 +1,85 @@ +SUMMARY = "Lightweight high-performance web server" +HOMEPAGE = "http://www.lighttpd.net/" +BUGTRACKER = "http://redmine.lighttpd.net/projects/lighttpd/issues" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=e4dac5c6ab169aa212feb5028853a579" + +SECTION = "net" +RDEPENDS_${PN} = "lighttpd-module-dirlisting \ + lighttpd-module-indexfile \ + lighttpd-module-staticfile" +RRECOMMENDS_${PN} = "lighttpd-module-access \ + lighttpd-module-accesslog" + +SRC_URI = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${PV}.tar.xz \ + file://index.html.lighttpd \ + file://lighttpd.conf \ + file://lighttpd \ + file://lighttpd.service \ + file://0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch \ + " + +SRC_URI[md5sum] = "1e3a9eb5078f481e3a8a1d0aaac8c3c8" +SRC_URI[sha256sum] = "0f8ad5aac7529d7b948b9d7e8cd0b4a9e177309d85d6bf6516e28e6e40d74f36" + +PACKAGECONFIG ??= "openssl pcre zlib \ + ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \ +" + +PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6" +PACKAGECONFIG[mmap] = "--enable-mmap,--disable-mmap" +PACKAGECONFIG[libev] = "--with-libev,--without-libev,libev" +PACKAGECONFIG[mysql] = "--with-mysql,--without-mysql,mariadb" +PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap" +PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr" +PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind" +PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl" +PACKAGECONFIG[krb5] = "--with-krb5,--without-krb5,krb5" +PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,libpcre" +PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib" +PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2" +PACKAGECONFIG[fam] = "--with-fam,--without-fam,gamin" +PACKAGECONFIG[webdav-props] = "--with-webdav-props,--without-webdav-props,libxml2 sqlite3" +PACKAGECONFIG[webdav-locks] = "--with-webdav-locks,--without-webdav-locks,util-linux" +PACKAGECONFIG[gdbm] = "--with-gdbm,--without-gdbm,gdbm" +PACKAGECONFIG[memcache] = "--with-memcached,--without-memcached,libmemcached" +PACKAGECONFIG[lua] = "--with-lua,--without-lua,lua5.1" + +EXTRA_OECONF += "--enable-lfs" + +inherit autotools pkgconfig update-rc.d gettext systemd + +INITSCRIPT_NAME = "lighttpd" +INITSCRIPT_PARAMS = "defaults 70" + +SYSTEMD_SERVICE_${PN} = "lighttpd.service" + +do_install_append() { + install -d ${D}${sysconfdir}/init.d ${D}${sysconfdir}/lighttpd.d ${D}/www/pages/dav + install -m 0755 ${WORKDIR}/lighttpd ${D}${sysconfdir}/init.d + install -m 0644 ${WORKDIR}/lighttpd.conf ${D}${sysconfdir} + install -m 0644 ${WORKDIR}/index.html.lighttpd ${D}/www/pages/index.html + + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/lighttpd.service ${D}${systemd_unitdir}/system + sed -i -e 's,@SBINDIR@,${sbindir},g' \ + -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + -e 's,@BASE_BINDIR@,${base_bindir},g' \ + ${D}${systemd_unitdir}/system/lighttpd.service + #For FHS compliance, create symbolic links to /var/log and /var/tmp for logs and temporary data + ln -sf ${localstatedir}/log ${D}/www/logs + ln -sf ${localstatedir}/tmp ${D}/www/var +} + +FILES_${PN} += "${sysconfdir} /www" + +CONFFILES_${PN} = "${sysconfdir}/lighttpd.conf" + +PACKAGES_DYNAMIC += "^lighttpd-module-.*" + +python populate_packages_prepend () { + lighttpd_libdir = d.expand('${libdir}') + do_split_packages(d, lighttpd_libdir, '^mod_(.*)\.so$', 'lighttpd-module-%s', 'Lighttpd module for %s', extra_depends='') +} diff --git a/poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch b/poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch new file mode 100644 index 000000000..04cb588db --- /dev/null +++ b/poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch @@ -0,0 +1,151 @@ +From 517cbff66c8bdbf455bc3b7c1a85a4f990d0f9a6 Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Tue, 17 Feb 2015 21:08:07 -0800 +Subject: [PATCH] Act as the "mv" command when rotate log + +Act as the "mv" command when rotate log, first rename, if failed, then +read and write. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + logrotate.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 60 insertions(+), 12 deletions(-) + +diff --git a/logrotate.c b/logrotate.c +index 4ad58d4..ba05884 100644 +--- a/logrotate.c ++++ b/logrotate.c +@@ -1315,6 +1315,54 @@ static int findNeedRotating(struct logInfo *log, int logNum, int force) + return 0; + } + ++/* Act as the "mv" command, if rename failed, then read the old file and ++ * write to new file. The function which invokes the mvFile will use ++ * the strerror(errorno) to handle the error message, so we don't have ++ * to print the error message here */ ++ ++int mvFile (char *oldName, char *newName, struct logInfo *log, acl_type acl) ++{ ++ struct stat sbprev; ++ int fd_old, fd_new, n; ++ char buf[BUFSIZ]; ++ ++ /* Do the rename first */ ++ if (!rename(oldName, newName)) ++ return 0; ++ ++ /* If the errno is EXDEV, then read old file, write newfile and ++ * remove the oldfile */ ++ if (errno == EXDEV) { ++ /* Open the old file to read */ ++ if ((fd_old = open(oldName, O_RDONLY)) < 0) ++ return 1; ++ ++ /* Create the file to write, keep the same attribute as the old file */ ++ if (stat(oldName, &sbprev)) ++ return 1; ++ else { ++ if ((fd_new = createOutputFile(newName, ++ O_WRONLY | O_CREAT | O_TRUNC, &sbprev, acl, 0)) < 0 ) ++ return 1; ++ } ++ ++ /* Read and write */ ++ while ((n = read(fd_old, buf, BUFSIZ)) > 0) ++ if (write(fd_new, buf, n) != n) ++ return 1; ++ ++ if ((close(fd_old) < 0) || ++ removeLogFile(oldName, log) || ++ (close(fd_new) < 0)) ++ return 1; ++ ++ return 0; ++ } ++ ++ return 1; ++} ++ ++ + static int prerotateSingleLog(struct logInfo *log, int logNum, + struct logState *state, struct logNames *rotNames) + { +@@ -1674,15 +1722,15 @@ static int prerotateSingleLog(struct logInfo *log, int logNum, + } + + message(MESS_DEBUG, +- "renaming %s to %s (rotatecount %d, logstart %d, i %d), \n", ++ "moving %s to %s (rotatecount %d, logstart %d, i %d), \n", + oldName, newName, rotateCount, logStart, i); + +- if (!debug && rename(oldName, newName)) { ++ if (!debug && mvFile(oldName, newName, log, prev_acl)) { + if (errno == ENOENT) { + message(MESS_DEBUG, "old log %s does not exist\n", + oldName); + } else { +- message(MESS_ERROR, "error renaming %s to %s: %s\n", ++ message(MESS_ERROR, "error moving %s to %s: %s\n", + oldName, newName, strerror(errno)); + hasErrors = 1; + } +@@ -1767,21 +1815,21 @@ static int rotateSingleLog(struct logInfo *log, int logNum, + return 1; + } + +- message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum], ++ message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum], + tmpFilename); +- if (!debug && !hasErrors && rename(log->files[logNum], tmpFilename)) { +- message(MESS_ERROR, "failed to rename %s to %s: %s\n", ++ if (!debug && !hasErrors && mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) { ++ message(MESS_ERROR, "failed to move %s to %s: %s\n", + log->files[logNum], tmpFilename, + strerror(errno)); + hasErrors = 1; + } + } + else { +- message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum], ++ message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum], + rotNames->finalName); + if (!debug && !hasErrors && +- rename(log->files[logNum], rotNames->finalName)) { +- message(MESS_ERROR, "failed to rename %s to %s: %s\n", ++ mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) { ++ message(MESS_ERROR, "failed to move %s to %s: %s\n", + log->files[logNum], rotNames->finalName, + strerror(errno)); + hasErrors = 1; +@@ -2170,7 +2218,7 @@ static int rotateLogSet(struct logInfo *log, int force) + return hasErrors; + } + +-static int writeState(const char *stateFilename) ++static int writeState(struct logInfo *log, char *stateFilename) + { + struct logState *p; + FILE *f; +@@ -2322,7 +2370,7 @@ static int writeState(const char *stateFilename) + fclose(f); + + if (error == 0) { +- if (rename(tmpFilename, stateFilename)) { ++ if (mvFile(tmpFilename, stateFilename, log, prev_acl)) { + unlink(tmpFilename); + error = 1; + message(MESS_ERROR, "error renaming temp state file %s\n", +@@ -2648,7 +2696,7 @@ int main(int argc, const char **argv) + rc |= rotateLogSet(log, force); + + if (!debug) +- rc |= writeState(stateFile); ++ rc |= writeState(log, stateFile); + + return (rc != 0); + } +-- +1.8.3.1 + diff --git a/poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch b/poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch new file mode 100644 index 000000000..793d70259 --- /dev/null +++ b/poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch @@ -0,0 +1,32 @@ +Disable the check for different filesystems + +The logrotate supports rotate log across different filesystems now, so +disable the check for different filesystems. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + config.c | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/config.c b/config.c +index dbbf563..64e66f6 100644 +--- a/config.c ++++ b/config.c +@@ -1493,15 +1493,6 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig) + goto error; + } + } +- +- if (sb.st_dev != sb2.st_dev +- && !(newlog->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY | LOG_FLAG_TMPFILENAME))) { +- message(MESS_ERROR, +- "%s:%d olddir %s and log file %s " +- "are on different devices\n", configFile, +- lineNum, newlog->oldDir, newlog->files[i]); +- goto error; +- } + } + } + diff --git a/poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch b/poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch new file mode 100644 index 000000000..725567e0c --- /dev/null +++ b/poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch @@ -0,0 +1,38 @@ +From bf22e8805df69344f6f20cea390e829a22fa741b Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Tue, 17 Feb 2015 21:14:37 -0800 +Subject: [PATCH] Update the manual + +Update the manual for rotating on different filesystems. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + logrotate.8.in | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/logrotate.8.in b/logrotate.8.in +index 951e406..581bf48 100644 +--- a/logrotate.8.in ++++ b/logrotate.8.in +@@ -445,12 +445,10 @@ Do not rotate the log if it is empty (this overrides the \fBifempty\fR option). + + .TP + \fBolddir \fIdirectory\fR +-Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR must be +-on the same physical device as the log file being rotated, unless \fBcopy\fR, +-\fBcopytruncate\fR or \fBrenamecopy\fR option is used. The \fIdirectory\fR +-is assumed to be relative to the directory holding the log file +-unless an absolute path name is specified. When this option is used all +-old versions of the log end up in \fIdirectory\fR. This option may be ++Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR ++is assumed to be relative to the directory holding the log file unless ++an absolute path name is specified. When this option is used all old ++versions of the log end up in \fIdirectory\fR. This option may be + overridden by the \fBnoolddir\fR option. + + .TP +-- +1.8.3.1 + diff --git a/poky/meta/recipes-extended/logrotate/logrotate_3.13.0.bb b/poky/meta/recipes-extended/logrotate/logrotate_3.13.0.bb new file mode 100644 index 000000000..990cf9178 --- /dev/null +++ b/poky/meta/recipes-extended/logrotate/logrotate_3.13.0.bb @@ -0,0 +1,85 @@ +SUMMARY = "Rotates, compresses, removes and mails system log files" +SECTION = "console/utils" +HOMEPAGE = "https://github.com/logrotate/logrotate/issues" +LICENSE = "GPLv2" + +# TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox? + +DEPENDS="coreutils popt" + +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +# When updating logrotate to latest upstream, SRC_URI should point to +# a proper release tarball from https://github.com/logrotate/logrotate/releases +# and we have to take the snapshot for now because there is no such +# tarball available for 3.9.1. + +S = "${WORKDIR}/${BPN}-${PV}" + +UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases" +UPSTREAM_CHECK_REGEX = "logrotate-(?P<pver>\d+(\.\d+)+).tar" + +SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz \ + file://act-as-mv-when-rotate.patch \ + file://update-the-manual.patch \ + file://disable-check-different-filesystems.patch \ + " + +SRC_URI[md5sum] = "78ef24d6fddcc4df8e412dd75c551b4c" +SRC_URI[sha256sum] = "3222ca032f99be8d7a4a8c6ad69f3dcc49b9511bfe384bd5a271ebcd9bd3e52c" + +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}" + +PACKAGECONFIG[acl] = ",,acl" +PACKAGECONFIG[selinux] = ",,libselinux" + +CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \ + ${sysconfdir}/logrotate.conf" + +# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our +# optimization variables, so use it rather than EXTRA_CFLAGS. +EXTRA_OEMAKE = "\ + LFS= \ + OS_NAME='${OS_NAME}' \ + 'CC=${CC}' \ + 'RPM_OPT_FLAGS=${CFLAGS}' \ + 'EXTRA_LDFLAGS=${LDFLAGS}' \ + ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \ +" + +# OS_NAME in the makefile defaults to `uname -s`. The behavior for +# freebsd/netbsd is questionable, so leave it as Linux, which only sets +# INSTALL=install and BASEDIR=/usr. +OS_NAME = "Linux" + +inherit autotools systemd + +SYSTEMD_SERVICE_${PN} = "\ + ${BPN}.service \ + ${BPN}.timer \ +" + +LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily" +LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h" + +do_install(){ + oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} + mkdir -p ${D}${sysconfdir}/logrotate.d + mkdir -p ${D}${localstatedir}/lib + install -p -m 644 ${S}/examples/logrotate-default ${D}${sysconfdir}/logrotate.conf + touch ${D}${localstatedir}/lib/logrotate.status + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${S}/examples/logrotate.service ${D}${systemd_system_unitdir}/logrotate.service + install -m 0644 ${S}/examples/logrotate.timer ${D}${systemd_system_unitdir}/logrotate.timer + sed -i -e 's,OnCalendar=.*$,OnCalendar=${LOGROTATE_SYSTEMD_TIMER_BASIS},g' ${D}${systemd_system_unitdir}/logrotate.timer + sed -i -e 's,AccuracySec=.*$,AccuracySec=${LOGROTATE_SYSTEMD_TIMER_ACCURACY},g' ${D}${systemd_system_unitdir}/logrotate.timer + fi + + if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + mkdir -p ${D}${sysconfdir}/cron.daily + install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate + fi +} diff --git a/poky/meta/recipes-extended/lsb/lsb/0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch b/poky/meta/recipes-extended/lsb/lsb/0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch new file mode 100644 index 000000000..017575206 --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsb/0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch @@ -0,0 +1,38 @@ +From cba901945c5a6da9586550498f8e3787c57c3098 Mon Sep 17 00:00:00 2001 +From: Athanasios Oikonomou <athoik@gmail.com> +Date: Fri, 17 Feb 2017 21:04:04 +0200 +Subject: [PATCH] fix lsb_release to work with busybox head and find + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Athanasios Oikonomou <athoik@gmail.com> + +diff --git a/lsb_release b/lsb_release +index e7d6024..233b8c1 100755 +--- a/lsb_release ++++ b/lsb_release +@@ -209,7 +209,7 @@ EASE ($DISTRIB_CODENAME)" + || [ -n "$(echo $DISTRIB_DESCRIPTION | \ + sed -e "s/.*$DESCSTR_DELI.*//")" ] + then +- TMP_DISTRIB_DESC=$(head -1 $FILENAME 2>/dev/null) ++ TMP_DISTRIB_DESC=$(head -n 1 $FILENAME 2>/dev/null) + [ -z "$DISTRIB_DESCRIPTION" ] \ + && DISTRIB_DESCRIPTION=$TMP_DISTRIB_DESC + else +@@ -249,10 +249,10 @@ GetDistribInfo() { + then + CHECKFIRST=$(find $INFO_ROOT/ -maxdepth 1 \ + -name \*$INFO_DISTRIB_SUFFIX \ +- -and ! -name $INFO_LSB_FILE \ +- -and -type f \ ++ -type f \ + 2>/dev/null \ +- | head -1 ) # keep one of the files found (if many) ++ | grep -v $INFO_LSB_FILE \ ++ | head -n 1 ) # keep one of the files found (if many) + fi + InitDistribInfo $CHECKFIRST + fi +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/lsb/lsb/init-functions b/poky/meta/recipes-extended/lsb/lsb/init-functions new file mode 100755 index 000000000..7c1dce24c --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsb/init-functions @@ -0,0 +1,44 @@ +#!/bin/sh + +# LSB initscript functions, as defined in the LSB Spec 1.1.0 +# +# Lawrence Lim <llim@core.com> - Tue, 26 June 2007 +# Updated to the latest LSB 3.1 spec +# http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic_lines.txt + +start_daemon () { + /etc/core-lsb/lsb_start_daemon "$@" +} + +killproc () { + /etc/core-lsb/lsb_killproc "$@" +} + +pidofproc () { + /etc/core-lsb/lsb_pidofproc "$@" +} + +log_success_msg () { + /etc/core-lsb/lsb_log_message success "$@" +} + +log_failure_msg () { + /etc/core-lsb/lsb_log_message failure "$@" +} + +log_warning_msg () { + /etc/core-lsb/lsb_log_message warning "$@" +} + +# int log_begin_message (char *message) +log_begin_msg () { + if [ -z "$1" ]; then + return 1 + fi + echo " * $@" +} + + +log_end_msg () { + /etc/core-lsb/lsb_log_message end "$@" +} diff --git a/poky/meta/recipes-extended/lsb/lsb/lsb_killproc b/poky/meta/recipes-extended/lsb/lsb/lsb_killproc new file mode 100755 index 000000000..866c1a9c6 --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsb/lsb_killproc @@ -0,0 +1,6 @@ +#!/bin/sh + +. /etc/init.d/functions + +LSB=LSB-1.1 killproc $* +exit $? diff --git a/poky/meta/recipes-extended/lsb/lsb/lsb_log_message b/poky/meta/recipes-extended/lsb/lsb/lsb_log_message new file mode 100755 index 000000000..10343b081 --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsb/lsb_log_message @@ -0,0 +1,27 @@ +#!/bin/sh + +. /etc/init.d/functions + +ACTION=$1 +shift + +case "$ACTION" in + success) + echo -n $* + success "$*" + echo + ;; + failure) + echo -n $* + failure "$*" + echo + ;; + warning) + echo -n $* + warning "$*" + echo + ;; + *) + ;; +esac +exit 0 diff --git a/poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc b/poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc new file mode 100755 index 000000000..6d1fd0f24 --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc @@ -0,0 +1,6 @@ +#!/bin/sh + +. /etc/init.d/functions + +pidofproc $* +exit $? diff --git a/poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon b/poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon new file mode 100755 index 000000000..de62c2344 --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon @@ -0,0 +1,45 @@ +#!/bin/sh + +. /etc/init.d/functions + +nice= +force= +pidfile= +user= +check= +RETVAL= +while [ "$1" != "${1##[-+]}" ]; do + case $1 in + -f) + force="--force" + shift + ;; + -n) + nice=$2 + shift 2 + ;; + -p) + pidfile="--pidfile $2" + shift 2 + ;; + -u) + user="--user $2" + shift 2 + ;; + -c) + check="--check $2" + shift 2 + ;; + *) + echo "Unknown Option $1" + echo "Options are:" + echo "-f" + echo "-p {pidfile}" + echo "-n [+/-nicelevel]" + echo "-u {user}" + echo "-c {base}" + exit 1;; + esac +done +LSB=LSB-1.1 daemon ${force:-} ${nice:-} ${pidfile:-} ${user:-} ${check:-} $* +exit $? diff --git a/poky/meta/recipes-extended/lsb/lsb_5.0.bb b/poky/meta/recipes-extended/lsb/lsb_5.0.bb new file mode 100644 index 000000000..df4812e4b --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsb_5.0.bb @@ -0,0 +1,134 @@ +SUMMARY = "LSB support for OpenEmbedded" +SECTION = "console/utils" +HOMEPAGE = "http://prdownloads.sourceforge.net/lsb" +LICENSE = "GPLv2+" + +LSB_CORE = "lsb-core-${TARGET_ARCH}" +LSB_CORE_x86 = "lsb-core-ia32" +LSB_CORE_x86-64 = "lsb-core-amd64" +RPROVIDES_${PN} += "${LSB_CORE}" + +# lsb_release needs getopt, lsbinitscripts +RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} lsbinitscripts" + +LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf" + +SRC_URI = "${SOURCEFORGE_MIRROR}/project/lsb/lsb_release/1.4/lsb-release-1.4.tar.gz \ + file://0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch \ + file://init-functions \ + file://lsb_killproc \ + file://lsb_log_message \ + file://lsb_pidofproc \ + file://lsb_start_daemon \ + " +UPSTREAM_VERSION_UNKNOWN = "1" + +SRC_URI[md5sum] = "30537ef5a01e0ca94b7b8eb6a36bb1e4" +SRC_URI[sha256sum] = "99321288f8d62e7a1d485b7c6bdccf06766fb8ca603c6195806e4457fdf17172" + +UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lsb/files/lsb_release/" +UPSTREAM_CHECK_REGEX = "/lsb_release/(?P<pver>(\d+[\.\-_]*)+)/" + +S = "${WORKDIR}/lsb-release-1.4" + +CLEANBROKEN = "1" + +do_install() { + oe_runmake install prefix=${D}${base_prefix} mandir=${D}${datadir}/man/ DESTDIR=${D} + + # these two dirs are needed by package lsb-dist-checker + mkdir -p ${D}${sysconfdir}/opt + mkdir -p ${D}${localstatedir}/opt + + mkdir -p ${D}${base_libdir} + mkdir -p ${D}${sysconfdir}/lsb-release.d + printf "LSB_VERSION=\"core-5.0-noarch:" > ${D}${sysconfdir}/lsb-release + + if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then + printf "core-5.0-ia32" >> ${D}${sysconfdir}/lsb-release + else + printf "core-5.0-${TARGET_ARCH}" >> ${D}${sysconfdir}/lsb-release + fi + echo "\"" >> ${D}${sysconfdir}/lsb-release + echo "DISTRIB_ID=${DISTRO}" >> ${D}${sysconfdir}/lsb-release + echo "DISTRIB_RELEASE=${DISTRO_VERSION}" >> ${D}${sysconfdir}/lsb-release + if [ -n "${DISTRO_CODENAME}" ]; then + echo "DISTRIB_CODENAME=${DISTRO_CODENAME}" >> ${D}${sysconfdir}/lsb-release + fi + echo "DISTRIB_DESCRIPTION=\"${DISTRO_NAME} ${DISTRO_VERSION}\"" >> ${D}${sysconfdir}/lsb-release + + if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then + mkdir -p ${D}${sysconfdir}/lsb-release.d + touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch + touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-noarch + touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ia32 + touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ia32 + elif [ "${TARGET_ARCH}" = "x86_64" ]; then + touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch + touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-amd64 + touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-amd64 + fi + if [ "${TARGET_ARCH}" = "powerpc" ]; then + touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch + touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc32 + touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc32 + elif [ "${TARGET_ARCH}" = "powerpc64" ]; then + touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch + touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc64 + touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc64 + fi +} + +do_install_append() { + install -d ${D}${sysconfdir}/core-lsb + for i in lsb_killproc lsb_log_message lsb_pidofproc lsb_start_daemon + do + install -m 0755 ${WORKDIR}/$i ${D}${sysconfdir}/core-lsb + done + + install -d ${D}${nonarch_base_libdir}/lsb + install -m 0755 ${WORKDIR}/init-functions ${D}${nonarch_base_libdir}/lsb + + # create links for LSB test + if [ -e ${sbindir}/chkconfig ]; then + if [ "${nonarch_base_libdir}" != "${nonarch_libdir}" ] ; then + install -d ${D}${nonarch_libdir}/lsb + fi + ln -sf ${sbindir}/chkconfig ${D}${nonarch_libdir}/lsb/install_initd + ln -sf ${sbindir}/chkconfig ${D}${nonarch_libdir}/lsb/remove_initd + fi + + if [ "${TARGET_ARCH}" = "x86_64" ]; then + if [ "${base_libdir}" != "${base_prefix}/lib64" ]; then + lnr ${D}${base_libdir} ${D}${base_prefix}/lib64 + fi + cd ${D}${base_libdir} + ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2 + ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3 + fi + if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then + cd ${D}${base_libdir} + ln -sf ld-linux.so.2 ld-lsb.so.2 + ln -sf ld-linux.so.2 ld-lsb.so.3 + fi + + if [ "${TARGET_ARCH}" = "powerpc64" ]; then + if [ "${base_libdir}" != "${base_prefix}/lib64" ]; then + lnr ${D}${base_libdir} ${D}${base_prefix}/lib64 + fi + cd ${D}${base_libdir} + ln -sf ld64.so.1 ld-lsb-ppc64.so.2 + ln -sf ld64.so.1 ld-lsb-ppc64.so.3 + fi + if [ "${TARGET_ARCH}" = "powerpc" ]; then + cd ${D}${base_libdir} + ln -sf ld.so.1 ld-lsb-ppc32.so.2 + ln -sf ld.so.1 ld-lsb-ppc32.so.3 + fi +} + +FILES_${PN} += "${@'${base_prefix}/lib64' if d.getVar('TARGET_ARCH') == ('x86_64' or 'powerpc64') and '${base_libdir}' != '${base_prefix}/lib64' else ''} \ + ${base_libdir} \ + ${nonarch_libdir}/lsb \ + ${nonarch_base_libdir}/lsb/* \ + " diff --git a/poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch b/poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch new file mode 100644 index 000000000..c0076453f --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch @@ -0,0 +1,21 @@ +Upstream-Status: Pending + +Subject: functions: avoid exit 1 which causes init scripts to fail + +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + rc.d/init.d/functions | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: initscripts-9.72/rc.d/init.d/functions +=================================================================== +--- initscripts-9.72.orig/rc.d/init.d/functions ++++ initscripts-9.72/rc.d/init.d/functions +@@ -686,6 +686,6 @@ if [ "$_use_systemctl" = "1" ]; then + fi + fi + +-strstr "$(cat /proc/cmdline)" "rc.debug" && set -x ++strstr "$(cat /proc/cmdline)" "rc.debug" && set -x || true + return 0 + diff --git a/poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch b/poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch new file mode 100644 index 000000000..e912daa70 --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch @@ -0,0 +1,33 @@ +From e46b056282c8420f096d5c34d78c00f816788784 Mon Sep 17 00:00:00 2001 +From: Fan Xin <fan.xin@jp.fujitsu.com> +Date: Mon, 5 Jun 2017 16:26:47 +0900 +Subject: [PATCH 1/2] Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> +Signed-off-by: Saul Wold <sgw@linux.intel.com> + +Rebase on 9.72 + +Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com> +Upstream-Status: Pending + +--- + rc.d/init.d/functions | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions +index 2e3da964..1a204dec 100644 +--- a/rc.d/init.d/functions ++++ b/rc.d/init.d/functions +@@ -59,7 +59,7 @@ systemctl_redirect () { + [ -z "${COLUMNS:-}" ] && COLUMNS=80 + + if [ -z "${CONSOLETYPE:-}" ]; then +- if [ -c "/dev/stderr" ] && [ -r "/dev/stderr" ]; then ++ if [ -c "/dev/stderr" ] && [ -r "/dev/stderr" ] && [ -e /sbin/consoletype ]; then + CONSOLETYPE="$(/sbin/consoletype < /dev/stderr 2>/dev/null)" + else + CONSOLETYPE="serial" +-- +2.15.1 + diff --git a/poky/meta/recipes-extended/lsb/lsbinitscripts_9.79.bb b/poky/meta/recipes-extended/lsb/lsbinitscripts_9.79.bb new file mode 100644 index 000000000..46edeed8a --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsbinitscripts_9.79.bb @@ -0,0 +1,32 @@ +SUMMARY = "SysV init scripts which are only used in an LSB image" +HOMEPAGE = "https://wiki.debian.org/LSBInitScripts" +SECTION = "base" +LICENSE = "GPLv2" +DEPENDS = "popt glib-2.0" + +RPROVIDES_${PN} += "initd-functions" +RDEPENDS_${PN} += "util-linux" +RCONFLICTS_${PN} = "initscripts-functions" + +LIC_FILES_CHKSUM = "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6" + +S = "${WORKDIR}/git" +SRC_URI = "git://github.com/fedora-sysv/initscripts \ + file://functions.patch \ + file://0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch \ + " +SRCREV = "a51c1b4f7dcf55b568b2ee4c2b18078849943469" +UPSTREAM_CHECK_GITTAGREGEX = "^(?P<pver>\d+(\.\d+)+)" + +SRC_URI[md5sum] = "d6c798f40dceb117e12126d94cb25a9a" +SRC_URI[sha256sum] = "1793677bdd1f7ee4cb00878ce43346196374f848a4c8e4559e086040fc7487db" + +# Since we are only taking the patched version of functions, no need to +# configure or compile anything so do not execute these +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install(){ + install -d ${D}${sysconfdir}/init.d/ + install -m 0644 ${S}/rc.d/init.d/functions ${D}${sysconfdir}/init.d/functions +} diff --git a/poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh b/poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh new file mode 100644 index 000000000..073e247a5 --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh @@ -0,0 +1,525 @@ +#!/bin/sh + +# Copyright (C) 2012 Wind River Systems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# 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 + + +WORK_DIR="/opt/lsb-test" + +if [ `id -u` -ne 0 ] +then + cat << EOF + In order to install and run LSB testsuite, you need administrator privileges. + You are currently running this script as an unprivileged user. + +EOF + exit 1 +fi + +ARCH=`uname -m` +if [ ${ARCH} != "i686" ] && [ ${ARCH} != "x86_64" ] && [ ${ARCH} != "ppc" ] && [ ${ARCH} != "ppc64" ] +then + echo "Error: Unsupported architecture" + exit 1 +fi + +which rpm +if [ $? -ne 0 ] +then + echo "No rpm command found" + exit 1 +fi + +RET=0 + +cd ${WORK_DIR} || exit 1 +# Step 1: Download the LSB Packages +echo "" +echo "Download LSB packages..." +echo "" + +if [ ! -e ./packages_list ] +then + echo "Error: Could not find packages list" >&2 + exit 1 +fi + +. ./packages_list + +PACKAGES_DIR="/var/opt/lsb/test/manager/packages/ftp.linuxfoundation.org/pub/lsb" + +BASE_PACKAGES_DIR="${PACKAGES_DIR}/base/released-all/binary" +RUNTIME_BASE_PACKAGES_DIR="${PACKAGES_DIR}/test_suites/released-all/binary/runtime" +RUNTIME_PACKAGES_DIR="${PACKAGES_DIR}/test_suites/${LSB_RELEASE}/binary/runtime" +APP_PACKAGES_DIR="${PACKAGES_DIR}/app-battery/${LSB_RELEASE}/${LSB_ARCH}" +APP_TESTFILES_DIR="${PACKAGES_DIR}/app-battery/tests" +SNAPSHOTS_TESTFILES_DIR="${PACKAGES_DIR}/snapshots/appbat/tests" + +if [ ! -d ${PACKAGES_DIR} ] +then + mkdir -p ${PACKAGES_DIR} +fi + +if [ ! -d ${BASE_PACKAGES_DIR} ] +then + mkdir -p ${BASE_PACKAGES_DIR} +fi + +if [ ! -d ${RUNTIME_BASE_PACKAGES_DIR} ] +then + mkdir -p ${RUNTIME_BASE_PACKAGES_DIR} +fi + +if [ ! -d ${RUNTIME_PACKAGES_DIR} ] +then + mkdir -p ${RUNTIME_PACKAGES_DIR} +fi + +if [ ! -d ${APP_PACKAGES_DIR} ] +then + mkdir -p ${APP_PACKAGES_DIR} +fi + +if [ ! -d ${APP_TESTFILES_DIR} ] +then + mkdir -p ${APP_TESTFILES_DIR} +fi + +# Official download server list. You can replace them with your own server. +SERVER_IPADDR="140.211.169.28" +SERVER_NAME="ftp.linuxfoundation.org" + +if ! `grep -F -q "${SERVER_NAME}" /etc/hosts`; then + echo "${SERVER_IPADDR} ${SERVER_NAME} ${SERVER_NAME}" >> /etc/hosts +fi + +#ping -c 5 ${SERVER_NAME} +#if [ $? -ne 0 ] +#then +# echo "The server: ${SERVER_NAME} is unreachable" +# exit 1 +#fi + +SERVER1="\ + http://${SERVER_NAME}/pub/lsb/base/released-all/binary" +SERVER2="\ + http://${SERVER_NAME}/pub/lsb/test_suites/released-all/binary/runtime" +SERVER3="\ + http://${SERVER_NAME}/pub/lsb/test_suites/${LSB_RELEASE}/binary/runtime" +SERVER4="\ + http://${SERVER_NAME}/pub/lsb/app-battery/${LSB_RELEASE}/${LSB_ARCH}" +SERVER5="\ + http://${SERVER_NAME}/pub/lsb/app-battery/tests" + +# We using "curl" as a download tool, "wget" is an alternative. +CURL=`which curl` +WGET=`which wget` +if [ ! -z ${CURL} ] +then + DOWNLOAD_CMD="${CURL} -R -L -f --retry 3 --retry-delay 4 --connect-timeout 180 --compressed -C - -o" +elif [ ! -z ${WGET} ] +then + DOWNLOAD_CMD="${WGET} -c -t 5 -O" +else + echo "Can not find a download tool, please install curl or wget." + exit 1 +fi + +cd ${BASE_PACKAGES_DIR} +for pkg in ${BASE_PACKAGES_LIST}; do + if [ ! -f ${pkg} ] + then + #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER1}/${pkg} > /dev/null 2>&1 + ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER1}/${pkg} + if [ $? -eq 0 ] + then + mv -f ${pkg}".#part" ${pkg} + echo "Download ${pkg} successfully." + else + echo "Download ${pkg} failed." + RET=1 + fi + fi +done + +cd ${RUNTIME_BASE_PACKAGES_DIR} +for pkg in ${RUNTIME_BASE_PACKAGES_LIST}; do + if [ ! -f ${pkg} ] + then + #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER2}/${pkg} > /dev/null 2>&1 + ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER2}/${pkg} + if [ $? -eq 0 ] + then + mv -f ${pkg}".#part" ${pkg} + echo "Download ${pkg} successfully." + else + echo "Download ${pkg} failed." + RET=1 + fi + fi +done + +cd ${RUNTIME_PACKAGES_DIR} +for pkg in ${RUNTIME_PACKAGES_LIST}; do + if [ ! -f ${pkg} ] + then + #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER3}/${pkg} > /dev/null 2>&1 + ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER3}/${pkg} + if [ $? -eq 0 ] + then + mv -f ${pkg}".#part" ${pkg} + echo "Download ${pkg} successfully." + else + echo "Download ${pkg} failed." + RET=1 + fi + fi +done + +cd ${APP_PACKAGES_DIR} +for pkg in ${APP_PACKAGES_LIST}; do + if [ ! -f ${pkg} ] + then + #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER4}/${pkg} > /dev/null 2>&1 + ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER4}/${pkg} + if [ $? -eq 0 ] + then + mv -f ${pkg}".#part" ${pkg} + echo "Download ${pkg} successfully." + else + echo "Download ${pkg} failed." + RET=1 + fi + fi +done + +cd ${APP_TESTFILES_DIR} +for pkg in ${APP_TESTFILES_LIST}; do + if [ ! -f ${pkg} ] + then + #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER5}/${pkg} > /dev/null 2>&1 + ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER5}/${pkg} + if [ $? -eq 0 ] + then + mv -f ${pkg}".#part" ${pkg} + echo "Download ${pkg} successfully." + else + echo "Download ${pkg} failed." + RET=1 + fi + fi +done + +if [ ${RET} -ne 0 ] +then + echo "Download some packages failed. Please download them again." + exit 1 +fi + +# Step 2: Install the LSB Packages +echo "" +echo "Install LSB packages..." +echo "" + +# Kill lighttpd +ps aux | grep "lighttpd" | grep -v -q "grep" +if [ $? -eq 0 ] +then + killall lighttpd >/dev/null 2>&1 +fi + +# Start avahi-daemon +ps aux | grep "avahi-daemon" | grep -v -q "grep" +if [ $? -ne 0 ] +then + /etc/init.d/avahi-daemon start >/dev/null 2>&1 +fi + +LSB_START_CMD="/opt/lsb/test/manager/bin/dist-checker-start.pl" +LSB_STOP_CMD="/opt/lsb/test/manager/bin/dist-checker-stop.pl" + +PLATFORM_FILE="/etc/rpm/platform" + +RPM_INSTALL_CMD="rpm --quiet --nodeps --replacepkgs --nosignature -i --ignoreos" +RPM_INSTALL_CMD_NOSCRIPTS="rpm --quiet --nodeps --replacepkgs --noscripts --nosignature -i --ignoreos" + +# If the lsb has been started, stop it first. +if [ -x ${LSB_STOP_CMD} ] +then + ${LSB_STOP_CMD} +fi + +if [ ! -d /etc/rpm ] +then + mkdir -p /etc/rpm +fi + +if [ ! -f ${PLATFORM_FILE} ] +then + touch ${PLATFORM_FILE} +fi + +if ! `grep -F -q "noarch-suse" ${PLATFORM_FILE}`; then + if [ ${ARCH} = i686 ];then + echo "i486-suse" >> ${PLATFORM_FILE} + echo "i486-noarch" >> ${PLATFORM_FILE} + echo "i486-pc" >> ${PLATFORM_FILE} + echo "noarch-suse" >> ${PLATFORM_FILE} + elif [ ${ARCH} = x86_64 ]; then + echo "i486-suse" >> ${PLATFORM_FILE} + echo "i486-noarch" >> ${PLATFORM_FILE} + echo "i486-pc" >> ${PLATFORM_FILE} + echo "i486-.*-linux.*" >> ${PLATFORM_FILE} + echo "noarch-suse" >> ${PLATFORM_FILE} + echo "${ARCH}-suse" >> ${PLATFORM_FILE} + echo "${ARCH}-noarch" >> ${PLATFORM_FILE} + echo "${ARCH}-pc" >> ${PLATFORM_FILE} + else + echo "${ARCH}-suse" >> ${PLATFORM_FILE} + echo "${ARCH}-noarch" >> ${PLATFORM_FILE} + echo "${ARCH}-pc" >> ${PLATFORM_FILE} + echo "noarch-suse" >> ${PLATFORM_FILE} + fi +fi + +if [ -d ${BASE_PACKAGES_DIR} ] +then + cd ${BASE_PACKAGES_DIR} + for pkg in ${BASE_PACKAGES_LIST} + do + rpm --quiet -q ${pkg%\.*} + if [ $? -ne 0 ]; then + $RPM_INSTALL_CMD ${pkg} + fi + done +fi + +if [ -d ${RUNTIME_BASE_PACKAGES_DIR} ] +then + cd ${RUNTIME_BASE_PACKAGES_DIR} + for pkg in ${RUNTIME_BASE_PACKAGES_LIST} + do + rpm --quiet -q ${pkg%\.*} + if [ $? -ne 0 ]; then + $RPM_INSTALL_CMD ${pkg} + fi + done +fi + +if [ -d ${RUNTIME_PACKAGES_DIR} ] +then + cd ${RUNTIME_PACKAGES_DIR} + for pkg in ${RUNTIME_PACKAGES_LIST} + do + rpm --quiet -q ${pkg%\.*} + if [ $? -ne 0 ]; then + $RPM_INSTALL_CMD ${pkg} + fi + done +fi + +if [ -d ${APP_PACKAGES_DIR} ] +then + cd ${APP_PACKAGES_DIR} + for pkg in ${APP_PACKAGES_LIST} + do + echo "${pkg}" | grep -q "apache\|xpdf" + if [ $? -eq 0 ] + then + rpm --quiet -q ${pkg%\.*} + if [ $? -ne 0 ]; then + $RPM_INSTALL_CMD_NOSCRIPTS ${pkg} + fi + else + rpm --quiet -q ${pkg%\.*} + if [ $? -ne 0 ]; then + $RPM_INSTALL_CMD ${pkg} + fi + fi + done +fi + +if [ ! -d ${SNAPSHOTS_TESTFILES_DIR} ] +then + mkdir -p ${SNAPSHOTS_TESTFILES_DIR} +fi + +if [ -d ${APP_TESTFILES_DIR} ] +then + cd ${APP_TESTFILES_DIR} + for pkg in ${APP_TESTFILES_LIST} + do + cp -f ${pkg} ${SNAPSHOTS_TESTFILES_DIR} + done +fi + +cd ${WORK_DIR} + +# Step 3: Set environment +echo "" +echo "Set environment..." +echo "" + +check () +{ + if [ $? -eq 0 ] + then + echo "PASS" + else + echo "FAIL" + exit 1 + fi +} + +echo "" +echo "---------------------------------" +echo "Create the Dirnames on target" + +if [ ! -d /etc/rpm/sysinfo ] +then + mkdir -p /etc/rpm/sysinfo +fi + +cat > /etc/rpm/sysinfo/Dirnames << EOF +/etc/opt/lsb +/home/tet/LSB.tools +/opt/lsb-tet3-lite/lib/ksh +/opt/lsb-tet3-lite/lib/perl +/opt/lsb-tet3-lite/lib/posix_sh +/opt/lsb-tet3-lite/lib/tet3 +/opt/lsb-tet3-lite/lib/xpg3sh +/opt/lsb/appbat/lib/python2.4/site-packages/qm +/opt/lsb/appbat/lib/python2.4/site-packages/qm/external +/opt/lsb/appbat/lib/python2.4/site-packages/qm/external/DocumentTemplate +/opt/lsb/appbat/lib/python2.4/site-packages/qm/test +/opt/lsb/appbat/lib/python2.4/site-packages/qm/test/classes +/opt/lsb/appbat/lib/python2.4/site-packages/qm/test/web +/opt/lsb/test/doc +/opt/lsb/test/lib +/opt/lsb/test/qm/diagnostics +/opt/lsb/test/qm/doc +/opt/lsb/test/qm/doc/test/html +/opt/lsb/test/qm/doc/test/print +/opt/lsb/test/qm/dtml +/opt/lsb/test/qm/dtml/test +/opt/lsb/test/qm/messages/test +/opt/lsb/test/qm/tutorial/test/tdb +/opt/lsb/test/qm/tutorial/test/tdb/QMTest +/opt/lsb/test/qm/web +/opt/lsb/test/qm/web/images +/opt/lsb/test/qm/web/stylesheets +/opt/lsb/test/qm/xml +/opt/lsb/test/share +/usr/share/doc/lsb-runtime-test +/var/opt/lsb +/opt/lsb/test/desktop +/opt/lsb/test/desktop/fontconfig +/opt/lsb/test/desktop/freetype +/opt/lsb/test/desktop/gtkvts +/opt/lsb/test/desktop/libpng +/opt/lsb/test/desktop/xft +/opt/lsb/test/desktop/xml +/opt/lsb/test/desktop/xrender + + +EOF + +if [ -f /etc/rpm/sysinfo/Dirnames ] +then + echo "Success to creat Dirnames file" +else + echo "Fail to creat Dirnames file" +fi + +[ -x /sbin/ldconfig ] && { +echo "" +echo "---------------------------------" +echo "Update cache" +/sbin/ldconfig +check; +} + +# Check loop device +if [ ! -b /dev/loop0 ] +then + insmod /lib/modules/`uname -r`/kernel/drivers/block/loop.ko + if [ $? != 0 ];then + echo "Insmod loop.ko failed." + fi +fi + +# Resolve localhost +LOCALHOST=`hostname` +if ! `grep -F -q "$LOCALHOST" /etc/hosts`; then + echo "127.0.0.1 $LOCALHOST" >> /etc/hosts +fi + +# Workaround to add part of locales for LSB test +localedef -i de_DE -f ISO-8859-1 de_DE +localedef -i de_DE -f ISO-8859-15 de_DE.ISO-8859-15 +localedef -i de_DE -f UTF-8 de_DE.UTF-8 +localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro +localedef -i en_HK -f ISO-8859-1 en_HK +localedef -i en_PH -f ISO-8859-1 en_PH +localedef -i en_US -f ISO-8859-15 en_US.ISO-8859-15 +localedef -i en_US -f ISO-8859-1 en_US.ISO-8859-1 +localedef -i en_US -f ISO-8859-1 en_US +localedef -i en_US -f UTF-8 en_US.UTF-8 +localedef -i en_US -f ISO-8859-1 en_US.ISO8859-1 +localedef -i es_MX -f ISO-8859-1 es_MX +localedef -i fr_FR -f ISO-8859-1 fr_FR +localedef -i it_IT -f ISO-8859-1 it_IT +localedef -i ja_JP -f EUC-JP ja_JP.eucjp +localedef -i se_NO -f UTF-8 se_NO.UTF-8 +localedef -i ta_IN -f UTF-8 ta_IN +localedef -i es_ES -f ISO-8859-1 es_ES +localedef -i fr_FR@euro -f ISO-8859-1 fr_FR@euro +localedef -i is_IS -f UTF-8 is_IS.UTF-8 +localedef -i zh_TW -f BIG5 zh_TW.BIG5 +localedef -i en_US -f ISO-8859-15 en_US.ISO-8859-15 + +echo "" +echo "Installation done!" +echo "" + +# Step 4: Start LSB test +if [ -x ${LSB_START_CMD} ] +then + ${LSB_START_CMD} +fi + +echo "---------------------------------" +echo "Run all the certification version of LSB Tests" +echo "---------------------------------" + +LSB_DIST_CHECKER="/opt/lsb/test/manager/utils/dist-checker.pl" +SESSION="${WORK_DIR}/session" +if [ ! -e ${SESSION} ] +then + echo "Error: Could not find session file." + echo "You must run LSB test from webbrower." + exit 1 +fi + +if [ -x ${LSB_DIST_CHECKER} ] +then + ${LSB_DIST_CHECKER} -v2 -f ${SESSION} + check +fi + +echo "" +echo "LSB test complete. Please check the log file in /var/opt/lsb/test/manager/results/" +echo "" + diff --git a/poky/meta/recipes-extended/lsb/lsbtest/packages_list b/poky/meta/recipes-extended/lsb/lsbtest/packages_list new file mode 100644 index 000000000..1a6c11699 --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsbtest/packages_list @@ -0,0 +1,49 @@ +LSB_RELEASE="released-5.0" +LSB_ARCH="lsbarch" + +BASE_PACKAGES_LIST="lsb-setup-5.0.0-2.noarch.rpm" + +RUNTIME_BASE_PACKAGES_LIST="lsb-dist-checker-5.0.0.1-1.targetarch.rpm \ + lsb-tet3-lite-3.7-27.lsb5.targetarch.rpm \ + lsb-tet3-lite-devel-3.7-27.lsb5.targetarch.rpm \ + lsb-xvfb-1.2.0-22.targetarch.rpm \ + " + +RUNTIME_PACKAGES_LIST="lsb-cmdchk-5.0.3-1.targetarch.rpm \ + lsb-libchk-5.0.3-1.targetarch.rpm \ + lsb-qm-2.2-1.lsb5.targetarch.rpm \ + lsb-task-dist-testkit-5.0.0-2.noarch.rpm \ + lsb-test-core-5.0.1-1.targetarch.rpm \ + lsb-test-cpp-t2c-5.0.0-1.targetarch.rpm \ + lsb-test-desktop-5.0.0-1.targetarch.rpm \ + lsb-test-desktop-t2c-5.0.0-1.targetarch.rpm \ + lsb-test-libstdcpp-4.1.0-22.lsb1.targetarch.rpm \ + lsb-test-olver-core-5.0.0-1.targetarch.rpm \ + lsb-test-perl-5.0.2-1.noarch.rpm \ + lsb-test-printing-5.0.1-1.targetarch.rpm \ + lsb-test-python-5.0.0-1.targetarch.rpm \ + lsb-test-qt4-azov-5.0.0-1.targetarch.rpm \ + lsb-test-xts5-5.1.5-47.lsb5.targetarch.rpm \ + lsb-test-alsa-t2c-5.1.91-4.targetarch.rpm \ + lsb-test-core-t2c-5.0.1-1.targetarch.rpm \ + lsb-test-xml2-azov-5.0.0-1.targetarch.rpm \ + " + +APP_PACKAGES_LIST="lsb-python-2.4.6-10.lsb5.targetarch.rpm \ + lsb-apache-2.2.19-5.lsb5.targetarch.rpm \ + lsb-tcl-8.5.9-21.lsb5.targetarch.rpm \ + lsb-expect-5.43.0-21.lsb5.targetarch.rpm \ + lsb-groff-1.20.1-9.lsb5.targetarch.rpm \ + lsb-raptor-1.4.21-4.lsb5.targetarch.rpm \ + lsb-xpdf-1.01-17.lsb5.targetarch.rpm \ + lsb-samba-3.5.9-5.lsb5.targetarch.rpm \ + lsb-rsync-3.0.8-3.lsb5.targetarch.rpm \ + " + +APP_TESTFILES_LIST="expect-tests.tar \ + tcl-tests.tar \ + raptor-tests.tar \ + test1.pdf \ + test2.pdf \ + " + diff --git a/poky/meta/recipes-extended/lsb/lsbtest/session b/poky/meta/recipes-extended/lsb/lsbtest/session new file mode 100644 index 000000000..4d47e40f7 --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsbtest/session @@ -0,0 +1,176 @@ +[GENERAL] +VERBOSE_LEVEL: 1 +ARCHITECTURE: targetarch +USE_INTERNET: 1 +STD_VERSION: LSB 5.0 +STD_PROFILE: no +[cmdchk] +RUN: 1 +VERSION: local|* + +[libchk] +RUN: 1 +VERSION: local|* + +[alsa-t2c] +RUN: 1 +VERSION: local|* + +[alsa-t2c|local|*] +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/alsa-t2c +AUTOREPLY_RESULTS_DIR: /opt/lsb/test/alsa-t2c/results + +[core] +RUN: 1 +VERSION: local|* + +[core|local|*] +AUTOREPLY_PROVIDES_BASH: n +AUTOREPLY_TESTRUN_PATH: /home/tet/test_sets +AUTOREPLY_PERSON: Automated +AUTOREPLY_KERNEL_NAME: vmlinuz +AUTOREPLY_INSTALL_LSBPAM_CONF: y +AUTOREPLY_PROVIDES_C_SHELL: n +AUTOREPLY_ORGANISATION: N/A +AUTOREPLY_SET_PASS_MIN_DAYS: y +AUTOREPLY_PROVIDES_SYSV_INIT: +AUTOREPLY_ISNTALL_DEVS: y +AUTOREPLY_SUPPORTS_FILE_CMD: y +AUTOREPLY_TEST_SYSTEM: Distribution Checker +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/core/tet/test_sets +AUTOREPLY_SUPPORTS_NLS: n +AUTOREPLY_SUPPORTS_PROCESS_ACCOUNTING: n +AUTOREPLY_PATH_TO_RC.D: +AUTOREPLY_ALLOWS_MAKEDEV: n +AUTOREPLY_RESULTS_DIR: /opt/lsb/test/core/tet/test_sets/results + +[core-t2c] +RUN: 1 +VERSION: local|* + +[core-t2c|local|*] +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/core-t2c +AUTOREPLY_RESULTS_DIR: /opt/lsb/test/core-t2c/results + +[cpp-t2c] +RUN: 1 +VERSION: local|* + +[cpp-t2c|local|*] +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/cpp-t2c +AUTOREPLY_RESULTS_DIR: /opt/lsb/test/cpp-t2c/results + +[desktop] +RUN: 1 +VERSION: local|* + +[desktop|local|*] +AUTOREPLY_DESKTOP_ENVIRONMENT: [default] +AUTOREPLY_PERSON: Automated +AUTOREPLY_X_CLIENT_HOSTNAME: +AUTOREPLY_TEST_SYSTEM: Distribution Checker +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/desktop +AUTOREPLY_X11_FONT_PATH: [default] +AUTOREPLY_SHOW_SUMMARY_REPORT: +AUTOREPLY_ORGANISATION: N/A +AUTOREPLY_XVFB_DISPLAY: [default] + +[desktop-t2c] +RUN: 1 +VERSION: local|* + +[desktop-t2c|local|*] +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/desktop-t2c +AUTOREPLY_RESULTS_DIR: /opt/lsb/test/desktop-t2c/results + +[libstdcpp] +RUN: 1 +VERSION: local|* + +[libstdcpp|local|*] +AUTOREPLY_TEST_SYSTEM: Distribution Checker +AUTOREPLY_PERSON: Automated +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/libstdcpp_4.1.0 +AUTOREPLY_ORGANISATION: N/A +AUTOREPLY_GNU_TRIPLET: + +[olver] +RUN: 1 +VERSION: local|* + +[olver|local|*] +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/olver-core +AUTOREPLY_RESULTS_DIR: /var/opt/lsb/test/olver-core + +[perl] +RUN: 1 +VERSION: local|* + +[perl|local|*] +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/perl +AUTOREPLY_RESULTS_DIR: /opt/lsb/test/perl/results + +[printing] +RUN: 1 +VERSION: local|* + +[printing|local|*] +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/printing +AUTOREPLY_RESULTS_DIR: /opt/lsb/test/printing/results + +[python] +RUN: 1 +VERSION: local|* + +[python|local|*] +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/python +AUTOREPLY_RESULTS_DIR: /opt/lsb/test/python/results + +[xml2-azov] +RUN: 1 +VERSION: local|* + +[xts5] +RUN: 1 +VERSION: local|* + +[xts5|local|*] +AUTOREPLY_XT_FONTPATH_GOOD: [default] +AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/xts5 +AUTOREPLY_XVFB_DISPLAY: [default] +AUTOREPLY_RESULTS_DIR: /opt/lsb/test/xts5/xts5/results +AUTOREPLY_XT_FONTPATH: [default] +AUTOREPLY_X_CLIENT_HOSTNAME: + +[apache] +RUN: 1 +VERSION: local|* + +[expect] +RUN: 1 +VERSION: local|* + +[groff] +RUN: 1 +VERSION: local|* + +[raptor] +RUN: 1 +VERSION: local|* + +[rsync] +RUN: 1 +VERSION: local|* + +[samba] +RUN: 1 +VERSION: local|* + +[tcl] +RUN: 1 +VERSION: local|* + +[xpdf] +RUN: 1 +VERSION: local|* + diff --git a/poky/meta/recipes-extended/lsb/lsbtest_1.0.bb b/poky/meta/recipes-extended/lsb/lsbtest_1.0.bb new file mode 100644 index 000000000..a90c023d5 --- /dev/null +++ b/poky/meta/recipes-extended/lsb/lsbtest_1.0.bb @@ -0,0 +1,49 @@ +SUMMARY = "Automates Linux Standard Base (LSB) tests" +HOMEPAGE = "https://wiki.debian.org/LSBInitScripts" +SECTION = "console/utils" +LICENSE = "GPLv2" +PR = "r3" + +LIC_FILES_CHKSUM = "file://LSB_Test.sh;beginline=3;endline=16;md5=7063bb54b04719df0716b513447f4fc0" + +SRC_URI = "file://LSB_Test.sh \ + file://packages_list \ + file://session \ + " +RDEPENDS_${PN} = "lsb rpm" + +S = "${WORKDIR}" + +do_install() { + install -d ${D}/opt/lsb-test + install -m 0755 ${S}/LSB_Test.sh ${D}/opt/lsb-test/LSB_Test.sh + install -m 0644 ${S}/packages_list ${D}/opt/lsb-test/packages_list + install -m 0644 ${S}/session ${D}/opt/lsb-test/session + if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then + sed -i -e 's/lsbarch/ia32/g' -e 's/targetarch/i486/g' ${D}/opt/lsb-test/packages_list + sed -i -e 's/targetarch/x86/g' ${D}/opt/lsb-test/session + fi + if [ "${TARGET_ARCH}" = "x86_64" ];then + sed -i -e 's/lsbarch/amd64/g' -e 's/targetarch/x86_64/g' ${D}/opt/lsb-test/packages_list + sed -i -e 's/targetarch/x86-64/g' ${D}/opt/lsb-test/session + fi + if [ "${TARGET_ARCH}" = "powerpc" ];then + sed -i -e 's/lsbarch/ppc32/g' -e 's/targetarch/ppc/g' ${D}/opt/lsb-test/packages_list + sed -i -e 's/targetarch/PPC32/g' ${D}/opt/lsb-test/session + fi + + # For a ppc64 target. the default userspace is 32b. + # Therefore, only change the lsbarch and targetarch + # in the package_list when MLIB=lib64 is being used. + # Otherwise, by default, the ppc32 LSB packages + # will be downloaded by LSB_Test.sh + if [ "${TARGET_ARCH}" = "powerpc64" ];then + if [ "${PN}" != "${BPN}" ];then + sed -i -e 's/lsbarch/ppc64/g' -e 's/targetarch/ppc64/g' ${D}/opt/lsb-test/packages_list + sed -i -e 's/targetarch/PPC64/g' ${D}/opt/lsb-test/session + fi + fi +} + +FILES_${PN} += "/opt/lsb-test/* \ + " diff --git a/poky/meta/recipes-extended/lsof/files/lsof-remove-host-information.patch b/poky/meta/recipes-extended/lsof/files/lsof-remove-host-information.patch new file mode 100644 index 000000000..b7d2323dc --- /dev/null +++ b/poky/meta/recipes-extended/lsof/files/lsof-remove-host-information.patch @@ -0,0 +1,76 @@ +Remove host information from version.h + +make lsof not include host information + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Li Wang <li.wang@windriver.com> +--- + dialects/linux/Makefile | 50 +++++++++-------------------------------------- + 1 file changed, 9 insertions(+), 41 deletions(-) + +diff --git a/dialects/linux/Makefile b/dialects/linux/Makefile +index 2bea108..792142b 100644 +--- a/dialects/linux/Makefile ++++ b/dialects/linux/Makefile +@@ -76,48 +76,16 @@ version.h: FRC + @echo Constructing version.h + @rm -f version.h + @echo '#define LSOF_BLDCMT "${LSOF_BLDCMT}"' > version.h; +- @echo '#define LSOF_CC "${CC}"' >> version.h +- @echo '#define LSOF_CCV "${CCV}"' >> version.h +- @echo '#define LSOF_CCDATE "'`date`'"' >> version.h +- @echo '#define LSOF_CCFLAGS "'`echo ${CFLAGS} | sed 's/\\\\(/\\(/g' | sed 's/\\\\)/\\)/g' | sed 's/"/\\\\"/g'`'"' >> version.h ++ @echo '#define LSOF_CC ""' >> version.h ++ @echo '#define LSOF_CCV ""' >> version.h ++ @echo '#define LSOF_CCDATE ""' >> version.h ++ @echo '#define LSOF_CCFLAGS ""' >> version.h + @echo '#define LSOF_CINFO "${CINFO}"' >> version.h +- @if [ "X${LSOF_HOST}" = "X" ]; then \ +- echo '#define LSOF_HOST "'`uname -n`'"' >> version.h; \ +- else \ +- if [ "${LSOF_HOST}" = "none" ]; then \ +- echo '#define LSOF_HOST ""' >> version.h; \ +- else \ +- echo '#define LSOF_HOST "${LSOF_HOST}"' >> version.h; \ +- fi \ +- fi +- @echo '#define LSOF_LDFLAGS "${CFGL}"' >> version.h +- @if [ "X${LSOF_LOGNAME}" = "X" ]; then \ +- echo '#define LSOF_LOGNAME "${LOGNAME}"' >> version.h; \ +- else \ +- if [ "${LSOF_LOGNAME}" = "none" ]; then \ +- echo '#define LSOF_LOGNAME ""' >> version.h; \ +- else \ +- echo '#define LSOF_LOGNAME "${LSOF_LOGNAME}"' >> version.h; \ +- fi; \ +- fi +- @if [ "X${LSOF_SYSINFO}" = "X" ]; then \ +- echo '#define LSOF_SYSINFO "'`uname -a`'"' >> version.h; \ +- else \ +- if [ "${LSOF_SYSINFO}" = "none" ]; then \ +- echo '#define LSOF_SYSINFO ""' >> version.h; \ +- else \ +- echo '#define LSOF_SYSINFO "${LSOF_SYSINFO}"' >> version.h; \ +- fi \ +- fi +- @if [ "X${LSOF_USER}" = "X" ]; then \ +- echo '#define LSOF_USER "${USER}"' >> version.h; \ +- else \ +- if [ "${LSOF_USER}" = "none" ]; then \ +- echo '#define LSOF_USER ""' >> version.h; \ +- else \ +- echo '#define LSOF_USER "${LSOF_USER}"' >> version.h; \ +- fi \ +- fi ++ @echo '#define LSOF_HOST ""' >> version.h; ++ @echo '#define LSOF_LDFLAGS ""' >> version.h ++ @echo '#define LSOF_LOGNAME ""' >> version.h; ++ @echo '#define LSOF_SYSINFO ""' >> version.h; ++ @echo '#define LSOF_USER ""' >> version.h; + @sed '/VN/s/.ds VN \(.*\)/#define LSOF_VERSION "\1"/' < version >> version.h + + FRC: +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/lsof/lsof_4.89.bb b/poky/meta/recipes-extended/lsof/lsof_4.89.bb new file mode 100644 index 000000000..14546db23 --- /dev/null +++ b/poky/meta/recipes-extended/lsof/lsof_4.89.bb @@ -0,0 +1,64 @@ +SUMMARY = "LiSt Open Files tool" +DESCRIPTION = "Lsof is a Unix-specific diagnostic tool. \ +Its name stands for LiSt Open Files, and it does just that." +HOMEPAGE = "http://people.freebsd.org/~abe/" +SECTION = "devel" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://00README;beginline=645;endline=679;md5=964df275d26429ba3b39dbb9f205172a" + +# Upstream lsof releases are hosted on an ftp server which times out download +# attempts from hosts for which it can not perform a DNS reverse-lookup (See: +# https://people.freebsd.org/~abe/ ). http://www.mirrorservice.org seems to be +# the most commonly used alternative. + +SRC_URI = "http://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${PV}.tar.bz2 \ + file://lsof-remove-host-information.patch \ + " + +SRC_URI[md5sum] = "1b9cd34f3fb86856a125abbf2be3a386" +SRC_URI[sha256sum] = "81ac2fc5fdc944793baf41a14002b6deb5a29096b387744e28f8c30a360a3718" + +LOCALSRC = "file://${WORKDIR}/lsof_${PV}/lsof_${PV}_src.tar" + +S = "${WORKDIR}/lsof_${PV}_src" + +python do_unpack () { + # temporarily change S for unpack + # of lsof_${PV} + s = d.getVar('S', False) + d.setVar('S', '${WORKDIR}/lsof_${PV}') + bb.build.exec_func('base_do_unpack', d) + # temporarily change SRC_URI for unpack + # of lsof_${PV}_src + src_uri = d.getVar('SRC_URI', False) + d.setVar('SRC_URI', '${LOCALSRC}') + d.setVar('S', s) + bb.build.exec_func('base_do_unpack', d) + d.setVar('SRC_URI', src_uri) +} + +export LSOF_INCLUDE = "${STAGING_INCDIR}" + +do_configure () { + export LSOF_AR="${AR} cr" + export LSOF_RANLIB="${RANLIB}" + if [ "x${GLIBCVERSION}" != "x" ]; then + LINUX_CLIB=`echo ${GLIBCVERSION} |sed -e 's,\.,,g'` + LINUX_CLIB="-DGLIBCV=${LINUX_CLIB}" + export LINUX_CLIB + fi + yes | ./Configure linux +} + +export I = "${STAGING_INCDIR}" +export L = "${STAGING_INCDIR}" + +do_compile () { + oe_runmake 'CC=${CC}' 'CFGL=${LDFLAGS} -L./lib -llsof' 'DEBUG=' 'INCL=${CFLAGS}' +} + +do_install () { + install -d ${D}${sbindir} ${D}${mandir}/man8 + install -m 0755 lsof ${D}${sbindir}/lsof + install -m 0644 lsof.8 ${D}${mandir}/man8/lsof.8 +} diff --git a/poky/meta/recipes-extended/ltp/ltp/0001-configure-Fix-default-value-of-without-numa-switch-i.patch b/poky/meta/recipes-extended/ltp/ltp/0001-configure-Fix-default-value-of-without-numa-switch-i.patch new file mode 100644 index 000000000..da62687d5 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0001-configure-Fix-default-value-of-without-numa-switch-i.patch @@ -0,0 +1,31 @@ +From 4ace68a6ba501907a0741dba5f5f155e06a74c35 Mon Sep 17 00:00:00 2001 +From: Petr Vorel <pvorel@suse.cz> +Date: Wed, 7 Feb 2018 11:09:49 +0100 +Subject: [PATCH] configure: Fix default value of --without-numa switch in help + +The default value is no. + +Fixes: 39a85a1f1 ("configure: add knob to control numa support") + +Signed-off-by: Petr Vorel <pvorel@suse.cz> +Upstream-Status: Accepted +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index b39a31d..d66ea00 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -86,7 +86,7 @@ fi + # Numa + AC_ARG_WITH([numa], + AC_HELP_STRING([--without-numa], +- [without numa support (default=yes)]), ++ [without numa support (default=no)]), + [with_numa=no], + [with_numa=yes] + ) +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0001-configure-add-knob-to-control-numa-support.patch b/poky/meta/recipes-extended/ltp/ltp/0001-configure-add-knob-to-control-numa-support.patch new file mode 100644 index 000000000..8aaa287b7 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0001-configure-add-knob-to-control-numa-support.patch @@ -0,0 +1,50 @@ +From 39a85a1f1e6624f554215ba4b6843d3689a8415e Mon Sep 17 00:00:00 2001 +From: Anders Roxell <anders.roxell@linaro.org> +Date: Mon, 5 Feb 2018 11:56:04 +0100 +Subject: [PATCH] configure: add knob to control numa support + +Allow to disable numa from the top level. + +Based on patch: +http://cgit.openembedded.org/openembedded-core/commit/meta/recipes-extended/ltp?id=4c7873552e13dfdba96afca7562c398d2966ca71 + +Reported-by: Roy Li <rongqing.li@windriver.com> +Signed-off-by: Anders Roxell <anders.roxell@linaro.org> +Signed-off-by: Petr Vorel <pvorel@suse.cz> +Upstream-Status: Accepted +--- + configure.ac | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 5c8d4ea..b39a31d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -83,6 +83,14 @@ else + AC_SUBST([WITH_EXPECT],["no"]) + fi + ++# Numa ++AC_ARG_WITH([numa], ++ AC_HELP_STRING([--without-numa], ++ [without numa support (default=yes)]), ++ [with_numa=no], ++ [with_numa=yes] ++) ++ + # Perl + AC_ARG_WITH([perl], + [AC_HELP_STRING([--with-perl], +@@ -157,7 +165,9 @@ LTP_CHECK_SELINUX + LTP_CHECK_SIGNAL + LTP_CHECK_SYSCALL_EVENTFD + LTP_CHECK_SYSCALL_MODIFY_LDT ++if test "x$with_numa" = xyes; then + LTP_CHECK_SYSCALL_NUMA ++fi + LTP_CHECK_SYSCALL_QUOTACTL + LTP_CHECK_SYSCALL_SIGNALFD + LTP_CHECK_SYSCALL_UNSHARE +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch b/poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch new file mode 100644 index 000000000..5cf1e05f7 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch @@ -0,0 +1,46 @@ +From b193011da301b3d944e8fddcf4817513c31c5b88 Mon Sep 17 00:00:00 2001 +From: Fathi Boudra <fathi.boudra@linaro.org> +Date: Thu, 7 Jan 2016 17:36:19 +0000 +Subject: [PATCH 03/32] Add knob to control tirpc support + +allow to disable tirpc. Helps to disable it at top level for eg. musl it +does not yet work. + +Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org> +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending +--- + configure.ac | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/configure.ac b/configure.ac +index cc50397..9e2936b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -98,6 +98,13 @@ if test "x$with_python" = xyes; then + else + AC_SUBST([WITH_PYTHON],["no"]) + fi ++ ++# TI RPC ++AC_ARG_WITH([tirpc], ++ AC_HELP_STRING([--without-tirpc], ++ [without libtirpc support]), ++ [],[with_tirpc=yes], ++) + # END tools knobs + + # Testsuites knobs +@@ -169,7 +176,9 @@ LTP_CHECK_RENAMEAT2 + LTP_CHECK_FALLOCATE + LTP_CHECK_SYSCALL_FCNTL + LTP_CHECK_SYSCALL_PERF_EVENT_OPEN ++if test "x$with_tirpc" = xyes; then + LTP_CHECK_TIRPC ++fi + LTP_CHECK_TEE + LTP_CHECK_SPLICE + LTP_CHECK_VMSPLICE +-- +2.7.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch b/poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch new file mode 100644 index 000000000..84ab37ea3 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch @@ -0,0 +1,146 @@ +From 53acddddf1b324e06af886ee4639b774e5c8c8bc Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 7 Jan 2016 18:19:03 +0000 +Subject: [PATCH 04/32] build: Add option to select libc implementation + +There are more than glibc for C library implementation available on +linux now a days, uclibc cloaked like glibc but musl e.g. is very +different and does not implement all GNU extentions + +Disable tests specifically not building _yet_ on musl based systems + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending +--- + Makefile | 5 +++++ + testcases/kernel/Makefile | 5 ++++- + testcases/kernel/sched/Makefile | 4 +++- + testcases/kernel/syscalls/Makefile | 5 +++++ + testcases/network/nfsv4/acl/Makefile | 4 ++++ + testcases/network/rpc/basic_tests/Makefile | 5 +++++ + testcases/realtime/func/pi-tests/Makefile | 4 ++++ + testcases/realtime/stress/pi-tests/Makefile | 5 +++++ + 8 files changed, 35 insertions(+), 2 deletions(-) + +Index: git/Makefile +=================================================================== +--- git.orig/Makefile ++++ git/Makefile +@@ -49,6 +49,11 @@ SKIP_IDCHECK ?= 0 + UCLINUX ?= 0 + export UCLINUX + ++# System C library implementation (glibc,uclibc,musl etc.) ++# default to glibc if not set ++LIBC ?= glibc ++export LIBC ++ + # CLEAN_TARGETS: Targets which exist solely in clean. + # COMMON_TARGETS: Targets which exist in all, clean, and install. + # INSTALL_TARGETS: Targets which exist in clean and install (contains +Index: git/testcases/kernel/Makefile +=================================================================== +--- git.orig/testcases/kernel/Makefile ++++ git/testcases/kernel/Makefile +@@ -48,13 +48,16 @@ SUBDIRS += connectors \ + logging \ + mem \ + numa \ +- pty \ + sched \ + security \ + timers \ + tracing \ + module \ + ++ifneq ($(LIBC),musl) ++SUBDIRS += pty ++endif ++ + ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes) + SUBDIRS += power_management + endif +Index: git/testcases/kernel/sched/Makefile +=================================================================== +--- git.orig/testcases/kernel/sched/Makefile ++++ git/testcases/kernel/sched/Makefile +@@ -23,5 +23,7 @@ + top_srcdir ?= ../../.. + + include $(top_srcdir)/include/mk/env_pre.mk +- ++ifeq ($(LIBC),musl) ++ FILTER_OUT_DIRS += process_stress ++endif + include $(top_srcdir)/include/mk/generic_trunk_target.mk +Index: git/testcases/kernel/syscalls/Makefile +=================================================================== +--- git.orig/testcases/kernel/syscalls/Makefile ++++ git/testcases/kernel/syscalls/Makefile +@@ -28,6 +28,11 @@ ifeq ($(UCLINUX),1) + FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \ + mincore mprotect nftw profil remap_file_pages sbrk + endif ++ifeq ($(LIBC),musl) ++FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl mallopt profil \ ++ rt_sigsuspend setdomainname sethostname sigsuspend \ ++ ustat ++endif + + ifeq ($(UCLIBC),1) + FILTER_OUT_DIRS += profil +Index: git/testcases/network/nfsv4/acl/Makefile +=================================================================== +--- git.orig/testcases/network/nfsv4/acl/Makefile ++++ git/testcases/network/nfsv4/acl/Makefile +@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre + + LDLIBS += $(ACL_LIBS) + ++ifeq ($(LIBC),musl) ++FILTER_OUT_MAKE_TARGETS := acl1 ++endif ++ + include $(top_srcdir)/include/mk/generic_leaf_target.mk +Index: git/testcases/network/rpc/basic_tests/Makefile +=================================================================== +--- git.orig/testcases/network/rpc/basic_tests/Makefile ++++ git/testcases/network/rpc/basic_tests/Makefile +@@ -23,4 +23,9 @@ + top_srcdir ?= ../../../.. + + include $(top_srcdir)/include/mk/env_pre.mk ++ ++ifeq ($(LIBC),musl) ++FILTER_OUT_DIRS += rpc01 ++endif ++ + include $(top_srcdir)/include/mk/generic_trunk_target.mk +Index: git/testcases/realtime/func/pi-tests/Makefile +=================================================================== +--- git.orig/testcases/realtime/func/pi-tests/Makefile ++++ git/testcases/realtime/func/pi-tests/Makefile +@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre + include $(abs_srcdir)/../../config.mk + + MAKE_TARGETS := testpi-0 testpi-1 testpi-2 testpi-4 testpi-5 testpi-6 testpi-7 sbrk_mutex ++ifeq ($(LIBC),musl) ++FILTER_OUT_MAKE_TARGETS := testpi-5 testpi-6 sbrk_mutex ++endif ++ + + include $(top_srcdir)/include/mk/generic_leaf_target.mk +Index: git/testcases/realtime/stress/pi-tests/Makefile +=================================================================== +--- git.orig/testcases/realtime/stress/pi-tests/Makefile ++++ git/testcases/realtime/stress/pi-tests/Makefile +@@ -24,4 +24,9 @@ top_srcdir ?= ../../../.. + + include $(top_srcdir)/include/mk/env_pre.mk + include $(abs_srcdir)/../../config.mk ++ ++ifeq ($(LIBC),musl) ++FILTER_OUT_MAKE_TARGETS := testpi-3 ++endif ++ + include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch b/poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch new file mode 100644 index 000000000..b9390e2c8 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch @@ -0,0 +1,46 @@ +From 6e3058521b50d91d4b0569c4d491c5af5ff798b2 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 7 Jan 2016 18:22:38 +0000 +Subject: [PATCH 05/32] kernel/controllers: Link with libfts explicitly on musl + +musl does not implement fts like glibc and therefore it depends on +external implementation for all fts APIs + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending +--- + testcases/kernel/controllers/Makefile.inc | 3 +++ + testcases/kernel/controllers/cpuset/Makefile.inc | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc +index b106283..ef5fc0c 100644 +--- a/testcases/kernel/controllers/Makefile.inc ++++ b/testcases/kernel/controllers/Makefile.inc +@@ -36,6 +36,9 @@ MAKE_DEPS := $(LIB) + CPPFLAGS += -I$(abs_srcdir)/../$(LIBDIR) + + LDFLAGS += -L$(abs_builddir)/../$(LIBDIR) ++ifeq ($(LIBC),musl) ++LDLIBS += -lfts ++endif + + INSTALL_TARGETS ?= *.sh + +diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc +index 9e002f4..e0fcb9c 100644 +--- a/testcases/kernel/controllers/cpuset/Makefile.inc ++++ b/testcases/kernel/controllers/cpuset/Makefile.inc +@@ -42,6 +42,9 @@ MAKE_DEPS := $(LIBCONTROLLERS) $(LIBCPUSET) + LDFLAGS += -L$(abs_builddir)/$(LIBCPUSET_DIR) -L$(abs_builddir)/$(LIBCONTROLLERS_DIR) + + LDLIBS += -lcpu_set -lcontrollers -lltp ++ifeq ($(LIBC),musl) ++LDLIBS += -lfts ++endif + + INSTALL_TARGETS ?= *.sh + +-- +2.7.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch b/poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch new file mode 100644 index 000000000..2f4ca6375 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch @@ -0,0 +1,31 @@ +From d1a27570457fb6e1d6bafe81bfa0f3507b137e32 Mon Sep 17 00:00:00 2001 +From: Dengke Du <dengke.du@windriver.com> +Date: Thu, 9 Feb 2017 18:20:58 +0800 +Subject: [PATCH] fix __WORDSIZE undeclared when building with musl + +fix __WORDSIZE undeclared when building with musl. + +Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/177] + +Signed-off-by: Dengke Du <dengke.du@windriver.com> +--- + include/old/test.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/include/old/test.h b/include/old/test.h +index b36764d83..cc6f1b551 100644 +--- a/include/old/test.h ++++ b/include/old/test.h +@@ -44,6 +44,9 @@ + #include <string.h> + #include <stdlib.h> + #include <stdint.h> ++#ifndef __GLIBC__ ++#include <bits/reg.h> ++#endif + + #include "usctest.h" + +-- +2.11.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch new file mode 100644 index 000000000..e325ce4e4 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch @@ -0,0 +1,283 @@ +From a3cbee31daae2466bc8dcac36b33a01352693346 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 7 Jan 2016 19:40:08 +0000 +Subject: [PATCH 01/26] Check if __GLIBC_PREREQ is defined before using it + +__GLIBC_PREREQ is specific to glibc so it should be checked if it is +defined or not. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending +--- + testcases/kernel/syscalls/accept4/accept4_01.c | 9 ++++- + testcases/kernel/syscalls/getcpu/getcpu01.c | 40 +++++++++++++++++++++- + .../sched_getaffinity/sched_getaffinity01.c | 26 ++++++++++++++ + 3 files changed, 73 insertions(+), 2 deletions(-) + +diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c +index 6072bfa..2b090cb 100644 +--- a/testcases/kernel/syscalls/accept4/accept4_01.c ++++ b/testcases/kernel/syscalls/accept4/accept4_01.c +@@ -64,6 +64,7 @@ static void cleanup(void) + tst_rmdir(); + } + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if !(__GLIBC_PREREQ(2, 10)) + static int + accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) +@@ -82,7 +83,6 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) + } + tst_resm(TINFO, "\n"); + #endif +- + #if USE_SOCKETCALL + long args[6]; + +@@ -97,6 +97,7 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) + #endif + } + #endif ++#endif + + static void + do_test(int lfd, struct sockaddr_in *conn_addr, +@@ -119,9 +120,15 @@ do_test(int lfd, struct sockaddr_in *conn_addr, + die("Connect Error"); + + addrlen = sizeof(struct sockaddr_in); ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if !(__GLIBC_PREREQ(2, 10)) + acceptfd = accept4_01(lfd, (struct sockaddr *)&claddr, &addrlen, + closeonexec_flag | nonblock_flag); ++ ++#else ++ acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen, ++ closeonexec_flag | nonblock_flag); ++#endif + #else + acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen, + closeonexec_flag | nonblock_flag); +diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c +index c927512..921b107 100644 +--- a/testcases/kernel/syscalls/getcpu/getcpu01.c ++++ b/testcases/kernel/syscalls/getcpu/getcpu01.c +@@ -62,6 +62,7 @@ + #include <dirent.h> + + #if defined(__i386__) || defined(__x86_64__) ++#if defined(__GLIBC__) + #if __GLIBC_PREREQ(2,6) + #if defined(__x86_64__) + #include <utmpx.h> +@@ -75,10 +76,17 @@ int sys_support = 0; + #else + int sys_support = 0; + #endif ++#else ++int sys_support = 0; ++#endif + ++#if defined(__GLIBC__) + #if !(__GLIBC_PREREQ(2, 7)) + #define CPU_FREE(ptr) free(ptr) + #endif ++#else ++#define CPU_FREE(ptr) free(ptr) ++#endif + + void cleanup(void); + void setup(void); +@@ -164,7 +172,11 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id, + { + #if defined(__i386__) + return syscall(318, cpu_id, node_id, cache_struct); +-#elif __GLIBC_PREREQ(2,6) ++#elif defined(__GLIBC__) ++#if __GLIBC_PREREQ(2,6) ++ *cpu_id = sched_getcpu(); ++#endif ++#else + *cpu_id = sched_getcpu(); + #endif + return 0; +@@ -191,15 +204,20 @@ unsigned int set_cpu_affinity(void) + cpu_set_t *set; + size_t size; + int nrcpus = 1024; ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + realloc: + set = CPU_ALLOC(nrcpus); + #else + set = malloc(sizeof(cpu_set_t)); + #endif ++#else ++ set = malloc(sizeof(cpu_set_t)); ++#endif + if (set == NULL) { + tst_brkm(TFAIL, NULL, "CPU_ALLOC:errno:%d", errno); + } ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + size = CPU_ALLOC_SIZE(nrcpus); + CPU_ZERO_S(size, set); +@@ -207,8 +225,13 @@ realloc: + size = sizeof(cpu_set_t); + CPU_ZERO(set); + #endif ++#else ++ size = sizeof(cpu_set_t); ++ CPU_ZERO(set); ++#endif + if (sched_getaffinity(0, size, set) < 0) { + CPU_FREE(set); ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + if (errno == EINVAL && nrcpus < (1024 << 8)) { + nrcpus = nrcpus << 2; +@@ -220,10 +243,17 @@ realloc: + "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)"); + else + #endif ++#else ++ if (errno == EINVAL) ++ tst_resm(TFAIL, ++ "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)"); ++ else ++#endif + tst_resm(TFAIL, "sched_getaffinity:errno:%d", errno); + tst_exit(); + } + cpu_max = max_cpuid(size, set); ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + CPU_ZERO_S(size, set); + CPU_SET_S(cpu_max, size, set); +@@ -231,6 +261,10 @@ realloc: + CPU_ZERO(set); + CPU_SET(cpu_max, set); + #endif ++#else ++ CPU_ZERO(set); ++ CPU_SET(cpu_max, set); ++#endif + if (sched_setaffinity(0, size, set) < 0) { + CPU_FREE(set); + tst_brkm(TFAIL, NULL, "sched_setaffinity:errno:%d", errno); +@@ -247,11 +281,15 @@ unsigned int max_cpuid(size_t size, cpu_set_t * set) + { + unsigned int index, max = 0; + for (index = 0; index < size * BITS_PER_BYTE; index++) ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + if (CPU_ISSET_S(index, size, set)) + #else + if (CPU_ISSET(index, set)) + #endif ++#else ++ if (CPU_ISSET(index, set)) ++#endif + max = index; + return max; + } +diff --git a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c +index 9d6a81a..4ed13b2 100644 +--- a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c ++++ b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c +@@ -66,9 +66,11 @@ do { \ + tst_resm((TEST_RETURN == -1 ? TPASS : TFAIL) | TTERRNO, #t); \ + } while (0) + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if !(__GLIBC_PREREQ(2, 7)) + #define CPU_FREE(ptr) free(ptr) + #endif ++#endif + + int main(int ac, char **av) + { +@@ -95,14 +97,19 @@ static void do_test(void) + pid_t unused_pid; + unsigned len; + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + realloc: + mask = CPU_ALLOC(nrcpus); + #else + mask = malloc(sizeof(cpu_set_t)); + #endif ++#else ++ mask = malloc(sizeof(cpu_set_t)); ++#endif + if (mask == NULL) + tst_brkm(TFAIL | TTERRNO, cleanup, "fail to get enough memory"); ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + len = CPU_ALLOC_SIZE(nrcpus); + CPU_ZERO_S(len, mask); +@@ -110,10 +117,15 @@ realloc: + len = sizeof(cpu_set_t); + CPU_ZERO(mask); + #endif ++#else ++ len = sizeof(cpu_set_t); ++ CPU_ZERO(mask); ++#endif + /* positive test */ + TEST(sched_getaffinity(0, len, mask)); + if (TEST_RETURN == -1) { + CPU_FREE(mask); ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + if (errno == EINVAL && nrcpus < (1024 << 8)) { + nrcpus = nrcpus << 2; +@@ -125,17 +137,27 @@ realloc: + "newer glibc(>= 2.7)"); + else + #endif ++#else ++ if (errno == EINVAL) ++ tst_resm(TFAIL, "NR_CPUS > 1024, we'd better use a " ++ "newer glibc(>= 2.7)"); ++ else ++#endif + tst_resm(TFAIL | TTERRNO, "fail to get cpu affinity"); + cleanup(); + } else { + tst_resm(TINFO, "cpusetsize is %d", len); + tst_resm(TINFO, "mask.__bits[0] = %lu ", mask->__bits[0]); + for (i = 0; i < num; i++) { ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + TEST(CPU_ISSET_S(i, len, mask)); + #else + TEST(CPU_ISSET(i, mask)); + #endif ++#else ++ TEST(CPU_ISSET(i, mask)); ++#endif + if (TEST_RETURN != -1) + tst_resm(TPASS, "sched_getaffinity() succeed, " + "this process %d is running " +@@ -143,11 +165,15 @@ realloc: + } + } + ++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) + #if __GLIBC_PREREQ(2, 7) + CPU_ZERO_S(len, mask); + #else + CPU_ZERO(mask); + #endif ++#else ++ CPU_ZERO(mask); ++#endif + /* negative tests */ + QUICK_TEST(sched_getaffinity(0, len, (cpu_set_t *) - 1)); + QUICK_TEST(sched_getaffinity(0, 0, mask)); +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch b/poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch new file mode 100644 index 000000000..dd7d28319 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch @@ -0,0 +1,36 @@ +From bf5dd2932200e0199a38f3028d3bef2253f32e38 Mon Sep 17 00:00:00 2001 +From: Dengke Du <dengke.du@windriver.com> +Date: Thu, 9 Feb 2017 17:17:37 +0800 +Subject: [PATCH] fix redefinition of 'struct msgbuf' error building with musl + +When building with musl the file "sys/msg.h" already contain 'struct msgbuf' + +Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/177] + +Signed-off-by: Dengke Du <dengke.du@windriver.com> +--- + testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c +index a757c0d18..e023114d2 100644 +--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c ++++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c +@@ -47,11 +47,13 @@ const char *TCID = "msgrcv08"; + const int TST_TOTAL = 1; + + #if __WORDSIZE == 32 +- ++#ifdef __GLIBC__ + struct msgbuf { + long mtype; /* message type, must be > 0 */ + char mtext[16]; /* message data */ + }; ++#else ++#endif + + static void msr(int msqid) + { +-- +2.11.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch b/poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch new file mode 100644 index 000000000..b9fce880f --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch @@ -0,0 +1,75 @@ +From 0130f4146ced320aadb01b22e36b13d269a8ebba Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 7 Jan 2016 19:48:14 +0000 +Subject: [PATCH 10/32] replace __BEGIN_DECLS and __END_DECLS + +They are not portable across libc implementations +therefore replace them with expanded macros + +Include <asm-generic/types.h> to get __s32 definitions +its not a generally available typedef + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending +--- + testcases/kernel/syscalls/epoll2/include/epoll.h | 8 ++++++-- + utils/sctp/include/netinet/sctp.h | 9 +++++++-- + 2 files changed, 13 insertions(+), 4 deletions(-) + +diff --git a/testcases/kernel/syscalls/epoll2/include/epoll.h b/testcases/kernel/syscalls/epoll2/include/epoll.h +index be599c7..8cc5e7e 100644 +--- a/testcases/kernel/syscalls/epoll2/include/epoll.h ++++ b/testcases/kernel/syscalls/epoll2/include/epoll.h +@@ -85,7 +85,9 @@ struct epoll_event + } EPOLL_PACKED; + + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + + /* Creates an epoll instance. Returns an fd for the new instance. + The "size" parameter is a hint specifying the number of file +@@ -114,6 +116,8 @@ extern int epoll_ctl (int __epfd, int __op, int __fd, + extern int epoll_wait (int __epfd, struct epoll_event *__events, + int __maxevents, int __timeout) __THROW; + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* sys/epoll.h */ +diff --git a/utils/sctp/include/netinet/sctp.h b/utils/sctp/include/netinet/sctp.h +index 51f5bfb..c61aef3 100644 +--- a/utils/sctp/include/netinet/sctp.h ++++ b/utils/sctp/include/netinet/sctp.h +@@ -35,9 +35,12 @@ + + #include <stdint.h> + #include <linux/types.h> ++#include <asm-generic/types.h> + #include <sys/socket.h> + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + + typedef __s32 sctp_assoc_t; + +@@ -862,6 +865,8 @@ int sctp_recvmsg(int s, void *msg, size_t len, struct sockaddr *from, + /* Return the address length for an address family. */ + int sctp_getaddrlen(sa_family_t family); + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* __linux_sctp_h__ */ +-- +2.7.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch b/poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch new file mode 100644 index 000000000..a79763d00 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch @@ -0,0 +1,33 @@ +From f42b060e80c9f40627c712d4d56d45221bd7d9fa Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 8 Jan 2016 06:51:20 +0000 +Subject: [PATCH 18/32] guard mallocopt() with __GLIBC__ + +mallocopt is not available on non glibc implementations + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending +--- + utils/benchmark/ebizzy-0.3/ebizzy.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/utils/benchmark/ebizzy-0.3/ebizzy.c b/utils/benchmark/ebizzy-0.3/ebizzy.c +index 5bb8eff..934d951 100644 +--- a/utils/benchmark/ebizzy-0.3/ebizzy.c ++++ b/utils/benchmark/ebizzy-0.3/ebizzy.c +@@ -215,10 +215,10 @@ static void read_options(int argc, char *argv[]) + "\"never mmap\" option specified\n"); + usage(); + } +- ++#ifdef __GLIBC__ + if (never_mmap) + mallopt(M_MMAP_MAX, 0); +- ++#endif + if (chunk_size < record_size) { + fprintf(stderr, "Chunk size %u smaller than record size %u\n", + chunk_size, record_size); +-- +2.7.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch b/poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch new file mode 100644 index 000000000..7060a64b1 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch @@ -0,0 +1,50 @@ +From aa3568e6ac28f377e75ce16b11e3c7738a373e53 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 8 Jan 2016 06:57:04 +0000 +Subject: [PATCH 20/32] getdents: define getdents/getdents64 only for glibc + +getdents/getdents64 are implemented in musl and when we define static +functions with same name, it errors out. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending +--- + testcases/kernel/syscalls/getdents/getdents.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h +index abea655..db63d89 100644 +--- a/testcases/kernel/syscalls/getdents/getdents.h ++++ b/testcases/kernel/syscalls/getdents/getdents.h +@@ -34,12 +34,13 @@ struct linux_dirent { + char d_name[]; + }; + ++#ifdef __GLIBC__ + static inline int + getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int size) + { + return ltp_syscall(__NR_getdents, fd, dirp, size); + } +- ++#endif + struct linux_dirent64 { + uint64_t d_ino; + int64_t d_off; +@@ -48,10 +49,11 @@ struct linux_dirent64 { + char d_name[]; + }; + ++#ifdef __GLIBC__ + static inline int + getdents64(unsigned int fd, struct linux_dirent64 *dirp64, unsigned int size) + { + return ltp_syscall(__NR_getdents64, fd, dirp64, size); + } +- ++#endif + #endif /* GETDENTS_H */ +-- +2.7.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch b/poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch new file mode 100644 index 000000000..462976da4 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch @@ -0,0 +1,70 @@ +From b216435bb362df10c45f544b78d8c884eaa901fd Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 8 Jan 2016 07:01:02 +0000 +Subject: [PATCH 21/32] Define _GNU_SOURCE for MREMAP_MAYMOVE definition + +musl guards MREMAP_MAYMOVE with _GNU_SOURCE unlike glibc which uses +__USE_GNU + +Fixes errors like +error: 'MREMAP_MAYMOVE' undeclared (first use in this function) + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending +--- + testcases/kernel/syscalls/mremap/mremap01.c | 4 +++- + testcases/kernel/syscalls/mremap/mremap02.c | 2 ++ + testcases/kernel/syscalls/mremap/mremap03.c | 2 ++ + 3 files changed, 7 insertions(+), 1 deletion(-) + +Index: git/testcases/kernel/syscalls/mremap/mremap01.c +=================================================================== +--- git.orig/testcases/kernel/syscalls/mremap/mremap01.c ++++ git/testcases/kernel/syscalls/mremap/mremap01.c +@@ -76,10 +76,12 @@ + */ + #include <unistd.h> + #include <errno.h> ++#include <fcntl.h> ++#define _GNU_SOURCE + #define __USE_GNU + #include <sys/mman.h> + #undef __USE_GNU +-#include <fcntl.h> ++#undef _GNU_SOURCE + + #include "test.h" + #include "safe_macros.h" +Index: git/testcases/kernel/syscalls/mremap/mremap02.c +=================================================================== +--- git.orig/testcases/kernel/syscalls/mremap/mremap02.c ++++ git/testcases/kernel/syscalls/mremap/mremap02.c +@@ -75,9 +75,11 @@ + #include <errno.h> + #include <unistd.h> + #include <fcntl.h> ++#define _GNU_SOURCE + #define __USE_GNU + #include <sys/mman.h> + #undef __USE_GNU ++#undef _GNU_SOURCE + + #include "test.h" + +Index: git/testcases/kernel/syscalls/mremap/mremap03.c +=================================================================== +--- git.orig/testcases/kernel/syscalls/mremap/mremap03.c ++++ git/testcases/kernel/syscalls/mremap/mremap03.c +@@ -76,9 +76,11 @@ + #include <errno.h> + #include <unistd.h> + #include <fcntl.h> ++#define _GNU_SOURCE + #define __USE_GNU + #include <sys/mman.h> + #undef __USE_GNU ++#undef _GNU_SOURCE + + #include "test.h" + diff --git a/poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch b/poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch new file mode 100644 index 000000000..529f4ed30 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch @@ -0,0 +1,50 @@ +From 560347f77236616a635b4a997a0596b8da4d0799 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 8 Jan 2016 07:08:25 +0000 +Subject: [PATCH 23/32] ptrace: Use int instead of enum __ptrace_request + +__ptrace_request is only available with glibc + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending +--- + testcases/kernel/syscalls/ptrace/ptrace03.c | 4 ++++ + testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/testcases/kernel/syscalls/ptrace/ptrace03.c b/testcases/kernel/syscalls/ptrace/ptrace03.c +index a4028fc..f1880cd 100644 +--- a/testcases/kernel/syscalls/ptrace/ptrace03.c ++++ b/testcases/kernel/syscalls/ptrace/ptrace03.c +@@ -102,7 +102,11 @@ static pid_t unused_pid; + static pid_t zero_pid; + + struct test_case_t { ++#ifdef __GLIBC__ + enum __ptrace_request request; ++#else ++ int request; ++#endif + pid_t *pid; + int exp_errno; + } test_cases[] = { +diff --git a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h +index ae538e9..85aa89d 100644 +--- a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h ++++ b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h +@@ -130,7 +130,11 @@ static char *strings[] = { + SPT(KILL) + SPT(SINGLESTEP) + }; ++#ifdef __GLIBC__ + static inline char *strptrace(enum __ptrace_request request) ++#else ++static inline char *strptrace(int request) ++#endif + { + return strings[request]; + } +-- +2.7.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch b/poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch new file mode 100644 index 000000000..03aa45df8 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch @@ -0,0 +1,70 @@ +From e01e9862c248dc90a8ec6f2d06f8469d7a50cd8e Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 8 Jan 2016 07:14:58 +0000 +Subject: [PATCH 24/32] rt_sigaction/rt_sigprocmark: Define _GNU_SOURCE + +Fixes musl build failure e.g. +error: 'SA_NOMASK' undeclared here (not in a function) + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending +--- + testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c | 1 + + testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c | 2 +- + testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c | 1 + + testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c | 1 + + 4 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c +index 5cf89cc..bdcb91a 100644 +--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c ++++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c +@@ -28,6 +28,7 @@ + /* sigset_t type. */ + /******************************************************************************/ + ++#define _GNU_SOURCE + #include <stdio.h> + #include <stdlib.h> + #include <unistd.h> +diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c +index a1da743..8a27a0f 100644 +--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c ++++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c +@@ -23,7 +23,7 @@ + /* Description: This tests the rt_sigaction() syscall */ + /* rt_sigaction Expected EFAULT error check */ + /******************************************************************************/ +- ++#define _GNU_SOURCE + #include <stdio.h> + #include <stdlib.h> + #include <unistd.h> +diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c +index 175d220..e7627cd 100644 +--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c ++++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c +@@ -24,6 +24,7 @@ + /* rt_sigaction Expected EINVAL error check */ + /******************************************************************************/ + ++#define _GNU_SOURCE + #include <stdio.h> + #include <stdlib.h> + #include <unistd.h> +diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c +index 74e5a61..75c57fc 100644 +--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c ++++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c +@@ -39,6 +39,7 @@ + /* sigsetsize should indicate the size of a sigset_t type. */ + /******************************************************************************/ + ++#define _GNU_SOURCE + #include <stdio.h> + #include <signal.h> + #include <errno.h> +-- +2.7.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch b/poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch new file mode 100644 index 000000000..f65fad12d --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch @@ -0,0 +1,31 @@ +From 0133a2b29d6f48d8e2bba6a3be581cdfa91311a6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 8 Jan 2016 07:21:05 +0000 +Subject: [PATCH 26/32] crash01: Define _GNU_SOURCE + +Fixes musl build errors like +error: 'SA_NOMASK' undeclared (first use in this function) + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending +--- + testcases/misc/crash/crash01.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testcases/misc/crash/crash01.c b/testcases/misc/crash/crash01.c +index 0574521..08a02e7 100644 +--- a/testcases/misc/crash/crash01.c ++++ b/testcases/misc/crash/crash01.c +@@ -49,7 +49,7 @@ stress test at the same time you run other tests, like a multi-user + benchmark. + + */ +- ++#define _GNU_SOURCE + #include <stdio.h> + #include <stdlib.h> + #include <string.h> +-- +2.7.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch b/poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch new file mode 100644 index 000000000..c730d46e6 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch @@ -0,0 +1,48 @@ +From 94557fb7e1293c61145c959b8c5ffecf4a2b1069 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 8 Jan 2016 07:24:44 +0000 +Subject: [PATCH 28/32] rt_sigaction.h: Use sighandler_t instead of + __sighandler_t + +When _GNU_SOURCE is used then both typedefs are same and using +sighandler_t makes it work on musl too + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending +--- + include/lapi/rt_sigaction.h | 2 +- + testcases/kernel/syscalls/rt_sigsuspend/Makefile | 3 +++ + 2 files changed, 4 insertions(+), 1 deletion(-) + +Index: git/include/lapi/rt_sigaction.h +=================================================================== +--- git.orig/include/lapi/rt_sigaction.h ++++ git/include/lapi/rt_sigaction.h +@@ -36,12 +36,12 @@ + #if defined(__mips__) + struct kernel_sigaction { + unsigned int sa_flags; +- __sighandler_t k_sa_handler; ++ sighandler_t k_sa_handler; + sigset_t sa_mask; + }; + #else + struct kernel_sigaction { +- __sighandler_t k_sa_handler; ++ sighandler_t k_sa_handler; + unsigned long sa_flags; + void (*sa_restorer) (void); + sigset_t sa_mask; +Index: git/testcases/kernel/syscalls/rt_sigsuspend/Makefile +=================================================================== +--- git.orig/testcases/kernel/syscalls/rt_sigsuspend/Makefile ++++ git/testcases/kernel/syscalls/rt_sigsuspend/Makefile +@@ -19,4 +19,7 @@ + top_srcdir ?= ../../../.. + + include $(top_srcdir)/include/mk/testcases.mk ++ ++CFLAGS += -D_GNU_SOURCE ++ + include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch b/poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch new file mode 100644 index 000000000..c2ef899cc --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch @@ -0,0 +1,55 @@ +From 5a77e2bdc083f4f842a8ba7c2db1a7ac6e5f0664 Mon Sep 17 00:00:00 2001 +From: Dengke Du <dengke.du@windriver.com> +Date: Wed, 31 May 2017 21:26:05 -0400 +Subject: [PATCH] Add periodic output for long time test. + +This is needed in context of having scripts running ltp tests and +waiting with a timeout for the output of the tests. + +Signed-off-by: Tudor Florea <tudor.florea@enea.com> +Upstream-Status: Pending + +Signed-off-by: Dengke Du <dengke.du@windriver.com> +--- + .../kernel/controllers/memcg/stress/memcg_stress_test.sh | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +index af1a708..084e628 100755 +--- a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh ++++ b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh +@@ -37,7 +37,8 @@ if [ "x$(grep -w memory /proc/cgroups | cut -f4)" != "x1" ]; then + exit 0 + fi + +-RUN_TIME=$(( 15 * 60 )) ++ONE_MINUTE=60 ++RUN_TIME=15 + + cleanup() + { +@@ -62,7 +63,7 @@ do_mount() + # $1 - Number of cgroups + # $2 - Allocated how much memory in one process? in MB + # $3 - The interval to touch memory in a process +-# $4 - How long does this test run ? in second ++# $4 - How long does this test run ? in minutes + run_stress() + { + do_mount; +@@ -81,7 +82,11 @@ run_stress() + eval /bin/kill -s SIGUSR1 \$pid$i 2> /dev/null + done + +- sleep $4 ++ for i in $(seq 0 $(($4-1))) ++ do ++ eval echo "Started $i min ago. Still alive... " ++ sleep $ONE_MINUTE ++ done + + for i in $(seq 0 $(($1-1))) + do +-- +2.8.1 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch b/poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch new file mode 100644 index 000000000..71e32a5e5 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch @@ -0,0 +1,32 @@ +From f7c602b639db0d118e07d3fa7b6deead0be0c72b Mon Sep 17 00:00:00 2001 +From: Dengke Du <dengke.du@windriver.com> +Date: Wed, 8 Feb 2017 16:17:17 +0800 +Subject: [PATCH 3/5] Fix test_proc_kill hanging + +Sometimes the signal is delivered to memcg_process before the framework took +into consideration its pid entered in the tasks. Fixed by delaying the signal +send command. + +Signed-off-by: George Nita <george.nita@enea.com> +Signed-off-by: Dengke Du <dengke.du@windriver.com> + +Upstream-Status: Pending +--- + testcases/kernel/controllers/memcg/functional/memcg_lib.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh +index b785fe3..2918cc5 100755 +--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh ++++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh +@@ -283,6 +283,7 @@ test_proc_kill() + pid=$! + TST_CHECKPOINT_WAIT 0 + echo $pid > tasks ++ sleep 1 + + signal_memcg_process $pid $3 + +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch b/poky/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch new file mode 100644 index 000000000..04532be79 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch @@ -0,0 +1,41 @@ +From 672a56be14426eae44864673c6c2afca0ab89d46 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com> +Date: Fri, 13 May 2016 11:11:28 -0500 +Subject: [PATCH] testcases/network/nfsv4/acl/acl1.c: Security fix on string + printf +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes: + +acl1.c: In function 'test_acl_default': +acl1.c:317:2: error: format not a string literal and no format arguments +[-Werror=format-security] + printf(cmd); + +[YOCTO #9548] + +Signed-off-by: AnÃbal Limón <anibal.limon@linux.intel.com> + +Upstream-Status: Pending +--- + testcases/network/nfsv4/acl/acl1.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testcases/network/nfsv4/acl/acl1.c b/testcases/network/nfsv4/acl/acl1.c +index b8b67b4..7c7c506 100644 +--- a/testcases/network/nfsv4/acl/acl1.c ++++ b/testcases/network/nfsv4/acl/acl1.c +@@ -314,7 +314,7 @@ void test_acl_default(char *dir, acl_t acl) + char *cmd = malloc(256); + + strcpy(cmd, "chmod 7777 "); +- printf(cmd); ++ printf(cmd, NULL); + strcat(cmd, dir); + system(cmd); + acl2 = acl_get_file(path, ACL_TYPE_ACCESS); +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch b/poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch new file mode 100644 index 000000000..e7c927e11 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch @@ -0,0 +1,252 @@ +From 04da9478887e705ea38e4f097492da20e651686c Mon Sep 17 00:00:00 2001 +From: Guangwen Feng <fenggw-fnst@cn.fujitsu.com> +Date: Wed, 13 Sep 2017 15:48:42 +0800 +Subject: [PATCH] commands/ar01: Fix for test in deterministic mode + +If binutils was configured with --enable-deterministic-archives, +ar will run in deterministic mode by default, and use zero for +timestamps and uids/gids, which makes the test case abnormal. + +Fix this by add the "U" modifier when deterministic mode is default. + +Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com> +Signed-off-by: Fei Jie <feij.fnst@cn.fujitsu.com> + +Upstream-Status: Backport +[http://lists.linux.it/pipermail/ltp/2017-September/005668.html] + +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +--- + testcases/commands/ar/ar01 | 92 ++++++++++++++++++++++++++-------------------- + 1 file changed, 52 insertions(+), 40 deletions(-) + +diff --git a/testcases/commands/ar/ar01 b/testcases/commands/ar/ar01 +index ddab2e0..d688f76 100644 +--- a/testcases/commands/ar/ar01 ++++ b/testcases/commands/ar/ar01 +@@ -23,14 +23,26 @@ + # This is a basic ar command test. + # + TST_CNT=17 ++TST_SETUP=setup + TST_TESTFUNC=test + TST_NEEDS_TMPDIR=1 + . tst_test.sh + ++setup() ++{ ++ ar --help | grep "use zero for timestamps and uids/gids (default)" \ ++ >/dev/null ++ if [ $? -eq 0 ]; then ++ MOD="U" ++ else ++ MOD="" ++ fi ++} ++ + test1() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in +- ROD ar -ra file1.in lib.a $TST_DATAROOT/file2.in ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in ++ ROD ar -ra"$MOD" file1.in lib.a $TST_DATAROOT/file2.in + ROD ar -t lib.a \> ar.out + + printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp +@@ -47,9 +59,9 @@ test1() + + test2() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ +- $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in +- ROD ar -ma file1.in lib.a file4.in ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ ++ $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in ++ ROD ar -ma"$MOD" file1.in lib.a file4.in + ROD ar -t lib.a \> ar.out + + printf "file1.in\nfile4.in\nfile2.in\nfile3.in\n" > ar.exp +@@ -66,8 +78,8 @@ test2() + + test3() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in +- ROD ar -rb file3.in lib.a $TST_DATAROOT/file2.in ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in ++ ROD ar -rb"$MOD" file3.in lib.a $TST_DATAROOT/file2.in + ROD ar -t lib.a \> ar.out + + printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp +@@ -84,9 +96,9 @@ test3() + + test4() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ +- $TST_DATAROOT/file2.in +- ROD ar -mb file3.in lib.a file2.in ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ ++ $TST_DATAROOT/file2.in ++ ROD ar -mb"$MOD" file3.in lib.a file2.in + ROD ar -t lib.a \> ar.out + + printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp +@@ -103,7 +115,7 @@ test4() + + test5() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in \> ar.out ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out + + if [ -s ar.out ]; then + tst_res TFAIL "ar produced output unexpectedly (-c)" +@@ -117,7 +129,7 @@ test5() + + test6() + { +- ROD ar -qc lib.a $TST_DATAROOT/file1.in \> ar.out ++ ROD ar -qc"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out + + if [ -s ar.out ]; then + tst_res TFAIL "ar produced output unexpectedly (-qc)" +@@ -131,9 +143,9 @@ test6() + + test7() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ +- $TST_DATAROOT/file3.in +- ROD ar -d lib.a file1.in file2.in ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ ++ $TST_DATAROOT/file3.in ++ ROD ar -d"$MOD" lib.a file1.in file2.in + ROD ar -t lib.a \> ar.out + + printf "file3.in\n" > ar.exp +@@ -150,9 +162,9 @@ test7() + + test8() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ +- $TST_DATAROOT/file3.in +- ROD ar -d lib.a ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ ++ $TST_DATAROOT/file3.in ++ ROD ar -d"$MOD" lib.a + ROD ar -t lib.a \> ar.out + + printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp +@@ -169,8 +181,8 @@ test8() + + test9() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in +- ROD ar -ri file3.in lib.a $TST_DATAROOT/file2.in ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in ++ ROD ar -ri"$MOD" file3.in lib.a $TST_DATAROOT/file2.in + ROD ar -t lib.a \> ar.out + + printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp +@@ -187,9 +199,9 @@ test9() + + test10() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ +- $TST_DATAROOT/file2.in +- ROD ar -mi file3.in lib.a file2.in ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ ++ $TST_DATAROOT/file2.in ++ ROD ar -mi"$MOD" file3.in lib.a file2.in + ROD ar -t lib.a \> ar.out + + printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp +@@ -206,9 +218,9 @@ test10() + + test11() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ +- $TST_DATAROOT/file2.in +- ROD ar -m lib.a file3.in ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \ ++ $TST_DATAROOT/file2.in ++ ROD ar -m"$MOD" lib.a file3.in + ROD ar -t lib.a \> ar.out + + printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp +@@ -225,9 +237,9 @@ test11() + + test12() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ +- $TST_DATAROOT/file3.in +- ROD ar -p lib.a \> ar.out ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ ++ $TST_DATAROOT/file3.in ++ ROD ar -p"$MOD" lib.a \> ar.out + + printf "This is file one\nThis is file two\nThis is file three\n" > ar.exp + +@@ -244,9 +256,9 @@ test12() + test13() + { + +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ +- $TST_DATAROOT/file3.in +- ROD ar -q lib.a $TST_DATAROOT/file4.in ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ ++ $TST_DATAROOT/file3.in ++ ROD ar -q"$MOD" lib.a $TST_DATAROOT/file4.in + ROD ar -t lib.a \> ar.out + + printf "file1.in\nfile2.in\nfile3.in\nfile4.in\n" > ar.exp +@@ -264,14 +276,14 @@ test13() + test14() + { + ROD touch file0.in +- ROD ar -cr lib.a file0.in $TST_DATAROOT/file1.in ++ ROD ar -cr"$MOD" lib.a file0.in $TST_DATAROOT/file1.in + + file0_mtime1=$(ar -tv lib.a | grep file0.in) + file1_mtime1=$(ar -tv lib.a | grep file1.in) + + touch -c -t $(date --date='next day' +"%Y%m%d%H%M") file0.in + +- ROD ar -ru lib.a file0.in $TST_DATAROOT/file1.in ++ ROD ar -ru"$MOD" lib.a file0.in $TST_DATAROOT/file1.in + + file0_mtime2=$(ar -tv lib.a | grep file0.in) + file1_mtime2=$(ar -tv lib.a | grep file1.in) +@@ -293,7 +305,7 @@ test14() + + test15() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in + ROD ar -tv lib.a \> ar.out + + if grep -q '[rwx-]\{9\} [0-9].*/[0-9].*\s*[0-9].*.*file1.in' ar.out; then +@@ -308,9 +320,9 @@ test15() + + test16() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ +- $TST_DATAROOT/file3.in +- ROD ar -xv lib.a \> ar.out ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \ ++ $TST_DATAROOT/file3.in ++ ROD ar -xv"$MOD" lib.a \> ar.out + + printf "x - file1.in\nx - file2.in\nx - file3.in\n" > ar.exp + +@@ -332,8 +344,8 @@ test16() + + test17() + { +- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in +- ROD ar -xv lib.a file2.in \> ar.out ++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in ++ ROD ar -xv"$MOD" lib.a file2.in \> ar.out + + printf "x - file2.in\n" > ar.exp + +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch b/poky/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch new file mode 100644 index 000000000..5096a85c1 --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch @@ -0,0 +1,40 @@ +From 67af7dbe8bdf29f9ed980d8d29feeae32a0a7a1d Mon Sep 17 00:00:00 2001 +From: Li Wang <liwang@redhat.com> +Date: Tue, 23 Jan 2018 17:46:35 +0800 +Subject: [PATCH] safe_macros: make is_fuse() return zero if fs_type is NULL + +This commmit 28507e514c(safe_mount: Do not try mount() syscall for FUSE fs) +involves FUSE fs check in safe_mount(), but we'd better guarantee the "fs_type" +is legal to check in is_fuse() function otherwise system will kill the program. + + cmdline="fanotify06" + contacts="" + analysis=exit + <<<test_output>>> + tst_test.c:980: INFO: Timeout per run is 0h 10m 00s + tst_test.c:1025: BROK: Test killed by SIGSEGV! + +Signed-off-by: Li Wang <liwang@redhat.com> +Acked-by: Jan Stancek <jstancek@redhat.com> +Upstream-Status: Accepted [https://github.com/linux-test-project/ltp/commit/67af7dbe8bdf29f9ed980d8d29feeae32a0a7a1d] +--- + lib/safe_macros.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib/safe_macros.c b/lib/safe_macros.c +index c48e436dc..abdeca013 100644 +--- a/lib/safe_macros.c ++++ b/lib/safe_macros.c +@@ -708,6 +708,9 @@ static int is_fuse(const char *fs_type) + { + unsigned int i; + ++ if (!fs_type) ++ return 0; ++ + for (i = 0; i < ARRAY_SIZE(fuse_fs_types); i++) { + if (!strcmp(fuse_fs_types[i], fs_type)) + return 1; +-- +2.11.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp_20180118.bb b/poky/meta/recipes-extended/ltp/ltp_20180118.bb new file mode 100644 index 000000000..14fb41b3b --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp_20180118.bb @@ -0,0 +1,116 @@ +SUMMARY = "Linux Test Project" +DESCRIPTION = "The Linux Test Project is a joint project with SGI, IBM, OSDL, and Bull with a goal to deliver test suites to the open source community that validate the reliability, robustness, and stability of Linux. The Linux Test Project is a collection of tools for testing the Linux kernel and related features." +HOMEPAGE = "http://ltp.sourceforge.net" +SECTION = "console/utils" +LICENSE = "GPLv2 & GPLv2+ & LGPLv2+ & LGPLv2.1+ & BSD-2-Clause" +LIC_FILES_CHKSUM = "\ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://testcases/kernel/controllers/freezer/COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ + file://testcases/kernel/controllers/freezer/run_freezer.sh;beginline=5;endline=17;md5=86a61d2c042d59836ffb353a21456498 \ + file://testcases/kernel/hotplug/memory_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \ + file://testcases/kernel/hotplug/cpu_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \ + file://testcases/open_posix_testsuite/COPYING;md5=48b1c5ec633e3e30ec2cf884ae699947 \ + file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ + file://tools/pounder21/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://utils/ffsb-6.0-rc2/COPYING;md5=c46082167a314d785d012a244748d803 \ +" + +DEPENDS = "attr libaio libcap acl openssl zip-native" +DEPENDS_append_libc-musl = " fts " +EXTRA_OEMAKE_append_libc-musl = " LIBC=musl " +CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" +CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" +SRCREV = "731cd34e682d297b207668be8b1d15320a9ac1b1" + +SRC_URI = "git://github.com/linux-test-project/ltp.git \ + file://0001-configure-add-knob-to-control-numa-support.patch \ + file://0001-configure-Fix-default-value-of-without-numa-switch-i.patch \ + file://0003-Add-knob-to-control-tirpc-support.patch \ + file://0004-build-Add-option-to-select-libc-implementation.patch \ + file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \ + file://0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch \ + file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \ + file://0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch \ + file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \ + file://0018-guard-mallocopt-with-__GLIBC__.patch \ + file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \ + file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \ + file://0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch \ + file://0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch \ + file://0026-crash01-Define-_GNU_SOURCE.patch \ + file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch \ + file://0034-periodic_output.patch \ + file://0035-fix-test_proc_kill-hang.patch \ + file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ + file://0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch \ + file://0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch \ + " + +S = "${WORKDIR}/git" + +inherit autotools-brokensep + +TARGET_CC_ARCH += "${LDFLAGS}" + +export prefix = "/opt/ltp" +export exec_prefix = "/opt/ltp" + +PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl," +EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4" +EXTRA_OECONF = " --with-power-management-testsuite --with-realtime-testsuite " +# ltp network/rpc test cases ftbfs when libtirpc is found +EXTRA_OECONF += " --without-tirpc " + +do_install(){ + install -d ${D}/opt/ltp/ + oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install + + # fixup not deploy STPfailure_report.pl to avoid confusing about it fails to run + # as it lacks dependency on some perl moudle such as LWP::Simple + # And this script previously works as a tool for analyzing failures from LTP + # runs on the OSDL's Scaleable Test Platform (STP) and it mainly accesses + # http://khack.osdl.org to retrieve ltp test results run on + # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible + rm -rf ${D}/opt/ltp/bin/STPfailure_report.pl + + # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual + cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases +} + +RDEPENDS_${PN} = "\ + acl \ + at \ + attr \ + bash \ + cpio \ + cronie \ + curl \ + e2fsprogs-mke2fs \ + expect \ + gawk \ + gzip \ + iproute2 \ + ldd \ + libaio \ + logrotate \ + perl \ + python-core \ + procps \ + unzip \ + util-linux \ + which \ + tar \ +" + +FILES_${PN} += "/opt/ltp/* /opt/ltp/runtest/* /opt/ltp/scenario_groups/* /opt/ltp/testcases/bin/* /opt/ltp/testcases/bin/*/bin/* /opt/ltp/testscripts/* /opt/ltp/testcases/open_posix_testsuite/* /opt/ltp/testcases/open_posix_testsuite/conformance/* /opt/ltp/testcases/open_posix_testsuite/Documentation/* /opt/ltp/testcases/open_posix_testsuite/functional/* /opt/ltp/testcases/open_posix_testsuite/include/* /opt/ltp/testcases/open_posix_testsuite/scripts/* /opt/ltp/testcases/open_posix_testsuite/stress/* /opt/ltp/testcases/open_posix_testsuite/tools/* /opt/ltp/testcases/data/nm01/lib.a /opt/ltp/lib/libmem.a" + +# Avoid stripping some generated binaries otherwise some of the ltp tests such as ldd01 & nm01 fail +INHIBIT_PACKAGE_STRIP_FILES = "/opt/ltp/testcases/bin/nm01 /opt/ltp/testcases/bin/ldd01" +INSANE_SKIP_${PN} += "already-stripped staticdev" + +# Avoid file dependency scans, as LTP checks for things that may or may not +# exist on the running system. For instance it has specific checks for +# csh and ksh which are not typically part of OpenEmbedded systems (but +# can be added via additional layers.) +SKIP_FILEDEPS_${PN} = '1' diff --git a/poky/meta/recipes-extended/lzip/lzip_1.19.bb b/poky/meta/recipes-extended/lzip/lzip_1.19.bb new file mode 100644 index 000000000..099b36470 --- /dev/null +++ b/poky/meta/recipes-extended/lzip/lzip_1.19.bb @@ -0,0 +1,41 @@ +SUMMARY = "Lossless data compressor based on the LZMA algorithm" +HOMEPAGE = "http://lzip.nongnu.org/lzip.html" +SECTION = "console/utils" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=76d6e300ffd8fb9d18bd9b136a9bba13 \ + file://decoder.cc;beginline=3;endline=16;md5=db09fe3f9573f94d0076f7f07959e6e1" + +SRC_URI = "${SAVANNAH_GNU_MIRROR}/lzip/lzip-${PV}.tar.gz" + +SRC_URI[md5sum] = "4dd8790d7528440d034fc713a8680bd3" +SRC_URI[sha256sum] = "ffadc4f56be1bc0d3ae155ec4527bd003133bdc703a753b2cc683f610e646ba9" + +CONFIGUREOPTS = "\ + '--srcdir=${S}' \ + '--prefix=${prefix}' \ + '--exec-prefix=${exec_prefix}' \ + '--bindir=${bindir}' \ + '--datadir=${datadir}' \ + '--infodir=${infodir}' \ + '--sysconfdir=${sysconfdir}' \ + 'CXX=${CXX}' \ + 'CPPFLAGS=${CPPFLAGS}' \ + 'CXXFLAGS=${CXXFLAGS}' \ + 'LDFLAGS=${LDFLAGS}' \ +" +EXTRA_OEMAKE = "" + +B = "${S}/obj" +do_configure () { + ${S}/configure ${CONFIGUREOPTS} +} + +do_install () { + oe_runmake 'DESTDIR=${D}' install + # Info dir listing isn't interesting at this point so remove it if it exists. + if [ -e "${D}${infodir}/dir" ]; then + rm -f ${D}${infodir}/dir + fi +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/man-db/man-db_2.8.1.bb b/poky/meta/recipes-extended/man-db/man-db_2.8.1.bb new file mode 100644 index 000000000..8328a671f --- /dev/null +++ b/poky/meta/recipes-extended/man-db/man-db_2.8.1.bb @@ -0,0 +1,43 @@ +SUMMARY = "An implementation of the standard Unix documentation system accessed using the man command" +HOMEPAGE = "http://man-db.nongnu.org/" +LICENSE = "LGPLv2.1 & GPLv2" +LIC_FILES_CHKSUM = "file://docs/COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \ + file://docs/COPYING;md5=eb723b61539feef013de476e68b5c50a" + +SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/man-db/man-db-${PV}.tar.xz" +SRC_URI[md5sum] = "51842978e06686286421f9498d1009b7" +SRC_URI[sha256sum] = "a6aec641ca3d9942b054cc0e9c3f05cb46a3a992bc0006795755e2fed1357f3e" + +DEPENDS = "libpipeline gdbm groff-native" + +# | /usr/src/debug/man-db/2.8.0-r0/man-db-2.8.0/src/whatis.c:939: undefined reference to `_nl_msg_cat_cntr' +USE_NLS_libc-musl = "no" + +inherit gettext pkgconfig autotools + +EXTRA_OECONF = "--with-pager=less --disable-cache-owner" + +do_install_append_libc-musl() { + rm -f ${D}${libdir}/charset.alias +} + +FILES_${PN} += "${prefix}/lib/tmpfiles.d" + +FILES_${PN}-dev += "${libdir}/man-db/libman.so ${libdir}/${BPN}/libmandb.so" + +RDEPENDS_${PN} += "groff" +RRECOMMENDS_${PN} += "less" +RPROVIDES_${PN} += " man" + +def compress_pkg(d): + if bb.utils.contains("INHERIT", "compress_doc", True, False, d): + compress = d.getVar("DOC_COMPRESS") + if compress == "gz": + return "gzip" + elif compress == "bz2": + return "bzip2" + elif compress == "xz": + return "xz" + return "" + +RDEPENDS_${PN} += "${@compress_pkg(d)}" diff --git a/poky/meta/recipes-extended/man-pages/man-pages_4.14.bb b/poky/meta/recipes-extended/man-pages/man-pages_4.14.bb new file mode 100644 index 000000000..f8bd090d1 --- /dev/null +++ b/poky/meta/recipes-extended/man-pages/man-pages_4.14.bb @@ -0,0 +1,31 @@ +SUMMARY = "Linux man-pages" +DESCRIPTION = "The Linux man-pages project documents the Linux kernel and C library interfaces that are employed by user programs" +SECTION = "console/utils" +HOMEPAGE = "http://www.kernel.org/pub/linux/docs/man-pages" +LICENSE = "GPLv2+" + +LIC_FILES_CHKSUM = "file://README;md5=794f701617cc03fe50c53257660d8ec4" +SRC_URI = "${KERNELORG_MIRROR}/linux/docs/${BPN}/Archive/${BP}.tar.gz" + +SRC_URI[md5sum] = "82bd2d05c4d0dba5e7a90d39c9555197" +SRC_URI[sha256sum] = "aeebc6b09a11e7f7bbc98f3984fe8b8b2bde9d2f5f9dcbd4348a9e0d93704238" + +RDEPENDS_${PN} = "man" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install() { + oe_runmake install DESTDIR=${D} +} + +# Only deliveres man-pages so FILES_${PN} gets everything +FILES_${PN}-doc = "" +FILES_${PN} = "${mandir}/*" + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN} = "passwd.5 getspnam.3" +ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5" +ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3" diff --git a/poky/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch b/poky/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch new file mode 100644 index 000000000..bf8037cd2 --- /dev/null +++ b/poky/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch @@ -0,0 +1,129 @@ +From cdc7c278212ae836eecb4cc9d42c29443cc128a0 Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Thu, 6 Apr 2017 02:24:28 -0700 +Subject: [PATCH] mc: replace "perl -w" with "use warnings" + +The shebang's max length is usually 128 as defined in +/usr/include/linux/binfmts.h: + #define BINPRM_BUF_SIZE 128 + +There would be errors when @PERL@ is longer than 128, use +'/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w' +doesn't work: + +/usr/bin/env: perl -w: No such file or directory + +So replace "perl -w" with "use warnings" to make it work. + +The man2hlp.in already has "use warnings;", so just remove '-w' is OK. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + src/man2hlp/man2hlp.in | 2 +- + src/vfs/extfs/helpers/a+.in | 4 +++- + src/vfs/extfs/helpers/mailfs.in | 3 ++- + src/vfs/extfs/helpers/patchfs.in | 3 ++- + src/vfs/extfs/helpers/ulib.in | 4 +++- + src/vfs/extfs/helpers/uzip.in | 3 ++- + 6 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/src/man2hlp/man2hlp.in b/src/man2hlp/man2hlp.in +index f095830..558a674 100644 +--- a/src/man2hlp/man2hlp.in ++++ b/src/man2hlp/man2hlp.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # + # Man page to help file converter + # Copyright (C) 1994, 1995, 1998, 2000, 2001, 2002, 2003, 2004, 2005, +diff --git a/src/vfs/extfs/helpers/a+.in b/src/vfs/extfs/helpers/a+.in +index 579441c..fe446f4 100644 +--- a/src/vfs/extfs/helpers/a+.in ++++ b/src/vfs/extfs/helpers/a+.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # + # External filesystem for mc, using mtools + # Written Ludek Brukner <lubr@barco.cz>, 1997 +@@ -9,6 +9,8 @@ + + # These mtools components must be in PATH for this to work + ++use warnings; ++ + sub quote { + $_ = shift(@_); + s/([^\w\/.+-])/\\$1/g; +diff --git a/src/vfs/extfs/helpers/mailfs.in b/src/vfs/extfs/helpers/mailfs.in +index e9455be..059f41f 100644 +--- a/src/vfs/extfs/helpers/mailfs.in ++++ b/src/vfs/extfs/helpers/mailfs.in +@@ -1,6 +1,7 @@ +-#! @PERL@ -w ++#! @PERL@ + + use bytes; ++use warnings; + + # MC extfs for (possibly compressed) Berkeley style mailbox files + # Peter Daum <gator@cs.tu-berlin.de> (Jan 1998, mc-4.1.24) +diff --git a/src/vfs/extfs/helpers/patchfs.in b/src/vfs/extfs/helpers/patchfs.in +index ef407de..3ad4b53 100644 +--- a/src/vfs/extfs/helpers/patchfs.in ++++ b/src/vfs/extfs/helpers/patchfs.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # + # Written by Adam Byrtek <alpha@debian.org>, 2002 + # Rewritten by David Sterba <dave@jikos.cz>, 2009 +@@ -9,6 +9,7 @@ + + use bytes; + use strict; ++use warnings; + use POSIX; + use File::Temp 'tempfile'; + +diff --git a/src/vfs/extfs/helpers/ulib.in b/src/vfs/extfs/helpers/ulib.in +index 418611f..82c7ccf 100644 +--- a/src/vfs/extfs/helpers/ulib.in ++++ b/src/vfs/extfs/helpers/ulib.in +@@ -1,9 +1,11 @@ +-#! @PERL@ -w ++#! @PERL@ + # + # VFS to manage the gputils archives. + # Written by Molnár Károly (proton7@freemail.hu) 2012 + # + ++use warnings; ++ + my %month = ('jan' => '01', 'feb' => '02', 'mar' => '03', + 'apr' => '04', 'may' => '05', 'jun' => '06', + 'jul' => '07', 'aug' => '08', 'sep' => '09', +diff --git a/src/vfs/extfs/helpers/uzip.in b/src/vfs/extfs/helpers/uzip.in +index b1c4f90..c8eb335 100644 +--- a/src/vfs/extfs/helpers/uzip.in ++++ b/src/vfs/extfs/helpers/uzip.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # + # zip file archive Virtual File System for Midnight Commander + # Version 1.4.0 (2001-08-07). +@@ -9,6 +9,7 @@ + use POSIX; + use File::Basename; + use strict; ++use warnings; + + # + # Configuration options +-- +2.10.2 + diff --git a/poky/meta/recipes-extended/mc/mc_4.8.20.bb b/poky/meta/recipes-extended/mc/mc_4.8.20.bb new file mode 100644 index 000000000..70d1b5e0a --- /dev/null +++ b/poky/meta/recipes-extended/mc/mc_4.8.20.bb @@ -0,0 +1,49 @@ +SUMMARY = "Midnight Commander is an ncurses based file manager" +HOMEPAGE = "http://www.midnight-commander.org/" +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=270bbafe360e73f9840bd7981621f9c2" +SECTION = "console/utils" +DEPENDS = "ncurses glib-2.0 util-linux" +RDEPENDS_${PN} = "ncurses-terminfo" + +SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \ + file://0001-mc-replace-perl-w-with-use-warnings.patch \ + " +SRC_URI[md5sum] = "dcfc7aa613c62291a0f71f6b698d8267" +SRC_URI[sha256sum] = "2d85daaa6ab26e524946df4823ac2f69802bc16bc967781b5e28d5b86fc3b979" + +inherit autotools gettext pkgconfig + +# +# Both Samba (smb) and sftp require package delivered from meta-openembedded +# +PACKAGECONFIG ??= "" +PACKAGECONFIG[smb] = "--enable-vfs-smb,--disable-vfs-smb,samba," +PACKAGECONFIG[sftp] = "--enable-vfs-sftp,--disable-vfs-sftp,libssh2," + +EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x" + +CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" + +do_install_append () { + sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/* + + rm ${D}${libexecdir}/mc/extfs.d/s3+ ${D}${libexecdir}/mc/extfs.d/uc1541 +} + +PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers ${BPN}-fish" + +SUMMARY_${BPN}-helpers-perl = "Midnight Commander Perl-based helper scripts" +FILES_${BPN}-helpers-perl = "${libexecdir}/mc/extfs.d/a+ ${libexecdir}/mc/extfs.d/apt+ \ + ${libexecdir}/mc/extfs.d/deb ${libexecdir}/mc/extfs.d/deba \ + ${libexecdir}/mc/extfs.d/debd ${libexecdir}/mc/extfs.d/dpkg+ \ + ${libexecdir}/mc/extfs.d/mailfs ${libexecdir}/mc/extfs.d/patchfs \ + ${libexecdir}/mc/extfs.d/rpms+ ${libexecdir}/mc/extfs.d/ulib \ + ${libexecdir}/mc/extfs.d/uzip" +RDEPENDS_${BPN}-helpers-perl = "perl" + +SUMMARY_${BPN}-helpers = "Midnight Commander shell helper scripts" +FILES_${BPN}-helpers = "${libexecdir}/mc/extfs.d/* ${libexecdir}/mc/ext.d/*" + +SUMMARY_${BPN}-fish = "Midnight Commander Fish scripts" +FILES_${BPN}-fish = "${libexecdir}/mc/fish" diff --git a/poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch b/poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch new file mode 100644 index 000000000..a89161404 --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch @@ -0,0 +1,44 @@ +From 1f5baf3ad95ae4c39efe4d8ad8b2e642b3a351da Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Tue, 9 Feb 2016 11:44:01 +0200 +Subject: [PATCH] Fix the path of corosync and dlm header files check + +Original Makefile will check headers on host instead of sysroot. +Fix it. + +Upstream-Status: Inappropriate [Yocto specific] + +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- +mdadm only works with corosync 2.x which provides header file corosync/cmap.h. +If build mdadm with corosync 1.x, it fails with: + +| member.c:12:27: fatal error: corosync/cmap.h: No such file or directory +| #include <corosync/cmap.h> +| ^ + +Build with corosync only header file corosync/cmap.h exists. + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index fd79cfb..34150a9 100644 +--- a/Makefile ++++ b/Makefile +@@ -80,8 +80,8 @@ MDMON_DIR = $(RUN_DIR) + FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots + SYSTEMD_DIR=/lib/systemd/system + +-COROSYNC:=$(shell [ -d /usr/include/corosync ] || echo -DNO_COROSYNC) +-DLM:=$(shell [ -f /usr/include/libdlm.h ] || echo -DNO_DLM) ++COROSYNC:=$(shell [ -f $(SYSROOT)/usr/include/corosync/cmap.h ] || echo -DNO_COROSYNC) ++DLM:=$(shell [ -f $(SYSROOT)/usr/include/libdlm.h ] || echo -DNO_DLM) + + DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\" + DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\" +-- +2.4.0 + diff --git a/poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch b/poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch new file mode 100644 index 000000000..a4b7b8acd --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch @@ -0,0 +1,31 @@ +From a129ee6d80f3b2cda0d827c35fa81a517cf6d505 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 13 Oct 2017 10:27:34 -0700 +Subject: [PATCH] Use CC to check for implicit-fallthrough warning support + +This warning it new in gcc7 and in cross compile case +its possible that build host gcc is version 7+ but the +cross compile used for compiling mdadm is < version 7 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index d207ee4..971f255 100644 +--- a/Makefile ++++ b/Makefile +@@ -48,7 +48,7 @@ ifdef WARN_UNUSED + CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3 + endif + +-FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l) ++FALLTHROUGH := $(shell ${CC} -v --help 2>&1 | grep "implicit-fallthrough" | wc -l) + ifneq "$(FALLTHROUGH)" "0" + CWFLAGS += -Wimplicit-fallthrough=0 + endif +-- +2.14.2 + diff --git a/poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch b/poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch new file mode 100644 index 000000000..acd64ada2 --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch @@ -0,0 +1,48 @@ +From 943616e5dffb79f307e4bd9b249d316212998750 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 18 Dec 2016 08:30:51 +0000 +Subject: [PATCH] include <sys/sysmacros.h> for major/minor defintions + +glibc 2.25 is warning about it if applications depend on +sys/types.h for these macros, it expects to be included +from <sys/sysmacros.h> + +Fixes +| Grow.c:3534:13: error: In the GNU C Library, "minor" is defined +| by <sys/sysmacros.h>. For historical compatibility, it is +| currently defined by <sys/types.h> as well, but we plan to +| remove this soon. To use "minor", include <sys/sysmacros.h> +| directly. If you did not intend to use a system-defined macro +| "minor", you should undefine it after including <sys/types.h>. [-Werror] +| Query.c: In function 'Query': +| Query.c:105:13: error: In the GNU C Library, "makedev" is defined +| by <sys/sysmacros.h>. For historical compatibility, it is +| currently defined by <sys/types.h> as well, but we plan to +| remove this soon. To use "makedev", include <sys/sysmacros.h> +| directly. If you did not intend to use a system-defined macro +| "makedev", you should undefine it after including <sys/types.h>. [-Werror] +| makedev((unsigned)disc.major,(unsigned)disc.minor) == stb.st_rdev) +| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + mdadm.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/mdadm.h b/mdadm.h +index 8c8f4d1..3ce13b5 100755 +--- a/mdadm.h ++++ b/mdadm.h +@@ -34,6 +34,7 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence)); + #endif + + #include <sys/types.h> ++#include <sys/sysmacros.h> + #include <sys/stat.h> + #include <stdint.h> + #include <stdlib.h> +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch b/poky/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch new file mode 100644 index 000000000..ce15170c7 --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch @@ -0,0 +1,37 @@ +From aa09af0fe2ec0737fa04ffd00957532684e257b9 Mon Sep 17 00:00:00 2001 +From: Xiao Ni <xni@redhat.com> +Date: Fri, 17 Mar 2017 19:55:42 +0800 +Subject: [PATCH 1/5] mdadm: Add Wimplicit-fallthrough=0 in Makefile + +There are many errors like 'error: this statement may fall through'. +But the logic is right. So add the flag Wimplicit-fallthrough=0 +to disable the error messages. The method I use is from +https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html +#index-Wimplicit-fallthrough-375 + +Signed-off-by: Xiao Ni <xni@redhat.com> +Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com> +--- +Upstream-Status: Backport + Makefile | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Makefile b/Makefile +index 0f307ec..e1a7058 100644 +--- a/Makefile ++++ b/Makefile +@@ -48,6 +48,11 @@ ifdef WARN_UNUSED + CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3 + endif + ++FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l) ++ifneq "$(FALLTHROUGH)" "0" ++CWFLAGS += -Wimplicit-fallthrough=0 ++endif ++ + ifdef DEBIAN + CPPFLAGS += -DDEBIAN + endif +-- +2.12.2 + diff --git a/poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch b/poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch new file mode 100644 index 000000000..4cf809290 --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch @@ -0,0 +1,43 @@ +From 6d369e8f226594632ce4260129509daf7030de0a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 9 May 2016 22:03:57 +0000 +Subject: [PATCH] mdadm.h: Undefine dprintf before redefining + +dprintf is also defined in libc see +usr/include/bits/stdio2.h, this comes into +play especially when fortify sources is enabled +and compilers like clang reports the override + +In file included from policy.c:25: +./mdadm.h:1562:9: error: 'dprintf' macro redefined [-Werror,-Wmacro-redefined] + ^ +/mnt/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/bits/stdio2.h:145:12: note: previous definition is here + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + mdadm.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/mdadm.h b/mdadm.h +index 230e60f..8c8f4d1 100755 +--- a/mdadm.h ++++ b/mdadm.h +@@ -1554,11 +1554,13 @@ static inline char *to_subarray(struct mdstat_ent *ent, char *container) + } + + #ifdef DEBUG ++#undef dprintf + #define dprintf(fmt, arg...) \ + fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##arg) + #define dprintf_cont(fmt, arg...) \ + fprintf(stderr, fmt, ##arg) + #else ++#undef dprintf + #define dprintf(fmt, arg...) \ + ({ if (0) fprintf(stderr, "%s: %s: " fmt, Name, __func__, ##arg); 0; }) + #define dprintf_cont(fmt, arg...) \ +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch b/poky/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch new file mode 100644 index 000000000..cbce053a3 --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch @@ -0,0 +1,75 @@ +From bb4df273041ba206008bdb0ada75ccd97c29f623 Mon Sep 17 00:00:00 2001 +From: Xiao Ni <xni@redhat.com> +Date: Fri, 17 Mar 2017 19:55:43 +0800 +Subject: [PATCH 2/5] mdadm: Specify enough length when write to buffer +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In Detail.c the buffer path in function Detail is defined as path[200], +in fact the max lenth of content which needs to write to the buffer is +287. Because the length of dname of struct dirent is 255. +During building it reports error: +error: ‘%s’ directive writing up to 255 bytes into a region of size 189 +[-Werror=format-overflow=] + +In function examine_super0 there is a buffer nb with length 5. +But it need to show a int type argument. The lenght of max +number of int is 10. So the buffer length should be 11. + +In human_size function the length of buf is 30. During building +there is a error: +output between 20 and 47 bytes into a destination of size 30. +Change the length to 47. + +Signed-off-by: Xiao Ni <xni@redhat.com> +Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com> +--- +Upstream-Status: Backport + Detail.c | 2 +- + super0.c | 2 +- + util.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Detail.c b/Detail.c +index 509b0d4..cb33794 100644 +--- a/Detail.c ++++ b/Detail.c +@@ -575,7 +575,7 @@ This is pretty boring + printf(" Member Arrays :"); + + while (dir && (de = readdir(dir)) != NULL) { +- char path[200]; ++ char path[287]; + char vbuf[1024]; + int nlen = strlen(sra->sys_name); + dev_t devid; +diff --git a/super0.c b/super0.c +index 938cfd9..f5b4507 100644 +--- a/super0.c ++++ b/super0.c +@@ -231,7 +231,7 @@ static void examine_super0(struct supertype *st, char *homehost) + d++) { + mdp_disk_t *dp; + char *dv; +- char nb[5]; ++ char nb[11]; + int wonly, failfast; + if (d>=0) dp = &sb->disks[d]; + else dp = &sb->this_disk; +diff --git a/util.c b/util.c +index f100972..32bd909 100644 +--- a/util.c ++++ b/util.c +@@ -811,7 +811,7 @@ unsigned long calc_csum(void *super, int bytes) + #ifndef MDASSEMBLE + char *human_size(long long bytes) + { +- static char buf[30]; ++ static char buf[47]; + + /* We convert bytes to either centi-M{ega,ibi}bytes or + * centi-G{igi,ibi}bytes, with appropriate rounding, +-- +2.12.2 + diff --git a/poky/meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch b/poky/meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch new file mode 100644 index 000000000..dcec84ffc --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch @@ -0,0 +1,59 @@ +From bc87af1314325b00c6ac002a60a2b0f0caa81e34 Mon Sep 17 00:00:00 2001 +From: Xiao Ni <xni@redhat.com> +Date: Sat, 18 Mar 2017 10:33:44 +0800 +Subject: [PATCH 3/5] Replace snprintf with strncpy at some places to avoid + truncation + +In gcc7 there are some building errors like: +directive output may be truncated writing up to 31 bytes into a region of size 24 +snprintf(str, MPB_SIG_LEN, %s, mpb->sig); + +It just need to copy one string to target. So use strncpy to replace it. + +For this line code: snprintf(str, MPB_SIG_LEN, %s, mpb->sig); +Because mpb->sig has the content of version after magic, so +it's better to use strncpy to replace snprintf too. + +Signed-off-by: Xiao Ni <xni@redhat.com> +Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com> +--- +Upstream-Status: Backport + super-intel.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/super-intel.c b/super-intel.c +index 57c7e75..5499098 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -1811,7 +1811,8 @@ static void examine_super_imsm(struct supertype *st, char *homehost) + __u32 reserved = imsm_reserved_sectors(super, super->disks); + struct dl *dl; + +- snprintf(str, MPB_SIG_LEN, "%s", mpb->sig); ++ strncpy(str, (char *)mpb->sig, MPB_SIG_LEN); ++ str[MPB_SIG_LEN-1] = '\0'; + printf(" Magic : %s\n", str); + snprintf(str, strlen(MPB_VERSION_RAID0), "%s", get_imsm_version(mpb)); + printf(" Version : %s\n", get_imsm_version(mpb)); +@@ -7142,14 +7143,16 @@ static int update_subarray_imsm(struct supertype *st, char *subarray, + + u->type = update_rename_array; + u->dev_idx = vol; +- snprintf((char *) u->name, MAX_RAID_SERIAL_LEN, "%s", name); ++ strncpy((char *) u->name, name, MAX_RAID_SERIAL_LEN); ++ u->name[MAX_RAID_SERIAL_LEN-1] = '\0'; + append_metadata_update(st, u, sizeof(*u)); + } else { + struct imsm_dev *dev; + int i; + + dev = get_imsm_dev(super, vol); +- snprintf((char *) dev->volume, MAX_RAID_SERIAL_LEN, "%s", name); ++ strncpy((char *) dev->volume, name, MAX_RAID_SERIAL_LEN); ++ dev->volume[MAX_RAID_SERIAL_LEN-1] = '\0'; + for (i = 0; i < mpb->num_raid_devs; i++) { + dev = get_imsm_dev(super, i); + handle_missing(super, dev); +-- +2.12.2 + diff --git a/poky/meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch b/poky/meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch new file mode 100644 index 000000000..94fde42e9 --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch @@ -0,0 +1,33 @@ +From 5da889032e2d99751ed9fe60016146e9ae8114cd Mon Sep 17 00:00:00 2001 +From: Xiao Ni <xni@redhat.com> +Date: Sat, 18 Mar 2017 10:33:45 +0800 +Subject: [PATCH 4/5] mdadm: Forced type conversion to avoid truncation + +Gcc reports it needs 19 bytes to right to disk->serial. Because the +type of argument i is int. But the meaning of i is failed disk +number. So it doesn't need to use 19 bytes. Just add a type +conversion to avoid this building error + +Signed-off-by: Xiao Ni <xni@redhat.com> +Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com> +--- +Upstream-Status: Backport + super-intel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/super-intel.c b/super-intel.c +index 5499098..4e466ff 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -5228,7 +5228,7 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, + disk->status = CONFIGURED_DISK | FAILED_DISK; + disk->scsi_id = __cpu_to_le32(~(__u32)0); + snprintf((char *) disk->serial, MAX_RAID_SERIAL_LEN, +- "missing:%d", i); ++ "missing:%d", (__u8)i); + } + find_missing(super); + } else { +-- +2.12.2 + diff --git a/poky/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch b/poky/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch new file mode 100644 index 000000000..3d9d3b904 --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch @@ -0,0 +1,128 @@ +From 09014233bf10900f7bd8390b3b64ff82bca45222 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 19 Apr 2017 12:04:15 -0700 +Subject: [PATCH 5/5] Add a comment to indicate valid fallthrough + +gcc7 warns about code with fallthroughs, this patch adds +the comment to indicate a valid fallthrough, helps gcc7 +compiler warnings + +This works in cross and native compilation case + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + + Grow.c | 4 ++++ + bitmap.c | 8 ++++++++ + mdadm.c | 2 ++ + super-intel.c | 1 + + util.c | 1 + + 5 files changed, 16 insertions(+) + +diff --git a/Grow.c b/Grow.c +index 455c5f9..27c73b1 100755 +--- a/Grow.c ++++ b/Grow.c +@@ -1257,6 +1257,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re) + switch (info->new_level) { + case 4: + delta_parity = 1; ++ /* fallthrough */ + case 0: + re->level = 4; + re->before.layout = 0; +@@ -1284,10 +1285,12 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re) + + case 4: + info->array.layout = ALGORITHM_PARITY_N; ++ /* fallthrough */ + case 5: + switch (info->new_level) { + case 0: + delta_parity = -1; ++ /* fallthrough */ + case 4: + re->level = info->array.level; + re->before.data_disks = info->array.raid_disks - 1; +@@ -1343,6 +1346,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re) + case 4: + case 5: + delta_parity = -1; ++ /* fallthrough */ + case 6: + re->level = 6; + re->before.data_disks = info->array.raid_disks - 2; +diff --git a/bitmap.c b/bitmap.c +index ccedfd3..a6ff091 100644 +--- a/bitmap.c ++++ b/bitmap.c +@@ -82,13 +82,21 @@ static inline int count_dirty_bits_byte(char byte, int num_bits) + + switch (num_bits) { /* fall through... */ + case 8: if (byte & 128) num++; ++ /* fallthrough */ + case 7: if (byte & 64) num++; ++ /* fallthrough */ + case 6: if (byte & 32) num++; ++ /* fallthrough */ + case 5: if (byte & 16) num++; ++ /* fallthrough */ + case 4: if (byte & 8) num++; ++ /* fallthrough */ + case 3: if (byte & 4) num++; ++ /* fallthrough */ + case 2: if (byte & 2) num++; ++ /* fallthrough */ + case 1: if (byte & 1) num++; ++ /* fallthrough */ + default: break; + } + +diff --git a/mdadm.c b/mdadm.c +index c3a265b..2d06d3b 100644 +--- a/mdadm.c ++++ b/mdadm.c +@@ -148,6 +148,7 @@ int main(int argc, char *argv[]) + mode == CREATE || mode == GROW || + mode == INCREMENTAL || mode == MANAGE) + break; /* b means bitmap */ ++ /* fallthrough */ + case Brief: + c.brief = 1; + continue; +@@ -828,6 +829,7 @@ int main(int argc, char *argv[]) + + case O(INCREMENTAL,NoDegraded): + pr_err("--no-degraded is deprecated in Incremental mode\n"); ++ /* fallthrough */ + case O(ASSEMBLE,NoDegraded): /* --no-degraded */ + c.runstop = -1; /* --stop isn't allowed for --assemble, + * so we overload slightly */ +diff --git a/super-intel.c b/super-intel.c +index 4e466ff..00a2925 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -3271,6 +3271,7 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, + << SECT_PER_MB_SHIFT; + } + } ++ /* fallthrough */ + case MIGR_VERIFY: + /* we could emulate the checkpointing of + * 'sync_action=check' migrations, but for now +diff --git a/util.c b/util.c +index 32bd909..f2a4d19 100644 +--- a/util.c ++++ b/util.c +@@ -335,6 +335,7 @@ unsigned long long parse_size(char *size) + switch (*c) { + case 'K': + c++; ++ /* fallthrough */ + default: + s *= 2; + break; +-- +2.12.2 + diff --git a/poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch b/poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch new file mode 100644 index 000000000..df21399de --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch @@ -0,0 +1,22 @@ +super-intel.c:5063:2: error: right-hand operand of comma expression has no effect [-Werror=unused-value] + snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH, + ^ +cc1: all warnings being treated as errors +make: *** [super-intel.o] Error 1 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending + +Index: mdadm-4.0/super-intel.c +=================================================================== +--- mdadm-4.0.orig/super-intel.c ++++ mdadm-4.0/super-intel.c +@@ -5725,7 +5725,7 @@ static int write_super_imsm_spares(struc + spare->cache_size = mpb->cache_size; + spare->pwr_cycle_count = __cpu_to_le32(1); + +- snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH, ++ (void)snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH, + MPB_SIGNATURE MPB_VERSION_RAID0); + + for (d = super->disks; d; d = d->next) { diff --git a/poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch b/poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch new file mode 100644 index 000000000..00e6657e0 --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch @@ -0,0 +1,25 @@ +When try to print time_t values as a long int it causes an error because time_t +data type in x32 ABI is long long int. + +Upstream-Status: Pending + +Signed-off-by: AnÃbal Limón <anibal.limon@linux.intel.com> + +Index: mdadm-4.0/monitor.c +=================================================================== +--- mdadm-4.0.orig/monitor.c ++++ mdadm-4.0/monitor.c +@@ -445,9 +445,12 @@ static int read_and_act(struct active_ar + if (FD_ISSET(mdi->bb_fd, fds)) + check_for_cleared_bb(a, mdi); + } +- + gettimeofday(&tv, NULL); ++#if defined(__x86_64__) && defined(__ILP32__) ++ dprintf("(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s start:%llu\n", ++#else + dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n", ++#endif + a->info.container_member, + tv.tv_sec, tv.tv_usec, + array_states[a->curr_state], diff --git a/poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch b/poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch new file mode 100644 index 000000000..267c007c2 --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch @@ -0,0 +1,45 @@ +From c65898b9da82df94e1bae7937e415a7eb80355d5 Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Wed, 10 Feb 2016 17:28:05 +0200 +Subject: [PATCH] mdadm-fix-ptest-build-errors + +builds fail with ptest enabled: + +| restripe.c: In function 'test_stripes': +| restripe.c:845:4: error: ignoring return value of 'read', declared with +| attribute warn_unused_result [-Werror=unused-result] +| read(source[i], stripes[i], chunk_size); +| ^ +| cc1: all warnings being treated as errors +| Makefile:214: recipe for target 'test_stripe' failed + +Upstream-Status: Pending + +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- + restripe.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/restripe.c b/restripe.c +index 56dca73..d24b2b4 100644 +--- a/restripe.c ++++ b/restripe.c +@@ -842,10 +842,14 @@ int test_stripes(int *source, unsigned long long *offsets, + + while (length > 0) { + int disk; ++ ssize_t ret; + + for (i = 0 ; i < raid_disks ; i++) { + lseek64(source[i], offsets[i]+start, 0); +- read(source[i], stripes[i], chunk_size); ++ ret = read(source[i], stripes[i], chunk_size); ++ if (ret == -1) { ++ printf("Read Failed\n"); ++ } + } + for (i = 0 ; i < data_disks ; i++) { + int disk = geo_map(i, start/chunk_size, raid_disks, +-- +2.4.0 + diff --git a/poky/meta/recipes-extended/mdadm/files/run-ptest b/poky/meta/recipes-extended/mdadm/files/run-ptest new file mode 100644 index 000000000..5b276090f --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/files/run-ptest @@ -0,0 +1,10 @@ +#!/bin/sh + +./test &>./test.log +if [ $? -eq 0 ] +then + echo "PASS: mdadm" + rm test.log +else + echo "FAIL: mdadm" +fi diff --git a/poky/meta/recipes-extended/mdadm/mdadm_4.0.bb b/poky/meta/recipes-extended/mdadm/mdadm_4.0.bb new file mode 100644 index 000000000..dc098f19b --- /dev/null +++ b/poky/meta/recipes-extended/mdadm/mdadm_4.0.bb @@ -0,0 +1,78 @@ +SUMMARY = "Tool for managing software RAID under Linux" +HOMEPAGE = "http://www.kernel.org/pub/linux/utils/raid/mdadm/" + +# Some files are GPLv2+ while others are GPLv2. +LICENSE = "GPLv2 & GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \ + file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161" + + +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \ + file://gcc-4.9.patch \ + file://mdadm-3.3.2_x32_abi_time_t.patch \ + file://mdadm-fix-ptest-build-errors.patch \ + file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \ + file://run-ptest \ + file://0001-mdadm.h-Undefine-dprintf-before-redefining.patch \ + file://0001-include-sys-sysmacros.h-for-major-minor-defintions.patch \ + file://0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch \ + file://0002-mdadm-Specify-enough-length-when-write-to-buffer.patch \ + file://0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch \ + file://0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch \ + file://0005-Add-a-comment-to-indicate-valid-fallthrough.patch \ + file://0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch \ + " +SRC_URI[md5sum] = "2cb4feffea9167ba71b5f346a0c0a40d" +SRC_URI[sha256sum] = "1d6ae7f24ced3a0fa7b5613b32f4a589bb4881e3946a5a2c3724056254ada3a9" + +CFLAGS += "-fno-strict-aliasing" +inherit autotools-brokensep + +EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"' +# PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h +# prevents 64-bit userland from seeing this definition, instead defaulting +# to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get +# int-ll64.h included +CFLAGS_append_powerpc64 = ' -D__SANE_USERSPACE_TYPES__' +CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__' +CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__' + +do_compile() { + # Point to right sbindir + sed -i -e "s;BINDIR = /sbin;BINDIR = $base_sbindir;" ${S}/Makefile + oe_runmake SYSROOT="${STAGING_DIR_TARGET}" +} + +do_install() { + export STRIP="" + autotools_do_install +} + +inherit ptest + +do_compile_ptest() { + oe_runmake test +} + +do_install_ptest() { + cp -R --no-dereference --preserve=mode,links -v ${S}/tests ${D}${PTEST_PATH}/tests + cp ${S}/test ${D}${PTEST_PATH} + sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test + ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm + for prg in test_stripe swap_super raid6check + do + install -D -m 755 $prg ${D}${PTEST_PATH}/ + done +} +RDEPENDS_${PN}-ptest += "bash" +RRECOMMENDS_${PN}-ptest += " \ + coreutils \ + util-linux \ + kernel-module-loop \ + kernel-module-linear \ + kernel-module-raid0 \ + kernel-module-raid1 \ + kernel-module-raid10 \ + kernel-module-raid456 \ +" diff --git a/poky/meta/recipes-extended/mingetty/mingetty_1.08.bb b/poky/meta/recipes-extended/mingetty/mingetty_1.08.bb new file mode 100644 index 000000000..3c16228b0 --- /dev/null +++ b/poky/meta/recipes-extended/mingetty/mingetty_1.08.bb @@ -0,0 +1,28 @@ +SUMMARY = "Compact getty terminal handler for virtual consoles only" +SECTION = "console/utils" +HOMEPAGE = "http://sourceforge.net/projects/mingetty/" +LICENSE = "GPLv2" +PR = "r3" + +LIC_FILES_CHKSUM = "file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e" +SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz" + +SRC_URI[md5sum] = "2a75ad6487ff271424ffc00a64420990" +SRC_URI[sha256sum] = "0f55c90ba4faa913d91ef99cbf5cb2eb4dbe2780314c3bb17953f849c8cddd17" + +# substitute our CFLAGS for "-O2 -Wall -W -pipe" +# +EXTRA_OEMAKE = "CC='${CC}' \ + CFLAGS='${CFLAGS} -D_GNU_SOURCE'" + +do_install(){ + install -d ${D}${mandir}/man8 ${D}/${base_sbindir} + oe_runmake install DESTDIR=${D} +} + +inherit update-alternatives + +ALTERNATIVE_${PN} = "getty" +ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty" +ALTERNATIVE_TARGET[getty] = "${base_sbindir}/mingetty" +ALTERNATIVE_PRIORITY = "10" diff --git a/poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch b/poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch new file mode 100644 index 000000000..fec67fdd3 --- /dev/null +++ b/poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch @@ -0,0 +1,47 @@ +From d62a5862e26ed3fc58d789efe9c40ca6c911d36b Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 31 Aug 2015 22:35:31 +0000 +Subject: [PATCH] Fix build issus surfaced due to musl + +src/getsdir.h:28:14: error: 'MAXNAMLEN' undeclared here (not in a function) + char fname[MAXNAMLEN + 1]; /* filename + terminating null */ + +src/dial.c:352:22: error: 'KIOCSOUND' undeclared (first use in this function) +| ioctl(consolefd, KIOCSOUND, k); + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + src/dial.c | 2 +- + src/getsdir.c | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/dial.c b/src/dial.c +index a90c1d2..bf02574 100644 +--- a/src/dial.c ++++ b/src/dial.c +@@ -39,7 +39,7 @@ + #include "intl.h" + + #ifdef VC_MUSIC +-# if defined(__GLIBC__) ++# if defined(__GLIBC__) || defined(__linux__) + # include <sys/ioctl.h> + # include <sys/kd.h> + # include <sys/time.h> +diff --git a/src/getsdir.c b/src/getsdir.c +index 2195b27..b61a361 100644 +--- a/src/getsdir.c ++++ b/src/getsdir.c +@@ -30,6 +30,7 @@ + #include <string.h> + #include <sys/types.h> + #include <sys/stat.h> ++#include <sys/param.h> + #include <errno.h> + + #include "getsdir.h" +-- +2.5.1 + diff --git a/poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch b/poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch new file mode 100644 index 000000000..bd8261c97 --- /dev/null +++ b/poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch @@ -0,0 +1,35 @@ +Subject: [PATCH] fix minicom -h/-v return value is not 0 + +Upstream-Status: Pending + +Signed-off-by: Lu Chong <Chong.Lu@windriver.com> + +--- + src/minicom.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/minicom.c b/src/minicom.c +index e1a557b..730da7c 100644 +--- a/src/minicom.c ++++ b/src/minicom.c +@@ -1166,15 +1166,13 @@ int main(int argc, char **argv) + "modify it under the terms of the GNU General Public License\n" + "as published by the Free Software Foundation; either version\n" + "2 of the License, or (at your option) any later version.\n\n"); +- exit(1); +- break; ++ exit(0); + case 's': /* setup mode */ + dosetup = 1; + break; + case 'h': + helpthem(); +- exit(1); +- break; ++ exit(0); + case 'p': /* Pseudo terminal to use. */ + if (strncmp(optarg, "/dev/", 5) == 0) + optarg += 5; +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch b/poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch new file mode 100644 index 000000000..f5c08896f --- /dev/null +++ b/poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch @@ -0,0 +1,21 @@ +Upstream-Status: Pending + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> + +--- a/configure.in 2013-02-06 18:18:13.000000000 +0100 ++++ b/configure.in 2013-07-21 15:31:27.614828894 +0200 +@@ -40,7 +40,13 @@ + fi + + PKG_PROG_PKG_CONFIG +-if test -n "$PKG_CONFIG"; then ++ ++AC_ARG_ENABLE([lockdev], ++ AS_HELP_STRING([--enable-lockdev], ++ [Enable lockdev support (def: enabled)]), ++ [], [enable_lockdev="yes"]) ++ ++if test -n "$PKG_CONFIG" && test "x$enable_lockdev" = xyes; then + PKG_CHECK_MODULES([LOCKDEV], [lockdev], AC_DEFINE([HAVE_LOCKDEV],[1],[Define if you have lockdev]),[:]) + fi + diff --git a/poky/meta/recipes-extended/minicom/minicom_2.7.1.bb b/poky/meta/recipes-extended/minicom/minicom_2.7.1.bb new file mode 100644 index 000000000..e6afe2b65 --- /dev/null +++ b/poky/meta/recipes-extended/minicom/minicom_2.7.1.bb @@ -0,0 +1,30 @@ +SUMMARY = "Text-based modem control and terminal emulation program" +HOMEPAGE = "http://alioth.debian.org/projects/minicom/" +DESCRIPTION = "Minicom is a text-based modem control and terminal emulation program for Unix-like operating systems" +SECTION = "console/network" +DEPENDS = "ncurses virtual/libiconv" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=420477abc567404debca0a2a1cb6b645 \ + file://src/minicom.h;beginline=1;endline=12;md5=a58838cb709f0db517f4e42730c49e81" + +SRC_URI = "https://alioth.debian.org/frs/download.php/latestfile/3/${BP}.tar.gz \ + file://allow.to.disable.lockdev.patch \ + file://0001-fix-minicom-h-v-return-value-is-not-0.patch \ + file://0001-Fix-build-issus-surfaced-due-to-musl.patch \ + " + +SRC_URI[md5sum] = "9021cb8c5445f6e6e74b2acc39962d62" +SRC_URI[sha256sum] = "532f836b7a677eb0cb1dca8d70302b73729c3d30df26d58368d712e5cca041f1" + +UPSTREAM_CHECK_URI = "https://alioth.debian.org/frs/?group_id=30018" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[lockdev] = "--enable-lockdev,--disable-lockdev,lockdev" + +inherit autotools gettext pkgconfig + +do_install() { + for d in doc extras man lib src; do make -C $d DESTDIR=${D} install; done +} + +RRECOMMENDS_${PN} += "lrzsz" diff --git a/poky/meta/recipes-extended/mktemp/files/disable-strip.patch b/poky/meta/recipes-extended/mktemp/files/disable-strip.patch new file mode 100644 index 000000000..e06869e3a --- /dev/null +++ b/poky/meta/recipes-extended/mktemp/files/disable-strip.patch @@ -0,0 +1,15 @@ +Upstream-Status: Inappropriate [configuration] + +diff --git a/Makefile.in b/Makefile.in +index 37b3cc9..f1026f3 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -95,7 +95,7 @@ install-dirs: + $(DESTDIR)$(mandir)/man1 + + install-binaries: $(PROG) +- $(INSTALL) -m 0555 -s $(PROG) $(DESTDIR)$(bindir)/$(PROG) ++ $(INSTALL) -m 0555 $(PROG) $(DESTDIR)$(bindir)/$(PROG) + + install-man: + $(INSTALL) -m 0444 $(srcdir)/mktemp.$(mantype) \ diff --git a/poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch b/poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch new file mode 100644 index 000000000..f3b6dcc34 --- /dev/null +++ b/poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch @@ -0,0 +1,24 @@ +This fixes the parallel make install failure + +Upstream-Status: Accepted +http://www.gratisoft.us/bugzilla/show_bug.cgi?id=528 + +Signed-off-by: Saul Wold <sgw@linux.intel.com> + +Index: mktemp-1.7/Makefile.in +=================================================================== +--- mktemp-1.7.orig/Makefile.in ++++ mktemp-1.7/Makefile.in +@@ -94,10 +94,10 @@ install-dirs: + $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \ + $(DESTDIR)$(mandir)/man1 + +-install-binaries: $(PROG) ++install-binaries: install-dirs $(PROG) + $(INSTALL) -m 0555 $(PROG) $(DESTDIR)$(bindir)/$(PROG) + +-install-man: ++install-man: install-dirs + $(INSTALL) -m 0444 $(srcdir)/mktemp.$(mantype) \ + $(DESTDIR)$(mandir)/man1/mktemp.1 + diff --git a/poky/meta/recipes-extended/mktemp/mktemp_1.7.bb b/poky/meta/recipes-extended/mktemp/mktemp_1.7.bb new file mode 100644 index 000000000..e8ae5c6b7 --- /dev/null +++ b/poky/meta/recipes-extended/mktemp/mktemp_1.7.bb @@ -0,0 +1,36 @@ +SUMMARY = "Enables safe temporary file creation from shell scripts" +HOMEPAGE = "http://www.mktemp.org/" +BUGTRACKER = "http://www.mktemp.org/bugs" +SECTION = "console/utils" +LICENSE = "ISC" +LIC_FILES_CHKSUM = "file://LICENSE;md5=430680f6322a1eb87199b5e01a82c0d4" + +PR = "r3" + +SRC_URI = "ftp://ftp.mktemp.org/pub/mktemp/${BPN}-${PV}.tar.gz \ + file://disable-strip.patch \ + file://fix-parallel-make.patch \ + " + +SRC_URI[md5sum] = "787bbed9fa2ee8e7645733c0e8e65172" +SRC_URI[sha256sum] = "8e94b9e1edf866b2609545da65b627996ac5d158fda071e492bddb2f4a482675" + +inherit autotools update-alternatives + +EXTRA_OECONF = "--with-libc" + +do_install_append () { + if [ "${base_bindir}" != "${bindir}" ] ; then + install -d ${D}${base_bindir} + mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp + rmdir ${D}${bindir} + fi +} + +ALTERNATIVE_${PN} = "mktemp" +ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp" +ALTERNATIVE_PRIORITY = "60" + +ALTERNATIVE_${PN}-doc = "mktemp.1" +ALTERNATIVE_PRIORITY_${PN}-doc = "300" +ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1" diff --git a/poky/meta/recipes-extended/msmtp/msmtp_1.6.6.bb b/poky/meta/recipes-extended/msmtp/msmtp_1.6.6.bb new file mode 100644 index 000000000..e1721936c --- /dev/null +++ b/poky/meta/recipes-extended/msmtp/msmtp_1.6.6.bb @@ -0,0 +1,30 @@ +SUMMARY = "msmtp is an SMTP client" +DESCRIPTION = "A sendmail replacement for use in MTAs like mutt" +HOMEPAGE = "http://msmtp.sourceforge.net/" +SECTION = "console/network" + +LICENSE = "GPLv3" +DEPENDS = "zlib gnutls" + +#COPYING or Licence +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +SRC_URI = "http://sourceforge.net/projects/msmtp/files/msmtp/${PV}/${BPN}-${PV}.tar.xz \ + " + +SRC_URI[md5sum] = "82b0520b57db4b2cf05333d11fb5974d" +SRC_URI[sha256sum] = "da15db1f62bd0201fce5310adb89c86188be91cd745b7cb3b62b81a501e7fb5e" + +inherit gettext autotools update-alternatives pkgconfig + +EXTRA_OECONF += "--without-libsecret --without-libgsasl --without-libidn" + +ALTERNATIVE_${PN} = "sendmail" +ALTERNATIVE_TARGET[sendmail] = "${bindir}/msmtp" +ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail" +ALTERNATIVE_PRIORITY = "100" + +pkg_postinst_${PN}_linuxstdbase () { + # /usr/lib/sendmial is required by LSB core test + [ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/ +} diff --git a/poky/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch b/poky/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch new file mode 100644 index 000000000..8be45ccac --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch @@ -0,0 +1,87 @@ +From 08abfcd923e9f37d1902db26771b1dc6731eb265 Mon Sep 17 00:00:00 2001 +From: Jiri Popelka <jpopelka@redhat.com> +Date: Fri, 27 Sep 2013 18:40:06 +0200 +Subject: [PATCH 1/1] lib/inet6.c:INET6_rresolve() - various fixes + +1) Fall-back to numeric address if getnameinfo fails. + Reverse lookup is not mandatory, therefore its fail + is not an error. Just return numeric address in that case. + This makes netstat/route show IPv6 address instead of + [UNKNOWN] in case of DNS problems. + +2) Pass length of 'name' buffer into function. + 'name' is a pointer and therefore sizeof(name) + returns size of pointer and not size of the buffer. + see http://stackoverflow.com/questions/14298710/c-pointers-and-arrays-sizeof-operator + The sizeof() usage was added with commit 604785adc, + so I checked all the other changes in that commit + and they seem to be OK. + +3) remove unused 's' variable + +Upstream-Status: Pending + +Signed-off-by: Shan Hai <shan.hai@windriver.com> +Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> +--- + lib/inet6.c | 21 ++++++++++----------- + 1 file changed, 10 insertions(+), 11 deletions(-) + +diff --git a/lib/inet6.c b/lib/inet6.c +index 9a484a0..2a9c459 100644 +--- a/lib/inet6.c ++++ b/lib/inet6.c +@@ -84,10 +84,9 @@ static int INET6_resolve(char *name, struct sockaddr_in6 *sin6) + #endif + + +-static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric) ++static int INET6_rresolve(char *name, size_t namelen, ++ struct sockaddr_in6 *sin6, int numeric) + { +- int s; +- + /* Grmpf. -FvK */ + if (sin6->sin6_family != AF_INET6) { + #ifdef DEBUG +@@ -98,21 +97,20 @@ static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric) + return (-1); + } + if (numeric & 0x7FFF) { +- inet_ntop( AF_INET6, &sin6->sin6_addr, name, 80); ++ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen); + return (0); + } + if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + if (numeric & 0x8000) +- strcpy(name, "default"); ++ safe_strncpy(name, "default", namelen); + else +- strcpy(name, "[::]"); ++ safe_strncpy(name, "[::]", namelen); + return (0); + } + +- if ((s = getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6), +- name, 255 /* !! */ , NULL, 0, 0))) { +- fputs("getnameinfo failed\n", stderr); +- return -1; ++ if (getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6), ++ name, namelen , NULL, 0, 0)) { ++ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen); + } + return (0); + } +@@ -143,7 +141,8 @@ static char *INET6_sprint(struct sockaddr *sap, int numeric) + + if (sap->sa_family == 0xFFFF || sap->sa_family == 0) + return safe_strncpy(buff, _("[NONE SET]"), sizeof(buff)); +- if (INET6_rresolve(buff, (struct sockaddr_in6 *) sap, numeric) != 0) ++ if (INET6_rresolve(buff, sizeof(buff), ++ (struct sockaddr_in6 *) sap, numeric) != 0) + return safe_strncpy(buff, _("[UNKNOWN]"), sizeof(buff)); + return (fix_v4_address(buff, &((struct sockaddr_in6 *)sap)->sin6_addr)); + } +-- +1.8.5.2.233.g932f7e4 + diff --git a/poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch b/poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch new file mode 100644 index 000000000..06f81420e --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch @@ -0,0 +1,32 @@ +From 81814dc2b14843009193efd307d814c26baa61f0 Mon Sep 17 00:00:00 2001 +From: Jiri Popelka <jpopelka@redhat.com> +Date: Wed, 7 Dec 2011 19:14:09 +0100 +Subject: [PATCH] ifconfig interface:0 del <IP> will remove the aliased IP on IA64 + +Upstream-Status: Backport + +commit 81814dc2b14843009193efd307d814c26baa61f0 from +git://git.code.sf.net/p/net-tools/code + +--- + ifconfig.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/ifconfig.c b/ifconfig.c +index bc405c6..dae8922 100644 +--- a/ifconfig.c ++++ b/ifconfig.c +@@ -890,7 +890,9 @@ int main(int argc, char **argv) + continue; + } + +- memcpy(&ip, &sin.sin_addr.s_addr, sizeof(unsigned long)); ++ /* Clear "ip" in case sizeof(unsigned long) > sizeof(sin.sin_addr.s_addr) */ ++ ip = 0; ++ memcpy(&ip, &sin.sin_addr.s_addr, sizeof(sin.sin_addr.s_addr)); + + if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) { + fprintf(stderr, _("Interface %s not initialized\n"), +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch b/poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch new file mode 100644 index 000000000..f694d594b --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch @@ -0,0 +1,100 @@ +Adjust headers for non-glibc cases +especially exposed by musl + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending + +Index: net-tools-1.60/lib/inet6_gr.c +=================================================================== +--- net-tools-1.60.orig/lib/inet6_gr.c ++++ net-tools-1.60/lib/inet6_gr.c +@@ -23,7 +23,7 @@ + #include <string.h> + #include <stdio.h> + #include <unistd.h> +-#ifndef __GLIBC__ ++#ifdef HAVE_IPV6_ROUTE_H + #include <netinet6/ipv6_route.h> /* glibc doesn't have this */ + #endif + #include "version.h" +Index: net-tools-1.60/lib/inet6_sr.c +=================================================================== +--- net-tools-1.60.orig/lib/inet6_sr.c ++++ net-tools-1.60/lib/inet6_sr.c +@@ -23,10 +23,10 @@ + #include <string.h> + #include <stdio.h> + #include <unistd.h> +-#ifdef __GLIBC__ +-#include <net/route.h> +-#else ++#ifdef HAVE_IPV6_ROUTE_H + #include <netinet6/ipv6_route.h> /* glibc does not have this */ ++#else ++#include <net/route.h> + #endif + #include "version.h" + #include "net-support.h" +Index: net-tools-1.60/lib/inet_sr.c +=================================================================== +--- net-tools-1.60.orig/lib/inet_sr.c ++++ net-tools-1.60/lib/inet_sr.c +@@ -26,6 +26,7 @@ + #include <string.h> + #include <stdio.h> + #include <unistd.h> ++#include <asm-generic/param.h> + #include "version.h" + #include "net-support.h" + #include "pathnames.h" +Index: net-tools-1.60/lib/util-ank.c +=================================================================== +--- net-tools-1.60.orig/lib/util-ank.c ++++ net-tools-1.60/lib/util-ank.c +@@ -14,6 +14,7 @@ + * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses + */ + ++#include <limits.h> + #include <stdio.h> + #include <stdlib.h> + #include <unistd.h> +Index: net-tools-1.60/mii-tool.c +=================================================================== +--- net-tools-1.60.orig/mii-tool.c ++++ net-tools-1.60/mii-tool.c +@@ -47,10 +47,6 @@ static char Version[] = "$Id: mii-tool.c + #include <net/if.h> + #include <linux/sockios.h> + +-#ifndef __GLIBC__ +-#include <linux/if_arp.h> +-#include <linux/if_ether.h> +-#endif + #include "mii.h" + #include "version.h" + +Index: net-tools-1.60/netstat.c +=================================================================== +--- net-tools-1.60.orig/netstat.c ++++ net-tools-1.60/netstat.c +@@ -87,6 +87,7 @@ + #include <dirent.h> + #include <sys/stat.h> + #include <sys/types.h> ++#include <asm-generic/param.h> + + #include "net-support.h" + #include "pathnames.h" +Index: net-tools-1.60/slattach.c +=================================================================== +--- net-tools-1.60.orig/slattach.c ++++ net-tools-1.60/slattach.c +@@ -44,6 +44,7 @@ + #include <string.h> + #include <unistd.h> + #include <getopt.h> ++#include <termios.h> + #include <linux/if_slip.h> + + #if defined(__GLIBC__) diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch new file mode 100644 index 000000000..78daf6c3e --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch @@ -0,0 +1,635 @@ +From 23276afe270009420cfbc52bffafdd25ac0817fe Mon Sep 17 00:00:00 2001 +From: Li Zhou <li.zhou@windriver.com> +Date: Thu, 14 Jan 2016 17:01:29 +0800 +Subject: [PATCH 1/3] net-tools: add SCTP support for netstat + +Upstream-Status: pending + +Signed-off-by: Li Zhou <li.zhou@windriver.com> +--- + netstat.c | 411 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- + statistics.c | 68 +++++++++- + 2 files changed, 465 insertions(+), 14 deletions(-) + +Index: net-tools-1.60/netstat.c +=================================================================== +--- net-tools-1.60.orig/netstat.c ++++ net-tools-1.60/netstat.c +@@ -58,6 +58,7 @@ + * + *990420 {1.38} Tuan Hoang removed a useless assignment from igmp_do_one() + *20010404 {1.39} Arnaldo Carvalho de Melo - use setlocale ++ *20050516 {1.40} Ivan Skytte Joergensen:Added SCTP support + * + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General +@@ -106,7 +107,7 @@ + #endif + + /* prototypes for statistics.c */ +-void parsesnmp(int, int, int); ++void parsesnmp(int, int, int, int); + void inittab(void); + void parsesnmp6(int, int, int); + void inittab6(void); +@@ -119,6 +120,28 @@ typedef enum { + SS_DISCONNECTING /* in process of disconnecting */ + } socket_state; + ++#define SCTP_NSTATES 9 /* The number of states in array*/ ++ ++static const char *sctp_state[] = { ++ N_("EMPTY"), ++ N_("CLOSED"), ++ N_("COOKIE_WAIT"), ++ N_("COOKIE_ECHOED"), ++ N_("ESTABLISHED"), ++ N_("SHUTDOWN_PENDING"), ++ N_("SHUTDOWN_SENT"), ++ N_("SHUTDOWN_RECEIVED"), ++ N_("SHUTDOWN_ACK_SENT") ++}; ++ ++#define SCTP_NTYPES 3 /* The number of types in array */ ++ ++static const char *sctp_type[] = { ++ N_("udp"), ++ N_("udp-high-bw"), ++ N_("tcp") ++}; ++ + #define SO_ACCEPTCON (1<<16) /* performed a listen */ + #define SO_WAITDATA (1<<17) /* wait data to read */ + #define SO_NOSPACE (1<<18) /* no space to write */ +@@ -149,6 +172,7 @@ int flag_opt = 0; + int flag_raw = 0; + int flag_tcp = 0; + int flag_udp = 0; ++int flag_sctp= 0; + int flag_igmp= 0; + int flag_rom = 0; + int flag_exp = 1; +@@ -995,6 +1019,365 @@ static int udp_info(void) + udp_do_one); + } + ++static const char *sctp_socket_type_str(int type) { ++ if(type>=0 && type<SCTP_NTYPES) ++ return sctp_type[type]; ++ else { ++ static char type_str_buf[64]; ++ sprintf(type_str_buf,"UNKNOWN(%d)",type); ++ return type_str_buf; ++ } ++} ++ ++static const char *sctp_state_str(int state) ++{ ++ if(state>=0 && state<SCTP_NSTATES) ++ return sctp_state[state]; ++ else { ++ static char state_str_buf[64]; ++ sprintf(state_str_buf,"UNKNOWN(%d)",state); ++ return state_str_buf; ++ } ++} ++ ++static const char *sctp_socket_state_str(int state) ++{ ++ if(state>=0 && state<=10) ++ return tcp_state[state]; ++ else { ++ static char state_str_buf[64]; ++ sprintf(state_str_buf,"UNKNOWN(%d)",state); ++ return state_str_buf; ++ } ++} ++ ++static struct aftype *process_sctp_addr_str(const char *addr_str, struct sockaddr *sa) ++{ ++ if (strchr(addr_str,':')) { ++#if HAVE_AFINET6 ++ extern struct aftype inet6_aftype; ++ /* Demangle what the kernel gives us */ ++ struct in6_addr in6; ++ char addr6_str[INET6_ADDRSTRLEN]; ++ unsigned u0,u1,u2,u3,u4,u5,u6,u7; ++ sscanf(addr_str, "%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X", ++ &u0, &u1, &u2, &u3, &u4, &u5, &u6, &u7); ++ in6.s6_addr16[0] = htons(u0); ++ in6.s6_addr16[1] = htons(u1); ++ in6.s6_addr16[2] = htons(u2); ++ in6.s6_addr16[3] = htons(u3); ++ in6.s6_addr16[4] = htons(u4); ++ in6.s6_addr16[5] = htons(u5); ++ in6.s6_addr16[6] = htons(u6); ++ in6.s6_addr16[7] = htons(u7); ++ ++ inet_ntop(AF_INET6, &in6, addr6_str, sizeof(addr6_str)); ++ inet6_aftype.input(1, addr6_str, sa); ++ sa->sa_family = AF_INET6; ++#endif ++ } else { ++ ((struct sockaddr_in*)sa)->sin_addr.s_addr = inet_addr(addr_str); ++ sa->sa_family = AF_INET; ++ } ++ return get_afntype(sa->sa_family); ++} ++ ++static void sctp_eps_do_one(int lnr, char *line) ++{ ++ char buffer[1024]; ++ int type, state, port; ++ int uid; ++ unsigned long inode; ++ ++ struct aftype *ap; ++#if HAVE_AFINET6 ++ struct sockaddr_in6 localaddr; ++#else ++ struct sockaddr_in localaddr; ++#endif ++ const char *sty_str; ++ const char *sst_str; ++ const char *lport_str; ++ const char *uid_str; ++ const char *inode_str; ++ const char *pladdr_str; ++ char *laddrs_str; ++ ++ if(lnr == 0) { ++ /* ENDPT SOCK STY SST HBKT LPORT uid inode pladdr LADDRS*/ ++ return; ++ } ++ ++ strtok(line," \t\n"); /*skip ptr*/ ++ strtok(0," \t\n"); /*skip ptr*/ ++ sty_str = strtok(0," \t\n"); ++ sst_str = strtok(0," \t\n"); ++ strtok(0," \t\n"); /*skip hash bucket*/ ++ lport_str=strtok(0," \t\n"); ++ uid_str = strtok(0," \t\n"); ++ inode_str = strtok(0," \t\n"); ++ pladdr_str = strtok(0," \t\n"); ++ laddrs_str=strtok(0,"\t\n"); ++ ++ type = atoi(sty_str); ++ state = atoi(sst_str); ++ port = atoi(lport_str); ++ uid = atoi(uid_str); ++ inode = strtoul(inode_str,0,0); ++ ++ if(flag_sctp<=1) { ++ /* only print the primary address */ ++ char local_addr[64]; ++ char local_port[16]; ++ ++ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr); ++ if(ap) ++ safe_strncpy(local_addr, ++ ap->sprint((struct sockaddr *) &localaddr, flag_not), ++ sizeof(local_addr)); ++ else ++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); ++ ++ snprintf(local_port, sizeof(local_port), "%s", ++ get_sname(htons(port), "sctp", ++ flag_not & FLAG_NUM_PORT)); ++ ++ printf("sctp "); ++ sprintf(buffer,"%s:%s", local_addr, local_port); ++ printf("%-47s", buffer); ++ printf(" %-12s", sctp_socket_state_str(state)); ++ } else { ++ /*print all addresses*/ ++ const char *this_local_addr; ++ int first=1; ++ char local_port[16]; ++ snprintf(local_port, sizeof(local_port), "%s", ++ get_sname(htons(port), "sctp", ++ flag_not & FLAG_NUM_PORT)); ++ for(this_local_addr=strtok(laddrs_str," \t\n"); ++ this_local_addr; ++ this_local_addr=strtok(0," \t\n")) ++ { ++ char local_addr[64]; ++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); ++ if(ap) ++ safe_strncpy(local_addr, ++ ap->sprint((struct sockaddr *) &localaddr, flag_not), ++ sizeof(local_addr)); ++ else ++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); ++ ++ if(!first) printf("\n"); ++ if(first) ++ printf("sctp "); ++ else ++ printf(" "); ++ sprintf(buffer,"%s:%s", local_addr, local_port); ++ printf("%-47s", buffer); ++ printf(" %-12s", first?sctp_socket_state_str(state):""); ++ first = 0; ++ } ++ } ++ ++ finish_this_one(uid,inode,""); ++} ++ ++static void sctp_assoc_do_one(int lnr, char *line) ++{ ++ char buffer[1024]; ++ int type, state, state2, lport,rport; ++ int uid; ++ unsigned rxqueue,txqueue; ++ unsigned long inode; ++ ++ struct aftype *ap; ++#if HAVE_AFINET6 ++ struct sockaddr_in6 localaddr,remoteaddr; ++#else ++ struct sockaddr_in localaddr,remoteaddr; ++#endif ++ const char *sty_str; ++ const char *sst_str; ++ const char *st_str; ++ const char *txqueue_str; ++ const char *rxqueue_str; ++ const char *lport_str,*rport_str; ++ const char *uid_str; ++ const char *inode_str; ++ const char *pladdr_str; ++ char *laddrs_str; ++ const char *praddr_str; ++ char *raddrs_str; ++ ++ if(lnr == 0) { ++ /* ASSOC SOCK STY SST ST HBKT tx_queue rx_queue uid inode LPORT RPORT pladdr praddr LADDRS <-> RADDRS*/ ++ return; ++ } ++ ++ strtok(line," \t\n"); /*skip ptr*/ ++ strtok(0," \t\n"); /*skip ptr*/ ++ sty_str = strtok(0," \t\n"); ++ sst_str = strtok(0," \t\n"); ++ st_str = strtok(0," \t\n"); ++ strtok(0," \t\n"); /*skip hash bucket*/ ++ txqueue_str = strtok(0," \t\n"); ++ rxqueue_str = strtok(0," \t\n"); ++ uid_str = strtok(0," \t\n"); ++ inode_str = strtok(0," \t\n"); ++ lport_str=strtok(0," \t\n"); ++ rport_str=strtok(0," \t\n"); ++ pladdr_str = strtok(0," \t\n"); ++ praddr_str = strtok(0," \t\n"); ++ laddrs_str=strtok(0,"<->\t\n"); ++ raddrs_str=strtok(0,"<->\t\n"); ++ ++ type = atoi(sty_str); ++ state = atoi(sst_str); ++ state2 = atoi(st_str); ++ txqueue = atoi(txqueue_str); ++ rxqueue = atoi(rxqueue_str); ++ uid = atoi(uid_str); ++ inode = strtoul(inode_str,0,0); ++ lport = atoi(lport_str); ++ rport = atoi(rport_str); ++ ++ if(flag_sctp<=1) { ++ /* only print the primary addresses */ ++ char local_addr[64]; ++ char local_port[16]; ++ char remote_addr[64]; ++ char remote_port[16]; ++ ++ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr); ++ if(ap) ++ safe_strncpy(local_addr, ++ ap->sprint((struct sockaddr *) &localaddr, flag_not), ++ sizeof(local_addr)); ++ else ++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); ++ ++ snprintf(local_port, sizeof(local_port), "%s", ++ get_sname(htons(lport), "sctp", ++ flag_not & FLAG_NUM_PORT)); ++ ++ ap = process_sctp_addr_str(praddr_str, (struct sockaddr*)&remoteaddr); ++ if(ap) ++ safe_strncpy(remote_addr, ++ ap->sprint((struct sockaddr *) &remoteaddr, flag_not), ++ sizeof(remote_addr)); ++ else ++ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family); ++ ++ snprintf(remote_port, sizeof(remote_port), "%s", ++ get_sname(htons(rport), "sctp", ++ flag_not & FLAG_NUM_PORT)); ++ ++ printf("sctp"); ++ printf(" %6u %6u ", rxqueue, txqueue); ++ sprintf(buffer,"%s:%s", local_addr, local_port); ++ printf("%-23s", buffer); ++ printf(" "); ++ sprintf(buffer,"%s:%s", remote_addr, remote_port); ++ printf("%-23s", buffer); ++ printf(" %-12s", sctp_socket_state_str(state)); ++ } else { ++ /*print all addresses*/ ++ const char *this_local_addr; ++ const char *this_remote_addr; ++ char *ss1,*ss2; ++ int first=1; ++ char local_port[16]; ++ char remote_port[16]; ++ snprintf(local_port, sizeof(local_port), "%s", ++ get_sname(htons(lport), "sctp", ++ flag_not & FLAG_NUM_PORT)); ++ snprintf(remote_port, sizeof(remote_port), "%s", ++ get_sname(htons(rport), "sctp", ++ flag_not & FLAG_NUM_PORT)); ++ ++ this_local_addr=strtok_r(laddrs_str," \t\n",&ss1); ++ this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2); ++ while(this_local_addr || this_remote_addr) { ++ char local_addr[64]; ++ char remote_addr[64]; ++ if(this_local_addr) { ++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); ++ if(ap) ++ safe_strncpy(local_addr, ++ ap->sprint((struct sockaddr *) &localaddr, flag_not), ++ sizeof(local_addr)); ++ else ++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); ++ } ++ if(this_remote_addr) { ++ ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr); ++ if(ap) ++ safe_strncpy(remote_addr, ++ ap->sprint((struct sockaddr *) &remoteaddr, flag_not), ++ sizeof(remote_addr)); ++ else ++ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family); ++ } ++ ++ if(!first) printf("\n"); ++ if(first) ++ printf("sctp %6u %6u ", rxqueue, txqueue); ++ else ++ printf(" "); ++ if(this_local_addr) { ++ if(first) ++ sprintf(buffer,"%s:%s", local_addr, local_port); ++ else ++ sprintf(buffer,"%s", local_addr); ++ printf("%-23s", buffer); ++ } else ++ printf("%-23s", ""); ++ printf(" "); ++ if(this_remote_addr) { ++ if(first) ++ sprintf(buffer,"%s:%s", remote_addr, remote_port); ++ else ++ sprintf(buffer,"%s", remote_addr); ++ printf("%-23s", buffer); ++ } else ++ printf("%-23s", ""); ++ ++ printf(" %-12s", first?sctp_socket_state_str(state):""); ++ ++ first = 0; ++ this_local_addr=strtok_r(0," \t\n",&ss1); ++ this_remote_addr=strtok_r(0," \t\n",&ss2); ++ } ++ } ++ ++ finish_this_one(uid,inode,""); ++} ++ ++static int sctp_info_eps(void) ++{ ++#if !defined(_PATH_PROCNET_SCTP_EPS) ++#define _PATH_PROCNET_SCTP_EPS "/proc/net/sctp/eps" ++#endif ++ INFO_GUTS(_PATH_PROCNET_SCTP_EPS, "AF INET (sctp)", ++ sctp_eps_do_one); ++} ++ ++static int sctp_info_assocs(void) ++{ ++#if !defined(_PATH_PROCNET_SCTP_ASSOCS) ++#define _PATH_PROCNET_SCTP_ASSOCS "/proc/net/sctp/assocs" ++#endif ++ INFO_GUTS(_PATH_PROCNET_SCTP_ASSOCS, "AF INET (sctp)", ++ sctp_assoc_do_one); ++} ++ ++static int sctp_info(void) ++{ ++ if(flag_all) ++ sctp_info_eps(); ++ return sctp_info_assocs(); ++} ++ + static void raw_do_one(int lnr, const char *line) + { + char buffer[8192], local_addr[64], rem_addr[64]; +@@ -1558,7 +1941,7 @@ static void usage(void) + fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\n")); + fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n\n")); + +- fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n")); ++ fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-S|--sctp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n")); + fprintf(stderr, _(" <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF); + fprintf(stderr, _(" List of possible address families (which support routing):\n")); + print_aflist(1); /* 1 = routeable */ +@@ -1583,6 +1966,7 @@ int main + {"protocol", 1, 0, 'A'}, + {"tcp", 0, 0, 't'}, + {"udp", 0, 0, 'u'}, ++ {"sctp", 0, 0, 'S' }, + {"raw", 0, 0, 'w'}, + {"unix", 0, 0, 'x'}, + {"listening", 0, 0, 'l'}, +@@ -1613,7 +1997,7 @@ int main + getroute_init(); /* Set up AF routing support */ + + afname[0] = '\0'; +- while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuWVv?wxl64", longopts, &lop)) != EOF) ++ while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuSWVv?wxl64", longopts, &lop)) != EOF) + switch (i) { + case -1: + break; +@@ -1705,10 +2089,12 @@ int main + case 't': + flag_tcp++; + break; +- + case 'u': + flag_udp++; + break; ++ case 'S': ++ flag_sctp++; ++ break; + case 'w': + flag_raw++; + break; +@@ -1726,13 +2112,13 @@ int main + if (flag_int + flag_rou + flag_mas + flag_sta > 1) + usage(); + +- if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_raw)) +- flag_tcp = flag_udp = flag_raw = 1; ++ if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw)) ++ flag_tcp = flag_udp = flag_sctp = flag_raw = 1; + +- if ((flag_tcp || flag_udp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6)) ++ if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6)) + flag_inet = flag_inet6 = 1; + +- flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx ++ flag_arg = flag_tcp + flag_udp + flag_sctp + flag_raw + flag_unx + flag_ipx + + flag_ax25 + flag_netrom + flag_igmp + flag_x25; + + if (flag_mas) { +@@ -1760,7 +2146,7 @@ int main + char buf[256]; + if (!afname[0]) { + inittab(); +- parsesnmp(flag_raw, flag_tcp, flag_udp); ++ parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp); + } else { + safe_strncpy(buf, afname, sizeof(buf)); + tmp1 = buf; +@@ -1815,7 +2201,7 @@ int main + return (i); + } + for (;;) { +- if (!flag_arg || flag_tcp || flag_udp || flag_raw) { ++ if (!flag_arg || flag_tcp || flag_udp || flag_sctp || flag_raw) { + #if HAVE_AFINET + prg_cache_load(); + printf(_("Active Internet connections ")); /* xxx */ +@@ -1854,6 +2240,11 @@ int main + if (i) + return (i); + } ++ if (!flag_arg || flag_sctp) { ++ i = sctp_info(); ++ if (i) ++ return (i); ++ } + if (!flag_arg || flag_raw) { + i = raw_info(); + if (i) +Index: net-tools-1.60/statistics.c +=================================================================== +--- net-tools-1.60.orig/statistics.c ++++ net-tools-1.60/statistics.c +@@ -21,7 +21,7 @@ + #define UFWARN(x) + #endif + +-int print_static,f_raw,f_tcp,f_udp,f_unknown = 1; ++int print_static,f_raw,f_tcp,f_udp,f_sctp,f_unknown = 1; + + enum State { + number = 0, opt_number, i_forward, i_inp_icmp, i_outp_icmp, i_rto_alg, +@@ -297,6 +297,27 @@ struct entry Tcpexttab[] = + { "TCPRenoRecoveryFail", N_("%llu classic Reno fast retransmits failed"), opt_number }, + }; + ++struct entry Sctptab[] = ++{ ++ {"SctpCurrEstab", N_("%u Current Associations"), number}, ++ {"SctpActiveEstabs", N_("%u Active Associations"), number}, ++ {"SctpPassiveEstabs", N_("%u Passive Associations"), number}, ++ {"SctpAborteds", N_("%u Number of Aborteds "), number}, ++ {"SctpShutdowns", N_("%u Number of Graceful Terminations"), number}, ++ {"SctpOutOfBlues", N_("%u Number of Out of Blue packets"), number}, ++ {"SctpChecksumErrors", N_("%u Number of Packets with invalid Checksum"), number}, ++ {"SctpOutCtrlChunks", N_("%u Number of control chunks sent"), number}, ++ {"SctpOutOrderChunks", N_("%u Number of ordered chunks sent"), number}, ++ {"SctpOutUnorderChunks", N_("%u Number of Unordered chunks sent"), number}, ++ {"SctpInCtrlChunks", N_("%u Number of control chunks received"), number}, ++ {"SctpInOrderChunks", N_("%u Number of ordered chunks received"), number}, ++ {"SctpInUnorderChunks", N_("%u Number of Unordered chunks received"), number}, ++ {"SctpFragUsrMsgs", N_("%u Number of messages fragmented"), number}, ++ {"SctpReasmUsrMsgs", N_("%u Number of messages reassembled "), number}, ++ {"SctpOutSCTPPacks", N_("%u Number of SCTP packets sent"), number}, ++ {"SctpInSCTPPacks", N_("%u Number of SCTP packets received"), number}, ++}; ++ + struct tabtab { + char *title; + struct entry *tab; +@@ -310,6 +331,7 @@ struct tabtab snmptabs[] = + {"Icmp", Icmptab, sizeof(Icmptab), &f_raw}, + {"Tcp", Tcptab, sizeof(Tcptab), &f_tcp}, + {"Udp", Udptab, sizeof(Udptab), &f_udp}, ++ {"Sctp", Sctptab, sizeof(Sctptab), &f_sctp}, + {"TcpExt", Tcpexttab, sizeof(Tcpexttab), &f_tcp}, + {NULL} + }; +@@ -499,12 +521,40 @@ void process6_fd(FILE *f) + + } + +-void parsesnmp(int flag_raw, int flag_tcp, int flag_udp) ++/* Process a file with name-value lines (like /proc/net/sctp/snmp) */ ++void process_fd2(FILE *f, const char *filename) ++{ ++ char buf1[1024]; ++ char *sp; ++ struct tabtab *tab; ++ ++ tab = newtable(snmptabs, "Sctp"); ++ ++ while (fgets(buf1, sizeof buf1, f)) { ++ sp = buf1 + strcspn(buf1, " \t\n"); ++ if (!sp) ++ goto formaterr; ++ *sp = '\0'; ++ sp++; ++ ++ sp += strspn(sp, " \t\n"); ++ ++ if (*sp != '\0' && *(tab->flag)) ++ printval(tab, buf1, strtoul(sp, 0, 10)); ++ } ++ return; ++ ++formaterr: ++ fprintf(stderr,_("error parsing %s\n"), filename); ++ return; ++} ++ ++void parsesnmp(int flag_raw, int flag_tcp, int flag_udp, int flag_sctp) + { + FILE *f; + +- f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp; +- ++ f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp; f_sctp = flag_sctp; ++ + f = proc_fopen("/proc/net/snmp"); + if (!f) { + perror(_("cannot open /proc/net/snmp")); +@@ -530,6 +580,16 @@ void parsesnmp(int flag_raw, int flag_tc + + fclose(f); + } ++ ++ f = fopen("/proc/net/sctp/snmp", "r"); ++ if (f) { ++ process_fd2(f,"/proc/net/sctp/snmp"); ++ if (ferror(f)) ++ perror("/proc/net/sctp/snmp"); ++ ++ fclose(f); ++ } ++ + return; + } + diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch new file mode 100644 index 000000000..d34e65132 --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch @@ -0,0 +1,28 @@ +From 14287b594e1f02b811f889fb515c1a51b72c08d4 Mon Sep 17 00:00:00 2001 +From: Li Zhou <li.zhou@windriver.com> +Date: Thu, 14 Jan 2016 17:07:48 +0800 +Subject: [PATCH 2/3] net-tools: add SCTP support for netstat + +Upstream-Status: pending + +Signed-off-by: Li Zhou <li.zhou@windriver.com> +--- + netstat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/netstat.c b/netstat.c +index 5d1a4a1..56a15c2 100644 +--- a/netstat.c ++++ b/netstat.c +@@ -2104,7 +2104,7 @@ int main + usage(); + + if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw)) +- flag_tcp = flag_udp = flag_sctp = flag_raw = 1; ++ flag_tcp = flag_udp = flag_raw = 1; + + if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6)) + flag_inet = flag_inet6 = 1; +-- +1.8.5.2.233.g932f7e4 + diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch new file mode 100644 index 000000000..8b2ecab70 --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch @@ -0,0 +1,363 @@ +From 1d386279a449a1a6b96b88a71f35bf13b14b2c2c Mon Sep 17 00:00:00 2001 +From: Li Zhou <li.zhou@windriver.com> +Date: Thu, 14 Jan 2016 17:11:24 +0800 +Subject: [PATCH 3/3] net-tools: add SCTP support for netstat + +Upstream-Status: pending + +Signed-off-by: Li Zhou <li.zhou@windriver.com> +--- + netstat.c | 282 ++++++++++++++++++++++++-------------------------------------- + 1 file changed, 108 insertions(+), 174 deletions(-) + +diff --git a/netstat.c b/netstat.c +index 56a15c2..86adadb 100644 +--- a/netstat.c ++++ b/netstat.c +@@ -1095,23 +1095,21 @@ static void sctp_eps_do_one(int lnr, char *line) + const char *lport_str; + const char *uid_str; + const char *inode_str; +- const char *pladdr_str; + char *laddrs_str; + + if(lnr == 0) { +- /* ENDPT SOCK STY SST HBKT LPORT uid inode pladdr LADDRS*/ ++ /* ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS */ + return; + } + +- strtok(line," \t\n"); /*skip ptr*/ +- strtok(0," \t\n"); /*skip ptr*/ ++ strtok(line," \t\n"); /*skip endpt*/ ++ strtok(0," \t\n"); /*skip sock*/ + sty_str = strtok(0," \t\n"); + sst_str = strtok(0," \t\n"); + strtok(0," \t\n"); /*skip hash bucket*/ + lport_str=strtok(0," \t\n"); + uid_str = strtok(0," \t\n"); + inode_str = strtok(0," \t\n"); +- pladdr_str = strtok(0," \t\n"); + laddrs_str=strtok(0,"\t\n"); + + type = atoi(sty_str); +@@ -1119,61 +1117,35 @@ static void sctp_eps_do_one(int lnr, char *line) + port = atoi(lport_str); + uid = atoi(uid_str); + inode = strtoul(inode_str,0,0); +- +- if(flag_sctp<=1) { +- /* only print the primary address */ +- char local_addr[64]; +- char local_port[16]; +- +- ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr); +- if(ap) +- safe_strncpy(local_addr, +- ap->sprint((struct sockaddr *) &localaddr, flag_not), +- sizeof(local_addr)); +- else +- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); +- +- snprintf(local_port, sizeof(local_port), "%s", +- get_sname(htons(port), "sctp", +- flag_not & FLAG_NUM_PORT)); +- +- printf("sctp "); +- sprintf(buffer,"%s:%s", local_addr, local_port); +- printf("%-47s", buffer); +- printf(" %-12s", sctp_socket_state_str(state)); +- } else { +- /*print all addresses*/ +- const char *this_local_addr; +- int first=1; +- char local_port[16]; +- snprintf(local_port, sizeof(local_port), "%s", +- get_sname(htons(port), "sctp", +- flag_not & FLAG_NUM_PORT)); +- for(this_local_addr=strtok(laddrs_str," \t\n"); +- this_local_addr; +- this_local_addr=strtok(0," \t\n")) +- { +- char local_addr[64]; +- ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); +- if(ap) +- safe_strncpy(local_addr, +- ap->sprint((struct sockaddr *) &localaddr, flag_not), +- sizeof(local_addr)); +- else +- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); + +- if(!first) printf("\n"); +- if(first) +- printf("sctp "); +- else +- printf(" "); +- sprintf(buffer,"%s:%s", local_addr, local_port); +- printf("%-47s", buffer); +- printf(" %-12s", first?sctp_socket_state_str(state):""); +- first = 0; +- } ++ const char *this_local_addr; ++ int first=1; ++ char local_port[16]; ++ snprintf(local_port, sizeof(local_port), "%s", ++ get_sname(htons(port), "sctp", flag_not & FLAG_NUM_PORT)); ++ for(this_local_addr=strtok(laddrs_str," \t\n"); ++ this_local_addr; ++ this_local_addr=strtok(0," \t\n")) ++ { ++ char local_addr[64]; ++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); ++ if(ap) ++ safe_strncpy(local_addr, ++ ap->sprint((struct sockaddr *) &localaddr, flag_not), ++ sizeof(local_addr)); ++ else ++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); ++ ++ if(!first) printf("\n"); ++ if(first) ++ printf("sctp "); ++ else ++ printf(" "); ++ sprintf(buffer,"%s:%s", local_addr, local_port); ++ printf("%-55s", buffer); ++ printf(" %-12s", first?sctp_socket_state_str(state):""); ++ first = 0; + } +- + finish_this_one(uid,inode,""); + } + +@@ -1199,32 +1171,29 @@ static void sctp_assoc_do_one(int lnr, char *line) + const char *lport_str,*rport_str; + const char *uid_str; + const char *inode_str; +- const char *pladdr_str; + char *laddrs_str; +- const char *praddr_str; + char *raddrs_str; +- ++ + if(lnr == 0) { +- /* ASSOC SOCK STY SST ST HBKT tx_queue rx_queue uid inode LPORT RPORT pladdr praddr LADDRS <-> RADDRS*/ ++ /* ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT RPORT LADDRS <-> RADDRS */ + return; + } +- +- strtok(line," \t\n"); /*skip ptr*/ +- strtok(0," \t\n"); /*skip ptr*/ ++ ++ strtok(line," \t\n"); /*skip assoc*/ ++ strtok(0," \t\n"); /*skip sock*/ + sty_str = strtok(0," \t\n"); + sst_str = strtok(0," \t\n"); + st_str = strtok(0," \t\n"); + strtok(0," \t\n"); /*skip hash bucket*/ ++ strtok(0," \t\n"); /*skip hash assoc-id*/ + txqueue_str = strtok(0," \t\n"); + rxqueue_str = strtok(0," \t\n"); + uid_str = strtok(0," \t\n"); + inode_str = strtok(0," \t\n"); + lport_str=strtok(0," \t\n"); + rport_str=strtok(0," \t\n"); +- pladdr_str = strtok(0," \t\n"); +- praddr_str = strtok(0," \t\n"); +- laddrs_str=strtok(0,"<->\t\n"); +- raddrs_str=strtok(0,"<->\t\n"); ++ laddrs_str = strtok(0,"<->\t\n"); ++ raddrs_str = strtok(0,"<->\t\n"); + + type = atoi(sty_str); + state = atoi(sst_str); +@@ -1235,116 +1204,81 @@ static void sctp_assoc_do_one(int lnr, char *line) + inode = strtoul(inode_str,0,0); + lport = atoi(lport_str); + rport = atoi(rport_str); +- +- if(flag_sctp<=1) { +- /* only print the primary addresses */ +- char local_addr[64]; +- char local_port[16]; +- char remote_addr[64]; +- char remote_port[16]; +- +- ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr); +- if(ap) +- safe_strncpy(local_addr, +- ap->sprint((struct sockaddr *) &localaddr, flag_not), +- sizeof(local_addr)); +- else +- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); +- +- snprintf(local_port, sizeof(local_port), "%s", +- get_sname(htons(lport), "sctp", +- flag_not & FLAG_NUM_PORT)); +- +- ap = process_sctp_addr_str(praddr_str, (struct sockaddr*)&remoteaddr); +- if(ap) +- safe_strncpy(remote_addr, +- ap->sprint((struct sockaddr *) &remoteaddr, flag_not), +- sizeof(remote_addr)); +- else +- sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family); +- +- snprintf(remote_port, sizeof(remote_port), "%s", +- get_sname(htons(rport), "sctp", +- flag_not & FLAG_NUM_PORT)); +- +- printf("sctp"); +- printf(" %6u %6u ", rxqueue, txqueue); +- sprintf(buffer,"%s:%s", local_addr, local_port); +- printf("%-23s", buffer); +- printf(" "); +- sprintf(buffer,"%s:%s", remote_addr, remote_port); +- printf("%-23s", buffer); +- printf(" %-12s", sctp_socket_state_str(state)); +- } else { +- /*print all addresses*/ +- const char *this_local_addr; +- const char *this_remote_addr; +- char *ss1,*ss2; +- int first=1; +- char local_port[16]; +- char remote_port[16]; +- snprintf(local_port, sizeof(local_port), "%s", +- get_sname(htons(lport), "sctp", +- flag_not & FLAG_NUM_PORT)); +- snprintf(remote_port, sizeof(remote_port), "%s", +- get_sname(htons(rport), "sctp", +- flag_not & FLAG_NUM_PORT)); +- +- this_local_addr=strtok_r(laddrs_str," \t\n",&ss1); +- this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2); +- while(this_local_addr || this_remote_addr) { +- char local_addr[64]; +- char remote_addr[64]; +- if(this_local_addr) { +- ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); +- if(ap) +- safe_strncpy(local_addr, +- ap->sprint((struct sockaddr *) &localaddr, flag_not), +- sizeof(local_addr)); +- else +- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); +- } +- if(this_remote_addr) { +- ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr); +- if(ap) +- safe_strncpy(remote_addr, +- ap->sprint((struct sockaddr *) &remoteaddr, flag_not), +- sizeof(remote_addr)); +- else +- sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family); +- } + +- if(!first) printf("\n"); +- if(first) +- printf("sctp %6u %6u ", rxqueue, txqueue); +- else +- printf(" "); +- if(this_local_addr) { +- if(first) +- sprintf(buffer,"%s:%s", local_addr, local_port); ++ /*print all addresses*/ ++ const char *this_local_addr; ++ const char *this_remote_addr; ++ char *ss1,*ss2; ++ int first=1; ++ char local_port[16]; ++ char remote_port[16]; ++ snprintf(local_port, sizeof(local_port), "%s", ++ get_sname(htons(lport), "sctp", ++ flag_not & FLAG_NUM_PORT)); ++ snprintf(remote_port, sizeof(remote_port), "%s", ++ get_sname(htons(rport), "sctp", ++ flag_not & FLAG_NUM_PORT)); ++ ++ this_local_addr=strtok_r(laddrs_str," \t\n",&ss1); ++ this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2); ++ while(this_local_addr || this_remote_addr) { ++ char local_addr[64]; ++ char remote_addr[64]; ++ ++ if(this_local_addr) { ++ if (this_local_addr[0] == '*') { ++ /* skip * */ ++ this_local_addr++; ++ } ++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); ++ if(ap) ++ safe_strncpy(local_addr, ++ ap->sprint((struct sockaddr *) &localaddr, flag_not), sizeof(local_addr)); + else +- sprintf(buffer,"%s", local_addr); +- printf("%-23s", buffer); +- } else +- printf("%-23s", ""); +- printf(" "); +- if(this_remote_addr) { +- if(first) +- sprintf(buffer,"%s:%s", remote_addr, remote_port); ++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); ++ } ++ if(this_remote_addr) { ++ if (this_remote_addr[0] == '*') { ++ /* skip * */ ++ this_remote_addr++; ++ } ++ ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr); ++ if(ap) ++ safe_strncpy(remote_addr, ++ ap->sprint((struct sockaddr *) &remoteaddr, flag_not), sizeof(remote_addr)); + else +- sprintf(buffer,"%s", remote_addr); +- printf("%-23s", buffer); +- } else +- printf("%-23s", ""); +- +- printf(" %-12s", first?sctp_socket_state_str(state):""); ++ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family); ++ } + +- first = 0; +- this_local_addr=strtok_r(0," \t\n",&ss1); +- this_remote_addr=strtok_r(0," \t\n",&ss2); +- } ++ if(!first) printf("\n"); ++ if(first) ++ printf("sctp %6u %6u ", rxqueue, txqueue); ++ else ++ printf(" "); ++ if(this_local_addr) { ++ if(first) ++ sprintf(buffer,"%s:%s", local_addr, local_port); ++ else ++ sprintf(buffer,"%s", local_addr); ++ printf("%-27s", buffer); ++ } else ++ printf("%-27s", ""); ++ printf(" "); ++ if(this_remote_addr) { ++ if(first) ++ sprintf(buffer,"%s:%s", remote_addr, remote_port); ++ else ++ sprintf(buffer,"%s", remote_addr); ++ printf("%-27s", buffer); ++ } else ++ printf("%-27s", ""); ++ ++ printf(" %-12s", first?sctp_socket_state_str(state):""); ++ ++ first = 0; ++ this_local_addr=strtok_r(0," \t\n",&ss1); ++ this_remote_addr=strtok_r(0," \t\n",&ss2); + } +- + finish_this_one(uid,inode,""); + } + +-- +1.8.5.2.233.g932f7e4 + diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h new file mode 100644 index 000000000..6d39c2a8c --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h @@ -0,0 +1,75 @@ +/* +* config.h Automatically generated configuration includefile +* +* NET-TOOLS A collection of programs that form the base set of the +* NET-3 Networking Distribution for the LINUX operating +* system. +* +* DO NOT EDIT DIRECTLY +* +*/ + +/* + * + * Internationalization + * + * The net-tools package has currently been translated to French, + * German and Brazilian Portugese. Other translations are, of + * course, welcome. Answer `n' here if you have no support for + * internationalization on your system. + * + */ +#define I18N 1 + +/* + * + * Protocol Families. + * + */ +#define HAVE_AFUNIX 1 +#define HAVE_AFINET 1 +#define HAVE_AFINET6 1 +#define HAVE_AFIPX 0 +#define HAVE_AFATALK 0 +#define HAVE_AFAX25 0 +#define HAVE_AFNETROM 1 +#define HAVE_AFROSE 0 +#define HAVE_AFX25 0 +#define HAVE_AFECONET 0 +#define HAVE_AFDECnet 0 +#define HAVE_AFASH 0 + +/* + * + * Device Hardware types. + * + */ +#define HAVE_HWETHER 1 +#define HAVE_HWARC 1 +#define HAVE_HWSLIP 1 +#define HAVE_HWPPP 1 +#define HAVE_HWTUNNEL 1 +#define HAVE_HWSTRIP 0 +#define HAVE_HWTR 0 +#define HAVE_HWAX25 0 +#define HAVE_HWROSE 0 +#define HAVE_HWNETROM 1 +#define HAVE_HWX25 0 +#define HAVE_HWFR 1 +#define HAVE_HWSIT 0 +#define HAVE_HWFDDI 0 +#define HAVE_HWHIPPI 0 +#define HAVE_HWASH 0 +#define HAVE_HWHDLCLAPB 0 +#define HAVE_HWIRDA 1 +#define HAVE_HWEC 0 +#define HAVE_HWIB 0 + +/* + * + * Other Features. + * + */ +#define HAVE_FW_MASQUERADE 1 +#define HAVE_IP_TOOLS 1 +#define HAVE_MII 1 diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make new file mode 100644 index 000000000..ec516f27e --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make @@ -0,0 +1,36 @@ +I18N=1 +HAVE_AFUNIX=1 +HAVE_AFINET=1 +HAVE_AFINET6=1 +# HAVE_AFIPX=0 +# HAVE_AFATALK=0 +# HAVE_AFAX25=0 +HAVE_AFNETROM=1 +# HAVE_AFROSE=0 +# HAVE_AFX25=0 +# HAVE_AFECONET=0 +# HAVE_AFDECnet=0 +# HAVE_AFASH=0 +HAVE_HWETHER=1 +HAVE_HWARC=1 +HAVE_HWSLIP=1 +HAVE_HWPPP=1 +HAVE_HWTUNNEL=1 +HAVE_HWSTRIP=1 +HAVE_HWTR=1 +# HAVE_HWAX25=0 +# HAVE_HWROSE=0 +HAVE_HWNETROM=1 +# HAVE_HWX25=0 +HAVE_HWFR=1 +# HAVE_HWSIT=0 +# HAVE_HWFDDI=0 +# HAVE_HWHIPPI=0 +# HAVE_HWASH=0 +# HAVE_HWHDLCLAPB=0 +HAVE_HWIRDA=1 +# HAVE_HWEC=0 +# HAVE_HWIB=0 +HAVE_FW_MASQUERADE=1 +HAVE_IP_TOOLS=1 +HAVE_MII=1 diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch new file mode 100644 index 000000000..505eeb048 --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch @@ -0,0 +1,52 @@ +From 4d56645ea144a34f7cdd3e3ede6452d81fbae251 Mon Sep 17 00:00:00 2001 +From: Randy MacLeod <Randy.MacLeod@windriver.com> +Date: Sat, 8 Oct 2016 14:42:54 +0800 +Subject: [PATCH] iptunnel.c: include linux/ip.h to fix building with linux-4.8 + +Fix a build error when using the linux-4.8 headers that results in: + +In file included from +.../sysroots/qemuarm64/usr/include/linux/if_tunnel.h:6:0, + from iptunnel.c:39: +.../qemuarm64/usr/include/linux/ip.h:85:8: error: redefinition of +'struct iphdr' + struct iphdr { + ^~~~~ +In file included from iptunnel.c:29:0: +.../qemuarm64/usr/include/netinet/ip.h:44:8: note: originally defined here + struct iphdr + ^~~~~ + +Upstream-Status: Submitted [1] + +[1] https://sourceforge.net/p/net-tools/mailman/message/35413022/ + +Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + iptunnel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/iptunnel.c b/iptunnel.c +index 4943d83..acfcbc7 100644 +--- a/iptunnel.c ++++ b/iptunnel.c +@@ -26,7 +26,6 @@ + #include <sys/socket.h> + #include <sys/ioctl.h> + #include <netinet/in.h> +-#include <netinet/ip.h> + #include <arpa/inet.h> + #if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)) + #include <net/if.h> +@@ -36,6 +35,7 @@ + #include <linux/if_arp.h> + #endif + #include <linux/types.h> ++#include <linux/ip.h> + #include <linux/if_tunnel.h> + + #include "config.h" +-- +2.8.3 + diff --git a/poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb b/poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb new file mode 100644 index 000000000..5657fd8c5 --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb @@ -0,0 +1,122 @@ +SUMMARY = "Basic networking tools" +DESCRIPTION = "A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system" +HOMEPAGE = "http://net-tools.berlios.de/" +BUGTRACKER = "http://bugs.debian.org/net-tools" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ + file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba" + +SRC_URI = "http://snapshot.debian.org/archive/debian/20050312T000000Z/pool/main/n/${BPN}/${BPN}_1.60.orig.tar.gz;name=tarball \ + http://snapshot.debian.org/archive/debian//20150831T093342Z/pool/main/n/${BPN}/${BPN}_${PV}.diff.gz;apply=no;name=patch \ + file://net-tools-config.h \ + file://net-tools-config.make \ + file://ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch \ + file://musl-fixes.patch \ + file://net-tools-1.60-sctp1.patch \ + file://net-tools-1.60-sctp2-quiet.patch \ + file://net-tools-1.60-sctp3-addrs.patch \ + file://0001-lib-inet6.c-INET6_rresolve-various-fixes.patch \ + file://net-tools-fix-building-with-linux-4.8.patch \ + " + +# for this package we're mostly interested in tracking debian patches, +# and not in the upstream version where all development has effectively stopped +UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)" + +S = "${WORKDIR}/net-tools-1.60" + +SRC_URI[tarball.md5sum] = "ecaf37acb5b5daff4bdda77785fd916d" +SRC_URI[tarball.sha256sum] = "ec67967cf7b1a3a3828a84762fbc013ac50ee5dc9aa3095d5c591f302c2de0f5" + +SRC_URI[patch.md5sum] = "ea3592f49ac8380962bc4d9b66c7e7e9" +SRC_URI[patch.sha256sum] = "aeeeafaff68866a446f01bb639d4e0146a60af34dcd20e31a3e46585022fc76c" + +# the package is taken from snapshots.debian.org; that source is static and goes stale +# so we check the latest upstream from a directory that does get updated +UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/net-tools/" + +inherit gettext + +do_patch[depends] += "quilt-native:do_populate_sysroot" + +# The Makefile is lame, no parallel build +PARALLEL_MAKE = "" + +# Unlike other Debian packages, net-tools *.diff.gz contains another series of +# patches maintained by quilt. So manually apply them before applying other local +# patches. Also remove all temp files before leaving, because do_patch() will pop +# up all previously applied patches in the start +nettools_do_patch() { + cd ${S} + quilt pop -a || true + if [ -d ${S}/.pc-nettools ]; then + rm -rf ${S}/.pc + mv ${S}/.pc-nettools ${S}/.pc + QUILT_PATCHES=${S}/debian/patches quilt pop -a + rm -rf ${S}/.pc ${S}/debian + fi + patch -p1 < ${WORKDIR}/${BPN}_${PV}.diff + QUILT_PATCHES=${S}/debian/patches quilt push -a + mv ${S}/.pc ${S}/.pc-nettools +} + +do_unpack[cleandirs] += "${S}" + +# We invoke base do_patch at end, to incorporate any local patch +python do_patch() { + bb.build.exec_func('nettools_do_patch', d) + bb.build.exec_func('patch_do_patch', d) +} + +do_configure() { + # net-tools has its own config mechanism requiring "make config" + # we pre-generate desired options and copy to source directory instead + cp ${WORKDIR}/net-tools-config.h ${S}/config.h + cp ${WORKDIR}/net-tools-config.make ${S}/config.make + + if [ "${USE_NLS}" = "no" ]; then + sed -i -e 's/^I18N=1/# I18N=1/' ${S}/config.make + fi +} + +do_compile() { + # net-tools use COPTS/LOPTS to allow adding custom options + oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" +} + +do_install() { + # We don't need COPTS or LOPTS, but let's be consistent. + oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" 'BASEDIR=${D}' install + + if [ "${base_bindir}" != "/bin" ]; then + mkdir -p ${D}/${base_bindir} + mv ${D}/bin/* ${D}/${base_bindir}/ + rmdir ${D}/bin + fi + if [ "${base_sbindir}" != "/sbin" ]; then + mkdir ${D}/${base_sbindir} + mv ${D}/sbin/* ${D}/${base_sbindir}/ + rmdir ${D}/sbin + fi +} + +inherit update-alternatives + +base_sbindir_progs = "arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach" +base_bindir_progs = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname" + +ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}" +ALTERNATIVE_${PN}-doc += "hostname.1 dnsdomainname.1" +ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1" +ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1" +ALTERNATIVE_PRIORITY[hostname.1] = "10" + +python __anonymous() { + for prog in d.getVar('base_sbindir_progs').split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog)) + for prog in d.getVar('base_bindir_progs').split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) +} +ALTERNATIVE_PRIORITY = "100" + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/newt/files/0001-detect-gold-as-GNU-linker-too.patch b/poky/meta/recipes-extended/newt/files/0001-detect-gold-as-GNU-linker-too.patch new file mode 100644 index 000000000..a4b3afd95 --- /dev/null +++ b/poky/meta/recipes-extended/newt/files/0001-detect-gold-as-GNU-linker-too.patch @@ -0,0 +1,31 @@ +From 58245b859ffbcb1780575bf1b0a018d55e74e434 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> +Date: Wed, 21 Sep 2016 21:14:40 +0200 +Subject: [PATCH] detect gold as GNU linker too +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Pending + +Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 03e8bda..c2fce51 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -28,7 +28,7 @@ AC_CHECK_SIZEOF([void *]) + AC_MSG_CHECKING([for GNU ld]) + LD=`$CC -print-prog-name=ld 2>&5` + +-if test `$LD -v 2>&1 | $ac_cv_path_GREP -c "GNU ld"` = 0; then ++if test `$LD -v 2>&1 | $ac_cv_path_GREP -c "GNU "` = 0; then + # Not + GNU_LD="" + AC_MSG_RESULT([no]) +-- +2.5.5 + diff --git a/poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch b/poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch new file mode 100644 index 000000000..bc55582fd --- /dev/null +++ b/poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch @@ -0,0 +1,26 @@ +From fad40cfc18a42946a9a9e440c3434cd6b847ff9d Mon Sep 17 00:00:00 2001 +From: Otavio Salvador <otavio@ossystems.com.br> +Date: Mon, 18 Jan 2016 17:05:19 +0000 +Subject: [PATCH] Makefile.in: Add tinfo library to the linking libraries +Organization: O.S. Systems Software LTDA. + +Upstream-Status: Pending + +Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index a85d00f..98b85f9 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -1,4 +1,4 @@ +-LIBS = -lslang @LIBS@ ++LIBS = -lslang -ltinfo @LIBS@ + LIBTCL = @TCL_LIB_FLAG@ + + CC = @CC@ +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/newt/files/cross_ar.patch b/poky/meta/recipes-extended/newt/files/cross_ar.patch new file mode 100644 index 000000000..86cc0be1d --- /dev/null +++ b/poky/meta/recipes-extended/newt/files/cross_ar.patch @@ -0,0 +1,56 @@ +Fix cross link using autoconf detected AR + +If building on 32bit host and creating 64bit libraries, the target +package builds should not invoke the 32bit hosts's ar. Specifically +you will get an error message like: + +x86_64-linux-gcc -m64 --sysroot=/opt/qemux86-64/tmp/sysroots/qemux86-64 -g -o test test.o libnewt.a -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lslang +libnewt.a: could not read symbols: Archive has no index; run ranlib to add one +collect2: error: ld returned 1 exit status + +Signed-off-by: Jason Wessel <jason.wessel@windriver.com> + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + Makefile.in | 3 ++- + configure.ac | 4 ++++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +Index: newt-0.52.20/Makefile.in +=================================================================== +--- newt-0.52.20.orig/Makefile.in ++++ newt-0.52.20/Makefile.in +@@ -7,6 +7,7 @@ CFLAGS = @CFLAGS@ + LDFLAGS = @LDFLAGS@ + CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@ + GNU_LD = @GNU_LD@ ++AR = @AR@ + + VERSION = @VERSION@ + TAG = r$(subst .,-,$(VERSION)) +@@ -109,7 +110,7 @@ whiptcl.$(SOEXT): $(WHIPTCLOBJS) $(LIBNE + $(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.$(SOEXT) $(WHIPTCLOBJS) -L. -lnewt $(LIBTCL) -lpopt $(LIBS) + + $(LIBNEWT): $(LIBOBJS) +- ar rv $@ $^ ++ $(AR) rv $@ $^ + + newt.o $(SHAREDDIR)/newt.o: newt.c Makefile + +Index: newt-0.52.20/configure.ac +=================================================================== +--- newt-0.52.20.orig/configure.ac ++++ newt-0.52.20/configure.ac +@@ -15,6 +15,10 @@ AC_PROG_INSTALL + AC_PROG_LN_S + AC_PROG_GREP + AC_SYS_LARGEFILE ++AN_MAKEVAR([AR], [AC_PROG_AR]) ++AN_PROGRAM([ar], [AC_PROG_AR]) ++AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)]) ++AC_PROG_AR + + AC_CHECK_SIZEOF([long]) + AC_CHECK_SIZEOF([long long]) diff --git a/poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch b/poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch new file mode 100644 index 000000000..b0a1e8c10 --- /dev/null +++ b/poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch @@ -0,0 +1,37 @@ +Upstream-Status: Pending + +Author: dexuan.cui@intel.com +Date: Fri Apr 15 16:17:39 CST 2011 + +The patch fixes a parallel-make issue: when generating $(SHAREDDIR)/%.o, we should +ensure the directory ${SHAREDDIR} exists. + +We need to push the patch to upstream. + +Signed-off-by: Dexuan Cui <dexuan.cui@intel.com> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +--- a/Makefile.in ++++ b/Makefile.in +@@ -128,12 +128,12 @@ $(SHAREDDIR): + + sharedlib: $(LIBNEWTSH) + +-$(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS) ++$(LIBNEWTSH): $(SHAREDOBJS) + $(CC) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) $(SHAREDOBJS) $(LDFLAGS) $(LIBS) + ln -fs $(LIBNEWTSONAME) libnewt.$(SOEXT) + ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME) + +-$(SHAREDDIR)/%.o : %.c ++$(SHAREDDIR)/%.o : %.c $(SHAREDDIR) + $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< + + install: $(LIBNEWT) install-sh whiptail +-- +1.8.1.2 + diff --git a/poky/meta/recipes-extended/newt/files/pie-flags.patch b/poky/meta/recipes-extended/newt/files/pie-flags.patch new file mode 100644 index 000000000..8883e26ad --- /dev/null +++ b/poky/meta/recipes-extended/newt/files/pie-flags.patch @@ -0,0 +1,36 @@ +specify -fPIC after CFLAGS so it can override the CFLAGS containing -pie and -fpie +this makes sure the objects that go into shared objects are compiled with -fPIC +and not with -fpie. We can not use -fpie on objects which will go into .so files +Fixes errors like + +| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: shared/newt.o: relocation R_X86_64_PC32 against undefined symbol `SLtt_Screen_Rows@@SLANG2' can not be used when making a shared object; recompile with -fPIC +| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: final link failed: Bad value +| collect2: error: ld returned 1 exit status +| make: *** [libnewt.so.0.52.18] Error 1 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending +Index: newt-0.52.18/Makefile.in +=================================================================== +--- newt-0.52.18.orig/Makefile.in ++++ newt-0.52.18/Makefile.in +@@ -96,8 +96,8 @@ _snack.$(SOEXT): snack.c $(LIBNEWTSH) + PIFLAGS=`$$pyconfig --includes`; \ + PLDFLAGS=`$$pyconfig --ldflags`; \ + PLFLAGS=`$$pyconfig --libs`; \ +- echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \ +- $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \ ++ echo $(CC) $(CPPFLAGS) $(SHCFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \ ++ $(CC) $(CPPFLAGS) $(SHCFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \ + echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \ + $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \ + done || : +@@ -135,7 +135,7 @@ $(LIBNEWTSH): $(SHAREDOBJS) + ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME) + + $(SHAREDDIR)/%.o : %.c $(SHAREDDIR) +- $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< ++ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(SHCFLAGS) -o $@ $< + + install: $(LIBNEWT) install-sh whiptail + [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir) diff --git a/poky/meta/recipes-extended/newt/libnewt-python_0.52.20.bb b/poky/meta/recipes-extended/newt/libnewt-python_0.52.20.bb new file mode 100644 index 000000000..20369effe --- /dev/null +++ b/poky/meta/recipes-extended/newt/libnewt-python_0.52.20.bb @@ -0,0 +1,28 @@ +require recipes-extended/newt/libnewt_${PV}.bb + +SUMMARY .= " - python" +DEPENDS = "libnewt python3" +RDEPENDS_${PN} += "python3-core" + +inherit python3native python3-dir + +EXTRA_OECONF += "--with-python" +EXTRA_OEMAKE += "PYTHONVERS=${PYTHON_DIR}" + + +do_compile () { + VERSION="$(sed -n 's/^VERSION = //p' Makefile)" + oe_runmake _snack.so +} + +do_install () { + install -d ${D}${PYTHON_SITEPACKAGES_DIR} + install -m 0755 ${PYTHON_DIR}/_snack.so ${D}${PYTHON_SITEPACKAGES_DIR}/ + install -m 0644 snack.py ${D}${PYTHON_SITEPACKAGES_DIR}/ +} + +PACKAGES_remove = "whiptail" + +FILES_${PN} = "${PYTHON_SITEPACKAGES_DIR}/*" + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/newt/libnewt_0.52.20.bb b/poky/meta/recipes-extended/newt/libnewt_0.52.20.bb new file mode 100644 index 000000000..65ce70c47 --- /dev/null +++ b/poky/meta/recipes-extended/newt/libnewt_0.52.20.bb @@ -0,0 +1,54 @@ +SUMMARY = "A library for text mode user interfaces" + +DESCRIPTION = "Newt is a programming library for color text mode, widget based user \ +interfaces. Newt can be used to add stacked windows, entry widgets, \ +checkboxes, radio buttons, labels, plain text fields, scrollbars, \ +etc., to text mode user interfaces. This package also contains the \ +shared library needed by programs built with newt, as well as a \ +/usr/bin/dialog replacement called whiptail. Newt is based on the \ +slang library." + +HOMEPAGE = "https://releases.pagure.org/newt/" +SECTION = "libs" + +LICENSE = "LGPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" + +# slang needs to be >= 2.2 +DEPENDS = "slang popt" + +SRC_URI = "https://releases.pagure.org/newt/newt-${PV}.tar.gz \ + file://fix_SHAREDDIR.patch \ + file://cross_ar.patch \ + file://Makefile.in-Add-tinfo-library-to-the-linking-librari.patch \ + file://pie-flags.patch \ + file://0001-detect-gold-as-GNU-linker-too.patch \ +" + +SRC_URI[md5sum] = "70b288f821234593a8e7920e435b259b" +SRC_URI[sha256sum] = "8d66ba6beffc3f786d4ccfee9d2b43d93484680ef8db9397a4fb70b5adbb6dbc" + +S = "${WORKDIR}/newt-${PV}" + +EXTRA_OECONF = "--without-tcl --without-python" + +inherit autotools-brokensep + +CLEANBROKEN = "1" + +export CPPFLAGS + +PACKAGES_prepend = "whiptail " + +do_configure_prepend() { + sh autogen.sh +} + +do_compile_prepend() { + # Make sure the recompile is OK + rm -f ${B}/.depend +} + +FILES_whiptail = "${bindir}/whiptail" + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb b/poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb new file mode 100644 index 000000000..9002fbc37 --- /dev/null +++ b/poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb @@ -0,0 +1,151 @@ +# +# Copyright (C) 2010 Intel Corporation +# + +SUMMARY = "Standard full-featured Linux system" +DESCRIPTION = "Package group bringing in packages needed for a more traditional full-featured Linux system" +PR = "r6" + +inherit packagegroup + +PACKAGES = "\ + packagegroup-core-full-cmdline \ + packagegroup-core-full-cmdline-libs \ + packagegroup-core-full-cmdline-utils \ + packagegroup-core-full-cmdline-extended \ + packagegroup-core-full-cmdline-dev-utils \ + packagegroup-core-full-cmdline-multiuser \ + packagegroup-core-full-cmdline-initscripts \ + packagegroup-core-full-cmdline-sys-services \ + " + +python __anonymous () { + # For backwards compatibility after rename + namemap = {} + namemap["packagegroup-core-full-cmdline"] = "packagegroup-core-basic" + namemap["packagegroup-core-full-cmdline-libs"] = "packagegroup-core-basic-libs" + namemap["packagegroup-core-full-cmdline-utils"] = "packagegroup-core-basic-utils" + namemap["packagegroup-core-full-cmdline-extended"] = "packagegroup-core-basic-extended" + namemap["packagegroup-core-full-cmdline-dev-utils"] = "packagegroup-core-dev-utils" + namemap["packagegroup-core-full-cmdline-multiuser"] = "packagegroup-core-multiuser" + namemap["packagegroup-core-full-cmdline-initscripts"] = "packagegroup-core-initscripts" + namemap["packagegroup-core-full-cmdline-sys-services"] = "packagegroup-core-sys-services" + + packages = d.getVar("PACKAGES").split() + for pkg in packages: + if pkg.endswith('-dev'): + mapped = namemap.get(pkg[:-4], None) + if mapped: + mapped += '-dev' + elif pkg.endswith('-dbg'): + mapped = namemap.get(pkg[:-4], None) + if mapped: + mapped += '-dbg' + else: + mapped = namemap.get(pkg, None) + + if mapped: + oldtaskname = mapped.replace("packagegroup-core", "task-core") + mapstr = " %s %s" % (mapped, oldtaskname) + d.appendVar("RPROVIDES_%s" % pkg, mapstr) + d.appendVar("RREPLACES_%s" % pkg, mapstr) + d.appendVar("RCONFLICTS_%s" % pkg, mapstr) +} + + +RDEPENDS_packagegroup-core-full-cmdline = "\ + packagegroup-core-full-cmdline-libs \ + packagegroup-core-full-cmdline-utils \ + packagegroup-core-full-cmdline-extended \ + packagegroup-core-full-cmdline-dev-utils \ + packagegroup-core-full-cmdline-multiuser \ + packagegroup-core-full-cmdline-initscripts \ + packagegroup-core-full-cmdline-sys-services \ + " + +RDEPENDS_packagegroup-core-full-cmdline-libs = "\ + glib-2.0 \ + " + +RDEPENDS_packagegroup-core-full-cmdline-utils = "\ + bash \ + acl \ + attr \ + bc \ + coreutils \ + cpio \ + e2fsprogs \ + ed \ + file \ + findutils \ + gawk \ + gmp \ + grep \ + makedevs \ + mc \ + mc-fish \ + mc-helpers \ + mc-helpers-perl \ + mktemp \ + ncurses \ + net-tools \ + popt \ + procps \ + psmisc \ + sed \ + tar \ + time \ + util-linux \ + zlib \ + " + +RDEPENDS_packagegroup-core-full-cmdline-extended = "\ + iproute2 \ + iputils \ + iptables \ + module-init-tools \ + openssl \ + " + +RDEPENDS_packagegroup-core-full-cmdline-dev-utils = "\ + diffutils \ + m4 \ + make \ + patch \ + " + +VIRTUAL-RUNTIME_initscripts ?= "initscripts" +VIRTUAL-RUNTIME_init_manager ?= "sysvinit" +VIRTUAL-RUNTIME_login_manager ?= "busybox" +VIRTUAL-RUNTIME_syslog ?= "sysklogd" +RDEPENDS_packagegroup-core-full-cmdline-initscripts = "\ + ${VIRTUAL-RUNTIME_initscripts} \ + ${VIRTUAL-RUNTIME_init_manager} \ + ethtool \ + ${VIRTUAL-RUNTIME_login_manager} \ + ${VIRTUAL-RUNTIME_syslog} \ + " + +RDEPENDS_packagegroup-core-full-cmdline-multiuser = "\ + cracklib \ + gzip \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libuser', '', d)} \ + shadow \ + sudo \ + " + +RDEPENDS_packagegroup-core-full-cmdline-sys-services = "\ + at \ + bzip2 \ + cronie \ + dbus \ + elfutils \ + gzip \ + less \ + logrotate \ + nfs-utils \ + pciutils \ + rpcbind \ + tcp-wrappers \ + tzdata \ + " diff --git a/poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb b/poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb new file mode 100644 index 000000000..53d100ce7 --- /dev/null +++ b/poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb @@ -0,0 +1,242 @@ +# +# Copyright (C) 2010 Intel Corporation +# + +SUMMARY = "Linux Standard Base (LSB)" +DESCRIPTION = "Packages required to satisfy the Linux Standard Base (LSB) specification" +PR = "r10" + +inherit packagegroup distro_features_check + +# The libxt, libxtst and others require x11 in DISTRO_FEATURES +REQUIRED_DISTRO_FEATURES = "x11" + +# libglu needs virtual/libgl, which requires opengl in DISTRO_FEATURES +REQUIRED_DISTRO_FEATURES += "opengl" + +# libpam, pam-plugin-wheel requires pam in DISTRO_FEATURES +REQUIRED_DISTRO_FEATURES += "pam" + +# +# We will skip parsing this packagegeoup for non-glibc systems +# +python __anonymous () { + if d.getVar('TCLIBC') != "glibc": + raise bb.parse.SkipRecipe("incompatible with %s C library" % + d.getVar('TCLIBC')) +} + +PACKAGES = "\ + packagegroup-core-lsb \ + packagegroup-core-sys-extended \ + packagegroup-core-db \ + packagegroup-core-perl \ + packagegroup-core-python \ + packagegroup-core-tcl \ + packagegroup-core-lsb-misc \ + packagegroup-core-lsb-core \ + packagegroup-core-lsb-perl \ + packagegroup-core-lsb-python \ + packagegroup-core-lsb-desktop \ + packagegroup-core-lsb-runtime-add \ + " + + +RDEPENDS_packagegroup-core-lsb = "\ + packagegroup-core-sys-extended \ + packagegroup-core-db \ + packagegroup-core-perl \ + packagegroup-core-python \ + packagegroup-core-tcl \ + packagegroup-core-lsb-misc \ + packagegroup-core-lsb-core \ + packagegroup-core-lsb-perl \ + packagegroup-core-lsb-python \ + packagegroup-core-lsb-desktop \ + packagegroup-core-lsb-runtime-add \ + " + + +RDEPENDS_packagegroup-core-sys-extended = "\ + curl \ + dhcp-client \ + hdparm \ + lighttpd \ + libaio \ + lrzsz \ + lzo \ + mc \ + mc-fish \ + mc-helpers \ + mc-helpers-perl \ + mdadm \ + minicom \ + parted \ + quota \ + screen \ + setserial \ + sysstat \ + udev-extraconf \ + unzip \ + watchdog \ + wget \ + which \ + xinetd \ + zip \ + " + +RDEPENDS_packagegroup-core-db = "\ + db \ + sqlite3 \ + " + +RDEPENDS_packagegroup-core-perl = "\ + gdbm \ + perl \ + zlib \ + " + + +RDEPENDS_packagegroup-core-python = "\ + expat \ + gdbm \ + gmp \ + ncurses \ + openssl \ + python \ + readline \ + zip \ + " + +RDEPENDS_packagegroup-core-tcl = "\ + tcl \ + " + +# Miscellaneous packages required by LSB (or LSB tests) +RDEPENDS_packagegroup-core-lsb-misc = "\ + chkconfig \ + gettext \ + gettext-runtime \ + groff \ + lsbinitscripts \ + lsbtest \ + lsof \ + strace \ + libusb1 \ + usbutils \ + rpm \ + " + +SUMMARY_packagegroup-core-lsb-core = "LSB Core" +DESCRIPTION_packagegroup-core-lsb-core = "Packages required to support commands/libraries \ + specified in the LSB Core specification" +RDEPENDS_packagegroup-core-lsb-core = "\ + at \ + bash \ + bc \ + binutils \ + binutils-symlinks \ + coreutils \ + cpio \ + cronie \ + cups \ + diffutils \ + ed \ + glibc-utils \ + elfutils \ + file \ + findutils \ + fontconfig-utils \ + foomatic-filters \ + gawk \ + ghostscript \ + grep \ + gzip \ + localedef \ + lsb \ + m4 \ + make \ + man \ + man-pages \ + mktemp \ + msmtp \ + patch \ + procps \ + psmisc \ + sed \ + shadow \ + tar \ + time \ + util-linux \ + xdg-utils \ + \ + glibc \ + libgcc \ + libpam \ + libxml2 \ + ncurses \ + zlib \ + nspr \ + nss \ +" + +SUMMARY_packagegroup-core-lsb-perl = "LSB Runtime Languages (Perl)" +DESCRIPTION_packagegroup-core-lsb-perl = "Packages required to support libraries \ + specified in the LSB Runtime languages specification (Perl parts)" +RDEPENDS_packagegroup-core-lsb-perl = "\ + perl \ + perl-modules \ + perl-misc \ + perl-pod \ + perl-dev \ + perl-doc \ +" + +SUMMARY_packagegroup-core-lsb-python = "LSB Runtime Languages (Python)" +DESCRIPTION_packagegroup-core-lsb-python = "Packages required to support libraries \ + specified in the LSB Runtime languages specification (Python parts)" +RDEPENDS_packagegroup-core-lsb-python = "\ + python \ + python-modules \ + python-misc \ +" + +SUMMARY_packagegroup-core-lsb-desktop = "LSB Desktop" +DESCRIPTION_packagegroup-core-lsb-desktop = "Packages required to support libraries \ + specified in the LSB Desktop specification" +RDEPENDS_packagegroup-core-lsb-desktop = "\ + libxt \ + libxxf86vm \ + libdrm \ + libglu \ + libxi \ + libxtst \ + libx11-locale \ + xorg-minimal-fonts \ + gdk-pixbuf-loader-ico \ + gdk-pixbuf-loader-bmp \ + gdk-pixbuf-loader-ani \ + gdk-pixbuf-xlib \ + liberation-fonts \ + gtk+ \ + atk \ + libasound \ +" + +RDEPENDS_packagegroup-core-lsb-runtime-add = "\ + ldd \ + pam-plugin-wheel \ + e2fsprogs-mke2fs \ + mkfontdir \ + liburi-perl \ + libxml-parser-perl \ + libxml-perl \ + libxml-sax-perl \ + glibc-localedatas \ + glibc-gconvs \ + glibc-charmaps \ + glibc-binaries \ + glibc-localedata-posix \ + glibc-extra-nss \ + glibc-pcprofile \ +" diff --git a/poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch b/poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch new file mode 100644 index 000000000..c55b64813 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch @@ -0,0 +1,68 @@ +From 45d1ed58927593968faead7dbb295f3922f41a2f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 8 Aug 2015 14:16:43 -0700 +Subject: [PATCH] Add support for defining missing funcitonality + +In order to support alternative libc on linux ( musl, bioninc ) etc we +need to check for glibc-only features and provide alternatives, in this +list strndupa is first one, when configure detects that its not included +in system C library then the altrnative implementation from missing.h is +used + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + configure.ac | 3 +++ + libpam/include/missing.h | 12 ++++++++++++ + modules/pam_exec/pam_exec.c | 1 + + 3 files changed, 16 insertions(+) + create mode 100644 libpam/include/missing.h + +diff --git a/configure.ac b/configure.ac +index 9e1257f..cbed979 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -599,6 +599,9 @@ dnl + AC_CHECK_DECL(__NR_keyctl, [have_key_syscalls=1],[have_key_syscalls=0],[#include <sys/syscall.h>]) + AC_CHECK_DECL(ENOKEY, [have_key_errors=1],[have_key_errors=0],[#include <errno.h>]) + ++# musl and bionic don't have strndupa ++AC_CHECK_DECLS_ONCE([strndupa]) ++ + HAVE_KEY_MANAGEMENT=0 + if test $have_key_syscalls$have_key_errors = 11 + then +diff --git a/libpam/include/missing.h b/libpam/include/missing.h +new file mode 100644 +index 0000000..3cf011c +--- /dev/null ++++ b/libpam/include/missing.h +@@ -0,0 +1,12 @@ ++#pragma once ++ ++#if !HAVE_DECL_STRNDUPA ++#define strndupa(s, n) \ ++ ({ \ ++ const char *__old = (s); \ ++ size_t __len = strnlen(__old, (n)); \ ++ char *__new = alloca(__len + 1); \ ++ __new[__len] = '\0'; \ ++ memcpy(__new, __old, __len); \ ++ }) ++#endif +diff --git a/modules/pam_exec/pam_exec.c b/modules/pam_exec/pam_exec.c +index 17ba6ca..3aa2694 100644 +--- a/modules/pam_exec/pam_exec.c ++++ b/modules/pam_exec/pam_exec.c +@@ -59,6 +59,7 @@ + #include <security/pam_modutil.h> + #include <security/pam_ext.h> + #include <security/_pam_macros.h> ++#include <missing.h> + + #define ENV_ITEM(n) { (n), #n } + static struct { +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/pam/libpam/99_pam b/poky/meta/recipes-extended/pam/libpam/99_pam new file mode 100644 index 000000000..97e990d10 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/99_pam @@ -0,0 +1 @@ +d root root 0755 /var/run/sepermit none diff --git a/poky/meta/recipes-extended/pam/libpam/crypt_configure.patch b/poky/meta/recipes-extended/pam/libpam/crypt_configure.patch new file mode 100644 index 000000000..917a8af64 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/crypt_configure.patch @@ -0,0 +1,40 @@ +From b86575ab4a0df07da160283459da270e1c0372a0 Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Tue, 24 May 2016 14:11:09 +0300 +Subject: [PATCH] crypt_configure + +This patch fixes a case where it find crypt defined in libc (musl) but +not in specified libraries then it ends up assigning +LIBCRYPT="-l" which then goes into makefile cause all sort of problems +e.g. + +ld: cannot find -l-m32 +| collect2: error: ld returned 1 exit status +The reason is that -l appears on commandline with +out any library and compiler treats the next argument as library name +whatever it is. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index df39d07..e68d856 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -401,7 +401,7 @@ AS_IF([test "x$ac_cv_header_xcrypt_h" = "xyes"], + [crypt_libs="crypt"]) + + BACKUP_LIBS=$LIBS +-AC_SEARCH_LIBS([crypt],[$crypt_libs], LIBCRYPT="${ac_lib:+-l$ac_lib}", LIBCRYPT="") ++AC_SEARCH_LIBS([crypt],[$crypt_libs], [test "$ac_cv_search_crypt" = "none required" || LIBCRYPT="$ac_cv_search_crypt"]) + AC_CHECK_FUNCS(crypt_r crypt_gensalt_r) + LIBS=$BACKUP_LIBS + AC_SUBST(LIBCRYPT) +-- +2.4.0 + diff --git a/poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch b/poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch new file mode 100644 index 000000000..8a9c3b2fa --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch @@ -0,0 +1,24 @@ +Fix the build error when a separate build directory is used: + +Making install in xtestsmake[1]: Entering directory `/media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/build/xtests'/usr/bin/install -c -d /media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/image/usr/share/Linux-PAM/xtestsfor file in run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd tst-pam_dispatch5.pamd tst-pam_cracklib1.pamd tst-pam_cracklib2.pamd tst-pam_unix1.pamd tst-pam_unix2.pamd tst-pam_unix3.pamd tst-pam_unix4.pamd tst-pam_unix1.sh tst-pam_unix2.sh tst-pam_unix3.sh tst-pam_unix4.sh access.conf tst-pam_access1.pamd tst-pam_access1.sh tst-pam_access2.pamd tst-pam_access2.sh tst-pam_access3.pamd tst-pam_access3.sh tst-pam_access4.pamd tst-pam_access4.sh limits.conf tst-pam_limits1.pamd tst-pam_limits1.sh tst-pam_succeed_if1.pamd tst-pam_succeed_if1.sh group.conf tst-pam_group1.pamd tst-pam_group1.sh tst-pam_authfail.pamd tst-pam_authsucceed.pamd tst-pam_substack1.pamd tst-pam_substack1a.pamd tst-pam_substack1.sh tst-pam_substack2.pamd tst-pam_substack2a.pamd tst-pam_substack2.sh tst-pam_substack3.pamd tst-pam_substack3a.pamd tst-pam_substack3.sh tst-pam_substack4.pamd tst-pam_substack4a.pamd tst-pam_substack4.sh tst-pam_substack5.pamd tst-pam_substack5a.pamd tst-pam_substack5.sh tst-pam_assemble_line1.pamd tst-pam_assemble_line1.sh tst-pam_pwhistory1.pamd tst-pam_pwhistory1.sh tst-pam_time1.pamd time.conf ; do \/usr/bin/install -c $file /media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/image/usr/share/Linux-PAM/xtests ; \ done +/usr/bin/install: cannot stat `run-xtests.sh': No such file or directory +/usr/bin/install: cannot stat `tst-pam_dispatch1.pamd': No such file or directory +/usr/bin/install: cannot stat `tst-pam_dispatch2.pamd': No such file or directory + +Upstream-Status: Pending + +RP 2013/03/21 + +Index: Linux-PAM-1.1.6/xtests/Makefile.am +=================================================================== +--- Linux-PAM-1.1.6.orig/xtests/Makefile.am 2013-03-08 12:26:30.360266000 +0000 ++++ Linux-PAM-1.1.6/xtests/Makefile.am 2013-03-21 11:39:58.557166650 +0000 +@@ -59,7 +59,7 @@ + install_xtests: + $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests + for file in $(EXTRA_DIST) ; do \ +- $(INSTALL) $$file $(DESTDIR)$(pkgdatadir)/xtests ; \ ++ $(INSTALL) $(srcdir)/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \ + done + for file in $(XTESTS); do \ + $(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \ diff --git a/poky/meta/recipes-extended/pam/libpam/include_paths_header.patch b/poky/meta/recipes-extended/pam/libpam/include_paths_header.patch new file mode 100644 index 000000000..e4eb95669 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/include_paths_header.patch @@ -0,0 +1,59 @@ +This patch adds missing include for paths.h which should provide +_PATH_LASTLOG definition + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Index: Linux-PAM-1.1.6/modules/pam_lastlog/pam_lastlog.c +=================================================================== +--- Linux-PAM-1.1.6.orig/modules/pam_lastlog/pam_lastlog.c ++++ Linux-PAM-1.1.6/modules/pam_lastlog/pam_lastlog.c +@@ -23,9 +23,11 @@ + #include <stdarg.h> + #include <stdio.h> + #include <string.h> ++#include <sys/file.h> + #include <sys/types.h> + #include <syslog.h> + #include <unistd.h> ++#include <paths.h> + + #if defined(hpux) || defined(sunos) || defined(solaris) + # ifndef _PATH_LASTLOG +@@ -332,6 +334,23 @@ last_login_read(pam_handle_t *pamh, int + return retval; + } + ++#ifndef __GLIBC__ ++static void logwtmp(const char * line, const char * name, const char * host) ++{ ++ struct utmp u; ++ memset(&u, 0, sizeof(u)); ++ ++ u.ut_pid = getpid(); ++ u.ut_type = name[0] ? USER_PROCESS : DEAD_PROCESS; ++ strncpy(u.ut_line, line, sizeof(u.ut_line)); ++ strncpy(u.ut_name, name, sizeof(u.ut_name)); ++ strncpy(u.ut_host, host, sizeof(u.ut_host)); ++ gettimeofday(&(u.ut_tv), NULL); ++ ++ updwtmp(_PATH_WTMP, &u); ++} ++#endif /* __GLIBC__ */ ++ + static int + last_login_write(pam_handle_t *pamh, int announce, int last_fd, + uid_t uid, const char *user) +Index: Linux-PAM-1.1.6/modules/Makefile.am +=================================================================== +--- Linux-PAM-1.1.6.orig/modules/Makefile.am ++++ Linux-PAM-1.1.6/modules/Makefile.am +@@ -7,7 +7,7 @@ SUBDIRS = pam_access pam_cracklib pam_de + pam_group pam_issue pam_keyinit pam_lastlog pam_limits \ + pam_listfile pam_localuser pam_loginuid pam_mail \ + pam_mkhomedir pam_motd pam_namespace pam_nologin \ +- pam_permit pam_pwhistory pam_rhosts pam_rootok pam_securetty \ ++ pam_permit pam_pwhistory pam_rootok pam_securetty \ + pam_selinux pam_sepermit pam_shells pam_stress \ + pam_succeed_if pam_tally pam_tally2 pam_time pam_timestamp \ + pam_tty_audit pam_umask \ diff --git a/poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch b/poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch new file mode 100644 index 000000000..680029ae0 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch @@ -0,0 +1,226 @@ +From 555407ff6e2f742df64ae93859f14a0fc1397829 Mon Sep 17 00:00:00 2001 +From: Wenzong Fan <wenzong.fan@windriver.com> +Date: Fri, 12 Sep 2014 05:35:05 -0400 +Subject: [PATCH] libpam/xtests: remove bash dependency + +There's not bash specific syntax in the xtest scripts: + + # after below patches applied: + $ cd Linux-PAM-1.1.6/xtests + $ checkbashisms *.sh + No output + +Just remove the runtime dependency to bash. + +Upstream-Status: Pending + +Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> +--- + xtests/run-xtests.sh | 2 +- + xtests/tst-pam_access1.sh | 2 +- + xtests/tst-pam_access2.sh | 2 +- + xtests/tst-pam_access3.sh | 2 +- + xtests/tst-pam_access4.sh | 2 +- + xtests/tst-pam_assemble_line1.sh | 2 +- + xtests/tst-pam_group1.sh | 2 +- + xtests/tst-pam_limits1.sh | 2 +- + xtests/tst-pam_pwhistory1.sh | 2 +- + xtests/tst-pam_substack1.sh | 2 +- + xtests/tst-pam_substack2.sh | 2 +- + xtests/tst-pam_substack3.sh | 2 +- + xtests/tst-pam_substack4.sh | 2 +- + xtests/tst-pam_substack5.sh | 2 +- + xtests/tst-pam_succeed_if1.sh | 2 +- + xtests/tst-pam_unix1.sh | 2 +- + xtests/tst-pam_unix2.sh | 2 +- + xtests/tst-pam_unix3.sh | 2 +- + xtests/tst-pam_unix4.sh | 2 +- + 19 files changed, 19 insertions(+), 19 deletions(-) + +diff --git a/xtests/run-xtests.sh b/xtests/run-xtests.sh +index 3a89057..1cf8684 100755 +--- a/xtests/run-xtests.sh ++++ b/xtests/run-xtests.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + SRCDIR=$1 + shift 1 +diff --git a/xtests/tst-pam_access1.sh b/xtests/tst-pam_access1.sh +index 180d256..70521d2 100755 +--- a/xtests/tst-pam_access1.sh ++++ b/xtests/tst-pam_access1.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + /usr/sbin/groupadd tstpamaccess + /usr/sbin/useradd -G tstpamaccess -p '!!' tstpamaccess1 +diff --git a/xtests/tst-pam_access2.sh b/xtests/tst-pam_access2.sh +index 0a30275..7e3e60f 100755 +--- a/xtests/tst-pam_access2.sh ++++ b/xtests/tst-pam_access2.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + /usr/sbin/groupadd tstpamaccess + /usr/sbin/useradd -p '!!' tstpamaccess2 +diff --git a/xtests/tst-pam_access3.sh b/xtests/tst-pam_access3.sh +index 348e0c3..3630e2e 100755 +--- a/xtests/tst-pam_access3.sh ++++ b/xtests/tst-pam_access3.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + /usr/sbin/useradd -p '!!' tstpamaccess3 + ./tst-pam_access3 +diff --git a/xtests/tst-pam_access4.sh b/xtests/tst-pam_access4.sh +index 61e7b44..4538df4 100755 +--- a/xtests/tst-pam_access4.sh ++++ b/xtests/tst-pam_access4.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + /usr/sbin/useradd -p '!!' tstpamaccess4 + ./tst-pam_access4 +diff --git a/xtests/tst-pam_assemble_line1.sh b/xtests/tst-pam_assemble_line1.sh +index 248d47e..dc2a675 100755 +--- a/xtests/tst-pam_assemble_line1.sh ++++ b/xtests/tst-pam_assemble_line1.sh +@@ -1,3 +1,3 @@ +-#!/bin/bash ++#!/bin/sh + + exec ./tst-pam_authfail tst-pam_assemble_line1 +diff --git a/xtests/tst-pam_group1.sh b/xtests/tst-pam_group1.sh +index b76377f..44faca9 100755 +--- a/xtests/tst-pam_group1.sh ++++ b/xtests/tst-pam_group1.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + /usr/sbin/groupadd tstpamgrpg + /usr/sbin/useradd -p '!!' tstpamgrp +diff --git a/xtests/tst-pam_limits1.sh b/xtests/tst-pam_limits1.sh +index 4faa822..32c021d 100755 +--- a/xtests/tst-pam_limits1.sh ++++ b/xtests/tst-pam_limits1.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + /usr/sbin/useradd -p '!!' tstpamlimits + ./tst-pam_limits1 +diff --git a/xtests/tst-pam_pwhistory1.sh b/xtests/tst-pam_pwhistory1.sh +index ddb3b8b..0f212e2 100644 +--- a/xtests/tst-pam_pwhistory1.sh ++++ b/xtests/tst-pam_pwhistory1.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + /usr/sbin/useradd tstpampwhistory + ./tst-pam_pwhistory1 +diff --git a/xtests/tst-pam_substack1.sh b/xtests/tst-pam_substack1.sh +index 5260175..f1b72a7 100755 +--- a/xtests/tst-pam_substack1.sh ++++ b/xtests/tst-pam_substack1.sh +@@ -1,3 +1,3 @@ +-#!/bin/bash ++#!/bin/sh + + exec ./tst-pam_authfail tst-pam_substack1 +diff --git a/xtests/tst-pam_substack2.sh b/xtests/tst-pam_substack2.sh +index c02f597..3804fa7 100755 +--- a/xtests/tst-pam_substack2.sh ++++ b/xtests/tst-pam_substack2.sh +@@ -1,3 +1,3 @@ +-#!/bin/bash ++#!/bin/sh + + exec ./tst-pam_authsucceed tst-pam_substack2 +diff --git a/xtests/tst-pam_substack3.sh b/xtests/tst-pam_substack3.sh +index 0e572aa..aa48e8e 100755 +--- a/xtests/tst-pam_substack3.sh ++++ b/xtests/tst-pam_substack3.sh +@@ -1,3 +1,3 @@ +-#!/bin/bash ++#!/bin/sh + + exec ./tst-pam_authsucceed tst-pam_substack3 +diff --git a/xtests/tst-pam_substack4.sh b/xtests/tst-pam_substack4.sh +index a3ef08a..958a07a 100755 +--- a/xtests/tst-pam_substack4.sh ++++ b/xtests/tst-pam_substack4.sh +@@ -1,3 +1,3 @@ +-#!/bin/bash ++#!/bin/sh + + exec ./tst-pam_authsucceed tst-pam_substack4 +diff --git a/xtests/tst-pam_substack5.sh b/xtests/tst-pam_substack5.sh +index e2714fd..7e0da74 100755 +--- a/xtests/tst-pam_substack5.sh ++++ b/xtests/tst-pam_substack5.sh +@@ -1,3 +1,3 @@ +-#!/bin/bash ++#!/bin/sh + + exec ./tst-pam_authfail tst-pam_substack5 +diff --git a/xtests/tst-pam_succeed_if1.sh b/xtests/tst-pam_succeed_if1.sh +index a643b2e..58e57b4 100755 +--- a/xtests/tst-pam_succeed_if1.sh ++++ b/xtests/tst-pam_succeed_if1.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + /usr/sbin/useradd -p '!!' tstpamtest + /usr/sbin/useradd -p '!!' pamtest +diff --git a/xtests/tst-pam_unix1.sh b/xtests/tst-pam_unix1.sh +index f75bd84..72deac0 100755 +--- a/xtests/tst-pam_unix1.sh ++++ b/xtests/tst-pam_unix1.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + /usr/sbin/useradd -p '!!' tstpamunix + ./tst-pam_unix1 +diff --git a/xtests/tst-pam_unix2.sh b/xtests/tst-pam_unix2.sh +index 7093155..c04d6e6 100755 +--- a/xtests/tst-pam_unix2.sh ++++ b/xtests/tst-pam_unix2.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + # pamunix0 = 0aXKZztA.d1KY + /usr/sbin/useradd -p 0aXKZztA.d1KY tstpamunix +diff --git a/xtests/tst-pam_unix3.sh b/xtests/tst-pam_unix3.sh +index ef4a07c..b52db2b 100755 +--- a/xtests/tst-pam_unix3.sh ++++ b/xtests/tst-pam_unix3.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + # pamunix01 = 0aXKZztA.d1KYIuFXArmd2jU + /usr/sbin/useradd -p 0aXKZztA.d1KYIuFXArmd2jU tstpamunix +diff --git a/xtests/tst-pam_unix4.sh b/xtests/tst-pam_unix4.sh +index 787c2f9..e7976fd 100755 +--- a/xtests/tst-pam_unix4.sh ++++ b/xtests/tst-pam_unix4.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + # pamunix01 = 0aXKZztA.d1KYIuFXArmd2jU + /usr/sbin/useradd -p 0aXKZztA.d1KYIuFXArmd2jU tstpamunix +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch b/poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch new file mode 100644 index 000000000..7edf66f91 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch @@ -0,0 +1,37 @@ +This patch is used to create a new sub package libpam-xtests to do more checks. + +Upstream-Status: Pending + +Signed-off-by: Kang Kai <kai.kang@windriver.com> +Index: Linux-PAM-1.3.0/xtests/Makefile.am +=================================================================== +--- Linux-PAM-1.3.0.orig/xtests/Makefile.am ++++ Linux-PAM-1.3.0/xtests/Makefile.am +@@ -7,7 +7,7 @@ AM_CFLAGS = -DLIBPAM_COMPILE -I$(top_src + LDADD = $(top_builddir)/libpam/libpam.la \ + $(top_builddir)/libpam_misc/libpam_misc.la + +-CLEANFILES = *~ $(XTESTS) ++CLEANFILES = *~ + + EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \ + tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd \ +@@ -51,3 +51,18 @@ EXTRA_PROGRAMS = $(XTESTS) + + xtests: $(XTESTS) run-xtests.sh + "$(srcdir)"/run-xtests.sh "$(srcdir)" ${XTESTS} ${NOSRCTESTS} ++ ++all: $(XTESTS) ++ ++install: install_xtests ++ ++install_xtests: ++ $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests ++ for file in $(EXTRA_DIST) ; do \ ++ $(INSTALL) $$file $(DESTDIR)$(pkgdatadir)/xtests ; \ ++ done ++ for file in $(XTESTS); do \ ++ $(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \ ++ done ++ ++.PHONY: all install_xtests diff --git a/poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch b/poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch new file mode 100644 index 000000000..9b8d4c297 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch @@ -0,0 +1,203 @@ +Description: extract the securetty logic for use with the "nullok_secure" option + introduced in the "055_pam_unix_nullok_secure" patch. + +Upstream-Status: Pending + +Signed-off-by: Ming Liu <ming.liu@windriver.com> +=================================================================== +Index: Linux-PAM-1.3.0/modules/pam_securetty/Makefile.am +=================================================================== +--- Linux-PAM-1.3.0.orig/modules/pam_securetty/Makefile.am ++++ Linux-PAM-1.3.0/modules/pam_securetty/Makefile.am +@@ -24,6 +24,10 @@ endif + securelib_LTLIBRARIES = pam_securetty.la + pam_securetty_la_LIBADD = $(top_builddir)/libpam/libpam.la + ++pam_securetty_la_SOURCES = \ ++ pam_securetty.c \ ++ tty_secure.c ++ + if ENABLE_REGENERATE_MAN + noinst_DATA = README + README: pam_securetty.8.xml +Index: Linux-PAM-1.3.0/modules/pam_securetty/pam_securetty.c +=================================================================== +--- Linux-PAM-1.3.0.orig/modules/pam_securetty/pam_securetty.c ++++ Linux-PAM-1.3.0/modules/pam_securetty/pam_securetty.c +@@ -1,7 +1,5 @@ + /* pam_securetty module */ + +-#define SECURETTY_FILE "/etc/securetty" +-#define TTY_PREFIX "/dev/" + #define CMDLINE_FILE "/proc/cmdline" + #define CONSOLEACTIVE_FILE "/sys/class/tty/console/active" + +@@ -40,6 +38,9 @@ + #include <security/pam_modutil.h> + #include <security/pam_ext.h> + ++extern int _pammodutil_tty_secure(const pam_handle_t *pamh, ++ const char *uttyname); ++ + #define PAM_DEBUG_ARG 0x0001 + #define PAM_NOCONSOLE_ARG 0x0002 + +@@ -73,11 +74,7 @@ securetty_perform_check (pam_handle_t *p + const char *username; + const char *uttyname; + const void *void_uttyname; +- char ttyfileline[256]; +- char ptname[256]; +- struct stat ttyfileinfo; + struct passwd *user_pwd; +- FILE *ttyfile; + + /* log a trail for debugging */ + if (ctrl & PAM_DEBUG_ARG) { +@@ -105,50 +102,7 @@ securetty_perform_check (pam_handle_t *p + return PAM_SERVICE_ERR; + } + +- /* The PAM_TTY item may be prefixed with "/dev/" - skip that */ +- if (strncmp(TTY_PREFIX, uttyname, sizeof(TTY_PREFIX)-1) == 0) { +- uttyname += sizeof(TTY_PREFIX)-1; +- } +- +- if (stat(SECURETTY_FILE, &ttyfileinfo)) { +- pam_syslog(pamh, LOG_NOTICE, "Couldn't open %s: %m", SECURETTY_FILE); +- return PAM_SUCCESS; /* for compatibility with old securetty handling, +- this needs to succeed. But we still log the +- error. */ +- } +- +- if ((ttyfileinfo.st_mode & S_IWOTH) || !S_ISREG(ttyfileinfo.st_mode)) { +- /* If the file is world writable or is not a +- normal file, return error */ +- pam_syslog(pamh, LOG_ERR, +- "%s is either world writable or not a normal file", +- SECURETTY_FILE); +- return PAM_AUTH_ERR; +- } +- +- ttyfile = fopen(SECURETTY_FILE,"r"); +- if (ttyfile == NULL) { /* Check that we opened it successfully */ +- pam_syslog(pamh, LOG_ERR, "Error opening %s: %m", SECURETTY_FILE); +- return PAM_SERVICE_ERR; +- } +- +- if (isdigit(uttyname[0])) { +- snprintf(ptname, sizeof(ptname), "pts/%s", uttyname); +- } else { +- ptname[0] = '\0'; +- } +- +- retval = 1; +- +- while ((fgets(ttyfileline, sizeof(ttyfileline)-1, ttyfile) != NULL) +- && retval) { +- if (ttyfileline[strlen(ttyfileline) - 1] == '\n') +- ttyfileline[strlen(ttyfileline) - 1] = '\0'; +- +- retval = ( strcmp(ttyfileline, uttyname) +- && (!ptname[0] || strcmp(ptname, uttyname)) ); +- } +- fclose(ttyfile); ++ retval = _pammodutil_tty_secure(pamh, uttyname); + + if (retval && !(ctrl & PAM_NOCONSOLE_ARG)) { + FILE *cmdlinefile; +Index: Linux-PAM-1.3.0/modules/pam_securetty/tty_secure.c +=================================================================== +--- /dev/null ++++ Linux-PAM-1.3.0/modules/pam_securetty/tty_secure.c +@@ -0,0 +1,90 @@ ++/* ++ * A function to determine if a particular line is in /etc/securetty ++ */ ++ ++ ++#define SECURETTY_FILE "/etc/securetty" ++#define TTY_PREFIX "/dev/" ++ ++/* This function taken out of pam_securetty by Sam Hartman ++ * <hartmans@debian.org>*/ ++/* ++ * by Elliot Lee <sopwith@redhat.com>, Red Hat Software. ++ * July 25, 1996. ++ * Slight modifications AGM. 1996/12/3 ++ */ ++ ++#include <unistd.h> ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <security/pam_modules.h> ++#include <stdarg.h> ++#include <syslog.h> ++#include <sys/syslog.h> ++#include <stdio.h> ++#include <string.h> ++#include <stdlib.h> ++#include <ctype.h> ++#include <security/pam_modutil.h> ++#include <security/pam_ext.h> ++ ++extern int _pammodutil_tty_secure(const pam_handle_t *pamh, ++ const char *uttyname); ++ ++int _pammodutil_tty_secure(const pam_handle_t *pamh, const char *uttyname) ++{ ++ int retval = PAM_AUTH_ERR; ++ char ttyfileline[256]; ++ char ptname[256]; ++ struct stat ttyfileinfo; ++ FILE *ttyfile; ++ /* The PAM_TTY item may be prefixed with "/dev/" - skip that */ ++ if (strncmp(TTY_PREFIX, uttyname, sizeof(TTY_PREFIX)-1) == 0) ++ uttyname += sizeof(TTY_PREFIX)-1; ++ ++ if (stat(SECURETTY_FILE, &ttyfileinfo)) { ++ pam_syslog(pamh, LOG_NOTICE, "Couldn't open %s: %m", ++ SECURETTY_FILE); ++ return PAM_SUCCESS; /* for compatibility with old securetty handling, ++ this needs to succeed. But we still log the ++ error. */ ++ } ++ ++ if ((ttyfileinfo.st_mode & S_IWOTH) || !S_ISREG(ttyfileinfo.st_mode)) { ++ /* If the file is world writable or is not a ++ normal file, return error */ ++ pam_syslog(pamh, LOG_ERR, ++ "%s is either world writable or not a normal file", ++ SECURETTY_FILE); ++ return PAM_AUTH_ERR; ++ } ++ ++ ttyfile = fopen(SECURETTY_FILE,"r"); ++ if(ttyfile == NULL) { /* Check that we opened it successfully */ ++ pam_syslog(pamh, LOG_ERR, "Error opening %s: %m", SECURETTY_FILE); ++ return PAM_SERVICE_ERR; ++ } ++ ++ if (isdigit(uttyname[0])) { ++ snprintf(ptname, sizeof(ptname), "pts/%s", uttyname); ++ } else { ++ ptname[0] = '\0'; ++ } ++ ++ retval = 1; ++ ++ while ((fgets(ttyfileline,sizeof(ttyfileline)-1, ttyfile) != NULL) ++ && retval) { ++ if(ttyfileline[strlen(ttyfileline) - 1] == '\n') ++ ttyfileline[strlen(ttyfileline) - 1] = '\0'; ++ retval = ( strcmp(ttyfileline,uttyname) ++ && (!ptname[0] || strcmp(ptname, uttyname)) ); ++ } ++ fclose(ttyfile); ++ ++ if(retval) { ++ retval = PAM_AUTH_ERR; ++ } ++ ++ return retval; ++} diff --git a/poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch b/poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch new file mode 100644 index 000000000..d2cc66882 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch @@ -0,0 +1,195 @@ +From b6545b83f94c5fb7aec1478b8d458a1393f479c8 Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Wed, 25 May 2016 14:12:25 +0300 +Subject: [PATCH] pam_unix: support 'nullok_secure' option + +Debian patch to add a new 'nullok_secure' option to pam_unix, +which accepts users with null passwords only when the applicant is +connected from a tty listed in /etc/securetty. + +Authors: Sam Hartman <hartmans@debian.org>, + Steve Langasek <vorlon@debian.org> + +Upstream-Status: Pending + +Signed-off-by: Ming Liu <ming.liu@windriver.com> +Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com> +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- + modules/pam_unix/Makefile.am | 3 ++- + modules/pam_unix/pam_unix.8.xml | 19 ++++++++++++++++++- + modules/pam_unix/support.c | 40 +++++++++++++++++++++++++++++++++++----- + modules/pam_unix/support.h | 8 ++++++-- + 4 files changed, 61 insertions(+), 9 deletions(-) + +diff --git a/modules/pam_unix/Makefile.am b/modules/pam_unix/Makefile.am +index 56df178..2bba460 100644 +--- a/modules/pam_unix/Makefile.am ++++ b/modules/pam_unix/Makefile.am +@@ -30,7 +30,8 @@ if HAVE_VERSIONING + pam_unix_la_LDFLAGS += -Wl,--version-script=$(srcdir)/../modules.map + endif + pam_unix_la_LIBADD = $(top_builddir)/libpam/libpam.la \ +- @LIBCRYPT@ @LIBSELINUX@ @TIRPC_LIBS@ @NSL_LIBS@ ++ @LIBCRYPT@ @LIBSELINUX@ @TIRPC_LIBS@ @NSL_LIBS@ \ ++ ../pam_securetty/tty_secure.lo + + securelib_LTLIBRARIES = pam_unix.la + +diff --git a/modules/pam_unix/pam_unix.8.xml b/modules/pam_unix/pam_unix.8.xml +index 1b318f1..be0330e 100644 +--- a/modules/pam_unix/pam_unix.8.xml ++++ b/modules/pam_unix/pam_unix.8.xml +@@ -159,7 +159,24 @@ + <para> + The default action of this module is to not permit the + user access to a service if their official password is blank. +- The <option>nullok</option> argument overrides this default. ++ The <option>nullok</option> argument overrides this default ++ and allows any user with a blank password to access the ++ service. ++ </para> ++ </listitem> ++ </varlistentry> ++ <varlistentry> ++ <term> ++ <option>nullok_secure</option> ++ </term> ++ <listitem> ++ <para> ++ The default action of this module is to not permit the ++ user access to a service if their official password is blank. ++ The <option>nullok_secure</option> argument overrides this ++ default and allows any user with a blank password to access ++ the service as long as the value of PAM_TTY is set to one of ++ the values found in /etc/securetty. + </para> + </listitem> + </varlistentry> +diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c +index fc8595e..29e3341 100644 +--- a/modules/pam_unix/support.c ++++ b/modules/pam_unix/support.c +@@ -183,13 +183,22 @@ int _set_ctrl(pam_handle_t *pamh, int flags, int *remember, int *rounds, + /* now parse the arguments to this module */ + + for (; argc-- > 0; ++argv) { ++ int sl; + + D(("pam_unix arg: %s", *argv)); + + for (j = 0; j < UNIX_CTRLS_; ++j) { +- if (unix_args[j].token +- && !strncmp(*argv, unix_args[j].token, strlen(unix_args[j].token))) { +- break; ++ if (unix_args[j].token) { ++ sl = strlen(unix_args[j].token); ++ if (unix_args[j].token[sl-1] == '=') { ++ /* exclude argument from comparison */ ++ if (!strncmp(*argv, unix_args[j].token, sl)) ++ break; ++ } else { ++ /* compare full strings */ ++ if (!strcmp(*argv, unix_args[j].token)) ++ break; ++ } + } + } + +@@ -560,6 +569,7 @@ static int _unix_run_helper_binary(pam_handle_t *pamh, const char *passwd, + if (child == 0) { + static char *envp[] = { NULL }; + const char *args[] = { NULL, NULL, NULL, NULL }; ++ int nullok = off(UNIX__NONULL, ctrl); + + /* XXX - should really tidy up PAM here too */ + +@@ -587,7 +597,16 @@ static int _unix_run_helper_binary(pam_handle_t *pamh, const char *passwd, + /* exec binary helper */ + args[0] = CHKPWD_HELPER; + args[1] = user; +- if (off(UNIX__NONULL, ctrl)) { /* this means we've succeeded */ ++ if (on(UNIX_NULLOK_SECURE, ctrl)) { ++ const void *uttyname; ++ retval = pam_get_item(pamh, PAM_TTY, &uttyname); ++ if (retval != PAM_SUCCESS || uttyname == NULL ++ || _pammodutil_tty_secure(pamh, (const char *)uttyname) != PAM_SUCCESS) { ++ nullok = 0; ++ } ++ } ++ ++ if (nullok) { + args[2]="nullok"; + } else { + args[2]="nonull"; +@@ -672,6 +691,17 @@ _unix_blankpasswd (pam_handle_t *pamh, unsigned int ctrl, const char *name) + if (on(UNIX__NONULL, ctrl)) + return 0; /* will fail but don't let on yet */ + ++ if (on(UNIX_NULLOK_SECURE, ctrl)) { ++ int retval2; ++ const void *uttyname; ++ retval2 = pam_get_item(pamh, PAM_TTY, &uttyname); ++ if (retval2 != PAM_SUCCESS || uttyname == NULL) ++ return 0; ++ ++ if (_pammodutil_tty_secure(pamh, (const char *)uttyname) != PAM_SUCCESS) ++ return 0; ++ } ++ + /* UNIX passwords area */ + + retval = get_pwd_hash(pamh, name, &pwd, &salt); +@@ -758,7 +788,7 @@ int _unix_verify_password(pam_handle_t * pamh, const char *name + } + } + } else { +- retval = verify_pwd_hash(p, salt, off(UNIX__NONULL, ctrl)); ++ retval = verify_pwd_hash(p, salt, _unix_blankpasswd(pamh, ctrl, name)); + } + + if (retval == PAM_SUCCESS) { +diff --git a/modules/pam_unix/support.h b/modules/pam_unix/support.h +index b4c279c..8da4a8e 100644 +--- a/modules/pam_unix/support.h ++++ b/modules/pam_unix/support.h +@@ -98,8 +98,9 @@ typedef struct { + #define UNIX_QUIET 28 /* Don't print informational messages */ + #define UNIX_NO_PASS_EXPIRY 29 /* Don't check for password expiration if not used for authentication */ + #define UNIX_DES 30 /* DES, default */ ++#define UNIX_NULLOK_SECURE 31 /* NULL passwords allowed only on secure ttys */ + /* -------------- */ +-#define UNIX_CTRLS_ 31 /* number of ctrl arguments defined */ ++#define UNIX_CTRLS_ 32 /* number of ctrl arguments defined */ + + #define UNIX_DES_CRYPT(ctrl) (off(UNIX_MD5_PASS,ctrl)&&off(UNIX_BIGCRYPT,ctrl)&&off(UNIX_SHA256_PASS,ctrl)&&off(UNIX_SHA512_PASS,ctrl)&&off(UNIX_BLOWFISH_PASS,ctrl)) + +@@ -117,7 +118,7 @@ static const UNIX_Ctrls unix_args[UNIX_CTRLS_] = + /* UNIX_AUTHTOK_TYPE */ {"authtok_type=", _ALL_ON_, 0100, 0}, + /* UNIX__PRELIM */ {NULL, _ALL_ON_^(0600), 0200, 0}, + /* UNIX__UPDATE */ {NULL, _ALL_ON_^(0600), 0400, 0}, +-/* UNIX__NONULL */ {NULL, _ALL_ON_, 01000, 0}, ++/* UNIX__NONULL */ {NULL, _ALL_ON_^(02000000000), 01000, 0}, + /* UNIX__QUIET */ {NULL, _ALL_ON_, 02000, 0}, + /* UNIX_USE_AUTHTOK */ {"use_authtok", _ALL_ON_, 04000, 0}, + /* UNIX_SHADOW */ {"shadow", _ALL_ON_, 010000, 0}, +@@ -139,6 +140,7 @@ static const UNIX_Ctrls unix_args[UNIX_CTRLS_] = + /* UNIX_QUIET */ {"quiet", _ALL_ON_, 01000000000, 0}, + /* UNIX_NO_PASS_EXPIRY */ {"no_pass_expiry", _ALL_ON_, 02000000000, 0}, + /* UNIX_DES */ {"des", _ALL_ON_^(0260420000), 0, 1}, ++/* UNIX_NULLOK_SECURE */ {"nullok_secure", _ALL_ON_^(01000), 02000000000, 0}, + }; + + #define UNIX_DEFAULTS (unix_args[UNIX__NONULL].flag) +@@ -172,6 +174,8 @@ extern int _unix_read_password(pam_handle_t * pamh + ,const char *data_name + ,const void **pass); + ++extern int _pammodutil_tty_secure(const pam_handle_t *pamh, const char *uttyname); ++ + extern int _unix_run_verify_binary(pam_handle_t *pamh, + unsigned int ctrl, const char *user, int *daysleft); + #endif /* _PAM_UNIX_SUPPORT_H */ +-- +2.4.0 + diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/common-account b/poky/meta/recipes-extended/pam/libpam/pam.d/common-account new file mode 100644 index 000000000..316b17337 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/pam.d/common-account @@ -0,0 +1,25 @@ +# +# /etc/pam.d/common-account - authorization settings common to all services +# +# This file is included from other service-specific PAM config files, +# and should contain a list of the authorization modules that define +# the central access policy for use on the system. The default is to +# only deny service to users whose accounts are expired in /etc/shadow. +# +# As of pam 1.0.1-6, this file is managed by pam-auth-update by default. +# To take advantage of this, it is recommended that you configure any +# local modules either before or after the default block, and use +# pam-auth-update to manage selection of other modules. See +# pam-auth-update(8) for details. +# + +# here are the per-package modules (the "Primary" block) +account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so +# here's the fallback if no module succeeds +account requisite pam_deny.so +# prime the stack with a positive return value if there isn't one already; +# this avoids us returning an error just because nothing sets a success code +# since the modules above will each just jump around +account required pam_permit.so +# and here are more per-package modules (the "Additional" block) +# end of pam-auth-update config diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/common-auth b/poky/meta/recipes-extended/pam/libpam/pam.d/common-auth new file mode 100644 index 000000000..460b69f19 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/pam.d/common-auth @@ -0,0 +1,18 @@ +# +# /etc/pam.d/common-auth - authentication settings common to all services +# +# This file is included from other service-specific PAM config files, +# and should contain a list of the authentication modules that define +# the central authentication scheme for use on the system +# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the +# traditional Unix authentication mechanisms. + +# here are the per-package modules (the "Primary" block) +auth [success=1 default=ignore] pam_unix.so nullok_secure +# here's the fallback if no module succeeds +auth requisite pam_deny.so +# prime the stack with a positive return value if there isn't one already; +# this avoids us returning an error just because nothing sets a success code +# since the modules above will each just jump around +auth required pam_permit.so +# and here are more per-package modules (the "Additional" block) diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/common-password b/poky/meta/recipes-extended/pam/libpam/pam.d/common-password new file mode 100644 index 000000000..389605732 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/pam.d/common-password @@ -0,0 +1,26 @@ +# +# /etc/pam.d/common-password - password-related modules common to all services +# +# This file is included from other service-specific PAM config files, +# and should contain a list of modules that define the services to be +# used to change user passwords. The default is pam_unix. + +# Explanation of pam_unix options: +# +# The "sha512" option enables salted SHA512 passwords. Without this option, +# the default is Unix crypt. Prior releases used the option "md5". +# +# The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in +# login.defs. +# +# See the pam_unix manpage for other options. + +# here are the per-package modules (the "Primary" block) +password [success=1 default=ignore] pam_unix.so obscure sha512 +# here's the fallback if no module succeeds +password requisite pam_deny.so +# prime the stack with a positive return value if there isn't one already; +# this avoids us returning an error just because nothing sets a success code +# since the modules above will each just jump around +password required pam_permit.so +# and here are more per-package modules (the "Additional" block) diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/common-session b/poky/meta/recipes-extended/pam/libpam/pam.d/common-session new file mode 100644 index 000000000..a4a551f71 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/pam.d/common-session @@ -0,0 +1,19 @@ +# +# /etc/pam.d/common-session - session-related modules common to all services +# +# This file is included from other service-specific PAM config files, +# and should contain a list of modules that define tasks to be performed +# at the start and end of sessions of *any* kind (both interactive and +# non-interactive). +# + +# here are the per-package modules (the "Primary" block) +session [default=1] pam_permit.so +# here's the fallback if no module succeeds +session requisite pam_deny.so +# prime the stack with a positive return value if there isn't one already; +# this avoids us returning an error just because nothing sets a success code +# since the modules above will each just jump around +session required pam_permit.so +# and here are more per-package modules (the "Additional" block) +session required pam_unix.so diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive b/poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive new file mode 100644 index 000000000..b110bb2b4 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive @@ -0,0 +1,19 @@ +# +# /etc/pam.d/common-session-noninteractive - session-related modules +# common to all non-interactive services +# +# This file is included from other service-specific PAM config files, +# and should contain a list of modules that define tasks to be performed +# at the start and end of all non-interactive sessions. +# + +# here are the per-package modules (the "Primary" block) +session [default=1] pam_permit.so +# here's the fallback if no module succeeds +session requisite pam_deny.so +# prime the stack with a positive return value if there isn't one already; +# this avoids us returning an error just because nothing sets a success code +# since the modules above will each just jump around +session required pam_permit.so +# and here are more per-package modules (the "Additional" block) +session required pam_unix.so diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/other b/poky/meta/recipes-extended/pam/libpam/pam.d/other new file mode 100644 index 000000000..ec970ecbe --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam/pam.d/other @@ -0,0 +1,24 @@ +# +# /etc/pam.d/other - specify the PAM fallback behaviour +# +# Note that this file is used for any unspecified service; for example +#if /etc/pam.d/cron specifies no session modules but cron calls +#pam_open_session, the session module out of /etc/pam.d/other is +#used. + +# We use pam_warn.so to generate syslog notes that the 'other' +#fallback rules are being used (as a hint to suggest you should setup +#specific PAM rules for the service and aid to debugging). Then to be +#secure, deny access to all services by default. + +auth required pam_warn.so +auth required pam_deny.so + +account required pam_warn.so +account required pam_deny.so + +password required pam_warn.so +password required pam_deny.so + +session required pam_warn.so +session required pam_deny.so diff --git a/poky/meta/recipes-extended/pam/libpam_1.3.0.bb b/poky/meta/recipes-extended/pam/libpam_1.3.0.bb new file mode 100644 index 000000000..92ab72a42 --- /dev/null +++ b/poky/meta/recipes-extended/pam/libpam_1.3.0.bb @@ -0,0 +1,164 @@ +SUMMARY = "Linux-PAM (Pluggable Authentication Modules)" +DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), a flexible mechanism for authenticating users" +HOMEPAGE = "https://fedorahosted.org/linux-pam/" +BUGTRACKER = "https://fedorahosted.org/linux-pam/newticket" +SECTION = "base" +# PAM is dual licensed under GPL and BSD. +# /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time +# libpam-runtime-1.0.1 is GPLv2+), by openembedded +LICENSE = "GPLv2+ | BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=7eb5c1bf854e8881005d673599ee74d3" + +SRC_URI = "http://linux-pam.org/library/Linux-PAM-${PV}.tar.bz2 \ + file://99_pam \ + file://pam.d/common-account \ + file://pam.d/common-auth \ + file://pam.d/common-password \ + file://pam.d/common-session \ + file://pam.d/common-session-noninteractive \ + file://pam.d/other \ + file://libpam-xtests.patch \ + file://fixsepbuild.patch \ + file://pam-security-abstract-securetty-handling.patch \ + file://pam-unix-nullok-secure.patch \ + file://libpam-xtests-remove-bash-dependency.patch \ + file://crypt_configure.patch \ + " + +SRC_URI[md5sum] = "da4b2289b7cfb19583d54e9eaaef1c3a" +SRC_URI[sha256sum] = "241aed1ef522f66ed672719ecf2205ec513fd0075ed80cda8e086a5b1a01d1bb" + +SRC_URI_append_libc-musl = " file://0001-Add-support-for-defining-missing-funcitonality.patch \ + file://include_paths_header.patch \ + " + +DEPENDS = "bison-native flex flex-native cracklib libxml2-native" + +EXTRA_OECONF = "--with-db-uniquename=_pam \ + --includedir=${includedir}/security \ + --libdir=${base_libdir} \ + --disable-nis \ + --disable-regenerate-docu \ + --disable-prelude" + +CFLAGS_append = " -fPIC " + +PR = "r5" + +S = "${WORKDIR}/Linux-PAM-${PV}" + +inherit autotools gettext pkgconfig + +PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit," + +PACKAGES += "${PN}-runtime ${PN}-xtests" +FILES_${PN} = "${base_libdir}/lib*${SOLIBS}" +FILES_${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}" +FILES_${PN}-runtime = "${sysconfdir}" +FILES_${PN}-xtests = "${datadir}/Linux-PAM/xtests" + +PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*" + +def get_multilib_bit(d): + baselib = d.getVar('baselib') or '' + return baselib.replace('lib', '') + +libpam_suffix = "suffix${@get_multilib_bit(d)}" + +RPROVIDES_${PN} += "${PN}-${libpam_suffix}" +RPROVIDES_${PN}-runtime += "${PN}-runtime-${libpam_suffix}" + +RDEPENDS_${PN}-runtime = "${PN}-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-deny-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-permit-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-warn-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-unix-${libpam_suffix} \ + " +RDEPENDS_${PN}-xtests = "${PN}-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-access-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-debug-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-cracklib-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-succeed-if-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-time-${libpam_suffix} \ + coreutils" + +# FIXME: Native suffix breaks here, disable it for now +RRECOMMENDS_${PN} = "${PN}-runtime-${libpam_suffix}" +RRECOMMENDS_${PN}_class-native = "" + +python populate_packages_prepend () { + def pam_plugin_append_file(pn, dir, file): + nf = os.path.join(dir, file) + of = d.getVar('FILES_' + pn) + if of: + nf = of + " " + nf + d.setVar('FILES_' + pn, nf) + + def pam_plugin_hook(file, pkg, pattern, format, basename): + pn = d.getVar('PN') + libpam_suffix = d.getVar('libpam_suffix') + + rdeps = d.getVar('RDEPENDS_' + pkg) + if rdeps: + rdeps = rdeps + " " + pn + "-" + libpam_suffix + else: + rdeps = pn + "-" + libpam_suffix + d.setVar('RDEPENDS_' + pkg, rdeps) + + provides = d.getVar('RPROVIDES_' + pkg) + if provides: + provides = provides + " " + pkg + "-" + libpam_suffix + else: + provides = pkg + "-" + libpam_suffix + d.setVar('RPROVIDES_' + pkg, provides) + + mlprefix = d.getVar('MLPREFIX') or '' + dvar = d.expand('${WORKDIR}/package') + pam_libdir = d.expand('${base_libdir}/security') + pam_sbindir = d.expand('${sbindir}') + pam_filterdir = d.expand('${base_libdir}/security/pam_filter') + pam_pkgname = mlprefix + 'pam-plugin%s' + + do_split_packages(d, pam_libdir, '^pam(.*)\.so$', pam_pkgname, + 'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='') + pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_chkpwd') + pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_update') + pam_plugin_append_file('%spam-plugin-tally' % mlprefix, pam_sbindir, 'pam_tally') + pam_plugin_append_file('%spam-plugin-tally2' % mlprefix, pam_sbindir, 'pam_tally2') + pam_plugin_append_file('%spam-plugin-timestamp' % mlprefix, pam_sbindir, 'pam_timestamp_check') + pam_plugin_append_file('%spam-plugin-mkhomedir' % mlprefix, pam_sbindir, 'mkhomedir_helper') + pam_plugin_append_file('%spam-plugin-console' % mlprefix, pam_sbindir, 'pam_console_apply') + do_split_packages(d, pam_filterdir, '^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='') +} + +do_install() { + autotools_do_install + + # don't install /var/run when populating rootfs. Do it through volatile + rm -rf ${D}${localstatedir} + install -d ${D}${sysconfdir}/default/volatiles + install -m 0644 ${WORKDIR}/99_pam ${D}${sysconfdir}/default/volatiles + + install -d ${D}${sysconfdir}/pam.d/ + install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ + + # The lsb requires unix_chkpwd has setuid permission + chmod 4755 ${D}${sbindir}/unix_chkpwd + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session + fi +} + +inherit distro_features_check +REQUIRED_DISTRO_FEATURES = "pam" + +BBCLASSEXTEND = "nativesdk native" + +CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session" +CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-auth" +CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-password" +CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive" +CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-account" +CONFFILES_${PN}-runtime += "${sysconfdir}/security/limits.conf" diff --git a/poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch b/poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch new file mode 100644 index 000000000..b0376cefc --- /dev/null +++ b/poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch @@ -0,0 +1,29 @@ +From d78dd087c4ec4715aab5fe115668e726046ecd76 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Apr 2015 18:16:05 -0700 +Subject: [PATCH] Include fcntl.h in /platform_defs.h + +exposed when compiling using musl + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + libparted/fs/xfs/platform_defs.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libparted/fs/xfs/platform_defs.h b/libparted/fs/xfs/platform_defs.h +index 2b55752..32bd3d3 100644 +--- a/libparted/fs/xfs/platform_defs.h ++++ b/libparted/fs/xfs/platform_defs.h +@@ -42,6 +42,7 @@ + #include <stdlib.h> + #include <string.h> + #include <unistd.h> ++#include <fcntl.h> + #include <sys/param.h> + #include <sys/types.h> + +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/parted/files/0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch b/poky/meta/recipes-extended/parted/files/0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch new file mode 100644 index 000000000..428b14ed5 --- /dev/null +++ b/poky/meta/recipes-extended/parted/files/0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch @@ -0,0 +1,44 @@ +From 6e82af54714392dcdf74a8aedaae7de7d0af1080 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Thu, 27 Apr 2017 16:37:24 +0300 +Subject: [PATCH] Move python helper scripts (used only in tests) to Python 3 + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + tests/gpt-header-move | 2 +- + tests/msdos-overlap | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/gpt-header-move b/tests/gpt-header-move +index 05cdc65..3cbcb7e 100755 +--- a/tests/gpt-header-move ++++ b/tests/gpt-header-move +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python3 + + # open img file, subtract 33 from altlba address, and move the last 33 sectors + # back by 33 sectors +diff --git a/tests/msdos-overlap b/tests/msdos-overlap +index 5bddfb0..3de7d2e 100755 +--- a/tests/msdos-overlap ++++ b/tests/msdos-overlap +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python3 + """ + Write an overlapping partition to a msdos disk + +@@ -14,7 +14,7 @@ BAD_ENTRY = (0x72, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + OFFSET = 0x1b8 + + if len(sys.argv) < 2: +- print "%s: <image or device>" ++ print("%s: <image or device>") + sys.exit(1) + + data = "".join(chr(c) for c in BAD_ENTRY) +-- +2.11.0 + diff --git a/poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch new file mode 100644 index 000000000..ba1a4bab4 --- /dev/null +++ b/poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch @@ -0,0 +1,33 @@ +From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Apr 2015 17:02:13 -0700 +Subject: [PATCH] Unset need_charset_alias when building for musl + +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 +which actually shoudl be fixed in gnulib and then all downstream +projects will get it eventually. For now we apply the fix to +coreutils + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/gnulib.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/gnulib.mk b/lib/gnulib.mk +index e1d74db..c0e92dd 100644 +--- a/lib/gnulib.mk ++++ b/lib/gnulib.mk +@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch b/poky/meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch new file mode 100644 index 000000000..e522e1c6e --- /dev/null +++ b/poky/meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch @@ -0,0 +1,224 @@ +From d6e15a60e84c1511523aa81272b7db7a6ec441d0 Mon Sep 17 00:00:00 2001 +From: Ovidiu Panait <ovidiu.panait@windriver.com> +Date: Tue, 26 Sep 2017 08:04:58 +0000 +Subject: [PATCH] libparted: Use read only when probing devices on linux + (#1245144) + +When a device is opened for RW closing it can trigger other actions, +like udev scanning it for partition changes. Use read only for the +init_* methods and RW for actual changes to the device. + +This adds _device_open which takes mode flags as an argument and turns +linux_open into a wrapper for it with RW_MODE. + +_device_open_ro is added to open the device with RD_MODE and increment +the open_counter. This is used in the init_* functions. + +_device_close is a wrapper around linux_close that decrements the +open_counter and is used in the init_* functions. + +All of these changes are self-contained with no external API changes. +The only visible change in behavior is that when a new PedDevice is +created the device is opened in RO_MODE instead of RW_MODE. + +Resolves: rhbz#1245144 + +Upstream-Status: Backport + +Author: Brian C. Lane <bcl@redhat.com> +Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> +--- + libparted/arch/linux.c | 62 +++++++++++++++++++++++++++++++++++--------------- + 1 file changed, 44 insertions(+), 18 deletions(-) + +diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c +index f612617..0a06a54 100644 +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -294,7 +294,9 @@ struct blkdev_ioctl_param { + static char* _device_get_part_path (PedDevice const *dev, int num); + static int _partition_is_mounted_by_path (const char* path); + static unsigned int _device_get_partition_range(PedDevice const* dev); +- ++static int _device_open (PedDevice* dev, int flags); ++static int _device_open_ro (PedDevice* dev); ++static int _device_close (PedDevice* dev); + + static int + _read_fd (int fd, char **buf) +@@ -913,7 +915,7 @@ init_ide (PedDevice* dev) + if (!_device_stat (dev, &dev_stat)) + goto error; + +- if (!ped_device_open (dev)) ++ if (!_device_open_ro (dev)) + goto error; + + if (ioctl (arch_specific->fd, HDIO_GET_IDENTITY, &hdi)) { +@@ -982,11 +984,11 @@ init_ide (PedDevice* dev) + if (!_device_probe_geometry (dev)) + goto error_close_dev; + +- ped_device_close (dev); ++ _device_close (dev); + return 1; + + error_close_dev: +- ped_device_close (dev); ++ _device_close (dev); + error: + return 0; + } +@@ -1119,7 +1121,7 @@ init_scsi (PedDevice* dev) + char* vendor; + char* product; + +- if (!ped_device_open (dev)) ++ if (!_device_open_ro (dev)) + goto error; + + if (ioctl (arch_specific->fd, SCSI_IOCTL_GET_IDLUN, &idlun) < 0) { +@@ -1133,7 +1135,7 @@ init_scsi (PedDevice* dev) + goto error_close_dev; + if (!_device_probe_geometry (dev)) + goto error_close_dev; +- ped_device_close (dev); ++ _device_close (dev); + return 1; + } + +@@ -1155,11 +1157,11 @@ init_scsi (PedDevice* dev) + if (!_device_probe_geometry (dev)) + goto error_close_dev; + +- ped_device_close (dev); ++ _device_close (dev); + return 1; + + error_close_dev: +- ped_device_close (dev); ++ _device_close (dev); + error: + return 0; + } +@@ -1171,7 +1173,7 @@ init_file (PedDevice* dev) + + if (!_device_stat (dev, &dev_stat)) + goto error; +- if (!ped_device_open (dev)) ++ if (!_device_open_ro (dev)) + goto error; + + dev->sector_size = PED_SECTOR_SIZE_DEFAULT; +@@ -1198,7 +1200,7 @@ init_file (PedDevice* dev) + goto error_close_dev; + } + +- ped_device_close (dev); ++ _device_close (dev); + + dev->bios_geom.cylinders = dev->length / 4 / 32; + dev->bios_geom.heads = 4; +@@ -1209,7 +1211,7 @@ init_file (PedDevice* dev) + return 1; + + error_close_dev: +- ped_device_close (dev); ++ _device_close (dev); + error: + return 0; + } +@@ -1225,7 +1227,7 @@ init_dasd (PedDevice* dev, const char* model_name) + if (!_device_stat (dev, &dev_stat)) + goto error; + +- if (!ped_device_open (dev)) ++ if (!_device_open_ro (dev)) + goto error; + + LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); +@@ -1265,11 +1267,11 @@ init_dasd (PedDevice* dev, const char* model_name) + + dev->model = strdup (model_name); + +- ped_device_close (dev); ++ _device_close (dev); + return 1; + + error_close_dev: +- ped_device_close (dev); ++ _device_close (dev); + error: + return 0; + } +@@ -1284,7 +1286,7 @@ init_generic (PedDevice* dev, const char* model_name) + if (!_device_stat (dev, &dev_stat)) + goto error; + +- if (!ped_device_open (dev)) ++ if (!_device_open_ro (dev)) + goto error; + + ped_exception_fetch_all (); +@@ -1332,11 +1334,11 @@ init_generic (PedDevice* dev, const char* model_name) + + dev->model = strdup (model_name); + +- ped_device_close (dev); ++ _device_close (dev); + return 1; + + error_close_dev: +- ped_device_close (dev); ++ _device_close (dev); + error: + return 0; + } +@@ -1623,12 +1625,27 @@ retry: + } + + static int ++_device_open_ro (PedDevice* dev) ++{ ++ int rc = _device_open (dev, RD_MODE); ++ if (rc) ++ dev->open_count++; ++ return rc; ++} ++ ++static int + linux_open (PedDevice* dev) + { ++ return _device_open (dev, RW_MODE); ++} ++ ++static int ++_device_open (PedDevice* dev, int flags) ++{ + LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); + + retry: +- arch_specific->fd = open (dev->path, RW_MODE); ++ arch_specific->fd = open (dev->path, flags); + + if (arch_specific->fd == -1) { + char* rw_error_msg = strerror (errno); +@@ -1697,6 +1714,15 @@ linux_refresh_close (PedDevice* dev) + return 1; + } + ++static int ++_device_close (PedDevice* dev) ++{ ++ int rc = linux_close (dev); ++ if (dev->open_count > 0) ++ dev->open_count--; ++ return rc; ++} ++ + #if SIZEOF_OFF_T < 8 + + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +-- +2.11.0 + diff --git a/poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch b/poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch new file mode 100644 index 000000000..bd2b5c55b --- /dev/null +++ b/poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch @@ -0,0 +1,34 @@ +From 5c99d7e4c2b5e7a957dc922aff03debfebbd6154 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> +Date: Fri, 3 Mar 2017 21:49:15 +0100 +Subject: [PATCH] libparted_fs_resize: link against libuuid explicitly to + unbreak gold linking on test +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +| ../libparted/fs/.libs/libparted-fs-resize.so: error: undefined reference to 'uuid_generate' + +Upstream-Status: Pending + +Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> +--- + libparted/fs/Makefile.am | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am +index d3cc8bc..c301b0b 100644 +--- a/libparted/fs/Makefile.am ++++ b/libparted/fs/Makefile.am +@@ -113,6 +113,8 @@ libparted_fs_resize_la_SOURCES = \ + r/hfs/reloc_plus.c \ + r/hfs/reloc_plus.h + ++libparted_fs_resize_la_LIBADD = $(UUID_LIBS) ++ + AM_CPPFLAGS = \ + -I$(top_srcdir)/libparted/labels \ + $(partedincludedir) \ +-- +2.9.3 + diff --git a/poky/meta/recipes-extended/parted/files/Makefile b/poky/meta/recipes-extended/parted/files/Makefile new file mode 100644 index 000000000..ee90be081 --- /dev/null +++ b/poky/meta/recipes-extended/parted/files/Makefile @@ -0,0 +1,285 @@ +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no + +am__tty_colors = \ +$(am__tty_colors_dummy); \ +test "X$(AM_COLOR_TESTS)" != Xno \ +&& test "X$$TERM" != Xdumb \ +&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \ +&& { \ + am__color_tests=yes; \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ +} + +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +am__rst_section = { sed 'p;s/./=/g;' && echo; } +am__sh_e_setup = case $$- in *e*) set +e;; esac + +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`; \ +test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) + +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` + +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:.log=.log) +TEST_LOGS = $(am__test_logs2:.sh.log=.log) +SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +SH_LOG_COMPILE = $(SH_LOG_COMPILER) + +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac + +MKDIR_P = /bin/mkdir -p +SHELL = /bin/bash +VERSION = 3.1 +PACKAGE_STRING = GNU parted 3.1 +PACKAGE_BUGREPORT = bug-parted@gnu.org +abs_srcdir = $(PWD) +abs_top_builddir = $(PWD)/.. +abs_top_srcdir = $(PWD)/.. +srcdir = . +top_srcdir = .. +subdir = tests +SH_LOG_COMPILER = $(SHELL) + +TESTS = \ + help-version.sh \ + t0000-basic.sh \ + t0001-tiny.sh \ + t0010-script-no-ctrl-chars.sh \ + t0100-print.sh \ + t0101-print-empty.sh \ + t0200-gpt.sh \ + t0201-gpt.sh \ + t0202-gpt-pmbr.sh \ + t0203-gpt-tiny-device-abort.sh \ + t0203-gpt-shortened-device-primary-valid.sh \ + t0205-gpt-list-clobbers-pmbr.sh \ + t0206-gpt-print-with-corrupt-primary-clobbers-pmbr.sh \ + t0207-IEC-binary-notation.sh \ + t0208-mkpart-end-in-IEC.sh \ + t0209-gpt-pmbr_boot.sh \ + t0210-gpt-resized-partition-entry-array.sh \ + t0211-gpt-rewrite-header.sh \ + t0212-gpt-many-partitions.sh \ + t0220-gpt-msftres.sh \ + t0250-gpt.sh \ + t0280-gpt-corrupt.sh \ + t0300-dos-on-gpt.sh \ + t0400-loop-clobber-infloop.sh \ + t0500-dup-clobber.sh \ + t0501-duplicate.sh \ + t1100-busy-label.sh \ + t1101-busy-partition.sh \ + t1700-probe-fs.sh \ + t2200-dos-label-recog.sh \ + t2201-pc98-label-recog.sh \ + t2300-dos-label-extended-bootcode.sh \ + t2310-dos-extended-2-sector-min-offset.sh \ + t2400-dos-hfs-partition-type.sh \ + t2500-probe-corrupt-hfs.sh \ + t3000-resize-fs.sh \ + t3200-type-change.sh \ + t3300-palo-prep.sh \ + t3310-flags.sh \ + t3400-whole-disk-FAT-partition.sh \ + t4000-sun-raid-type.sh \ + t4001-sun-vtoc.sh \ + t4100-msdos-partition-limits.sh \ + t4100-dvh-partition-limits.sh \ + t4100-msdos-starting-sector.sh \ + t4200-partprobe.sh \ + t4300-nilfs2-tiny.sh \ + t5000-tags.sh \ + t6000-dm.sh \ + t6001-psep.sh \ + t6100-mdraid-partitions.sh \ + t7000-scripting.sh \ + t8000-loop.sh \ + t8001-loop-blkpg.sh \ + t9010-big-sector.sh \ + t9020-alignment.sh \ + t9021-maxima.sh \ + t9022-one-unit-snap.sh \ + t9023-value-lt-one.sh \ + t9030-align-check.sh \ + t9040-many-partitions.sh \ + t9041-undetected-in-use-16th-partition.sh \ + t9042-dos-partition-limit.sh \ + t9050-partition-table-types.sh + +TESTS_ENVIRONMENT = \ + export \ + abs_top_builddir='$(abs_top_builddir)' \ + abs_top_srcdir='$(abs_top_srcdir)' \ + abs_srcdir='$(abs_srcdir)' \ + built_programs=parted \ + srcdir='$(srcdir)' \ + top_srcdir='$(top_srcdir)' \ + VERSION=$(VERSION) \ + ; 9>&2 + +.SUFFIXES: .log + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for i in $$bases; do \ + if grep "^$$ws*:copy-in-global-log:$$ws*no$$ws*$$" $$i.trs \ + >/dev/null; then continue; \ + fi; \ + glob_res=`sed -n -e "s/$$ws*$$//" \ + -e "s/^$$ws*:global-test-result:$$ws*//p" \ + $$i.trs`; \ + test -n "$$glob_res" || glob_res=RUN; \ + echo "$$glob_res: $$i" | $(am__rst_section); \ + if test ! -r $$i.log; then \ + echo "fatal: making $@: $$i.log is unreadable" >&2; \ + exit 1; \ + fi; \ + cat $$i.log; echo; \ + done; \ + } >$(TEST_SUITE_LOG).tmp; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @if test $@ != recheck; then \ + list='$(RECHECK_LOGS)'; \ + test -z "$$list" || rm -f $$list; \ + fi + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @ws='[ ]'; \ + log_list='' trs_list=''; $(am__set_TESTS_bases); \ + for i in $$bases; do \ + if test -z "$$log_list"; then \ + log_list="$$i.log"; \ + else \ + log_list="$$log_list $$i.log"; \ + fi; \ + if test -z "$$trs_list"; then \ + trs_list="$$i.trs"; \ + else \ + trs_list="$$trs_list $$i.trs"; \ + fi; \ + done; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list" + +.sh.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) -- $(SH_LOG_COMPILE) "$$tst" diff --git a/poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch b/poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch new file mode 100644 index 000000000..68ab715f3 --- /dev/null +++ b/poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch @@ -0,0 +1,57 @@ +From 060e74354774d36d2c11ef08e3e7ea9b9b6e23fb Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Thu, 13 Nov 2014 11:29:33 +0800 +Subject: [PATCH] libparted/arch/linux.c: fix compile failure while + --disable-device-mapper + +While --disable-device-mapper, the MACRO ENABLE_DEVICE_MAPPER is +undef, but it missed to scope some device mapper functions. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + libparted/arch/linux.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c +index 6fd73c5..2afa479 100644 +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -2320,6 +2320,7 @@ zasprintf (const char *format, ...) + static char * + dm_canonical_path (PedDevice const *dev) + { ++#ifdef ENABLE_DEVICE_MAPPER + LinuxSpecific const *arch_specific = LINUX_SPECIFIC (dev); + + /* Get map name from devicemapper */ +@@ -2337,6 +2338,7 @@ dm_canonical_path (PedDevice const *dev) + dm_task_destroy (task); + return dev_name; + err: ++#endif + return NULL; + } + +@@ -2957,13 +2959,15 @@ _disk_sync_part_table (PedDisk* disk) + unsigned long long *start, + unsigned long long *length); + +- ++#ifdef ENABLE_DEVICE_MAPPER + if (disk->dev->type == PED_DEVICE_DM) { + add_partition = _dm_add_partition; + remove_partition = _dm_remove_partition; + resize_partition = _dm_resize_partition; + get_partition_start_and_length = _dm_get_partition_start_and_length; +- } else { ++ } else ++#endif ++ { + add_partition = _blkpg_add_partition; + remove_partition = _blkpg_remove_partition; + #ifdef BLKPG_RESIZE_PARTITION +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch b/poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch new file mode 100644 index 000000000..0711d4e29 --- /dev/null +++ b/poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch @@ -0,0 +1,20 @@ +Upstream-Status: Submitted [bug-parted@gnu.org] + +| for po in `ls -1 ./*.pt_BR.po 2>/dev/null`; do \ +| make $(basename ${po%.pt_BR.po}); \ +| done +| Makefile:904: *** Recursive variable `mandir' references itself (eventually). Stop. + +Signed-off-by: Andreas Oberritter <obi@opendreambox.org> + +--- parted-3.1/doc/po4a.mk.orig 2012-03-15 14:09:11.555831872 +0100 ++++ parted-3.1/doc/po4a.mk 2012-03-15 14:10:44.243830985 +0100 +@@ -23,7 +23,7 @@ + # threshold is 80%), it won't be distributed, and the build won't fail. + # + +-mandir = $(mandir)/$(lang) ++mandir := $(mandir)/$(lang) + + # Inform automake that we want to install some man pages in section 1, 5 + # and 8. diff --git a/poky/meta/recipes-extended/parted/files/no_check.patch b/poky/meta/recipes-extended/parted/files/no_check.patch new file mode 100644 index 000000000..e6a26d11a --- /dev/null +++ b/poky/meta/recipes-extended/parted/files/no_check.patch @@ -0,0 +1,20 @@ +Upstream-Status: Inappropriate [configuration] + +If check is detected, it makes the builds non-determinstic so just force +it to be disabled. + +RP - 4/11/08 + +Index: parted-3.2/configure.ac +=================================================================== +--- parted-3.2.orig/configure.ac ++++ parted-3.2/configure.ac +@@ -555,7 +555,7 @@ AC_CHECK_HEADER([execinfo.h], [ + AM_CONDITIONAL([COMPILE_FOR_S390], [test "$host_cpu" = s390 || test "$host_cpu" = s390x]) + + dnl check for "check", unit testing library/header +-PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no) ++have_check=no + if test "$have_check" != "yes"; then + AC_MSG_RESULT([Unable to locate check version 0.9.3 or higher: not building]) + fi diff --git a/poky/meta/recipes-extended/parted/files/run-ptest b/poky/meta/recipes-extended/parted/files/run-ptest new file mode 100644 index 000000000..695c5e8a7 --- /dev/null +++ b/poky/meta/recipes-extended/parted/files/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +make -C tests check-TESTS diff --git a/poky/meta/recipes-extended/parted/files/syscalls.patch b/poky/meta/recipes-extended/parted/files/syscalls.patch new file mode 100644 index 000000000..93205a0a8 --- /dev/null +++ b/poky/meta/recipes-extended/parted/files/syscalls.patch @@ -0,0 +1,55 @@ +Upstream-Status: Pending + +--- + libparted/arch/linux.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +Index: parted-3.2/libparted/arch/linux.c +=================================================================== +--- parted-3.2.orig/libparted/arch/linux.c ++++ parted-3.2/libparted/arch/linux.c +@@ -17,6 +17,8 @@ + + #define PROC_DEVICES_BUFSIZ 16384 + ++#include <linux/version.h> ++ + #include <config.h> + #include <arch/linux.h> + #include <linux/blkpg.h> +@@ -1696,12 +1698,14 @@ linux_refresh_close (PedDevice* dev) + + #if SIZEOF_OFF_T < 8 + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) + static _syscall5(int,_llseek, + unsigned int, fd, + unsigned long, offset_high, + unsigned long, offset_low, + loff_t*, result, + unsigned int, origin) ++#endif + + loff_t + llseek (unsigned int fd, loff_t offset, unsigned int whence) +@@ -1709,11 +1713,20 @@ llseek (unsigned int fd, loff_t offset, + loff_t result; + int retval; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) + retval = _llseek(fd, + ((unsigned long long)offset) >> 32, + ((unsigned long long)offset) & 0xffffffff, + &result, + whence); ++#else ++ retval = syscall(__NR__llseek, fd, ++ ((unsigned long long)offset) >> 32, ++ ((unsigned long long)offset) & 0xffffffff, ++ &result, ++ whence); ++#endif ++ + return (retval==-1 ? (loff_t) retval : result); + } + diff --git a/poky/meta/recipes-extended/parted/parted/parted-3.2-sysmacros.patch b/poky/meta/recipes-extended/parted/parted/parted-3.2-sysmacros.patch new file mode 100644 index 000000000..211e6c734 --- /dev/null +++ b/poky/meta/recipes-extended/parted/parted/parted-3.2-sysmacros.patch @@ -0,0 +1,32 @@ +https://bugs.gentoo.org/580022 + +From dec8995fe80508374beba6356f6ecbba8ef6b18b Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Tue, 21 Jun 2016 15:01:08 -0400 +Subject: [PATCH] include sysmacros.h for major/minor/makedev + +Linux C libs are moving away from including this header implicitly via +sys/types.h, so include it explicitly. + +Upstream-Status: Pending +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> + +--- + libparted/arch/linux.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c +index 326b95619d31..e5c168be3c68 100644 +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -37,6 +37,7 @@ + #include <dirent.h> + #include <sys/ioctl.h> + #include <sys/stat.h> ++#include <sys/sysmacros.h> + #include <sys/types.h> + #include <sys/utsname.h> /* for uname() */ + #include <scsi/scsi.h> +-- +2.8.2 + diff --git a/poky/meta/recipes-extended/parted/parted_3.2.bb b/poky/meta/recipes-extended/parted/parted_3.2.bb new file mode 100644 index 000000000..ab30108bf --- /dev/null +++ b/poky/meta/recipes-extended/parted/parted_3.2.bb @@ -0,0 +1,50 @@ +SUMMARY = "Disk partition editing/resizing utility" +HOMEPAGE = "http://www.gnu.org/software/parted/parted.html" +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c" +SECTION = "console/tools" +DEPENDS = "ncurses readline util-linux virtual/libiconv" +PR = "r1" + +SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \ + file://no_check.patch \ + file://syscalls.patch \ + file://fix-doc-mandir.patch \ + file://fix-compile-failure-while-dis.patch \ + file://0001-Include-fcntl.h-in-platform_defs.h.patch \ + file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ + file://0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch \ + file://0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch \ + file://parted-3.2-sysmacros.patch \ + file://run-ptest \ + file://Makefile \ + file://0001-libparted-Use-read-only-when-probing-devices-on-linu.patch \ +" + +SRC_URI[md5sum] = "0247b6a7b314f8edeb618159fa95f9cb" +SRC_URI[sha256sum] = "858b589c22297cacdf437f3baff6f04b333087521ab274f7ab677cb8c6bb78e4" + +EXTRA_OECONF = "--disable-device-mapper" + +inherit autotools pkgconfig gettext texinfo ptest + +BBCLASSEXTEND = "native" + +do_compile_ptest() { + oe_runmake -C tests print-align print-max dup-clobber duplicate fs-resize +} + +do_install_ptest() { + t=${D}${PTEST_PATH} + mkdir $t/build-aux + cp ${S}/build-aux/test-driver $t/build-aux/ + cp -r ${S}/tests $t + cp ${WORKDIR}/Makefile $t/tests/ + sed -i "s|^VERSION.*|VERSION = ${PV}|g" $t/tests/Makefile + for i in print-align print-max dup-clobber duplicate fs-resize; \ + do cp ${B}/tests/.libs/$i $t/tests/; \ + done + sed -e 's| ../parted||' -i $t/tests/*.sh +} + +RDEPENDS_${PN}-ptest = "bash coreutils perl util-linux-losetup python3" diff --git a/poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb b/poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb new file mode 100644 index 000000000..06d37adc3 --- /dev/null +++ b/poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb @@ -0,0 +1,28 @@ +SUMMARY = "PBZIP2 is a parallel implementation of bzip2" +DESCRIPTION = "PBZIP2 is a parallel implementation of the bzip2 block-sorting \ +file compressor that uses pthreads and achieves near-linear speedup on SMP \ +machines. The output of this version is fully compatible with bzip2 v1.0.2 or \ +newer (ie: anything compressed with pbzip2 can be decompressed with bzip2)." +HOMEPAGE = "http://compression.ca/pbzip2/" +SECTION = "console/utils" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=398b8832c6f840cfebd20ab2be6a3743" + +DEPENDS = "bzip2" +DEPENDS_append_class-native = " bzip2-replacement-native" + +SRC_URI = "https://launchpad.net/${BPN}/1.1/${PV}/+download/${BP}.tar.gz" + +SRC_URI[md5sum] = "4cb87da2dba05540afce162f34b3a9a6" +SRC_URI[sha256sum] = "8fd13eaaa266f7ee91f85c1ea97c86d9c9cc985969db9059cdebcb1e1b7bdbe6" + +UPSTREAM_CHECK_URI = "http://compression.ca/pbzip2/" + +EXTRA_OEMAKE = "CXX='${CXX} ${CXXFLAGS}' LDFLAGS='${LDFLAGS}'" + +do_install() { + install -d ${D}${bindir} + install -m 0755 pbzip2 ${D}${bindir}/ +} + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb b/poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb new file mode 100644 index 000000000..644d8208e --- /dev/null +++ b/poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb @@ -0,0 +1,17 @@ +SUMMARY = "Convert::ASN1 - Perl ASN.1 Encode/Decode library" +SECTION = "libs" +LICENSE = "Artistic-1.0 | GPL-1.0+" +LIC_FILES_CHKSUM = "file://README.md;beginline=91;endline=97;md5=ceff7fd286eb6d8e8e0d3d23e096a63f" + +SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/Convert-ASN1-${PV}.tar.gz" + +SRC_URI[md5sum] = "68723e96be0b258a9e20480276e8a62c" +SRC_URI[sha256sum] = "74a4a78ae0c5e973100ac0a8f203a110f76fb047b79dae4fc1fd7d6814d3d58a" + +S = "${WORKDIR}/Convert-ASN1-${PV}" + +inherit cpan ptest-perl + +EXTRA_PERLFLAGS = "-I ${PERLHOSTLIB}" + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb b/poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb new file mode 100644 index 000000000..8e1461ceb --- /dev/null +++ b/poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb @@ -0,0 +1,20 @@ +SUMMARY = "Perl modules useful for manipulating date and time information" +HOMEPAGE = "https://metacpan.org/release/TimeDate" +SECTION = "libs" +# You can redistribute it and/or modify it under the same terms as Perl itself. +LICENSE = "Artistic-1.0 | GPL-1.0+" +LIC_FILES_CHKSUM = "file://README;beginline=21;md5=576b7cb41e5e821501a01ed66f0f9d9e" + +SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/TimeDate-${PV}.tar.gz" + +S = "${WORKDIR}/TimeDate-${PV}" + +inherit cpan ptest-perl + +BBCLASSEXTEND = "native" + +RDEPENDS_${PN}_class-native = "" +RDEPENDS_${PN} += "perl-module-carp perl-module-exporter perl-module-strict perl-module-time-local" + +SRC_URI[md5sum] = "b1d91153ac971347aee84292ed886c1c" +SRC_URI[sha256sum] = "75bd254871cb5853a6aa0403ac0be270cdd75c9d1b6639f18ecba63c15298e86" diff --git a/poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.12.bb b/poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.12.bb new file mode 100644 index 000000000..fa9f9954b --- /dev/null +++ b/poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.12.bb @@ -0,0 +1,27 @@ +SUMMARY = "Perl module for supporting simple generic namespaces" +HOMEPAGE = "http://veillard.com/XML/" +DESCRIPTION = "XML::NamespaceSupport offers a simple way to process namespace-based XML names. \ + It also helps maintain a prefix-to-namespace URI map, and provides a number of \ + basic checks. " + +SECTION = "libs" +LICENSE = "Artistic-1.0 | GPL-1.0+" + +SRCNAME = "XML-NamespaceSupport" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=c9d8a117e7620b5adf8d69c29613ceab" + +SRC_URI = "${CPAN_MIRROR}/authors/id/P/PE/PERIGRIN/${SRCNAME}-${PV}.tar.gz" +SRC_URI[md5sum] = "a8916c6d095bcf073e1108af02e78c97" +SRC_URI[sha256sum] = "47e995859f8dd0413aa3f22d350c4a62da652e854267aa0586ae544ae2bae5ef" + +UPSTREAM_CHECK_REGEX = "XML\-NamespaceSupport\-(?P<pver>(\d+\.\d+))(?!_\d+).tar" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +inherit cpan ptest-perl + +RDEPENDS_${PN}-ptest += "perl-module-test-more" + +BBCLASSEXTEND="native" + diff --git a/poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.09.bb b/poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.09.bb new file mode 100644 index 000000000..b3e01e9ac --- /dev/null +++ b/poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.09.bb @@ -0,0 +1,24 @@ +SUMMARY = "Base class SAX Drivers and Filters" +HOMEPAGE = "http://search.cpan.org/dist/XML-SAX-Base/" +DESCRIPTION = "This module has a very simple task - to be a base class for \ +PerlSAX drivers and filters. It's default behaviour is to pass \ +the input directly to the output unchanged. It can be useful to \ +use this module as a base class so you don't have to, for example, \ +implement the characters() callback." + +SECTION = "libs" +LICENSE = "Artistic-1.0 | GPL-1.0+" +RDEPENDS_${PN} += "perl-module-extutils-makemaker" + +LIC_FILES_CHKSUM = "file://dist.ini;endline=5;md5=8f9c9a55340aefaee6e9704c88466446" + +SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GR/GRANTM/XML-SAX-Base-${PV}.tar.gz" + +SRC_URI[md5sum] = "ec347a14065dd7aec7d9fb181b2d7946" +SRC_URI[sha256sum] = "66cb355ba4ef47c10ca738bd35999723644386ac853abbeb5132841f5e8a2ad0" + +S = "${WORKDIR}/XML-SAX-Base-${PV}" + +inherit cpan ptest-perl + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb b/poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb new file mode 100644 index 000000000..cdcbebffc --- /dev/null +++ b/poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb @@ -0,0 +1,33 @@ +SUMMARY = "Perl module for using and building Perl SAX2 XML processors" +HOMEPAGE = "http://search.cpan.org/dist/XML-SAX/" +DESCRIPTION = "XML::SAX consists of several framework classes for using and \ +building Perl SAX2 XML parsers, filters, and drivers. It is designed \ +around the need to be able to "plug in" different SAX parsers to an \ +application without requiring programmer intervention. Those of you \ +familiar with the DBI will be right at home. Some of the designs \ +come from the Java JAXP specification (SAX part), only without the \ +javaness." + +SECTION = "libs" +LICENSE = "Artistic-1.0 | GPL-1.0+" +DEPENDS += "libxml-namespacesupport-perl-native" +RDEPENDS_${PN} += "libxml-namespacesupport-perl libxml-sax-base-perl perl-module-file-temp" +PR = "r2" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=65c4cd8f39c24c7135ed70dacbcb09e3" + +SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GR/GRANTM/XML-SAX-${PV}.tar.gz" + +SRC_URI[md5sum] = "290f5375ae87fdebfdb5bc3854019f24" +SRC_URI[sha256sum] = "32b04b8e36b6cc4cfc486de2d859d87af5386dd930f2383c49347050d6f5ad84" + +S = "${WORKDIR}/XML-SAX-${PV}" + +inherit cpan ptest-perl + +do_install_ptest() { + cp -r ${B}/testfiles ${D}${PTEST_PATH} + chown -R root:root ${D}${PTEST_PATH}/testfiles +} + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/pigz/pigz_2.4.bb b/poky/meta/recipes-extended/pigz/pigz_2.4.bb new file mode 100644 index 000000000..6e6da9c3c --- /dev/null +++ b/poky/meta/recipes-extended/pigz/pigz_2.4.bb @@ -0,0 +1,30 @@ +SUMMARY = "A parallel implementation of gzip" +DESCRIPTION = "pigz, which stands for parallel implementation of gzip, is a \ +fully functional replacement for gzip that exploits multiple processors and \ +multiple cores to the hilt when compressing data. pigz was written by Mark \ +Adler, and uses the zlib and pthread libraries." +HOMEPAGE = "http://zlib.net/pigz/" +SECTION = "console/utils" +LICENSE = "Zlib & Apache-2.0" +LIC_FILES_CHKSUM = "file://pigz.c;md5=9ae6dee8ceba9610596ed0ada493d142;beginline=7;endline=21" + +SRC_URI = "http://zlib.net/${BPN}/fossils/${BP}.tar.gz" +SRC_URI[md5sum] = "def2f6e19d9d8231445adc1349d346df" +SRC_URI[sha256sum] = "a4f816222a7b4269bd232680590b579ccc72591f1bb5adafcd7208ca77e14f73" +# Point this at the homepage in case /fossils/ isn't updated +UPSTREAM_CHECK_URI = "http://zlib.net/${BPN}/" +UPSTREAM_CHECK_REGEX = "pigz-(?P<pver>.*)\.tar" + +DEPENDS = "zlib" + +EXTRA_OEMAKE = "-e MAKEFLAGS=" + +do_install() { + # Install files into /bin (FHS), which is typical place for gzip + install -d ${D}${base_bindir} + install ${B}/pigz ${D}${base_bindir}/pigz + ln -nsf pigz ${D}${base_bindir}/unpigz + ln -nsf pigz ${D}${base_bindir}/pigzcat +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch b/poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch new file mode 100644 index 000000000..12bae28dc --- /dev/null +++ b/poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch @@ -0,0 +1,51 @@ +From c84480be8df6966c538d1fb67ccae2f42cc46421 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 22 Mar 2016 07:36:54 +0000 +Subject: [PATCH 1/2] configure: Detect headers before using them + +Current logic does not work when system does not have +sys/endian.h, since it tried to reuse the cached results +from first try of detecting htole64 in sys/endian.h which is +'no' and hence the second try to look into endian.h also +comes out negative. + +So we check for header and then run the test for symbols +and these symbols are not standard and we need to define _GNU_SOURCE +for it to work, this issue is exposed by systems using musl e.g. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + + configure.ac | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 4cb56bc..5e23c50 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -69,12 +69,17 @@ AC_FUNC_MALLOC + AC_FUNC_REALLOC + AC_FUNC_STRTOD + AC_CHECK_FUNCS([memchr memmove memset strerror strtol]) +-AC_CHECK_DECLS([htole64, le64toh], +- [], ++AC_CHECK_HEADER([sys/endian.h], + [ +- AC_CHECK_DECLS([htole64, le64toh], [], [], [#include <endian.h>]) ++ AC_CHECK_DECLS([htole64, le64toh], [], [], [#define _GNU_SOURCE 1 #include <sys/endian.h>]) + ], +- [#include <sys/endian.h>]) ++ [], []) ++ ++AC_CHECK_HEADER([endian.h], ++ [ ++ AC_CHECK_DECLS([htole64, le64toh], [], [], [#define _GNU_SOURCE 1 #include <endian.h>]) ++ ], ++ [], []) + + AC_CONFIG_FILES([Makefile + src/Makefile +-- +1.8.3.1 + diff --git a/poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch b/poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch new file mode 100644 index 000000000..6b615988d --- /dev/null +++ b/poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch @@ -0,0 +1,47 @@ +From 5f3a535987bae4c3e3d9e9079c7526e399f7aecd Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 22 Mar 2016 07:42:39 +0000 +Subject: [PATCH 2/2] endian: Use macro bswap_64 instead of __bswap_64 + +byteswap.h defines then as public APIs on all libc +on linux including musl + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + src/endian.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/endian.c b/src/endian.c +index b7724f3..51aea58 100644 +--- a/src/endian.c ++++ b/src/endian.c +@@ -15,6 +15,7 @@ void xle64enc(uint8_t *d, uint64_t n) { + #include <stdint.h> + #ifdef __linux__ + #include <endian.h> ++ #include <byteswap.h> + #else + #include <sys/endian.h> + #endif +@@ -23,7 +24,7 @@ void xle64enc(uint8_t *d, uint64_t n) { + # if __BYTE_ORDER == __LITTLE_ENDIAN + # define htole64(x) (x) + # else +-# define htole64(x) __bswap_64 (x) ++# define htole64(x) bswap_64 (x) + # endif + #endif + +@@ -31,7 +32,7 @@ void xle64enc(uint8_t *d, uint64_t n) { + # if __BYTE_ORDER == __LITTLE_ENDIAN + # define le64toh(x) (x) + # else +-# define le64toh(x) __bswap_64 (x) ++# define le64toh(x) bswap_64 (x) + # endif + #endif + +-- +1.8.3.1 + diff --git a/poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch b/poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch new file mode 100644 index 000000000..e3489db5b --- /dev/null +++ b/poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch @@ -0,0 +1,68 @@ +From 936d8068ae19d95260d3058f41dd6cf718101cd6 Mon Sep 17 00:00:00 2001 +From: Christian Krause <kizkizzbangbang@googlemail.com> +Date: Sat, 26 Dec 2015 14:36:17 +0100 +Subject: [PATCH] option to not build man page + +fixes #56 +--- + configure.ac | 23 +++++++++++++++++++---- + src/Makefile.am | 2 ++ + 2 files changed, 21 insertions(+), 4 deletions(-) + +Upstream-Status: Backport +RP 2016/01/22 + +diff --git a/configure.ac b/configure.ac +index b437e56..4cb56bc 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -20,13 +20,28 @@ AC_CHECK_FILE( + [src/pixz.1], + [], + [ +- AC_CHECK_PROG(A2X, a2x, a2x, []) +- if test "x$A2X" = x ; then +- AC_MSG_ERROR([AsciiDoc not found, not able to generate the man page.]) +- fi ++ AC_ARG_WITH( ++ [manpage], ++ [ --without-manpage don't build man page], ++ [case ${withval} in ++ yes) manpage=true ;; ++ no) manpage=false ;; ++ *) AC_MSG_ERROR([bad value ${withval} for --with-manpage]) ;; ++ esac], ++ [manpage=true] ++ ) + ] + ) + ++AM_CONDITIONAL([MANPAGE], [test x$manpage = xtrue]) ++ ++if test x$manpage = xtrue ; then ++ AC_CHECK_PROG(A2X, a2x, a2x, []) ++ if test "x$A2X" = x ; then ++ AC_MSG_ERROR([AsciiDoc not found, not able to generate the man page.]) ++ fi ++fi ++ + # Checks for libraries. + AC_CHECK_LIB([m], [ceil]) + AX_PTHREAD +diff --git a/src/Makefile.am b/src/Makefile.am +index 600ec90..b98f450 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -15,6 +15,7 @@ pixz_SOURCES = \ + read.c \ + write.c + ++if MANPAGE + # TODO remove when possible: This is a hack because a2x is not able to output the man pages to a + # specific directory, only to where the source is. + pixz.1: pixz.1.asciidoc +@@ -26,3 +27,4 @@ man_MANS = pixz.1 + CLEANFILES = pixz.1 + + EXTRA_DIST = $(man_MANS) pixz.1.asciidoc ++endif diff --git a/poky/meta/recipes-extended/pixz/pixz_1.0.6.bb b/poky/meta/recipes-extended/pixz/pixz_1.0.6.bb new file mode 100644 index 000000000..303258658 --- /dev/null +++ b/poky/meta/recipes-extended/pixz/pixz_1.0.6.bb @@ -0,0 +1,25 @@ +SUMMARY = "Parallel, indexed xz compressor" + +DEPENDS = "xz libarchive" + +SRC_URI = "https://github.com/vasi/pixz/releases/download/v${PV}/${BPN}-${PV}.tar.xz" +SRC_URI[md5sum] = "f6dc5909c9a31b192f69aa397ae8df48" +SRC_URI[sha256sum] = "02c50746b134fa1b1aae41fcc314d7c6f1919b3d48bcdea01bf11769f83f72e8" + +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=5cf6d164086105f1512ccb81bfff1926" + +SRC_URI += "file://936d8068ae19d95260d3058f41dd6cf718101cd6.patch \ + file://0001-configure-Detect-headers-before-using-them.patch \ + file://0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch \ +" +UPSTREAM_CHECK_URI = "https://github.com/vasi/pixz/releases" + +PACKAGECONFIG[manpages] = "--with-manpage, --without-manpage, asciidoc-native" + +CFLAGS_append_libc-musl = " -D_GNU_SOURCE" +CACHED_CONFIGUREVARS += "ac_cv_file_src_pixz_1=no" + +inherit autotools pkgconfig manpages + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/procps/procps/sysctl.conf b/poky/meta/recipes-extended/procps/procps/sysctl.conf new file mode 100644 index 000000000..34e7488bf --- /dev/null +++ b/poky/meta/recipes-extended/procps/procps/sysctl.conf @@ -0,0 +1,64 @@ +# This configuration file is taken from Debian. +# +# /etc/sysctl.conf - Configuration file for setting system variables +# See sysctl.conf (5) for information. +# + +#kernel.domainname = example.com + +# Uncomment the following to stop low-level messages on console +#kernel.printk = 4 4 1 7 + +##############################################################3 +# Functions previously found in netbase +# + +# Uncomment the next two lines to enable Spoof protection (reverse-path filter) +# Turn on Source Address Verification in all interfaces to +# prevent some spoofing attacks +net.ipv4.conf.default.rp_filter=1 +net.ipv4.conf.all.rp_filter=1 + +# Uncomment the next line to enable TCP/IP SYN cookies +#net.ipv4.tcp_syncookies=1 + +# Uncomment the next line to enable packet forwarding for IPv4 +#net.ipv4.ip_forward=1 + +# Uncomment the next line to enable packet forwarding for IPv6 +#net.ipv6.conf.all.forwarding=1 + + +################################################################### +# Additional settings - these settings can improve the network +# security of the host and prevent against some network attacks +# including spoofing attacks and man in the middle attacks through +# redirection. Some network environments, however, require that these +# settings are disabled so review and enable them as needed. +# +# Ignore ICMP broadcasts +#net.ipv4.icmp_echo_ignore_broadcasts = 1 +# +# Ignore bogus ICMP errors +#net.ipv4.icmp_ignore_bogus_error_responses = 1 +# +# Do not accept ICMP redirects (prevent MITM attacks) +#net.ipv4.conf.all.accept_redirects = 0 +#net.ipv6.conf.all.accept_redirects = 0 +# _or_ +# Accept ICMP redirects only for gateways listed in our default +# gateway list (enabled by default) +# net.ipv4.conf.all.secure_redirects = 1 +# +# Do not send ICMP redirects (we are not a router) +#net.ipv4.conf.all.send_redirects = 0 +# +# Do not accept IP source route packets (we are not a router) +#net.ipv4.conf.all.accept_source_route = 0 +#net.ipv6.conf.all.accept_source_route = 0 +# +# Log Martian Packets +#net.ipv4.conf.all.log_martians = 1 +# + +#kernel.shmmax = 141762560 diff --git a/poky/meta/recipes-extended/procps/procps_3.3.12.bb b/poky/meta/recipes-extended/procps/procps_3.3.12.bb new file mode 100644 index 000000000..ecf215fec --- /dev/null +++ b/poky/meta/recipes-extended/procps/procps_3.3.12.bb @@ -0,0 +1,65 @@ +SUMMARY = "System and process monitoring utilities" +DESCRIPTION = "Procps contains a set of system utilities that provide system information about processes using \ +the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, and skill." +HOMEPAGE = "https://gitlab.com/procps-ng/procps" +SECTION = "base" +LICENSE = "GPLv2+ & LGPLv2+" +LIC_FILES_CHKSUM="file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \ + " + +DEPENDS = "ncurses" + +inherit autotools gettext pkgconfig update-alternatives + +SRC_URI = "http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-${PV}.tar.xz \ + file://sysctl.conf \ + " + +SRC_URI[md5sum] = "957e42e8b193490b2111252e4a2b443c" +SRC_URI[sha256sum] = "6ed65ab86318f37904e8f9014415a098bec5bc53653e5d9ab404f95ca5e1a7d4" + +S = "${WORKDIR}/procps-ng-${PV}" + +EXTRA_OECONF = "--enable-skill --disable-modern-top" + +do_install_append () { + install -d ${D}${base_bindir} + [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done + install -d ${D}${base_sbindir} + [ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done + if [ "${base_sbindir}" != "${sbindir}" ]; then + rmdir ${D}${sbindir} + fi + + install -d ${D}${sysconfdir} + install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + install -d ${D}${sysconfdir}/sysctl.d + ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf + fi +} + +CONFFILES_${PN} = "${sysconfdir}/sysctl.conf" + +bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w" +base_bindir_progs += "kill pidof ps watch" +base_sbindir_progs += "sysctl" + +ALTERNATIVE_PRIORITY = "200" +ALTERNATIVE_PRIORITY[pidof] = "150" + +ALTERNATIVE_${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}" + +ALTERNATIVE_${PN}-doc = "kill.1 uptime.1" +ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" +ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" + +python __anonymous() { + for prog in d.getVar('base_bindir_progs').split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) + + for prog in d.getVar('base_sbindir_progs').split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog)) +} + diff --git a/poky/meta/recipes-extended/psmisc/psmisc.inc b/poky/meta/recipes-extended/psmisc/psmisc.inc new file mode 100644 index 000000000..82ef94770 --- /dev/null +++ b/poky/meta/recipes-extended/psmisc/psmisc.inc @@ -0,0 +1,57 @@ +SUMMARY = "Utilities for managing processes on your system" +HOMEPAGE = "http://psmisc.sf.net/" +DESCRIPTION = "The psmisc package contains utilities for managing processes on your \ +system: pstree, killall and fuser. The pstree command displays a tree \ +structure of all of the running processes on your system. The killall \ +command sends a specified signal (SIGTERM if nothing is specified) to \ +processes identified by name. The fuser command identifies the PIDs \ +of processes that are using specified files or filesystems." +SECTION = "base" +DEPENDS = "ncurses virtual/libintl" +LICENSE = "GPLv2" + +SRC_URI = "${SOURCEFORGE_MIRROR}/psmisc/psmisc-${PV}.tar.gz" + +S = "${WORKDIR}/psmisc-${PV}" + +inherit autotools gettext + +# Upstream has a custom autogen.sh which invokes po/update-potfiles as they +# don't ship a po/POTFILES.in (which is silly). Without that file gettext +# doesn't believe po/ is a gettext directory and won't generate po/Makefile. +EXTRA_AUTORECONF_remove = "--exclude=autopoint" +do_configure_prepend() { + ( cd ${S} && po/update-potfiles ) +} + + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" +PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," + +ALLOW_EMPTY_${PN} = "1" + +PACKAGES =+ "fuser fuser-doc killall killall-doc pstree pstree-doc" +PACKAGES += "psmisc-extras" + +FILES_${PN} = "" +RDEPENDS_${PN} = "fuser killall pstree" + +FILES_fuser = "${bindir}/fuser.${BPN}" +FILES_fuser-doc = "${mandir}/man1/fuser*" + +FILES_killall = "${bindir}/killall.${BPN}" +FILES_killall-doc = "${mandir}/man1/killall*" + +FILES_pstree = "${bindir}/pstree" +FILES_pstree-doc = "${mandir}/man1/pstree*" + +FILES_psmisc-extras = "${bindir}" +FILES_psmisc-extras-doc = "${mandir}" + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "90" + +ALTERNATIVE_killall = "killall" + +ALTERNATIVE_fuser = "fuser" diff --git a/poky/meta/recipes-extended/psmisc/psmisc/0001-Makefile.am-create-src-directory-before-attempting-t.patch b/poky/meta/recipes-extended/psmisc/psmisc/0001-Makefile.am-create-src-directory-before-attempting-t.patch new file mode 100644 index 000000000..4d44495fd --- /dev/null +++ b/poky/meta/recipes-extended/psmisc/psmisc/0001-Makefile.am-create-src-directory-before-attempting-t.patch @@ -0,0 +1,30 @@ +From 285877b7761d74736aca2687ed9bef2f78b82c33 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Thu, 2 Nov 2017 16:21:22 +0200 +Subject: [PATCH] Makefile.am: create src directory before attempting to write + there + +Otherwise out of tree builds will fail. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> +--- + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index 9f61ab4..b4ced7f 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -79,7 +79,7 @@ EXTRA_DIST = src/signames.c README.md + CLEANFILES = src/signames.h + + src/signames.h: src/signames.c Makefile +- export LC_ALL=C ; \ ++ export LC_ALL=C ; mkdir -p src ; \ + @CPP@ -dM $< |\ + tr -s '\t ' ' ' | sort -n -k 3 | sed \ + 's:#define SIG\([A-Z][A-Z]*[0-9]*\) \([0-9][0-9]*\).*$\:{\ \2,"\1" },:p;d' | \ +-- +2.14.2 + diff --git a/poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch b/poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch new file mode 100644 index 000000000..b57a006bc --- /dev/null +++ b/poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch @@ -0,0 +1,51 @@ +From 5dc872bb2fba6421cb8e1ee578f7bd4aaed55f61 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 24 Mar 2016 15:46:14 +0000 +Subject: [PATCH] Use UINTPTR_MAX instead of __WORDSIZE + +Do not include sys/user.h since it conflicts with +pt_regs struct from kernel APIs in asm/ptrace.h + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + src/peekfd.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/src/peekfd.c b/src/peekfd.c +index cba2130..0d39878 100644 +--- a/src/peekfd.c ++++ b/src/peekfd.c +@@ -30,8 +30,11 @@ + #include <asm/ptrace.h> + #include <byteswap.h> + #include <endian.h> ++#ifdef __GLIBC__ + #include <sys/user.h> ++#endif + #include <stdlib.h> ++#include <stdint.h> + #include <getopt.h> + #include <ctype.h> + +@@ -228,11 +231,11 @@ int main(int argc, char **argv) + if (WIFSTOPPED(status)) { + #ifdef PPC + struct pt_regs regs; +- regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R0, 0); +- regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R3, 0); +- regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R4, 0); +- regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R5, 0); +- regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_ORIG_R3, 0); ++ regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R0, 0); ++ regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R3, 0); ++ regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R4, 0); ++ regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R5, 0); ++ regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_ORIG_R3, 0); + #elif defined(ARM) + struct pt_regs regs; + ptrace(PTRACE_GETREGS, pid, 0, ®s); +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/psmisc/psmisc_23.0.bb b/poky/meta/recipes-extended/psmisc/psmisc_23.0.bb new file mode 100644 index 000000000..2b07f4974 --- /dev/null +++ b/poky/meta/recipes-extended/psmisc/psmisc_23.0.bb @@ -0,0 +1,10 @@ +require psmisc.inc +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" + +SRC_URI = "git://gitlab.com/psmisc/psmisc.git;protocol=https \ + file://0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch \ + file://0001-Makefile.am-create-src-directory-before-attempting-t.patch \ + " +SRCREV = "67b1da268f4c0ce6859980e3dfcfaec5b2448e80" +S = "${WORKDIR}/git" diff --git a/poky/meta/recipes-extended/quota/quota/fcntl.patch b/poky/meta/recipes-extended/quota/quota/fcntl.patch new file mode 100644 index 000000000..2d3797132 --- /dev/null +++ b/poky/meta/recipes-extended/quota/quota/fcntl.patch @@ -0,0 +1,85 @@ +Include fcntl.h to pacify compiler errors on musl +like + +error: unknown type name 'loff_t' +Cover rpc headers under proper conditional +Dont use __P its undefined + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +ndex: quota-tools/quota.h +=================================================================== +Index: quota-tools/quota.h +=================================================================== +--- quota-tools.orig/quota.h ++++ quota-tools/quota.h +@@ -165,6 +165,6 @@ enum { + #endif + #endif + +-long quotactl __P((int, const char *, qid_t, caddr_t)); ++long quotactl (int, const char *, qid_t, caddr_t); + + #endif /* _QUOTA_ */ +Index: quota-tools/quotacheck.c +=================================================================== +--- quota-tools.orig/quotacheck.c ++++ quota-tools/quotacheck.c +@@ -19,6 +19,7 @@ + #include <unistd.h> + #include <stdlib.h> + #include <errno.h> ++#include <fcntl.h> + + #include <sys/stat.h> + #include <sys/types.h> +Index: quota-tools/quotaio.c +=================================================================== +--- quota-tools.orig/quotaio.c ++++ quota-tools/quotaio.c +@@ -12,6 +12,7 @@ + #include <string.h> + #include <unistd.h> + #include <stdlib.h> ++#include <fcntl.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/file.h> +Index: quota-tools/dqblk_v2.h +=================================================================== +--- quota-tools.orig/dqblk_v2.h ++++ quota-tools/dqblk_v2.h +@@ -7,6 +7,7 @@ + #ifndef GUARD_DQBLK_V2_H + #define GUARD_DQBLK_V2_H + ++#include <fcntl.h> + #include <sys/types.h> + #include "quota_tree.h" + +Index: quota-tools/rquota_client.c +=================================================================== +--- quota-tools.orig/rquota_client.c ++++ quota-tools/rquota_client.c +@@ -19,7 +19,9 @@ + + #include "config.h" + ++#if defined(RPC) + #include <rpc/rpc.h> ++#endif + #include <sys/types.h> + #include <sys/param.h> + #include <sys/stat.h> +@@ -35,7 +37,9 @@ + #include <stdint.h> + + #include "mntopt.h" ++#if defined(RPC) + #include "rquota.h" ++#endif + #include "common.h" + #include "quotaio.h" + #include "quotasys.h" diff --git a/poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch b/poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch new file mode 100644 index 000000000..06ff13cb9 --- /dev/null +++ b/poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch @@ -0,0 +1,198 @@ +Use proper C99 integer types + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Index: quota-tools/bylabel.c +=================================================================== +--- quota-tools.orig/bylabel.c ++++ quota-tools/bylabel.c +@@ -20,6 +20,7 @@ + #include <ctype.h> + #include <fcntl.h> + #include <unistd.h> ++#include <stdint.h> + + #include "bylabel.h" + #include "common.h" +@@ -37,32 +38,32 @@ static struct uuidCache_s { + + #define EXT2_SUPER_MAGIC 0xEF53 + struct ext2_super_block { +- u_char s_dummy1[56]; +- u_char s_magic[2]; +- u_char s_dummy2[46]; +- u_char s_uuid[16]; +- u_char s_volume_name[16]; ++ uint8_t s_dummy1[56]; ++ uint8_t s_magic[2]; ++ uint8_t s_dummy2[46]; ++ uint8_t s_uuid[16]; ++ uint8_t s_volume_name[16]; + }; + +-#define ext2magic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8)) ++#define ext2magic(s) ((uint32_t) s.s_magic[0] + (((uint32_t) s.s_magic[1]) << 8)) + + #define XFS_SUPER_MAGIC "XFSB" + #define XFS_SUPER_MAGIC2 "BSFX" + struct xfs_super_block { +- u_char s_magic[4]; +- u_char s_dummy[28]; +- u_char s_uuid[16]; +- u_char s_dummy2[60]; +- u_char s_fsname[12]; ++ uint8_t s_magic[4]; ++ uint8_t s_dummy[28]; ++ uint8_t s_uuid[16]; ++ uint8_t s_dummy2[60]; ++ uint8_t s_fsname[12]; + }; + + #define REISER_SUPER_MAGIC "ReIsEr2Fs" + struct reiserfs_super_block { +- u_char s_dummy1[52]; +- u_char s_magic[10]; +- u_char s_dummy2[22]; +- u_char s_uuid[16]; +- u_char s_volume_name[16]; ++ uint8_t s_dummy1[52]; ++ uint8_t s_magic[10]; ++ uint8_t s_dummy2[22]; ++ uint8_t s_uuid[16]; ++ uint8_t s_volume_name[16]; + }; + + static inline unsigned short swapped(unsigned short a) +@@ -222,7 +223,7 @@ static char *get_spec_by_x(int n, const + return NULL; + } + +-static u_char fromhex(char c) ++static uint8_t fromhex(char c) + { + if (isdigit(c)) + return (c - '0'); +@@ -234,7 +235,7 @@ static u_char fromhex(char c) + + static char *get_spec_by_uuid(const char *s) + { +- u_char uuid[16]; ++ uint8_t uuid[16]; + int i; + + if (strlen(s) != 36 || s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-') +Index: quota-tools/quot.c +=================================================================== +--- quota-tools.orig/quot.c ++++ quota-tools/quot.c +@@ -47,6 +47,7 @@ + #include <utmp.h> + #include <pwd.h> + #include <grp.h> ++#include <stdint.h> + + #include "pot.h" + #include "quot.h" +@@ -56,8 +57,8 @@ + #include "quotasys.h" + + #define TSIZE 500 +-static __uint64_t sizes[TSIZE]; +-static __uint64_t overflow; ++static uint64_t sizes[TSIZE]; ++static uint64_t overflow; + + static int aflag; + static int cflag; +@@ -72,7 +73,7 @@ static time_t now; + char *progname; + + static void mounttable(void); +-static char *idname(__uint32_t, int); ++static char *idname(uint32_t, int); + static void report(const char *, const char *, int); + static void creport(const char *, const char *); + +@@ -173,7 +174,7 @@ static int qcmp(du_t * p1, du_t * p2) + static void creport(const char *file, const char *fsdir) + { + int i; +- __uint64_t t = 0; ++ uint64_t t = 0; + + printf(_("%s (%s):\n"), file, fsdir); + for (i = 0; i < TSIZE - 1; i++) +@@ -219,7 +220,7 @@ static void report(const char *file, con + } + } + +-static idcache_t *getnextent(int type, __uint32_t id, int byid) ++static idcache_t *getnextent(int type, uint32_t id, int byid) + { + struct passwd *pw; + struct group *gr; +@@ -240,7 +241,7 @@ static idcache_t *getnextent(int type, _ + return &idc; + } + +-static char *idname(__uint32_t id, int type) ++static char *idname(uint32_t id, int type) + { + idcache_t *ncp, *idp; + static idcache_t nc[2][NID]; +@@ -286,8 +287,8 @@ static void acctXFS(xfs_bstat_t *p) + { + register du_t *dp; + du_t **hp; +- __uint64_t size; +- __uint32_t i, id; ++ uint64_t size; ++ uint32_t i, id; + + if ((p->bs_mode & S_IFMT) == 0) + return; +Index: quota-tools/quot.h +=================================================================== +--- quota-tools.orig/quot.h ++++ quota-tools/quot.h +@@ -35,18 +35,18 @@ + #define SEC24HR (60*60*24) /* seconds per day */ + + typedef struct { +- __uint32_t id; ++ uint32_t id; + char name[UT_NAMESIZE + 1]; + } idcache_t; + + typedef struct du { + struct du *next; +- __uint64_t blocks; +- __uint64_t blocks30; +- __uint64_t blocks60; +- __uint64_t blocks90; +- __uint64_t nfiles; +- __uint32_t id; ++ uint64_t blocks; ++ uint64_t blocks30; ++ uint64_t blocks60; ++ uint64_t blocks90; ++ uint64_t nfiles; ++ uint32_t id; + } du_t; + + #define NDU 60000 +Index: quota-tools/rquota_server.c +=================================================================== +--- quota-tools.orig/rquota_server.c ++++ quota-tools/rquota_server.c +@@ -60,7 +60,7 @@ extern char nfs_pseudoroot[PATH_MAX]; + */ + extern struct authunix_parms *unix_cred; + +-int in_group(gid_t * gids, u_int len, gid_t gid) ++int in_group(gid_t * gids, uint32_t len, gid_t gid) + { + gid_t *gidsp = gids + len; + diff --git a/poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch b/poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch new file mode 100644 index 000000000..4687ca06f --- /dev/null +++ b/poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch @@ -0,0 +1,32 @@ +From a3808fd165847298d025971eb3c7be7d11caba9d Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Wed, 8 Nov 2017 11:56:55 +0200 +Subject: [PATCH] Replace getrpcbynumber_r with getrpcbynumber + +musl and uclibc dont implement it + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- + svc_socket.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/svc_socket.c b/svc_socket.c +index 8a44604..5bdaaa0 100644 +--- a/svc_socket.c ++++ b/svc_socket.c +@@ -36,7 +36,8 @@ static int get_service_port(u_long number, const char *proto) + struct servent servbuf, *servp = NULL; + int ret; + +- ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof(rpcdata), &rpcp); ++ rpcp = getrpcbynumber(number); ++ ret = 0; + if (ret == 0 && rpcp != NULL) { + /* First try name */ + ret = getservbyname_r(rpcp->r_name, proto, &servbuf, servdata, +-- +2.4.0 + diff --git a/poky/meta/recipes-extended/quota/quota_4.04.bb b/poky/meta/recipes-extended/quota/quota_4.04.bb new file mode 100644 index 000000000..93f376286 --- /dev/null +++ b/poky/meta/recipes-extended/quota/quota_4.04.bb @@ -0,0 +1,38 @@ +SUMMARY = "Tools for monitoring & limiting user disk usage per filesystem" +SECTION = "base" +HOMEPAGE = "http://sourceforge.net/projects/linuxquota/" +BUGTRACKER = "http://sourceforge.net/tracker/?group_id=18136&atid=118136" +LICENSE = "BSD & GPLv2+ & LGPLv2.1+" +LIC_FILES_CHKSUM = "file://quota.c;beginline=1;endline=33;md5=331c7d77744bfe0ad24027f0651028ec \ + file://rquota_server.c;beginline=1;endline=20;md5=fe7e0d7e11c6f820f8fa62a5af71230f \ + file://svc_socket.c;beginline=1;endline=17;md5=24d5a8792da45910786eeac750be8ceb" + +SRC_URI = "${SOURCEFORGE_MIRROR}/project/linuxquota/quota-tools/${PV}/quota-${PV}.tar.gz \ + file://fcntl.patch \ + file://remove_non_posix_types.patch \ + " +SRC_URI_append_libc-musl = " file://replace_getrpcbynumber_r.patch" + +SRC_URI[md5sum] = "f46f3b0b5141f032f25684005dac49d3" +SRC_URI[sha256sum] = "735be1887e7f51f54165e778ae43fc859c04e44d88834ecb2f470e91d4ef8edf" + +CVE_PRODUCT = "linux_diskquota" + +UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/linuxquota/files/quota-tools/" +UPSTREAM_CHECK_REGEX = "/quota-tools/(?P<pver>(\d+[\.\-_]*)+)/" + +DEPENDS = "gettext-native e2fsprogs libnl dbus" + +inherit autotools-brokensep gettext pkgconfig + +CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'rpc', '-I${STAGING_INCDIR}/tirpc', '', d)}" +LDFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'rpc', '-ltirpc', '', d)}" +ASNEEDED = "" + +PACKAGECONFIG ??= "tcp-wrappers rpc bsd" +PACKAGECONFIG_libc-musl = "tcp-wrappers rpc" + +PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" +PACKAGECONFIG[rpc] = "--enable-rpc,--disable-rpc,libtirpc" +PACKAGECONFIG[bsd] = "--enable-bsd_behaviour=yes,--enable-bsd_behaviour=no," +PACKAGECONFIG[ldapmail] = "--enable-ldapmail,--disable-ldapmail,openldap" diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch b/poky/meta/recipes-extended/rpcbind/rpcbind/0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch new file mode 100644 index 000000000..bf7aaef5a --- /dev/null +++ b/poky/meta/recipes-extended/rpcbind/rpcbind/0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch @@ -0,0 +1,221 @@ +From 7ea36eeece56b59f98e469934e4c20b4da043346 Mon Sep 17 00:00:00 2001 +From: Doran Moppert <dmoppert@redhat.com> +Date: Thu, 11 May 2017 11:42:54 -0400 +Subject: [PATCH] rpcbind: pair all svc_getargs() calls with svc_freeargs() to + avoid memory leak + +This patch is to address CVE-2017-8779 "rpcbomb" in rpcbind, discussed +at [1], [2], [3]. The last link suggests this issue is actually a bug +in rpcbind, which led me here. + +The leak caused by the reproducer at [4] appears to come from +rpcb_service_4(), in the case where svc_getargs() returns false and the +function had an early return, rather than passing through the cleanup +path at done:, as would otherwise occur. + +It also addresses a couple of other locations where the same fault seems +to exist, though I haven't been able to exercise those. I hope someone +more intimate with rpc(3) can confirm my understanding is correct, and +that I haven't introduced any new bugs. + +Without this patch, using the reproducer (and variants) repeatedly +against rpcbind with a numBytes argument of 1_000_000_000, /proc/$(pidof +rpcbind)/status reports VmSize increase of 976564 kB each call, and +VmRSS increase of around 260 kB every 33 calls - the specific numbers +are probably an artifact of my rhel/glibc version. With the patch, +there is a small (~50 kB) VmSize increase with the first message, but +thereafter both VmSize and VmRSS remain steady. + +[1]: http://seclists.org/oss-sec/2017/q2/209 +[2]: https://bugzilla.redhat.com/show_bug.cgi?id=1448124 +[3]: https://sourceware.org/ml/libc-alpha/2017-05/msg00129.html +[4]: https://github.com/guidovranken/rpcbomb/ + + +CVE: CVE-2017-8779 +Upstream-Status: Backport + +Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com> +--- + src/pmap_svc.c | 56 +++++++++++++++++++++++++++++++++++++++++++++--------- + src/rpcb_svc.c | 2 +- + src/rpcb_svc_4.c | 2 +- + src/rpcb_svc_com.c | 8 ++++++++ + 4 files changed, 57 insertions(+), 11 deletions(-) + +diff --git a/src/pmap_svc.c b/src/pmap_svc.c +index 4c744fe..e926cdc 100644 +--- a/src/pmap_svc.c ++++ b/src/pmap_svc.c +@@ -175,6 +175,7 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long + long ans; + uid_t uid; + char uidbuf[32]; ++ int rc = TRUE; + + /* + * Can't use getpwnam here. We might end up calling ourselves +@@ -194,7 +195,8 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long + + if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)®)) { + svcerr_decode(xprt); +- return (FALSE); ++ rc = FALSE; ++ goto done; + } + #ifdef RPCBIND_DEBUG + if (debugging) +@@ -205,7 +207,8 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long + + if (!check_access(xprt, op, reg.pm_prog, PMAPVERS)) { + svcerr_weakauth(xprt); +- return (FALSE); ++ rc = (FALSE); ++ goto done; + } + + rpcbreg.r_prog = reg.pm_prog; +@@ -258,7 +261,16 @@ done_change: + rpcbs_set(RPCBVERS_2_STAT, ans); + else + rpcbs_unset(RPCBVERS_2_STAT, ans); +- return (TRUE); ++done: ++ if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)®)) { ++ if (debugging) { ++ /*(void) xlog(LOG_DEBUG, "unable to free arguments\n");*/ ++ if (doabort) { ++ rpcbind_abort(); ++ } ++ } ++ } ++ return (rc); + } + + /* ARGSUSED */ +@@ -272,15 +284,18 @@ pmapproc_getport(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt) + #ifdef RPCBIND_DEBUG + char *uaddr; + #endif ++ int rc = TRUE; + + if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)®)) { + svcerr_decode(xprt); +- return (FALSE); ++ rc = FALSE; ++ goto done; + } + + if (!check_access(xprt, PMAPPROC_GETPORT, reg.pm_prog, PMAPVERS)) { + svcerr_weakauth(xprt); +- return FALSE; ++ rc = FALSE; ++ goto done; + } + + #ifdef RPCBIND_DEBUG +@@ -330,21 +345,34 @@ pmapproc_getport(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt) + pmap_ipprot2netid(reg.pm_prot) ?: "<unknown>", + port ? udptrans : ""); + +- return (TRUE); ++done: ++ if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)®)) { ++ if (debugging) { ++ /* (void) xlog(LOG_DEBUG, "unable to free arguments\n");*/ ++ if (doabort) { ++ rpcbind_abort(); ++ } ++ } ++ } ++ return (rc); + } + + /* ARGSUSED */ + static bool_t + pmapproc_dump(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt) + { ++ int rc = TRUE; ++ + if (!svc_getargs(xprt, (xdrproc_t)xdr_void, NULL)) { + svcerr_decode(xprt); +- return (FALSE); ++ rc = FALSE; ++ goto done; + } + + if (!check_access(xprt, PMAPPROC_DUMP, 0, PMAPVERS)) { + svcerr_weakauth(xprt); +- return FALSE; ++ rc = FALSE; ++ goto done; + } + + if ((!svc_sendreply(xprt, (xdrproc_t) xdr_pmaplist_ptr, +@@ -354,7 +382,17 @@ pmapproc_dump(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt) + rpcbind_abort(); + } + } +- return (TRUE); ++ ++done: ++ if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)NULL)) { ++ if (debugging) { ++ /*(void) xlog(LOG_DEBUG, "unable to free arguments\n");*/ ++ if (doabort) { ++ rpcbind_abort(); ++ } ++ } ++ } ++ return (rc); + } + + int pmap_netid2ipprot(const char *netid) +diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c +index 709e3fb..091f530 100644 +--- a/src/rpcb_svc.c ++++ b/src/rpcb_svc.c +@@ -166,7 +166,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp) + svcerr_decode(transp); + if (debugging) + (void) xlog(LOG_DEBUG, "rpcbind: could not decode"); +- return; ++ goto done; + } + + if (rqstp->rq_proc == RPCBPROC_SET +diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c +index 5094879..eebbbbe 100644 +--- a/src/rpcb_svc_4.c ++++ b/src/rpcb_svc_4.c +@@ -218,7 +218,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp) + svcerr_decode(transp); + if (debugging) + (void) xlog(LOG_DEBUG, "rpcbind: could not decode\n"); +- return; ++ goto done; + } + + if (rqstp->rq_proc == RPCBPROC_SET +diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c +index 5862c26..cb63afd 100644 +--- a/src/rpcb_svc_com.c ++++ b/src/rpcb_svc_com.c +@@ -927,6 +927,14 @@ error: + if (call_msg.rm_xid != 0) + (void) free_slot_by_xid(call_msg.rm_xid); + out: ++ if (!svc_freeargs(transp, (xdrproc_t) xdr_rmtcall_args, (char *) &a)) { ++ if (debugging) { ++ (void) xlog(LOG_DEBUG, "unable to free arguments\n"); ++ if (doabort) { ++ rpcbind_abort(); ++ } ++ } ++ } + if (local_uaddr) + free(local_uaddr); + if (buf_alloc) +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/init.d b/poky/meta/recipes-extended/rpcbind/rpcbind/init.d new file mode 100644 index 000000000..67499aa82 --- /dev/null +++ b/poky/meta/recipes-extended/rpcbind/rpcbind/init.d @@ -0,0 +1,87 @@ +#!/bin/sh +# +# start/stop rpcbind daemon. + +### BEGIN INIT INFO +# Provides: rpcbind +# Required-Start: $network +# Required-Stop: $network +# Default-Start: S 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: RPC portmapper replacement +# Description: rpcbind is a server that converts RPC (Remote +# Procedure Call) program numbers into DARPA +# protocol port numbers. It must be running in +# order to make RPC calls. Services that use +# RPC include NFS and NIS. +### END INIT INFO + +# Source function library. +. /etc/init.d/functions + +test -f /sbin/rpcbind || exit 0 + +OPTIONS="" +if [ -f /etc/default/rpcbind ] +then + . /etc/default/rpcbind +elif [ -f /etc/rpcbind.conf ] +then + . /etc/rpcbind.conf +fi + +start () +{ + echo -n "Starting rpcbind daemon..." + if pidof /sbin/rpcbind >/dev/null; then + echo "already running." + exit 0 + fi + start-stop-daemon --start --quiet --exec /sbin/rpcbind -- "$@" + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + fi +} + +stop () +{ + echo "Stopping rpcbind daemon..." + if ! pidof /sbin/rpcbind >/dev/null; then + echo "not running." + return 0 + fi + start-stop-daemon --stop --quiet --exec /sbin/rpcbind + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + fi +} + +case "$1" in + start) + start $OPTIONS + ;; + stop) + stop + ;; + force-reload) + stop + start $OPTIONS + ;; + restart) + stop + start $OPTIONS + ;; + status) + status /sbin/rpcbind + ;; + *) + echo "Usage: /etc/init.d/rpcbind {start|stop|force-reload|restart|status}" + exit 1 + ;; +esac + +exit $? diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/pmapproc_dump-Fixed-typo-in-memory-leak-patch.patch b/poky/meta/recipes-extended/rpcbind/rpcbind/pmapproc_dump-Fixed-typo-in-memory-leak-patch.patch new file mode 100644 index 000000000..4c23ee01c --- /dev/null +++ b/poky/meta/recipes-extended/rpcbind/rpcbind/pmapproc_dump-Fixed-typo-in-memory-leak-patch.patch @@ -0,0 +1,30 @@ +From c49a7ea639eb700823e174fd605bbbe183e229aa Mon Sep 17 00:00:00 2001 +From: Steve Dickson <steved@redhat.com> +Date: Wed, 17 May 2017 10:52:25 -0400 +Subject: [PATCH] pmapproc_dump: Fixed typo in memory leak patch + +commit 7ea36eee introduce a typo that caused +NIS (aka ypbind) to fail. + +Signed-off-by: Steve Dickson <steved@redhat.com> + +Upstream-Status: Backport + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + src/pmap_svc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: rpcbind-0.2.4/src/pmap_svc.c +=================================================================== +--- rpcbind-0.2.4.orig/src/pmap_svc.c ++++ rpcbind-0.2.4/src/pmap_svc.c +@@ -384,7 +384,7 @@ pmapproc_dump(struct svc_req *rqstp /*__ + } + + done: +- if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)NULL)) { ++ if (!svc_freeargs(xprt, (xdrproc_t) xdr_void, (char *)NULL)) { + if (debugging) { + /*(void) xlog(LOG_DEBUG, "unable to free arguments\n");*/ + if (doabort) { diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf new file mode 100644 index 000000000..2a4dfbcfb --- /dev/null +++ b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf @@ -0,0 +1,3 @@ +# Optional arguments passed to rpcbind. +# +RPCBIND_OPTS="" diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service new file mode 100644 index 000000000..9cdade495 --- /dev/null +++ b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service @@ -0,0 +1,12 @@ +[Unit] +Description=RPC Bind Service +Requires=rpcbind.socket + +[Service] +Type=forking +EnvironmentFile=-@SYSCONFDIR@/rpcbind.conf +ExecStart=@SBINDIR@/rpcbind $RPCBIND_OPTS +SuccessExitStatus=2 + +[Install] +Also=rpcbind.socket diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket new file mode 100644 index 000000000..d63c1d972 --- /dev/null +++ b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket @@ -0,0 +1,8 @@ +[Unit] +Description=RPCbind Server Activation Socket + +[Socket] +ListenStream=/var/run/rpcbind.sock + +[Install] +WantedBy=sockets.target diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbproc_callit_com-Stop-freeing-a-static-pointer.patch b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbproc_callit_com-Stop-freeing-a-static-pointer.patch new file mode 100644 index 000000000..9a000d028 --- /dev/null +++ b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbproc_callit_com-Stop-freeing-a-static-pointer.patch @@ -0,0 +1,100 @@ +From 7c7590ad536c0e24bef790cb1e65702fc54db566 Mon Sep 17 00:00:00 2001 +From: Steve Dickson <steved@redhat.com> +Date: Tue, 30 May 2017 11:27:22 -0400 +Subject: [PATCH] rpcbproc_callit_com: Stop freeing a static pointer + +commit 7ea36ee introduced a svc_freeargs() call +that ended up freeing static pointer. + +It turns out the allocations for the rmt_args +is not necessary . The xdr routines (xdr_bytes) will +handle the memory management and the largest +possible message size is UDPMSGSIZE (due to UDP only) +which is smaller than RPC_BUF_MAX + +Signed-off-by: Steve Dickson <steved@redhat.com> + +Upstream-Status: Backport + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + src/rpcb_svc_com.c | 39 ++++++--------------------------------- + 1 file changed, 6 insertions(+), 33 deletions(-) + +diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c +index cb63afd..1fc2229 100644 +--- a/src/rpcb_svc_com.c ++++ b/src/rpcb_svc_com.c +@@ -612,9 +612,9 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp, + struct netconfig *nconf; + struct netbuf *caller; + struct r_rmtcall_args a; +- char *buf_alloc = NULL, *outbufp; ++ char *outbufp; + char *outbuf_alloc = NULL; +- char buf[RPC_BUF_MAX], outbuf[RPC_BUF_MAX]; ++ char outbuf[RPC_BUF_MAX]; + struct netbuf *na = (struct netbuf *) NULL; + struct rpc_msg call_msg; + int outlen; +@@ -635,36 +635,10 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp, + } + if (si.si_socktype != SOCK_DGRAM) + return; /* Only datagram type accepted */ +- sendsz = __rpc_get_t_size(si.si_af, si.si_proto, UDPMSGSIZE); +- if (sendsz == 0) { /* data transfer not supported */ +- if (reply_type == RPCBPROC_INDIRECT) +- svcerr_systemerr(transp); +- return; +- } +- /* +- * Should be multiple of 4 for XDR. +- */ +- sendsz = ((sendsz + 3) / 4) * 4; +- if (sendsz > RPC_BUF_MAX) { +-#ifdef notyet +- buf_alloc = alloca(sendsz); /* not in IDR2? */ +-#else +- buf_alloc = malloc(sendsz); +-#endif /* notyet */ +- if (buf_alloc == NULL) { +- if (debugging) +- xlog(LOG_DEBUG, +- "rpcbproc_callit_com: No Memory!\n"); +- if (reply_type == RPCBPROC_INDIRECT) +- svcerr_systemerr(transp); +- return; +- } +- a.rmt_args.args = buf_alloc; +- } else { +- a.rmt_args.args = buf; +- } ++ sendsz = UDPMSGSIZE; + + call_msg.rm_xid = 0; /* For error checking purposes */ ++ memset(&a, 0, sizeof(a)); /* Zero out the input buffer */ + if (!svc_getargs(transp, (xdrproc_t) xdr_rmtcall_args, (char *) &a)) { + if (reply_type == RPCBPROC_INDIRECT) + svcerr_decode(transp); +@@ -704,7 +678,8 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp, + if (rbl == (rpcblist_ptr)NULL) { + #ifdef RPCBIND_DEBUG + if (debugging) +- xlog(LOG_DEBUG, "not found\n"); ++ xlog(LOG_DEBUG, "prog %lu vers %lu: not found\n", ++ a.rmt_prog, a.rmt_vers); + #endif + if (reply_type == RPCBPROC_INDIRECT) + svcerr_noprog(transp); +@@ -937,8 +912,6 @@ out: + } + if (local_uaddr) + free(local_uaddr); +- if (buf_alloc) +- free(buf_alloc); + if (outbuf_alloc) + free(outbuf_alloc); + if (na) { +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb b/poky/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb new file mode 100644 index 000000000..dcdee6c46 --- /dev/null +++ b/poky/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb @@ -0,0 +1,65 @@ +SUMMARY = "Universal Addresses to RPC Program Number Mapper" +DESCRIPTION = "The rpcbind utility is a server that converts RPC \ + program numbers into universal addresses." +SECTION = "console/network" +HOMEPAGE = "http://sourceforge.net/projects/rpcbind/" +BUGTRACKER = "http://sourceforge.net/tracker/?group_id=201237&atid=976751" +DEPENDS = "libtirpc quota" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=b46486e4c4a416602693a711bb5bfa39 \ + file://src/rpcinfo.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24" + +SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \ + file://init.d \ + file://rpcbind.conf \ + file://rpcbind.socket \ + file://rpcbind.service \ + file://0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch \ + file://pmapproc_dump-Fixed-typo-in-memory-leak-patch.patch \ + file://rpcbproc_callit_com-Stop-freeing-a-static-pointer.patch \ + " +SRC_URI[md5sum] = "cf10cd41ed8228fc54c316191c1f07fe" +SRC_URI[sha256sum] = "074a9a530dc7c11e0d905aa59bcb0847c009313f02e98d3d798aa9568f414c66" + +inherit autotools update-rc.d systemd pkgconfig + +PACKAGECONFIG ??= "tcp-wrappers" +PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" + +INITSCRIPT_NAME = "rpcbind" +INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ." + +SYSTEMD_SERVICE_${PN} = "rpcbind.service" + +inherit useradd + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} = "--system --no-create-home --home-dir / \ + --shell /bin/false --user-group rpc" + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" +PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/, \ + --without-systemdsystemunitdir, \ + systemd \ +" + +EXTRA_OECONF += " --enable-warmstarts --with-rpcuser=rpc" + +do_install_append () { + mv ${D}${bindir} ${D}${sbindir} + + install -d ${D}${sysconfdir}/init.d + sed -e 's,/etc/,${sysconfdir}/,g' \ + -e 's,/sbin/,${sbindir}/,g' \ + ${WORKDIR}/init.d > ${D}${sysconfdir}/init.d/rpcbind + chmod 0755 ${D}${sysconfdir}/init.d/rpcbind + + install -m 0755 ${WORKDIR}/rpcbind.conf ${D}${sysconfdir} + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/rpcbind.socket ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/rpcbind.service ${D}${systemd_unitdir}/system + sed -i -e 's,@SBINDIR@,${sbindir},g' \ + -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + ${D}${systemd_unitdir}/system/rpcbind.service +} diff --git a/poky/meta/recipes-extended/screen/screen/0001-configure.ac-fix-configure-failed-while-build-dir-ha.patch b/poky/meta/recipes-extended/screen/screen/0001-configure.ac-fix-configure-failed-while-build-dir-ha.patch new file mode 100644 index 000000000..1274b2794 --- /dev/null +++ b/poky/meta/recipes-extended/screen/screen/0001-configure.ac-fix-configure-failed-while-build-dir-ha.patch @@ -0,0 +1,109 @@ +From 4b258c5a9078f8df60684ab7536ce3a8ff207e08 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Thu, 12 Oct 2017 10:03:57 +0000 +Subject: [PATCH] configure.ac: fix configure failed while build dir contains "yes" + +While the name of build dir contains "yes", the AC_EGREP_CPP +test always return true. + +We rarely use "yes;" to name build dir, so s/yes/yes;/g +could fix the issue + +Upstream-Status: Accepted +https://git.savannah.gnu.org/cgit/screen.git/commit/?h=screen-v4&id=8c2b4061d16756ee2ed37f08db063b8215656943 + +Signed-off-by: Jian Kang <jian.kang@windriver.com> +--- + configure.ac | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 12996cd..4765af6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -128,7 +128,7 @@ fi + + + AC_CHECKING(for Ultrix) +-AC_EGREP_CPP(yes, ++AC_EGREP_CPP(yes;, + [#if defined(ultrix) || defined(__ultrix) + yes; + #endif +@@ -145,7 +145,7 @@ dnl ghazi@caip.rutgers.edu (Kaveh R. Ghazi): + dnl BBN butterfly is not POSIX, but a MACH BSD system. + dnl Do not define POSIX and TERMIO. + AC_CHECKING(for butterfly) +-AC_EGREP_CPP(yes, ++AC_EGREP_CPP(yes;, + [#if defined(butterfly) + yes; + #endif +@@ -156,7 +156,7 @@ if test -n "$ULTRIX"; then + test -z "$GCC" && CC="$CC -YBSD" + fi + AC_CHECKING(for POSIX.1) +-AC_EGREP_CPP(yes, ++AC_EGREP_CPP(yes;, + [#include <sys/types.h> + #include <unistd.h> + main () { +@@ -173,14 +173,14 @@ AC_TRY_COMPILE( + #include <fcntl.h>], [int x = SIGCHLD | FNDELAY;], , AC_DEFINE(SYSV)) + + AC_CHECKING(for sequent/ptx) +-AC_EGREP_CPP(yes, ++AC_EGREP_CPP(yes;, + [#ifdef _SEQUENT_ + yes; + #endif + ], LIBS="$LIBS -lsocket -linet";seqptx=1) + + AC_CHECKING(SVR4) +-AC_EGREP_CPP(yes, ++AC_EGREP_CPP(yes;, + [main () { + #if defined(SVR4) || defined(__SVR4) + yes; +@@ -200,9 +200,9 @@ fi + AC_CHECK_HEADERS([stropts.h string.h strings.h]) + + AC_CHECKING(for Solaris 2.x) +-AC_EGREP_CPP(yes, ++AC_EGREP_CPP(yes;, + [#if defined(SVR4) && defined(sun) +- yes ++ yes; + #endif + ], LIBS="$LIBS -lsocket -lnsl -lkstat") + +@@ -697,7 +697,7 @@ else + pdir='/dev' + fi + dnl SCO uses ptyp%d +-AC_EGREP_CPP(yes, ++AC_EGREP_CPP(yes;, + [#ifdef M_UNIX + yes; + #endif +@@ -880,7 +880,7 @@ fi + ) + + if test -z "$load" ; then +-AC_EGREP_CPP(yes, ++AC_EGREP_CPP(yes;, + [#if defined(NeXT) || defined(apollo) || defined(linux) + yes; + #endif +@@ -1112,7 +1112,7 @@ AC_CHECKING(syslog in libbsd.a) + AC_TRY_LINK(, [closelog();], AC_NOTE(- found.), [LIBS="$oldlibs" + AC_NOTE(- bad news: syslog missing.) AC_DEFINE(NOSYSLOG)])]) + +-AC_EGREP_CPP(yes, ++AC_EGREP_CPP(yes;, + [#ifdef M_UNIX + yes; + #endif +-- +2.13.3 + diff --git a/poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch b/poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch new file mode 100644 index 000000000..fbdb0eb47 --- /dev/null +++ b/poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch @@ -0,0 +1,58 @@ +From 79ad2885e26631077dd6b8aebe17ae95b38133a6 Mon Sep 17 00:00:00 2001 +From: Jackie Huang <jackie.huang@windriver.com> +Date: Tue, 26 Jul 2016 14:23:59 +0800 +Subject: [PATCH] fix for multijob build + +make sure that comm.sh script generates comm.h header before doing +anything else + +Signed-off-by: Amadeusz Sawiski <amade@asmblr.net> + +Upstream-Status: Backport + +Backport patch to fix parallel build failure and update context to make patch +coulde be applied. + +http://git.savannah.gnu.org/cgit/screen.git/commit?id=c0de6dd + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + Makefile.in | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index aca7da3..3607711 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -298,7 +298,7 @@ search.o: layout.h viewport.h canvas.h search.c config.h screen.h os.h osdef.h a + comm.h layer.h term.h image.h display.h window.h mark.h extern.h + tty.o: layout.h viewport.h canvas.h tty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \ + layer.h term.h image.h display.h window.h extern.h +-term.o: layout.h viewport.h canvas.h term.c term.h ++term.o: layout.h viewport.h canvas.h term.c term.h comm.h + window.o: layout.h viewport.h canvas.h window.c config.h screen.h os.h osdef.h ansi.h acls.h \ + comm.h layer.h term.h image.h display.h window.h extern.h logfile.h + utmp.o: layout.h viewport.h canvas.h utmp.c config.h screen.h os.h osdef.h ansi.h acls.h \ +@@ -324,7 +324,7 @@ canvas.o: layout.h viewport.h canvas.h canvas.c config.h screen.h os.h osdef.h a + comm.h layer.h term.h image.h display.h window.h extern.h \ + braille.h + comm.o: layout.h viewport.h canvas.h comm.c config.h acls.h comm.h +-kmapdef.o: layout.h viewport.h canvas.h kmapdef.c config.h ++kmapdef.o: layout.h viewport.h canvas.h kmapdef.c config.h comm.h + acls.o: layout.h viewport.h canvas.h acls.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \ + layer.h term.h image.h display.h window.h extern.h + braille.o: layout.h viewport.h canvas.h braille.c config.h screen.h os.h osdef.h ansi.h acls.h \ +@@ -350,7 +350,7 @@ layout.o: layout.h viewport.h canvas.h layout.c config.h screen.h os.h osdef.h a + viewport.o: layout.h viewport.h canvas.h viewport.c config.h screen.h os.h osdef.h ansi.h acls.h \ + comm.h layer.h term.h image.h display.h window.h extern.h \ + braille.h +-list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h +-list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h ++list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h comm.h ++list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h comm.h + list_window.o: list_generic.h list_window.c window.h layer.h screen.h osdef.h comm.h + +-- +1.9.1 + diff --git a/poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch b/poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch new file mode 100644 index 000000000..a01dc2475 --- /dev/null +++ b/poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch @@ -0,0 +1,30 @@ +Upstream-Status: Backport + +Backport from: + +http://git.savannah.gnu.org/cgit/screen.git/commit/?id=39c5f1c + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +--- +From 39c5f1c76f1fcef4b5958bf828a63f53426b6984 Mon Sep 17 00:00:00 2001 +From: Mike Gerwitz <mike@mikegerwitz.com> +Date: Tue, 24 Dec 2013 22:16:31 -0500 +Subject: [PATCH] comm.h now depends on term.h + +--- + src/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: screen-4.6.1/Makefile.in +=================================================================== +--- screen-4.6.1.orig/Makefile.in ++++ screen-4.6.1/Makefile.in +@@ -133,7 +133,7 @@ kmapdef.c: term.h + tty.c: tty.sh + sh $(srcdir)/tty.sh tty.c + +-comm.h: comm.c comm.sh config.h ++comm.h: comm.c comm.sh config.h term.h + AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh + + osdef.h: osdef.sh config.h osdef.h.in diff --git a/poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch b/poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch new file mode 100644 index 000000000..e184aa1f3 --- /dev/null +++ b/poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch @@ -0,0 +1,57 @@ +From 79afb676904653403145fda9e1a6a9d3ea1cb22a Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen <jussi.kukkonen@intel.com> +Date: Fri, 7 Aug 2015 11:10:32 +0300 +Subject: [PATCH 4/4] Avoid mis-identifying systems as SVR4 + +Linux can be misdetected as SVR4 because it has +libelf installed. This leads to linking with libelf, even though no +symbols from that library were actually used, and to a workaround for +a buggy getlogin() being enabled. + +It is not documented which exact SVR4 system had the bug that the +workaround was added for, so all I could do is make an educated guess +at the #defines its compiler would be likely to set. + +Modified from patch by Maarten ter Huurne. + +Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223] + +Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> +--- + configure.ac | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index dc928ae..65439ce 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -179,14 +179,24 @@ AC_EGREP_CPP(yes, + #endif + ], LIBS="$LIBS -lsocket -linet";seqptx=1) + ++AC_CHECKING(SVR4) ++AC_EGREP_CPP(yes, ++[main () { ++#if defined(SVR4) || defined(__SVR4) ++ yes; ++#endif ++], AC_NOTE(- you have a SVR4 system) AC_DEFINE(SVR4) svr4=1) ++if test -n "$svr4" ; then + oldlibs="$LIBS" + LIBS="$LIBS -lelf" + AC_CHECKING(SVR4) + AC_TRY_LINK([#include <utmpx.h> + ],, +-[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN), +-[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])] ++[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(BUGGYGETLOGIN), ++[AC_CHECK_HEADER(elf.h, AC_DEFINE(BUGGYGETLOGIN))])] + ,LIBS="$oldlibs") ++fi ++ + AC_CHECK_HEADERS([stropts.h string.h strings.h]) + + AC_CHECKING(for Solaris 2.x) +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch b/poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch new file mode 100644 index 000000000..248bf087e --- /dev/null +++ b/poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch @@ -0,0 +1,137 @@ +From cd0f7f10a3fffbc60fe55eb200474d13fe1da65b Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen <jussi.kukkonen@intel.com> +Date: Fri, 7 Aug 2015 10:34:29 +0300 +Subject: [PATCH 2/4] Provide cross compile alternatives for AC_TRY_RUN + +Modified from patch by Maarten ter Huurne. + +Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223] + +Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> +--- + configure.ac | 32 ++++++++++++++++++++------------ + 1 file changed, 20 insertions(+), 12 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 27690a6..ce89f56 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -348,7 +348,8 @@ main() + exit(0); + } + ], AC_NOTE(- your fifos are usable) fifo=1, +-AC_NOTE(- your fifos are not usable)) ++AC_NOTE(- your fifos are not usable), ++AC_NOTE(- skipping check because we are cross compiling; assuming fifos are usable) fifo=1) + rm -f /tmp/conftest* + + if test -n "$fifo"; then +@@ -396,7 +397,8 @@ main() + exit(0); + } + ], AC_NOTE(- your implementation is ok), +-AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1) ++AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1, ++AC_NOTE(- skipping check because we are cross compiling; assuming fifo implementation is ok)) + rm -f /tmp/conftest* + fi + +@@ -458,7 +460,8 @@ main() + exit(0); + } + ], AC_NOTE(- your sockets are usable) sock=1, +-AC_NOTE(- your sockets are not usable)) ++AC_NOTE(- your sockets are not usable), ++AC_NOTE(- skipping check because we are cross compiling; assuming sockets are usable) sock=1) + rm -f /tmp/conftest* + + if test -n "$sock"; then +@@ -497,7 +500,8 @@ main() + } + ],AC_NOTE(- you are normal), + AC_NOTE(- unix domain sockets are not kept in the filesystem) +-AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1) ++AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1, ++AC_NOTE(- skipping check because we are cross compiling; assuming sockets are normal)) + rm -f /tmp/conftest* + fi + +@@ -624,7 +628,8 @@ main() + exit(0); + } + ],AC_NOTE(- select is ok), +-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN)) ++AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN), ++AC_NOTE(- skipping check because we are cross compiling; assuming select is ok)) + + dnl + dnl **** termcap or terminfo **** +@@ -666,7 +671,8 @@ main() + { + exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); + }], AC_NOTE(- you use the termcap database), +-AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO)) ++AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO), ++AC_NOTE(- skipping check because we are cross compiling; assuming terminfo database is used) AC_DEFINE(TERMINFO)) + AC_CHECKING(ospeed) + AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED)) + +@@ -801,7 +807,8 @@ main() + else + AC_NOTE(- can't determine - assume ptys are world accessable) + fi +- ] ++ ], ++ AC_NOTE(- skipping check because we are cross compiling; assuming ptys are world accessable) + ) + rm -f conftest_grp + fi +@@ -885,7 +892,7 @@ AC_EGREP_CPP(yes, + #endif + ], load=1) + fi +-if test -z "$load" ; then ++if test -z "$load" && test "$cross_compiling" = no ; then + AC_CHECKING(for kernelfile) + for core in /unix /vmunix /dynix /hp-ux /xelos /dev/ksyms /kernel/unix /kernel/genunix /unicos /mach /netbsd /386bsd /dgux /bsd /stand/vmunix; do + if test -f $core || test -c $core; then +@@ -1078,7 +1085,7 @@ main() + #endif + exit(0); + } +-],,AC_DEFINE(SYSVSIGS)) ++],,AC_DEFINE(SYSVSIGS),:) + + fi + +@@ -1158,7 +1165,7 @@ main() { + if (strncmp(buf, "cdedef", 6)) + exit(1); + exit(0); /* libc version works properly. */ +-}], AC_DEFINE(USEBCOPY)) ++}], AC_DEFINE(USEBCOPY),,:) + + AC_TRY_RUN([ + #define bcopy(s,d,l) memmove(d,s,l) +@@ -1173,7 +1180,8 @@ main() { + if (strncmp(buf, "cdedef", 6)) + exit(1); + exit(0); /* libc version works properly. */ +-}], AC_DEFINE(USEMEMMOVE)) ++}], AC_DEFINE(USEMEMMOVE),, ++ AC_NOTE(- skipping check because we are cross compiling; use memmove) AC_DEFINE(USEMEMMOVE)) + + + AC_TRY_RUN([ +@@ -1189,7 +1197,7 @@ main() { + if (strncmp(buf, "cdedef", 6)) + exit(1); + exit(0); /* libc version works properly. */ +-}], AC_DEFINE(USEMEMCPY)) ++}], AC_DEFINE(USEMEMCPY),,:) + + AC_SYS_LONG_FILE_NAMES + +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch b/poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch new file mode 100644 index 000000000..cc62c12e0 --- /dev/null +++ b/poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch @@ -0,0 +1,65 @@ +From 73b726c25f94c1b15514ed9249b927afdfbbfb94 Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen <jussi.kukkonen@intel.com> +Date: Fri, 7 Aug 2015 10:30:40 +0300 +Subject: [PATCH 1/4] Remove redundant compiler sanity checks + +AC_PROG_CC already performs sanity checks. And unlike the removed +checks, it does so in a way that supports cross compilation. + +Modified from patch by Maarten ter Huurne. + +Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223] + +Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> +--- + configure.ac | 27 --------------------------- + 1 file changed, 27 deletions(-) + +diff --git a/configure.ac b/configure.ac +index ffe2e37..27690a6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -48,31 +48,6 @@ AC_PROG_GCC_TRADITIONAL + AC_ISC_POSIX + AC_USE_SYSTEM_EXTENSIONS + +-AC_TRY_RUN(main(){exit(0);},,[ +-if test $CC != cc ; then +-AC_NOTE(Your $CC failed - restarting with CC=cc) +-AC_NOTE() +-CC=cc +-export CC +-exec $0 $configure_args +-fi +-]) +- +-AC_TRY_RUN(main(){exit(0);},, +-exec 5>&2 +-eval $ac_link +-AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;) +-AC_NOTE($ac_compile) +-AC_MSG_ERROR(Can't run the compiler - sorry)) +- +-AC_TRY_RUN([ +-main() +-{ +- int __something_strange_(); +- __something_strange_(0); +-} +-],AC_MSG_ERROR(Your compiler does not set the exit status - sorry)) +- + AC_PROG_AWK + + AC_PROG_INSTALL +@@ -1300,8 +1275,6 @@ fi + dnl Ptx bug workaround -- insert -lc after -ltermcap + test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq" + +-AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.)) +- + ETCSCREENRC= + AC_MSG_CHECKING(for the global screenrc file) + AC_ARG_WITH(sys-screenrc, [ --with-sys-screenrc=path to the global screenrc file], [ ETCSCREENRC="${withval}" ]) +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch b/poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch new file mode 100644 index 000000000..d7e55a445 --- /dev/null +++ b/poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch @@ -0,0 +1,135 @@ +From d0b20e4cacc60ad62a2150ce07388cb5a25c2040 Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen <jussi.kukkonen@intel.com> +Date: Fri, 7 Aug 2015 11:09:01 +0300 +Subject: [PATCH 3/4] Skip host file system checks when cross-compiling + +Modified from patch by Maarten ter Huurne. + +Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223] + +Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> +--- + configure.ac | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index ce89f56..dc928ae 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -85,7 +85,7 @@ AC_ARG_ENABLE(socket-dir, + dnl + dnl **** special unix variants **** + dnl +-if test -n "$ISC"; then ++if test "$cross_compiling" = no && test -n "$ISC" ; then + AC_DEFINE(ISC) LIBS="$LIBS -linet" + fi + +@@ -96,10 +96,11 @@ dnl AC_DEFINE(OSF1) # this disables MIPS again.... + dnl fi + dnl fi + +-if test -f /sysV68 ; then ++if test "$cross_compiling" = no && test -f /sysV68 ; then + AC_DEFINE(sysV68) + fi + ++if test "$cross_compiling" = no ; then + AC_CHECKING(for MIPS) + if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then + oldlibs="$LIBS" +@@ -123,6 +124,7 @@ AC_DEFINE(USE_WAIT2) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd" + )) + fi + fi ++fi + + + AC_CHECKING(for Ultrix) +@@ -132,7 +134,7 @@ AC_EGREP_CPP(yes, + #endif + ], ULTRIX=1) + +-if test -f /usr/lib/libpyr.a ; then ++if test "$cross_compiling" = no && test -f /usr/lib/libpyr.a ; then + oldlibs="$LIBS" + LIBS="$LIBS -lpyr" + AC_CHECKING(Pyramid OSX) +@@ -679,17 +681,21 @@ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED)) + dnl + dnl **** PTY specific things **** + dnl ++if test "$cross_compiling" = no ; then + AC_CHECKING(for /dev/ptc) + if test -r /dev/ptc; then + AC_DEFINE(HAVE_DEV_PTC) + fi ++fi + ++if test "$cross_compiling" = no ; then + AC_CHECKING(for SVR4 ptys) + sysvr4ptys= + if test -c /dev/ptmx ; then + AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS) + sysvr4ptys=1]) + fi ++fi + + AC_CHECK_FUNCS(getpt) + +@@ -699,6 +705,7 @@ AC_CHECK_FUNCS(openpty,, + [AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])]) + fi + ++if test "$cross_compiling" = no ; then + AC_CHECKING(for ptyranges) + if test -d /dev/ptym ; then + pdir='/dev/ptym' +@@ -722,6 +729,7 @@ p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\ + AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0") + AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1") + fi ++fi + + dnl **** pty mode/group handling **** + dnl +@@ -869,14 +877,16 @@ fi + dnl + dnl **** loadav **** + dnl ++if test "$cross_compiling" = no ; then + AC_CHECKING(for libutil(s)) + test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils" + test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil" ++fi + + AC_CHECKING(getloadavg) + AC_TRY_LINK(,[getloadavg((double *)0, 0);], + AC_DEFINE(LOADAV_GETLOADAVG) load=1, +-if test -f /usr/lib/libkvm.a ; then ++if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then + olibs="$LIBS" + LIBS="$LIBS -lkvm" + AC_CHECKING(getloadavg with -lkvm) +@@ -1094,13 +1104,18 @@ dnl **** libraries **** + dnl + + AC_CHECKING(for crypt and sec libraries) ++if test "$cross_compiling" = no ; then + test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d" ++fi + oldlibs="$LIBS" + LIBS="$LIBS -lcrypt" + AC_CHECKING(crypt) + AC_TRY_LINK(,,,LIBS="$oldlibs") ++if test "$cross_compiling" = no ; then + test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec" + test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow" ++fi ++ + oldlibs="$LIBS" + LIBS="$LIBS -lsun" + AC_CHECKING(IRIX sun library) +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/screen/screen/screen.pam b/poky/meta/recipes-extended/screen/screen/screen.pam new file mode 100644 index 000000000..ff657fa07 --- /dev/null +++ b/poky/meta/recipes-extended/screen/screen/screen.pam @@ -0,0 +1,2 @@ +#%PAM-1.0 +auth include common-auth diff --git a/poky/meta/recipes-extended/screen/screen_4.6.2.bb b/poky/meta/recipes-extended/screen/screen_4.6.2.bb new file mode 100644 index 000000000..7a33c31d8 --- /dev/null +++ b/poky/meta/recipes-extended/screen/screen_4.6.2.bb @@ -0,0 +1,52 @@ +SUMMARY = "Multiplexing terminal manager" +DESCRIPTION = "Screen is a full-screen window manager \ +that multiplexes a physical terminal between several \ +processes, typically interactive shells." +HOMEPAGE = "http://www.gnu.org/software/screen/" +BUGTRACKER = "https://savannah.gnu.org/bugs/?func=additem&group=screen" + +SECTION = "console/utils" + +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://screen.h;endline=26;md5=3971142989289a8198a544220703c2bf" + +DEPENDS = "ncurses \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" +RDEPENDS_${PN} = "base-files" + +SRC_URI = "${GNU_MIRROR}/screen/screen-${PV}.tar.gz \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'file://screen.pam', '', d)} \ + file://Remove-redundant-compiler-sanity-checks.patch \ + file://Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch \ + file://Skip-host-file-system-checks-when-cross-compiling.patch \ + file://Avoid-mis-identifying-systems-as-SVR4.patch \ + file://0002-comm.h-now-depends-on-term.h.patch \ + file://0001-fix-for-multijob-build.patch \ + file://0001-configure.ac-fix-configure-failed-while-build-dir-ha.patch \ + " + +SRC_URI[md5sum] = "a0f529d3333b128dfaa324d978ba73a8" +SRC_URI[sha256sum] = "1b6922520e6a0ce5e28768d620b0f640a6631397f95ccb043b70b91bb503fa3a" + +inherit autotools texinfo + +PACKAGECONFIG ??= "" +PACKAGECONFIG[utempter] = "ac_cv_header_utempter_h=yes,ac_cv_header_utempter_h=no,libutempter," + +EXTRA_OECONF = "--with-pty-mode=0620 --with-pty-group=5 \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}" + +do_install_append () { + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then + install -D -m 644 ${WORKDIR}/screen.pam ${D}/${sysconfdir}/pam.d/screen + fi +} + +pkg_postinst_${PN} () { + grep -q "^${bindir}/screen$" $D${sysconfdir}/shells || echo ${bindir}/screen >> $D${sysconfdir}/shells +} + +pkg_postrm_${PN} () { + printf "$(grep -v "^${bindir}/screen$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells +} diff --git a/poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch new file mode 100644 index 000000000..ba1a4bab4 --- /dev/null +++ b/poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch @@ -0,0 +1,33 @@ +From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Apr 2015 17:02:13 -0700 +Subject: [PATCH] Unset need_charset_alias when building for musl + +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 +which actually shoudl be fixed in gnulib and then all downstream +projects will get it eventually. For now we apply the fix to +coreutils + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/gnulib.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/gnulib.mk b/lib/gnulib.mk +index e1d74db..c0e92dd 100644 +--- a/lib/gnulib.mk ++++ b/lib/gnulib.mk +@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest b/poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest new file mode 100644 index 000000000..7c0f62770 --- /dev/null +++ b/poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +make -C testsuite -k runtest-TESTS diff --git a/poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch b/poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch new file mode 100644 index 000000000..0293900fb --- /dev/null +++ b/poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch @@ -0,0 +1,66 @@ +sed: add ptest + +ptest needs buildtest-TESTS and runtest-TESTS targets. +serial-tests is required to generate those targets. + +And fix following error after add serial-tests. + +[snip] +help2man: can't get `--help' info from ../sed/sed +make[2]: *** [sed.1] Error 2 +[snip] + +Upstream-Status: Inappropriate + +Signed-off-by: Chong Lu <Chong.Lu@windriver.com> +--- + configure.ac | 2 +- + doc/Makefile.am | 2 +- + testsuite/Makefile.am | 6 ++++++ + 3 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 9d33ec9..4f0c532 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4,7 +4,7 @@ AC_CONFIG_AUX_DIR(build-aux) + AC_CONFIG_SRCDIR([sed/sed.c]) + AM_CONFIG_HEADER(config.h:config_h.in) + AC_PREREQ(2.60) +-AM_INIT_AUTOMAKE ++AM_INIT_AUTOMAKE([serial-tests]) + + SED_FEATURE_VERSION=4.2.2 + AC_DEFINE_UNQUOTED(SED_FEATURE_VERSION, "$SED_FEATURE_VERSION", +diff --git a/doc/Makefile.am b/doc/Makefile.am +index af6975c..6fd8c9a 100644 +--- a/doc/Makefile.am ++++ b/doc/Makefile.am +@@ -25,7 +25,7 @@ $(srcdir)/s-texi: sed-in.texi $(srcdir)/groupify.sed + fi + echo stamp > $(srcdir)/s-texi + +-sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x ++_sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x + $(HELP2MAN) --name "stream editor for filtering and transforming text" \ + -p sed --include $(srcdir)/sed.x -o $(srcdir)/sed.1 $(SED) + +diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am +index d80e72c..b05f01e 100644 +--- a/testsuite/Makefile.am ++++ b/testsuite/Makefile.am +@@ -99,5 +99,11 @@ EXTRA_DIST = \ + # automake makes `check' depend on $(TESTS). Declare + # dummy targets for $(TESTS) so that make does not complain. + ++install-ptest: ++ cd $(BUILDDIR); tar -c --exclude=*.o $(TESTDIR) | ( cd $(DESTDIR) && tar -xf - ) ++ for i in $(EXTRA_DIST) tst-regex2.c; do install $(srcdir)/$$i $(DESTDIR)/$(TESTDIR); done ++ sed -e 's/^Makefile:/_Makefile:/' -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/bash/sh/' -i $(DESTDIR)/$(TESTDIR)/Makefile ++ for i in `grep -rl "../sed/sed" $(DESTDIR)/$(TESTDIR)`; do sed -e 's/..\/sed\/sed/sed/' -i $$i; done ++ + .PHONY: $(SEDTESTS) + $(SEDTESTS): +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/sed/sed_4.2.2.bb b/poky/meta/recipes-extended/sed/sed_4.2.2.bb new file mode 100644 index 000000000..f10e365ea --- /dev/null +++ b/poky/meta/recipes-extended/sed/sed_4.2.2.bb @@ -0,0 +1,53 @@ +SUMMARY = "Stream EDitor (text filtering utility)" +HOMEPAGE = "http://www.gnu.org/software/sed/" +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \ + file://sed/sed.h;beginline=1;endline=17;md5=767ab3a06d7584f6fd0469abaec4412f" +SECTION = "console/utils" + +SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz \ + file://sed-add-ptest.patch \ + file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ + file://run-ptest \ +" + +SRC_URI[md5sum] = "4111de4faa3b9848a0686b2f260c5056" +SRC_URI[sha256sum] = "fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff" + +inherit autotools texinfo update-alternatives gettext ptest +RDEPENDS_${PN}-ptest += "make ${PN}" +RRECOMMENDS_${PN}-ptest_append_libc-glibc = " locale-base-ru-ru" + +EXTRA_OECONF = "--disable-acl \ + ${@bb.utils.contains('PTEST_ENABLED', '1', '--enable-regex-tests', '', d)}" + +do_install () { + autotools_do_install + install -d ${D}${base_bindir} + if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then + mv ${D}${bindir}/sed ${D}${base_bindir}/sed + rmdir ${D}${bindir}/ + fi +} + +ALTERNATIVE_${PN} = "sed" +ALTERNATIVE_LINK_NAME[sed] = "${base_bindir}/sed" +ALTERNATIVE_PRIORITY = "100" + +TESTDIR = "testsuite" + +do_compile_ptest() { + oe_runmake -C ${TESTDIR} buildtest-TESTS +} + +do_install_ptest() { + oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR} + sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e 's:${HOSTTOOLS_DIR}/::g' \ + -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ + -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ + -i ${D}${PTEST_PATH}/${TESTDIR}/Makefile +} + +RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sed', '', d)}" diff --git a/poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch b/poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch new file mode 100644 index 000000000..a6f604b65 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch @@ -0,0 +1,124 @@ +From 8cf3454d567f77233023be49a39a33e9f0836f89 Mon Sep 17 00:00:00 2001 +From: Scott Garman <scott.a.garman@intel.com> +Date: Thu, 14 Apr 2016 12:28:57 +0200 +Subject: [PATCH] Disable use of syslog for sysroot + +Disable use of syslog to prevent sysroot user and group additions from +writing entries to the host's syslog. This patch should only be used +with the shadow-native recipe. + +Upstream-Status: Inappropriate [disable feature] + +Signed-off-by: Scott Garman <scott.a.garman@intel.com> +Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> +--- + src/groupadd.c | 3 +++ + src/groupdel.c | 3 +++ + src/groupmems.c | 3 +++ + src/groupmod.c | 3 +++ + src/useradd.c | 3 +++ + src/userdel.c | 3 +++ + src/usermod.c | 3 +++ + 7 files changed, 21 insertions(+) + +diff --git a/src/groupadd.c b/src/groupadd.c +index 39b4ec0..f716f57 100644 +--- a/src/groupadd.c ++++ b/src/groupadd.c +@@ -34,6 +34,9 @@ + + #ident "$Id$" + ++/* Disable use of syslog since we're running this command against a sysroot */ ++#undef USE_SYSLOG ++ + #include <ctype.h> + #include <fcntl.h> + #include <getopt.h> +diff --git a/src/groupdel.c b/src/groupdel.c +index da99347..46a679c 100644 +--- a/src/groupdel.c ++++ b/src/groupdel.c +@@ -34,6 +34,9 @@ + + #ident "$Id$" + ++/* Disable use of syslog since we're running this command against a sysroot */ ++#undef USE_SYSLOG ++ + #include <ctype.h> + #include <fcntl.h> + #include <grp.h> +diff --git a/src/groupmems.c b/src/groupmems.c +index e4f107f..95cb073 100644 +--- a/src/groupmems.c ++++ b/src/groupmems.c +@@ -32,6 +32,9 @@ + + #include <config.h> + ++/* Disable use of syslog since we're running this command against a sysroot */ ++#undef USE_SYSLOG ++ + #include <fcntl.h> + #include <getopt.h> + #include <grp.h> +diff --git a/src/groupmod.c b/src/groupmod.c +index d9d3807..6229737 100644 +--- a/src/groupmod.c ++++ b/src/groupmod.c +@@ -34,6 +34,9 @@ + + #ident "$Id$" + ++/* Disable use of syslog since we're running this command against a sysroot */ ++#undef USE_SYSLOG ++ + #include <ctype.h> + #include <fcntl.h> + #include <getopt.h> +diff --git a/src/useradd.c b/src/useradd.c +index e1ebf50..25679d8 100644 +--- a/src/useradd.c ++++ b/src/useradd.c +@@ -34,6 +34,9 @@ + + #ident "$Id$" + ++/* Disable use of syslog since we're running this command against a sysroot */ ++#undef USE_SYSLOG ++ + #include <assert.h> + #include <ctype.h> + #include <errno.h> +diff --git a/src/userdel.c b/src/userdel.c +index 19b12bc..a083929 100644 +--- a/src/userdel.c ++++ b/src/userdel.c +@@ -34,6 +34,9 @@ + + #ident "$Id$" + ++/* Disable use of syslog since we're running this command against a sysroot */ ++#undef USE_SYSLOG ++ + #include <errno.h> + #include <fcntl.h> + #include <getopt.h> +diff --git a/src/usermod.c b/src/usermod.c +index 685b50a..28e5cfc 100644 +--- a/src/usermod.c ++++ b/src/usermod.c +@@ -34,6 +34,9 @@ + + #ident "$Id$" + ++/* Disable use of syslog since we're running this command against a sysroot */ ++#undef USE_SYSLOG ++ + #include <ctype.h> + #include <errno.h> + #include <fcntl.h> +-- +2.1.0 + diff --git a/poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch b/poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch new file mode 100644 index 000000000..828b95a57 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch @@ -0,0 +1,46 @@ +From 170c25c8e0b5c3dc2615d1db94c8d24a13ff99bf Mon Sep 17 00:00:00 2001 +From: Peter Kjellerstedt <pkj@axis.com> +Date: Thu, 11 Sep 2014 15:11:23 +0200 +Subject: [PATCH] Do not read login.defs before doing chroot() + +If "useradd --root <root> ..." was used, the login.defs file would still +be read from /etc/login.defs instead of <root>/etc/login.defs. This was +due to getdef_ulong() being called before process_root_flag(). + +Upstream-Status: Submitted [http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2014-September/010446.html] + +Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> +--- + src/useradd.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/useradd.c b/src/useradd.c +index a8a1f76..e1ebf50 100644 +--- a/src/useradd.c ++++ b/src/useradd.c +@@ -1993,9 +1993,11 @@ int main (int argc, char **argv) + #endif /* USE_PAM */ + #endif /* ACCT_TOOLS_SETUID */ + ++#ifdef ENABLE_SUBIDS + /* Needed for userns check */ +- uid_t uid_min = (uid_t) getdef_ulong ("UID_MIN", 1000UL); +- uid_t uid_max = (uid_t) getdef_ulong ("UID_MAX", 60000UL); ++ uid_t uid_min; ++ uid_t uid_max; ++#endif + + /* + * Get my name so that I can use it to report errors. +@@ -2026,6 +2028,8 @@ int main (int argc, char **argv) + is_shadow_grp = sgr_file_present (); + #endif + #ifdef ENABLE_SUBIDS ++ uid_min = (uid_t) getdef_ulong ("UID_MIN", 1000UL); ++ uid_max = (uid_t) getdef_ulong ("UID_MAX", 60000UL); + is_sub_uid = sub_uid_file_present () && !rflg && + (!user_id || (user_id <= uid_max && user_id >= uid_min)); + is_sub_gid = sub_gid_file_present () && !rflg && +-- +1.9.0 + diff --git a/poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-12424 b/poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-12424 new file mode 100644 index 000000000..4d3e1e016 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-12424 @@ -0,0 +1,46 @@ +From 954e3d2e7113e9ac06632aee3c69b8d818cc8952 Mon Sep 17 00:00:00 2001 +From: Tomas Mraz <tmraz@fedoraproject.org> +Date: Fri, 31 Mar 2017 16:25:06 +0200 +Subject: [PATCH] Fix buffer overflow if NULL line is present in db. + +If ptr->line == NULL for an entry, the first cycle will exit, +but the second one will happily write past entries buffer. +We actually do not want to exit the first cycle prematurely +on ptr->line == NULL. +Signed-off-by: Tomas Mraz <tmraz@fedoraproject.org> + +CVE: CVE-2017-12424 +Upstream-Status: Backport +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + lib/commonio.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/lib/commonio.c b/lib/commonio.c +index b10da06..31edbaa 100644 +--- a/lib/commonio.c ++++ b/lib/commonio.c +@@ -751,16 +751,16 @@ commonio_sort (struct commonio_db *db, int (*cmp) (const void *, const void *)) + for (ptr = db->head; + (NULL != ptr) + #if KEEP_NIS_AT_END +- && (NULL != ptr->line) +- && ( ('+' != ptr->line[0]) +- && ('-' != ptr->line[0])) ++ && ((NULL == ptr->line) ++ || (('+' != ptr->line[0]) ++ && ('-' != ptr->line[0]))) + #endif + ; + ptr = ptr->next) { + n++; + } + #if KEEP_NIS_AT_END +- if ((NULL != ptr) && (NULL != ptr->line)) { ++ if (NULL != ptr) { + nis = ptr; + } + #endif +-- +2.1.0 + diff --git a/poky/meta/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch b/poky/meta/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch new file mode 100644 index 000000000..60a46e125 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch @@ -0,0 +1,47 @@ +From acec93540eba6899661c607408498ac72ab07a47 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh> +Date: Tue, 7 Mar 2017 16:03:03 +0100 +Subject: [PATCH] useradd: copy extended attributes of home +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The Home directory wasn't getting the extended attributes +of /etc/skel. This patch fixes that issue and adds the copy +of the extended attributes of the root of the home directory. + +Upstream-Status: Submitted [http://lists.alioth.debian.org/pipermail/pkg-shadow-commits/2017-March/003804.html] + +Change-Id: Icd633f7c6c494efd2a30cb8f04c306f749ad0c3b +Signed-off-by: José Bollo <jose.bollo@iot.bzh> +--- + src/useradd.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/useradd.c b/src/useradd.c +index a8a1f76..8aefb9c 100644 +--- a/src/useradd.c ++++ b/src/useradd.c +@@ -52,6 +52,9 @@ + #include <sys/stat.h> + #include <sys/types.h> + #include <time.h> ++#ifdef WITH_ATTR ++#include <attr/libattr.h> ++#endif + #include "chkname.h" + #include "defines.h" + #include "faillog.h" +@@ -1915,6 +1918,9 @@ static void create_home (void) + chown (user_home, user_id, user_gid); + chmod (user_home, + 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK)); ++#ifdef WITH_ATTR ++ attr_copy_file (def_template, user_home, NULL, NULL); ++#endif + home_added = true; + #ifdef WITH_AUDIT + audit_logger (AUDIT_ADD_USER, Prog, +-- +2.9.3 + diff --git a/poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch b/poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch new file mode 100644 index 000000000..2f084b4e9 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch @@ -0,0 +1,115 @@ +Upstream-Status: Inappropriate [OE specific] + +Subject: useradd.c: create parent directories when necessary + +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + src/useradd.c | 72 +++++++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 49 insertions(+), 23 deletions(-) + +diff --git a/src/useradd.c b/src/useradd.c +index 4bd969d..cb5dd6c 100644 +--- a/src/useradd.c ++++ b/src/useradd.c +@@ -1896,6 +1896,35 @@ static void usr_update (void) + } + + /* ++ * mkdir_p - create directories, including parent directories when needed ++ * ++ * similar to `mkdir -p' ++ */ ++void mkdir_p(const char *path) { ++ int len = strlen(path); ++ char newdir[len + 1]; ++ mode_t mode = 0755; ++ int i = 0; ++ ++ if (path[i] == '\0') { ++ return; ++ } ++ ++ /* skip the leading '/' */ ++ i++; ++ ++ while(path[i] != '\0') { ++ if (path[i] == '/') { ++ strncpy(newdir, path, i); ++ newdir[i] = '\0'; ++ mkdir(newdir, mode); ++ } ++ i++; ++ } ++ mkdir(path, mode); ++} ++ ++/* + * create_home - create the user's home directory + * + * create_home() creates the user's home directory if it does not +@@ -1910,39 +1939,36 @@ static void create_home (void) + fail_exit (E_HOMEDIR); + } + #endif +- /* XXX - create missing parent directories. --marekm */ +- if (mkdir (user_home, 0) != 0) { +- fprintf (stderr, +- _("%s: cannot create directory %s\n"), +- Prog, user_home); +-#ifdef WITH_AUDIT +- audit_logger (AUDIT_ADD_USER, Prog, +- "adding home directory", +- user_name, (unsigned int) user_id, +- SHADOW_AUDIT_FAILURE); +-#endif +- fail_exit (E_HOMEDIR); +- } +- chown (user_home, user_id, user_gid); +- chmod (user_home, +- 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK)); +-#ifdef WITH_ATTR +- attr_copy_file (def_template, user_home, NULL, NULL); +-#endif +- home_added = true; ++ mkdir_p(user_home); ++ } ++ if (access (user_home, F_OK) != 0) { + #ifdef WITH_AUDIT + audit_logger (AUDIT_ADD_USER, Prog, + "adding home directory", + user_name, (unsigned int) user_id, +- SHADOW_AUDIT_SUCCESS); ++ SHADOW_AUDIT_FAILURE); + #endif +-#ifdef WITH_SELINUX +- /* Reset SELinux to create files with default contexts */ +- if (reset_selinux_file_context () != 0) { +- fail_exit (E_HOMEDIR); +- } ++ fail_exit (E_HOMEDIR); ++ } ++ chown (user_home, user_id, user_gid); ++ chmod (user_home, ++ 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK)); ++#ifdef WITH_ATTR ++ attr_copy_file (def_template, user_home, NULL, NULL); ++#endif ++ home_added = true; ++#ifdef WITH_AUDIT ++ audit_logger (AUDIT_ADD_USER, Prog, ++ "adding home directory", ++ user_name, (unsigned int) user_id, ++ SHADOW_AUDIT_SUCCESS); + #endif ++#ifdef WITH_SELINUX ++ /* Reset SELinux to create files with default contexts */ ++ if (reset_selinux_file_context () != 0) { ++ fail_exit (E_HOMEDIR); + } ++#endif + } + + /* +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch b/poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch new file mode 100644 index 000000000..615c6e002 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch @@ -0,0 +1,201 @@ +Upstream-Status: Inappropriate [OE specific] + +Allow for setting password in clear text. + +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + src/Makefile.am | 8 ++++---- + src/groupadd.c | 8 +++++++- + src/groupmod.c | 8 +++++++- + src/useradd.c | 9 +++++++-- + src/usermod.c | 8 +++++++- + 5 files changed, 32 insertions(+), 9 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 25e288d..856b087 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -88,10 +88,10 @@ chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBSELINUX) $(LIBCRYPT) + chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD) + chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT) + gpasswd_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) +-groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) ++groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) + groupdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) + groupmems_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) +-groupmod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) ++groupmod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT) + grpck_LDADD = $(LDADD) $(LIBSELINUX) + grpconv_LDADD = $(LDADD) $(LIBSELINUX) + grpunconv_LDADD = $(LDADD) $(LIBSELINUX) +@@ -111,9 +111,9 @@ su_SOURCES = \ + suauth.c + su_LDADD = $(LDADD) $(LIBPAM) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD) + sulogin_LDADD = $(LDADD) $(LIBCRYPT) +-useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) ++useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) $(LIBCRYPT) + userdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) +-usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) ++usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) $(LIBCRYPT) + vipw_LDADD = $(LDADD) $(LIBSELINUX) + + install-am: all-am +diff --git a/src/groupadd.c b/src/groupadd.c +index f716f57..4e28c26 100644 +--- a/src/groupadd.c ++++ b/src/groupadd.c +@@ -124,6 +124,7 @@ static /*@noreturn@*/void usage (int status) + (void) fputs (_(" -o, --non-unique allow to create groups with duplicate\n" + " (non-unique) GID\n"), usageout); + (void) fputs (_(" -p, --password PASSWORD use this encrypted password for the new group\n"), usageout); ++ (void) fputs (_(" -P, --clear-password PASSWORD use this clear password for the new group\n"), usageout); + (void) fputs (_(" -r, --system create a system account\n"), usageout); + (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout); + (void) fputs ("\n", usageout); +@@ -387,12 +388,13 @@ static void process_flags (int argc, char **argv) + {"key", required_argument, NULL, 'K'}, + {"non-unique", no_argument, NULL, 'o'}, + {"password", required_argument, NULL, 'p'}, ++ {"clear-password", required_argument, NULL, 'P'}, + {"system", no_argument, NULL, 'r'}, + {"root", required_argument, NULL, 'R'}, + {NULL, 0, NULL, '\0'} + }; + +- while ((c = getopt_long (argc, argv, "fg:hK:op:rR:", ++ while ((c = getopt_long (argc, argv, "fg:hK:op:P:rR:", + long_options, NULL)) != -1) { + switch (c) { + case 'f': +@@ -444,6 +446,10 @@ static void process_flags (int argc, char **argv) + pflg = true; + group_passwd = optarg; + break; ++ case 'P': ++ pflg = true; ++ group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL)); ++ break; + case 'r': + rflg = true; + break; +diff --git a/src/groupmod.c b/src/groupmod.c +index d9d3807..68f49d1 100644 +--- a/src/groupmod.c ++++ b/src/groupmod.c +@@ -127,6 +127,7 @@ static void usage (int status) + (void) fputs (_(" -o, --non-unique allow to use a duplicate (non-unique) GID\n"), usageout); + (void) fputs (_(" -p, --password PASSWORD change the password to this (encrypted)\n" + " PASSWORD\n"), usageout); ++ (void) fputs (_(" -P, --clear-password PASSWORD change the password to this clear PASSWORD\n"), usageout); + (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout); + (void) fputs ("\n", usageout); + exit (status); +@@ -375,10 +376,11 @@ static void process_flags (int argc, char **argv) + {"new-name", required_argument, NULL, 'n'}, + {"non-unique", no_argument, NULL, 'o'}, + {"password", required_argument, NULL, 'p'}, ++ {"clear-password", required_argument, NULL, 'P'}, + {"root", required_argument, NULL, 'R'}, + {NULL, 0, NULL, '\0'} + }; +- while ((c = getopt_long (argc, argv, "g:hn:op:R:", ++ while ((c = getopt_long (argc, argv, "g:hn:op:P:R:", + long_options, NULL)) != -1) { + switch (c) { + case 'g': +@@ -405,6 +407,10 @@ static void process_flags (int argc, char **argv) + group_passwd = optarg; + pflg = true; + break; ++ case 'P': ++ group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL)); ++ pflg = true; ++ break; + case 'R': /* no-op, handled in process_root_flag () */ + break; + default: +diff --git a/src/useradd.c b/src/useradd.c +index b3bd451..4416f90 100644 +--- a/src/useradd.c ++++ b/src/useradd.c +@@ -776,6 +776,7 @@ static void usage (int status) + (void) fputs (_(" -o, --non-unique allow to create users with duplicate\n" + " (non-unique) UID\n"), usageout); + (void) fputs (_(" -p, --password PASSWORD encrypted password of the new account\n"), usageout); ++ (void) fputs (_(" -P, --clear-password PASSWORD clear password of the new account\n"), usageout); + (void) fputs (_(" -r, --system create a system account\n"), usageout); + (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout); + (void) fputs (_(" -s, --shell SHELL login shell of the new account\n"), usageout); +@@ -1050,6 +1051,7 @@ static void process_flags (int argc, char **argv) + {"no-user-group", no_argument, NULL, 'N'}, + {"non-unique", no_argument, NULL, 'o'}, + {"password", required_argument, NULL, 'p'}, ++ {"clear-password", required_argument, NULL, 'P'}, + {"system", no_argument, NULL, 'r'}, + {"root", required_argument, NULL, 'R'}, + {"shell", required_argument, NULL, 's'}, +@@ -1062,9 +1064,9 @@ static void process_flags (int argc, char **argv) + }; + while ((c = getopt_long (argc, argv, + #ifdef WITH_SELINUX +- "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:UZ:", ++ "b:c:d:De:f:g:G:hk:K:lmMNop:P:rR:s:u:UZ:", + #else /* !WITH_SELINUX */ +- "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:U", ++ "b:c:d:De:f:g:G:hk:K:lmMNop:P:rR:s:u:U", + #endif /* !WITH_SELINUX */ + long_options, NULL)) != -1) { + switch (c) { +@@ -1230,6 +1232,9 @@ static void process_flags (int argc, char **argv) + } + user_pass = optarg; + break; ++ case 'P': /* set clear text password */ ++ user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL)); ++ break; + case 'r': + rflg = true; + break; +diff --git a/src/usermod.c b/src/usermod.c +index e7d4351..b79f7a3 100644 +--- a/src/usermod.c ++++ b/src/usermod.c +@@ -419,6 +419,7 @@ static /*@noreturn@*/void usage (int status) + " new location (use only with -d)\n"), usageout); + (void) fputs (_(" -o, --non-unique allow using duplicate (non-unique) UID\n"), usageout); + (void) fputs (_(" -p, --password PASSWORD use encrypted password for the new password\n"), usageout); ++ (void) fputs (_(" -P, --clear-password PASSWORD use clear password for the new password\n"), usageout); + (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout); + (void) fputs (_(" -s, --shell SHELL new login shell for the user account\n"), usageout); + (void) fputs (_(" -u, --uid UID new UID for the user account\n"), usageout); +@@ -996,6 +997,7 @@ static void process_flags (int argc, char **argv) + {"move-home", no_argument, NULL, 'm'}, + {"non-unique", no_argument, NULL, 'o'}, + {"password", required_argument, NULL, 'p'}, ++ {"clear-password", required_argument, NULL, 'P'}, + {"root", required_argument, NULL, 'R'}, + {"shell", required_argument, NULL, 's'}, + {"uid", required_argument, NULL, 'u'}, +@@ -1012,7 +1014,7 @@ static void process_flags (int argc, char **argv) + {NULL, 0, NULL, '\0'} + }; + while ((c = getopt_long (argc, argv, +- "ac:d:e:f:g:G:hl:Lmop:R:s:u:U" ++ "ac:d:e:f:g:G:hl:Lmop:P:R:s:u:U" + #ifdef ENABLE_SUBIDS + "v:w:V:W:" + #endif /* ENABLE_SUBIDS */ +@@ -1112,6 +1114,10 @@ static void process_flags (int argc, char **argv) + user_pass = optarg; + pflg = true; + break; ++ case 'P': ++ user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL)); ++ pflg = true; ++ break; + case 'R': /* no-op, handled in process_root_flag () */ + break; + case 's': +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch b/poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch new file mode 100644 index 000000000..185590cab --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch @@ -0,0 +1,41 @@ +From 2cb54158b80cdbd97ca3b36df83f9255e923ae3f Mon Sep 17 00:00:00 2001 +From: James Le Cuirot <chewi@aura-online.co.uk> +Date: Sat, 23 Aug 2014 09:46:39 +0100 +Subject: [PATCH] Check size of uid_t and gid_t using AC_CHECK_SIZEOF + +This built-in check is simpler than the previous method and, most +importantly, works when cross-compiling. + +Upstream-Status: Accepted +[https://github.com/shadow-maint/shadow/commit/2cb54158b80cdbd97ca3b36df83f9255e923ae3f] + +Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> +--- + configure.in | 14 ++++---------- + 1 file changed, 4 insertions(+), 10 deletions(-) + +diff --git a/configure.in b/configure.in +index 1a3f841..4a4d6d0 100644 +--- a/configure.in ++++ b/configure.in +@@ -335,16 +335,10 @@ if test "$enable_subids" != "no"; then + dnl + dnl FIXME: check if 32 bit UIDs/GIDs are supported by libc + dnl +- AC_RUN_IFELSE([AC_LANG_SOURCE([ +-#include <sys/types.h> +-int main(void) { +- uid_t u; +- gid_t g; +- return (sizeof u < 4) || (sizeof g < 4); +-} +- ])], [id32bit="yes"], [id32bit="no"]) +- +- if test "x$id32bit" = "xyes"; then ++ AC_CHECK_SIZEOF([uid_t],, [#include "sys/types.h"]) ++ AC_CHECK_SIZEOF([gid_t],, [#include "sys/types.h"]) ++ ++ if test "$ac_cv_sizeof_uid_t" -ge 4 && test "$ac_cv_sizeof_gid_t" -ge 4; then + AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.]) + enable_subids="yes" + else diff --git a/poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch b/poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch new file mode 100644 index 000000000..4fa3d184e --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch @@ -0,0 +1,46 @@ +Upstream-Status: Inappropriate [OE specific] + +commonio.c: fix unexpected open failure in chroot environment + +When using commands with '-R <newroot>' option in our pseudo environment, +we would usually get the 'Pemission Denied' error. This patch serves as +a workaround to this problem. + +Note that this patch doesn't change the logic in the code, it just expands +the codes. + +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + lib/commonio.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/lib/commonio.c b/lib/commonio.c +index cc536bf..51cafd9 100644 +--- a/lib/commonio.c ++++ b/lib/commonio.c +@@ -613,10 +613,18 @@ int commonio_open (struct commonio_db *db, int mode) + db->cursor = NULL; + db->changed = false; + +- fd = open (db->filename, +- (db->readonly ? O_RDONLY : O_RDWR) +- | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW); +- saved_errno = errno; ++ if (db->readonly) { ++ fd = open (db->filename, ++ (true ? O_RDONLY : O_RDWR) ++ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW); ++ saved_errno = errno; ++ } else { ++ fd = open (db->filename, ++ (false ? O_RDONLY : O_RDWR) ++ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW); ++ saved_errno = errno; ++ } ++ + db->fp = NULL; + if (fd >= 0) { + #ifdef WITH_TCB +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch b/poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch new file mode 100644 index 000000000..02cb91aaf --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch @@ -0,0 +1,28 @@ +Upstream-Status: Pending + +Subject: fix installation failure with subids disabled + +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + src/Makefile.am | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 25e288d..076f8ef 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -52,7 +52,10 @@ usbin_PROGRAMS = \ + noinst_PROGRAMS = id sulogin + + suidbins = su +-suidubins = chage chfn chsh expiry gpasswd newgrp passwd newuidmap newgidmap ++suidubins = chage chfn chsh expiry gpasswd newgrp passwd ++if ENABLE_SUBIDS ++suidubins += newgidmap newuidmap ++endif + if ACCT_TOOLS_SETUID + suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod + endif +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot b/poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot new file mode 100644 index 000000000..8a68dd341 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot @@ -0,0 +1,386 @@ +# +# /etc/login.defs - Configuration control definitions for the shadow package. +# +# $Id: login.defs 3038 2009-07-23 20:41:35Z nekral-guest $ +# + +# +# Delay in seconds before being allowed another attempt after a login failure +# Note: When PAM is used, some modules may enfore a minimal delay (e.g. +# pam_unix enforces a 2s delay) +# +FAIL_DELAY 3 + +# +# Enable logging and display of /var/log/faillog login failure info. +# +#FAILLOG_ENAB yes + +# +# Enable display of unknown usernames when login failures are recorded. +# +LOG_UNKFAIL_ENAB no + +# +# Enable logging of successful logins +# +LOG_OK_LOGINS no + +# +# Enable logging and display of /var/log/lastlog login time info. +# +#LASTLOG_ENAB yes + +# +# Enable checking and display of mailbox status upon login. +# +# Disable if the shell startup files already check for mail +# ("mailx -e" or equivalent). +# +##MAIL_CHECK_ENAB yes + +# +# Enable additional checks upon password changes. +# +#OBSCURE_CHECKS_ENAB yes + +# +# Enable checking of time restrictions specified in /etc/porttime. +# +#PORTTIME_CHECKS_ENAB yes + +# +# Enable setting of ulimit, umask, and niceness from passwd gecos field. +# +#QUOTAS_ENAB yes + +# +# Enable "syslog" logging of su activity - in addition to sulog file logging. +# SYSLOG_SG_ENAB does the same for newgrp and sg. +# +SYSLOG_SU_ENAB yes +SYSLOG_SG_ENAB yes + +# +# If defined, either full pathname of a file containing device names or +# a ":" delimited list of device names. Root logins will be allowed only +# upon these devices. +# +CONSOLE /etc/securetty +#CONSOLE console:tty01:tty02:tty03:tty04 + +# +# If defined, all su activity is logged to this file. +# +#SULOG_FILE /var/log/sulog + +# +# If defined, ":" delimited list of "message of the day" files to +# be displayed upon login. +# +#MOTD_FILE /etc/motd +#MOTD_FILE /etc/motd:/usr/lib/news/news-motd + +# +# If defined, this file will be output before each login prompt. +# +#ISSUE_FILE /etc/issue + +# +# If defined, file which maps tty line to TERM environment parameter. +# Each line of the file is in a format something like "vt100 tty01". +# +#TTYTYPE_FILE /etc/ttytype + +# +# If defined, login failures will be logged here in a utmp format. +# last, when invoked as lastb, will read /var/log/btmp, so... +# +#FTMP_FILE /var/log/btmp + +# +# If defined, name of file whose presence which will inhibit non-root +# logins. The contents of this file should be a message indicating +# why logins are inhibited. +# +#NOLOGINS_FILE /etc/nologin + +# +# If defined, the command name to display when running "su -". For +# example, if this is defined as "su" then a "ps" will display the +# command is "-su". If not defined, then "ps" would display the +# name of the shell actually being run, e.g. something like "-sh". +# +SU_NAME su + +# +# *REQUIRED* +# Directory where mailboxes reside, _or_ name of file, relative to the +# home directory. If you _do_ define both, #MAIL_DIR takes precedence. +# +#MAIL_DIR /var/spool/mail +MAIL_FILE .mail + +# +# If defined, file which inhibits all the usual chatter during the login +# sequence. If a full pathname, then hushed mode will be enabled if the +# user's name or shell are found in the file. If not a full pathname, then +# hushed mode will be enabled if the file exists in the user's home directory. +# +HUSHLOGIN_FILE .hushlogin +#HUSHLOGIN_FILE /etc/hushlogins + +# +# If defined, either a TZ environment parameter spec or the +# fully-rooted pathname of a file containing such a spec. +# +#ENV_TZ TZ=CST6CDT +#ENV_TZ /etc/tzname + +# +# If defined, an HZ environment parameter spec. +# +# for Linux/x86 +#ENV_HZ HZ=100 +# For Linux/Alpha... +#ENV_HZ HZ=1024 + +# +# *REQUIRED* The default PATH settings, for superuser and normal users. +# +# (they are minimal, add the rest in the shell startup files) +ENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin +ENV_PATH PATH=/bin:/usr/bin + +# +# Terminal permissions +# +# TTYGROUP Login tty will be assigned this group ownership. +# TTYPERM Login tty will be set to this permission. +# +# If you have a "write" program which is "setgid" to a special group +# which owns the terminals, define TTYGROUP to the group number and +# TTYPERM to 0620. Otherwise leave TTYGROUP commented out and assign +# TTYPERM to either 622 or 600. +# +TTYGROUP tty +TTYPERM 0600 + +# +# Login configuration initializations: +# +# ERASECHAR Terminal ERASE character ('\010' = backspace). +# KILLCHAR Terminal KILL character ('\025' = CTRL/U). +# ULIMIT Default "ulimit" value. +# +# The ERASECHAR and KILLCHAR are used only on System V machines. +# The ULIMIT is used only if the system supports it. +# (now it works with setrlimit too; ulimit is in 512-byte units) +# +# Prefix these values with "0" to get octal, "0x" to get hexadecimal. +# +ERASECHAR 0177 +KILLCHAR 025 +#ULIMIT 2097152 + +# Default initial "umask" value for non-PAM enabled systems. +# UMASK is also used by useradd and newusers to set the mode of new home +# directories. +# 022 is the default value, but 027, or even 077, could be considered +# better for privacy. There is no One True Answer here: each sysadmin +# must make up her mind. +UMASK 022 + +# +# Password aging controls: +# +# PASS_MAX_DAYS Maximum number of days a password may be used. +# PASS_MIN_DAYS Minimum number of days allowed between password changes. +# PASS_MIN_LEN Minimum acceptable password length. +# PASS_WARN_AGE Number of days warning given before a password expires. +# +PASS_MAX_DAYS 99999 +PASS_MIN_DAYS 0 +#PASS_MIN_LEN 5 +PASS_WARN_AGE 7 + +# +# If "yes", the user must be listed as a member of the first gid 0 group +# in /etc/group (called "root" on most Linux systems) to be able to "su" +# to uid 0 accounts. If the group doesn't exist or is empty, no one +# will be able to "su" to uid 0. +# +#SU_WHEEL_ONLY no + +# +# If compiled with cracklib support, where are the dictionaries +# +#CRACKLIB_DICTPATH /var/cache/cracklib/cracklib_dict + +# +# Min/max values for automatic uid selection in useradd +# +UID_MIN 1000 +UID_MAX 60000 +# System accounts +SYS_UID_MIN 101 +SYS_UID_MAX 999 + +# +# Min/max values for automatic gid selection in groupadd +# +GID_MIN 1000 +GID_MAX 60000 +# System accounts +SYS_GID_MIN 101 +SYS_GID_MAX 999 + +# +# Max number of login retries if password is bad +# +LOGIN_RETRIES 5 + +# +# Max time in seconds for login +# +LOGIN_TIMEOUT 60 + +# +# Maximum number of attempts to change password if rejected (too easy) +# +#PASS_CHANGE_TRIES 5 + +# +# Warn about weak passwords (but still allow them) if you are root. +# +#PASS_ALWAYS_WARN yes + +# +# Number of significant characters in the password for crypt(). +# Default is 8, don't change unless your crypt() is better. +# Ignored if MD5_CRYPT_ENAB set to "yes". +# +#PASS_MAX_LEN 8 + +# +# Require password before chfn/chsh can make any changes. +# +#CHFN_AUTH yes + +# +# Which fields may be changed by regular users using chfn - use +# any combination of letters "frwh" (full name, room number, work +# phone, home phone). If not defined, no changes are allowed. +# For backward compatibility, "yes" = "rwh" and "no" = "frwh". +# +CHFN_RESTRICT rwh + +# +# Password prompt (%s will be replaced by user name). +# +# XXX - it doesn't work correctly yet, for now leave it commented out +# to use the default which is just "Password: ". +#LOGIN_STRING "%s's Password: " + +# +# Only works if compiled with MD5_CRYPT defined: +# If set to "yes", new passwords will be encrypted using the MD5-based +# algorithm compatible with the one used by recent releases of FreeBSD. +# It supports passwords of unlimited length and longer salt strings. +# Set to "no" if you need to copy encrypted passwords to other systems +# which don't understand the new algorithm. Default is "no". +# +# Note: If you use PAM, it is recommended to use a value consistent with +# the PAM modules configuration. +# +# This variable is deprecated. You should use ENCRYPT_METHOD. +# +#MD5_CRYPT_ENAB no + +# +# Only works if compiled with ENCRYPTMETHOD_SELECT defined: +# If set to MD5 , MD5-based algorithm will be used for encrypting password +# If set to SHA256, SHA256-based algorithm will be used for encrypting password +# If set to SHA512, SHA512-based algorithm will be used for encrypting password +# If set to DES, DES-based algorithm will be used for encrypting password (default) +# Overrides the MD5_CRYPT_ENAB option +# +# Note: If you use PAM, it is recommended to use a value consistent with +# the PAM modules configuration. +# +#ENCRYPT_METHOD DES + +# +# Only works if ENCRYPT_METHOD is set to SHA256 or SHA512. +# +# Define the number of SHA rounds. +# With a lot of rounds, it is more difficult to brute forcing the password. +# But note also that it more CPU resources will be needed to authenticate +# users. +# +# If not specified, the libc will choose the default number of rounds (5000). +# The values must be inside the 1000-999999999 range. +# If only one of the MIN or MAX values is set, then this value will be used. +# If MIN > MAX, the highest value will be used. +# +# SHA_CRYPT_MIN_ROUNDS 5000 +# SHA_CRYPT_MAX_ROUNDS 5000 + +# +# List of groups to add to the user's supplementary group set +# when logging in on the console (as determined by the CONSOLE +# setting). Default is none. +# +# Use with caution - it is possible for users to gain permanent +# access to these groups, even when not logged in on the console. +# How to do it is left as an exercise for the reader... +# +#CONSOLE_GROUPS floppy:audio:cdrom + +# +# Should login be allowed if we can't cd to the home directory? +# Default in no. +# +DEFAULT_HOME yes + +# +# If this file exists and is readable, login environment will be +# read from it. Every line should be in the form name=value. +# +#ENVIRON_FILE /etc/environment + +# +# If defined, this command is run when removing a user. +# It should remove any at/cron/print jobs etc. owned by +# the user to be removed (passed as the first argument). +# +#USERDEL_CMD /usr/sbin/userdel_local + +# +# Enable setting of the umask group bits to be the same as owner bits +# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is +# the same as gid, and username is the same as the primary group name. +# +# This also enables userdel to remove user groups if no members exist. +# +USERGROUPS_ENAB yes + +# +# If set to a non-nul number, the shadow utilities will make sure that +# groups never have more than this number of users on one line. +# This permit to support split groups (groups split into multiple lines, +# with the same group ID, to avoid limitation of the line length in the +# group file). +# +# 0 is the default value and disables this feature. +# +#MAX_MEMBERS_PER_GROUP 0 + +# +# If useradd should create home directories for users by default (non +# system users only) +# This option is overridden with the -M or -m flags on the useradd command +# line. +# +CREATE_HOME yes + diff --git a/poky/meta/recipes-extended/shadow/files/login_defs_pam.sed b/poky/meta/recipes-extended/shadow/files/login_defs_pam.sed new file mode 100644 index 000000000..0a1f3be4a --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/login_defs_pam.sed @@ -0,0 +1,32 @@ +/^FAILLOG_ENAB/b comment +/^LASTLOG_ENAB/b comment +/^MAIL_CHECK_ENAB/b comment +/^OBSCURE_CHECKS_ENAB/b comment +/^PORTTIME_CHECKS_ENAB/b comment +/^QUOTAS_ENAB/b comment +/^MOTD_FILE/b comment +/^FTMP_FILE/b comment +/^NOLOGINS_FILE/b comment +/^ENV_HZ/b comment +/^ENV_TZ/b comment +/^PASS_MIN_LEN/b comment +/^SU_WHEEL_ONLY/b comment +/^CRACKLIB_DICTPATH/b comment +/^PASS_CHANGE_TRIES/b comment +/^PASS_ALWAYS_WARN/b comment +/^PASS_MAX_LEN/b comment +/^PASS_MIN_LEN/b comment +/^CHFN_AUTH/b comment +/^CHSH_AUTH/b comment +/^ISSUE_FILE/b comment +/^LOGIN_STRING/b comment +/^ULIMIT/b comment +/^ENVIRON_FILE/b comment + +b exit + +: comment + s:^:#: + +: exit + diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/chfn b/poky/meta/recipes-extended/shadow/files/pam.d/chfn new file mode 100644 index 000000000..baf7698bb --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/pam.d/chfn @@ -0,0 +1,14 @@ +# +# The PAM configuration file for the Shadow `chfn' service +# + +# This allows root to change user infomation without being +# prompted for a password +auth sufficient pam_rootok.so + +# The standard Unix authentication modules, used with +# NIS (man nsswitch) as well as normal /etc/passwd and +# /etc/shadow entries. +auth include common-auth +account include common-account +session include common-session diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/chpasswd b/poky/meta/recipes-extended/shadow/files/pam.d/chpasswd new file mode 100644 index 000000000..9e3efa68b --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/pam.d/chpasswd @@ -0,0 +1,4 @@ +# The PAM configuration file for the Shadow 'chpasswd' service +# + +password include common-password diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/chsh b/poky/meta/recipes-extended/shadow/files/pam.d/chsh new file mode 100644 index 000000000..8fb169f64 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/pam.d/chsh @@ -0,0 +1,19 @@ +# +# The PAM configuration file for the Shadow `chsh' service +# + +# This will not allow a user to change their shell unless +# their current one is listed in /etc/shells. This keeps +# accounts with special shells from changing them. +auth required pam_shells.so + +# This allows root to change user shell without being +# prompted for a password +auth sufficient pam_rootok.so + +# The standard Unix authentication modules, used with +# NIS (man nsswitch) as well as normal /etc/passwd and +# /etc/shadow entries. +auth include common-auth +account include common-account +session include common-session diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/login b/poky/meta/recipes-extended/shadow/files/pam.d/login new file mode 100644 index 000000000..b34005853 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/pam.d/login @@ -0,0 +1,81 @@ +# +# The PAM configuration file for the Shadow `login' service +# + +# Enforce a minimal delay in case of failure (in microseconds). +# (Replaces the `FAIL_DELAY' setting from login.defs) +# Note that other modules may require another minimal delay. (for example, +# to disable any delay, you should add the nodelay option to pam_unix) +auth optional pam_faildelay.so delay=3000000 + +# Outputs an issue file prior to each login prompt (Replaces the +# ISSUE_FILE option from login.defs). Uncomment for use +# auth required pam_issue.so issue=/etc/issue + +# Disallows root logins except on tty's listed in /etc/securetty +# (Replaces the `CONSOLE' setting from login.defs) +# Note that it is included as a "requisite" module. No password prompts will +# be displayed if this module fails to avoid having the root password +# transmitted on unsecure ttys. +# You can change it to a "required" module if you think it permits to +# guess valid user names of your system (invalid user names are considered +# as possibly being root). +auth [success=ok ignore=ignore user_unknown=ignore default=die] pam_securetty.so + +# Disallows other than root logins when /etc/nologin exists +# (Replaces the `NOLOGINS_FILE' option from login.defs) +auth requisite pam_nologin.so + +# This module parses environment configuration file(s) +# and also allows you to use an extended config +# file /etc/security/pam_env.conf. +# +# parsing /etc/environment needs "readenv=1" +session required pam_env.so readenv=1 + +# Standard Un*x authentication. +auth include common-auth + +# This allows certain extra groups to be granted to a user +# based on things like time of day, tty, service, and user. +# Please edit /etc/security/group.conf to fit your needs +# (Replaces the `CONSOLE_GROUPS' option in login.defs) +auth optional pam_group.so + +# Uncomment and edit /etc/security/time.conf if you need to set +# time restrainst on logins. +# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs +# as well as /etc/porttime) +# account requisite pam_time.so + +# Uncomment and edit /etc/security/access.conf if you need to +# set access limits. +# (Replaces /etc/login.access file) +# account required pam_access.so + +# Sets up user limits according to /etc/security/limits.conf +# (Replaces the use of /etc/limits in old login) +session required pam_limits.so + +# Prints the last login info upon succesful login +# (Replaces the `LASTLOG_ENAB' option from login.defs) +session optional pam_lastlog.so + +# Prints the motd upon succesful login +# (Replaces the `MOTD_FILE' option in login.defs) +session optional pam_motd.so + +# Prints the status of the user's mailbox upon succesful login +# (Replaces the `MAIL_CHECK_ENAB' option from login.defs). +# +# This also defines the MAIL environment variable +# However, userdel also needs MAIL_DIR and MAIL_FILE variables +# in /etc/login.defs to make sure that removing a user +# also removes the user's mail spool file. +# See comments in /etc/login.defs +session optional pam_mail.so standard + +# Standard Un*x account and session +account include common-account +password include common-password +session include common-session diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/newusers b/poky/meta/recipes-extended/shadow/files/pam.d/newusers new file mode 100644 index 000000000..4aa3dde48 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/pam.d/newusers @@ -0,0 +1,4 @@ +# The PAM configuration file for the Shadow 'newusers' service +# + +password include common-password diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/passwd b/poky/meta/recipes-extended/shadow/files/pam.d/passwd new file mode 100644 index 000000000..f53499243 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/pam.d/passwd @@ -0,0 +1,5 @@ +# +# The PAM configuration file for the Shadow `passwd' service +# + +password include common-password diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/su b/poky/meta/recipes-extended/shadow/files/pam.d/su new file mode 100644 index 000000000..8d590a32e --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/pam.d/su @@ -0,0 +1,57 @@ +# +# The PAM configuration file for the Shadow `su' service +# + +# This allows root to su without passwords (normal operation) +auth sufficient pam_rootok.so + +# Uncomment this to force users to be a member of group root +# before they can use `su'. You can also add "group=foo" +# to the end of this line if you want to use a group other +# than the default "root" (but this may have side effect of +# denying "root" user, unless she's a member of "foo" or explicitly +# permitted earlier by e.g. "sufficient pam_rootok.so"). +# (Replaces the `SU_WHEEL_ONLY' option from login.defs) +# auth required pam_wheel.so + +# Uncomment this if you want wheel members to be able to +# su without a password. +# auth sufficient pam_wheel.so trust + +# Uncomment this if you want members of a specific group to not +# be allowed to use su at all. +# auth required pam_wheel.so deny group=nosu + +# Uncomment and edit /etc/security/time.conf if you need to set +# time restrainst on su usage. +# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs +# as well as /etc/porttime) +# account requisite pam_time.so + +# This module parses environment configuration file(s) +# and also allows you to use an extended config +# file /etc/security/pam_env.conf. +# +# parsing /etc/environment needs "readenv=1" +session required pam_env.so readenv=1 + +# Defines the MAIL environment variable +# However, userdel also needs MAIL_DIR and MAIL_FILE variables +# in /etc/login.defs to make sure that removing a user +# also removes the user's mail spool file. +# See comments in /etc/login.defs +# +# "nopen" stands to avoid reporting new mail when su'ing to another user +session optional pam_mail.so nopen + +# Sets up user limits, please uncomment and read /etc/security/limits.conf +# to enable this functionality. +# (Replaces the use of /etc/limits in old login) +# session required pam_limits.so + +# The standard Unix authentication modules, used with +# NIS (man nsswitch) as well as normal /etc/passwd and +# /etc/shadow entries. +auth include common-auth +account include common-account +session include common-session diff --git a/poky/meta/recipes-extended/shadow/files/securetty b/poky/meta/recipes-extended/shadow/files/securetty new file mode 100644 index 000000000..2be341a21 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/securetty @@ -0,0 +1,238 @@ +# /etc/securetty: list of terminals on which root is allowed to login. +# See securetty(5) and login(1). +console + +# Standard serial ports +ttyS0 +ttyS1 +ttyS2 +ttyS3 + +# ARM AMBA SoCs +ttyAM0 +ttyAM1 +ttyAM2 +ttyAM3 +ttyAMA0 +ttyAMA1 +ttyAMA2 +ttyAMA3 + +# QCOM Socs +ttyHSL0 +ttyHSL1 +ttyHSL2 +ttyHSL3 +ttyMSM0 +ttyMSM1 +ttyMSM2 + +# Samsung ARM SoCs +ttySAC0 +ttySAC1 +ttySAC2 +ttySAC3 + +# STM SoCs +ttyAS0 +ttyAS1 +ttyAS2 +ttyAS3 + +# TI OMAP SoCs +ttyO0 +ttyO1 +ttyO2 +ttyO3 + +# Xilinx Zynq SoC +ttyPS0 +ttyPS1 + +# USB dongles +ttyUSB0 +ttyUSB1 +ttyUSB2 + +# USB serial gadget +ttyGS0 + +# PowerMac +ttyPZ0 +ttyPZ1 +ttyPZ2 +ttyPZ3 + +# Embedded MPC platforms +ttyPSC0 +ttyPSC1 +ttyPSC2 +ttyPSC3 +ttyPSC4 +ttyPSC5 + +# PA-RISC mux ports +ttyB0 +ttyB1 + +# Standard hypervisor virtual console +hvc0 + +# Oldstyle Xen console +xvc0 + +# Standard consoles +tty1 +tty2 +tty3 +tty4 +tty5 +tty6 +tty7 +tty8 +tty9 +tty10 +tty11 +tty12 +tty13 +tty14 +tty15 +tty16 +tty17 +tty18 +tty19 +tty20 +tty21 +tty22 +tty23 +tty24 +tty25 +tty26 +tty27 +tty28 +tty29 +tty30 +tty31 +tty32 +tty33 +tty34 +tty35 +tty36 +tty37 +tty38 +tty39 +tty40 +tty41 +tty42 +tty43 +tty44 +tty45 +tty46 +tty47 +tty48 +tty49 +tty50 +tty51 +tty52 +tty53 +tty54 +tty55 +tty56 +tty57 +tty58 +tty59 +tty60 +tty61 +tty62 +tty63 + +# Local X displays (allows empty passwords with pam_unix's nullok_secure) +pts/0 +pts/1 +pts/2 +pts/3 + +# Embedded Freescale i.MX ports +ttymxc0 +ttymxc1 +ttymxc2 +ttymxc3 +ttymxc4 +ttymxc5 + +# Freescale lpuart ports +ttyLP0 +ttyLP1 +ttyLP2 +ttyLP3 +ttyLP4 +ttyLP5 + +# Standard serial ports, with devfs +tts/0 +tts/1 + +# Standard consoles, with devfs +vc/1 +vc/2 +vc/3 +vc/4 +vc/5 +vc/6 +vc/7 +vc/8 +vc/9 +vc/10 +vc/11 +vc/12 +vc/13 +vc/14 +vc/15 +vc/16 +vc/17 +vc/18 +vc/19 +vc/20 +vc/21 +vc/22 +vc/23 +vc/24 +vc/25 +vc/26 +vc/27 +vc/28 +vc/29 +vc/30 +vc/31 +vc/32 +vc/33 +vc/34 +vc/35 +vc/36 +vc/37 +vc/38 +vc/39 +vc/40 +vc/41 +vc/42 +vc/43 +vc/44 +vc/45 +vc/46 +vc/47 +vc/48 +vc/49 +vc/50 +vc/51 +vc/52 +vc/53 +vc/54 +vc/55 +vc/56 +vc/57 +vc/58 +vc/59 +vc/60 +vc/61 +vc/62 +vc/63 diff --git a/poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch b/poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch new file mode 100644 index 000000000..a7bb0a929 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch @@ -0,0 +1,27 @@ +# commit message copied from openembedded: +# commit 246c80637b135f3a113d319b163422f98174ee6c +# Author: Khem Raj <raj.khem@gmail.com> +# Date: Wed Jun 9 13:37:03 2010 -0700 +# +# shadow-4.1.4.2: Add patches to support dots in login id. +# +# Signed-off-by: Khem Raj <raj.khem@gmail.com> +# +# comment added by Kevin Tian <kevin.tian@intel.com>, 2010-08-11 + +Upstream-Status: Pending + +Signed-off-by: Scott Garman <scott.a.garman@intel.com> + +Index: shadow-4.1.4.2/libmisc/chkname.c +=================================================================== +--- shadow-4.1.4.2.orig/libmisc/chkname.c 2009-04-28 12:14:04.000000000 -0700 ++++ shadow-4.1.4.2/libmisc/chkname.c 2010-06-03 17:43:20.638973857 -0700 +@@ -61,6 +61,7 @@ static bool is_valid_name (const char *n + ( ('0' <= *name) && ('9' >= *name) ) || + ('_' == *name) || + ('-' == *name) || ++ ('.' == *name) || + ( ('$' == *name) && ('\0' == *(name + 1)) ) + )) { + return false; diff --git a/poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch b/poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch new file mode 100644 index 000000000..1af04d5fe --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch @@ -0,0 +1,100 @@ + +The groupadd from shadow does not allow upper case group names, the +same is true for the upstream shadow. But distributions like +Debian/Ubuntu/CentOS has their own way to cope with this problem, +this patch is picked up from CentOS release 7.0 to relax the usernames +restrictions to allow the upper case group names, and the relaxation is +POSIX compliant because POSIX indicate that usernames are composed of +characters from the portable filename character set [A-Za-z0-9._-]. + +Upstream-Status: Pending + +Signed-off-by: Shan Hai <shan.hai@windriver.com> + +diff -urpN a/libmisc/chkname.c b/libmisc/chkname.c +index 5089112..f40a0da 100644 +--- a/libmisc/chkname.c ++++ b/libmisc/chkname.c +@@ -49,21 +49,28 @@ + static bool is_valid_name (const char *name) + { + /* +- * User/group names must match [a-z_][a-z0-9_-]*[$] +- */ +- if (('\0' == *name) || +- !((('a' <= *name) && ('z' >= *name)) || ('_' == *name))) { ++ * User/group names must match gnu e-regex: ++ * [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]? ++ * ++ * as a non-POSIX, extension, allow "$" as the last char for ++ * sake of Samba 3.x "add machine script" ++ */ ++ if ( ('\0' == *name) || ++ !((*name >= 'a' && *name <= 'z') || ++ (*name >= 'A' && *name <= 'Z') || ++ (*name >= '0' && *name <= '9') || ++ (*name == '_') || (*name == '.') ++ )) { + return false; + } + + while ('\0' != *++name) { +- if (!(( ('a' <= *name) && ('z' >= *name) ) || +- ( ('0' <= *name) && ('9' >= *name) ) || +- ('_' == *name) || +- ('-' == *name) || +- ('.' == *name) || +- ( ('$' == *name) && ('\0' == *(name + 1)) ) +- )) { ++ if (!( (*name >= 'a' && *name <= 'z') || ++ (*name >= 'A' && *name <= 'Z') || ++ (*name >= '0' && *name <= '9') || ++ (*name == '_') || (*name == '.') || (*name == '-') || ++ (*name == '$' && *(name + 1) == '\0') ++ )) { + return false; + } + } +diff -urpN a/man/groupadd.8.xml b/man/groupadd.8.xml +index 230fd0c..94f7807 100644 +--- a/man/groupadd.8.xml ++++ b/man/groupadd.8.xml +@@ -222,12 +222,6 @@ + <refsect1 id='caveats'> + <title>CAVEATS</title> + <para> +- Groupnames must start with a lower case letter or an underscore, +- followed by lower case letters, digits, underscores, or dashes. +- They can end with a dollar sign. +- In regular expression terms: [a-z_][a-z0-9_-]*[$]? +- </para> +- <para> + Groupnames may only be up to &GROUP_NAME_MAX_LENGTH; characters long. + </para> + <para> +diff -urpN a/man/useradd.8.xml b/man/useradd.8.xml +index 5dec989..fe623b9 100644 +--- a/man/useradd.8.xml ++++ b/man/useradd.8.xml +@@ -336,7 +336,7 @@ + </term> + <listitem> + <para> +- Do no create the user's home directory, even if the system ++ Do not create the user's home directory, even if the system + wide setting from <filename>/etc/login.defs</filename> + (<option>CREATE_HOME</option>) is set to + <replaceable>yes</replaceable>. +@@ -607,12 +607,6 @@ + </para> + + <para> +- Usernames must start with a lower case letter or an underscore, +- followed by lower case letters, digits, underscores, or dashes. +- They can end with a dollar sign. +- In regular expression terms: [a-z_][a-z0-9_-]*[$]? +- </para> +- <para> + Usernames may only be up to 32 characters long. + </para> + </refsect1> diff --git a/poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch b/poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch new file mode 100644 index 000000000..15f8044fa --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch @@ -0,0 +1,91 @@ +The system-auth in the configure files is from Fedora which put all the 4 pam type rules +in one file. +In yocto it obey the way with Debian/Ubuntu, and the names are common-auth, common-account, +common-password and common-session. +So update them with oe way. + +Upstream-Status: Pending + +Signed-off-by: Kang Kai <kai.kang@windriver.com> + +diff -Nur shadow-4.1.4.3/etc/pam.d.orig/chage shadow-4.1.4.3/etc/pam.d/chage +--- shadow-4.1.4.3/etc/pam.d.orig/chage 2011-07-20 19:02:27.384844958 +0800 ++++ shadow-4.1.4.3/etc/pam.d/chage 2011-07-20 19:03:08.964844958 +0800 +@@ -1,4 +1,4 @@ + #%PAM-1.0 + auth sufficient pam_rootok.so + account required pam_permit.so +-password include system-auth ++password include common-password +diff -Nur shadow-4.1.4.3/etc/pam.d.orig/chgpasswd shadow-4.1.4.3/etc/pam.d/chgpasswd +--- shadow-4.1.4.3/etc/pam.d.orig/chgpasswd 2011-07-20 19:02:27.384844958 +0800 ++++ shadow-4.1.4.3/etc/pam.d/chgpasswd 2011-07-20 19:03:26.544844958 +0800 +@@ -1,4 +1,4 @@ + #%PAM-1.0 + auth sufficient pam_rootok.so + account required pam_permit.so +-password include system-auth ++password include common-password +diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupadd shadow-4.1.4.3/etc/pam.d/groupadd +--- shadow-4.1.4.3/etc/pam.d.orig/groupadd 2011-07-20 19:02:27.384844958 +0800 ++++ shadow-4.1.4.3/etc/pam.d/groupadd 2011-07-20 19:04:08.124844958 +0800 +@@ -1,4 +1,4 @@ + #%PAM-1.0 + auth sufficient pam_rootok.so + account required pam_permit.so +-password include system-auth ++password include common-password +diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupdel shadow-4.1.4.3/etc/pam.d/groupdel +--- shadow-4.1.4.3/etc/pam.d.orig/groupdel 2011-07-20 19:02:27.384844958 +0800 ++++ shadow-4.1.4.3/etc/pam.d/groupdel 2011-07-20 19:04:26.114844958 +0800 +@@ -1,4 +1,4 @@ + #%PAM-1.0 + auth sufficient pam_rootok.so + account required pam_permit.so +-password include system-auth ++password include common-password +diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupmems shadow-4.1.4.3/etc/pam.d/groupmems +--- shadow-4.1.4.3/etc/pam.d.orig/groupmems 2011-07-20 19:02:27.384844958 +0800 ++++ shadow-4.1.4.3/etc/pam.d/groupmems 2011-07-20 19:04:35.074844958 +0800 +@@ -1,4 +1,4 @@ + #%PAM-1.0 + auth sufficient pam_rootok.so + account required pam_permit.so +-password include system-auth ++password include common-password +diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupmod shadow-4.1.4.3/etc/pam.d/groupmod +--- shadow-4.1.4.3/etc/pam.d.orig/groupmod 2011-07-20 19:02:27.384844958 +0800 ++++ shadow-4.1.4.3/etc/pam.d/groupmod 2011-07-20 19:04:44.864844958 +0800 +@@ -1,4 +1,4 @@ + #%PAM-1.0 + auth sufficient pam_rootok.so + account required pam_permit.so +-password include system-auth ++password include common-password +diff -Nur shadow-4.1.4.3/etc/pam.d.orig/useradd shadow-4.1.4.3/etc/pam.d/useradd +--- shadow-4.1.4.3/etc/pam.d.orig/useradd 2011-07-20 19:02:27.384844958 +0800 ++++ shadow-4.1.4.3/etc/pam.d/useradd 2011-07-20 19:07:26.244844958 +0800 +@@ -1,4 +1,4 @@ + #%PAM-1.0 + auth sufficient pam_rootok.so + account required pam_permit.so +-password include system-auth ++password include common-password +diff -Nur shadow-4.1.4.3/etc/pam.d.orig/userdel shadow-4.1.4.3/etc/pam.d/userdel +--- shadow-4.1.4.3/etc/pam.d.orig/userdel 2011-07-20 19:02:27.384844958 +0800 ++++ shadow-4.1.4.3/etc/pam.d/userdel 2011-07-20 19:07:35.734844958 +0800 +@@ -1,4 +1,4 @@ + #%PAM-1.0 + auth sufficient pam_rootok.so + account required pam_permit.so +-password include system-auth ++password include common-password +diff -Nur shadow-4.1.4.3/etc/pam.d.orig/usermod shadow-4.1.4.3/etc/pam.d/usermod +--- shadow-4.1.4.3/etc/pam.d.orig/usermod 2011-07-20 19:02:27.384844958 +0800 ++++ shadow-4.1.4.3/etc/pam.d/usermod 2011-07-20 19:07:42.024844958 +0800 +@@ -1,4 +1,4 @@ + #%PAM-1.0 + auth sufficient pam_rootok.so + account required pam_permit.so +-password include system-auth ++password include common-password diff --git a/poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch b/poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch new file mode 100644 index 000000000..37dc153fc --- /dev/null +++ b/poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch @@ -0,0 +1,33 @@ +Upstream-Status: Pending + +usermod: fix compilation failure with subids disabled + +Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +--- + src/usermod.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/usermod.c b/src/usermod.c +index e7d4351..685b50a 100644 +--- a/src/usermod.c ++++ b/src/usermod.c +@@ -1360,7 +1360,7 @@ static void process_flags (int argc, char **argv) + Prog, (unsigned long) user_newid); + exit (E_UID_IN_USE); + } +- ++#ifdef ENABLE_SUBIDS + if ( (vflg || Vflg) + && !is_sub_uid) { + fprintf (stderr, +@@ -1376,6 +1376,7 @@ static void process_flags (int argc, char **argv) + Prog, sub_gid_dbname (), "-w", "-W"); + exit (E_USAGE); + } ++#endif + } + + /* +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb b/poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb new file mode 100644 index 000000000..c78f888cf --- /dev/null +++ b/poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb @@ -0,0 +1,38 @@ +SUMMARY = "Provider of the machine specific securetty file" +SECTION = "base utils" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +INHIBIT_DEFAULT_DEPS = "1" + +PR = "r3" + +SRC_URI = "file://securetty" + +S = "${WORKDIR}" + +# Since SERIAL_CONSOLES is likely to be set from the machine configuration +PACKAGE_ARCH = "${MACHINE_ARCH}" + +do_install () { + # Ensure we add a suitable securetty file to the package that has + # most common embedded TTYs defined. + install -d ${D}${sysconfdir} + install -m 0400 ${WORKDIR}/securetty ${D}${sysconfdir}/securetty + if [ ! -z "${SERIAL_CONSOLES}" ]; then + # Our SERIAL_CONSOLES contains a baud rate and sometimes extra + # options as well. The following pearl :) takes that and converts + # it into newline-separated tty's and appends them into + # securetty. So if a machine has a weird looking console device + # node (e.g. ttyAMA0) that securetty does not know, it will get + # appended to securetty and root logins will be allowed on that + # console. + tmp="${SERIAL_CONSOLES}" + for entry in $tmp ; do + ttydev=`echo "$entry" | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'` + if ! grep -q $ttydev ${D}${sysconfdir}/securetty; then + echo $ttydev >> ${D}${sysconfdir}/securetty + fi + done + fi +} diff --git a/poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb b/poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb new file mode 100644 index 000000000..ef014628f --- /dev/null +++ b/poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb @@ -0,0 +1,32 @@ +SUMMARY = "Shadow utils requirements for useradd.bbclass" +HOMEPAGE = "http://pkg-shadow.alioth.debian.org" +BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580" +SECTION = "base utils" +LICENSE = "BSD | Artistic-1.0" +LIC_FILES_CHKSUM = "file://login.defs_shadow-sysroot;md5=25e2f2de4dfc8f966ac5cdfce45cd7d5" + +DEPENDS = "base-passwd" + +PR = "r3" + +# The sole purpose of this recipe is to provide the /etc/login.defs +# file for the target sysroot - needed so the shadow-native utilities +# can add custom users/groups for recipes that use inherit useradd. +SRC_URI = "file://login.defs_shadow-sysroot" + +SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79" +SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778" + +S = "${WORKDIR}" + +do_install() { + install -d ${D}${sysconfdir} + install -p -m 644 ${S}/login.defs_shadow-sysroot ${D}${sysconfdir}/login.defs +} + +SYSROOT_DIRS += "${sysconfdir}" + +# don't create any packages +# otherwise: dbus-dev depends on shadow-sysroot-dev which depends on shadow-sysroot +# and this has another copy of /etc/login.defs already provided by shadow +PACKAGES = "" diff --git a/poky/meta/recipes-extended/shadow/shadow.inc b/poky/meta/recipes-extended/shadow/shadow.inc new file mode 100644 index 000000000..673207fc9 --- /dev/null +++ b/poky/meta/recipes-extended/shadow/shadow.inc @@ -0,0 +1,201 @@ +SUMMARY = "Tools to change and administer password and group data" +HOMEPAGE = "http://pkg-shadow.alioth.debian.org" +BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580" +SECTION = "base/utils" +LICENSE = "BSD | Artistic-1.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=ed80ff1c2b40843cf5768e5229cf16e5 \ + file://src/passwd.c;beginline=8;endline=30;md5=d83888ea14ae61951982d77125947661" + +DEPENDS = "virtual/crypt" + +SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.xz \ + file://shadow-4.1.3-dots-in-usernames.patch \ + file://usermod-fix-compilation-failure-with-subids-disabled.patch \ + file://fix-installation-failure-with-subids-disabled.patch \ + file://0001-Do-not-read-login.defs-before-doing-chroot.patch \ + file://check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch \ + file://0001-useradd-copy-extended-attributes-of-home.patch \ + file://0001-shadow-CVE-2017-12424 \ + ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \ + " + +SRC_URI_append_class-target = " \ + file://login_defs_pam.sed \ + file://shadow-update-pam-conf.patch \ + file://shadow-relaxed-usernames.patch \ + " + +SRC_URI_append_class-native = " \ + file://0001-Disable-use-of-syslog-for-sysroot.patch \ + file://allow-for-setting-password-in-clear-text.patch \ + file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \ + file://0001-useradd.c-create-parent-directories-when-necessary.patch \ + " +SRC_URI_append_class-nativesdk = " \ + file://0001-Disable-use-of-syslog-for-sysroot.patch \ + " + +SRC_URI[md5sum] = "2bfafe7d4962682d31b5eba65dba4fc8" +SRC_URI[sha256sum] = "3b0893d1476766868cd88920f4f1231c4795652aa407569faff802bcda0f3d41" + +# Additional Policy files for PAM +PAM_SRC_URI = "file://pam.d/chfn \ + file://pam.d/chpasswd \ + file://pam.d/chsh \ + file://pam.d/login \ + file://pam.d/newusers \ + file://pam.d/passwd \ + file://pam.d/su" + +inherit autotools gettext + +EXTRA_OECONF += "--without-audit \ + --without-libcrack \ + --without-selinux \ + --with-group-name-max-length=24 \ + --enable-subordinate-ids=yes \ + ${NSCDOPT}" + +NSCDOPT = "" +NSCDOPT_class-native = "--without-nscd" +NSCDOPT_class-nativesdk = "--without-nscd" +NSCDOPT_libc-glibc = "${@bb.utils.contains('DISTRO_FEATURES', 'libc-spawn', '--with-nscd', '--without-nscd', d)}" + +PAM_PLUGINS = "libpam-runtime \ + pam-plugin-faildelay \ + pam-plugin-securetty \ + pam-plugin-nologin \ + pam-plugin-env \ + pam-plugin-group \ + pam-plugin-limits \ + pam-plugin-lastlog \ + pam-plugin-motd \ + pam-plugin-mail \ + pam-plugin-shells \ + pam-plugin-rootok" + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)}" +PACKAGECONFIG_class-native ??= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)}" +PACKAGECONFIG_class-nativesdk = "" +PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam,${PAM_PLUGINS}" +PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr" +PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl" + +RDEPENDS_${PN} = "shadow-securetty \ + base-passwd \ + util-linux-sulogin" +RDEPENDS_${PN}_class-native = "" +RDEPENDS_${PN}_class-nativesdk = "" + +do_install() { + oe_runmake DESTDIR="${D}" sbindir="${base_sbindir}" usbindir="${sbindir}" install + + # Info dir listing isn't interesting at this point so remove it if it exists. + if [ -e "${D}${infodir}/dir" ]; then + rm -f ${D}${infodir}/dir + fi + + # Enable CREATE_HOME by default. + sed -i 's/#CREATE_HOME/CREATE_HOME/g' ${D}${sysconfdir}/login.defs + + # As we are on an embedded system, ensure the users mailbox is in + # ~/ not /var/spool/mail by default, as who knows where or how big + # /var is. The system MDA will set this later anyway. + sed -i 's/MAIL_DIR/#MAIL_DIR/g' ${D}${sysconfdir}/login.defs + sed -i 's/#MAIL_FILE/MAIL_FILE/g' ${D}${sysconfdir}/login.defs + + # Disable checking emails. + sed -i 's/MAIL_CHECK_ENAB/#MAIL_CHECK_ENAB/g' ${D}${sysconfdir}/login.defs + + # Comment out SU_NAME to work correctly with busybox + # See Bug#5359 and Bug#7173 + sed -i 's:^SU_NAME:#SU_NAME:g' ${D}${sysconfdir}/login.defs + + # Use proper encryption for passwords + sed -i 's/^#ENCRYPT_METHOD.*$/ENCRYPT_METHOD SHA512/' ${D}${sysconfdir}/login.defs + + # Now we don't have a mail system. Disable mail creation for now. + sed -i 's:/bin/bash:/bin/sh:g' ${D}${sysconfdir}/default/useradd + sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd + + # Use users group by default + sed -i 's,^GROUP=1000,GROUP=100,g' ${D}${sysconfdir}/default/useradd +} + +do_install_append() { + # Ensure that the image has as a /var/spool/mail dir so shadow can + # put mailboxes there if the user reconfigures shadow to its + # defaults (see sed below). + install -d ${D}${localstatedir}/spool/mail + + if [ -e ${WORKDIR}/pam.d ]; then + install -d ${D}${sysconfdir}/pam.d/ + install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ + # Remove defaults that are not used when supporting PAM. + sed -i -f ${WORKDIR}/login_defs_pam.sed ${D}${sysconfdir}/login.defs + fi + + install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir} + + # Move binaries to the locations we want + rm ${D}${sbindir}/vigr + ln -sf vipw.${BPN} ${D}${base_sbindir}/vigr + if [ "${sbindir}" != "${base_sbindir}" ]; then + mv ${D}${sbindir}/vipw ${D}${base_sbindir}/vipw + fi + if [ "${bindir}" != "${base_bindir}" ]; then + mv ${D}${bindir}/login ${D}${base_bindir}/login + mv ${D}${bindir}/su ${D}${base_bindir}/su + fi + + # Handle link properly after rename, otherwise missing files would + # lead rpm failed dependencies. + ln -sf newgrp.${BPN} ${D}${bindir}/sg +} + +PACKAGES =+ "${PN}-base" +FILES_${PN}-base = "\ + ${base_bindir}/login.shadow \ + ${base_bindir}/su.shadow \ + ${bindir}/sg \ + ${bindir}/newgrp.shadow \ + ${bindir}/groups.shadow \ + ${sysconfdir}/pam.d/login \ + ${sysconfdir}/pam.d/su \ + ${sysconfdir}/login.defs \ +" +RDEPENDS_${PN} += "${PN}-base" + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "200" + +ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr nologin" +ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd" +ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw" +ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr" +ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin" + +ALTERNATIVE_${PN}-base = "newgrp groups login su" +ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login" +ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su" + +ALTERNATIVE_${PN}-doc = "passwd.5 getspnam.3 groups.1 su.1 nologin.8" +ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5" +ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3" +ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1" +ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1" +ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8" + +PACKAGE_WRITE_DEPS += "shadow-native" +pkg_postinst_${PN}_class-target () { + if [ "x$D" != "x" ]; then + rootarg="--root $D" + else + rootarg="" + fi + + pwconv $rootarg || exit 1 + grpconv $rootarg || exit 1 +} diff --git a/poky/meta/recipes-extended/shadow/shadow_4.2.1.bb b/poky/meta/recipes-extended/shadow/shadow_4.2.1.bb new file mode 100644 index 000000000..5675cb8cc --- /dev/null +++ b/poky/meta/recipes-extended/shadow/shadow_4.2.1.bb @@ -0,0 +1,10 @@ +require shadow.inc + +# Build falsely assumes that if --enable-libpam is set, we don't need to link against +# libcrypt. This breaks chsh. +BUILD_LDFLAGS_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', bb.utils.contains('DISTRO_FEATURES', 'libc-crypt', '-lcrypt', '', d), '', d)}" + +BBCLASSEXTEND = "native nativesdk" + + + diff --git a/poky/meta/recipes-extended/slang/slang/dont-link-to-host.patch b/poky/meta/recipes-extended/slang/slang/dont-link-to-host.patch new file mode 100644 index 000000000..42dba0fae --- /dev/null +++ b/poky/meta/recipes-extended/slang/slang/dont-link-to-host.patch @@ -0,0 +1,16 @@ +SLANG_INST_LIB is the location of where slang will end up, but when building for +packaging this doesn't have DESTDIR appended so can potentially link to the host +for cross builds and will trigger QA errors. + +As this is obviously wrong, delete it. + +Upstream-Status: Pending +Signed-off-by: Ross Burton <ross.burton@intel.com> + +diff --git a/slsh/Makefile.in b/slsh/Makefile.in +index cba9d81..4c1c370 100644 +--- a/slsh/Makefile.in ++++ b/slsh/Makefile.in +@@ -80 +80 @@ SHELL = /bin/sh +-INST_LIBS = $(DEST_LIB_DIR) $(RPATH) $(SLANG_INST_LIB) -lslang $(READLINE_LIB) $(DYNAMIC_LIBS) ++INST_LIBS = $(DEST_LIB_DIR) $(RPATH) -lslang $(READLINE_LIB) $(DYNAMIC_LIBS) diff --git a/poky/meta/recipes-extended/slang/slang/no-x.patch b/poky/meta/recipes-extended/slang/slang/no-x.patch new file mode 100644 index 000000000..7dc1602fe --- /dev/null +++ b/poky/meta/recipes-extended/slang/slang/no-x.patch @@ -0,0 +1,18 @@ +There's no need to check for the X libraries as the socket module doesn't use +anything from X. + +Upstream-Status: Pending +Signed-off-by: Ross Burton <ross.burton@intel.com> + +diff --git a/autoconf/configure.ac b/autoconf/configure.ac +index b61e974..a3e5db2 100644 +--- a/autoconf/configure.ac ++++ b/autoconf/configure.ac +@@ -72,3 +71,0 @@ AC_SUBST(LIB_READLINE) +-# For the socket module +-AC_PATH_XTRA +- +--- a/modules/Makefile.in ++++ b/modules/Makefile.in +@@ -67 +66,0 @@ ZLIB_LIB = @Z_LIB@ -lz +-SOCKET_LIBS = @X_EXTRA_LIBS@ diff --git a/poky/meta/recipes-extended/slang/slang/run-ptest b/poky/meta/recipes-extended/slang/slang/run-ptest new file mode 100644 index 000000000..39f474af3 --- /dev/null +++ b/poky/meta/recipes-extended/slang/slang/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +make -C test runtests diff --git a/poky/meta/recipes-extended/slang/slang/terminfo_fixes.patch b/poky/meta/recipes-extended/slang/slang/terminfo_fixes.patch new file mode 100644 index 000000000..3e6d15aa7 --- /dev/null +++ b/poky/meta/recipes-extended/slang/slang/terminfo_fixes.patch @@ -0,0 +1,148 @@ +Do not use the JD_TERMCAP macro since we cannot get the terminfo from +ncurses pkg-config, but fix the macro to not reference host directories. +Also add src/test/Makefile.in so that we can use -ltermcap if we want to. + +Upstream-Status: Pending + +Signed-off-by: Joe Slater <joe.slater@windriver.com> + + +--- a/autoconf/aclocal.m4 ++++ b/autoconf/aclocal.m4 +@@ -506,14 +506,10 @@ then + else + MISC_TERMINFO_DIRS="" + fi +-JD_Terminfo_Dirs="$MISC_TERMINFO_DIRS \ +- /usr/lib/terminfo \ +- /usr/share/terminfo \ +- /usr/share/lib/terminfo \ +- /usr/local/lib/terminfo" ++ + TERMCAP=-ltermcap + +-for terminfo_dir in $JD_Terminfo_Dirs ++for terminfo_dir in $MISC_TERMINFO_DIRS + do + if test -d $terminfo_dir + then +--- a/autoconf/configure.ac ++++ b/autoconf/configure.ac +@@ -249,7 +249,14 @@ AC_CHECK_SIZEOF(size_t) + JD_CHECK_LONG_LONG + JD_LARGE_FILE_SUPPORT + +-JD_TERMCAP ++dnl Do not use JD_TERMCAP, since we cannot get terminfo from ncurses*-config anymore. ++dnl Set TERMCAP=-ltermcap and AC_DEFINE(USE_TERMCAP,1,[Define to use termcap]) ++dnl to use libtermcap. ++TERMCAP="" ++MISC_TERMINFO_DIRS="" ++AC_SUBST(TERMCAP)dnl ++AC_SUBST(MISC_TERMINFO_DIRS)dnl ++ + JD_GCC_WARNINGS + + JD_SET_OBJ_SRC_DIR(src) +@@ -364,7 +371,7 @@ AC_CONFIG_HEADER(src/sysconf.h:src/confi + dnl AC_CONFIG_SUBDIRS(demo) + + AC_OUTPUT(Makefile:autoconf/Makefile.in \ +- src/Makefile slsh/Makefile modules/Makefile demo/Makefile \ ++ src/Makefile src/test/Makefile slsh/Makefile modules/Makefile demo/Makefile \ + slang.pc:autoconf/slangpc.in \ + ) + +--- /dev/null ++++ b/src/test/Makefile.in +@@ -0,0 +1,90 @@ ++# -*- make -*- ++TEST_SCRIPTS_SLC = argv syntax scircuit eqs sscanf loops arith array strops \ ++ bstring pack stdio assoc selfload struct nspace path ifeval anytype arrmult \ ++ time utf8 except bugs list regexp method deref naninf overflow sort \ ++ longlong signal dollar req docfun debug qualif compare break multline \ ++ stack misc posixio posdir proc math ++ ++TEST_SCRIPTS_NO_SLC = autoload nspace2 prep ++ ++TEST_SCRIPTS = $(TEST_SCRIPTS_SLC) $(TEST_SCRIPTS_NO_SLC) ++ ++TEST_PGM = sltest ++MEMCHECK = valgrind --tool=memcheck --leak-check=yes --leak-resolution=med --num-callers=20 ++RUN_TEST_PGM = ./$(TEST_PGM) ++SLANGINC = .. ++SLANGLIB = ../$(ARCH)objs ++OTHER_LIBS = -lm @TERMCAP@ ++OTHER_CFLAGS = ++ ++runtests: $(TEST_PGM) cleantmp ++ @tests=""; \ ++ for test in $(TEST_SCRIPTS); \ ++ do \ ++ tests="$$tests $$test.sl"; \ ++ done; \ ++ for test in $(TEST_SCRIPTS_SLC); \ ++ do \ ++ tests="$$tests $$test.slc"; \ ++ done; \ ++ MAKERUNNING=1 ./runtests.sh $$tests ++# @touch $(TEST_PGM).c ++ ++update: $(TEST_PGM) cleantmp ++ @tests=""; \ ++ for X in $(TEST_SCRIPTS); \ ++ do \ ++ if [ ! -e lastrun/$$X.sl ] || [ $$X.sl -nt lastrun/$$X.sl ] ; \ ++ then \ ++ tests="$$tests $$X.sl"; \ ++ fi \ ++ done; \ ++ for X in $(TEST_SCRIPTS_SLC); \ ++ do \ ++ if [ ! -e lastrun/$$X.slc ] || [ $$X.sl -nt lastrun/$$X.slc ] ; \ ++ then \ ++ tests="$$tests $$X.slc"; \ ++ fi \ ++ done; \ ++ if test -n "$$tests"; \ ++ then \ ++ MAKERUNNING=1 ./runtests.sh $$tests; \ ++ fi ++# @touch $(TEST_PGM).c ++ ++memcheck_runtests: $(TEST_PGM) cleantmp ++ @echo "" ++ @echo "Running tests:" ++ @echo "" ++ -@for X in $(TEST_SCRIPTS); \ ++ do \ ++ $(MEMCHECK) --log-file=log.$${X} $(RUN_TEST_PGM) $$X.sl; \ ++ grep ERROR log.$${X}; grep 'lost: [^0]' log.$${X}; \ ++ $(MEMCHECK) --log-file=log.$${X}_u $(RUN_TEST_PGM) -utf8 $$X.sl; \ ++ grep ERROR log.$${X}_u; grep 'lost: [^0]' log.$${X}_u; \ ++ done ++# touch $(TEST_PGM).c ++ ++memcheck_runtests_slc: $(TEST_PGM) cleantmp ++ @echo "" ++ @echo "Running tests:" ++ @echo "" ++ -@for X in $(TEST_SCRIPTS_SLC); \ ++ do \ ++ $(MEMCHECK) --log-file=log.$${X}_c $(RUN_TEST_PGM) $$X.slc; \ ++ $(MEMCHECK) --log-file=log.$${X}_uc $(RUN_TEST_PGM) -utf8 $$X.slc; \ ++ done ++# touch $(TEST_PGM).c ++ ++memcheck: memcheck_runtests memcheck_runtests_slc ++ ++$(TEST_PGM): $(TEST_PGM).c assoc.c list.c $(SLANGLIB)/libslang.a ++ $(CC) $(CFLAGS) $(OTHER_CFLAGS) $(LDFLAGS) $(TEST_PGM).c -o $(TEST_PGM) -I$(SLANGINC) -L$(SLANGLIB) -lslang $(OTHER_LIBS) ++cleantmp: ++ -/bin/rm -rf tmpfile*.* tmpdir*.* ++clean: cleantmp ++ -/bin/rm -f *~ *.o *.log log.pid* *.slc log.* *.log-* ++distclean: clean ++ /bin/rm -f $(TEST_PGM) $(TEST_PGM).gcda $(TEST_PGM).gcno ++.PHONY: clean memcheck runtests memcheck_runtests_slc memcheck_runtests cleantmp ++ diff --git a/poky/meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch b/poky/meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch new file mode 100644 index 000000000..27a9bb87e --- /dev/null +++ b/poky/meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch @@ -0,0 +1,30 @@ +From 38688ee2754415cf2a1935dafb8278861b7315e7 Mon Sep 17 00:00:00 2001 +From: Stefan Strogin <sstrogin@cisco.com> +Date: Thu, 2 Mar 2017 00:26:31 +0200 +Subject: [PATCH] test: add output in the format "result: testname" + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Stefan Strogin <sstrogin@cisco.com> +--- + src/test/runtests.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/test/runtests.sh b/src/test/runtests.sh +index a3eaad0..64f0705 100755 +--- a/src/test/runtests.sh ++++ b/src/test/runtests.sh +@@ -34,8 +34,10 @@ do + then + n_failed=`expr ${n_failed} + 1` + tests_failed="$tests_failed $testfile" ++ echo "FAIL: $testfile" + else + touch lastrun/$testfile ++ echo "PASS: $testfile" + fi + done + +-- +2.11.0 + diff --git a/poky/meta/recipes-extended/slang/slang_2.3.2.bb b/poky/meta/recipes-extended/slang/slang_2.3.2.bb new file mode 100644 index 000000000..87fd41af8 --- /dev/null +++ b/poky/meta/recipes-extended/slang/slang_2.3.2.bb @@ -0,0 +1,81 @@ +SUMMARY = "The shared library for the S-Lang extension language" + +DESCRIPTION = "S-Lang is an interpreted language and a programming library. The \ +S-Lang language was designed so that it can be easily embedded into \ +a program to provide the program with a powerful extension language. \ +The S-Lang library, provided in this package, provides the S-Lang \ +extension language. S-Lang's syntax resembles C, which makes it easy \ +to recode S-Lang procedures in C if you need to." + +HOMEPAGE = "http://www.jedsoft.org/slang/" +SECTION = "libs" +DEPENDS = "ncurses virtual/libiconv" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=a52a18a472d4f7e45479b06563717c02" + +SRC_URI = "http://www.jedsoft.org/releases/${BPN}/${BP}.tar.bz2 \ + file://no-x.patch \ + file://dont-link-to-host.patch \ + file://test-add-output-in-the-format-result-testname.patch \ + file://terminfo_fixes.patch \ + file://run-ptest \ + " + +SRC_URI[md5sum] = "c2d5a7aa0246627da490be4e399c87cb" +SRC_URI[sha256sum] = "fc9e3b0fc4f67c3c1f6d43c90c16a5c42d117b8e28457c5b46831b8b5d3ae31a" + +UPSTREAM_CHECK_URI = "http://www.jedsoft.org/releases/slang/" +PREMIRRORS_append = "\n http://www.jedsoft.org/releases/slang/.* http://www.jedsoft.org/releases/slang/old/ \n" + +inherit autotools-brokensep ptest +CLEANBROKEN = "1" + +EXTRA_OECONF = "--without-onig" +# There's no way to turn off rpaths and slang will -rpath to the default search +# path. Unset RPATH to stop this. +EXTRA_OEMAKE = "RPATH=''" + +PACKAGECONFIG ??= "pcre" +PACKAGECONFIG[pcre] = "--with-pcre=${STAGING_DIR_HOST}${prefix},--without-pcre,pcre" +PACKAGECONFIG[png] = "--with-png=${STAGING_DIR_HOST}${prefix},--without-png,libpng" +PACKAGECONFIG[zlib] = "--with-z=${STAGING_DIR_HOST}${prefix},--without-z,zlib" + +do_configure_prepend() { + cd ${S}/autoconf + # slang keeps configure.ac and rest of autoconf files in autoconf/ directory + # we have to go there to be able to run gnu-configize cause it expects configure.{in,ac} + # to be present. Resulting files land in autoconf/autoconf/ so we need to move them. + gnu-configize --force && mv autoconf/config.* . + # For the same reason we also need to run autoconf manually. + autoconf && mv configure .. + cd ${B} +} + +do_compile_ptest() { + oe_runmake -C src static + oe_runmake -C src/test sltest +} + +do_install_ptest() { + mkdir ${D}${PTEST_PATH}/test + for f in Makefile sltest runtests.sh *.sl *.inc; do + cp ${S}/src/test/$f ${D}${PTEST_PATH}/test/ + done + sed -e 's/\ \$(TEST_PGM)\.c\ assoc\.c\ list\.c\ \$(SLANGLIB)\/libslang\.a//' \ + -e '/\$(CC).*(TEST_PGM)/d' \ + -i ${D}${PTEST_PATH}/test/Makefile + + cp ${S}/slsh/lib/require.sl ${D}${PTEST_PATH}/test/ + sed -i 's/\.\.\/\.\.\/slsh\/lib\/require\.sl/require\.sl/' ${D}${PTEST_PATH}/test/req.sl + + cp ${S}/doc/text/slangfun.txt ${D}${PTEST_PATH}/test/ + sed -i 's/\.\.\/\.\.\/doc\/text\/slangfun\.txt/slangfun\.txt/' ${D}${PTEST_PATH}/test/docfun.sl +} + +FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/" + +PARALLEL_MAKE = "" +PARALLEL_MAKEINST = "" + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/stress/files/texinfo.patch b/poky/meta/recipes-extended/stress/files/texinfo.patch new file mode 100644 index 000000000..f23a1f69c --- /dev/null +++ b/poky/meta/recipes-extended/stress/files/texinfo.patch @@ -0,0 +1,80 @@ +Upstream-Status: Pending +--- a/doc/stress.texi ++++ b/doc/stress.texi +@@ -62,47 +62,47 @@ + + @table @samp + @item -? +-@itemx --help ++@item --help + Show help information. + +-@itemx --version ++@item --version + Show version information. + + @item -v +-@itemx --verbose ++@item --verbose + Turn up verbosity. + + @item -q +-@itemx --quiet ++@item --quiet + Turn down verbosity. + + @item -n +-@itemx --dry-run ++@item --dry-run + Show what would have been done. + + @item -t @var{secs} +-@itemx --timeout @var{secs} ++@item --timeout @var{secs} + Time out after @var{secs} seconds. + +-@itemx --backoff @var{usecs} ++@item --backoff @var{usecs} + Wait for factor of @var{usecs} microseconds before starting work. + + @item -c @var{forks} +-@itemx --cpu @var{forks} ++@item --cpu @var{forks} + Spawn @var{forks} processes each spinning on @samp{sqrt()}. + + @item -i @var{forks} +-@itemx --io @var{forks} ++@item --io @var{forks} + Spawn @var{forks} processes each spinning on @samp{sync()}. + + @item -m @var{forks} +-@itemx --vm @var{forks} ++@item --vm @var{forks} + Spawn @var{forks} processes each spinning on @samp{malloc()}. + +-@itemx --vm-bytes @var{bytes} ++@item --vm-bytes @var{bytes} + Allocate @var{bytes} number of bytes. The default is 1. + +-@itemx --vm-hang ++@item --vm-hang + Instruct each vm hog process to go to sleep after allocating memory. This + contrasts with their normal behavior, which is to free the memory and + reallocate @emph{ad infinitum}. This is useful for simulating low memory +@@ -114,13 +114,13 @@ + @end example + + @item -d @var{forks} +-@itemx --hdd @var{forks} ++@item --hdd @var{forks} + Spawn @var{forks} processes each spinning on @samp{write()}. + +-@itemx --hdd-bytes @var{bytes} ++@item --hdd-bytes @var{bytes} + Write @var{bytes} number of bytes. The default is 1GB. + +-@itemx --hdd-noclean ++@item --hdd-noclean + Do not unlink file(s) to which random ASCII data is written. + + @end table diff --git a/poky/meta/recipes-extended/stress/stress_1.0.4.bb b/poky/meta/recipes-extended/stress/stress_1.0.4.bb new file mode 100644 index 000000000..e9179d3e1 --- /dev/null +++ b/poky/meta/recipes-extended/stress/stress_1.0.4.bb @@ -0,0 +1,15 @@ +SUMMARY = "System load testing utility" +DESCRIPTION = "Deliberately simple workload generator for POSIX systems. It \ +imposes a configurable amount of CPU, memory, I/O, and disk stress on the system." +HOMEPAGE = "http://people.seas.harvard.edu/~apw/stress/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +SRC_URI = "http://people.seas.harvard.edu/~apw/${BPN}/${BP}.tar.gz \ + file://texinfo.patch \ + " + +SRC_URI[md5sum] = "890a4236dd1656792f3ef9a190cf99ef" +SRC_URI[sha256sum] = "057e4fc2a7706411e1014bf172e4f94b63a12f18412378fca8684ca92408825b" + +inherit autotools diff --git a/poky/meta/recipes-extended/sudo/files/sudo.pam b/poky/meta/recipes-extended/sudo/files/sudo.pam new file mode 100644 index 000000000..515eab0c6 --- /dev/null +++ b/poky/meta/recipes-extended/sudo/files/sudo.pam @@ -0,0 +1,6 @@ +#%PAM-1.0 +auth include common-auth +account include common-account +password include common-password +session optional pam_keyinit.so revoke +session required pam_limits.so diff --git a/poky/meta/recipes-extended/sudo/sudo.inc b/poky/meta/recipes-extended/sudo/sudo.inc new file mode 100644 index 000000000..362bd3a2e --- /dev/null +++ b/poky/meta/recipes-extended/sudo/sudo.inc @@ -0,0 +1,46 @@ +SUMMARY = "Provide limited super user privileges to specific users" +DESCRIPTION = "Sudo (superuser do) allows a system administrator to give certain users (or groups of users) the ability to run some (or all) commands as root while logging all commands and arguments." +HOMEPAGE = "http://www.sudo.ws" +BUGTRACKER = "http://www.sudo.ws/bugs/" +SECTION = "admin" +LICENSE = "ISC & BSD & Zlib" +LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=7765a3d787cb4fed3ccc3c9cee030af9 \ + file://plugins/sudoers/redblack.c;beginline=1;endline=41;md5=805782a8466975716f8376b2be9aedde \ + file://lib/util/reallocarray.c;beginline=3;endline=16;md5=85b0905b795d4d58bf2e00635649eec6 \ + file://lib/util/fnmatch.c;beginline=3;endline=27;md5=67f83ee9bd456557397082f8f1be0efd \ + file://lib/util/getcwd.c;beginline=5;endline=27;md5=449af4cc57fc7d46f42090608ba3e681 \ + file://lib/util/glob.c;beginline=6;endline=31;md5=5872733146b9eb0deb79e1f664815b85 \ + file://lib/util/snprintf.c;beginline=6;endline=34;md5=c82c1b3a5c32e08545c9ec5d71e41e50 \ + file://include/sudo_queue.h;beginline=5;endline=27;md5=449af4cc57fc7d46f42090608ba3e681 \ + file://lib/util/inet_pton.c;beginline=3;endline=17;md5=3970ab0518ab79cbd0bafb697f10b33a" + +inherit autotools + +PACKAGECONFIG ??= "" +PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib" + +CONFFILES_${PN} = "${sysconfdir}/sudoers" + +EXTRA_OECONF = "--with-editor=/bin/vi --with-env-editor" + +EXTRA_OECONF_append_libc-musl = " --disable-hardening " + +# mksigname/mksiglist are used on build host to generate source files +do_compile_prepend () { + # Remove build host references from sudo_usage.h + sed -i \ + -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \ + -e 's,--build=${BUILD_SYS},,g' \ + -e 's,--host=${HOST_SYS},,g' \ + ${B}/src/sudo_usage.h + oe_runmake SSP_CFLAGS="" SSP_LDFLAGS="" CC="$BUILD_CC" CFLAGS="$BUILD_CFLAGS" CPPFLAGS="$BUILD_CPPFLAGS -I${S}/include -I${S} -I${B}" -C lib/util mksigname mksiglist +} + +# Explicitly create ${localstatedir}/lib before do_install to ensure +# the directory is accessible by all users. Otherwise the mkinstalldirs +# script (from sudo) will recursively create ${localstatedir}/lib/sudo +# and then chmod each directory with 0700 permissions, which isn't what +# we want (i.e, users would not be able to access /var/lib). +do_install_prepend (){ + mkdir -p ${D}/${localstatedir}/lib +} diff --git a/poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch b/poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch new file mode 100644 index 000000000..eb36cd49b --- /dev/null +++ b/poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch @@ -0,0 +1,34 @@ +From 386e2c2fa2ab2e02ef71c268a57205139be329ab Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 31 Aug 2015 07:07:49 +0000 +Subject: [PATCH] Include sys/types.h for id_t definition + +/sudo_util.h:219:14: error: unknown type name 'id_t' + __dso_public id_t sudo_strtoid_v1(const char *str, const char *sep, + char **endp, const char **errstr); + ^ + make[1]: *** [preserve_fds.o] Error 1 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + include/sudo_util.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/sudo_util.h b/include/sudo_util.h +index 89c9f89..ac0855a 100644 +--- a/include/sudo_util.h ++++ b/include/sudo_util.h +@@ -17,6 +17,8 @@ + #ifndef SUDO_UTIL_H + #define SUDO_UTIL_H + ++#include <sys/types.h> ++ + #ifdef HAVE_STDBOOL_H + # include <stdbool.h> + #else +-- +2.5.1 + diff --git a/poky/meta/recipes-extended/sudo/sudo_1.8.22.bb b/poky/meta/recipes-extended/sudo/sudo_1.8.22.bb new file mode 100644 index 000000000..91501781b --- /dev/null +++ b/poky/meta/recipes-extended/sudo/sudo_1.8.22.bb @@ -0,0 +1,36 @@ +require sudo.inc + +SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-${PV}.tar.gz \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ + file://0001-Include-sys-types.h-for-id_t-definition.patch \ + " + +PAM_SRC_URI = "file://sudo.pam" + +SRC_URI[md5sum] = "24abdea48db4c5abcd410167c801cc8c" +SRC_URI[sha256sum] = "7256cb27c20883b14360eddbd17f98922073d104b214cf65aeacf1d9c9b9fd02" + +DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" +RDEPENDS_${PN} += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-limits pam-plugin-keyinit', '', d)}" + +EXTRA_OECONF += " \ + ac_cv_type_rsize_t=no \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-tmpfiles.d=${libdir}/tmpfiles.d', '--disable-tmpfiles.d', d)} \ + " + +do_install_append () { + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then + install -D -m 644 ${WORKDIR}/sudo.pam ${D}/${sysconfdir}/pam.d/sudo + fi + + chmod 4111 ${D}${bindir}/sudo + chmod 0440 ${D}${sysconfdir}/sudoers + + # Explicitly remove the ${localstatedir}/run directory to avoid QA error + rmdir -p --ignore-fail-on-non-empty ${D}${localstatedir}/run/sudo +} + +FILES_${PN} += "${libdir}/tmpfiles.d" +FILES_${PN}-dev += "${libexecdir}/${BPN}/lib*${SOLIBSDEV} ${libexecdir}/${BPN}/*.la \ + ${libexecdir}/lib*${SOLIBSDEV} ${libexecdir}/*.la" diff --git a/poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch b/poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch new file mode 100644 index 000000000..9567946c0 --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch @@ -0,0 +1,132 @@ +From f0af5bcfd753691652eac35efbcb208c933253f1 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 31 Aug 2015 05:11:53 +0000 +Subject: [PATCH] Fix build with musl + +Explicitly include fcntl.h since with glibc is comes in as indirect +include but not with musl + +linux/time.h inclusion is not required on musl so using !__GLIBC__ is +not right for musl here + +wait type is glibc specific + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + klogd.c | 10 +--------- + ksym_mod.c | 5 +---- + pidfile.c | 1 + + syslog.c | 3 ++- + syslogd.c | 4 +--- + 5 files changed, 6 insertions(+), 17 deletions(-) + +diff --git a/klogd.c b/klogd.c +index 6cc80ed..9219671 100644 +--- a/klogd.c ++++ b/klogd.c +@@ -260,11 +260,8 @@ + #include <unistd.h> + #include <signal.h> + #include <errno.h> +-#include <sys/fcntl.h> ++#include <fcntl.h> + #include <sys/stat.h> +-#if !defined(__GLIBC__) +-#include <linux/time.h> +-#endif /* __GLIBC__ */ + #include <stdarg.h> + #include <paths.h> + #include <stdlib.h> +@@ -277,13 +274,8 @@ + + #define __LIBRARY__ + #include <linux/unistd.h> +-#if !defined(__GLIBC__) +-# define __NR_ksyslog __NR_syslog +-_syscall3(int,ksyslog,int, type, char *, buf, int, len); +-#else + #include <sys/klog.h> + #define ksyslog klogctl +-#endif + + #define LOG_BUFFER_SIZE 4096 + #define LOG_LINE_LENGTH 1000 +diff --git a/ksym_mod.c b/ksym_mod.c +index 68cd6b6..6e26da1 100644 +--- a/ksym_mod.c ++++ b/ksym_mod.c +@@ -113,12 +113,9 @@ + #include <unistd.h> + #include <signal.h> + #include <errno.h> +-#include <sys/fcntl.h> ++#include <fcntl.h> + #include <sys/stat.h> + #include "module.h" +-#if !defined(__GLIBC__) +-#include <linux/time.h> +-#endif /* __GLIBC__ */ + #include <stdarg.h> + #include <paths.h> + #include <linux/version.h> +diff --git a/pidfile.c b/pidfile.c +index e0959a0..6daa2e0 100644 +--- a/pidfile.c ++++ b/pidfile.c +@@ -31,6 +31,7 @@ + #include <string.h> + #include <errno.h> + #include <signal.h> ++#include <fcntl.h> + + /* read_pid + * +diff --git a/syslog.c b/syslog.c +index bdb3ff2..ef7b34e 100644 +--- a/syslog.c ++++ b/syslog.c +@@ -55,7 +55,7 @@ static char sccsid[] = "@(#)syslog.c 5.28 (Berkeley) 6/27/90"; + #include <sys/types.h> + #include <sys/socket.h> + #include <sys/file.h> +-#include <sys/signal.h> ++//#include <sys/signal.h> + #include <sys/syslog.h> + #if 0 + #include "syslog.h" +@@ -72,6 +72,7 @@ static char sccsid[] = "@(#)syslog.c 5.28 (Berkeley) 6/27/90"; + #include <stdarg.h> + #include <paths.h> + #include <stdio.h> ++#include <fcntl.h> + + #define _PATH_LOGNAME "/dev/log" + +diff --git a/syslogd.c b/syslogd.c +index ea73ea5..1ca0595 100644 +--- a/syslogd.c ++++ b/syslogd.c +@@ -818,9 +818,7 @@ void doexit(int sig); + void init(); + void cfline(char *line, register struct filed *f); + int decode(char *name, struct code *codetab); +-#if defined(__GLIBC__) + #define dprintf mydprintf +-#endif /* __GLIBC__ */ + static void dprintf(char *, ...); + static void allocate_log(void); + void sighup_handler(); +@@ -2094,7 +2092,7 @@ void reapchild() + (void) signal(SIGCHLD, reapchild); /* reset signal handler -ASP */ + wait ((int *)0); + #else +- union wait status; ++ int status; + + while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0) + ; +-- +2.5.1 + diff --git a/poky/meta/recipes-extended/sysklogd/files/0001-fix-problems-that-causes-a-segmentation-fault-under-.patch b/poky/meta/recipes-extended/sysklogd/files/0001-fix-problems-that-causes-a-segmentation-fault-under-.patch new file mode 100644 index 000000000..56431af84 --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/files/0001-fix-problems-that-causes-a-segmentation-fault-under-.patch @@ -0,0 +1,28 @@ +From cb72b3e172c238b4b5ae5935dc6be54f5034fcf1 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 30 Jun 2017 18:20:06 -0700 +Subject: [PATCH 1/2] fix problems that causes a segmentation fault under some + conditions + +Upstream-Status: Inappropriate [ no upstream ] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + ksym_mod.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/ksym_mod.c b/ksym_mod.c +index 6e26da1..a3daa7d 100644 +--- a/ksym_mod.c ++++ b/ksym_mod.c +@@ -186,7 +186,6 @@ extern int InitMsyms() + else + Syslog(LOG_ERR, "Error loading kernel symbols " \ + "- %s\n", strerror(errno)); +- fclose(ksyms); + return(0); + } + +-- +2.13.2 + diff --git a/poky/meta/recipes-extended/sysklogd/files/0002-Make-way-for-respecting-flags-from-environment.patch b/poky/meta/recipes-extended/sysklogd/files/0002-Make-way-for-respecting-flags-from-environment.patch new file mode 100644 index 000000000..ebbdef303 --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/files/0002-Make-way-for-respecting-flags-from-environment.patch @@ -0,0 +1,35 @@ +From b22f244732cd0f475af2f82fc7eecec49f90623b Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 1 Jul 2017 00:01:50 -0700 +Subject: [PATCH 2/2] Make way for respecting flags from environment + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + Makefile | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 5af1689..af699d2 100644 +--- a/Makefile ++++ b/Makefile +@@ -17,14 +17,12 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +-CC= gcc + #SKFLAGS= -g -DSYSV -Wall + #LDFLAGS= -g +-SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce ++SKFLAGS = $(CFLAGS) $(CPPFLAGS) -DSYSV -Wall -fno-strength-reduce + # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE + # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE + # $(shell getconf LFS_SKFLAGS) +-LDFLAGS= -s + + # Look where your install program is. + INSTALL = /usr/bin/install +-- +2.13.2 + diff --git a/poky/meta/recipes-extended/sysklogd/files/klogd.service b/poky/meta/recipes-extended/sysklogd/files/klogd.service new file mode 100644 index 000000000..0c888c497 --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/files/klogd.service @@ -0,0 +1,13 @@ +[Unit] +Description=Kernel Logging Service +After=syslogd.service + +[Service] +Type=forking +ExecStart=/sbin/klogd +PIDFile=/var/run/klogd.pid +StandardOutput=null +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch b/poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch new file mode 100644 index 000000000..d426c83bf --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch @@ -0,0 +1,17 @@ +Upstream-Status: Inappropriate [configuration] + +Index: sysklogd-1.5.1/Makefile +=================================================================== +--- sysklogd-1.5.1.orig/Makefile ++++ sysklogd-1.5.1/Makefile +@@ -127,8 +127,8 @@ clobber: clean + rm -f syslogd klogd ksym syslog_tst oops_test TAGS tsyslogd tklogd + + install_exec: syslogd klogd +- ${INSTALL} -m 500 -s syslogd ${BINDIR}/syslogd +- ${INSTALL} -m 500 -s klogd ${BINDIR}/klogd ++ ${INSTALL} -m 500 syslogd ${BINDIR}/syslogd ++ ${INSTALL} -m 500 klogd ${BINDIR}/klogd + + install_man: + ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} sysklogd.8 ${MANDIR}/man8/sysklogd.8 diff --git a/poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch b/poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch new file mode 100644 index 000000000..c1cc042c9 --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch @@ -0,0 +1,20 @@ +Upstream-Status: Inappropriate + +The compiler should not be generating vectorized instructions on this target. +This is a work around until I can determine why this is occuring on this +particular recipe + +Index: sysklogd-1.5/Makefile +=================================================================== +--- sysklogd-1.5.orig/Makefile ++++ sysklogd-1.5/Makefile +@@ -20,7 +20,8 @@ + CC= gcc + #SKFLAGS= -g -DSYSV -Wall + #LDFLAGS= -g +-SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce ++SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce \ ++ -fno-tree-vectorize + # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE + # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE + # $(shell getconf LFS_SKFLAGS) diff --git a/poky/meta/recipes-extended/sysklogd/files/sysklogd b/poky/meta/recipes-extended/sysklogd/files/sysklogd new file mode 100755 index 000000000..258f88280 --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/files/sysklogd @@ -0,0 +1,151 @@ +#! /bin/sh +# /etc/init.d/sysklogd: start the system log daemon. + +### BEGIN INIT INFO +# Provides: sysklogd +# Required-Start: $remote_fs $time +# Required-Stop: $remote_fs $time +# Should-Start: $network +# Should-Stop: $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: System logger +### END INIT INFO + +# Source function library. +. /etc/init.d/functions + +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +pidfile_syslogd=/var/run/syslogd.pid +pidfile_klogd=/var/run/klogd.pid +binpath_syslogd=/sbin/syslogd +binpath_klogd=/sbin/klogd + +test -x $binpath || exit 0 + +test ! -r /etc/default/syslogd || . /etc/default/syslogd + +create_xconsole() +{ + # Only proceed if /dev/xconsole is used at all + if ! grep -q '^[^#].*/dev/xconsole' /etc/syslog.conf + then + return + fi + + if [ ! -e /dev/xconsole ]; then + mknod -m 640 /dev/xconsole p + else + chmod 0640 /dev/xconsole + fi + chown root:adm /dev/xconsole + test ! -x /sbin/restorecon || /sbin/restorecon /dev/xconsole +} + +log_begin_msg () { + echo -n $1 +} + +log_end_msg () { + echo $1 +} + +log_success_msg () { + echo $1 +} + +running() +{ + # No pidfile, probably no daemon present + # + if [ ! -f $pidfile ] + then + return 1 + fi + + pid=`cat $pidfile_syslogd` + + # No pid, probably no daemon present + # + if [ -z "$pid" ] + then + return 1 + fi + + if [ ! -d /proc/$pid ] + then + return 1 + fi + + cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1` + + # No syslogd? + # + if [ "$cmd" != "$binpath" ] + then + return 1 + fi + + return 0 +} + +case "$1" in + start) + log_begin_msg "Starting system log daemon..." + create_xconsole + start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD + log_end_msg $? + log_begin_msg "Starting kernel log daemon..." + start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD + log_end_msg $? + ;; + stop) + log_begin_msg "Stopping system log daemon..." + start-stop-daemon --stop --quiet --pidfile $pidfile_syslogd --name syslogd + log_end_msg $? + log_begin_msg "Stopping kernel log daemon..." + start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd + log_end_msg $? + ;; + reload|force-reload) + log_begin_msg "Reloading system log daemon..." + start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile_syslogd --name syslogd + log_end_msg $? + log_begin_msg "Reloading kernel log daemon..." + start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd + start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD + log_end_msg $? + ;; + restart) + log_begin_msg "Restarting system log daemon..." + start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile_syslogd --name syslogd + start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD + log_end_msg $? + log_begin_msg "Reloading kernel log daemon..." + start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd + start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD + log_end_msg $? + ;; + reload-or-restart) + if running + then + $0 reload + else + $0 start + fi + ;; + status) + status syslogd + RETVAL=$? + status klogd + rval=$? + [ $RETVAL -eq 0 ] && exit $rval + exit $RETVAL + ;; + *) + log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart|status}" + exit 1 +esac + +exit 0 diff --git a/poky/meta/recipes-extended/sysklogd/files/syslog.conf b/poky/meta/recipes-extended/sysklogd/files/syslog.conf new file mode 100644 index 000000000..0849de126 --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/files/syslog.conf @@ -0,0 +1,71 @@ +# /etc/syslog.conf Configuration file for syslogd. +# +# Ported from debian by Yu Ke <ke.yu@intel.com> +# + +# +# First some standard logfiles. Log by facility. +# + +auth,authpriv.* /var/log/auth.log +*.*;auth,authpriv.none -/var/log/syslog +#cron.* /var/log/cron.log +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +lpr.* -/var/log/lpr.log +mail.* -/var/log/mail.log +user.* -/var/log/user.log + +# +# Logging for the mail system. Split it up so that +# it is easy to write scripts to parse these files. +# +mail.info -/var/log/mail.info +mail.warn -/var/log/mail.warn +mail.err /var/log/mail.err + +# Logging for INN news system +# +news.crit /var/log/news.crit +news.err /var/log/news.err +news.notice -/var/log/news.notice + +# +# Some `catch-all' logfiles. +# +*.=debug;\ +auth,authpriv.none;\ +news.none;mail.none -/var/log/debug + +*.=info;*.=notice;*.=warn;\ +auth,authpriv.none;\ +cron,daemon.none;\ +mail,news.none -/var/log/messages + +# +# Emergencies are sent to everybody logged in. +# +*.emerg * + +# +# I like to have messages displayed on the console, but only on a virtual +# console I usually leave idle. +# +#daemon,mail.*;\ +#news.=crit;news.=err;news.=notice;\ +#*.=debug;*.=info;\ +#*.=notice;*.=warn /dev/tty8 + +# The named pipe /dev/xconsole is for the `xconsole' utility. To use it, +# you must invoke `xconsole' with the `-file' option: +# +# $ xconsole -file /dev/xconsole [...] +# +# NOTE: adjust the list below, or you'll go crazy if you have a reasonably +# busy site.. +# +daemon.*;mail.*;\ +news.err;\ +*.=debug;*.=info;\ +*.=notice;*.=warn |/dev/xconsole + diff --git a/poky/meta/recipes-extended/sysklogd/files/syslogd.service b/poky/meta/recipes-extended/sysklogd/files/syslogd.service new file mode 100644 index 000000000..eeaff3d38 --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/files/syslogd.service @@ -0,0 +1,14 @@ +[Unit] +Description=System Logging Service +Requires=syslog.socket + +[Service] +Type=forking +ExecStart=/sbin/syslogd +PIDFile=/var/run/syslogd.pid +StandardOutput=null +Restart=on-failure + +[Install] +WantedBy=multi-user.target +Alias=syslog.service diff --git a/poky/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf b/poky/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf new file mode 100644 index 000000000..f4aecd385 --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf @@ -0,0 +1 @@ +p /dev/xconsole 0640 root adm diff --git a/poky/meta/recipes-extended/sysklogd/sysklogd.inc b/poky/meta/recipes-extended/sysklogd/sysklogd.inc new file mode 100644 index 000000000..1a537fabf --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/sysklogd.inc @@ -0,0 +1,72 @@ +SUMMARY = "System Log Daemons" +DESCRIPTION = "The sysklogd package implements two system log daemons: syslogd, klogd" +HOMEPAGE = "http://www.infodrom.org/projects/sysklogd/" +SECTION = "base" + +LICENSE = "GPLv2+ & BSD" +LICENSE_syslogd = "BSD" +LICENSE_klogd = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ + file://syslogd.c;beginline=2;endline=15;md5=77ffb2fec48c46d7ca0abb2d5813e7fd \ + file://klogd.c;beginline=2;endline=19;md5=7e87ed0ae6142de079bce738c10c899d \ + " + +inherit update-rc.d systemd + +SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \ + file://no-strip-install.patch \ + file://0001-Fix-build-with-musl.patch \ + file://0001-fix-problems-that-causes-a-segmentation-fault-under-.patch \ + file://0002-Make-way-for-respecting-flags-from-environment.patch \ + file://sysklogd \ + file://syslog.conf \ + file://syslogd.service \ + file://klogd.service \ + file://tmpfiles.sysklogd.conf \ + " + +SRC_URI_append_e500v2 = " file://no-vectorization.patch" + +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE_${PN} = "syslogd.service klogd.service" +SYSTEMD_AUTO_ENABLE = "enable" + +INITSCRIPT_NAME = "syslog" +CONFFILES_${PN} = "${sysconfdir}/syslog.conf" +RCONFLICTS_${PN}-syslog = "rsyslog busybox-syslog syslog-ng" + +CFLAGS += "-DSYSV -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" + +do_install () { + install -d ${D}${mandir}/man8 \ + ${D}${mandir}/man5 \ + ${D}${base_sbindir} + oe_runmake 'BINDIR=${D}${base_sbindir}' \ + 'MANDIR=${D}${mandir}' install + install -d ${D}${sysconfdir} + install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf + install -d ${D}${sysconfdir}/init.d + install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog + install -d ${D}${systemd_unitdir}/system + install -m 644 ${WORKDIR}/syslogd.service ${D}${systemd_unitdir}/system + install -m 644 ${WORKDIR}/klogd.service ${D}${systemd_unitdir}/system + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true', 'false', d)}; then + install -d ${D}${exec_prefix}/lib/tmpfiles.d + install -m 644 ${WORKDIR}/tmpfiles.sysklogd.conf ${D}${exec_prefix}/lib/tmpfiles.d/sysklogd.conf + fi +} + +FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/sysklogd.conf', '', d)}" + +pkg_prerm_${PN} () { + if test "x$D" = "x"; then + if test "$1" = "upgrade" -o "$1" = "remove"; then + /etc/init.d/syslog stop || : + fi + fi +} + +python () { + if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): + d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") +} diff --git a/poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb b/poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb new file mode 100644 index 000000000..975ecc2b6 --- /dev/null +++ b/poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb @@ -0,0 +1,4 @@ +require sysklogd.inc + +SRC_URI[md5sum] = "c70599ab0d037fde724f7210c2c8d7f8" +SRC_URI[sha256sum] = "5166c185ae23c92e8b9feee66a6e3d0bc944bf673112f53e3ecf62e08ce7c201" diff --git a/poky/meta/recipes-extended/sysstat/sysstat.inc b/poky/meta/recipes-extended/sysstat/sysstat.inc new file mode 100644 index 000000000..0bc7e14d3 --- /dev/null +++ b/poky/meta/recipes-extended/sysstat/sysstat.inc @@ -0,0 +1,65 @@ +SUMMARY = "System performance tools" +DESCRIPTION = "The sysstat utilities are a collection of performance monitoring tools for Linux." +HOMEPAGE = "http://sebastien.godard.pagesperso-orange.fr/" +LICENSE = "GPLv2+" +SECTION = "console/utils" + +SRC_URI = "http://pagesperso-orange.fr/sebastien.godard/sysstat-${PV}.tar.xz \ + file://99_sysstat \ + file://sysstat.service \ + " + +UPSTREAM_CHECK_URI = "http://sebastien.godard.pagesperso-orange.fr/download.html" +UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar" + +DEPENDS += "base-passwd" + +# autotools-brokensep as this package doesn't use automake +inherit autotools-brokensep gettext systemd + +PACKAGECONFIG ??= "" +PACKAGECONFIG[lm-sensors] = "--enable-sensors,--disable-sensors,lmsensors,lmsensors-libsensors" + +EXTRA_OECONF += "--disable-stripping" + +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE_${PN} = "sysstat.service" +SYSTEMD_AUTO_ENABLE = "enable" + +do_configure_prepend() { + export sa_lib_dir=${libdir}/sa +} + +do_install() { + autotools_do_install + + # don't install /var/log/sa when populating rootfs. Do it through volatile + rm -rf ${D}/var + if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -d ${D}/etc/default/volatiles + install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles + fi + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/tmpfiles.d + echo "d ${localstatedir}/log/sa - - - -" \ + > ${D}${sysconfdir}/tmpfiles.d/sysstat.conf + fi + + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_unitdir}/system + sed -i -e 's#@LIBDIR@#${libdir}#g' ${D}${systemd_unitdir}/system/sysstat.service +} + +pkg_postinst_${PN} () { + if [ -n "$D" ]; then + exit 0 + fi + if [ -e /etc/init.d/populate-volatile.sh ]; then + /etc/init.d/populate-volatile.sh update + fi +} + + +FILES_${PN} += "${libdir}/sa" + +TARGET_CC_ARCH += "${LDFLAGS}" diff --git a/poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch b/poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch new file mode 100644 index 000000000..1b63299aa --- /dev/null +++ b/poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch @@ -0,0 +1,59 @@ +From 42325faa88d64cce799977d611b2792beb154643 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 14 Sep 2015 08:36:59 +0000 +Subject: [PATCH] Include needed headers explicitly + +on glibc these headers get pulled in indirectly via other .h files +but right fix is to include them directly when used + +fixes + +error: use of undeclared identifier 'PATH_MAX' +error: called object type 'unsigned int' is not a function or function pointer +dm_major = major(aux.st_rdev); + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + common.c | 1 + + ioconf.c | 1 + + sa_common.c | 1 + + 3 files changed, 3 insertions(+) + +Index: sysstat-11.7.1/common.c +=================================================================== +--- sysstat-11.7.1.orig/common.c ++++ sysstat-11.7.1/common.c +@@ -20,6 +20,7 @@ + */ + + #include <stdio.h> ++#include <limits.h> + #include <string.h> + #include <stdlib.h> + #include <stdarg.h> +Index: sysstat-11.7.1/ioconf.c +=================================================================== +--- sysstat-11.7.1.orig/ioconf.c ++++ sysstat-11.7.1/ioconf.c +@@ -27,6 +27,7 @@ + #include <errno.h> + #include <dirent.h> + #include <sys/stat.h> ++#include <sys/types.h> + + #include "ioconf.h" + #include "common.h" +Index: sysstat-11.7.1/sa_common.c +=================================================================== +--- sysstat-11.7.1.orig/sa_common.c ++++ sysstat-11.7.1/sa_common.c +@@ -20,6 +20,7 @@ + */ + + #include <stdio.h> ++#include <limits.h> + #include <string.h> + #include <stdlib.h> + #include <stdint.h> diff --git a/poky/meta/recipes-extended/sysstat/sysstat/99_sysstat b/poky/meta/recipes-extended/sysstat/sysstat/99_sysstat new file mode 100644 index 000000000..0b0ec30de --- /dev/null +++ b/poky/meta/recipes-extended/sysstat/sysstat/99_sysstat @@ -0,0 +1 @@ +d root root 0755 /var/log/sa none diff --git a/poky/meta/recipes-extended/sysstat/sysstat/sysstat.service b/poky/meta/recipes-extended/sysstat/sysstat/sysstat.service new file mode 100644 index 000000000..aff07109f --- /dev/null +++ b/poky/meta/recipes-extended/sysstat/sysstat/sysstat.service @@ -0,0 +1,12 @@ +[Unit] +Description=Resets System Activity Logs + +[Service] +Type=oneshot +RemainAfterExit=yes +User=root +ExecStart=@LIBDIR@/sa/sa1 --boot + +[Install] +WantedBy=multi-user.target + diff --git a/poky/meta/recipes-extended/sysstat/sysstat_11.7.1.bb b/poky/meta/recipes-extended/sysstat/sysstat_11.7.1.bb new file mode 100644 index 000000000..86738e7b7 --- /dev/null +++ b/poky/meta/recipes-extended/sysstat/sysstat_11.7.1.bb @@ -0,0 +1,8 @@ +require sysstat.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=a23a74b3f4caf9616230789d94217acb" + +SRC_URI += "file://0001-Include-needed-headers-explicitly.patch" + +SRC_URI[md5sum] = "bdcda7c9048c7c22fb1f30f75285d13d" +SRC_URI[sha256sum] = "303a595b1af0330b183a0f1febfccf89f183b9575ae0562b91fdb876f3ef1feb" diff --git a/poky/meta/recipes-extended/tar/tar.inc b/poky/meta/recipes-extended/tar/tar.inc new file mode 100644 index 000000000..93e4da114 --- /dev/null +++ b/poky/meta/recipes-extended/tar/tar.inc @@ -0,0 +1,52 @@ +SUMMARY = "GNU file archiving program" +DESCRIPTION = "GNU tar saves many files together into a single tape \ +or disk archive, and can restore individual files from the archive." +HOMEPAGE = "http://www.gnu.org/software/tar/" +SECTION = "base" + +SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2" + +inherit autotools gettext texinfo + +EXTRA_OECONF += "DEFAULT_RMT_DIR=${base_sbindir}" + +# Let aclocal use the relative path for the m4 file rather than the +# absolute since tar has a lot of m4 files, otherwise there might +# be an "Argument list too long" error when it is built in a long/deep +# directory. +acpaths = "-I ./m4" + +do_install () { + autotools_do_install + ln -s tar ${D}${bindir}/gtar +} + +do_install_append_class-target() { + if [ "${base_bindir}" != "${bindir}" ]; then + install -d ${D}${base_bindir} + mv ${D}${bindir}/tar ${D}${base_bindir}/tar + mv ${D}${bindir}/gtar ${D}${base_bindir}/gtar + rmdir ${D}${bindir}/ + fi +} + +PACKAGES =+ "${PN}-rmt" + +FILES_${PN}-rmt = "${base_sbindir}/rmt*" + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_${PN} = "tar" +ALTERNATIVE_${PN}-rmt = "rmt" +ALTERNATIVE_${PN}_class-nativesdk = "" +ALTERNATIVE_${PN}-rmt_class-nativesdk = "" + +ALTERNATIVE_LINK_NAME[tar] = "${base_bindir}/tar" +ALTERNATIVE_LINK_NAME[rmt] = "${base_sbindir}/rmt" + +PROVIDES_append_class-native = " tar-replacement-native" +NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}" + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/tar/tar/musl_dirent.patch b/poky/meta/recipes-extended/tar/tar/musl_dirent.patch new file mode 100644 index 000000000..2d98ed131 --- /dev/null +++ b/poky/meta/recipes-extended/tar/tar/musl_dirent.patch @@ -0,0 +1,19 @@ +musl has valid d_ino implementation + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending + +Index: tar-1.28/m4/d-ino.m4 +=================================================================== +--- tar-1.28.orig/m4/d-ino.m4 ++++ tar-1.28/m4/d-ino.m4 +@@ -40,7 +40,8 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_ + [gl_cv_struct_dirent_d_ino=no], + [case "$host_os" in + # Guess yes on glibc systems with Linux kernel. +- linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;; ++ linux*-gnu*|linux*-musl*) ++ gl_cv_struct_dirent_d_ino="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;; + # If we don't know, assume the worst. diff --git a/poky/meta/recipes-extended/tar/tar/remove-gets.patch b/poky/meta/recipes-extended/tar/tar/remove-gets.patch new file mode 100644 index 000000000..f24de926a --- /dev/null +++ b/poky/meta/recipes-extended/tar/tar/remove-gets.patch @@ -0,0 +1,29 @@ +ISO C11 removes the specification of gets() from the C language, eglibc 2.16+ removed it + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Upstream-Status: Pending +--- + gnu/stdio.in.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gnu/stdio.in.h b/gnu/stdio.in.h +index ec43874..502e3ae 100644 +--- a/gnu/stdio.in.h ++++ b/gnu/stdio.in.h +@@ -722,10 +722,12 @@ _GL_WARN_ON_USE (getline, "getline is unportable - " + /* It is very rare that the developer ever has full control of stdin, + so any use of gets warrants an unconditional warning; besides, C11 + removed it. */ ++#if defined gets + #undef gets + #if HAVE_RAW_DECL_GETS && !defined __cplusplus + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); + #endif ++#endif + + #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ + struct obstack; +-- +2.8.3 + diff --git a/poky/meta/recipes-extended/tar/tar_1.30.bb b/poky/meta/recipes-extended/tar/tar_1.30.bb new file mode 100644 index 000000000..e743a6d0d --- /dev/null +++ b/poky/meta/recipes-extended/tar/tar_1.30.bb @@ -0,0 +1,18 @@ +require tar.inc + +PACKAGECONFIG ??= "" +PACKAGECONFIG[acl] = "--with-posix-acls, --without-posix-acls, acl," + +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +SRC_URI += "file://remove-gets.patch \ + file://musl_dirent.patch \ + " +SRC_URI[md5sum] = "8404e4c1fc5a3000228ab2b8ad674a65" +SRC_URI[sha256sum] = "87592b86cb037c554375f5868bdd3cc57748aef38d6cb741c81065f0beac63b7" + +do_install_append_libc-musl() { + rm -f ${D}${libdir}/charset.alias + rmdir ${D}${libdir} +} diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Fix-build-with-clang.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Fix-build-with-clang.patch new file mode 100644 index 000000000..9d1e05d7f --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Fix-build-with-clang.patch @@ -0,0 +1,65 @@ +From 7f8878ac1aaf4a19992d39379797c151301bedb1 Mon Sep 17 00:00:00 2001 +From: Oleksiy Obitotskyy <oobitots@cisco.com> +Date: Mon, 5 Feb 2018 08:29:10 -0800 +Subject: [PATCH] Fix build with clang + +Fix "error: non-void function 'fix_options' should return a value". +Add function prototype to tcpd.c and miscd.c. + +Upstream-Status: Pending + +Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com> +--- + v2 - add function prototypes + + fix_options.c | 2 +- + miscd.c | 4 ++++ + tcpd.c | 4 ++++ + 3 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/fix_options.c b/fix_options.c +index b5e81b8..9958ff4 100644 +--- a/fix_options.c ++++ b/fix_options.c +@@ -29,7 +29,7 @@ static char sccsid[] = "@(#) fix_options.c 1.6 97/04/08 02:29:19"; + + /* fix_options - get rid of IP-level socket options */ + +-fix_options(request) ++void fix_options(request) + struct request_info *request; + { + #ifdef IP_OPTIONS +diff --git a/miscd.c b/miscd.c +index 1ab835c..723b83a 100644 +--- a/miscd.c ++++ b/miscd.c +@@ -40,6 +40,10 @@ static char sccsid[] = "@(#) miscd.c 1.10 96/02/11 17:01:30"; + #include "patchlevel.h" + #include "tcpd.h" + ++#ifdef KILL_IP_OPTIONS ++void fix_options(struct request_info *); ++#endif ++ + int allow_severity = SEVERITY; /* run-time adjustable */ + int deny_severity = LOG_WARNING; /* ditto */ + +diff --git a/tcpd.c b/tcpd.c +index d865b9c..a179891 100644 +--- a/tcpd.c ++++ b/tcpd.c +@@ -38,6 +38,10 @@ static char sccsid[] = "@(#) tcpd.c 1.10 96/02/11 17:01:32"; + #include "patchlevel.h" + #include "tcpd.h" + ++#ifdef KILL_IP_OPTIONS ++void fix_options(struct request_info *); ++#endif ++ + int allow_severity = SEVERITY; /* run-time adjustable */ + int deny_severity = LOG_WARNING; /* ditto */ + +-- +2.10.3.dirty + diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff new file mode 100644 index 000000000..16d6719cb --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff @@ -0,0 +1,77 @@ +Upstream-Status: Backport + +diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 +--- tcp_wrappers_7.6.orig/hosts_access.5 1995-01-30 19:51:47.000000000 +0100 ++++ tcp_wrappers_7.6/hosts_access.5 2004-04-09 16:59:45.000000000 +0200 +@@ -173,7 +173,7 @@ + Patterns like these can be used when the machine has different internet + addresses with different internet hostnames. Service providers can use + this facility to offer FTP, GOPHER or WWW archives with internet names +-that may even belong to different organizations. See also the `twist' ++that may even belong to different organizations. See also the `twist\' + option in the hosts_options(5) document. Some systems (Solaris, + FreeBSD) can have more than one internet address on one physical + interface; with other systems you may have to resort to SLIP or PPP +@@ -236,10 +236,10 @@ + Before accepting a client request, the wrappers can use the IDENT + service to find out that the client did not send the request at all. + When the client host provides IDENT service, a negative IDENT lookup +-result (the client matches `UNKNOWN@host') is strong evidence of a host ++result (the client matches `UNKNOWN@host\') is strong evidence of a host + spoofing attack. + .PP +-A positive IDENT lookup result (the client matches `KNOWN@host') is ++A positive IDENT lookup result (the client matches `KNOWN@host\') is + less trustworthy. It is possible for an intruder to spoof both the + client connection and the IDENT lookup, although doing so is much + harder than spoofing just a client connection. It may also be that +diff -ruN tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5 +--- tcp_wrappers_7.6.orig/hosts_options.5 1994-12-28 17:42:29.000000000 +0100 ++++ tcp_wrappers_7.6/hosts_options.5 2004-04-09 16:59:49.000000000 +0200 +@@ -124,7 +124,7 @@ + value is taken. + .SH MISCELLANEOUS + .IP "banners /some/directory" +-Look for a file in `/some/directory' with the same name as the daemon ++Look for a file in `/some/directory\' with the same name as the daemon + process (for example in.telnetd for the telnet service), and copy its + contents to the client. Newline characters are replaced by + carriage-return newline, and %<letter> sequences are expanded (see +diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8 +--- tcp_wrappers_7.6.orig/tcpdmatch.8 1996-02-11 17:01:36.000000000 +0100 ++++ tcp_wrappers_7.6/tcpdmatch.8 2004-04-09 17:00:49.000000000 +0200 +@@ -26,7 +26,7 @@ + A daemon process name. Typically, the last component of a daemon + executable pathname. + .IP client +-A host name or network address, or one of the `unknown' or `paranoid' ++A host name or network address, or one of the `unknown\' or `paranoid\' + wildcard patterns. + .sp + When a client host name is specified, \fItcpdmatch\fR gives a +@@ -37,13 +37,13 @@ + .PP + Optional information specified with the \fIdaemon@server\fR form: + .IP server +-A host name or network address, or one of the `unknown' or `paranoid' +-wildcard patterns. The default server name is `unknown'. ++A host name or network address, or one of the `unknown\' or `paranoid\' ++wildcard patterns. The default server name is `unknown\'. + .PP + Optional information specified with the \fIuser@client\fR form: + .IP user + A client user identifier. Typically, a login name or a numeric userid. +-The default user name is `unknown'. ++The default user name is `unknown\'. + .SH OPTIONS + .IP -d + Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current +@@ -70,7 +70,7 @@ + .ti +5 + tcpdmatch in.telnetd paranoid + .PP +-On some systems, daemon names have no `in.' prefix, or \fItcpdmatch\fR ++On some systems, daemon names have no `in.\' prefix, or \fItcpdmatch\fR + may need some help to locate the inetd configuration file. + .SH FILES + .PP diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch new file mode 100644 index 000000000..9a735bff6 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch @@ -0,0 +1,250 @@ +Upstream-Status: Backport + +diff -ruNp tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3 +--- tcp_wrappers_7.6.orig/hosts_access.3 2005-03-09 18:30:25.000000000 +0100 ++++ tcp_wrappers_7.6/hosts_access.3 2005-03-09 18:27:03.000000000 +0100 +@@ -3,7 +3,7 @@ + hosts_access, hosts_ctl, request_init, request_set \- access control library + .SH SYNOPSIS + .nf +-#include "tcpd.h" ++#include <tcpd.h> + + extern int allow_severity; + extern int deny_severity; +diff -ruNp tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 +--- tcp_wrappers_7.6.orig/hosts_access.5 2005-03-09 18:30:25.000000000 +0100 ++++ tcp_wrappers_7.6/hosts_access.5 2005-03-09 18:30:18.000000000 +0100 +@@ -8,9 +8,9 @@ name, host name/address) patterns. Exam + impatient reader is encouraged to skip to the EXAMPLES section for a + quick introduction. + .PP +-An extended version of the access control language is described in the +-\fIhosts_options\fR(5) document. The extensions are turned on at +-program build time by building with -DPROCESS_OPTIONS. ++The extended version of the access control language is described in the ++\fIhosts_options\fR(5) document. \fBNote that this language supersedes ++the meaning of \fIshell_command\fB as documented below.\fR + .PP + In the following text, \fIdaemon\fR is the the process name of a + network daemon process, and \fIclient\fR is the name and/or address of +@@ -346,8 +346,8 @@ in.tftpd: LOCAL, .my.domain + /etc/hosts.deny: + .in +3 + .nf +-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\ +- /usr/ucb/mail -s %d-%h root) & ++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\ ++ /usr/bin/mail -s %d-%h root) & + .fi + .PP + The safe_finger command comes with the tcpd wrapper and should be +@@ -383,6 +383,7 @@ that shouldn\'t. All problems are repor + .fi + .SH SEE ALSO + .nf ++hosts_options(5) extended syntax. + tcpd(8) tcp/ip daemon wrapper program. + tcpdchk(8), tcpdmatch(8), test programs. + .SH BUGS +diff -ruNp tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5 +--- tcp_wrappers_7.6.orig/hosts_options.5 2005-03-09 18:30:24.000000000 +0100 ++++ tcp_wrappers_7.6/hosts_options.5 2005-03-09 18:27:03.000000000 +0100 +@@ -2,10 +2,8 @@ + .SH NAME + hosts_options \- host access control language extensions + .SH DESCRIPTION +-This document describes optional extensions to the language described +-in the hosts_access(5) document. The extensions are enabled at program +-build time. For example, by editing the Makefile and turning on the +-PROCESS_OPTIONS compile-time option. ++This document describes extensions to the language described ++in the hosts_access(5) document. + .PP + The extensible language uses the following format: + .sp +@@ -58,12 +56,12 @@ Notice the leading dot on the domain nam + Execute, in a child process, the specified shell command, after + performing the %<letter> expansions described in the hosts_access(5) + manual page. The command is executed with stdin, stdout and stderr +-connected to the null device, so that it won\'t mess up the ++connected to the null device, so that it won't mess up the + conversation with the client host. Example: + .sp + .nf + .ti +3 +-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) & ++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) & + .fi + .sp + executes, in a background child process, the shell command "safe_finger +diff -ruNp tcp_wrappers_7.6.orig/inetcf.c tcp_wrappers_7.6/inetcf.c +--- tcp_wrappers_7.6.orig/inetcf.c 1997-02-12 02:13:24.000000000 +0100 ++++ tcp_wrappers_7.6/inetcf.c 2005-03-09 18:27:03.000000000 +0100 +@@ -26,13 +26,17 @@ extern void exit(); + * guesses. Shorter names follow longer ones. + */ + char *inet_files[] = { ++#if 0 + "/private/etc/inetd.conf", /* NEXT */ + "/etc/inet/inetd.conf", /* SYSV4 */ + "/usr/etc/inetd.conf", /* IRIX?? */ ++#endif + "/etc/inetd.conf", /* BSD */ ++#if 0 + "/etc/net/tlid.conf", /* SYSV4?? */ + "/etc/saf/tlid.conf", /* SYSV4?? */ + "/etc/tlid.conf", /* SYSV4?? */ ++#endif + 0, + }; + +diff -ruNp tcp_wrappers_7.6.orig/tcpd.8 tcp_wrappers_7.6/tcpd.8 +--- tcp_wrappers_7.6.orig/tcpd.8 1996-02-21 16:39:16.000000000 +0100 ++++ tcp_wrappers_7.6/tcpd.8 2005-03-09 18:27:03.000000000 +0100 +@@ -12,7 +12,11 @@ The program supports both 4.3BSD-style s + TLI. Functionality may be limited when the protocol underneath TLI is + not an internet protocol. + .PP +-Operation is as follows: whenever a request for service arrives, the ++There are two possible modes of operation: execution of \fItcpd\fP ++before a service started by \fIinetd\fP, or linking a daemon with ++the \fIlibwrap\fP shared library as documented in the \fIhosts_access\fR(3) ++manual page. Operation when started by \fIinetd\fP ++is as follows: whenever a request for service arrives, the + \fIinetd\fP daemon is tricked into running the \fItcpd\fP program + instead of the desired server. \fItcpd\fP logs the request and does + some additional checks. When all is well, \fItcpd\fP runs the +@@ -88,11 +92,11 @@ configuration files. + .sp + .in +5 + # mkdir /other/place +-# mv /usr/etc/in.fingerd /other/place +-# cp tcpd /usr/etc/in.fingerd ++# mv /usr/sbin/in.fingerd /other/place ++# cp tcpd /usr/sbin/in.fingerd + .fi + .PP +-The example assumes that the network daemons live in /usr/etc. On some ++The example assumes that the network daemons live in /usr/sbin. On some + systems, network daemons live in /usr/sbin or in /usr/libexec, or have + no `in.\' prefix to their name. + .SH EXAMPLE 2 +@@ -101,35 +105,34 @@ are left in their original place. + .PP + In order to monitor access to the \fIfinger\fR service, perform the + following edits on the \fIinetd\fR configuration file (usually +-\fI/etc/inetd.conf\fR or \fI/etc/inet/inetd.conf\fR): ++\fI/etc/inetd.conf\fR): + .nf + .sp + .ti +5 +-finger stream tcp nowait nobody /usr/etc/in.fingerd in.fingerd ++finger stream tcp nowait nobody /usr/sbin/in.fingerd in.fingerd + .sp + becomes: + .sp + .ti +5 +-finger stream tcp nowait nobody /some/where/tcpd in.fingerd ++finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd + .sp + .fi + .PP +-The example assumes that the network daemons live in /usr/etc. On some ++The example assumes that the network daemons live in /usr/sbin. On some + systems, network daemons live in /usr/sbin or in /usr/libexec, the + daemons have no `in.\' prefix to their name, or there is no userid + field in the inetd configuration file. + .PP + Similar changes will be needed for the other services that are to be + covered by \fItcpd\fR. Send a `kill -HUP\' to the \fIinetd\fR(8) +-process to make the changes effective. AIX users may also have to +-execute the `inetimp\' command. ++process to make the changes effective. + .SH EXAMPLE 3 + In the case of daemons that do not live in a common directory ("secret" + or otherwise), edit the \fIinetd\fR configuration file so that it + specifies an absolute path name for the process name field. For example: + .nf + .sp +- ntalk dgram udp wait root /some/where/tcpd /usr/local/lib/ntalkd ++ ntalk dgram udp wait root /usr/sbin/tcpd /usr/local/lib/ntalkd + .sp + .fi + .PP +@@ -164,6 +167,7 @@ The default locations of the host access + .SH SEE ALSO + .na + .nf ++hosts_access(3), functions provided by the libwrap library. + hosts_access(5), format of the tcpd access control tables. + syslog.conf(5), format of the syslogd control file. + inetd.conf(5), format of the inetd control file. +diff -ruNp tcp_wrappers_7.6.orig/tcpdchk.8 tcp_wrappers_7.6/tcpdchk.8 +--- tcp_wrappers_7.6.orig/tcpdchk.8 1995-01-08 17:00:31.000000000 +0100 ++++ tcp_wrappers_7.6/tcpdchk.8 2005-03-09 18:27:03.000000000 +0100 +@@ -9,8 +9,8 @@ tcpdchk [-a] [-d] [-i inet_conf] [-v] + potential and real problems it can find. The program examines the + \fItcpd\fR access control files (by default, these are + \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR), and compares the +-entries in these files against entries in the \fIinetd\fR or \fItlid\fR +-network configuration files. ++entries in these files against entries in the \fIinetd\fR ++network configuration file. + .PP + \fItcpdchk\fR reports problems such as non-existent pathnames; services + that appear in \fItcpd\fR access control rules, but are not controlled +@@ -26,14 +26,13 @@ problem. + .SH OPTIONS + .IP -a + Report access control rules that permit access without an explicit +-ALLOW keyword. This applies only when the extended access control +-language is enabled (build with -DPROCESS_OPTIONS). ++ALLOW keyword. + .IP -d + Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current + directory instead of the default ones. + .IP "-i inet_conf" + Specify this option when \fItcpdchk\fR is unable to find your +-\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when ++\fIinetd.conf\fR network configuration file, or when + you suspect that the program uses the wrong one. + .IP -v + Display the contents of each access control rule. Daemon lists, client +@@ -54,7 +53,6 @@ tcpdmatch(8), explain what tcpd would do + hosts_access(5), format of the tcpd access control tables. + hosts_options(5), format of the language extensions. + inetd.conf(5), format of the inetd control file. +-tlid.conf(5), format of the tlid control file. + .SH AUTHORS + .na + .nf +diff -ruNp tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8 +--- tcp_wrappers_7.6.orig/tcpdmatch.8 2005-03-09 18:30:24.000000000 +0100 ++++ tcp_wrappers_7.6/tcpdmatch.8 2005-03-09 18:27:03.000000000 +0100 +@@ -13,7 +13,7 @@ request for service. Examples are given + The program examines the \fItcpd\fR access control tables (default + \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR) and prints its + conclusion. For maximal accuracy, it extracts additional information +-from your \fIinetd\fR or \fItlid\fR network configuration file. ++from your \fIinetd\fR network configuration file. + .PP + When \fItcpdmatch\fR finds a match in the access control tables, it + identifies the matched rule. In addition, it displays the optional +@@ -50,7 +50,7 @@ Examine \fIhosts.allow\fR and \fIhosts.d + directory instead of the default ones. + .IP "-i inet_conf" + Specify this option when \fItcpdmatch\fR is unable to find your +-\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when ++\fIinetd.conf\fR network configuration file, or when + you suspect that the program uses the wrong one. + .SH EXAMPLES + To predict how \fItcpd\fR would handle a telnet request from the local +@@ -86,7 +86,6 @@ tcpdchk(8), tcpd configuration checker + hosts_access(5), format of the tcpd access control tables. + hosts_options(5), format of the language extensions. + inetd.conf(5), format of the inetd control file. +-tlid.conf(5), format of the tlid control file. + .SH AUTHORS + .na + .nf diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch new file mode 100644 index 000000000..9e188027f --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch @@ -0,0 +1,105 @@ +Upstream-Status: Backport + +See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=17847 + +diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 +--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 18:54:33.000000000 +0200 ++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 18:54:27.000000000 +0200 +@@ -89,6 +89,10 @@ + bitwise AND of the address and the `mask\'. For example, the net/mask + pattern `131.155.72.0/255.255.254.0\' matches every address in the + range `131.155.72.0\' through `131.155.73.255\'. ++.IP \(bu ++Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This ++method of matching cannot be used in conjunction with `net/mask\' matching, ++hostname matching beginning with `.\' or IP address matching ending with `.\'. + .SH WILDCARDS + The access control language supports explicit wildcards: + .IP ALL +diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c +--- tcp_wrappers_7.6.orig/hosts_access.c 1997-02-12 02:13:23.000000000 +0100 ++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 18:52:21.000000000 +0200 +@@ -289,6 +289,11 @@ + { + int n; + ++#ifndef DISABLE_WILDCARD_MATCHING ++ if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */ ++ return (match_pattern_ylo(string,tok)); ++ } else ++#endif + if (tok[0] == '.') { /* suffix */ + n = strlen(string) - strlen(tok); + return (n > 0 && STR_EQ(tok, string + n)); +@@ -329,3 +334,71 @@ + } + return ((addr & mask) == net); + } ++ ++#ifndef DISABLE_WILDCARD_MATCHING ++/* Note: this feature has been adapted in a pretty straightforward way ++ from Tatu Ylonen's last SSH version under free license by ++ Pekka Savola <pekkas@netcore.fi>. ++ ++ Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland ++*/ ++ ++/* Returns true if the given string matches the pattern (which may contain ++ ? and * as wildcards), and zero if it does not match. */ ++ ++int match_pattern_ylo(const char *s, const char *pattern) ++{ ++ while (1) ++ { ++ /* If at end of pattern, accept if also at end of string. */ ++ if (!*pattern) ++ return !*s; ++ ++ /* Process '*'. */ ++ if (*pattern == '*') ++ { ++ /* Skip the asterisk. */ ++ pattern++; ++ ++ /* If at end of pattern, accept immediately. */ ++ if (!*pattern) ++ return 1; ++ ++ /* If next character in pattern is known, optimize. */ ++ if (*pattern != '?' && *pattern != '*') ++ { ++ /* Look instances of the next character in pattern, and try ++ to match starting from those. */ ++ for (; *s; s++) ++ if (*s == *pattern && ++ match_pattern_ylo(s + 1, pattern + 1)) ++ return 1; ++ /* Failed. */ ++ return 0; ++ } ++ ++ /* Move ahead one character at a time and try to match at each ++ position. */ ++ for (; *s; s++) ++ if (match_pattern_ylo(s, pattern)) ++ return 1; ++ /* Failed. */ ++ return 0; ++ } ++ ++ /* There must be at least one more character in the string. If we are ++ at the end, fail. */ ++ if (!*s) ++ return 0; ++ ++ /* Check if the next character of the string is acceptable. */ ++ if (*pattern != '?' && *pattern != *s) ++ return 0; ++ ++ /* Move to the next character, both in string and in pattern. */ ++ s++; ++ pattern++; ++ } ++ /*NOTREACHED*/ ++} ++#endif /* DISABLE_WILDCARD_MATCHING */ diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch new file mode 100644 index 000000000..725f4b595 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch @@ -0,0 +1,32 @@ +Upstream-Status: Backport + +* Mon Feb 5 2001 Preston Brown <pbrown@redhat.com> +- fix gethostbyname to work better with dot "." notation (#16949) + +--- tcp_wrappers_7.6/socket.c.fixgethostbyname Fri Mar 21 13:27:25 1997 ++++ tcp_wrappers_7.6/socket.c Mon Feb 5 14:09:40 2001 +@@ -52,7 +52,8 @@ + char *name; + { + char dot_name[MAXHOSTNAMELEN + 1]; +- ++ struct hostent *hp; ++ + /* + * Don't append dots to unqualified names. Such names are likely to come + * from local hosts files or from NIS. +@@ -61,8 +62,12 @@ + if (strchr(name, '.') == 0 || strlen(name) >= MAXHOSTNAMELEN - 1) { + return (gethostbyname(name)); + } else { +- sprintf(dot_name, "%s.", name); +- return (gethostbyname(dot_name)); ++ sprintf(dot_name, "%s.", name); ++ hp = gethostbyname(dot_name); ++ if (hp) ++ return hp; ++ else ++ return (gethostbyname(name)); + } + } + diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch new file mode 100644 index 000000000..96d47c39f --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch @@ -0,0 +1,1255 @@ +Upstream-Status: Backport + +diff -ruN tcp_wrappers_7.6.orig/fix_options.c tcp_wrappers_7.6/fix_options.c +--- tcp_wrappers_7.6.orig/fix_options.c 1997-04-08 02:29:19.000000000 +0200 ++++ tcp_wrappers_7.6/fix_options.c 2004-04-10 19:07:43.000000000 +0200 +@@ -11,6 +11,9 @@ + + #include <sys/types.h> + #include <sys/param.h> ++#ifdef INET6 ++#include <sys/socket.h> ++#endif + #include <netinet/in.h> + #include <netinet/in_systm.h> + #include <netinet/ip.h> +@@ -41,6 +44,22 @@ + unsigned int opt; + int optlen; + struct in_addr dummy; ++#ifdef INET6 ++ struct sockaddr_storage ss; ++ int sslen; ++ ++ /* ++ * check if this is AF_INET socket ++ * XXX IPv6 support? ++ */ ++ sslen = sizeof(ss); ++ if (getsockname(fd, (struct sockaddr *)&ss, &sslen) < 0) { ++ syslog(LOG_ERR, "getpeername: %m"); ++ clean_exit(request); ++ } ++ if (ss.ss_family != AF_INET) ++ return; ++#endif + + if ((ip = getprotobyname("ip")) != 0) + ipproto = ip->p_proto; +diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 +--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 19:22:58.000000000 +0200 ++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 19:07:43.000000000 +0200 +@@ -85,11 +85,18 @@ + for daemon process names or for client user names. + .IP \(bu + An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a +-`net/mask\' pair. A host address is matched if `net\' is equal to the ++`net/mask\' pair. An IPv4 host address is matched if `net\' is equal to the + bitwise AND of the address and the `mask\'. For example, the net/mask + pattern `131.155.72.0/255.255.254.0\' matches every address in the + range `131.155.72.0\' through `131.155.73.255\'. + .IP \(bu ++An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a ++`[net]/prefixlen\' pair. An IPv6 host address is matched if ++`prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the ++address. For example, the [net]/prefixlen pattern ++`[3ffe:505:2:1::]/64\' matches every address in the range ++`3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'. ++.IP \(bu + Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This + method of matching cannot be used in conjunction with `net/mask\' matching, + hostname matching beginning with `.\' or IP address matching ending with `.\'. +diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c +--- tcp_wrappers_7.6.orig/hosts_access.c 2004-04-10 19:22:58.000000000 +0200 ++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 19:07:43.000000000 +0200 +@@ -24,7 +24,13 @@ + /* System libraries. */ + + #include <sys/types.h> ++#ifdef INT32_T ++ typedef uint32_t u_int32_t; ++#endif + #include <sys/param.h> ++#ifdef INET6 ++#include <sys/socket.h> ++#endif + #include <netinet/in.h> + #include <arpa/inet.h> + #include <stdio.h> +@@ -33,6 +39,9 @@ + #include <errno.h> + #include <setjmp.h> + #include <string.h> ++#ifdef INET6 ++#include <netdb.h> ++#endif + + extern char *fgets(); + extern int errno; +@@ -82,6 +91,10 @@ + static int host_match(); + static int string_match(); + static int masked_match(); ++#ifdef INET6 ++static int masked_match4(); ++static int masked_match6(); ++#endif + + /* Size of logical line buffer. */ + +@@ -289,6 +302,13 @@ + { + int n; + ++#ifdef INET6 ++ /* convert IPv4 mapped IPv6 address to IPv4 address */ ++ if (STRN_EQ(string, "::ffff:", 7) ++ && dot_quad_addr(string + 7) != INADDR_NONE) { ++ string += 7; ++ } ++#endif + #ifndef DISABLE_WILDCARD_MATCHING + if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */ + return (match_pattern_ylo(string,tok)); +@@ -304,20 +324,72 @@ + } else if (tok[(n = strlen(tok)) - 1] == '.') { /* prefix */ + return (STRN_EQ(tok, string, n)); + } else { /* exact match */ ++#ifdef INET6 ++ struct addrinfo hints, *res; ++ struct sockaddr_in6 pat, addr; ++ int len, ret; ++ char ch; ++ ++ len = strlen(tok); ++ if (*tok == '[' && tok[len - 1] == ']') { ++ ch = tok[len - 1]; ++ tok[len - 1] = '\0'; ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = AF_INET6; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; ++ if ((ret = getaddrinfo(tok + 1, NULL, &hints, &res)) == 0) { ++ memcpy(&pat, res->ai_addr, sizeof(pat)); ++ freeaddrinfo(res); ++ } ++ tok[len - 1] = ch; ++ if (ret != 0 || getaddrinfo(string, NULL, &hints, &res) != 0) ++ return NO; ++ memcpy(&addr, res->ai_addr, sizeof(addr)); ++ freeaddrinfo(res); ++#ifdef NI_WITHSCOPEID ++ if (pat.sin6_scope_id != 0 && ++ addr.sin6_scope_id != pat.sin6_scope_id) ++ return NO; ++#endif ++ return (!memcmp(&pat.sin6_addr, &addr.sin6_addr, ++ sizeof(struct in6_addr))); ++ return (ret); ++ } ++#endif + return (STR_EQ(tok, string)); + } + } + + /* masked_match - match address against netnumber/netmask */ + ++#ifdef INET6 + static int masked_match(net_tok, mask_tok, string) + char *net_tok; + char *mask_tok; + char *string; + { ++ return (masked_match4(net_tok, mask_tok, string) || ++ masked_match6(net_tok, mask_tok, string)); ++} ++ ++static int masked_match4(net_tok, mask_tok, string) ++#else ++static int masked_match(net_tok, mask_tok, string) ++#endif ++char *net_tok; ++char *mask_tok; ++char *string; ++{ ++#ifdef INET6 ++ u_int32_t net; ++ u_int32_t mask; ++ u_int32_t addr; ++#else + unsigned long net; + unsigned long mask; + unsigned long addr; ++#endif + + /* + * Disallow forms other than dotted quad: the treatment that inet_addr() +@@ -329,12 +401,78 @@ + return (NO); + if ((net = dot_quad_addr(net_tok)) == INADDR_NONE + || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) { ++#ifndef INET6 + tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok); ++#endif + return (NO); /* not tcpd_jump() */ + } + return ((addr & mask) == net); + } + ++#ifdef INET6 ++static int masked_match6(net_tok, mask_tok, string) ++char *net_tok; ++char *mask_tok; ++char *string; ++{ ++ struct addrinfo hints, *res; ++ struct sockaddr_in6 net, addr; ++ u_int32_t mask; ++ int len, mask_len, i = 0; ++ char ch; ++ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = AF_INET6; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; ++ if (getaddrinfo(string, NULL, &hints, &res) != 0) ++ return NO; ++ memcpy(&addr, res->ai_addr, sizeof(addr)); ++ freeaddrinfo(res); ++ ++ if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) { ++ if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE ++ || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) ++ return (NO); ++ return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]); ++ } ++ ++ /* match IPv6 address against netnumber/prefixlen */ ++ len = strlen(net_tok); ++ if (*net_tok != '[' || net_tok[len - 1] != ']') ++ return NO; ++ ch = net_tok[len - 1]; ++ net_tok[len - 1] = '\0'; ++ if (getaddrinfo(net_tok + 1, NULL, &hints, &res) != 0) { ++ net_tok[len - 1] = ch; ++ return NO; ++ } ++ memcpy(&net, res->ai_addr, sizeof(net)); ++ freeaddrinfo(res); ++ net_tok[len - 1] = ch; ++ if ((mask_len = atoi(mask_tok)) < 0 || mask_len > 128) ++ return NO; ++ ++#ifdef NI_WITHSCOPEID ++ if (net.sin6_scope_id != 0 && addr.sin6_scope_id != net.sin6_scope_id) ++ return NO; ++#endif ++ while (mask_len > 0) { ++ if (mask_len < 32) { ++ mask = htonl(~(0xffffffff >> mask_len)); ++ if ((*(u_int32_t *)&addr.sin6_addr.s6_addr[i] & mask) != (*(u_int32_t *)&net.sin6_addr.s6_addr[i] & mask)) ++ return NO; ++ break; ++ } ++ if (*(u_int32_t *)&addr.sin6_addr.s6_addr[i] != *(u_int32_t *)&net.sin6_addr.s6_addr[i]) ++ return NO; ++ i += 4; ++ mask_len -= 32; ++ } ++ return YES; ++} ++#endif /* INET6 */ ++ + #ifndef DISABLE_WILDCARD_MATCHING + /* Note: this feature has been adapted in a pretty straightforward way + from Tatu Ylonen's last SSH version under free license by +diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile +--- tcp_wrappers_7.6.orig/Makefile 1997-03-21 19:27:21.000000000 +0100 ++++ tcp_wrappers_7.6/Makefile 2004-04-10 19:22:44.000000000 +0200 +@@ -21,7 +21,7 @@ + @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix" + @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211" + @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4" +- @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2" ++ @echo " sunos40 sunos5 solaris8 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2" + @echo " uts215 uxp" + @echo + @echo "If none of these match your environment, edit the system" +@@ -131,20 +131,34 @@ + NETGROUP=-DNETGROUP TLI= SYSTYPE="-systype bsd43" all + + # Freebsd and linux by default have no NIS. +-386bsd netbsd bsdos: ++386bsd bsdos: + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ + LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \ + EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all + + freebsd: + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ ++ LIBS="-L/usr/local/v6/lib -linet6" \ + LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \ +- EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all ++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" \ ++ VSYSLOG= all ++ ++netbsd: ++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ ++ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \ ++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" VSYSLOG= all + + linux: + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ +- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \ +- NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all ++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \ ++ NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \ ++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all ++ ++gnu: ++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ ++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \ ++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \ ++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all + + # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x. + hpux hpux8 hpux9 hpux10: +@@ -196,6 +210,13 @@ + NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \ + BUGS="$(BUGS) -DSOLARIS_24_GETHOSTBYNAME_BUG" all + ++# SunOS 5.8 is another SYSV4 variant, but has IPv6 support ++solaris8: ++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ ++ LIBS="-lsocket -lnsl" RANLIB=echo ARFLAGS=rv VSYSLOG= \ ++ NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \ ++ EXTRA_CFLAGS="-DINET6 -DNO_CLONE_DEVICE -DINT32_T" all ++ + # Generic SYSV40 + esix sysv4: + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ +diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c +--- tcp_wrappers_7.6.orig/misc.c 1996-02-11 17:01:30.000000000 +0100 ++++ tcp_wrappers_7.6/misc.c 2004-04-10 19:07:43.000000000 +0200 +@@ -58,9 +58,31 @@ + { + char *cp; + ++#ifdef INET6 ++ int bracket = 0; ++ ++ for (cp = string; cp && *cp; cp++) { ++ switch (*cp) { ++ case '[': ++ bracket++; ++ break; ++ case ']': ++ bracket--; ++ break; ++ default: ++ if (bracket == 0 && *cp == delimiter) { ++ *cp++ = 0; ++ return cp; ++ } ++ break; ++ } ++ } ++ return (NULL); ++#else + if ((cp = strchr(string, delimiter)) != 0) + *cp++ = 0; + return (cp); ++#endif + } + + /* dot_quad_addr - convert dotted quad to internal form */ +diff -ruN tcp_wrappers_7.6.orig/refuse.c tcp_wrappers_7.6/refuse.c +--- tcp_wrappers_7.6.orig/refuse.c 1994-12-28 17:42:40.000000000 +0100 ++++ tcp_wrappers_7.6/refuse.c 2004-04-10 19:07:43.000000000 +0200 +@@ -25,7 +25,12 @@ + void refuse(request) + struct request_info *request; + { ++#ifdef INET6 ++ syslog(deny_severity, "refused connect from %s (%s)", ++ eval_client(request), eval_hostaddr(request->client)); ++#else + syslog(deny_severity, "refused connect from %s", eval_client(request)); ++#endif + clean_exit(request); + /* NOTREACHED */ + } +diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c +--- tcp_wrappers_7.6.orig/rfc931.c 1995-01-02 16:11:34.000000000 +0100 ++++ tcp_wrappers_7.6/rfc931.c 2004-04-10 19:07:43.000000000 +0200 +@@ -68,20 +68,50 @@ + /* rfc931 - return remote user name, given socket structures */ + + void rfc931(rmt_sin, our_sin, dest) ++#ifdef INET6 ++struct sockaddr *rmt_sin; ++struct sockaddr *our_sin; ++#else + struct sockaddr_in *rmt_sin; + struct sockaddr_in *our_sin; ++#endif + char *dest; + { + unsigned rmt_port; + unsigned our_port; ++#ifdef INET6 ++ struct sockaddr_storage rmt_query_sin; ++ struct sockaddr_storage our_query_sin; ++ int alen; ++#else + struct sockaddr_in rmt_query_sin; + struct sockaddr_in our_query_sin; ++#endif + char user[256]; /* XXX */ + char buffer[512]; /* XXX */ + char *cp; + char *result = unknown; + FILE *fp; + ++#ifdef INET6 ++ /* address family must be the same */ ++ if (rmt_sin->sa_family != our_sin->sa_family) { ++ STRN_CPY(dest, result, STRING_LENGTH); ++ return; ++ } ++ switch (our_sin->sa_family) { ++ case AF_INET: ++ alen = sizeof(struct sockaddr_in); ++ break; ++ case AF_INET6: ++ alen = sizeof(struct sockaddr_in6); ++ break; ++ default: ++ STRN_CPY(dest, result, STRING_LENGTH); ++ return; ++ } ++#endif ++ + /* + * Use one unbuffered stdio stream for writing to and for reading from + * the RFC931 etc. server. This is done because of a bug in the SunOS +@@ -92,7 +122,11 @@ + * sockets. + */ + ++#ifdef INET6 ++ if ((fp = fsocket(our_sin->sa_family, SOCK_STREAM, 0)) != 0) { ++#else + if ((fp = fsocket(AF_INET, SOCK_STREAM, 0)) != 0) { ++#endif + setbuf(fp, (char *) 0); + + /* +@@ -112,6 +146,25 @@ + * addresses from the query socket. + */ + ++#ifdef INET6 ++ memcpy(&our_query_sin, our_sin, alen); ++ memcpy(&rmt_query_sin, rmt_sin, alen); ++ switch (our_sin->sa_family) { ++ case AF_INET: ++ ((struct sockaddr_in *)&our_query_sin)->sin_port = htons(ANY_PORT); ++ ((struct sockaddr_in *)&rmt_query_sin)->sin_port = htons(RFC931_PORT); ++ break; ++ case AF_INET6: ++ ((struct sockaddr_in6 *)&our_query_sin)->sin6_port = htons(ANY_PORT); ++ ((struct sockaddr_in6 *)&rmt_query_sin)->sin6_port = htons(RFC931_PORT); ++ break; ++ } ++ ++ if (bind(fileno(fp), (struct sockaddr *) & our_query_sin, ++ alen) >= 0 && ++ connect(fileno(fp), (struct sockaddr *) & rmt_query_sin, ++ alen) >= 0) { ++#else + our_query_sin = *our_sin; + our_query_sin.sin_port = htons(ANY_PORT); + rmt_query_sin = *rmt_sin; +@@ -121,6 +174,7 @@ + sizeof(our_query_sin)) >= 0 && + connect(fileno(fp), (struct sockaddr *) & rmt_query_sin, + sizeof(rmt_query_sin)) >= 0) { ++#endif + + /* + * Send query to server. Neglect the risk that a 13-byte +@@ -129,8 +183,13 @@ + */ + + fprintf(fp, "%u,%u\r\n", ++#ifdef INET6 ++ ntohs(((struct sockaddr_in *)rmt_sin)->sin_port), ++ ntohs(((struct sockaddr_in *)our_sin)->sin_port)); ++#else + ntohs(rmt_sin->sin_port), + ntohs(our_sin->sin_port)); ++#endif + fflush(fp); + + /* +@@ -144,8 +203,13 @@ + && ferror(fp) == 0 && feof(fp) == 0 + && sscanf(buffer, "%u , %u : USERID :%*[^:]:%255s", + &rmt_port, &our_port, user) == 3 ++#ifdef INET6 ++ && ntohs(((struct sockaddr_in *)rmt_sin)->sin_port) == rmt_port ++ && ntohs(((struct sockaddr_in *)our_sin)->sin_port) == our_port) { ++#else + && ntohs(rmt_sin->sin_port) == rmt_port + && ntohs(our_sin->sin_port) == our_port) { ++#endif + + /* + * Strip trailing carriage return. It is part of the +diff -ruN tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c +--- tcp_wrappers_7.6.orig/scaffold.c 1997-03-21 19:27:24.000000000 +0100 ++++ tcp_wrappers_7.6/scaffold.c 2004-04-10 19:07:43.000000000 +0200 +@@ -25,7 +25,9 @@ + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ + #endif + ++#ifndef INET6 + extern char *malloc(); ++#endif + + /* Application-specific. */ + +@@ -39,6 +41,7 @@ + int deny_severity = LOG_WARNING; + int rfc931_timeout = RFC931_TIMEOUT; + ++#ifndef INET6 + /* dup_hostent - create hostent in one memory block */ + + static struct hostent *dup_hostent(hp) +@@ -73,9 +76,46 @@ + } + return (&hb->host); + } ++#endif + + /* find_inet_addr - find all addresses for this host, result to free() */ + ++#ifdef INET6 ++struct addrinfo *find_inet_addr(host) ++char *host; ++{ ++ struct addrinfo hints, *res; ++ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = PF_UNSPEC; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; ++ if (getaddrinfo(host, NULL, &hints, &res) == 0) ++ return (res); ++ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = PF_UNSPEC; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME; ++ if (getaddrinfo(host, NULL, &hints, &res) != 0) { ++ tcpd_warn("%s: host not found", host); ++ return (0); ++ } ++ if (res->ai_family != AF_INET6 && res->ai_family != AF_INET) { ++ tcpd_warn("%d: not an internet host", res->ai_family); ++ freeaddrinfo(res); ++ return (0); ++ } ++ if (!res->ai_canonname) { ++ tcpd_warn("%s: hostname alias", host); ++ tcpd_warn("(cannot obtain official name)", res->ai_canonname); ++ } else if (STR_NE(host, res->ai_canonname)) { ++ tcpd_warn("%s: hostname alias", host); ++ tcpd_warn("(official name: %.*s)", STRING_LENGTH, res->ai_canonname); ++ } ++ return (res); ++} ++#else + struct hostent *find_inet_addr(host) + char *host; + { +@@ -118,6 +158,7 @@ + } + return (dup_hostent(hp)); + } ++#endif + + /* check_dns - give each address thorough workout, return address count */ + +@@ -125,8 +166,13 @@ + char *host; + { + struct request_info request; ++#ifdef INET6 ++ struct sockaddr_storage sin; ++ struct addrinfo *hp, *res; ++#else + struct sockaddr_in sin; + struct hostent *hp; ++#endif + int count; + char *addr; + +@@ -134,11 +180,18 @@ + return (0); + request_init(&request, RQ_CLIENT_SIN, &sin, 0); + sock_methods(&request); ++#ifndef INET6 + memset((char *) &sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; ++#endif + ++#ifdef INET6 ++ for (res = hp, count = 0; res; res = res->ai_next, count++) { ++ memcpy(&sin, res->ai_addr, res->ai_addrlen); ++#else + for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) { + memcpy((char *) &sin.sin_addr, addr, sizeof(sin.sin_addr)); ++#endif + + /* + * Force host name and address conversions. Use the request structure +@@ -151,7 +204,11 @@ + tcpd_warn("host address %s->name lookup failed", + eval_hostaddr(request.client)); + } ++#ifdef INET6 ++ freeaddrinfo(hp); ++#else + free((char *) hp); ++#endif + return (count); + } + +diff -ruN tcp_wrappers_7.6.orig/scaffold.h tcp_wrappers_7.6/scaffold.h +--- tcp_wrappers_7.6.orig/scaffold.h 1994-12-31 18:19:20.000000000 +0100 ++++ tcp_wrappers_7.6/scaffold.h 2004-04-10 19:07:43.000000000 +0200 +@@ -4,6 +4,10 @@ + * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. + */ + ++#ifdef INET6 ++extern struct addrinfo *find_inet_addr(); ++#else + extern struct hostent *find_inet_addr(); ++#endif + extern int check_dns(); + extern int check_path(); +diff -ruN tcp_wrappers_7.6.orig/socket.c tcp_wrappers_7.6/socket.c +--- tcp_wrappers_7.6.orig/socket.c 2004-04-10 19:22:58.000000000 +0200 ++++ tcp_wrappers_7.6/socket.c 2004-04-10 19:07:43.000000000 +0200 +@@ -24,13 +24,22 @@ + #include <sys/types.h> + #include <sys/param.h> + #include <sys/socket.h> ++#ifdef INT32_T ++typedef uint32_t u_int32_t; ++#endif + #include <netinet/in.h> + #include <netdb.h> + #include <stdio.h> + #include <syslog.h> + #include <string.h> + ++#ifdef INET6 ++#ifndef NI_WITHSCOPEID ++#define NI_WITHSCOPEID 0 ++#endif ++#else + extern char *inet_ntoa(); ++#endif + + /* Local stuff. */ + +@@ -79,8 +88,13 @@ + void sock_host(request) + struct request_info *request; + { ++#ifdef INET6 ++ static struct sockaddr_storage client; ++ static struct sockaddr_storage server; ++#else + static struct sockaddr_in client; + static struct sockaddr_in server; ++#endif + int len; + char buf[BUFSIZ]; + int fd = request->fd; +@@ -109,7 +123,11 @@ + memset(buf, 0 sizeof(buf)); + #endif + } ++#ifdef INET6 ++ request->client->sin = (struct sockaddr *)&client; ++#else + request->client->sin = &client; ++#endif + + /* + * Determine the server binding. This is used for client username +@@ -122,7 +140,11 @@ + tcpd_warn("getsockname: %m"); + return; + } ++#ifdef INET6 ++ request->server->sin = (struct sockaddr *)&server; ++#else + request->server->sin = &server; ++#endif + } + + /* sock_hostaddr - map endpoint address to printable form */ +@@ -130,10 +152,26 @@ + void sock_hostaddr(host) + struct host_info *host; + { ++#ifdef INET6 ++ struct sockaddr *sin = host->sin; ++ int salen; ++ ++ if (!sin) ++ return; ++#ifdef SIN6_LEN ++ salen = sin->sa_len; ++#else ++ salen = (sin->sa_family == AF_INET) ? sizeof(struct sockaddr_in) ++ : sizeof(struct sockaddr_in6); ++#endif ++ getnameinfo(sin, salen, host->addr, sizeof(host->addr), ++ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID); ++#else + struct sockaddr_in *sin = host->sin; + + if (sin != 0) + STRN_CPY(host->addr, inet_ntoa(sin->sin_addr), sizeof(host->addr)); ++#endif + } + + /* sock_hostname - map endpoint address to host name */ +@@ -141,6 +179,160 @@ + void sock_hostname(host) + struct host_info *host; + { ++#ifdef INET6 ++ struct sockaddr *sin = host->sin; ++ struct sockaddr_in sin4; ++ struct addrinfo hints, *res, *res0 = NULL; ++ int salen, alen, err = 1; ++ char *ap = NULL, *rap, hname[NI_MAXHOST]; ++ ++ if (sin != NULL) { ++ if (sin->sa_family == AF_INET6) { ++ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sin; ++ ++ if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { ++ memset(&sin4, 0, sizeof(sin4)); ++#ifdef SIN6_LEN ++ sin4.sin_len = sizeof(sin4); ++#endif ++ sin4.sin_family = AF_INET; ++ sin4.sin_port = sin6->sin6_port; ++ sin4.sin_addr.s_addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12]; ++ sin = (struct sockaddr *)&sin4; ++ } ++ } ++ switch (sin->sa_family) { ++ case AF_INET: ++ ap = (char *)&((struct sockaddr_in *)sin)->sin_addr; ++ alen = sizeof(struct in_addr); ++ salen = sizeof(struct sockaddr_in); ++ break; ++ case AF_INET6: ++ ap = (char *)&((struct sockaddr_in6 *)sin)->sin6_addr; ++ alen = sizeof(struct in6_addr); ++ salen = sizeof(struct sockaddr_in6); ++ break; ++ default: ++ break; ++ } ++ if (ap) ++ err = getnameinfo(sin, salen, hname, sizeof(hname), ++ NULL, 0, NI_WITHSCOPEID | NI_NAMEREQD); ++ } ++ if (!err) { ++ ++ STRN_CPY(host->name, hname, sizeof(host->name)); ++ ++ /* reject numeric addresses */ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = sin->sa_family; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST; ++ if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) { ++ freeaddrinfo(res0); ++ res0 = NULL; ++ tcpd_warn("host name/name mismatch: " ++ "reverse lookup results in non-FQDN %s", ++ host->name); ++ strcpy(host->name, paranoid); /* name is bad, clobber it */ ++ } ++ err = !err; ++ } ++ if (!err) { ++ /* we are now sure that this is non-numeric */ ++ ++ /* ++ * Verify that the address is a member of the address list returned ++ * by gethostbyname(hostname). ++ * ++ * Verify also that gethostbyaddr() and gethostbyname() return the same ++ * hostname, or rshd and rlogind may still end up being spoofed. ++ * ++ * On some sites, gethostbyname("localhost") returns "localhost.domain". ++ * This is a DNS artefact. We treat it as a special case. When we ++ * can't believe the address list from gethostbyname("localhost") ++ * we're in big trouble anyway. ++ */ ++ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = sin->sa_family; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME; ++ if (getaddrinfo(host->name, NULL, &hints, &res0) != 0) { ++ ++ /* ++ * Unable to verify that the host name matches the address. This ++ * may be a transient problem or a botched name server setup. ++ */ ++ ++ tcpd_warn("can't verify hostname: getaddrinfo(%s, %s) failed", ++ host->name, ++ (sin->sa_family == AF_INET) ? "AF_INET" : "AF_INET6"); ++ ++ } else if ((res0->ai_canonname == NULL ++ || STR_NE(host->name, res0->ai_canonname)) ++ && STR_NE(host->name, "localhost")) { ++ ++ /* ++ * The gethostbyaddr() and gethostbyname() calls did not return ++ * the same hostname. This could be a nameserver configuration ++ * problem. It could also be that someone is trying to spoof us. ++ */ ++ ++ tcpd_warn("host name/name mismatch: %s != %.*s", ++ host->name, STRING_LENGTH, ++ (res0->ai_canonname == NULL) ? "" : res0->ai_canonname); ++ ++ } else { ++ ++ /* ++ * The address should be a member of the address list returned by ++ * gethostbyname(). We should first verify that the h_addrtype ++ * field is AF_INET, but this program has already caused too much ++ * grief on systems with broken library code. ++ */ ++ ++ for (res = res0; res; res = res->ai_next) { ++ if (res->ai_family != sin->sa_family) ++ continue; ++ switch (res->ai_family) { ++ case AF_INET: ++ rap = (char *)&((struct sockaddr_in *)res->ai_addr)->sin_addr; ++ break; ++ case AF_INET6: ++ /* need to check scope_id */ ++ if (((struct sockaddr_in6 *)sin)->sin6_scope_id != ++ ((struct sockaddr_in6 *)res->ai_addr)->sin6_scope_id) { ++ continue; ++ } ++ rap = (char *)&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr; ++ break; ++ default: ++ continue; ++ } ++ if (memcmp(rap, ap, alen) == 0) { ++ freeaddrinfo(res0); ++ return; /* name is good, keep it */ ++ } ++ } ++ ++ /* ++ * The host name does not map to the initial address. Perhaps ++ * someone has messed up. Perhaps someone compromised a name ++ * server. ++ */ ++ ++ getnameinfo(sin, salen, hname, sizeof(hname), ++ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID); ++ tcpd_warn("host name/address mismatch: %s != %.*s", ++ hname, STRING_LENGTH, ++ (res0->ai_canonname == NULL) ? "" : res0->ai_canonname); ++ } ++ strcpy(host->name, paranoid); /* name is bad, clobber it */ ++ if (res0) ++ freeaddrinfo(res0); ++ } ++#else /* INET6 */ + struct sockaddr_in *sin = host->sin; + struct hostent *hp; + int i; +@@ -220,6 +412,7 @@ + } + strcpy(host->name, paranoid); /* name is bad, clobber it */ + } ++#endif /* INET6 */ + } + + /* sock_sink - absorb unreceived IP datagram */ +@@ -228,7 +421,11 @@ + int fd; + { + char buf[BUFSIZ]; ++#ifdef INET6 ++ struct sockaddr_storage sin; ++#else + struct sockaddr_in sin; ++#endif + int size = sizeof(sin); + + /* +diff -ruN tcp_wrappers_7.6.orig/tcpd.c tcp_wrappers_7.6/tcpd.c +--- tcp_wrappers_7.6.orig/tcpd.c 1996-02-11 17:01:33.000000000 +0100 ++++ tcp_wrappers_7.6/tcpd.c 2004-04-10 19:07:43.000000000 +0200 +@@ -120,7 +120,12 @@ + + /* Report request and invoke the real daemon program. */ + ++#ifdef INET6 ++ syslog(allow_severity, "connect from %s (%s)", ++ eval_client(&request), eval_hostaddr(request.client)); ++#else + syslog(allow_severity, "connect from %s", eval_client(&request)); ++#endif + closelog(); + (void) execv(path, argv); + syslog(LOG_ERR, "error: cannot execute %s: %m", path); +diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c +--- tcp_wrappers_7.6.orig/tcpdchk.c 1997-02-12 02:13:25.000000000 +0100 ++++ tcp_wrappers_7.6/tcpdchk.c 2004-04-10 19:07:43.000000000 +0200 +@@ -22,6 +22,9 @@ + + #include <sys/types.h> + #include <sys/stat.h> ++#ifdef INET6 ++#include <sys/socket.h> ++#endif + #include <netinet/in.h> + #include <arpa/inet.h> + #include <stdio.h> +@@ -397,6 +400,31 @@ + } + } + ++#ifdef INET6 ++static int is_inet6_addr(pat) ++ char *pat; ++{ ++ struct addrinfo hints, *res; ++ int len, ret; ++ char ch; ++ ++ if (*pat != '[') ++ return (0); ++ len = strlen(pat); ++ if ((ch = pat[len - 1]) != ']') ++ return (0); ++ pat[len - 1] = '\0'; ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = AF_INET6; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; ++ if ((ret = getaddrinfo(pat + 1, NULL, &hints, &res)) == 0) ++ freeaddrinfo(res); ++ pat[len - 1] = ch; ++ return (ret == 0); ++} ++#endif ++ + /* check_host - criticize host pattern */ + + static int check_host(pat) +@@ -423,14 +451,27 @@ + #endif + #endif + } else if (mask = split_at(pat, '/')) { /* network/netmask */ ++#ifdef INET6 ++ int mask_len; ++ ++ if ((dot_quad_addr(pat) == INADDR_NONE ++ || dot_quad_addr(mask) == INADDR_NONE) ++ && (!is_inet6_addr(pat) ++ || ((mask_len = atoi(mask)) < 0 || mask_len > 128))) ++#else + if (dot_quad_addr(pat) == INADDR_NONE + || dot_quad_addr(mask) == INADDR_NONE) ++#endif + tcpd_warn("%s/%s: bad net/mask pattern", pat, mask); + } else if (STR_EQ(pat, "FAIL")) { /* obsolete */ + tcpd_warn("FAIL is no longer recognized"); + tcpd_warn("(use EXCEPT or DENY instead)"); + } else if (reserved_name(pat)) { /* other reserved */ + /* void */ ; ++#ifdef INET6 ++ } else if (is_inet6_addr(pat)) { /* IPv6 address */ ++ addr_count = 1; ++#endif + } else if (NOT_INADDR(pat)) { /* internet name */ + if (pat[strlen(pat) - 1] == '.') { + tcpd_warn("%s: domain or host name ends in dot", pat); +diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h +--- tcp_wrappers_7.6.orig/tcpd.h 1996-03-19 16:22:25.000000000 +0100 ++++ tcp_wrappers_7.6/tcpd.h 2004-04-10 19:07:43.000000000 +0200 +@@ -11,7 +11,11 @@ + struct host_info { + char name[STRING_LENGTH]; /* access via eval_hostname(host) */ + char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */ ++#ifdef INET6 ++ struct sockaddr *sin; /* socket address or 0 */ ++#else + struct sockaddr_in *sin; /* socket address or 0 */ ++#endif + struct t_unitdata *unit; /* TLI transport address or 0 */ + struct request_info *request; /* for shared information */ + }; +diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.c tcp_wrappers_7.6/tcpdmatch.c +--- tcp_wrappers_7.6.orig/tcpdmatch.c 1996-02-11 17:01:36.000000000 +0100 ++++ tcp_wrappers_7.6/tcpdmatch.c 2004-04-10 19:07:43.000000000 +0200 +@@ -57,7 +57,11 @@ + int argc; + char **argv; + { ++#ifdef INET6 ++ struct addrinfo hints, *hp, *res; ++#else + struct hostent *hp; ++#endif + char *myname = argv[0]; + char *client; + char *server; +@@ -68,8 +72,13 @@ + int ch; + char *inetcf = 0; + int count; ++#ifdef INET6 ++ struct sockaddr_storage server_sin; ++ struct sockaddr_storage client_sin; ++#else + struct sockaddr_in server_sin; + struct sockaddr_in client_sin; ++#endif + struct stat st; + + /* +@@ -172,13 +181,20 @@ + if (NOT_INADDR(server) == 0 || HOSTNAME_KNOWN(server)) { + if ((hp = find_inet_addr(server)) == 0) + exit(1); ++#ifndef INET6 + memset((char *) &server_sin, 0, sizeof(server_sin)); + server_sin.sin_family = AF_INET; ++#endif + request_set(&request, RQ_SERVER_SIN, &server_sin, 0); + ++#ifdef INET6 ++ for (res = hp, count = 0; res; res = res->ai_next, count++) { ++ memcpy(&server_sin, res->ai_addr, res->ai_addrlen); ++#else + for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) { + memcpy((char *) &server_sin.sin_addr, addr, + sizeof(server_sin.sin_addr)); ++#endif + + /* + * Force evaluation of server host name and address. Host name +@@ -194,7 +210,11 @@ + fprintf(stderr, "Please specify an address instead\n"); + exit(1); + } ++#ifdef INET6 ++ freeaddrinfo(hp); ++#else + free((char *) hp); ++#endif + } else { + request_set(&request, RQ_SERVER_NAME, server, 0); + } +@@ -208,6 +228,18 @@ + tcpdmatch(&request); + exit(0); + } ++#ifdef INET6 ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = AF_INET6; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; ++ if (getaddrinfo(client, NULL, &hints, &res) == 0) { ++ freeaddrinfo(res); ++ request_set(&request, RQ_CLIENT_ADDR, client, 0); ++ tcpdmatch(&request); ++ exit(0); ++ } ++#endif + + /* + * Perhaps they are testing special client hostname patterns that aren't +@@ -229,6 +261,34 @@ + */ + if ((hp = find_inet_addr(client)) == 0) + exit(1); ++#ifdef INET6 ++ request_set(&request, RQ_CLIENT_SIN, &client_sin, 0); ++ ++ for (res = hp, count = 0; res; res = res->ai_next, count++) { ++ memcpy(&client_sin, res->ai_addr, res->ai_addrlen); ++ ++ /* ++ * getnameinfo() doesn't do reverse lookup against link-local ++ * address. So, we pass through host name evaluation against ++ * such addresses. ++ */ ++ if (res->ai_family != AF_INET6 || ++ !IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr)) { ++ /* ++ * Force evaluation of client host name and address. Host name ++ * conflicts will be reported while eval_hostname() does its job. ++ */ ++ request_set(&request, RQ_CLIENT_NAME, "", RQ_CLIENT_ADDR, "", 0); ++ if (STR_EQ(eval_hostname(request.client), unknown)) ++ tcpd_warn("host address %s->name lookup failed", ++ eval_hostaddr(request.client)); ++ } ++ tcpdmatch(&request); ++ if (res->ai_next) ++ printf("\n"); ++ } ++ freeaddrinfo(hp); ++#else + memset((char *) &client_sin, 0, sizeof(client_sin)); + client_sin.sin_family = AF_INET; + request_set(&request, RQ_CLIENT_SIN, &client_sin, 0); +@@ -250,6 +310,7 @@ + printf("\n"); + } + free((char *) hp); ++#endif + exit(0); + } + +diff -ruN tcp_wrappers_7.6.orig/tli.c tcp_wrappers_7.6/tli.c +--- tcp_wrappers_7.6.orig/tli.c 1997-03-21 19:27:26.000000000 +0100 ++++ tcp_wrappers_7.6/tli.c 2004-04-10 19:07:43.000000000 +0200 +@@ -65,8 +65,13 @@ + void tli_host(request) + struct request_info *request; + { ++#ifdef INET6 ++ static struct sockaddr_storage client; ++ static struct sockaddr_storage server; ++#else + static struct sockaddr_in client; + static struct sockaddr_in server; ++#endif + + /* + * If we discover that we are using an IP transport, pretend we never +@@ -76,14 +81,29 @@ + + tli_endpoints(request); + if ((request->config = tli_transport(request->fd)) != 0 ++#ifdef INET6 ++ && (STR_EQ(request->config->nc_protofmly, "inet") || ++ STR_EQ(request->config->nc_protofmly, "inet6"))) { ++#else + && STR_EQ(request->config->nc_protofmly, "inet")) { ++#endif + if (request->client->unit != 0) { ++#ifdef INET6 ++ client = *(struct sockaddr_storage *) request->client->unit->addr.buf; ++ request->client->sin = (struct sockaddr *) &client; ++#else + client = *(struct sockaddr_in *) request->client->unit->addr.buf; + request->client->sin = &client; ++#endif + } + if (request->server->unit != 0) { ++#ifdef INET6 ++ server = *(struct sockaddr_storage *) request->server->unit->addr.buf; ++ request->server->sin = (struct sockaddr *) &server; ++#else + server = *(struct sockaddr_in *) request->server->unit->addr.buf; + request->server->sin = &server; ++#endif + } + tli_cleanup(request); + sock_methods(request); +@@ -187,7 +207,15 @@ + } + while (config = getnetconfig(handlep)) { + if (stat(config->nc_device, &from_config) == 0) { ++#ifdef NO_CLONE_DEVICE ++ /* ++ * If the network devices are not cloned (as is the case for ++ * Solaris 8 Beta), we must compare the major device numbers. ++ */ ++ if (major(from_config.st_rdev) == major(from_client.st_rdev)) ++#else + if (minor(from_config.st_rdev) == major(from_client.st_rdev)) ++#endif + break; + } + } +diff -ruN tcp_wrappers_7.6.orig/update.c tcp_wrappers_7.6/update.c +--- tcp_wrappers_7.6.orig/update.c 1994-12-28 17:42:56.000000000 +0100 ++++ tcp_wrappers_7.6/update.c 2004-04-10 19:07:43.000000000 +0200 +@@ -46,10 +46,18 @@ + request->fd = va_arg(ap, int); + continue; + case RQ_CLIENT_SIN: ++#ifdef INET6 ++ request->client->sin = va_arg(ap, struct sockaddr *); ++#else + request->client->sin = va_arg(ap, struct sockaddr_in *); ++#endif + continue; + case RQ_SERVER_SIN: ++#ifdef INET6 ++ request->server->sin = va_arg(ap, struct sockaddr *); ++#else + request->server->sin = va_arg(ap, struct sockaddr_in *); ++#endif + continue; + + /* +diff -ruN tcp_wrappers_7.6.orig/workarounds.c tcp_wrappers_7.6/workarounds.c +--- tcp_wrappers_7.6.orig/workarounds.c 1996-03-19 16:22:26.000000000 +0100 ++++ tcp_wrappers_7.6/workarounds.c 2004-04-10 19:07:43.000000000 +0200 +@@ -166,11 +166,22 @@ + int *len; + { + int ret; ++#ifdef INET6 ++ struct sockaddr *sin = sa; ++#else + struct sockaddr_in *sin = (struct sockaddr_in *) sa; ++#endif + + if ((ret = getpeername(sock, sa, len)) >= 0 ++#ifdef INET6 ++ && ((sin->su_si.si_family == AF_INET6 ++ && IN6_IS_ADDR_UNSPECIFIED(&sin->su_sin6.sin6_addr)) ++ || (sin->su_si.si_family == AF_INET ++ && sin->su_sin.sin_addr.s_addr == 0))) { ++#else + && sa->sa_family == AF_INET + && sin->sin_addr.s_addr == 0) { ++#endif + errno = ENOTCONN; + return (-1); + } else { diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch new file mode 100644 index 000000000..226106f4f --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch @@ -0,0 +1,153 @@ +Upstream-Status: Backport + +Path: news.porcupine.org!news.porcupine.org!not-for-mail +From: Wietse Venema <wietse@((no)(spam)(please))wzv.win.tue.nl> +Newsgroups: comp.mail.sendmail,comp.security.unix +Subject: TCP Wrapper Blacklist Extension +Followup-To: poster +Date: 8 Sep 1997 18:53:13 -0400 +Organization: Wietse's hangout while on sabattical in the USA +Lines: 147 +Sender: wietse@spike.porcupine.org +Message-ID: <5v1vkp$h4f$1@spike.porcupine.org> +NNTP-Posting-Host: spike.porcupine.org +Xref: news.porcupine.org comp.mail.sendmail:3541 comp.security.unix:7158 + +The patch below adds a new host pattern to the TCP Wrapper access +control language. Instead of a host name or address pattern, you +can specify an external /file/name with host name or address +patterns. The feature can be used recursively. + +The /file/name extension makes it easy to blacklist bad sites, for +example, to block unwanted electronic mail when libwrap is linked +into sendmail. Adding hosts to a simple text file is much easier +than having to edit a more complex hosts.allow/deny file. + +I developed this a year or so ago as a substitute for NIS netgroups. +At that time, I did not consider it of sufficient interest for +inclusion in the TCP Wrapper distribution. How times have changed. + +The patch is relative to TCP Wrappers version 7.6. The main archive +site is ftp://ftp.win.tue.nl/pub/security/tcp_wrappers_7.6.tar.gz + +Thanks to the Debian LINUX folks for expressing their interest in +this patch. + + Wietse + + +[diff updated by Md] + +diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 +--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 19:28:09.000000000 +0200 ++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 19:28:01.000000000 +0200 +@@ -97,6 +97,13 @@ + `[3ffe:505:2:1::]/64\' matches every address in the range + `3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'. + .IP \(bu ++A string that begins with a `/\' character is treated as a file ++name. A host name or address is matched if it matches any host name ++or address pattern listed in the named file. The file format is ++zero or more lines with zero or more host name or address patterns ++separated by whitespace. A file name pattern can be used anywhere ++a host name or address pattern can be used. ++.IP \(bu + Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This + method of matching cannot be used in conjunction with `net/mask\' matching, + hostname matching beginning with `.\' or IP address matching ending with `.\'. +diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c +--- tcp_wrappers_7.6.orig/hosts_access.c 2004-04-10 19:28:09.000000000 +0200 ++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 19:27:05.000000000 +0200 +@@ -253,6 +253,26 @@ + } + } + ++/* hostfile_match - look up host patterns from file */ ++ ++static int hostfile_match(path, host) ++char *path; ++struct hosts_info *host; ++{ ++ char tok[BUFSIZ]; ++ int match = NO; ++ FILE *fp; ++ ++ if ((fp = fopen(path, "r")) != 0) { ++ while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host))) ++ /* void */ ; ++ fclose(fp); ++ } else if (errno != ENOENT) { ++ tcpd_warn("open %s: %m", path); ++ } ++ return (match); ++} ++ + /* host_match - match host name and/or address against pattern */ + + static int host_match(tok, host) +@@ -280,6 +300,8 @@ + tcpd_warn("netgroup support is disabled"); /* not tcpd_jump() */ + return (NO); + #endif ++ } else if (tok[0] == '/') { /* /file hack */ ++ return (hostfile_match(tok, host)); + } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */ + char *name = eval_hostname(host); + return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name)); +diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c +--- tcp_wrappers_7.6.orig/tcpdchk.c 2004-04-10 19:28:09.000000000 +0200 ++++ tcp_wrappers_7.6/tcpdchk.c 2004-04-10 19:27:05.000000000 +0200 +@@ -353,6 +353,8 @@ + { + if (pat[0] == '@') { + tcpd_warn("%s: daemon name begins with \"@\"", pat); ++ } else if (pat[0] == '/') { ++ tcpd_warn("%s: daemon name begins with \"/\"", pat); + } else if (pat[0] == '.') { + tcpd_warn("%s: daemon name begins with dot", pat); + } else if (pat[strlen(pat) - 1] == '.') { +@@ -385,6 +387,8 @@ + { + if (pat[0] == '@') { /* @netgroup */ + tcpd_warn("%s: user name begins with \"@\"", pat); ++ } else if (pat[0] == '/') { ++ tcpd_warn("%s: user name begins with \"/\"", pat); + } else if (pat[0] == '.') { + tcpd_warn("%s: user name begins with dot", pat); + } else if (pat[strlen(pat) - 1] == '.') { +@@ -430,8 +434,13 @@ + static int check_host(pat) + char *pat; + { ++ char buf[BUFSIZ]; + char *mask; + int addr_count = 1; ++ FILE *fp; ++ struct tcpd_context saved_context; ++ char *cp; ++ char *wsp = " \t\r\n"; + + if (pat[0] == '@') { /* @netgroup */ + #ifdef NO_NETGRENT +@@ -450,6 +459,21 @@ + tcpd_warn("netgroup support disabled"); + #endif + #endif ++ } else if (pat[0] == '/') { /* /path/name */ ++ if ((fp = fopen(pat, "r")) != 0) { ++ saved_context = tcpd_context; ++ tcpd_context.file = pat; ++ tcpd_context.line = 0; ++ while (fgets(buf, sizeof(buf), fp)) { ++ tcpd_context.line++; ++ for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp)) ++ check_host(cp); ++ } ++ tcpd_context = saved_context; ++ fclose(fp); ++ } else if (errno != ENOENT) { ++ tcpd_warn("open %s: %m", pat); ++ } + } else if (mask = split_at(pat, '/')) { /* network/netmask */ + #ifdef INET6 + int mask_len; diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch new file mode 100644 index 000000000..260e8d313 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch @@ -0,0 +1,47 @@ +Upstream-Status: Backport + +diff -uN tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.new/hosts_access.c +--- tcp_wrappers_7.6/hosts_access.c Mon May 20 14:00:56 2002 ++++ tcp_wrappers_7.6.new/hosts_access.c Mon May 20 14:25:05 2002 +@@ -448,6 +448,15 @@ + int len, mask_len, i = 0; + char ch; + ++ /* ++ * Behavior of getaddrinfo() against IPv4-mapped IPv6 address is ++ * different between KAME and Solaris8. While KAME returns ++ * AF_INET6, Solaris8 returns AF_INET. So, we avoid this here. ++ */ ++ if (STRN_EQ(string, "::ffff:", 7) ++ && dot_quad_addr(string + 7) != INADDR_NONE) ++ return (masked_match4(net_tok, mask_tok, string + 7)); ++ + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET6; + hints.ai_socktype = SOCK_STREAM; +@@ -457,13 +466,6 @@ + memcpy(&addr, res->ai_addr, sizeof(addr)); + freeaddrinfo(res); + +- if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) { +- if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE +- || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) +- return (NO); +- return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]); +- } +- + /* match IPv6 address against netnumber/prefixlen */ + len = strlen(net_tok); + if (*net_tok != '[' || net_tok[len - 1] != ']') +diff -uN tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.new/socket.c +--- tcp_wrappers_7.6/socket.c Mon May 20 13:48:35 2002 ++++ tcp_wrappers_7.6.new/socket.c Mon May 20 14:22:27 2002 +@@ -228,7 +228,7 @@ + hints.ai_family = sin->sa_family; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST; +- if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) { ++ if ((err = getaddrinfo(host->name, NULL, &hints, &res0)) == 0) { + freeaddrinfo(res0); + res0 = NULL; + tcpd_warn("host name/name mismatch: " diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch new file mode 100644 index 000000000..d473fb634 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch @@ -0,0 +1,85 @@ +Upstream-Status: Backport + +Index: tcp_wrappers_7.6/Makefile +=================================================================== +--- tcp_wrappers_7.6.orig/Makefile ++++ tcp_wrappers_7.6/Makefile +@@ -45,7 +45,7 @@ what: + # + # SysV.4 Solaris 2.x OSF AIX + #REAL_DAEMON_DIR=/usr/sbin +-# ++REAL_DAEMON_DIR=/usr/sbin + # BSD 4.4 + #REAL_DAEMON_DIR=/usr/libexec + # +@@ -513,6 +513,7 @@ VSYSLOG = -Dvsyslog=myvsyslog + # (examples: allow, deny, banners, twist and spawn). + # + #STYLE = -DPROCESS_OPTIONS # Enable language extensions. ++STYLE = -DPROCESS_OPTIONS + + ################################################################ + # Optional: Changing the default disposition of logfile records +@@ -536,6 +537,7 @@ VSYSLOG = -Dvsyslog=myvsyslog + # The LOG_XXX names below are taken from the /usr/include/syslog.h file. + + FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use ++FACILITY= LOG_DAEMON + + # The syslog priority at which successful connections are logged. + +@@ -632,6 +634,7 @@ TABLES = -DHOSTS_DENY=\"/etc/hosts.deny\ + # lookups altogether, see the next section. + + PARANOID= -DPARANOID ++PARANOID= + + ######################################## + # Optional: turning off hostname lookups +@@ -645,6 +648,7 @@ PARANOID= -DPARANOID + # mode (see previous section) and comment out the following definition. + + HOSTNAME= -DALWAYS_HOSTNAME ++HOSTNAME= + + ############################################# + # Optional: Turning on host ADDRESS checking +@@ -671,6 +675,7 @@ HOSTNAME= -DALWAYS_HOSTNAME + # Solaris 2.x, and Linux. See your system documentation for details. + # + # KILL_OPT= -DKILL_IP_OPTIONS ++KILL_OPT= -DKILL_IP_OPTIONS + + ## End configuration options + ############################ +@@ -678,9 +683,10 @@ HOSTNAME= -DALWAYS_HOSTNAME + # Protection against weird shells or weird make programs. + + SHELL = /bin/sh +-.c.o:; $(CC) $(CFLAGS) -c $*.c ++.c.o:; $(CC) $(CFLAGS) -o $*.o -c $*.c + +-CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ ++COPTS = -O2 -g ++CFLAGS = $(COPTS) -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ + $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \ + -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \ + -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ +@@ -713,11 +719,12 @@ all other: config-check tcpd tcpdmatch t + + config-check: + @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; } +- @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \ +- if cmp cflags /tmp/cflags.$$$$ ; \ +- then rm /tmp/cflags.$$$$ ; \ +- else mv /tmp/cflags.$$$$ cflags ; \ ++ @set +e; echo $(CFLAGS) >cflags.new ; \ ++ if cmp cflags cflags.new ; \ ++ then rm cflags.new ; \ ++ else mv cflags.new cflags ; \ + fi >/dev/null 2>/dev/null ++ @if [ ! -d shared ]; then mkdir shared; fi + + $(LIB): $(LIB_OBJ) + rm -f $(LIB) diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch new file mode 100644 index 000000000..bd1396bc7 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch @@ -0,0 +1,255 @@ +Upstream-Status: Backport + +diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile +--- tcp_wrappers_7.6.orig/Makefile 2004-05-02 15:37:59.000000000 +0200 ++++ tcp_wrappers_7.6/Makefile 2004-05-02 15:31:09.000000000 +0200 +@@ -150,15 +150,15 @@ + + linux: + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ +- LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \ ++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \ + NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \ +- EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all ++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all + + gnu: + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ +- LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \ ++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \ + NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \ +- EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all ++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT" all + + # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x. + hpux hpux8 hpux9 hpux10: +@@ -713,7 +713,22 @@ + + LIB = libwrap.a + +-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk ++shared/%.o: %.c ++ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@ ++ ++SOMAJOR = 0 ++SOMINOR = 7.6 ++ ++SHLIB = shared/libwrap.so.$(SOMAJOR).$(SOMINOR) ++SHLIBSOMAJ = shared/libwrap.so.$(SOMAJOR) ++SHLIBSO = shared/libwrap.so ++SHLIBFLAGS = -Lshared -lwrap ++ ++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS) ++SHCFLAGS = -fPIC -shared -D_REENTRANT ++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ)); ++ ++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB) + + # Invalidate all object files when the compiler options (CFLAGS) have changed. + +@@ -731,27 +746,33 @@ + $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ) + -$(RANLIB) $(LIB) + +-tcpd: tcpd.o $(LIB) +- $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS) ++$(SHLIB): $(SHLIB_OBJ) ++ rm -f $(SHLIB) ++ $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) ++ ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ) ++ ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO) ++ ++tcpd: tcpd.o $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS) + + miscd: miscd.o $(LIB) + $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS) + +-safe_finger: safe_finger.o $(LIB) +- $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS) ++safe_finger: safe_finger.o $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS) + + TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o + +-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB) +- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS) ++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS) + +-try-from: try-from.o fakelog.o $(LIB) +- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS) ++try-from: try-from.o fakelog.o $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS) + + TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o + +-tcpdchk: $(TCPDCHK_OBJ) $(LIB) +- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS) ++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB) ++ $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS) + + shar: $(KIT) + @shar $(KIT) +@@ -767,7 +788,9 @@ + + clean: + rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \ ++ libwrap*.so* \ + cflags ++ rm -rf shared/ + + tidy: clean + chmod -R a+r . +@@ -913,5 +936,6 @@ + update.o: mystdarg.h + update.o: tcpd.h + vfprintf.o: cflags ++weak_symbols.o: tcpd.h + workarounds.o: cflags + workarounds.o: tcpd.h +diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h +--- tcp_wrappers_7.6.orig/tcpd.h 2004-05-02 15:37:59.000000000 +0200 ++++ tcp_wrappers_7.6/tcpd.h 2004-05-02 15:37:49.000000000 +0200 +@@ -4,6 +4,15 @@ + * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. + */ + ++#ifndef _TCPWRAPPERS_TCPD_H ++#define _TCPWRAPPERS_TCPD_H ++ ++/* Need definitions of struct sockaddr_in and FILE. */ ++#include <netinet/in.h> ++#include <stdio.h> ++ ++__BEGIN_DECLS ++ + /* Structure to describe one communications endpoint. */ + + #define STRING_LENGTH 128 /* hosts, users, processes */ +@@ -29,10 +38,10 @@ + char pid[10]; /* access via eval_pid(request) */ + struct host_info client[1]; /* client endpoint info */ + struct host_info server[1]; /* server endpoint info */ +- void (*sink) (); /* datagram sink function or 0 */ +- void (*hostname) (); /* address to printable hostname */ +- void (*hostaddr) (); /* address to printable address */ +- void (*cleanup) (); /* cleanup function or 0 */ ++ void (*sink) (int); /* datagram sink function or 0 */ ++ void (*hostname) (struct host_info *); /* address to printable hostname */ ++ void (*hostaddr) (struct host_info *); /* address to printable address */ ++ void (*cleanup) (struct request_info *); /* cleanup function or 0 */ + struct netconfig *config; /* netdir handle */ + }; + +@@ -70,20 +79,27 @@ + #define fromhost sock_host /* no TLI support needed */ + #endif + +-extern int hosts_access(); /* access control */ +-extern void shell_cmd(); /* execute shell command */ +-extern char *percent_x(); /* do %<char> expansion */ +-extern void rfc931(); /* client name from RFC 931 daemon */ +-extern void clean_exit(); /* clean up and exit */ +-extern void refuse(); /* clean up and exit */ +-extern char *xgets(); /* fgets() on steroids */ +-extern char *split_at(); /* strchr() and split */ +-extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ ++extern int hosts_access(struct request_info *request); /* access control */ ++extern void shell_cmd(char *); /* execute shell command */ ++extern char *percent_x(char *, int, char *, struct request_info *); ++ /* do %<char> expansion */ ++extern void rfc931(struct sockaddr *, struct sockaddr *, char *); ++ /* client name from RFC 931 daemon */ ++extern void clean_exit(struct request_info *); /* clean up and exit */ ++extern void refuse(struct request_info *); /* clean up and exit */ ++extern char *xgets(char *, int, FILE *); /* fgets() on steroids */ ++extern char *split_at(char *, int); /* strchr() and split */ ++extern unsigned long dot_quad_addr(char *); /* restricted inet_addr() */ + + /* Global variables. */ + ++#ifdef HAVE_WEAKSYMS ++extern int allow_severity __attribute__ ((weak)); /* for connection logging */ ++extern int deny_severity __attribute__ ((weak)); /* for connection logging */ ++#else + extern int allow_severity; /* for connection logging */ + extern int deny_severity; /* for connection logging */ ++#endif + extern char *hosts_allow_table; /* for verification mode redirection */ + extern char *hosts_deny_table; /* for verification mode redirection */ + extern int hosts_access_verbose; /* for verbose matching mode */ +@@ -98,6 +114,8 @@ + #ifdef __STDC__ + extern struct request_info *request_init(struct request_info *,...); + extern struct request_info *request_set(struct request_info *,...); ++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, ++ char *client_user); + #else + extern struct request_info *request_init(); /* initialize request */ + extern struct request_info *request_set(); /* update request structure */ +@@ -121,20 +139,23 @@ + * host_info structures serve as caches for the lookup results. + */ + +-extern char *eval_user(); /* client user */ +-extern char *eval_hostname(); /* printable hostname */ +-extern char *eval_hostaddr(); /* printable host address */ +-extern char *eval_hostinfo(); /* host name or address */ +-extern char *eval_client(); /* whatever is available */ +-extern char *eval_server(); /* whatever is available */ ++extern char *eval_user(struct request_info *); /* client user */ ++extern char *eval_hostname(struct host_info *); /* printable hostname */ ++extern char *eval_hostaddr(struct host_info *); /* printable host address */ ++extern char *eval_hostinfo(struct host_info *); /* host name or address */ ++extern char *eval_client(struct request_info *);/* whatever is available */ ++extern char *eval_server(struct request_info *);/* whatever is available */ + #define eval_daemon(r) ((r)->daemon) /* daemon process name */ + #define eval_pid(r) ((r)->pid) /* process id */ + + /* Socket-specific methods, including DNS hostname lookups. */ + +-extern void sock_host(); /* look up endpoint addresses */ +-extern void sock_hostname(); /* translate address to hostname */ +-extern void sock_hostaddr(); /* address to printable address */ ++/* look up endpoint addresses */ ++extern void sock_host(struct request_info *); ++/* translate address to hostname */ ++extern void sock_hostname(struct host_info *); ++/* address to printable address */ ++extern void sock_hostaddr(struct host_info *); + #define sock_methods(r) \ + { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } + +@@ -182,7 +203,7 @@ + * behavior. + */ + +-extern void process_options(); /* execute options */ ++extern void process_options(char *, struct request_info *);/* execute options */ + extern int dry_run; /* verification flag */ + + /* Bug workarounds. */ +@@ -221,3 +242,7 @@ + #define strtok my_strtok + extern char *my_strtok(); + #endif ++ ++__END_DECLS ++ ++#endif +diff -ruN tcp_wrappers_7.6.orig/weak_symbols.c tcp_wrappers_7.6/weak_symbols.c +--- tcp_wrappers_7.6.orig/weak_symbols.c 1970-01-01 01:00:00.000000000 +0100 ++++ tcp_wrappers_7.6/weak_symbols.c 2004-05-02 15:31:09.000000000 +0200 +@@ -0,0 +1,11 @@ ++ /* ++ * @(#) weak_symbols.h 1.5 99/12/29 23:50 ++ * ++ * Author: Anthony Towns <ajt@debian.org> ++ */ ++ ++#ifdef HAVE_WEAKSYMS ++#include <syslog.h> ++int deny_severity = LOG_WARNING; ++int allow_severity = SEVERITY; ++#endif diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch new file mode 100644 index 000000000..eb5685c57 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch @@ -0,0 +1,68 @@ +Upstream-Status: Backport + +diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 +--- tcp_wrappers_7.6.orig/hosts_access.5 2003-08-21 03:15:36.000000000 +0200 ++++ tcp_wrappers_7.6/hosts_access.5 2003-08-21 03:15:31.000000000 +0200 +@@ -90,6 +90,10 @@ + pattern `131.155.72.0/255.255.254.0\' matches every address in the + range `131.155.72.0\' through `131.155.73.255\'. + .IP \(bu ++An expression of the form `n.n.n.n/mm' is interpreted as a ++`net/masklength' pair, where `mm' is the number of consecutive `1' ++bits in the netmask applied to the `n.n.n.n' address. ++.IP \(bu + An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a + `[net]/prefixlen\' pair. An IPv6 host address is matched if + `prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the +diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c +--- tcp_wrappers_7.6.orig/hosts_access.c 2003-08-21 03:15:36.000000000 +0200 ++++ tcp_wrappers_7.6/hosts_access.c 2003-08-21 03:09:30.000000000 +0200 +@@ -417,7 +417,8 @@ + if ((addr = dot_quad_addr(string)) == INADDR_NONE) + return (NO); + if ((net = dot_quad_addr(net_tok)) == INADDR_NONE +- || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) { ++ || ((mask = dot_quad_addr(mask_tok)) == INADDR_NONE ++ && (mask = cidr_mask_addr(mask_tok)) == 0)) { + #ifndef INET6 + tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok); + #endif +diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c +--- tcp_wrappers_7.6.orig/misc.c 2003-08-21 03:15:36.000000000 +0200 ++++ tcp_wrappers_7.6/misc.c 2003-08-21 03:09:30.000000000 +0200 +@@ -107,3 +107,17 @@ + } + return (runs == 4 ? inet_addr(str) : INADDR_NONE); + } ++ ++/* cidr_mask_addr - convert cidr netmask length to internal form */ ++ ++unsigned long cidr_mask_addr(str) ++char *str; ++{ ++ int maskbits; ++ ++ maskbits = atoi(str); ++ if (maskbits < 1 || maskbits > 32) ++ return (0); ++ return htonl(0xFFFFFFFF << (32 - maskbits)); ++} ++ +diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c +--- tcp_wrappers_7.6.orig/tcpdchk.c 2003-08-21 03:15:36.000000000 +0200 ++++ tcp_wrappers_7.6/tcpdchk.c 2003-08-21 03:09:30.000000000 +0200 +@@ -497,12 +497,12 @@ + int mask_len; + + if ((dot_quad_addr(pat) == INADDR_NONE +- || dot_quad_addr(mask) == INADDR_NONE) ++ || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0) + && (!is_inet6_addr(pat) + || ((mask_len = atoi(mask)) < 0 || mask_len > 128))) + #else + if (dot_quad_addr(pat) == INADDR_NONE +- || dot_quad_addr(mask) == INADDR_NONE) ++ || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0) + #endif + tcpd_warn("%s/%s: bad net/mask pattern", pat, mask); + } else if (STR_EQ(pat, "FAIL")) { /* obsolete */ diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch new file mode 100644 index 000000000..3ca687411 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch @@ -0,0 +1,14 @@ +Upstream-Status: Backport + +diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 +--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-25 12:17:59.000000000 +0200 ++++ tcp_wrappers_7.6/hosts_access.5 2004-04-25 12:17:53.000000000 +0200 +@@ -89,6 +89,8 @@ + bitwise AND of the address and the `mask\'. For example, the net/mask + pattern `131.155.72.0/255.255.254.0\' matches every address in the + range `131.155.72.0\' through `131.155.73.255\'. ++`255.255.255.255\' is not a valid mask value, so a single host can be ++matched just by its IP. + .IP \(bu + An expression of the form `n.n.n.n/mm' is interpreted as a + `net/masklength' pair, where `mm' is the number of consecutive `1' diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch new file mode 100644 index 000000000..308737797 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch @@ -0,0 +1,73 @@ +Upstream-Status: Backport + +diff -ruN tcp_wrappers_7.6.orig/eval.c tcp_wrappers_7.6/eval.c +--- tcp_wrappers_7.6.orig/eval.c 1995-01-30 19:51:46.000000000 +0100 ++++ tcp_wrappers_7.6/eval.c 2004-11-04 13:59:01.000000000 +0100 +@@ -98,6 +98,28 @@ + } + } + ++/* eval_port - return string with the port */ ++char *eval_port(saddr) ++#ifdef INET6 ++struct sockaddr *saddr; ++#else ++struct sockaddr_in *saddr; ++#endif ++{ ++ static char port[16]; ++ if (saddr != 0) { ++ sprintf(port, "%u", ++#ifdef INET6 ++ ntohs(((struct sockaddr_in *)saddr)->sin_port)); ++#else ++ ntohs(saddr->sin_port)); ++#endif ++ } else { ++ strcpy(port, "0"); ++ } ++ return (port); ++} ++ + /* eval_client - return string with as much about the client as we know */ + + char *eval_client(request) +diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5 +--- tcp_wrappers_7.6.orig/hosts_access.5 2004-11-04 13:17:45.000000000 +0100 ++++ tcp_wrappers_7.6/hosts_access.5 2004-11-04 13:55:32.000000000 +0100 +@@ -175,6 +175,8 @@ + unavailable. + .IP "%n (%N)" + The client (server) host name (or "unknown" or "paranoid"). ++.IP "%r (%R)" ++The clients (servers) port number (or "0"). + .IP %p + The daemon process id. + .IP %s +diff -ruN tcp_wrappers_7.6.orig/percent_x.c tcp_wrappers_7.6/percent_x.c +--- tcp_wrappers_7.6.orig/percent_x.c 1994-12-28 17:42:38.000000000 +0100 ++++ tcp_wrappers_7.6/percent_x.c 2004-11-04 13:19:29.000000000 +0100 +@@ -63,6 +63,8 @@ + ch == 'n' ? eval_hostname(request->client) : + ch == 'N' ? eval_hostname(request->server) : + ch == 'p' ? eval_pid(request) : ++ ch == 'r' ? eval_port(request->client->sin) : ++ ch == 'R' ? eval_port(request->server->sin) : + ch == 's' ? eval_server(request) : + ch == 'u' ? eval_user(request) : + ch == '%' ? "%" : (tcpd_warn("unrecognized %%%c", ch), ""); +diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h +--- tcp_wrappers_7.6.orig/tcpd.h 2004-11-04 13:17:45.000000000 +0100 ++++ tcp_wrappers_7.6/tcpd.h 2004-11-04 13:19:13.000000000 +0100 +@@ -145,6 +145,11 @@ + extern char *eval_hostinfo(struct host_info *); /* host name or address */ + extern char *eval_client(struct request_info *);/* whatever is available */ + extern char *eval_server(struct request_info *);/* whatever is available */ ++#ifdef INET6 ++extern char *eval_port(struct sockaddr *); ++#else ++extern char *eval_port(struct sockaddr_in *); ++#endif + #define eval_daemon(r) ((r)->daemon) /* daemon process name */ + #define eval_pid(r) ((r)->pid) /* process id */ + diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch new file mode 100644 index 000000000..4cc554fc3 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch @@ -0,0 +1,21 @@ +Upstream-Status: Backport + +diff -ruN tcp_wrappers_7.6.orig/percent_m.c tcp_wrappers_7.6/percent_m.c +--- tcp_wrappers_7.6.orig/percent_m.c 1994-12-28 17:42:37.000000000 +0100 ++++ tcp_wrappers_7.6/percent_m.c 2003-08-21 02:45:31.000000000 +0200 +@@ -29,11 +29,15 @@ + + while (*bp = *cp) + if (*cp == '%' && cp[1] == 'm') { ++#ifdef HAVE_STRERROR ++ strcpy(bp, strerror(errno)); ++#else + if (errno < sys_nerr && errno > 0) { + strcpy(bp, sys_errlist[errno]); + } else { + sprintf(bp, "Unknown error %d", errno); + } ++#endif + bp += strlen(bp); + cp += 2; + } else { diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch new file mode 100644 index 000000000..3ba214d24 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch @@ -0,0 +1,45 @@ +Upstream-Status: Backport + +Index: tcp_wrappers_7.6.orig/Makefile +=================================================================== +--- tcp_wrappers_7.6.orig.orig/Makefile 2009-04-06 10:55:47.000000000 +0000 ++++ tcp_wrappers_7.6.orig/Makefile 2009-04-06 10:57:04.000000000 +0000 +@@ -748,31 +748,31 @@ + + $(SHLIB): $(SHLIB_OBJ) + rm -f $(SHLIB) +- $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) ++ $(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ) + ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ) + ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO) + + tcpd: tcpd.o $(SHLIB) +- $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ tcpd.o $(SHLIBFLAGS) + + miscd: miscd.o $(LIB) +- $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ miscd.o $(LIB) $(LIBS) + + safe_finger: safe_finger.o $(SHLIB) +- $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS) + + TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o + + tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB) +- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS) + + try-from: try-from.o fakelog.o $(SHLIB) +- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS) + + TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o + + tcpdchk: $(TCPDCHK_OBJ) $(SHLIB) +- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS) + + shar: $(KIT) + @shar $(KIT) diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch new file mode 100644 index 000000000..797352579 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch @@ -0,0 +1,54 @@ +From daf89d272e51b2153015ce7f54ab0b86182e64c1 Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Wed, 28 Jan 2015 18:50:23 -0800 +Subject: [PATCH] Makefile: fix for parallel build + +Fixed: +make: *** No rule to make target `cflags', needed by `tcpd.o'. Stop. + +Let "cflags" depend on config-check which generates cflgas will fix the +problem. + +Also fixed: +Fatal error: can't create shared/hosts_access.o: No such file or directory + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + Makefile | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index fe5e732..f468751 100644 +--- a/Makefile ++++ b/Makefile +@@ -714,6 +714,7 @@ KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \ + LIB = libwrap.a + + shared/%.o: %.c ++ [ -d shared ] || mkdir -p shared + $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@ + + SOMAJOR = 0 +@@ -730,6 +731,8 @@ SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ)); + + all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB) + ++cflags: config-check ++ + # Invalidate all object files when the compiler options (CFLAGS) have changed. + + config-check: +@@ -739,7 +742,7 @@ config-check: + then rm cflags.new ; \ + else mv cflags.new cflags ; \ + fi >/dev/null 2>/dev/null +- @if [ ! -d shared ]; then mkdir shared; fi ++ @[ -d shared ] || mkdir -p shared + + $(LIB): $(LIB_OBJ) + rm -f $(LIB) +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch new file mode 100644 index 000000000..19bd7d3c0 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch @@ -0,0 +1,23 @@ +Upstream-Status: Backport + +diff -ruN tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3 +--- tcp_wrappers_7.6.orig/hosts_access.3 2004-04-25 00:10:48.000000000 +0200 ++++ tcp_wrappers_7.6/hosts_access.3 2004-04-25 00:09:36.000000000 +0200 +@@ -14,6 +14,9 @@ + struct request_info *request_set(request, key, value, ..., 0) + struct request_info *request; + ++void fromhost(request) ++struct request_info *request; ++ + int hosts_access(request) + struct request_info *request; + +@@ -60,6 +63,7 @@ + is available, host names and client user names are looked up on demand, + using the request structure as a cache. hosts_access() returns zero if + access should be denied. ++fromhost() must be called before hosts_access(). + .PP + hosts_ctl() is a wrapper around the request_init() and hosts_access() + routines with a perhaps more convenient interface (though it does not diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch new file mode 100644 index 000000000..eee640e8a --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch @@ -0,0 +1,31 @@ +__BEGIN_DECLS/__END_DECLS are BSD specific and not defined in musl +glibc and uclibc had sys/cdefs.h doing it. + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +Index: tcp_wrappers_7.6/tcpd.h +=================================================================== +--- tcp_wrappers_7.6.orig/tcpd.h ++++ tcp_wrappers_7.6/tcpd.h +@@ -11,7 +11,9 @@ + #include <netinet/in.h> + #include <stdio.h> + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + + /* Structure to describe one communications endpoint. */ + +@@ -252,6 +254,8 @@ extern char *fix_strtok(); + extern char *my_strtok(); + #endif + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch new file mode 100644 index 000000000..7650600ab --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch @@ -0,0 +1,35 @@ +STRINGS name conflicts with variable for strings tools (e.g. i586-oe-linux-strings) + +Upstream-Status: Pending + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> + +--- tcp_wrappers_7.6/Makefile.orig 2013-04-18 23:41:58.277981740 +0200 ++++ tcp_wrappers_7.6/Makefile 2013-04-18 23:42:42.513978966 +0200 +@@ -309,7 +309,7 @@ + pyramid: + @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ + LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ="environ.o vfprintf.o" \ +- STRINGS="-Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy" \ ++ STRINGS_FLAGS="-Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy" \ + NETGROUP="-DNETGROUP -DUSE_GETDOMAIN" TLI= all + + # Untested. +@@ -419,7 +419,7 @@ + # Uncomment the following if your C library does not provide the + # strchr/strrchr/memcmp routines, but comes with index/rindex/bcmp. + # +-#STRINGS= -Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy ++#STRINGS_FLAGS= -Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy + + ################################################################# + # System dependencies: selection of non-default object libraries. +@@ -690,7 +690,7 @@ + $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \ + -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \ + -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ +- $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \ ++ $(UCHAR) $(TABLES) $(STRINGS_FLAGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \ + $(VSYSLOG) $(HOSTNAME) + + LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \ diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch new file mode 100644 index 000000000..5875b81b2 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch @@ -0,0 +1,39 @@ +Upstream-Status: Backport + +diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c +--- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:40:08.000000000 +0200 ++++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:40:02.000000000 +0200 +@@ -92,6 +92,8 @@ + char *cp; + char *result = unknown; + FILE *fp; ++ unsigned saved_timeout; ++ struct sigaction nact, oact; + + #ifdef INET6 + /* address family must be the same */ +@@ -134,7 +136,12 @@ + */ + + if (setjmp(timebuf) == 0) { +- signal(SIGALRM, timeout); ++ /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */ ++ saved_timeout = alarm(0); ++ nact.sa_handler = timeout; ++ nact.sa_flags = 0; ++ (void) sigemptyset(&nact.sa_mask); ++ (void) sigaction(SIGALRM, &nact, &oact); + alarm(rfc931_timeout); + + /* +@@ -223,6 +230,10 @@ + } + alarm(0); + } ++ /* Restore SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */ ++ (void) sigaction(SIGALRM, &oact, NULL); ++ if (saved_timeout > 0) ++ alarm(saved_timeout); + fclose(fp); + } + STRN_CPY(dest, result, STRING_LENGTH); diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff new file mode 100644 index 000000000..723f4f136 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff @@ -0,0 +1,41 @@ +Upstream-Status: Backport + +diff -ruNp tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c +--- tcp_wrappers_7.6.orig/scaffold.c 2005-03-09 18:22:04.000000000 +0100 ++++ tcp_wrappers_7.6/scaffold.c 2005-03-09 18:20:47.000000000 +0100 +@@ -237,10 +237,17 @@ struct request_info *request; + + /* ARGSUSED */ + +-void rfc931(request) +-struct request_info *request; ++void rfc931(rmt_sin, our_sin, dest) ++#ifdef INET6 ++struct sockaddr *rmt_sin; ++struct sockaddr *our_sin; ++#else ++struct sockaddr_in *rmt_sin; ++struct sockaddr_in *our_sin; ++#endif ++char *dest; + { +- strcpy(request->user, unknown); ++ strcpy(dest, unknown); + } + + /* check_path - examine accessibility */ +diff -ruNp tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h +--- tcp_wrappers_7.6.orig/tcpd.h 2005-03-09 18:22:04.000000000 +0100 ++++ tcp_wrappers_7.6/tcpd.h 2005-03-09 18:21:23.000000000 +0100 +@@ -83,7 +83,11 @@ extern int hosts_access(struct request_i + extern void shell_cmd(char *); /* execute shell command */ + extern char *percent_x(char *, int, char *, struct request_info *); + /* do %<char> expansion */ ++#ifdef INET6 + extern void rfc931(struct sockaddr *, struct sockaddr *, char *); ++#else ++extern void rfc931(struct sockaddr_in *, struct sockaddr_in *, char *); ++#endif + /* client name from RFC 931 daemon */ + extern void clean_exit(struct request_info *); /* clean up and exit */ + extern void refuse(struct request_info *); /* clean up and exit */ diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8 b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8 new file mode 100644 index 000000000..875616b9e --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8 @@ -0,0 +1,34 @@ +.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual" +.SH NAME +safe_finger \- finger client wrapper that protects against nasty stuff +from finger servers +.SH SYNOPSIS +.B safe_finger [finger_options] +.SH DESCRIPTION +The +.B safe_finger +command protects against nasty stuff from finger servers. Use this +program for automatic reverse finger probes from the +.B tcp_wrapper +.B (tcpd) +, not the raw finger command. The +.B safe_finger +command makes sure that the finger client is not run with root +privileges. It also runs the finger client with a defined PATH +environment. +.B safe_finger +will also protect you from problems caused by the output of some +finger servers. The problem: some programs may react to stuff in +the first column. Other programs may get upset by thrash anywhere +on a line. File systems may fill up as the finger server keeps +sending data. Text editors may bomb out on extremely long lines. +The finger server may take forever because it is somehow wedged. +.B safe_finger +takes care of all this badness. +.SH SEE ALSO +.BR hosts_access (5), +.BR hosts_options (5), +.BR tcpd (8) +.SH AUTHOR +Wietse Venema, Eindhoven University of Technology, The Netherlands. + diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch new file mode 100644 index 000000000..fc2afeef1 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch @@ -0,0 +1,31 @@ +Upstream-Status: Backport + +--- tcp-wrappers-7.6-ipv6.1.orig/safe_finger.c ++++ tcp-wrappers-7.6-ipv6.1/safe_finger.c +@@ -26,21 +26,24 @@ + #include <stdio.h> + #include <ctype.h> + #include <pwd.h> ++#include <syslog.h> + + extern void exit(); + + /* Local stuff */ + +-char path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin"; ++char path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin"; + + #define TIME_LIMIT 60 /* Do not keep listinging forever */ + #define INPUT_LENGTH 100000 /* Do not keep listinging forever */ + #define LINE_LENGTH 128 /* Editors can choke on long lines */ + #define FINGER_PROGRAM "finger" /* Most, if not all, UNIX systems */ + #define UNPRIV_NAME "nobody" /* Preferred privilege level */ +-#define UNPRIV_UGID 32767 /* Default uid and gid */ ++#define UNPRIV_UGID 65534 /* Default uid and gid */ + + int finger_pid; ++int allow_severity = SEVERITY; ++int deny_severity = LOG_WARNING; + + void cleanup(sig) + int sig; diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch new file mode 100644 index 000000000..9d7ea042b --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch @@ -0,0 +1,36 @@ +Upstream-Status: Backport + +* Mon Feb 10 2003 Harald Hoyer <harald@redhat.de> 7.6-29 +- added security patch tcp_wrappers-7.6-sig.patch + +--- tcp_wrappers_7.6/hosts_access.c.sig 2003-02-10 16:18:31.000000000 +0100 ++++ tcp_wrappers_7.6/hosts_access.c 2003-02-10 16:50:38.000000000 +0100 +@@ -66,6 +66,7 @@ + + #define YES 1 + #define NO 0 ++#define ERR -1 + + /* + * These variables are globally visible so that they can be redirected in +@@ -129,9 +129,9 @@ + return (verdict == AC_PERMIT); + if (table_match(hosts_allow_table, request)) + return (YES); +- if (table_match(hosts_deny_table, request)) +- return (NO); +- return (YES); ++ if (table_match(hosts_deny_table, request) == NO) ++ return (YES); ++ return (NO); + } + + /* table_match - match table entries with (daemon, client) pair */ +@@ -175,6 +175,7 @@ + (void) fclose(fp); + } else if (errno != ENOENT) { + tcpd_warn("cannot open %s: %m", table); ++ match = ERR; + } + if (match) { + if (hosts_access_verbose > 1) diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch new file mode 100644 index 000000000..76dd6340b --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch @@ -0,0 +1,32 @@ +Upstream-Status: Backport + +diff -ruNp tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c +--- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:42:25.000000000 +0200 ++++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:41:04.000000000 +0200 +@@ -33,7 +33,7 @@ static char sccsid[] = "@(#) rfc931.c 1. + + int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */ + +-static jmp_buf timebuf; ++static sigjmp_buf timebuf; + + /* fsocket - open stdio stream on top of socket */ + +@@ -62,7 +62,7 @@ int protocol; + static void timeout(sig) + int sig; + { +- longjmp(timebuf, sig); ++ siglongjmp(timebuf, sig); + } + + /* rfc931 - return remote user name, given socket structures */ +@@ -135,7 +135,7 @@ char *dest; + * Set up a timer so we won't get stuck while waiting for the server. + */ + +- if (setjmp(timebuf) == 0) { ++ if (sigsetjmp(timebuf, 0) == 0) { + /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */ + saved_timeout = alarm(0); + nact.sa_handler = timeout; diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch new file mode 100644 index 000000000..8e46df8e1 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch @@ -0,0 +1,59 @@ +commit 88b6984ef0bf3b703c1c851092662b95e91db1ff +Author: farrah rashid <farrah.rashid@windriver.com> +Date: Tue Feb 12 09:53:50 2013 -0500 + + tcp-wrappers Support for building with glibc + + Added support for socklen_t type to len argument passed to socket related + calls. This fixes a bug that causes tcp wrappers to fail when using sshd. + + Upstream-Status: Pending + + Signed-off-by: farrah rashid <farrah.rashid@windriver.com> + +diff --git a/fix_options.c b/fix_options.c +index 7473adf..fe2b442 100644 +--- a/fix_options.c ++++ b/fix_options.c +@@ -38,7 +38,12 @@ struct request_info *request; + #ifdef IP_OPTIONS + unsigned char optbuf[BUFFER_SIZE / 3], *cp; + char lbuf[BUFFER_SIZE], *lp; +- int optsize = sizeof(optbuf), ipproto; ++#ifdef __GLIBC__ ++ socklen_t optsize = sizeof(optbuf); ++#else ++ int optsize = sizeof(optbuf); ++#endif ++ int ipproto; + struct protoent *ip; + int fd = request->fd; + unsigned int opt; +diff --git a/socket.c b/socket.c +index 4b2c575..a0d2987 100644 +--- a/socket.c ++++ b/socket.c +@@ -95,7 +95,11 @@ struct request_info *request; + static struct sockaddr_in client; + static struct sockaddr_in server; + #endif ++#ifdef __GLIBC__ ++ socklen_t len; ++#else + int len; ++#endif + char buf[BUFSIZ]; + int fd = request->fd; + +@@ -426,7 +430,11 @@ int fd; + #else + struct sockaddr_in sin; + #endif ++#ifdef __GLIBC__ ++ socklen_t size = sizeof(sin); ++#else + int size = sizeof(sin); ++#endif + + /* + * Eat up the not-yet received datagram. Some systems insist on a diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch new file mode 100644 index 000000000..be29bdcfa --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch @@ -0,0 +1,41 @@ +Upstream-Status: Backport + +diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c +--- tcp_wrappers_7.6.orig/tcpdchk.c 2003-08-21 02:50:37.000000000 +0200 ++++ tcp_wrappers_7.6/tcpdchk.c 2003-08-21 02:50:33.000000000 +0200 +@@ -53,6 +53,24 @@ + #include "inetcf.h" + #include "scaffold.h" + ++/* list of programs which are known to be linked with libwrap in debian */ ++static const char *const libwrap_programs[] = { ++ "portmap", "mountd", "statd", "ugidd", ++ "redir", "rlinetd", ++ "sshd", ++ "atftpd", ++ "diald", ++ "esound", ++ "gdm", "gnome-session", ++ "icecast", "icecast_admin", "icecast_client", "icecast_source", ++ "mysqld", ++ "ntop", ++ "pptpd", ++ "rquotad", ++ "sendmail", "smail", ++ NULL ++}; ++ + /* + * Stolen from hosts_access.c... + */ +@@ -147,8 +165,8 @@ + /* + * These are not run from inetd but may have built-in access control. + */ +- inet_set("portmap", WR_NOT); +- inet_set("rpcbind", WR_NOT); ++ for (c = 0; libwrap_programs[c]; c++) ++ inet_set(libwrap_programs[c], WR_YES); + + /* + * Check accessibility of access control files. diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8 b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8 new file mode 100644 index 000000000..9c8f30543 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8 @@ -0,0 +1,28 @@ +.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual" +.SH NAME +try-from \- test program for the tcp_wrapper +.SH SYNOPSIS +.B try-from +.SH DESCRIPTION +The +.B try-from +command can be called via a remote shell command to find out +if the hostname and address are properly recognized +by the +.B tcp_wrapper +library, if username lookup works, and (SysV only) if the TLI +on top of IP heuristics work. Diagnostics are reported through +.BR syslog (3) +and redirected to stderr. + +Example: + +rsh host /some/where/try-from + +.SH SEE ALSO +.BR hosts_access (5), +.BR hosts_options (5), +.BR tcpd (8) +.SH AUTHOR +Wietse Venema, Eindhoven University of Technology, The Netherlands. + diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb new file mode 100644 index 000000000..3ece8c301 --- /dev/null +++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb @@ -0,0 +1,133 @@ +SUMMARY = "Security tool that is a wrapper for TCP daemons" +HOMEPAGE = "http://www.softpanorama.org/Net/Network_security/TCP_wrappers/" +DESCRIPTION = "Tools for monitoring and filtering incoming requests for tcp \ + services." +SECTION = "console/network" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://DISCLAIMER;md5=071bd69cb78b18888ea5e3da5c3127fa" +PR ="r10" + + +PACKAGES = "${PN}-dbg libwrap libwrap-doc libwrap-dev libwrap-staticdev ${PN} ${PN}-doc" +FILES_libwrap = "${base_libdir}/lib*${SOLIBS}" +FILES_libwrap-doc = "${mandir}/man3 ${mandir}/man5" +FILES_libwrap-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}" +FILES_libwrap-staticdev = "${libdir}/lib*.a" +FILES_${PN} = "${sbindir}" +FILES_${PN}-doc = "${mandir}/man8" + +SRC_URI = "ftp://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \ + file://00_man_quoting.diff \ + file://01_man_portability.patch \ + file://05_wildcard_matching.patch \ + file://06_fix_gethostbyname.patch \ + file://10_usagi-ipv6.patch \ + file://11_tcpd_blacklist.patch \ + file://11_usagi_fix.patch \ + file://12_makefile_config.patch \ + file://13_shlib_weaksym.patch \ + file://14_cidr_support.patch \ + file://15_match_clarify.patch \ + file://expand_remote_port.patch \ + file://have_strerror.patch \ + file://man_fromhost.patch \ + file://restore_sigalarm.patch \ + file://rfc931.diff \ + file://safe_finger.patch \ + file://sig_fix.patch \ + file://siglongjmp.patch \ + file://socklen_t.patch \ + file://tcpdchk_libwrapped.patch \ + file://ldflags.patch \ + file://rename_strings_variable.patch \ + file://try-from.8 \ + file://safe_finger.8 \ + file://makefile-fix-parallel.patch \ + file://musl-decls.patch \ + file://0001-Fix-build-with-clang.patch \ + " + +SRC_URI[md5sum] = "e6fa25f71226d090f34de3f6b122fb5a" +SRC_URI[sha256sum] = "9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d" + +S = "${WORKDIR}/tcp_wrappers_${PV}" + +EXTRA_OEMAKE = "'CC=${CC}' \ + 'AR=${AR}' \ + 'RANLIB=${RANLIB}' \ + 'REAL_DAEMON_DIR=${sbindir}' \ + 'STYLE=-DPROCESS_OPTIONS' \ + 'FACILITY=LOG_DAEMON' \ + 'SEVERITY=LOG_INFO' \ + 'BUGS=' \ + 'VSYSLOG=' \ + 'RFC931_TIMEOUT=10' \ + 'ACCESS=-DHOSTS_ACCESS' \ + 'KILL_OPT=-DKILL_IP_OPTIONS' \ + 'UMASK=-DDAEMON_UMASK=022' \ + 'NETGROUP=${EXTRA_OEMAKE_NETGROUP}' \ + 'LIBS=-lnsl' \ + 'ARFLAGS=rv' \ + 'AUX_OBJ=weak_symbols.o' \ + 'TLI=' \ + 'COPTS=' \ + 'EXTRA_CFLAGS=${CFLAGS} -DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len'" + +EXTRA_OEMAKE_NETGROUP = "-DNETGROUP -DUSE_GETDOMAIN" +EXTRA_OEMAKE_NETGROUP_libc-musl = "-DUSE_GETDOMAIN" + +EXTRA_OEMAKE_append_libc-musl = " 'LIBS='" + +do_compile () { + oe_runmake 'TABLES=-DHOSTS_DENY=\"${sysconfdir}/hosts.deny\" -DHOSTS_ALLOW=\"${sysconfdir}/hosts.allow\"' \ + all +} + +BINS = "safe_finger tcpd tcpdchk try-from tcpdmatch" +MANS3 = "hosts_access" +MANS5 = "hosts_options" +MANS8 = "tcpd tcpdchk tcpdmatch" +do_install () { + oe_libinstall -a libwrap ${D}${libdir} + oe_libinstall -C shared -so libwrap ${D}${base_libdir} + + if [ "${libdir}" != "${base_libdir}" ] ; then + rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'` + libname=`readlink ${D}${base_libdir}/libwrap.so | xargs basename` + ln -s ${rel_lib_prefix}${base_libdir}/${libname} ${D}${libdir}/libwrap.so + rm -f ${D}${base_libdir}/libwrap.so + fi + + install -d ${D}${sbindir} + for b in ${BINS}; do + install -m 0755 $b ${D}${sbindir}/ || exit 1 + done + + install -d ${D}${mandir}/man3 + for m in ${MANS3}; do + install -m 0644 $m.3 ${D}${mandir}/man3/ || exit 1 + done + + install -d ${D}${mandir}/man5 + for m in ${MANS5}; do + install -m 0644 $m.5 ${D}${mandir}/man5/ || exit 1 + done + + install -d ${D}${mandir}/man8 + for m in ${MANS8}; do + install -m 0644 $m.8 ${D}${mandir}/man8/ || exit 1 + done + + install -m 0644 ${WORKDIR}/try-from.8 ${D}${mandir}/man8/ + install -m 0644 ${WORKDIR}/safe_finger.8 ${D}${mandir}/man8/ + + install -d ${D}${includedir} + install -m 0644 tcpd.h ${D}${includedir}/ + + install -d ${D}${sysconfdir} + touch ${D}${sysconfdir}/hosts.allow + touch ${D}${sysconfdir}/hosts.deny +} + +FILES_${PN} += "${sysconfdir}/hosts.allow ${sysconfdir}/hosts.deny" diff --git a/poky/meta/recipes-extended/texi2html/files/0001-Allow-compiling-out-of-source.patch b/poky/meta/recipes-extended/texi2html/files/0001-Allow-compiling-out-of-source.patch new file mode 100644 index 000000000..0cf025ff4 --- /dev/null +++ b/poky/meta/recipes-extended/texi2html/files/0001-Allow-compiling-out-of-source.patch @@ -0,0 +1,39 @@ +From: Olaf Mandel <o.mandel@menlosystems.com> +Date: Fri, 21 Oct 2016 13:04:44 +0000 +Subject: [PATCH] Allow compiling out-of-source + +Upstream-Status: Backport of [svn://svn.sv.gnu.org/texinfo/trunk r3602] +--- + Makefile.am | 2 +- + Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 3447463..c9b5b5c 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -208,7 +208,7 @@ i18n/en.thl i18n/: $(po_document_dir)/po_document/$(PACKAGE)_document.pot + done; \ + msgexec -i $< "$(srcdir)/gettext_to_separated.pl" | "$(srcdir)/separated_to_hash.pl" en > i18n/en.thl; \ + else \ +- cp -p i18n_ref/*.thl i18n; \ ++ cp -p "$(srcdir)/i18n_ref/"*.thl i18n; \ + fi + + i18n_ref: +diff --git a/Makefile.in b/Makefile.in +index 4264b37..a13f84d 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -1126,7 +1126,7 @@ i18n/en.thl i18n/: $(po_document_dir)/po_document/$(PACKAGE)_document.pot + done; \ + msgexec -i $< "$(srcdir)/gettext_to_separated.pl" | "$(srcdir)/separated_to_hash.pl" en > i18n/en.thl; \ + else \ +- cp -p i18n_ref/*.thl i18n; \ ++ cp -p "$(srcdir)/i18n_ref/"*.thl i18n; \ + fi + + i18n_ref: +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/texi2html/texi2html_5.0.bb b/poky/meta/recipes-extended/texi2html/texi2html_5.0.bb new file mode 100644 index 000000000..afd125b08 --- /dev/null +++ b/poky/meta/recipes-extended/texi2html/texi2html_5.0.bb @@ -0,0 +1,31 @@ +SUMMARY = "Perl script that converts Texinfo to HTML" +HOMEPAGE = "http://www.nongnu.org/texi2html/" +SECTION = "console/utils" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" + +PR = "r2" + +SRC_URI = "${SAVANNAH_GNU_MIRROR}/texi2html/${BPN}-${PV}.tar.bz2 \ + file://0001-Allow-compiling-out-of-source.patch \ + " + +SRC_URI[md5sum] = "f15ac876fcdc8be865b16535f480aa54" +SRC_URI[sha256sum] = "e8a98b0ee20c495a6ab894398a065ef580272dbd5a15b1b19e8bd1bc89d9f9fa" + +inherit autotools gettext texinfo + +do_configure_prepend() { + # autotools_do_configure updates po/Makefile.in.in, we also need + # update po_document. + cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_document/ + cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_messages/ +} + +do_install_append () { + sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/texi2html +} + +FILES_${PN}-doc += "${datadir}/texinfo" + +RDEPENDS_${PN} = "perl" diff --git a/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb new file mode 100644 index 000000000..1254bc89b --- /dev/null +++ b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb @@ -0,0 +1,30 @@ +SUMMARY = "Fake version of the texinfo utility suite" +SECTION = "console/utils" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=d6bb62e73ca8b901d3f2e9d71542f4bb" +DEPENDS = "" +PV = "1.0" + +SRC_URI = "file://template.py file://COPYING" + +S = "${WORKDIR}" + +NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}" + +inherit native + +do_install_name() { + FILENAME="${D}${bindir}/$1" + # Using ln causes problems with rm_work + cp -T "${S}/template.py" "$FILENAME" + chmod +x $FILENAME +} + +do_install() { + mkdir -p "${D}${bindir}" + for i in makeinfo pod2texi texi2dvi pdftexi2dvi texindex texi2pdf \ + txixml2texi texi2any install-info ginstall-info \ + update-info-dir; do + do_install_name $i + done +} diff --git a/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING new file mode 100644 index 000000000..531cbe723 --- /dev/null +++ b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING @@ -0,0 +1,19 @@ +Copyright (c) 2014 Intel Corp. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py new file mode 100644 index 000000000..e369f7445 --- /dev/null +++ b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py @@ -0,0 +1,122 @@ +#! /usr/bin/env python3 + +# template.py (and other filenames) +# By Max Eliaser (max.eliaser@intel.com) + +# Copyright (c) 2014 Intel Corp. + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# This program acts like a dummy version of the texinfo utilities, creating +# the right output files but leaving them blank. It will parse out the name +# of the executable from argv[0] and emulate the corresponding program, so +# multiple copies of this script will exist under different names. + +import sys, os + +olong = "--output=" +Elong = "--macro-expand=" + + +this_binary = sys.argv[0].split ("/")[-1] + +# To be outputted if functionality that hasn't been stubbed yet is invoked. +stub_msg = """ +This stand-in version of %s is not yet fully capable of emulating the real +version from the GNU texinfo suite. If you see this message, file a bug report +with details on the recipe that failed. +""" % this_binary + +# Autotools setups query the version, so this is actually necessary. Some of +# them (lookin' at you, glibc) actually look for the substring "GNU texinfo," +# so we put that substring in there without actually telling a lie. +version_str = """ %s (fake texinfo, emulating GNU texinfo) 5.2 + +Super amazing version which is totally not fake in any way whatsoever. +Copyright (C) 2014 Intel Corp. Distributed under the terms of the MIT +license. +""" % this_binary + +simple_binaries = "pod2texi texi2dvi pdftexi2dvi texindex texi2pdf \ + txixml2texi install-info ginstall-info \ + update-info-dir".split () + +# These utilities use a slightly different set of options and flags. +complex_binaries = "makeinfo texi2any".split () + +valid_binaries = simple_binaries + complex_binaries + +# For generating blank output files. +def touch_file (path): + f = open (path, "w") + f.close () + +assert this_binary in valid_binaries, \ + this_binary + " is not one of " + ', '.join (valid_binaries) + +if "--version" in sys.argv: + print(version_str) + sys.exit (0) + +# For debugging +log_interceptions = False +if log_interceptions: + f = open ("/tmp/intercepted_" + this_binary, "a") + f.write (' '.join ([this_binary] + sys.argv[1:]) + '\n') + f.close () + +# Look through the options and flags, and if necessary, touch any output +# files. +arg_idx = 1 +while arg_idx < len (sys.argv): + arg = sys.argv [arg_idx] + + if arg == "--": + break + + # Something like -I . can result in a need for this (specifically the .) + elif len (arg) < 2: + pass + + # Check if -o or --output is specified. These can be used at most once. + elif arg[0] == '-' and arg[1] != '-' and arg[len (arg) - 1] == 'o': + touch_file (sys.argv[arg_idx + 1]) + sys.exit (0) + elif arg.startswith (olong): + touch_file (arg.split ("=")[1]) + sys.exit (0) + + # Check for functionality that isn't implemented yet. + else: + assert arg[0] != '-' or arg[1] == '-' or 'E' not in arg or \ + this_binary in simple_binaries, \ + "-E option not yet supported" + stub_msg + + assert not arg.startswith (Elong), \ + Elong[:-1] + " option not yet supported" + stub_msg + + arg_idx += 1 + +# The -o/--output option overrides the default. For makeinfo and texi2any, +# that default is to look for a @setfilename command in the input file. +# Otherwise, printing nothing to stdout and then exiting should suffice. +assert this_binary in simple_binaries, \ + "Don't know how to get default output file name from input file!" + \ + stub_msg + diff --git a/poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch new file mode 100644 index 000000000..c7338aa47 --- /dev/null +++ b/poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch @@ -0,0 +1,30 @@ +From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Apr 2015 17:02:13 -0700 +Subject: [PATCH] Unset need_charset_alias when building for musl + +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 +which actually shoudl be fixed in gnulib and then all downstream +projects will get it eventually. For now we apply the fix to +coreutils + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/gnulib.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: texinfo-5.2/gnulib/lib/Makefile.am +=================================================================== +--- texinfo-5.2.orig/gnulib/lib/Makefile.am ++++ texinfo-5.2/gnulib/lib/Makefile.am +@@ -378,7 +378,7 @@ install-exec-localcharset: all-local + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ diff --git a/poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch b/poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch new file mode 100644 index 000000000..ab6f1658a --- /dev/null +++ b/poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch @@ -0,0 +1,43 @@ +We already DEPEND on the native texinfo being present before building so +there isn't any need to try and build the required native texinfo binaries +before cross-compiling. This simplifies the recipe somewhat! + +Upstream-Status: Inappropriate oe specific + +Signed-off-by: Joshua Lock <josh@linux.intel.com> + +Index: texinfo-4.13/configure.ac +=================================================================== +--- texinfo-4.13.orig/configure.ac ++++ texinfo-4.13/configure.ac +@@ -100,29 +100,7 @@ AC_CANONICAL_BUILD + # $native_tools is also added to SUBDIRS in the main Makefile.am, + # so that make compiles the native tools first. + # +-if test "$cross_compiling" = no; then +- native_tools= +-else +- native_tools=tools +- test -d "$native_tools" || mkdir "$native_tools" +- confdir=`(cd "$srcdir";pwd)` +- # Make sure the secondary configure won't fail with +- # "error: source directory already configured". +- rm -f config.status +- AC_MSG_NOTICE([[Doing configure of native tools (${build}).]]) +- cd "$native_tools" || exit 1 +- # Run secondary configure in alternate environment or +- # it gets the wrong CC etc. +- # env -i gives this build host configure a clean environment; +- # consequently, we have to re-initialize $PATH. +- env -i CC="$BUILD_CC" AR="$BUILD_AR" RANLIB="$BUILD_RANLIB" \ +- PATH="$PATH" \ +- tools_only=1 \ +- ${confdir}/configure --build=${build} --host=${build} \ +- --disable-rpath --disable-nls +- cd .. || exit 1 +- AC_MSG_NOTICE([[Continuing with main configure (${host}).]]) +-fi ++native_tools= + AC_SUBST(native_tools) + AM_CONDITIONAL(TOOLS_ONLY, [[test "x$tools_only" = x1]]) + diff --git a/poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch b/poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch new file mode 100644 index 000000000..f4184399c --- /dev/null +++ b/poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch @@ -0,0 +1,65 @@ +From e89b1c57d76f5cf5acbb0d0187374f7a77bce1e2 Mon Sep 17 00:00:00 2001 +From: Edwin Plauchu <edwin.plauchu.camacho@intel.com> +Date: Tue, 29 Nov 2016 13:43:24 -0600 +Subject: [PATCH] dont-depend-on-help2man + +Upstream-Status: Inappropriate + +Signed-off-by: Marko Lindqvist <cazfi74@gmail.com> +Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com> +--- + doc/Makefile.am | 2 +- + man/Makefile.am | 12 ++++++------ + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/doc/Makefile.am b/doc/Makefile.am +index 39db834..1bb2a4f +--- a/doc/Makefile.am ++++ b/doc/Makefile.am +@@ -38,7 +38,7 @@ refcard_files = refcard/Makefile refcard/txicmdcheck \ + # Include our texinfo.tex, not Automake's. + EXTRA_DIST = epsf.tex texinfo.tex \ + fdl.texi \ +- $(man_MANS) $(TXI_XLATE) \ ++ $(TXI_XLATE) \ + $(refcard_files) texinfo-tex-test.texi \ + texinfo-ja.tex short-sample-ja.texi + +diff --git a/man/Makefile.am b/man/Makefile.am +index 6bfcb3d..a820c96 +--- a/man/Makefile.am ++++ b/man/Makefile.am +@@ -13,24 +13,24 @@ + # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + # These are generated using help2man. +-man_MANS = install-info.1 makeinfo.1 texindex.1 texi2dvi.1 ++#man_MANS = install-info.1 makeinfo.1 texindex.1 texi2dvi.1 + + # These require the build in info/, thus can't do if we failed to find a + # terminal library. + if HAVE_TERMLIBS +-man_MANS += info.1 ++#man_MANS += info.1 + endif + + # These are hand-written. +-man_MANS += info.5 texinfo.5 ++#man_MANS += info.5 texinfo.5 + + # This is generated by pod2man, but let's just run it by hand. +-man_MANS += pod2texi.1 ++#man_MANS += pod2texi.1 + + # These are just .so's to the common program. +-man_MANS += texi2any.1 texi2pdf.1 pdftexi2dvi.1 ++#man_MANS += texi2any.1 texi2pdf.1 pdftexi2dvi.1 + +-EXTRA_DIST = $(man_MANS) ginfo.h2m ++EXTRA_DIST = ginfo.h2m + + # Maintainers should be able to regenerate. + MAINTAINERCLEANFILES = $(man_MANS) +-- +2.9.3 + diff --git a/poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch b/poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch new file mode 100644 index 000000000..0b6e9fd7e --- /dev/null +++ b/poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch @@ -0,0 +1,16 @@ +install-info uses symbols from zlib so must link against it. + +Upstream-Status: Pending + +Signed-off-by: Joshua Lock <josh@linux.intel.com> + +Index: texinfo-5.1/install-info/Makefile.am +=================================================================== +--- texinfo-5.1.orig/install-info/Makefile.am ++++ texinfo-5.1/install-info/Makefile.am +@@ -34,4 +34,4 @@ AM_CPPFLAGS = \ + -I$(top_srcdir)/gnulib/lib \ + -I$(top_builddir)/gnulib/lib \ + -DLOCALEDIR=\"$(localedir)\" +-LDADD = $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL) ++LDADD = $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL) -lz diff --git a/poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch b/poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch new file mode 100644 index 000000000..f25352c63 --- /dev/null +++ b/poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch @@ -0,0 +1,256 @@ +From fe4f00459601efe0cfa75d92749a32237800a530 Mon Sep 17 00:00:00 2001 +From: Edwin Plauchu <edwin.plauchu.camacho@intel.com> +Date: Tue, 29 Nov 2016 12:27:17 -0600 +Subject: [PATCH] texinfo-4.12-zlib + +Upstream-Status: Pending + +Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> +Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com> +--- + install-info/Makefile.in | 12 ++----- + install-info/install-info.c | 79 +++++++++++++++++++++++++++------------------ + 2 files changed, 49 insertions(+), 42 deletions(-) + +diff --git a/install-info/Makefile.in b/install-info/Makefile.in +index 837d020..ba96579 100644 +--- a/install-info/Makefile.in ++++ b/install-info/Makefile.in +@@ -216,7 +208,7 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" + PROGRAMS = $(bin_PROGRAMS) + am_ginstall_info_OBJECTS = install-info.$(OBJEXT) + ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS) +-ginstall_info_LDADD = $(LDADD) ++ginstall_info_LDADD = $(LDADD) -lz + am__DEPENDENCIES_1 = + ginstall_info_DEPENDENCIES = $(top_builddir)/gnulib/lib/libgnu.a \ + $(am__DEPENDENCIES_1) +diff --git a/install-info/install-info.c b/install-info/install-info.c +index e58189c..8617787 100644 +--- a/install-info/install-info.c ++++ b/install-info/install-info.c +@@ -22,6 +22,7 @@ + #include <getopt.h> + #include <regex.h> + #include <argz.h> ++#include <zlib.h> + + #define TAB_WIDTH 8 + +@@ -684,15 +685,15 @@ The first time you invoke Info you start off looking at this node.\n\ + + Return either stdin reading the file, or a non-stdin pipe reading + the output of the compression program. */ +-FILE * ++void * + open_possibly_compressed_file (char *filename, + void (*create_callback) (char *), +- char **opened_filename, char **compression_program) ++ char **opened_filename, char **compression_program, int *is_pipe) + { + char *local_opened_filename, *local_compression_program; + int nread; + char data[13]; +- FILE *f; ++ gzFile *f; + + /* We let them pass NULL if they don't want this info, but it's easier + to always determine it. */ +@@ -700,48 +701,48 @@ open_possibly_compressed_file (char *filename, + opened_filename = &local_opened_filename; + + *opened_filename = filename; +- f = fopen (*opened_filename, FOPEN_RBIN); ++ f = gzopen (*opened_filename, FOPEN_RBIN); + if (!f) + { + *opened_filename = concat (filename, ".gz", ""); +- f = fopen (*opened_filename, FOPEN_RBIN); ++ f = gzopen (*opened_filename, FOPEN_RBIN); + } + if (!f) + { + free (*opened_filename); + *opened_filename = concat (filename, ".xz", ""); +- f = fopen (*opened_filename, FOPEN_RBIN); ++ f = gzopen (*opened_filename, FOPEN_RBIN); + } + if (!f) + { + free (*opened_filename); + *opened_filename = concat (filename, ".bz2", ""); +- f = fopen (*opened_filename, FOPEN_RBIN); ++ f = gzopen (*opened_filename, FOPEN_RBIN); + } + if (!f) + { + free (*opened_filename); + *opened_filename = concat (filename, ".lz", ""); +- f = fopen (*opened_filename, FOPEN_RBIN); ++ f = gzopen (*opened_filename, FOPEN_RBIN); + } + if (!f) + { + free (*opened_filename); + *opened_filename = concat (filename, ".lzma", ""); +- f = fopen (*opened_filename, FOPEN_RBIN); ++ f = gzopen (*opened_filename, FOPEN_RBIN); + } + #ifdef __MSDOS__ + if (!f) + { + free (*opened_filename); + *opened_filename = concat (filename, ".igz", ""); +- f = fopen (*opened_filename, FOPEN_RBIN); ++ f = gzopen (*opened_filename, FOPEN_RBIN); + } + if (!f) + { + free (*opened_filename); + *opened_filename = concat (filename, ".inz", ""); +- f = fopen (*opened_filename, FOPEN_RBIN); ++ f = gzopen (*opened_filename, FOPEN_RBIN); + } + #endif /* __MSDOS__ */ + if (!f) +@@ -757,7 +758,7 @@ open_possibly_compressed_file (char *filename, + (*create_callback) (filename); + + /* And try opening it again. */ +- f = fopen (*opened_filename, FOPEN_RBIN); ++ f = gzopen (*opened_filename, FOPEN_RBIN); + if (!f) + return 0; + } +@@ -767,26 +768,26 @@ open_possibly_compressed_file (char *filename, + + /* Read first few bytes of file rather than relying on the filename. + If the file is shorter than this it can't be usable anyway. */ +- nread = fread (data, sizeof (data), 1, f); +- if (nread != 1) ++ nread = gzread (f, data, sizeof (data)); ++ if (nread != sizeof (data)) + { +- if (nread == 0) ++ if (nread >= 0) + { + /* Try to create the file if its empty. */ +- if (feof (f) && create_callback) ++ if (gzeof(f) && create_callback) + { +- if (fclose (f) != 0) ++ if (gzclose(f) != 0) + return 0; /* unknown error closing file */ + +- if (remove (filename) != 0) ++ if (remove(filename) != 0) + return 0; /* unknown error deleting file */ + + (*create_callback) (filename); +- f = fopen (*opened_filename, FOPEN_RBIN); ++ f = gzopen (*opened_filename, FOPEN_RBIN); + if (!f) + return 0; +- nread = fread (data, sizeof (data), 1, f); +- if (nread == 0) ++ nread = gzread(f, data, sizeof (data)); ++ if (nread >= 0) + return 0; + goto determine_file_type; /* success */ + } +@@ -857,35 +858,40 @@ determine_file_type: + *compression_program = NULL; + + /* Seek back over the magic bytes. */ +- if (fseek (f, 0, 0) < 0) ++ if (gzseek (f, 0, SEEK_SET) == -1) + return 0; + + if (*compression_program) + { /* It's compressed, so open a pipe. */ ++ FILE *p; + char *command = concat (*compression_program, " -d", ""); + +- if (fclose (f) < 0) ++ if (gzclose (f) < 0) + return 0; +- f = freopen (*opened_filename, FOPEN_RBIN, stdin); +- if (!f) ++ p = freopen (*opened_filename, FOPEN_RBIN, stdin); ++ if (!p) + return 0; +- f = popen (command, "r"); +- if (!f) ++ p = popen (command, "r"); ++ if (!p) + { + /* Used for error message in calling code. */ + *opened_filename = command; + return 0; + } ++ else ++ *is_pipe = 1; ++ return p; + } + else + { +-#if O_BINARY ++#if 0 && O_BINARY + /* Since this is a text file, and we opened it in binary mode, + switch back to text mode. */ + f = freopen (*opened_filename, "r", f); + if (! f) + return 0; + #endif ++ *is_pipe = 0; + } + + return f; +@@ -904,7 +910,8 @@ readfile (char *filename, int *sizep, + void (*create_callback) (char *), char **opened_filename, + char **compression_program) + { +- FILE *f; ++ void *f; ++ int pipe_p; + int filled = 0; + int data_size = 8192; + char *data = xmalloc (data_size); +@@ -912,14 +919,20 @@ readfile (char *filename, int *sizep, + /* If they passed the space for the file name to return, use it. */ + f = open_possibly_compressed_file (filename, create_callback, + opened_filename, +- compression_program); ++ compression_program, ++ &pipe_p); + + if (!f) + return 0; + + for (;;) + { +- int nread = fread (data + filled, 1, data_size - filled, f); ++ int nread; ++ ++ if (pipe_p) ++ nread = fread (data + filled, 1, data_size - filled, f); ++ else ++ nread = gzread (f, data + filled, data_size - filled); + if (nread < 0) + return 0; + if (nread == 0) +@@ -938,8 +951,10 @@ readfile (char *filename, int *sizep, + /* We need to close the stream, since on some systems the pipe created + by popen is simulated by a temporary file which only gets removed + inside pclose. */ +- if (f != stdin) ++ if (pipe_p) + pclose (f); ++ else ++ gzclose (f); + + *sizep = filled; + return data; +-- +2.9.3 + diff --git a/poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch b/poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch new file mode 100644 index 000000000..5b7f32d9a --- /dev/null +++ b/poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch @@ -0,0 +1,17 @@ +Upstream-Status: Inappropriate [cross build specific] + +Signed-off-by: Saul Wold <sgw@linux.intel.com> + +Index: texinfo-5.1/info/Makefile.am +=================================================================== +--- texinfo-5.1.orig/info/Makefile.am ++++ texinfo-5.1/info/Makefile.am +@@ -76,7 +76,7 @@ cmd_sources = $(srcdir)/session.c $(srcd + # more than once. + funs.h: makedoc$(EXEEXT) $(cmd_sources) + rm -f $(generated_sources) +- $(top_builddir)/$(native_tools)/info/makedoc $(cmd_sources) ++ makedoc $(cmd_sources) + + # The following hack is necessary to hint make before the automatic + # dependencies are built. diff --git a/poky/meta/recipes-extended/texinfo/texinfo_6.5.bb b/poky/meta/recipes-extended/texinfo/texinfo_6.5.bb new file mode 100644 index 000000000..f966457f8 --- /dev/null +++ b/poky/meta/recipes-extended/texinfo/texinfo_6.5.bb @@ -0,0 +1,90 @@ +SUMMARY = "Documentation system for on-line information and printed output" +DESCRIPTION = "Texinfo is a documentation system that can produce both \ +online information and printed output from a single source file. The \ +GNU Project uses the Texinfo file format for most of its documentation." +HOMEPAGE = "http://www.gnu.org/software/texinfo/" +SECTION = "console/utils" +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +PROVIDES_append_class-native = " texinfo-replacement-native" + +def compress_pkg(d): + if bb.data.inherits_class('compress_doc', d): + compress = d.getVar("DOC_COMPRESS") + if compress == "gz": + return "gzip" + elif compress == "bz2": + return "bzip2" + elif compress == "xz": + return "xz" + return "" + +RDEPENDS_info += "${@compress_pkg(d)}" + +DEPENDS = "zlib ncurses texinfo-replacement-native" +DEPENDS_class-native = "zlib-native ncurses-native" + +TARGET_PATCH = "file://use_host_makedoc.patch" +TARGET_PATCH_class-native = "" + +SRC_URI = "${GNU_MIRROR}/texinfo/${BP}.tar.gz \ + file://texinfo-4.12-zlib.patch \ + file://disable-native-tools.patch \ + file://link-zip.patch \ + file://dont-depend-on-help2man.patch \ + file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ + ${TARGET_PATCH} \ + " + +SRC_URI[md5sum] = "94e8f7149876793030e5518dd8d6e956" +SRC_URI[sha256sum] = "d34272e4042c46186ddcd66bd5d980c0ca14ff734444686ccf8131f6ec8b1427" + +tex_texinfo = "texmf/tex/texinfo" + +inherit gettext autotools + +EXTRA_AUTORECONF += "-I ${S}/gnulib/m4" + +do_configure_prepend () { + # autotools_do_configure updates po/Makefile.in.in, we also need + # update po_document. + cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_document/ +} + +do_compile_prepend() { + if [ -d tools ];then + oe_runmake -C tools/gnulib/lib + fi +} + +do_install_append() { + mkdir -p ${D}${datadir}/${tex_texinfo} + install -p -m644 ${S}/doc/texinfo.tex ${S}/doc/txi-??.tex ${D}${datadir}/${tex_texinfo} + sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/texi2any ${D}${bindir}/pod2texi +} + +do_install_append_class-native() { + install -m 755 info/makedoc ${D}${bindir} +} + +PACKAGES += "info info-doc" + +FILES_info = "${bindir}/info ${bindir}/infokey ${bindir}/install-info" +FILES_info-doc = "${infodir}/info.info* ${infodir}/dir ${infodir}/info-*.info* \ + ${mandir}/man1/info.1* ${mandir}/man5/info.5* \ + ${mandir}/man1/infokey.1* ${mandir}/man1/install-info.1*" + +FILES_${PN} = "${bindir}/makeinfo ${bindir}/texi* ${bindir}/pdftexi2dvi ${bindir}/pod2texi ${datadir}/texinfo" +RDEPENDS_${PN} = "perl" +FILES_${PN}-doc = "${infodir}/texinfo* \ + ${datadir}/${tex_texinfo} \ + ${mandir}/man1 ${mandir}/man5" + +# Lie about providing the Locale::gettext_xs module. It is not actually built, +# but the code will test for it and if not found use Locale::gettext_pp instead. +# However, this causes a file dependency on perl(Locale::gettext_xs) to be +# generated, which must be satisfied. +RPROVIDES_${PN} += "perl(Locale::gettext_xs)" + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/time/time_1.8.bb b/poky/meta/recipes-extended/time/time_1.8.bb new file mode 100644 index 000000000..fb3147a73 --- /dev/null +++ b/poky/meta/recipes-extended/time/time_1.8.bb @@ -0,0 +1,21 @@ +SUMMARY = "Tool that measures CPU resources" +DESCRIPTION = "time measures many of the CPU resources, such as time and \ +memory, that other programs use." +HOMEPAGE = "http://www.gnu.org/software/time/" +SECTION = "utils" +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +inherit texinfo update-alternatives + +ALTERNATIVE_${PN} = "time" +ALTERNATIVE_PRIORITY = "100" + +BBCLASSEXTEND = "native nativesdk" + +SRC_URI = "${GNU_MIRROR}/time/time-${PV}.tar.gz" + +SRC_URI[md5sum] = "4e00dcb8c3ab11c7cf5a0d698828ac96" +SRC_URI[sha256sum] = "8a2f540155961a35ba9b84aec5e77e3ae36c74cecb4484db455960601b7a2e1b" + +inherit autotools diff --git a/poky/meta/recipes-extended/tzcode/tzcode-native_2018d.bb b/poky/meta/recipes-extended/tzcode/tzcode-native_2018d.bb new file mode 100644 index 000000000..7933a5df9 --- /dev/null +++ b/poky/meta/recipes-extended/tzcode/tzcode-native_2018d.bb @@ -0,0 +1,30 @@ +# note that we allow for us to use data later than our code version +# +SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect" +LICENSE = "PD & BSD & BSD-3-Clause" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=c679c9d6b02bc2757b3eaf8f53c43fba" + +SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz;name=tzcode \ + http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata \ + " + +UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones" + +SRC_URI[tzcode.md5sum] = "96612b4f5d7e8804fd9a0981c021be90" +SRC_URI[tzcode.sha256sum] = "7de44e85baad748d217e3fd60706f599f9aec68bce6356b163f52b0dbd40a8d9" +SRC_URI[tzdata.md5sum] = "871a7ef808eb42ebc551acdb3d661554" +SRC_URI[tzdata.sha256sum] = "5106eddceb5f1ae3a91dbd3960e1b8b11ba0dc08579a31cf0724a7691b10c054" + +S = "${WORKDIR}" + +inherit native + +EXTRA_OEMAKE += "cc='${CC}'" + +do_install () { + install -d ${D}${bindir}/ + install -m 755 zic ${D}${bindir}/ + install -m 755 zdump ${D}${bindir}/ + install -m 755 tzselect ${D}${bindir}/ +} diff --git a/poky/meta/recipes-extended/tzdata/tzdata_2018d.bb b/poky/meta/recipes-extended/tzdata/tzdata_2018d.bb new file mode 100644 index 000000000..f7fce80b7 --- /dev/null +++ b/poky/meta/recipes-extended/tzdata/tzdata_2018d.bb @@ -0,0 +1,215 @@ +SUMMARY = "Timezone data" +HOMEPAGE = "http://www.iana.org/time-zones" +SECTION = "base" +LICENSE = "PD & BSD & BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=c679c9d6b02bc2757b3eaf8f53c43fba" + +DEPENDS = "tzcode-native" + +SRC_URI = "http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata" +UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones" + +SRC_URI[tzdata.md5sum] = "871a7ef808eb42ebc551acdb3d661554" +SRC_URI[tzdata.sha256sum] = "5106eddceb5f1ae3a91dbd3960e1b8b11ba0dc08579a31cf0724a7691b10c054" + +inherit allarch + +RCONFLICTS_${PN} = "timezones timezone-africa timezone-america timezone-antarctica \ + timezone-arctic timezone-asia timezone-atlantic \ + timezone-australia timezone-europe timezone-indian \ + timezone-iso3166.tab timezone-pacific timezone-zone.tab" + +S = "${WORKDIR}" + +DEFAULT_TIMEZONE ?= "Universal" +INSTALL_TIMEZONE_FILE ?= "1" + +TZONES= "africa antarctica asia australasia europe northamerica southamerica \ + factory etcetera backward systemv \ + " +# pacificnew + +do_compile () { + for zone in ${TZONES}; do \ + ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \ + -y ${S}/yearistype.sh ${S}/${zone} ; \ + ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \ + -y ${S}/yearistype.sh ${S}/${zone} ; \ + ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \ + -y ${S}/yearistype.sh ${S}/${zone} ; \ + done +} + +do_install () { + install -d ${D}/$exec_prefix ${D}${datadir}/zoneinfo + cp -pPR ${S}/$exec_prefix ${D}/ + # libc is removing zoneinfo files from package + cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo + cp -pP "${S}/zone1970.tab" ${D}${datadir}/zoneinfo + cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo + + # Install default timezone + if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then + install -d ${D}${sysconfdir} + if [ "${INSTALL_TIMEZONE_FILE}" = "1" ]; then + echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone + fi + ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime + else + bberror "DEFAULT_TIMEZONE is set to an invalid value." + exit 1 + fi + + chown -R root:root ${D} +} + +pkg_postinst_${PN} () { + etc_lt="$D${sysconfdir}/localtime" + src="$D${sysconfdir}/timezone" + + if [ -e ${src} ] ; then + tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}") + fi + + if [ -z "${tz}" ] ; then + exit 0 + fi + + if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then + echo "You have an invalid TIMEZONE setting in ${src}" + echo "Your ${etc_lt} has been reset to Universal; enjoy!" + tz="Universal" + echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}" + if [ -L ${etc_lt} ] ; then + rm -f "${etc_lt}" + fi + ln -s "${datadir}/zoneinfo/${tz}" "${etc_lt}" + fi +} + +# Packages primarily organized by directory with a major city +# in most time zones in the base package + +PACKAGES = "tzdata tzdata-misc tzdata-posix tzdata-right tzdata-africa \ + tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \ + tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific" + +FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*" +RPROVIDES_tzdata-africa = "tzdata-africa" + +FILES_tzdata-americas += "${datadir}/zoneinfo/America/* \ + ${datadir}/zoneinfo/US/* \ + ${datadir}/zoneinfo/Brazil/* \ + ${datadir}/zoneinfo/Canada/* \ + ${datadir}/zoneinfo/Mexico/* \ + ${datadir}/zoneinfo/Chile/*" +RPROVIDES_tzdata-americas = "tzdata-americas" + +FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*" +RPROVIDES_tzdata-antarctica = "tzdata-antarctica" + +FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*" +RPROVIDES_tzdata-arctic = "tzdata-arctic" + +FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/* \ + ${datadir}/zoneinfo/Indian/* \ + ${datadir}/zoneinfo/Mideast/*" +RPROVIDES_tzdata-asia = "tzdata-asia" + +FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*" +RPROVIDES_tzdata-atlantic = "tzdata-atlantic" + +FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*" +RPROVIDES_tzdata-australia = "tzdata-australia" + +FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*" +RPROVIDES_tzdata-europe = "tzdata-europe" + +FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*" +RPROVIDES_tzdata-pacific = "tzdata-pacific" + +FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*" +RPROVIDES_tzdata-posix = "tzdata-posix" + +FILES_tzdata-right += "${datadir}/zoneinfo/right/*" +RPROVIDES_tzdata-right = "tzdata-right" + + +FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba \ + ${datadir}/zoneinfo/Egypt \ + ${datadir}/zoneinfo/Eire \ + ${datadir}/zoneinfo/Factory \ + ${datadir}/zoneinfo/GB-Eire \ + ${datadir}/zoneinfo/Hongkong \ + ${datadir}/zoneinfo/Iceland \ + ${datadir}/zoneinfo/Iran \ + ${datadir}/zoneinfo/Israel \ + ${datadir}/zoneinfo/Jamaica \ + ${datadir}/zoneinfo/Japan \ + ${datadir}/zoneinfo/Kwajalein \ + ${datadir}/zoneinfo/Libya \ + ${datadir}/zoneinfo/Navajo \ + ${datadir}/zoneinfo/Poland \ + ${datadir}/zoneinfo/Portugal \ + ${datadir}/zoneinfo/Singapore \ + ${datadir}/zoneinfo/Turkey" +RPROVIDES_tzdata-misc = "tzdata-misc" + + +FILES_${PN} += "${datadir}/zoneinfo/Pacific/Honolulu \ + ${datadir}/zoneinfo/America/Anchorage \ + ${datadir}/zoneinfo/America/Los_Angeles \ + ${datadir}/zoneinfo/America/Denver \ + ${datadir}/zoneinfo/America/Chicago \ + ${datadir}/zoneinfo/America/New_York \ + ${datadir}/zoneinfo/America/Caracas \ + ${datadir}/zoneinfo/America/Sao_Paulo \ + ${datadir}/zoneinfo/Europe/London \ + ${datadir}/zoneinfo/Europe/Paris \ + ${datadir}/zoneinfo/Africa/Cairo \ + ${datadir}/zoneinfo/Europe/Moscow \ + ${datadir}/zoneinfo/Asia/Dubai \ + ${datadir}/zoneinfo/Asia/Karachi \ + ${datadir}/zoneinfo/Asia/Dhaka \ + ${datadir}/zoneinfo/Asia/Bangkok \ + ${datadir}/zoneinfo/Asia/Hong_Kong \ + ${datadir}/zoneinfo/Asia/Tokyo \ + ${datadir}/zoneinfo/Australia/Darwin \ + ${datadir}/zoneinfo/Australia/Adelaide \ + ${datadir}/zoneinfo/Australia/Brisbane \ + ${datadir}/zoneinfo/Australia/Sydney \ + ${datadir}/zoneinfo/Pacific/Noumea \ + ${datadir}/zoneinfo/CET \ + ${datadir}/zoneinfo/CST6CDT \ + ${datadir}/zoneinfo/EET \ + ${datadir}/zoneinfo/EST \ + ${datadir}/zoneinfo/EST5EDT \ + ${datadir}/zoneinfo/GB \ + ${datadir}/zoneinfo/GMT \ + ${datadir}/zoneinfo/GMT+0 \ + ${datadir}/zoneinfo/GMT-0 \ + ${datadir}/zoneinfo/GMT0 \ + ${datadir}/zoneinfo/Greenwich \ + ${datadir}/zoneinfo/HST \ + ${datadir}/zoneinfo/MET \ + ${datadir}/zoneinfo/MST \ + ${datadir}/zoneinfo/MST7MDT \ + ${datadir}/zoneinfo/NZ \ + ${datadir}/zoneinfo/NZ-CHAT \ + ${datadir}/zoneinfo/PRC \ + ${datadir}/zoneinfo/PST8PDT \ + ${datadir}/zoneinfo/ROC \ + ${datadir}/zoneinfo/ROK \ + ${datadir}/zoneinfo/UCT \ + ${datadir}/zoneinfo/UTC \ + ${datadir}/zoneinfo/Universal \ + ${datadir}/zoneinfo/W-SU \ + ${datadir}/zoneinfo/WET \ + ${datadir}/zoneinfo/Zulu \ + ${datadir}/zoneinfo/zone.tab \ + ${datadir}/zoneinfo/zone1970.tab \ + ${datadir}/zoneinfo/iso3166.tab \ + ${datadir}/zoneinfo/Etc/*" + +CONFFILES_${PN} += "${@ "${sysconfdir}/timezone" if bb.utils.to_boolean(d.getVar('INSTALL_TIMEZONE_FILE')) else "" }" +CONFFILES_${PN} += "${sysconfdir}/localtime" diff --git a/poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch b/poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch new file mode 100644 index 000000000..afc4c734a --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch @@ -0,0 +1,403 @@ +From: Giovanni Scafora <giovanni.archlinux.org> +Subject: unzip files encoded with non-latin, non-unicode file names +Last-Update: 2015-02-11 + +Upstream-Status: Backport +CVE: CVE-2015-1315 + +Updated 2015-02-11 by Marc Deslauriers <marc.deslauriers@canonical.com> +to fix buffer overflow in charset_to_intern() + +Signed-off-by: Marc Deslauriers <marc.deslauriers@canonical.com> + +Index: unzip-6.0/unix/unix.c +=================================================================== +--- unzip-6.0.orig/unix/unix.c 2015-02-11 08:46:43.675324290 -0500 ++++ unzip-6.0/unix/unix.c 2015-02-11 09:18:04.902081319 -0500 +@@ -30,6 +30,9 @@ + #define UNZIP_INTERNAL + #include "unzip.h" + ++#include <iconv.h> ++#include <langinfo.h> ++ + #ifdef SCO_XENIX + # define SYSNDIR + #else /* SCO Unix, AIX, DNIX, TI SysV, Coherent 4.x, ... */ +@@ -1874,3 +1877,102 @@ + } + } + #endif /* QLZIP */ ++ ++ ++typedef struct { ++ char *local_charset; ++ char *archive_charset; ++} CHARSET_MAP; ++ ++/* A mapping of local <-> archive charsets used by default to convert filenames ++ * of DOS/Windows Zip archives. Currently very basic. */ ++static CHARSET_MAP dos_charset_map[] = { ++ { "ANSI_X3.4-1968", "CP850" }, ++ { "ISO-8859-1", "CP850" }, ++ { "CP1252", "CP850" }, ++ { "UTF-8", "CP866" }, ++ { "KOI8-R", "CP866" }, ++ { "KOI8-U", "CP866" }, ++ { "ISO-8859-5", "CP866" } ++}; ++ ++char OEM_CP[MAX_CP_NAME] = ""; ++char ISO_CP[MAX_CP_NAME] = ""; ++ ++/* Try to guess the default value of OEM_CP based on the current locale. ++ * ISO_CP is left alone for now. */ ++void init_conversion_charsets() ++{ ++ const char *local_charset; ++ int i; ++ ++ /* Make a guess only if OEM_CP not already set. */ ++ if(*OEM_CP == '\0') { ++ local_charset = nl_langinfo(CODESET); ++ for(i = 0; i < sizeof(dos_charset_map)/sizeof(CHARSET_MAP); i++) ++ if(!strcasecmp(local_charset, dos_charset_map[i].local_charset)) { ++ strncpy(OEM_CP, dos_charset_map[i].archive_charset, ++ sizeof(OEM_CP)); ++ break; ++ } ++ } ++} ++ ++/* Convert a string from one encoding to the current locale using iconv(). ++ * Be as non-intrusive as possible. If error is encountered during covertion ++ * just leave the string intact. */ ++static void charset_to_intern(char *string, char *from_charset) ++{ ++ iconv_t cd; ++ char *s,*d, *buf; ++ size_t slen, dlen, buflen; ++ const char *local_charset; ++ ++ if(*from_charset == '\0') ++ return; ++ ++ buf = NULL; ++ local_charset = nl_langinfo(CODESET); ++ ++ if((cd = iconv_open(local_charset, from_charset)) == (iconv_t)-1) ++ return; ++ ++ slen = strlen(string); ++ s = string; ++ ++ /* Make sure OUTBUFSIZ + 1 never ends up smaller than FILNAMSIZ ++ * as this function also gets called with G.outbuf in fileio.c ++ */ ++ buflen = FILNAMSIZ; ++ if (OUTBUFSIZ + 1 < FILNAMSIZ) ++ { ++ buflen = OUTBUFSIZ + 1; ++ } ++ ++ d = buf = malloc(buflen); ++ if(!d) ++ goto cleanup; ++ ++ bzero(buf,buflen); ++ dlen = buflen - 1; ++ ++ if(iconv(cd, &s, &slen, &d, &dlen) == (size_t)-1) ++ goto cleanup; ++ strncpy(string, buf, buflen); ++ ++ cleanup: ++ free(buf); ++ iconv_close(cd); ++} ++ ++/* Convert a string from OEM_CP to the current locale charset. */ ++inline void oem_intern(char *string) ++{ ++ charset_to_intern(string, OEM_CP); ++} ++ ++/* Convert a string from ISO_CP to the current locale charset. */ ++inline void iso_intern(char *string) ++{ ++ charset_to_intern(string, ISO_CP); ++} +Index: unzip-6.0/unix/unxcfg.h +=================================================================== +--- unzip-6.0.orig/unix/unxcfg.h 2015-02-11 08:46:43.675324290 -0500 ++++ unzip-6.0/unix/unxcfg.h 2015-02-11 08:46:43.671324260 -0500 +@@ -228,4 +228,30 @@ + /* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */ + /* and notfirstcall are used by do_wild(). */ + ++ ++#define MAX_CP_NAME 25 ++ ++#ifdef SETLOCALE ++# undef SETLOCALE ++#endif ++#define SETLOCALE(category, locale) setlocale(category, locale) ++#include <locale.h> ++ ++#ifdef _ISO_INTERN ++# undef _ISO_INTERN ++#endif ++#define _ISO_INTERN(str1) iso_intern(str1) ++ ++#ifdef _OEM_INTERN ++# undef _OEM_INTERN ++#endif ++#ifndef IZ_OEM2ISO_ARRAY ++# define IZ_OEM2ISO_ARRAY ++#endif ++#define _OEM_INTERN(str1) oem_intern(str1) ++ ++void iso_intern(char *); ++void oem_intern(char *); ++void init_conversion_charsets(void); ++ + #endif /* !__unxcfg_h */ +Index: unzip-6.0/unzip.c +=================================================================== +--- unzip-6.0.orig/unzip.c 2015-02-11 08:46:43.675324290 -0500 ++++ unzip-6.0/unzip.c 2015-02-11 08:46:43.675324290 -0500 +@@ -327,11 +327,21 @@ + -2 just filenames but allow -h/-t/-z -l long Unix \"ls -l\" format\n\ + -v verbose, multi-page format\n"; + ++#ifndef UNIX + static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\ + -h print header line -t print totals for listed files or for all\n\ + -z print zipfile comment -T print file times in sortable decimal format\ + \n -C be case-insensitive %s\ + -x exclude filenames that follow from listing\n"; ++#else /* UNIX */ ++static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\ ++ -h print header line -t print totals for listed files or for all\n\ ++ -z print zipfile comment %c-T%c print file times in sortable decimal format\ ++\n %c-C%c be case-insensitive %s\ ++ -x exclude filenames that follow from listing\n\ ++ -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives\n\ ++ -I CHARSET specify a character encoding for UNIX and other archives\n"; ++#endif /* !UNIX */ + #ifdef MORE + static ZCONST char Far ZipInfoUsageLine4[] = + " -M page output through built-in \"more\"\n"; +@@ -664,6 +674,17 @@ + -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\ + -C match filenames case-insensitively -L make (some) names \ + lowercase\n %-42s -V retain VMS version numbers\n%s"; ++#elif (defined UNIX) ++static ZCONST char Far UnzipUsageLine4[] = "\ ++modifiers:\n\ ++ -n never overwrite existing files -q quiet mode (-qq => quieter)\n\ ++ -o overwrite files WITHOUT prompting -a auto-convert any text files\n\ ++ -j junk paths (do not make directories) -aa treat ALL files as text\n\ ++ -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\ ++ -C match filenames case-insensitively -L make (some) names \ ++lowercase\n %-42s -V retain VMS version numbers\n%s\ ++ -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives\n\ ++ -I CHARSET specify a character encoding for UNIX and other archives\n\n"; + #else /* !VMS */ + static ZCONST char Far UnzipUsageLine4[] = "\ + modifiers:\n\ +@@ -802,6 +823,10 @@ + #endif /* UNICODE_SUPPORT */ + + ++#ifdef UNIX ++ init_conversion_charsets(); ++#endif ++ + #if (defined(__IBMC__) && defined(__DEBUG_ALLOC__)) + extern void DebugMalloc(void); + +@@ -1335,6 +1360,11 @@ + argc = *pargc; + argv = *pargv; + ++#ifdef UNIX ++ extern char OEM_CP[MAX_CP_NAME]; ++ extern char ISO_CP[MAX_CP_NAME]; ++#endif ++ + while (++argv, (--argc > 0 && *argv != NULL && **argv == '-')) { + s = *argv + 1; + while ((c = *s++) != 0) { /* "!= 0": prevent Turbo C warning */ +@@ -1516,6 +1546,35 @@ + } + break; + #endif /* MACOS */ ++#ifdef UNIX ++ case ('I'): ++ if (negative) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: encodings can't be negated")); ++ return(PK_PARAM); ++ } else { ++ if(*s) { /* Handle the -Icharset case */ ++ /* Assume that charsets can't start with a dash to spot arguments misuse */ ++ if(*s == '-') { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ strncpy(ISO_CP, s, sizeof(ISO_CP)); ++ } else { /* -I charset */ ++ ++argv; ++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ s = *argv; ++ strncpy(ISO_CP, s, sizeof(ISO_CP)); ++ } ++ while(*(++s)); /* No params straight after charset name */ ++ } ++ break; ++#endif /* ?UNIX */ + case ('j'): /* junk pathnames/directory structure */ + if (negative) + uO.jflag = FALSE, negative = 0; +@@ -1591,6 +1650,35 @@ + } else + ++uO.overwrite_all; + break; ++#ifdef UNIX ++ case ('O'): ++ if (negative) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: encodings can't be negated")); ++ return(PK_PARAM); ++ } else { ++ if(*s) { /* Handle the -Ocharset case */ ++ /* Assume that charsets can't start with a dash to spot arguments misuse */ ++ if(*s == '-') { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ strncpy(OEM_CP, s, sizeof(OEM_CP)); ++ } else { /* -O charset */ ++ ++argv; ++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -O argument")); ++ return(PK_PARAM); ++ } ++ s = *argv; ++ strncpy(OEM_CP, s, sizeof(OEM_CP)); ++ } ++ while(*(++s)); /* No params straight after charset name */ ++ } ++ break; ++#endif /* ?UNIX */ + case ('p'): /* pipes: extract to stdout, no messages */ + if (negative) { + uO.cflag = FALSE; +Index: unzip-6.0/unzpriv.h +=================================================================== +--- unzip-6.0.orig/unzpriv.h 2015-02-11 08:46:43.675324290 -0500 ++++ unzip-6.0/unzpriv.h 2015-02-11 08:46:43.675324290 -0500 +@@ -3008,7 +3008,7 @@ + !(((islochdr) || (isuxatt)) && \ + ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \ + (hostnum) == FS_HPFS_ || \ +- ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \ ++ ((hostnum) == FS_NTFS_ /* && (hostver) == 50 */ )) { \ + _OEM_INTERN((string)); \ + } else { \ + _ISO_INTERN((string)); \ +Index: unzip-6.0/zipinfo.c +=================================================================== +--- unzip-6.0.orig/zipinfo.c 2015-02-11 08:46:43.675324290 -0500 ++++ unzip-6.0/zipinfo.c 2015-02-11 08:46:43.675324290 -0500 +@@ -457,6 +457,10 @@ + int tflag_slm=TRUE, tflag_2v=FALSE; + int explicit_h=FALSE, explicit_t=FALSE; + ++#ifdef UNIX ++ extern char OEM_CP[MAX_CP_NAME]; ++ extern char ISO_CP[MAX_CP_NAME]; ++#endif + + #ifdef MACOS + uO.lflag = LFLAG; /* reset default on each call */ +@@ -501,6 +505,35 @@ + uO.lflag = 0; + } + break; ++#ifdef UNIX ++ case ('I'): ++ if (negative) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: encodings can't be negated")); ++ return(PK_PARAM); ++ } else { ++ if(*s) { /* Handle the -Icharset case */ ++ /* Assume that charsets can't start with a dash to spot arguments misuse */ ++ if(*s == '-') { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ strncpy(ISO_CP, s, sizeof(ISO_CP)); ++ } else { /* -I charset */ ++ ++argv; ++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ s = *argv; ++ strncpy(ISO_CP, s, sizeof(ISO_CP)); ++ } ++ while(*(++s)); /* No params straight after charset name */ ++ } ++ break; ++#endif /* ?UNIX */ + case 'l': /* longer form of "ls -l" type listing */ + if (negative) + uO.lflag = -2, negative = 0; +@@ -521,6 +554,35 @@ + G.M_flag = TRUE; + break; + #endif ++#ifdef UNIX ++ case ('O'): ++ if (negative) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: encodings can't be negated")); ++ return(PK_PARAM); ++ } else { ++ if(*s) { /* Handle the -Ocharset case */ ++ /* Assume that charsets can't start with a dash to spot arguments misuse */ ++ if(*s == '-') { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -I argument")); ++ return(PK_PARAM); ++ } ++ strncpy(OEM_CP, s, sizeof(OEM_CP)); ++ } else { /* -O charset */ ++ ++argv; ++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) { ++ Info(slide, 0x401, ((char *)slide, ++ "error: a valid character encoding should follow the -O argument")); ++ return(PK_PARAM); ++ } ++ s = *argv; ++ strncpy(OEM_CP, s, sizeof(OEM_CP)); ++ } ++ while(*(++s)); /* No params straight after charset name */ ++ } ++ break; ++#endif /* ?UNIX */ + case 's': /* default: shorter "ls -l" type listing */ + if (negative) + uO.lflag = -2, negative = 0; diff --git a/poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch b/poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch new file mode 100644 index 000000000..0e497cc65 --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch @@ -0,0 +1,53 @@ +From: sms +Subject: Fix CVE-2014-8139: CRC32 verification heap-based overflow +Bug-Debian: http://bugs.debian.org/773722 + +The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz + +Upstream-Status: Backport +CVE: CVE-2014-8139 + +Signed-off-by: Roy Li <rongqing.li@windriver.com> + +--- a/extract.c ++++ b/extract.c +@@ -298,6 +298,8 @@ + #ifndef SFX + static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \ + EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n"; ++ static ZCONST char Far TooSmallEBlength[] = "bad extra-field entry:\n \ ++ EF block length (%u bytes) invalid (< %d)\n"; + static ZCONST char Far InvalidComprDataEAs[] = + " invalid compressed data for EAs\n"; + # if (defined(WIN32) && defined(NTSD_EAS)) +@@ -2023,7 +2025,8 @@ + ebID = makeword(ef); + ebLen = (unsigned)makeword(ef+EB_LEN); + +- if (ebLen > (ef_len - EB_HEADSIZE)) { ++ if (ebLen > (ef_len - EB_HEADSIZE)) ++ { + /* Discovered some extra field inconsistency! */ + if (uO.qflag) + Info(slide, 1, ((char *)slide, "%-22s ", +@@ -2158,11 +2161,19 @@ + } + break; + case EF_PKVMS: +- if (makelong(ef+EB_HEADSIZE) != ++ if (ebLen < 4) ++ { ++ Info(slide, 1, ++ ((char *)slide, LoadFarString(TooSmallEBlength), ++ ebLen, 4)); ++ } ++ else if (makelong(ef+EB_HEADSIZE) != + crc32(CRCVAL_INITIAL, ef+(EB_HEADSIZE+4), + (extent)(ebLen-4))) ++ { + Info(slide, 1, ((char *)slide, + LoadFarString(BadCRC_EAs))); ++ } + break; + case EF_PKW32: + case EF_PKUNIX: diff --git a/poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch b/poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch new file mode 100644 index 000000000..ca4aaadff --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch @@ -0,0 +1,36 @@ +From: sms +Subject: Fix CVE-2014-8140: out-of-bounds write issue in test_compr_eb() +Bug-Debian: http://bugs.debian.org/773722 + +The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz + +Upstream-Status: Backport +CVE: CVE-2014-8140 + +Signed-off-by: Roy Li <rongqing.li@windriver.com> + +Index: unzip60/extract.c +=================================================================== +--- unzip60.orig/extract.c ++++ unzip60/extract.c +@@ -2233,10 +2233,17 @@ static int test_compr_eb(__G__ eb, eb_si + if (compr_offset < 4) /* field is not compressed: */ + return PK_OK; /* do nothing and signal OK */ + ++ /* Return no/bad-data error status if any problem is found: ++ * 1. eb_size is too small to hold the uncompressed size ++ * (eb_ucsize). (Else extract eb_ucsize.) ++ * 2. eb_ucsize is zero (invalid). 2014-12-04 SMS. ++ * 3. eb_ucsize is positive, but eb_size is too small to hold ++ * the compressed data header. ++ */ + if ((eb_size < (EB_UCSIZE_P + 4)) || +- ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L && +- eb_size <= (compr_offset + EB_CMPRHEADLEN))) +- return IZ_EF_TRUNC; /* no compressed data! */ ++ ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) || ++ ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN)))) ++ return IZ_EF_TRUNC; /* no/bad compressed data! */ + + method = makeword(eb + (EB_HEADSIZE + compr_offset)); + if ((method == STORED) && diff --git a/poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch b/poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch new file mode 100644 index 000000000..c48c23f30 --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch @@ -0,0 +1,145 @@ +From: sms +Subject: Fix CVE-2014-8141: out-of-bounds read issues in getZip64Data() +Bug-Debian: http://bugs.debian.org/773722 + +The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz + +Upstream-Status: Backport +CVE: CVE-2014-8141 + +Signed-off-by: Roy Li <rongqing.li@windriver.com> + + +--- a/fileio.c ++++ b/fileio.c +@@ -176,6 +176,8 @@ + #endif + static ZCONST char Far ExtraFieldTooLong[] = + "warning: extra field too long (%d). Ignoring...\n"; ++static ZCONST char Far ExtraFieldCorrupt[] = ++ "warning: extra field (type: 0x%04x) corrupt. Continuing...\n"; + + #ifdef WINDLL + static ZCONST char Far DiskFullQuery[] = +@@ -2295,7 +2297,12 @@ + if (readbuf(__G__ (char *)G.extra_field, length) == 0) + return PK_EOF; + /* Looks like here is where extra fields are read */ +- getZip64Data(__G__ G.extra_field, length); ++ if (getZip64Data(__G__ G.extra_field, length) != PK_COOL) ++ { ++ Info(slide, 0x401, ((char *)slide, ++ LoadFarString( ExtraFieldCorrupt), EF_PKSZ64)); ++ error = PK_WARN; ++ } + #ifdef UNICODE_SUPPORT + G.unipath_filename = NULL; + if (G.UzO.U_flag < 2) { +--- a/process.c ++++ b/process.c +@@ -1,5 +1,5 @@ + /* +- Copyright (c) 1990-2009 Info-ZIP. All rights reserved. ++ Copyright (c) 1990-2014 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2009-Jan-02 or later + (the contents of which are also included in unzip.h) for terms of use. +@@ -1901,48 +1901,82 @@ + and a 4-byte version of disk start number. + Sets both local header and central header fields. Not terribly clever, + but it means that this procedure is only called in one place. ++ ++ 2014-12-05 SMS. ++ Added checks to ensure that enough data are available before calling ++ makeint64() or makelong(). Replaced various sizeof() values with ++ simple ("4" or "8") constants. (The Zip64 structures do not depend ++ on our variable sizes.) Error handling is crude, but we should now ++ stay within the buffer. + ---------------------------------------------------------------------------*/ + ++#define Z64FLGS 0xffff ++#define Z64FLGL 0xffffffff ++ + if (ef_len == 0 || ef_buf == NULL) + return PK_COOL; + + Trace((stderr,"\ngetZip64Data: scanning extra field of length %u\n", + ef_len)); + +- while (ef_len >= EB_HEADSIZE) { ++ while (ef_len >= EB_HEADSIZE) ++ { + eb_id = makeword(EB_ID + ef_buf); + eb_len = makeword(EB_LEN + ef_buf); + +- if (eb_len > (ef_len - EB_HEADSIZE)) { +- /* discovered some extra field inconsistency! */ ++ if (eb_len > (ef_len - EB_HEADSIZE)) ++ { ++ /* Extra block length exceeds remaining extra field length. */ + Trace((stderr, + "getZip64Data: block length %u > rest ef_size %u\n", eb_len, + ef_len - EB_HEADSIZE)); + break; + } +- if (eb_id == EF_PKSZ64) { +- ++ if (eb_id == EF_PKSZ64) ++ { + int offset = EB_HEADSIZE; + +- if (G.crec.ucsize == 0xffffffff || G.lrec.ucsize == 0xffffffff){ +- G.lrec.ucsize = G.crec.ucsize = makeint64(offset + ef_buf); +- offset += sizeof(G.crec.ucsize); ++ if ((G.crec.ucsize == Z64FLGL) || (G.lrec.ucsize == Z64FLGL)) ++ { ++ if (offset+ 8 > ef_len) ++ return PK_ERR; ++ ++ G.crec.ucsize = G.lrec.ucsize = makeint64(offset + ef_buf); ++ offset += 8; + } +- if (G.crec.csize == 0xffffffff || G.lrec.csize == 0xffffffff){ +- G.csize = G.lrec.csize = G.crec.csize = makeint64(offset + ef_buf); +- offset += sizeof(G.crec.csize); ++ ++ if ((G.crec.csize == Z64FLGL) || (G.lrec.csize == Z64FLGL)) ++ { ++ if (offset+ 8 > ef_len) ++ return PK_ERR; ++ ++ G.csize = G.crec.csize = G.lrec.csize = makeint64(offset + ef_buf); ++ offset += 8; + } +- if (G.crec.relative_offset_local_header == 0xffffffff){ ++ ++ if (G.crec.relative_offset_local_header == Z64FLGL) ++ { ++ if (offset+ 8 > ef_len) ++ return PK_ERR; ++ + G.crec.relative_offset_local_header = makeint64(offset + ef_buf); +- offset += sizeof(G.crec.relative_offset_local_header); ++ offset += 8; + } +- if (G.crec.disk_number_start == 0xffff){ ++ ++ if (G.crec.disk_number_start == Z64FLGS) ++ { ++ if (offset+ 4 > ef_len) ++ return PK_ERR; ++ + G.crec.disk_number_start = (zuvl_t)makelong(offset + ef_buf); +- offset += sizeof(G.crec.disk_number_start); ++ offset += 4; + } ++#if 0 ++ break; /* Expect only one EF_PKSZ64 block. */ ++#endif /* 0 */ + } + +- /* Skip this extra field block */ ++ /* Skip this extra field block. */ + ef_buf += (eb_len + EB_HEADSIZE); + ef_len -= (eb_len + EB_HEADSIZE); + } diff --git a/poky/meta/recipes-extended/unzip/unzip/18-cve-2014-9913-unzip-buffer-overflow.patch b/poky/meta/recipes-extended/unzip/unzip/18-cve-2014-9913-unzip-buffer-overflow.patch new file mode 100644 index 000000000..3c02d596c --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/18-cve-2014-9913-unzip-buffer-overflow.patch @@ -0,0 +1,33 @@ +From: "Steven M. Schweda" <sms@antinode.info> +Subject: Fix CVE-2014-9913, buffer overflow in unzip +Bug: https://sourceforge.net/p/infozip/bugs/27/ +Bug-Debian: https://bugs.debian.org/847485 +Bug-Ubuntu: https://launchpad.net/bugs/387350 +X-Debian-version: 6.0-21 + +Upstream-Status: Backport +CVE: CVE-2014-9913 +Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> + +--- a/list.c ++++ b/list.c +@@ -339,7 +339,18 @@ + G.crec.compression_method == ENHDEFLATED) { + methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3]; + } else if (methnum >= NUM_METHODS) { +- sprintf(&methbuf[4], "%03u", G.crec.compression_method); ++ /* 2013-02-26 SMS. ++ * http://sourceforge.net/p/infozip/bugs/27/ CVE-2014-9913. ++ * Unexpectedly large compression methods overflow ++ * &methbuf[]. Use the old, three-digit decimal format ++ * for values which fit. Otherwise, sacrifice the ++ * colon, and use four-digit hexadecimal. ++ */ ++ if (G.crec.compression_method <= 999) { ++ sprintf( &methbuf[ 4], "%03u", G.crec.compression_method); ++ } else { ++ sprintf( &methbuf[ 3], "%04X", G.crec.compression_method); ++ } + } + + #if 0 /* GRR/Euro: add this? */ diff --git a/poky/meta/recipes-extended/unzip/unzip/19-cve-2016-9844-zipinfo-buffer-overflow.patch b/poky/meta/recipes-extended/unzip/unzip/19-cve-2016-9844-zipinfo-buffer-overflow.patch new file mode 100644 index 000000000..ffadbc2ef --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/19-cve-2016-9844-zipinfo-buffer-overflow.patch @@ -0,0 +1,32 @@ +From: "Steven M. Schweda" <sms@antinode.info> +Subject: Fix CVE-2016-9844, buffer overflow in zipinfo +Bug-Debian: https://bugs.debian.org/847486 +Bug-Ubuntu: https://launchpad.net/bugs/1643750 +X-Debian-version: 6.0-21 + +Upstream-Status: Backport +CVE: CVE-2016-9844 +Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> + +--- a/zipinfo.c ++++ b/zipinfo.c +@@ -1921,7 +1921,18 @@ + ush dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3); + methbuf[3] = dtype[dnum]; + } else if (methnum >= NUM_METHODS) { /* unknown */ +- sprintf(&methbuf[1], "%03u", G.crec.compression_method); ++ /* 2016-12-05 SMS. ++ * https://launchpad.net/bugs/1643750 ++ * Unexpectedly large compression methods overflow ++ * &methbuf[]. Use the old, three-digit decimal format ++ * for values which fit. Otherwise, sacrifice the "u", ++ * and use four-digit hexadecimal. ++ */ ++ if (G.crec.compression_method <= 999) { ++ sprintf( &methbuf[ 1], "%03u", G.crec.compression_method); ++ } else { ++ sprintf( &methbuf[ 0], "%04X", G.crec.compression_method); ++ } + } + + for (k = 0; k < 15; ++k) diff --git a/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch b/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch new file mode 100644 index 000000000..87eed965d --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch @@ -0,0 +1,39 @@ +Upstream-Status: Backport +CVE: CVE-2015-7696 +Signed-off-by: Tudor Florea <tudor.flore@enea.com> + +From 68efed87fabddd450c08f3112f62a73f61d493c9 Mon Sep 17 00:00:00 2001 +From: Petr Stodulka <pstodulk@redhat.com> +Date: Mon, 14 Sep 2015 18:23:17 +0200 +Subject: [PATCH 1/2] upstream fix for heap overflow + +https://bugzilla.redhat.com/attachment.cgi?id=1073002 +--- + crypt.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/crypt.c b/crypt.c +index 784e411..a8975f2 100644 +--- a/crypt.c ++++ b/crypt.c +@@ -465,7 +465,17 @@ int decrypt(__G__ passwrd) + GLOBAL(pInfo->encrypted) = FALSE; + defer_leftover_input(__G); + for (n = 0; n < RAND_HEAD_LEN; n++) { +- b = NEXTBYTE; ++ /* 2012-11-23 SMS. (OUSPG report.) ++ * Quit early if compressed size < HEAD_LEN. The resulting ++ * error message ("unable to get password") could be improved, ++ * but it's better than trying to read nonexistent data, and ++ * then continuing with a negative G.csize. (See ++ * fileio.c:readbyte()). ++ */ ++ if ((b = NEXTBYTE) == (ush)EOF) ++ { ++ return PK_ERR; ++ } + h[n] = (uch)b; + Trace((stdout, " (%02x)", h[n])); + } +-- +2.4.6 diff --git a/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch b/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch new file mode 100644 index 000000000..a8f293674 --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch @@ -0,0 +1,32 @@ +Upstream-Status: Backport +CVE: CVE-2015-7697 +Signed-off-by: Tudor Florea <tudor.flore@enea.com> + +From bd8a743ee0a77e65ad07ef4196c4cd366add3f26 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka <kdudka@redhat.com> +Date: Mon, 14 Sep 2015 18:24:56 +0200 +Subject: [PATCH 2/2] fix infinite loop when extracting empty bzip2 data + +--- + extract.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/extract.c b/extract.c +index 7134bfe..29db027 100644 +--- a/extract.c ++++ b/extract.c +@@ -2733,6 +2733,12 @@ __GDEF + int repeated_buf_err; + bz_stream bstrm; + ++ if (G.incnt <= 0 && G.csize <= 0L) { ++ /* avoid an infinite loop */ ++ Trace((stderr, "UZbunzip2() got empty input\n")); ++ return 2; ++ } ++ + #if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + if (G.redirect_slide) + wsize = G.redirect_size, redirSlide = G.redirect_buffer; +-- +2.4.6 diff --git a/poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch b/poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch new file mode 100644 index 000000000..8f30e4267 --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch @@ -0,0 +1,50 @@ +Upstream-Status: Pending + +unix/Makefile: remove hard coded strip commands + +Remove the hard coded strip commands, both LF2 (used in linking) and +STRIP used alone. + +Signed-off-by: Mark Hatle <mark.hatle@windriver.com> + +diff -ur unzip60.orig/unix/configure unzip60/unix/configure +--- unzip60.orig/unix/configure 2009-04-16 14:25:12.000000000 -0500 ++++ unzip60/unix/configure 2011-06-21 11:23:36.822849960 -0500 +@@ -17,7 +17,7 @@ + IZ_BZIP2=${3} + CFLAGS="${CFLAGS} -I. -DUNIX" + LFLAGS1="" +-LFLAGS2="-s" ++LFLAGS2="" + LN="ln -s" + + CFLAGS_OPT='' +diff -ur unzip60.orig/unix/Makefile unzip60/unix/Makefile +--- unzip60.orig/unix/Makefile 2009-01-18 16:41:18.000000000 -0600 ++++ unzip60/unix/Makefile 2011-06-21 11:12:22.900003388 -0500 +@@ -52,7 +52,7 @@ + CF = $(CFLAGS) $(CF_NOOPT) + LFLAGS1 = + LF = -o unzip$E $(LFLAGS1) +-LF2 = -s ++LF2 = + + # UnZipSFX flags + SL = -o unzipsfx$E $(LFLAGS1) +@@ -70,7 +70,7 @@ + CHMOD = chmod + BINPERMS = 755 + MANPERMS = 644 +-STRIP = strip ++STRIP = + E = + O = .o + M = unix +@@ -776,7 +776,6 @@ + # + gcc: unix_make + $(MAKE) unzips CC=gcc LD=gcc CFLAGS="-O3" LF2="" +- $(STRIP) $(UNZIPS) + + # Heurikon HK68 (68010), UniPlus+ System V 5.0, Green Hills C-68000 + hk68: unix_make diff --git a/poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch b/poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch new file mode 100644 index 000000000..5fcd318b2 --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch @@ -0,0 +1,46 @@ +From 190040ebfcf5395a6ccedede2cc9343d34f0a108 Mon Sep 17 00:00:00 2001 +From: mancha <mancha1 AT zoho DOT com> +Date: Wed, 11 Feb 2015 +Subject: Info-ZIP UnZip buffer overflow + +Upstream-Status: Backport +CVE: CVE-2014-9636 + +By carefully crafting a corrupt ZIP archive with "extra fields" that +purport to have compressed blocks larger than the corresponding +uncompressed blocks in STORED no-compression mode, an attacker can +trigger a heap overflow that can result in application crash or +possibly have other unspecified impact. + +This patch ensures that when extra fields use STORED mode, the +"compressed" and uncompressed block sizes match. + +Signed-off-by: mancha <mancha1 AT zoho DOT com> +--- + extract.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/extract.c ++++ b/extract.c +@@ -2217,6 +2217,7 @@ static int test_compr_eb(__G__ eb, eb_si + ulg eb_ucsize; + uch *eb_ucptr; + int r; ++ ush method; + + if (compr_offset < 4) /* field is not compressed: */ + return PK_OK; /* do nothing and signal OK */ +@@ -2226,6 +2227,13 @@ static int test_compr_eb(__G__ eb, eb_si + eb_size <= (compr_offset + EB_CMPRHEADLEN))) + return IZ_EF_TRUNC; /* no compressed data! */ + ++ method = makeword(eb + (EB_HEADSIZE + compr_offset)); ++ if ((method == STORED) && ++ (eb_size - compr_offset - EB_CMPRHEADLEN != eb_ucsize)) ++ return PK_ERR; /* compressed & uncompressed ++ * should match in STORED ++ * method */ ++ + if ( + #ifdef INT_16BIT + (((ulg)(extent)eb_ucsize) != eb_ucsize) || diff --git a/poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch b/poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch new file mode 100644 index 000000000..659c6e331 --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch @@ -0,0 +1,18 @@ +Pass LDFLAGS to the linker + +Upstream-Status: Pending + +Signed-off-by: Mikhail Durnev <Mikhail_Durnev@mentor.com> + +diff -Naur old/unix/configure new/unix/configure +--- old/unix/configure 2014-01-13 21:59:27.000000000 +1100 ++++ new/unix/configure 2014-01-14 16:36:02.000000000 +1100 +@@ -16,7 +16,7 @@ + CFLAGSR=${CFLAGS} + IZ_BZIP2=${3} + CFLAGS="${CFLAGS} -I. -DUNIX" +-LFLAGS1="" ++LFLAGS1=${LDFLAGS} + LFLAGS2="" + LN="ln -s" + diff --git a/poky/meta/recipes-extended/unzip/unzip/fix-security-format.patch b/poky/meta/recipes-extended/unzip/unzip/fix-security-format.patch new file mode 100644 index 000000000..8e9b06c42 --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip/fix-security-format.patch @@ -0,0 +1,97 @@ +unzip: Fixing security formatting issues + +Fix security formatting issues related to sprintf parameters expeted. + +[YOCTO #9551] +[https://bugzilla.yoctoproject.org/show_bug.cgi?id=9551] + +Upstream-Status: Pending + +Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com> + +diff --git a/extract.c b/extract.c +index 7cd9123..25c5a62 100644 +--- a/extract.c ++++ b/extract.c +@@ -475,7 +475,7 @@ int extract_or_test_files(__G) /* return PK-type error code */ + Info(slide, 0x401, ((char *)slide, + LoadFarString(CentSigMsg), j + blknum*DIR_BLKSIZ + 1)); + Info(slide, 0x401, ((char *)slide, +- LoadFarString(ReportMsg))); ++ "%s",LoadFarString(ReportMsg))); + error_in_archive = PK_BADERR; + } + reached_end = TRUE; /* ...so no more left to do */ +@@ -754,8 +754,8 @@ int extract_or_test_files(__G) /* return PK-type error code */ + + #ifndef SFX + if (no_endsig_found) { /* just to make sure */ +- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); +- Info(slide, 0x401, ((char *)slide, LoadFarString(ReportMsg))); ++ Info(slide, 0x401, ((char *)slide, "%s", LoadFarString(EndSigMsg))); ++ Info(slide, 0x401, ((char *)slide, "%s", LoadFarString(ReportMsg))); + if (!error_in_archive) /* don't overwrite stronger error */ + error_in_archive = PK_WARN; + } +diff --git a/list.c b/list.c +index 15e0011..0b484f6 100644 +--- a/list.c ++++ b/list.c +@@ -181,7 +181,7 @@ int list_files(__G) /* return PK-type error code */ + Info(slide, 0x401, + ((char *)slide, LoadFarString(CentSigMsg), j)); + Info(slide, 0x401, +- ((char *)slide, LoadFarString(ReportMsg))); ++ ((char *)slide, "%s", LoadFarString(ReportMsg))); + return PK_BADERR; /* sig not found */ + } + } +@@ -507,7 +507,7 @@ int list_files(__G) /* return PK-type error code */ + && (!G.ecrec.is_zip64_archive) + && (memcmp(G.sig, end_central_sig, 4) != 0) + ) { /* just to make sure again */ +- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); ++ Info(slide, 0x401, ((char *)slide, "%s", LoadFarString(EndSigMsg))); + error_in_archive = PK_WARN; /* didn't find sig */ + } + +@@ -591,7 +591,7 @@ int get_time_stamp(__G__ last_modtime, nmember) /* return PK-type error code */ + Info(slide, 0x401, + ((char *)slide, LoadFarString(CentSigMsg), j)); + Info(slide, 0x401, +- ((char *)slide, LoadFarString(ReportMsg))); ++ ((char *)slide, "%s", LoadFarString(ReportMsg))); + return PK_BADERR; /* sig not found */ + } + } +@@ -674,7 +674,7 @@ int get_time_stamp(__G__ last_modtime, nmember) /* return PK-type error code */ + ---------------------------------------------------------------------------*/ + + if (memcmp(G.sig, end_central_sig, 4)) { /* just to make sure again */ +- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); ++ Info(slide, 0x401, ((char *)slide, "%s", LoadFarString(EndSigMsg))); + error_in_archive = PK_WARN; + } + if (*nmember == 0L && error_in_archive <= PK_WARN) +diff --git a/zipinfo.c b/zipinfo.c +index 0ac75b3..1e7fa82 100644 +--- a/zipinfo.c ++++ b/zipinfo.c +@@ -833,7 +833,7 @@ int zipinfo(__G) /* return PK-type error code */ + Info(slide, 0x401, + ((char *)slide, LoadFarString(CentSigMsg), j)); + Info(slide, 0x401, +- ((char *)slide, LoadFarString(ReportMsg))); ++ ((char *)slide, "%s", LoadFarString(ReportMsg))); + error_in_archive = PK_BADERR; /* sig not found */ + break; + } +@@ -1022,7 +1022,7 @@ int zipinfo(__G) /* return PK-type error code */ + && (!G.ecrec.is_zip64_archive) + && (memcmp(G.sig, end_central_sig, 4) != 0) + ) { /* just to make sure again */ +- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); ++ Info(slide, 0x401, ((char *)slide, "%s", LoadFarString(EndSigMsg))); + error_in_archive = PK_WARN; /* didn't find sig */ + } + diff --git a/poky/meta/recipes-extended/unzip/unzip_6.0.bb b/poky/meta/recipes-extended/unzip/unzip_6.0.bb new file mode 100644 index 000000000..105d048f5 --- /dev/null +++ b/poky/meta/recipes-extended/unzip/unzip_6.0.bb @@ -0,0 +1,61 @@ +SUMMARY = "Utilities for extracting and viewing files in .zip archives" +HOMEPAGE = "http://www.info-zip.org" +SECTION = "console/utils" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=94caec5a51ef55ef711ee4e8b1c69e29" +PE = "1" +PR = "r5" + +SRC_URI = "${SOURCEFORGE_MIRROR}/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz \ + file://avoid-strip.patch \ + file://define-ldflags.patch \ + file://06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch \ + file://cve-2014-9636.patch \ + file://09-cve-2014-8139-crc-overflow.patch \ + file://10-cve-2014-8140-test-compr-eb.patch \ + file://11-cve-2014-8141-getzip64data.patch \ + file://CVE-2015-7696.patch \ + file://CVE-2015-7697.patch \ + file://fix-security-format.patch \ + file://18-cve-2014-9913-unzip-buffer-overflow.patch \ + file://19-cve-2016-9844-zipinfo-buffer-overflow.patch \ +" +UPSTREAM_VERSION_UNKNOWN = "1" + +SRC_URI[md5sum] = "62b490407489521db863b523a7f86375" +SRC_URI[sha256sum] = "036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37" + +# exclude version 5.5.2 which triggers a false positive +UPSTREAM_CHECK_REGEX = "unzip(?P<pver>(?!552).+)\.tgz" + +S = "${WORKDIR}/unzip60" + +# Makefile uses CF_NOOPT instead of CFLAGS. We lifted the values from +# Makefile and add CFLAGS. Optimization will be overriden by unzip +# configure to be -O3. +# +EXTRA_OEMAKE = "-e MAKEFLAGS= STRIP=true LF2='' \ + 'CF_NOOPT=-I. -Ibzip2 -DUNIX ${CFLAGS}'" + +export LD = "${CC}" +LD_class-native = "${CC}" + +do_compile() { + oe_runmake -f unix/Makefile generic +} + +do_install() { + oe_runmake -f unix/Makefile install prefix=${D}${prefix} + install -d ${D}${mandir} + mv ${D}${prefix}/man/* ${D}${mandir} + rmdir ${D}${prefix}/man/ +} + +inherit update-alternatives + +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_${PN} = "unzip" +ALTERNATIVE_LINK_NAME[unzip] = "${bindir}/unzip" + +BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-extended/watchdog/watchdog-config.bb b/poky/meta/recipes-extended/watchdog/watchdog-config.bb new file mode 100644 index 000000000..8bf40f0f0 --- /dev/null +++ b/poky/meta/recipes-extended/watchdog/watchdog-config.bb @@ -0,0 +1,20 @@ +SUMMARY = "Software watchdog" +DESCRIPTION = "Watchdog is a daemon that checks if your system is still \ +working. If programs in user space are not longer executed it will reboot \ +the system." +HOMEPAGE = "http://watchdog.sourceforge.net/" +BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194" + +LICENSE = "MIT-X" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +SRC_URI = " \ + file://watchdog.default \ + file://watchdog.conf \ +" + +do_install() { + install -Dm 0644 ${WORKDIR}/watchdog.default ${D}${sysconfdir}/default/watchdog + install -Dm 0644 ${WORKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.conf +} + diff --git a/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf b/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf new file mode 100644 index 000000000..c493d12d3 --- /dev/null +++ b/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf @@ -0,0 +1,42 @@ +#ping = 172.31.14.1 +#ping = 172.26.1.255 +#interface = eth0 +#file = /var/log/messages +#change = 1407 + +# Uncomment to enable test. Setting one of these values to '0' disables it. +# These values will hopefully never reboot your machine during normal use +# (if your machine is really hung, the loadavg will go much higher than 25) +#max-load-1 = 24 +#max-load-5 = 18 +#max-load-15 = 12 + +# Note that this is the number of pages! +# To get the real size, check how large the pagesize is on your machine. +#min-memory = 1 + +#repair-binary = /usr/sbin/repair +#repair-timeout = +#test-binary = +#test-timeout = + +watchdog-device = /dev/watchdog + +# Defaults compiled into the binary +#temperature-device = +#max-temperature = 120 + +# Defaults compiled into the binary +#admin = root +#interval = 1 +#logtick = 1 +#log-dir = /var/log/watchdog + +# This greatly decreases the chance that watchdog won't be scheduled before +# your machine is really loaded +realtime = yes +priority = 1 + +# Check if rsyslogd is still running by enabling the following line +#pidfile = /var/run/rsyslogd.pid + diff --git a/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.default b/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.default new file mode 100644 index 000000000..647d5abca --- /dev/null +++ b/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.default @@ -0,0 +1,2 @@ +# Start watchdog at boot time? 0 or 1 +run_watchdog=1 diff --git a/poky/meta/recipes-extended/watchdog/watchdog/0001-Include-linux-param.h-for-EXEC_PAGESIZE-definition.patch b/poky/meta/recipes-extended/watchdog/watchdog/0001-Include-linux-param.h-for-EXEC_PAGESIZE-definition.patch new file mode 100644 index 000000000..198f19861 --- /dev/null +++ b/poky/meta/recipes-extended/watchdog/watchdog/0001-Include-linux-param.h-for-EXEC_PAGESIZE-definition.patch @@ -0,0 +1,32 @@ +From 8f91385dbd5e7c14b36ecbd8a01ca82c709f6d77 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 24 Jun 2016 18:19:29 +0000 +Subject: [PATCH] Include linux/param.h for EXEC_PAGESIZE definition + +Musl does not include linux/param.h whereas glibc +does, so it fails to build on musl. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + + src/watchdog.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/watchdog.c b/src/watchdog.c +index acf6450..486384a 100644 +--- a/src/watchdog.c ++++ b/src/watchdog.c +@@ -26,6 +26,9 @@ + #include <sys/param.h> /* For EXEC_PAGESIZE */ + #include <linux/oom.h> + #include <linux/watchdog.h> ++#ifdef __linux__ ++#include <linux/param.h> ++#endif + #include <string.h> + + #include <libgen.h> +-- +1.8.3.1 + diff --git a/poky/meta/recipes-extended/watchdog/watchdog/0001-watchdog-remove-interdependencies-of-watchdog-and-wd.patch b/poky/meta/recipes-extended/watchdog/watchdog/0001-watchdog-remove-interdependencies-of-watchdog-and-wd.patch new file mode 100644 index 000000000..338e0cd14 --- /dev/null +++ b/poky/meta/recipes-extended/watchdog/watchdog/0001-watchdog-remove-interdependencies-of-watchdog-and-wd.patch @@ -0,0 +1,68 @@ +From c1fe14fa5bd168292cc4670034bc48b954e9dac7 Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Tue, 13 Mar 2018 14:49:55 +0200 +Subject: [PATCH] watchdog: remove interdependencies of watchdog and + wd_keepalive services + +Since watchdog and watchdog-keepalive packages can't be installed +together, remove the inter-dependencies of watchdog and wd_keepalive +services + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- + debian/watchdog.service | 9 +++------ + debian/wd_keepalive.service | 10 +++++----- + 2 files changed, 8 insertions(+), 11 deletions(-) + +diff --git a/debian/watchdog.service b/debian/watchdog.service +index 7a2fc36..f31d1fe 100644 +--- a/debian/watchdog.service ++++ b/debian/watchdog.service +@@ -1,16 +1,13 @@ + [Unit] + Description=watchdog daemon +-Conflicts=wd_keepalive.service + After=multi-user.target +-OnFailure=wd_keepalive.service + + [Service] + Type=forking + EnvironmentFile=/etc/default/watchdog + ExecStartPre=/bin/sh -c '[ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module' +-ExecStart=/bin/sh -c '[ $run_watchdog != 1 ] || exec /usr/sbin/watchdog $watchdog_options' +-ExecStopPost=/bin/sh -c '[ $run_wd_keepalive != 1 ] || false' ++ExecStart=/bin/sh -c '[ x$run_watchdog != x1 ] || exec /usr/sbin/watchdog $watchdog_options' ++PIDFile=/var/run/watchdog.pid + + [Install] +-WantedBy=default.target +- ++WantedBy=multi-user.target +diff --git a/debian/wd_keepalive.service b/debian/wd_keepalive.service +index 45b018e..7f8b1dc 100644 +--- a/debian/wd_keepalive.service ++++ b/debian/wd_keepalive.service +@@ -1,13 +1,13 @@ + [Unit] + Description=watchdog keepalive daemon +-Before=watchdog.service shutdown.target +-Conflicts=watchdog.service shutdown.target ++After=multi-user.target + + [Service] + Type=forking + EnvironmentFile=/etc/default/watchdog + ExecStartPre=/bin/sh -c '[ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module' +-ExecStartPre=-/bin/systemctl reset-failed watchdog.service + ExecStart=/usr/sbin/wd_keepalive $watchdog_options +-ExecStartPost=/bin/sh -c 'ln -s /var/run/wd_keepalive.pid /run/sendsigs.omit.d/wd_keepalive.pid' +-ExecStopPost=/bin/sh -c 'rm -f /run/sendsigs.omit.d/wd_keepalive.pid' ++PIDFile=/var/run/wd_keepalive.pid ++ ++[Install] ++WantedBy=multi-user.target +-- +2.4.0 + diff --git a/poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch b/poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch new file mode 100644 index 000000000..ec44c803b --- /dev/null +++ b/poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch @@ -0,0 +1,16 @@ +Signed-off-by: Diego Rondini <diego.ml@zoho.com> +Upstream-Status: Inappropriate + +Index: watchdog-5.15/watchdog.conf +=================================================================== +--- watchdog-5.15.orig/watchdog.conf ++++ watchdog-5.15/watchdog.conf +@@ -28,7 +28,7 @@ + #retry-timeout = 60 + #repair-maximum = 1 + +-#watchdog-device = /dev/watchdog ++watchdog-device = /dev/watchdog + + # Defaults compiled into the binary + #temperature-sensor = diff --git a/poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch b/poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch new file mode 100644 index 000000000..b2765f190 --- /dev/null +++ b/poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch @@ -0,0 +1,56 @@ +Signed-off-by: Diego Rondini <diego.ml@zoho.com> +Upstream-Status: Inappropriate + +--- watchdog-5.13.orig/redhat/watchdog.init 2014-11-12 17:18:39.125943000 +0100 ++++ watchdog-5.13/redhat/watchdog.init 2014-11-12 18:27:36.189943000 +0100 +@@ -7,7 +7,7 @@ + # Henning P. Schmiedehausen <hps@tanstaafl.de> + + # Source function library. +-. /etc/rc.d/init.d/functions ++. /etc/init.d/functions + + [ -x /usr/sbin/watchdog -a -e /etc/watchdog.conf ] || exit 0 + +@@ -23,22 +23,22 @@ + + start() { + +- echo -n $"Starting $prog: " ++ echo -n "Starting $prog: " + if [ -n "$(pidofproc $prog)" ]; then +- echo -n $"$prog: already running" +- echo_failure ++ echo -n "$prog: already running " ++ failure + echo + return 1 + fi + if [ "$VERBOSE" = "yes" ]; then +- daemon /usr/sbin/${prog} -v ++ /usr/sbin/${prog} -v + else +- daemon /usr/sbin/${prog} ++ /usr/sbin/${prog} + fi + RETVAL=$? + [ $RETVAL -eq 0 ] && touch $lockfile +- [ $RETVAL -eq 0 ] && echo_success +- [ $RETVAL -ne 0 ] && echo_failure ++ [ $RETVAL -eq 0 ] && success ++ [ $RETVAL -ne 0 ] && failure + echo + return $RETVAL + } +@@ -50,8 +50,10 @@ + # and reboot the box. + killproc $prog -TERM + RETVAL=$? +- echo + [ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile ++ [ $RETVAL -eq 0 ] && success ++ [ $RETVAL -ne 0 ] && failure ++ echo + return $RETVAL + } + diff --git a/poky/meta/recipes-extended/watchdog/watchdog/wd_keepalive.init b/poky/meta/recipes-extended/watchdog/watchdog/wd_keepalive.init new file mode 100644 index 000000000..1d3e4c555 --- /dev/null +++ b/poky/meta/recipes-extended/watchdog/watchdog/wd_keepalive.init @@ -0,0 +1,121 @@ +#!/bin/sh +#/etc/init.d/wd_keepalive: start wd_keepalive daemon. + +### BEGIN INIT INFO +# Provides: wd_keepalive +# Short-Description: Start watchdog keepalive daemon +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# X-Start-Before: $all +# Default-Start: 2 3 4 5 +# Default-Stop +### END INIT INFO + +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +test -x /usr/sbin/wd_keepalive || exit 0 + +# For configuration of the init script use the file +# /etc/default/watchdog, do not edit this init script. + +# Set run_watchdog to 1 to start watchdog or 0 to disable it. +run_watchdog=0 + +# Specify additional watchdog options here (see manpage). +watchdog_options="" + +# Specify module to load +watchdog_module="none" + +[ -e /etc/default/watchdog ] && . /etc/default/watchdog + +NAME=wd_keepalive +DAEMON=/usr/sbin/wd_keepalive + +STOP_RETRY_SCHEDULE='TERM/10/forever/KILL/1' + +# . /lib/lsb/init-functions + +# Mock Debian stuff +log_begin_msg() { + echo -n $* +} + +log_end_msg() { + if [ "$1" = "0" ]; then + echo 'done' + else + echo 'error' + fi +} + +log_daemon_msg() { + echo $* +} + +log_progress_msg() { + echo $* +} + + +case "$1" in + start) + if [ $run_watchdog = 1 ] + then + [ ${watchdog_module:-none} != "none" ] && /sbin/modprobe $watchdog_module + echo -n "Starting watchdog keepalive daemon: " + if start-stop-daemon --start --quiet \ + --exec $DAEMON -- $watchdog_options + then + echo wd_keepalive. + else + echo + fi + fi + ;; + + stop) + if [ $run_watchdog = 1 ] + then + echo -n "Stopping watchdog keepalive daemon: " + if start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ + $STOP_RETRY_SCHEDULE + then + echo wd_keepalive. + else + echo + fi + fi + ;; + + status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + ;; + + restart) + $0 force-reload + ;; + + force-reload) + if [ $run_watchdog = 0 ]; then exit 0; fi + echo -n "Restarting $NAME daemon." + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ + $STOP_RETRY_SCHEDULE + echo -n "." + if start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON -- $watchdog_options + then + echo "done." + else + echo + fi + ;; + + *) + echo "Usage: /etc/init.d/wd_keepalive {start|stop|status|restart|force-reload}" + exit 1 + +esac + +exit 0 + diff --git a/poky/meta/recipes-extended/watchdog/watchdog_5.15.bb b/poky/meta/recipes-extended/watchdog/watchdog_5.15.bb new file mode 100644 index 000000000..37b37ae12 --- /dev/null +++ b/poky/meta/recipes-extended/watchdog/watchdog_5.15.bb @@ -0,0 +1,69 @@ +SUMMARY = "Software watchdog" +DESCRIPTION = "Watchdog is a daemon that checks if your system is still \ +working. If programs in user space are not longer executed \ +it will reboot the system." +HOMEPAGE = "http://watchdog.sourceforge.net/" +BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194" + +LICENSE = "GPL-2.0+" +LIC_FILES_CHKSUM = "file://COPYING;md5=ecc0551bf54ad97f6b541720f84d6569" + +SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz \ + file://0001-Include-linux-param.h-for-EXEC_PAGESIZE-definition.patch \ + file://0001-watchdog-remove-interdependencies-of-watchdog-and-wd.patch \ + file://watchdog-init.patch \ + file://watchdog-conf.patch \ + file://wd_keepalive.init \ +" + +SRC_URI[md5sum] = "678c32f6f35a0492c9c1b76b4aa88828" +SRC_URI[sha256sum] = "ffdc865137ad5d8e53664bd22bad4de6ca136d1b4636720320cb52af0c18947c" + +UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/watchdog/files/watchdog/" +UPSTREAM_CHECK_REGEX = "/watchdog/(?P<pver>(\d+[\.\-_]*)+)/" + +inherit autotools update-rc.d systemd + +DEPENDS_append_libc-musl = " libtirpc " +CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc " +LDFLAGS_append_libc-musl = " -ltirpc " +EXTRA_OECONF_append_libc-musl = " --disable-nfs " + +INITSCRIPT_PACKAGES = "${PN} ${PN}-keepalive" + +INITSCRIPT_NAME_${PN} = "watchdog.sh" +INITSCRIPT_PARAMS_${PN} = "start 15 1 2 3 4 5 . stop 85 0 6 ." + +INITSCRIPT_NAME_${PN}-keepalive = "wd_keepalive" +INITSCRIPT_PARAMS_${PN}-keepalive = "start 15 1 2 3 4 5 . stop 85 0 6 ." + +SYSTEMD_PACKAGES = "${PN} ${PN}-keepalive" +SYSTEMD_SERVICE_${PN} = "watchdog.service" +SYSTEMD_SERVICE_${PN}-keepalive = "wd_keepalive.service" + +do_install_append() { + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${S}/debian/watchdog.service ${D}${systemd_system_unitdir} + install -m 0644 ${S}/debian/wd_keepalive.service ${D}${systemd_system_unitdir} + + install -D ${S}/redhat/watchdog.init ${D}/${sysconfdir}/init.d/watchdog.sh + install -Dm 0755 ${WORKDIR}/wd_keepalive.init ${D}${sysconfdir}/init.d/wd_keepalive + + # watchdog.conf is provided by the watchdog-config recipe + rm ${D}${sysconfdir}/watchdog.conf +} + +PACKAGES =+ "${PN}-keepalive" + +FILES_${PN}-keepalive = " \ + ${sysconfdir}/init.d/wd_keepalive \ + ${systemd_system_unitdir}/wd_keepalive.service \ + ${sbindir}/wd_keepalive \ +" + +RDEPENDS_${PN} += "${PN}-config" +RRECOMMENDS_${PN} += "kernel-module-softdog" + +RDEPENDS_${PN}-keepalive += "${PN}-config" +RCONFLICTS_${PN}-keepalive += "${PN}" +RRECOMMENDS_${PN}-keepalive += "kernel-module-softdog" diff --git a/poky/meta/recipes-extended/wget/wget.inc b/poky/meta/recipes-extended/wget/wget.inc new file mode 100644 index 000000000..3cff656a6 --- /dev/null +++ b/poky/meta/recipes-extended/wget/wget.inc @@ -0,0 +1,31 @@ +SUMMARY = "Console URL download utility supporting HTTP, FTP, etc" +HOMEPAGE = "https://www.gnu.org/software/wget/" +SECTION = "console/network" +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=c678957b0c8e964aa6c70fd77641a71e" +DEPENDS = "gnutls zlib libpcre" + +inherit autotools gettext texinfo update-alternatives pkgconfig + +EXTRA_OECONF = "--with-ssl=gnutls --disable-rpath --disable-iri \ + --without-libgnutls-prefix ac_cv_header_uuid_uuid_h=no" + +EXTRA_OEMAKE += 'TOOLCHAIN_OPTIONS="${TOOLCHAIN_OPTIONS}" \ + DEBUG_PREFIX_MAP="${DEBUG_PREFIX_MAP}"' + +ALTERNATIVE_${PN} = "wget" +ALTERNATIVE_${PN}_class-nativesdk = "" +ALTERNATIVE_PRIORITY = "100" + +RRECOMMENDS_${PN} += "ca-certificates" + +BBCLASSEXTEND = "nativesdk" + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" +PACKAGECONFIG[libuuid] = "--with-libuuid, --without-libuuid,util-linux" +PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," + +# Let aclocal use the relative path for the m4 file rather than +# absolute, otherwise there might be an "Argument list too long" error +# when it is built in a long/deep directory. +acpaths = "-I ./m4" diff --git a/poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch new file mode 100644 index 000000000..0b3c6f555 --- /dev/null +++ b/poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch @@ -0,0 +1,30 @@ +From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 13 Apr 2015 17:02:13 -0700 +Subject: [PATCH] Unset need_charset_alias when building for musl + +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 +which actually shoudl be fixed in gnulib and then all downstream +projects will get it eventually. For now we apply the fix to +coreutils + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/gnulib.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: wget-1.16.3/lib/Makefile.am +=================================================================== +--- wget-1.16.3.orig/lib/Makefile.am ++++ wget-1.16.3/lib/Makefile.am +@@ -846,7 +846,7 @@ install-exec-localcharset: all-local + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ diff --git a/poky/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch b/poky/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch new file mode 100644 index 000000000..8781df21c --- /dev/null +++ b/poky/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch @@ -0,0 +1,61 @@ +From 7f1357529d23b356b45fbb0dd7388588162e4cb8 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Wed, 10 Jan 2018 14:43:20 +0800 +Subject: [PATCH] src/Makefile.am: improve reproducibility + +Remove build host references from the internally +generated file version.c. The references get compiled into +executables, which leads to non-reproducible builds. +The removed references (--sysroot, -fdebug-prefix-map) were +only used as part of the `wget --version' which do not have +side effect. + +... +$ wget --version +GNU Wget 1.14 built on linux-gnu. + ++digest +https +ipv6 +iri +large-file +nls +ntlm +opie +ssl/openssl + +Wgetrc: + /etc/wgetrc (system) +Locale: /usr/share/locale +Compile: gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc" + -DLOCALEDIR="/usr/share/locale" -I. -I../lib -I../lib -O2 -g -pipe + -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong + --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic +Link: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions + -fstack-protector-strong --param=ssp-buffer-size=4 + -grecord-gcc-switches -m64 -mtune=generic -lssl -lcrypto + /usr/lib64/libssl.so /usr/lib64/libcrypto.so /usr/lib64/libz.so + -ldl -lz -lz -lidn -luuid -lpcre ftp-opie.o openssl.o http-ntlm.o + ../lib/libgnu.a +... + +Upstream-Status: Inappropriate [oe-core specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + src/Makefile.am | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 28c0be2..44084a3 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -87,9 +87,13 @@ version.c: $(wget_SOURCES) ../lib/libgnu.a + echo '#include "version.h"' >> $@ + echo 'const char *version_string = "@VERSION@";' >> $@ + echo 'const char *compilation_string = "'$(COMPILE)'";' \ ++ | sed -e "s,$(TOOLCHAIN_OPTIONS),,g" \ ++ -e "s,$(DEBUG_PREFIX_MAP),,g" \ + | $(ESCAPEQUOTE) >> $@ + echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \ ++ | sed -e "s,$(TOOLCHAIN_OPTIONS),,g" \ ++ -e "s,$(DEBUG_PREFIX_MAP),,g" \ + | $(ESCAPEQUOTE) >> $@ + + css.c: $(srcdir)/css.l +-- +1.8.3.1 + diff --git a/poky/meta/recipes-extended/wget/wget_1.19.5.bb b/poky/meta/recipes-extended/wget/wget_1.19.5.bb new file mode 100644 index 000000000..e37d8c784 --- /dev/null +++ b/poky/meta/recipes-extended/wget/wget_1.19.5.bb @@ -0,0 +1,9 @@ +SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \ + file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ + file://0002-improve-reproducibility.patch \ + " + +SRC_URI[md5sum] = "2db6f03d655041f82eb64b8c8a1fa7da" +SRC_URI[sha256sum] = "b39212abe1a73f2b28f4c6cb223c738559caac91d6e416a6d91d4b9d55c9faee" + +require wget.inc diff --git a/poky/meta/recipes-extended/which/which-2.21/automake.patch b/poky/meta/recipes-extended/which/which-2.21/automake.patch new file mode 100644 index 000000000..4d0f2e4d7 --- /dev/null +++ b/poky/meta/recipes-extended/which/which-2.21/automake.patch @@ -0,0 +1,19 @@ +Update autoconf prologue to use "foreign" strictness. + +Upstream-Status: Pending +Signed-off-by: Ross Burton <ross.burton@intel.com> + +diff --git a/configure.ac b/configure.ac +index d974461..a20dfa8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,7 +1,7 @@ + dnl Process this file with autoconf to produce a configure script. + AC_INIT([which], [2.21]) + AC_CONFIG_SRCDIR(which.c) +-AM_INIT_AUTOMAKE ++AM_INIT_AUTOMAKE([foreign]) + AM_CONFIG_HEADER(config.h) + AM_MAINTAINER_MODE + + diff --git a/poky/meta/recipes-extended/which/which_2.21.bb b/poky/meta/recipes-extended/which/which_2.21.bb new file mode 100644 index 000000000..fac0fd394 --- /dev/null +++ b/poky/meta/recipes-extended/which/which_2.21.bb @@ -0,0 +1,35 @@ +SUMMARY = "Displays the full path of shell commands" +DESCRIPTION = "Which is a utility that prints out the full path of the \ +executables that bash(1) would execute when the passed \ +program names would have been entered on the shell prompt. \ +It does this by using the exact same algorithm as bash." +SECTION = "libs" +HOMEPAGE = "http://carlo17.home.xs4all.nl/which/" + +LICENSE = "GPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\ + file://which.c;beginline=1;endline=17;md5=a9963693af2272e7a8df6f231164e7a2" +DEPENDS = "cwautomacros-native" + +inherit autotools texinfo update-alternatives + +PR = "r3" + +EXTRA_OECONF = "--disable-iberty" + +SRC_URI = "${GNU_MIRROR}/which/which-${PV}.tar.gz \ + file://automake.patch \ + " + +SRC_URI[md5sum] = "097ff1a324ae02e0a3b0369f07a7544a" +SRC_URI[sha256sum] = "f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad" + +do_configure_prepend() { + sed -i -e 's%@ACLOCAL_CWFLAGS@%-I ${STAGING_DIR_NATIVE}/usr/share/cwautomacros/m4%g' ${S}/Makefile.am ${S}/tilde/Makefile.am +} + +ALTERNATIVE_${PN} = "which" +ALTERNATIVE_PRIORITY = "100" + +ALTERNATIVE_${PN}-doc = "which.1" +ALTERNATIVE_LINK_NAME[which.1] = "${mandir}/man1/which.1" diff --git a/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch b/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch new file mode 100644 index 000000000..14160bf8d --- /dev/null +++ b/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch @@ -0,0 +1,30 @@ +From 33f42aa8d190b40be18cd0541b5881d46978b572 Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen <jussi.kukkonen@intel.com> +Date: Thu, 17 Dec 2015 11:50:05 +0200 +Subject: [PATCH] Don't build the in-script manual + +Building the contents for "--manual" option requires a web browser +or java (these are the two options for "xmlto txt" support). +That's bonkers so don't do it: the man pages are still available +and contain the same info. + +Upstream-Status: Inappropriate [disables in-script docs] +Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> +--- + scripts/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/Makefile.in b/scripts/Makefile.in +index 430032d..85359bc 100644 +--- a/scripts/Makefile.in ++++ b/scripts/Makefile.in +@@ -112,5 +112,5 @@ html/%.html: desc/%.xml + (cd html;$(XMLTO) html-nochunks ../$<) + + %.txt: desc/%.xml +- $(XMLTO) txt $< ++ echo "Please see the man pages." > $@ + +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch b/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch new file mode 100644 index 000000000..e9defadea --- /dev/null +++ b/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch @@ -0,0 +1,29 @@ +From 37e227ae1766568d8de55e268bb69bc15eee3529 Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen <jussi.kukkonen@intel.com> +Date: Thu, 26 Nov 2015 16:01:47 +0200 +Subject: [PATCH] Enable xdg-terminal + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> +--- + scripts/Makefile.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/scripts/Makefile.in b/scripts/Makefile.in +index d167393..430032d 100644 +--- a/scripts/Makefile.in ++++ b/scripts/Makefile.in +@@ -20,7 +20,8 @@ SCRIPTS = \ + xdg-open \ + xdg-email \ + xdg-screensaver \ +- xdg-settings ++ xdg-settings \ ++ xdg-terminal + # xdg-su + # xdg-copy \ + # xdg-file-dialog +-- +2.1.4 + diff --git a/poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.2.bb b/poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.2.bb new file mode 100644 index 000000000..7339289de --- /dev/null +++ b/poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.2.bb @@ -0,0 +1,37 @@ +SUMMARY = "Basic desktop integration functions" +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/xdg-utils/" +DESCRIPTION = "The xdg-utils package is a set of simple scripts that provide basic \ +desktop integration functions for any Free Desktop, such as Linux. \ +They are intended to provide a set of defacto standards. \ +The following scripts are provided at this time: \ +xdg-desktop-icon \ +xdg-desktop-menu \ +xdg-email \ +xdg-icon-resource \ +xdg-mime \ +xdg-open \ +xdg-screensaver \ +xdg-terminal \ +" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=a5367a90934098d6b05af3b746405014" + +SRC_URI = "http://portland.freedesktop.org/download/${BPN}-${PV}.tar.gz \ + file://0001-Reinstate-xdg-terminal.patch \ + file://0001-Don-t-build-the-in-script-manual.patch \ + " + +SRC_URI[md5sum] = "361e75eb76c94d19f6f4f330d8ee626b" +SRC_URI[sha256sum] = "951952e2c6bb21214e0bb54e0dffa057d30f5563300225c24c16fba846258bcc" + +UPSTREAM_CHECK_REGEX = "xdg-utils-(?P<pver>((\d+[\.\-_]*)+)((rc|alpha|beta)\d+)?)\.(tar\.gz|tgz)" + +# Needs brokensep as this doesn't use automake +inherit autotools-brokensep distro_features_check + +# The xprop requires x11 in DISTRO_FEATURES +REQUIRED_DISTRO_FEATURES = "x11" + +DEPENDS = "xmlto-native libxslt-native" +RDEPENDS_${PN} += "xprop" diff --git a/poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch b/poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch new file mode 100644 index 000000000..3c1b2f6f0 --- /dev/null +++ b/poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch @@ -0,0 +1,100 @@ +From e8b0ffc7ea04cc71dba97a38e1a134aaf2285c2d Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 30 Dec 2015 07:14:50 +0000 +Subject: [PATCH] configure: Use HAVE_SYS_RESOURCE_H to guard sys/resource.h + inclusion + +HAVE_RLIM_T check will not let sys/resource.h to be checked and +rlim_t is defined in sys/resource.h so the check would fail. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + aclocal.m4 | 2 +- + configure | 14 +++++++------- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/aclocal.m4 b/aclocal.m4 +index 6e6f32c..70e7076 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -11,7 +11,7 @@ AC_CACHE_VAL(xinetd_cv_type_$1, + #if HAVE_NETDB_H + #include <netdb.h> + #endif +-#if HAVE_RLIM_T ++#if HAVE_SYS_RESOURCE_H + #include <sys/resource.h> + #endif + #if HAVE_STDINT_H +diff --git a/configure b/configure +index b507d38..bec56ea 100755 +--- a/configure ++++ b/configure +@@ -7640,7 +7640,7 @@ cat >>conftest.$ac_ext <<_ACEOF + #if HAVE_NETDB_H + #include <netdb.h> + #endif +-#if HAVE_RLIM_T ++#if HAVE_SYS_RESOURCE_H + #include <sys/resource.h> + #endif + #if HAVE_STDINT_H +@@ -7686,7 +7686,7 @@ cat >>conftest.$ac_ext <<_ACEOF + #if HAVE_NETDB_H + #include <netdb.h> + #endif +-#if HAVE_RLIM_T ++#if HAVE_SYS_RESOURCE_H + #include <sys/resource.h> + #endif + #if HAVE_STDINT_H +@@ -7732,7 +7732,7 @@ cat >>conftest.$ac_ext <<_ACEOF + #if HAVE_NETDB_H + #include <netdb.h> + #endif +-#if HAVE_RLIM_T ++#if HAVE_SYS_RESOURCE_H + #include <sys/resource.h> + #endif + #if HAVE_STDINT_H +@@ -7778,7 +7778,7 @@ cat >>conftest.$ac_ext <<_ACEOF + #if HAVE_NETDB_H + #include <netdb.h> + #endif +-#if HAVE_RLIM_T ++#if HAVE_SYS_RESOURCE_H + #include <sys/resource.h> + #endif + #if HAVE_STDINT_H +@@ -7824,7 +7824,7 @@ cat >>conftest.$ac_ext <<_ACEOF + #if HAVE_NETDB_H + #include <netdb.h> + #endif +-#if HAVE_RLIM_T ++#if HAVE_SYS_RESOURCE_H + #include <sys/resource.h> + #endif + #if HAVE_STDINT_H +@@ -7870,7 +7870,7 @@ cat >>conftest.$ac_ext <<_ACEOF + #if HAVE_NETDB_H + #include <netdb.h> + #endif +-#if HAVE_RLIM_T ++#if HAVE_SYS_RESOURCE_H + #include <sys/resource.h> + #endif + #if HAVE_STDINT_H +@@ -7916,7 +7916,7 @@ cat >>conftest.$ac_ext <<_ACEOF + #if HAVE_NETDB_H + #include <netdb.h> + #endif +-#if HAVE_RLIM_T ++#if HAVE_SYS_RESOURCE_H + #include <sys/resource.h> + #endif + #if HAVE_STDINT_H +-- +2.6.4 + diff --git a/poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch b/poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch new file mode 100644 index 000000000..cd6e6c107 --- /dev/null +++ b/poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch @@ -0,0 +1,86 @@ +Upstream-Status: Pending [from other distro Debian] + +From d588b6530e1382a624898b3f4307f636c72c80a9 Mon Sep 17 00:00:00 2001 +From: Pierre Habouzit <madcoder@debian.org> +Date: Wed, 28 Nov 2007 10:13:08 +0100 +Subject: [PATCH] Disable services from inetd.conf if a service with the same id exists. + + This way, if a service is enabled in /etc/xinetd* _and_ in +/etc/inetd.conf, the one (even if disabled) from /etc/xinetd* takes +precedence. + +Signed-off-by: Pierre Habouzit <madcoder@debian.org> +--- + xinetd/inet.c | 22 +++++++++++++++++++--- + 1 files changed, 19 insertions(+), 3 deletions(-) + +diff --git a/xinetd/inet.c b/xinetd/inet.c +index 1cb2ba2..8caab45 100644 +--- a/xinetd/inet.c ++++ b/xinetd/inet.c +@@ -23,6 +23,8 @@ + #include "parsesup.h" + #include "nvlists.h" + ++static psi_h iter ; ++ + static int get_next_inet_entry( int fd, pset_h sconfs, + struct service_config *defaults); + +@@ -32,12 +34,15 @@ void parse_inet_conf_file( int fd, struct configuration *confp ) + struct service_config *default_config = CNF_DEFAULTS( confp ); + + line_count = 0; ++ iter = psi_create (sconfs); + + for( ;; ) + { + if (get_next_inet_entry(fd, sconfs, default_config) == -2) + break; + } ++ ++ psi_destroy(iter); + } + + static int get_next_inet_entry( int fd, pset_h sconfs, +@@ -46,7 +51,7 @@ static int get_next_inet_entry( int fd, pset_h sconfs, + char *p; + str_h strp; + char *line = next_line(fd); +- struct service_config *scp; ++ struct service_config *scp, *tmp; + unsigned u, i; + const char *func = "get_next_inet_entry"; + char *name = NULL, *rpcvers = NULL, *rpcproto = NULL; +@@ -405,7 +410,16 @@ static int get_next_inet_entry( int fd, pset_h sconfs, + SC_SPECIFY( scp, A_SOCKET_TYPE ); + SC_SPECIFY( scp, A_WAIT ); + +- if( ! pset_add(sconfs, scp) ) ++ for ( tmp = SCP( psi_start( iter ) ) ; tmp ; tmp = SCP( psi_next(iter)) ){ ++ if (EQ(SC_ID(scp), SC_ID(tmp))) { ++ parsemsg(LOG_DEBUG, func, "removing duplicate service %s", SC_NAME(scp)); ++ sc_free(scp); ++ scp = NULL; ++ break; ++ } ++ } ++ ++ if( scp && ! pset_add(sconfs, scp) ) + { + out_of_memory( func ); + pset_destroy(args); +@@ -414,7 +428,9 @@ static int get_next_inet_entry( int fd, pset_h sconfs, + } + + pset_destroy(args); +- parsemsg( LOG_DEBUG, func, "added service %s", SC_NAME(scp)); ++ if (scp) { ++ parsemsg( LOG_DEBUG, func, "added service %s", SC_NAME(scp)); ++ } + return 0; + } + +-- +1.5.3.6.2040.g15e6 + diff --git a/poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch b/poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch new file mode 100644 index 000000000..8e59cdcaa --- /dev/null +++ b/poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch @@ -0,0 +1,79 @@ +Upstream-Status: Pending [from other distro Debian] + +From a3410b0bc81ab03a889d9ffc14e351badf8372f1 Mon Sep 17 00:00:00 2001 +From: Pierre Habouzit <madcoder@debian.org> +Date: Mon, 26 Nov 2007 16:02:04 +0100 +Subject: [PATCH] Various fixes from the previous maintainer. + +--- + xinetd/child.c | 20 +++++++++++++++++--- + xinetd/service.c | 8 ++++---- + 2 files changed, 21 insertions(+), 7 deletions(-) + +diff --git a/xinetd/child.c b/xinetd/child.c +index 89ee54c..48e9615 100644 +--- a/xinetd/child.c ++++ b/xinetd/child.c +@@ -284,6 +284,7 @@ void child_process( struct server *serp ) + connection_s *cp = SERVER_CONNECTION( serp ) ; + struct service_config *scp = SVC_CONF( sp ) ; + const char *func = "child_process" ; ++ int fd, null_fd; + + signal_default_state(); + +@@ -296,9 +297,22 @@ void child_process( struct server *serp ) + signals_pending[0] = -1; + signals_pending[1] = -1; + +- Sclose(0); +- Sclose(1); +- Sclose(2); ++ if ( ( null_fd = open( "/dev/null", O_RDONLY ) ) == -1 ) ++ { ++ msg( LOG_ERR, func, "open('/dev/null') failed: %m") ; ++ _exit( 1 ) ; ++ } ++ ++ for ( fd = 0 ; fd <= MAX_PASS_FD ; fd++ ) ++ { ++ if ( fd != null_fd && dup2( null_fd, fd ) == -1 ) ++ { ++ msg( LOG_ERR, func, "dup2(%d, %d) failed: %m") ; ++ _exit( 1 ) ; ++ } ++ } ++ if ( null_fd > MAX_PASS_FD ) ++ (void) Sclose( null_fd ) ; + + + #ifdef DEBUG_SERVER +diff --git a/xinetd/service.c b/xinetd/service.c +index 3d68d78..0132d6c 100644 +--- a/xinetd/service.c ++++ b/xinetd/service.c +@@ -745,8 +745,8 @@ static status_e failed_service(struct service *sp, + return FAILED; + + if ( last == NULL ) { +- last = SAIN( calloc( 1, sizeof(union xsockaddr) ) ); +- SVC_LAST_DGRAM_ADDR(sp) = (union xsockaddr *)last; ++ SVC_LAST_DGRAM_ADDR(sp) = SAIN( calloc( 1, sizeof(union xsockaddr) ) ); ++ last = SAIN( SVC_LAST_DGRAM_ADDR(sp) ); + } + + (void) time( ¤t_time ) ; +@@ -772,8 +772,8 @@ static status_e failed_service(struct service *sp, + return FAILED; + + if( last == NULL ) { +- last = SAIN6(calloc( 1, sizeof(union xsockaddr) ) ); +- SVC_LAST_DGRAM_ADDR( sp ) = (union xsockaddr *)last; ++ SVC_LAST_DGRAM_ADDR(sp) = SAIN6(calloc( 1, sizeof(union xsockaddr) ) ); ++ last = SAIN6(SVC_LAST_DGRAM_ADDR(sp)); + } + + (void) time( ¤t_time ) ; +-- +1.5.3.6.2040.g15e6 + diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch b/poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch new file mode 100644 index 000000000..852a43f2d --- /dev/null +++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch @@ -0,0 +1,34 @@ +xinetd: CVE-2013-4342 + +xinetd does not enforce the user and group configuration directives +for TCPMUX services, which causes these services to be run as root +and makes it easier for remote attackers to gain privileges by +leveraging another vulnerability in a service. +http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4342 + +the patch come from: +https://bugzilla.redhat.com/attachment.cgi?id=799732&action=diff + +CVE: CVE-2013-4342 +Signed-off-by: Li Wang <li.wang@windriver.com> +Upstream-Status: Backport +--- + xinetd/builtins.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xinetd/builtins.c b/xinetd/builtins.c +index 3b85579..34a5bac 100644 +--- a/xinetd/builtins.c ++++ b/xinetd/builtins.c +@@ -617,7 +617,7 @@ static void tcpmux_handler( const struct server *serp ) + if( SC_IS_INTERNAL( scp ) ) { + SC_INTERNAL(scp, nserp); + } else { +- exec_server(nserp); ++ child_process(nserp); + } + } + +-- +1.7.9.5 + diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch b/poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch new file mode 100644 index 000000000..2365ca123 --- /dev/null +++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch @@ -0,0 +1,112 @@ +Upstream-Status: Pending [from other distro Debian] + +From f44b218ccc779ab3f4aed072390ccf129d94b58d Mon Sep 17 00:00:00 2001 +From: David Madore <david@pleiades.stars> +Date: Mon, 24 Mar 2008 12:45:36 +0100 +Subject: [PATCH] xinetd should be able to listen on IPv6 even in -inetd_compat mode + +xinetd does not bind to IPv6 addresses (and does not seem to have an +option to do so) when used in -inetd_compat mode. As current inetd's +are IPv6-aware, this is a problem: this means xinetd cannot be used as +a drop-in inetd replacement. + +The attached patch is a suggestion: it adds a -inetd_ipv6 global +option that, if used, causes inetd-compatibility lines to have an +implicit "IPv6" option. Perhaps this is not the best solution, but +there should definitely be a way to get inetd.conf to be read in +IPv6-aware mode. +--- + xinetd/confparse.c | 1 + + xinetd/inet.c | 17 +++++++++++++++++ + xinetd/options.c | 3 +++ + xinetd/xinetd.man | 6 ++++++ + 4 files changed, 27 insertions(+), 0 deletions(-) + +diff --git a/xinetd/confparse.c b/xinetd/confparse.c +index db9f431..d7b0bcc 100644 +--- a/xinetd/confparse.c ++++ b/xinetd/confparse.c +@@ -40,6 +40,7 @@ + #include "inet.h" + #include "main.h" + ++extern int inetd_ipv6; + extern int inetd_compat; + + /* +diff --git a/xinetd/inet.c b/xinetd/inet.c +index 8caab45..2e617ae 100644 +--- a/xinetd/inet.c ++++ b/xinetd/inet.c +@@ -25,6 +25,8 @@ + + static psi_h iter ; + ++extern int inetd_ipv6; ++ + static int get_next_inet_entry( int fd, pset_h sconfs, + struct service_config *defaults); + +@@ -360,6 +362,21 @@ static int get_next_inet_entry( int fd, pset_h sconfs, + } + SC_SERVER_ARGV(scp)[u] = p; + } ++ ++ /* Set the IPv6 flag if we were passed the -inetd_ipv6 option */ ++ if ( inetd_ipv6 ) ++ { ++ nvp = nv_find_value( service_flags, "IPv6" ); ++ if ( nvp == NULL ) ++ { ++ parsemsg( LOG_WARNING, func, "inetd.conf - Bad foo %s", name ) ; ++ pset_destroy(args); ++ sc_free(scp); ++ return -1; ++ } ++ M_SET(SC_XFLAGS(scp), nvp->value); ++ } ++ + /* Set the reuse flag, as this is the default for inetd */ + nvp = nv_find_value( service_flags, "REUSE" ); + if ( nvp == NULL ) +diff --git a/xinetd/options.c b/xinetd/options.c +index b058b6a..dc2f3a0 100644 +--- a/xinetd/options.c ++++ b/xinetd/options.c +@@ -30,6 +30,7 @@ int logprocs_option ; + unsigned logprocs_option_arg ; + int stayalive_option=0; + char *program_name ; ++int inetd_ipv6 = 0 ; + int inetd_compat = 0 ; + int dont_fork = 0; + +@@ -128,6 +129,8 @@ int opt_recognize( int argc, char *argv[] ) + fprintf(stderr, "\n"); + exit(0); + } ++ else if ( strcmp ( &argv[ arg ][ 1 ], "inetd_ipv6" ) == 0 ) ++ inetd_ipv6 = 1; + else if ( strcmp ( &argv[ arg ][ 1 ], "inetd_compat" ) == 0 ) + inetd_compat = 1; + } +diff --git a/xinetd/xinetd.man b/xinetd/xinetd.man +index c76c3c6..c9dd803 100644 +--- a/xinetd/xinetd.man ++++ b/xinetd/xinetd.man +@@ -106,6 +106,12 @@ This option causes xinetd to read /etc/inetd.conf in addition to the + standard xinetd config files. /etc/inetd.conf is read after the + standard xinetd config files. + .TP ++.BI \-inetd_ipv6 ++This option causes xinetd to bind to IPv6 (AF_INET6) addresses for ++inetd compatibility lines (see previous option). This only affects ++how /etc/inetd.conf is interpreted and thus only has any effect if ++the \-inetd_compat option is also used. ++.TP + .BI \-cc " interval" + This option instructs + .B xinetd +-- +1.5.5.rc0.127.gb4337 + diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf new file mode 100644 index 000000000..9e6ea2577 --- /dev/null +++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf @@ -0,0 +1,11 @@ +# Simple configuration file for xinetd +# +# Some defaults, and include /etc/xinetd.d/ + +defaults +{ + + +} + +includedir /etc/xinetd.d diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd.default b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.default new file mode 100644 index 000000000..20a38e3f3 --- /dev/null +++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.default @@ -0,0 +1,12 @@ +# Default settings for xinetd. This file is sourced by /bin/sh from +# /etc/init.d/xinetd + +# enable xinetd Inetd compat mode +INETD_COMPAT=Yes + +# Options to pass to xinetd +# +# -stayalive comes by default : it can be removed if xinetd is expected +# not to start when no service is configured +# +XINETD_OPTS="-stayalive" diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd.init b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.init new file mode 100644 index 000000000..777c2c8b4 --- /dev/null +++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.init @@ -0,0 +1,64 @@ +#!/bin/sh +# +# /etc/init.d/xinetd -- script to start and stop xinetd. + +# Source function library. +. /etc/init.d/functions + +if test -f /etc/default/xinetd; then + . /etc/default/xinetd +fi + + +test -x /usr/sbin/xinetd || exit 0 + +checkportmap () { + if grep "^[^ *#]" /etc/xinetd.conf | grep -q 'rpc/'; then + if ! rpcinfo -u localhost portmapper >/dev/null 2>&1; then + echo + echo "WARNING: portmapper inactive - RPC services unavailable!" + echo " Commenting out or removing the RPC services from" + echo " the /etc/xinetd.conf file will remove this message." + echo + fi + fi +} + +case "$1" in + start) + checkportmap + echo -n "Starting internet superserver: xinetd" + start-stop-daemon --start --quiet --background --exec /usr/sbin/xinetd -- -pidfile /var/run/xinetd.pid $XINETD_OPTS + echo "." + ;; + stop) + echo -n "Stopping internet superserver: xinetd" + start-stop-daemon --stop --signal 3 --quiet --exec /usr/sbin/xinetd + echo "." + ;; + status) + status /usr/sbin/xinetd; + exit $? + ;; + reload) + echo -n "Reloading internet superserver configuration: xinetd" + start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd + echo "." + ;; + force-reload) + echo "$0 force-reload: Force Reload is deprecated" + echo -n "Forcefully reloading internet superserver configuration: xinetd" + start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd + echo "." + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "Usage: /etc/init.d/xinetd {start|stop|status|reload|force-reload|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd.service b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.service new file mode 100644 index 000000000..d5fdc5bc2 --- /dev/null +++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.service @@ -0,0 +1,13 @@ +[Unit] +Description=Xinetd A Powerful Replacement For Inetd +After=syslog.target network.target + +[Service] +Type=forking +PIDFile=/var/run/xinetd.pid +EnvironmentFile=-/etc/sysconfig/xinetd +ExecStart=@SBINDIR@/xinetd -stayalive -pidfile /var/run/xinetd.pid "$EXTRAOPTIONS" +ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb b/poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb new file mode 100644 index 000000000..1beb5456e --- /dev/null +++ b/poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb @@ -0,0 +1,78 @@ +SUMMARY = "Socket-based service activation daemon" +HOMEPAGE = "https://github.com/xinetd-org/xinetd" + +# xinetd is a BSD-like license +# Apple and Gentoo say BSD here. +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8ad8615198542444f84d28a6cf226dd8" + +DEPENDS = "" +DEPENDS_append_libc-musl = " libtirpc " +PR = "r2" + +# Blacklist a bogus tag in upstream check +UPSTREAM_CHECK_GITTAGREGEX = "xinetd-(?P<pver>(?!20030122).+)" + +SRC_URI = "git://github.com/xinetd-org/xinetd.git;protocol=https \ + file://xinetd.init \ + file://xinetd.conf \ + file://xinetd.default \ + file://Various-fixes-from-the-previous-maintainer.patch \ + file://Disable-services-from-inetd.conf-if-a-service-with-t.patch \ + file://xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch \ + file://xinetd-CVE-2013-4342.patch \ + file://0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch \ + file://xinetd.service \ + " +UPSTREAM_VERSION_UNKNOWN = "1" + +SRCREV = "68bb9ab9e9f214ad8a2322f28ac1d6733e70bc24" + +S = "${WORKDIR}/git" + +inherit autotools update-rc.d systemd + +SYSTEMD_SERVICE_${PN} = "xinetd.service" + +INITSCRIPT_NAME = "xinetd" +INITSCRIPT_PARAMS = "defaults" + +EXTRA_OECONF="--disable-nls" + +PACKAGECONFIG ??= "tcp-wrappers" +PACKAGECONFIG[tcp-wrappers] = "--with-libwrap,,tcp-wrappers" + +CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc " +LDFLAGS_append_libc-musl = " -ltirpc " + +do_configure() { + # Looks like configure.in is broken, so we are skipping + # rebuilding configure and are just using the shipped one + ( cd ${S}; gnu-configize --force ) + oe_runconf +} + +do_install() { + # Same here, the Makefile does some really stupid things, + # but since we only want two files why not override + # do_install from autotools and doing it ourselfs? + install -d "${D}${sbindir}" + install -d "${D}${sysconfdir}/init.d" + install -d "${D}${sysconfdir}/xinetd.d" + install -d "${D}${sysconfdir}/default" + install -m 644 "${WORKDIR}/xinetd.conf" "${D}${sysconfdir}" + install -m 755 "${WORKDIR}/xinetd.init" "${D}${sysconfdir}/init.d/xinetd" + install -m 644 "${WORKDIR}/xinetd.default" "${D}${sysconfdir}/default/xinetd" + install -m 755 "${B}/xinetd/xinetd" "${D}${sbindir}" + install -m 755 "${B}/xinetd/itox" "${D}${sbindir}" + install -m 664 ${S}/contrib/xinetd.d/* ${D}${sysconfdir}/xinetd.d + + # Install systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/xinetd.service ${D}${systemd_unitdir}/system + sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ + -e 's,@SBINDIR@,${sbindir},g' \ + ${D}${systemd_unitdir}/system/xinetd.service +} + +CONFFILES_${PN} = "${sysconfdir}/xinetd.conf" diff --git a/poky/meta/recipes-extended/xz/xz_5.2.3.bb b/poky/meta/recipes-extended/xz/xz_5.2.3.bb new file mode 100644 index 000000000..c0f8b82f6 --- /dev/null +++ b/poky/meta/recipes-extended/xz/xz_5.2.3.bb @@ -0,0 +1,36 @@ +SUMMARY = "Utilities for managing LZMA compressed files" +HOMEPAGE = "http://tukaani.org/xz/" +SECTION = "base" + +# The source includes bits of PD, GPLv2, GPLv3, LGPLv2.1+, but the only file +# which is GPLv3 is an m4 macro which isn't shipped in any of our packages, +# and the LGPL bits are under lib/, which appears to be used for libgnu, which +# appears to be used for DOS builds. So we're left with GPLv2+ and PD. +LICENSE = "GPLv2+ & GPL-3.0-with-autoconf-exception & LGPLv2.1+ & PD" +LICENSE_${PN} = "GPLv2+" +LICENSE_${PN}-dev = "GPLv2+" +LICENSE_${PN}-staticdev = "GPLv2+" +LICENSE_${PN}-doc = "GPLv2+" +LICENSE_${PN}-dbg = "GPLv2+" +LICENSE_${PN}-locale = "GPLv2+" +LICENSE_liblzma = "PD" + +LIC_FILES_CHKSUM = "file://COPYING;md5=c475b6c7dca236740ace4bba553e8e1c \ + file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \ + file://COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \ + file://lib/getopt.c;endline=23;md5=2069b0ee710572c03bb3114e4532cd84 " + +SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.gz" +SRC_URI[md5sum] = "ef68674fb47a8b8e741b34e429d86e9d" +SRC_URI[sha256sum] = "71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb" + +inherit autotools gettext + +PACKAGES =+ "liblzma" + +FILES_liblzma = "${libdir}/liblzma*${SOLIBS}" + +BBCLASSEXTEND = "native nativesdk" + +export CONFIG_SHELL="/bin/sh" diff --git a/poky/meta/recipes-extended/zip/zip-3.0/fix-security-format.patch b/poky/meta/recipes-extended/zip/zip-3.0/fix-security-format.patch new file mode 100644 index 000000000..19d854827 --- /dev/null +++ b/poky/meta/recipes-extended/zip/zip-3.0/fix-security-format.patch @@ -0,0 +1,42 @@ +zip: Fixing security formatting issues + +Fix security formatting issues related to printing without NULL argument + +zip.c: In function 'help_extended': +zip.c:1031:5: error: format not a string literal and no format arguments [-Werror=format-security] + printf(text[i]); + ^ +zip.c: In function 'version_info': +zip.c:1228:5: error: format not a string literal and no format arguments [-Werror=format-security] + printf(cryptnote[i]); + ^ + +[YOCTO #9552] +[https://bugzilla.yoctoproject.org/show_bug.cgi?id=9552] + +Upstream-Status: Pending + +Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com> + +diff --git a/zip.c b/zip.c +index 439821f..d7da768 100644 +--- a/zip.c ++++ b/zip.c +@@ -1028,7 +1028,7 @@ local void help_extended() + + for (i = 0; i < sizeof(text)/sizeof(char *); i++) + { +- printf(text[i]); ++ fputs(text[i],stdout); + putchar('\n'); + } + #ifdef DOS +@@ -1225,7 +1225,7 @@ local void version_info() + CR_MAJORVER, CR_MINORVER, CR_BETA_VER, CR_VERSION_DATE); + for (i = 0; i < sizeof(cryptnote)/sizeof(char *); i++) + { +- printf(cryptnote[i]); ++ fputs(cryptnote[i],stdout); + putchar('\n'); + } + ++i; /* crypt support means there IS at least one compilation option */ diff --git a/poky/meta/recipes-extended/zip/zip_3.0.bb b/poky/meta/recipes-extended/zip/zip_3.0.bb new file mode 100644 index 000000000..de779e94a --- /dev/null +++ b/poky/meta/recipes-extended/zip/zip_3.0.bb @@ -0,0 +1,43 @@ +SUMMARY = "Compressor/archiver for creating and modifying .zip files" +HOMEPAGE = "http://www.info-zip.org" +SECTION = "console/utils" + +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=04d43c5d70b496c032308106e26ae17d" + +PR = "r2" + +S = "${WORKDIR}/zip30" + +SRC_URI = "${SOURCEFORGE_MIRROR}/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz \ + file://fix-security-format.patch" +UPSTREAM_VERSION_UNKNOWN = "1" + +SRC_URI[md5sum] = "7b74551e63f8ee6aab6fbc86676c0d37" +SRC_URI[sha256sum] = "f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369" + +# zip.inc sets CFLAGS, but what Makefile actually uses is +# CFLAGS_NOOPT. It will also force -O3 optimization, overriding +# whatever we set. +EXTRA_OEMAKE = "'CC=${CC}' 'BIND=${CC}' 'AS=${CC} -c' 'CPP=${CPP}' \ + 'CFLAGS=-I. -DUNIX ${CFLAGS}' \ + 'CFLAGS_NOOPT=-I. -DUNIX ${CFLAGS}' \ + 'INSTALL=install' 'INSTALL_D=install -d' \ + 'BINFLAGS=0755'" + +do_compile() { + oe_runmake -f unix/Makefile flags IZ_BZIP2=no_such_directory + sed -i 's#LFLAGS1=""#LFLAGS1="${LDFLAGS}"#' flags + oe_runmake -f unix/Makefile generic IZ_BZIP2=no_such_directory +} + +do_install() { + oe_runmake -f unix/Makefile prefix=${D}${prefix} \ + BINDIR=${D}${bindir} MANDIR=${D}${mandir}/man1 \ + install +} + +BBCLASSEXTEND = "native" + +# exclude version 2.3.2 which triggers a false positive +UPSTREAM_CHECK_REGEX = "^zip(?P<pver>(?!232).+)\.tgz" |