Complete Yocto mirror with license table for TQMa6UL (2038-compliance)

- 264 license table entries with exact download URLs (224/264 resolved)
- Complete sources/ directory with all BitBake recipes
- Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl)
- Full traceability for Softwarefreigabeantrag
- GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4
- License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
This commit is contained in:
Siggi (OpenClaw Agent)
2026-03-01 20:58:18 +00:00
commit 16accb6b24
15086 changed files with 1292356 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
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 = "https://www.intel.com/content/www/us/en/developer/topic-technology/open/acpica/overview.html"
SECTION = "console/tools"
LICENSE = "Intel | BSD-3-Clause | GPL-2.0-only"
LIC_FILES_CHKSUM = "file://source/compiler/aslcompile.c;beginline=7;endline=150;md5=05eb845b15a27440410f456adc2ed082"
COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
DEPENDS = "m4-native flex-native bison-native"
SRC_URI = "git://github.com/acpica/acpica;protocol=https;branch=master \
file://CVE-2024-24856.patch"
SRCREV = "170fc3076a86777077637f10b05c32ac21ac13aa"
S = "${WORKDIR}/git"
inherit update-alternatives
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE:${PN} = "acpixtract acpidump"
EXTRA_OEMAKE = "CC='${CC}' \
OPT_CFLAGS=-Wall \
DESTDIR=${D} \
PREFIX=${prefix} \
INSTALLDIR=${bindir} \
INSTALLFLAGS= \
YACC=bison \
YFLAGS='-y --file-prefix-map=${WORKDIR}=${TARGET_DBGSRC_DIR}' \
"
do_install() {
oe_runmake install
}
# iasl*.bb is a subset of this recipe, so RREPLACE it
PROVIDES = "iasl"
RPROVIDES:${PN} += "iasl"
RREPLACES:${PN} += "iasl"
RCONFLICTS:${PN} += "iasl"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,31 @@
From 4d4547cf13cca820ff7e0f859ba83e1a610b9fd0 Mon Sep 17 00:00:00 2001
From: Huai-Yuan Liu <qq810974084@gmail.com>
Date: Tue, 9 Apr 2024 23:23:39 +0800
Subject: [PATCH] check null return of ACPI_ALLOCATE_ZEROED in
AcpiDbConvertToPackage
ACPI_ALLOCATE_ZEROED may fails, Elements might be null and will cause null pointer dereference later.
Signed-off-by: Huai-Yuan Liu <qq810974084@gmail.com>
CVE: CVE-2024-24856
Upstream-Status: Backport [https://github.com/acpica/acpica/pull/946/commits/4d4547cf13cca820ff7e0f859ba83e1a610b9fd0]
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
source/components/debugger/dbconvert.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/source/components/debugger/dbconvert.c b/source/components/debugger/dbconvert.c
index 6a41000036..32ad5be179 100644
--- a/source/components/debugger/dbconvert.c
+++ b/source/components/debugger/dbconvert.c
@@ -354,6 +354,8 @@ AcpiDbConvertToPackage (
Elements = ACPI_ALLOCATE_ZEROED (
DB_DEFAULT_PKG_ELEMENTS * sizeof (ACPI_OBJECT));
+ if (!Elements)
+ return (AE_NO_MEMORY);
This = String;
for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++)

View File

@@ -0,0 +1,28 @@
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 = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=aaee33adce0fc7cc40fee23f82f7f101 \
file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
"
SRC_URI = "git://github.com/asciidoc/asciidoc-py;protocol=https;branch=main"
SRCREV = "545b79b8d7dae70d12bf0657359bdd36de0c5c26"
DEPENDS = "libxml2-native libxslt-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
S = "${WORKDIR}/git"
# Tell xmllint where to find the DocBook XML catalogue, because right now it
# opens /etc/xml/catalog on the host. Depends on auto-catalogs.patch
export SGML_CATALOG_FILES="file://${STAGING_ETCDIR_NATIVE}/xml/catalog"
inherit setuptools3
CLEANBROKEN = "1"
BBCLASSEXTEND = "native nativesdk"
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))$"

View File

@@ -0,0 +1,56 @@
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(-)
Index: at-3.2.1/parsetime.y
===================================================================
--- at-3.2.1.orig/parsetime.y
+++ at-3.2.1/parsetime.y
@@ -14,6 +14,9 @@
((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
#endif
+#define is_leap_year(y) \
+ ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
+
struct tm exectm;
static int isgmt;
static char *tz = NULL;
@@ -230,8 +233,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");
@@ -274,8 +277,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");

View File

@@ -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 $?

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Job spooling tools
After=syslog.target
[Service]
ExecStart=@SBINDIR@/atd -f
[Install]
WantedBy=multi-user.target

View File

@@ -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

View File

@@ -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.2.1/Copyright
===================================================================
--- at-3.2.1.orig/Copyright
+++ at-3.2.1/Copyright
@@ -34,10 +34,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

View File

@@ -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.2.1/Makefile.in
===================================================================
--- at-3.2.1.orig/Makefile.in
+++ at-3.2.1/Makefile.in
@@ -77,7 +77,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

View File

@@ -0,0 +1,35 @@
From 8c8a0b6ba199327d2eafefd6611353e1c483a854 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Wed, 5 Dec 2018 10:00:36 +0800
Subject: [PATCH] fix pam.conf
oe doesn't support "@include", use the concrete directive instead.
Upstream-Status: Pending
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
pam.conf | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pam.conf b/pam.conf
index 3674c0a..2f8d586 100644
--- a/pam.conf
+++ b/pam.conf
@@ -2,9 +2,9 @@
# The PAM configuration file for the at daemon
#
-@include common-auth
-@include common-account
+auth include common-auth
+account include common-account
session required pam_loginuid.so
-@include common-session-noninteractive
+session include common-session-noninteractive
session required pam_limits.so
auth required pam_env.so user_readenv=1
--
2.7.4

View File

@@ -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:
*/

View File

@@ -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

View File

@@ -0,0 +1,76 @@
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 = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4"
DEPENDS = "flex flex-native bison-native \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
PACKAGECONFIG ?= "\
${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
"
PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux,"
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 = "${DEBIAN_MIRROR}/main/a/at/${BPN}_${PV}.orig.tar.gz \
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[sha256sum] = "bb066b389d7c9bb9d84a35738032b85c30cba7d949f758192adc72c9477fd3b8"
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"
do_patch[postfuncs] += "copy_posix_files"
copy_posix_files() {
cp -f ${WORKDIR}/posixtm.[ch] ${S}
}
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_system_unitdir}
install -m 0644 ${WORKDIR}/atd.service ${D}${systemd_system_unitdir}
sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/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
rm -f ${D}${datadir}/at/batch-job
}

View File

@@ -0,0 +1,72 @@
SUMMARY = "Baremetal examples to work with the several QEMU architectures supported on OpenEmbedded"
HOMEPAGE = "https://github.com/aehs29/baremetal-helloqemu"
DESCRIPTION = "These are introductory examples to showcase the use of QEMU to run baremetal applications."
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449"
SRCREV = "db2bf750eaef7fc0832e13ada8291343bbcc3afe"
PV = "0.1+git"
SRC_URI = "git://github.com/ahcbb6/baremetal-helloqemu.git;protocol=https;branch=master"
UPSTREAM_VERSION_UNKNOWN="1"
S = "${WORKDIR}/git"
# The following variables should be set to accomodate each application
BAREMETAL_BINNAME ?= "hello_baremetal_${MACHINE}"
IMAGE_LINK_NAME ?= "baremetal-helloworld-image-${MACHINE}"
IMAGE_NAME_SUFFIX ?= ""
# Baremetal-Image creates the proper wiring, assumes the output is provided in
# binary and ELF format, installed on ${base_libdir}/firmware/ , we want a
# package to be created since we might have some way of updating the baremetal
# firmware from Linux
inherit baremetal-image
# startup code for x86 uses NASM syntax
DEPENDS:qemux86:append = " nasm-native"
# These parameters are app specific for this example
# This will be translated automatically to the architecture and
# machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57
# but the examples can also be run on other architectures/machines
# such as vexpress-a15 by overriding the setting on the machine.conf
COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64|qemuriscv32|qemux86|qemux86-64"
BAREMETAL_QEMUARCH ?= ""
BAREMETAL_QEMUARCH:qemuarmv5 = "versatile"
BAREMETAL_QEMUARCH:qemuarm = "arm"
BAREMETAL_QEMUARCH:qemuarm64 = "aarch64"
BAREMETAL_QEMUARCH:qemuriscv64 = "riscv64"
BAREMETAL_QEMUARCH:qemuriscv32 = "riscv32"
BAREMETAL_QEMUARCH:qemux86 = "x86"
BAREMETAL_QEMUARCH:qemux86-64 = "x86-64"
EXTRA_OEMAKE:append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1"
# qemux86-64 uses a different Makefile
do_compile:prepend:qemux86-64(){
cd x86-64
}
# Install binaries on the proper location for baremetal-image to fetch and deploy
do_install(){
install -d ${D}/${base_libdir}/firmware
install -m 755 ${B}/build/hello_baremetal_${BAREMETAL_QEMUARCH}.bin ${D}/${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin
install -m 755 ${B}/build/hello_baremetal_${BAREMETAL_QEMUARCH}.elf ${D}/${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf
}
FILES:${PN} += " \
${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin \
${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf \
"
# qemux86-64 boots from iso rather than -kernel, create image to boot from
do_image:append:qemux86-64(){
dd if=/dev/zero of=${B}/build/img.iso bs=1M count=10 status=none
dd if=${B}/build/stage1.bin of=${B}/build/img.iso bs=512 count=1 conv=notrunc
dd if=${B}/build/stage2.bin of=${B}/build/img.iso bs=512 seek=1 count=64 conv=notrunc
dd if=${B}/build/hello_baremetal_x86-64.bin of=${B}/build/img.iso bs=512 seek=65 conv=notrunc
install ${B}/build/img.iso ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.iso
}

View File

@@ -0,0 +1,143 @@
SUMMARY = "An sh-compatible command language interpreter"
HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html"
DESCRIPTION = "Bash is the GNU Project's Bourne Again SHell, a complete implementation of the IEEE POSIX and Open Group shell specification with interactive command line editing, job control on architectures that support it, csh-like features such as history substitution and brace expansion, and a slew of other features."
SECTION = "base/shell"
DEPENDS = "ncurses bison-native virtual/libiconv"
inherit autotools gettext texinfo update-alternatives ptest
EXTRA_AUTORECONF += "--exclude=autoheader"
EXTRA_OECONF = "--enable-job-control --without-bash-malloc bash_cv_wexitstatus_offset=8"
# 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"
# This can vary depending upon the host
CFLAGS += "-DHEREDOC_PIPESIZE=65536"
# Disable bracketed paste mode by default (enabled by default in bash 5.1). It
# causes a lot of garbage in non-interactive shells
CFLAGS += "-DBRACKETED_PASTE_DEFAULT=0"
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 coreutils perl sed shadow util-linux-setpriv"
RDEPENDS:${PN}-ptest:append:libc-glibc = " \
glibc-gconv-big5hkscs \
glibc-gconv-iso8859-1 \
glibc-utils \
locale-base-de-de \
locale-base-en-us \
locale-base-fr-fr \
locale-base-fr-fr.iso-8859-1 \
locale-base-zh-hk.big5-hkscs \
"
CACHED_CONFIGUREVARS += "headersdir=${includedir}/${PN}"
do_configure:prepend () {
if [ ! -e ${S}/acinclude.m4 ]; then
cat ${S}/aclocal.m4 > ${S}/acinclude.m4
fi
}
do_compile:prepend() {
# Remove any leftover .build files. This ensures that bash always has the
# same version number and keeps builds reproducible
rm -f ${B}/.build
}
do_compile_ptest () {
oe_runmake buildtest
}
do_install:prepend () {
# Ensure determinism as this counter increases for each make call
rm -f ${B}/.build
}
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
}
fix_absolute_paths () {
# 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:append:class-target () {
fix_absolute_paths
}
do_install:append:class-nativesdk () {
fix_absolute_paths
}
do_install_ptest () {
make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
cp ${B}/Makefile ${D}${PTEST_PATH}
cp ${B}/config.h ${D}${PTEST_PATH}
cp ${B}/version.h ${D}${PTEST_PATH}
cp ${S}/y.tab.[ch] ${D}${PTEST_PATH}
install -D ${WORKDIR}/run-bash-ptests ${D}${PTEST_PATH}/run-bash-ptests
sed -i -e 's/^Makefile/_Makefile/' -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
-e 's|${DEBUG_PREFIX_MAP}||g' \
-e 's|${BUILD_LDFLAGS}||g' \
-e "s,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,g" \
-e 's:${HOSTTOOLS_DIR}/::g' \
-e 's:${UNINATIVE_LOADER}:${base_bindir}/false:g' \
${D}${PTEST_PATH}/Makefile
}
# The uninative loader is different on i386 & x86_64 hosts. Since it is only
# being replaced with /bin/false anyway, it doesn't need to be part of the task
# hash
do_install_ptest[vardepsexclude] += "UNINATIVE_LOADER"
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/*"
# Limit the RPROVIDES here to class target so that if usrmerge is enabled for nativesdk, it does not
# include host system paths in /bin/
RPROVIDES:${PN}:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/bash', '', d)}"

View File

@@ -0,0 +1,226 @@
From 721d5be99eb37d31e48bd66d61808a66a4c5ab84 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 30 Oct 2023 12:16:07 -0400
Subject: [PATCH] changes to SIGINT handler while waiting for a child; skip
vertical whitespace after translating an integer
Upstream-Status: Backport from
[https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=fe24a6a55e8850298b496c5b9d82f1866eba190e]
[Adjust and drop some codes to be applicable the tree]
Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
---
general.c | 5 +++--
jobs.c | 24 ++++++++++++++++--------
tests/redir.right | 4 ++--
tests/redir11.sub | 2 ++
tests/type.right | 16 ++++++++--------
tests/type.tests | 24 ++++++++++++------------
6 files changed, 43 insertions(+), 32 deletions(-)
diff --git a/general.c b/general.c
index 85c5a8b6..65e2ee06 100644
--- a/general.c
+++ b/general.c
@@ -262,8 +262,9 @@ legal_number (string, result)
if (errno || ep == string)
return 0; /* errno is set on overflow or underflow */
- /* Skip any trailing whitespace, since strtoimax does not. */
- while (whitespace (*ep))
+ /* Skip any trailing whitespace, since strtoimax does not, using the same
+ test that strtoimax uses for leading whitespace. */
+ while (isspace ((unsigned char) *ep))
ep++;
/* If *string is not '\0' but *ep is '\0' on return, the entire string
diff --git a/jobs.c b/jobs.c
index 6b986ed7..262d78de 100644
--- a/jobs.c
+++ b/jobs.c
@@ -2718,6 +2718,10 @@ wait_for_background_pids (ps)
#define INVALID_SIGNAL_HANDLER (SigHandler *)wait_for_background_pids
static SigHandler *old_sigint_handler = INVALID_SIGNAL_HANDLER;
+/* The current SIGINT handler as set by restore_sigint_handler. Only valid
+ immediately after restore_sigint_handler, used for continuations. */
+static SigHandler *cur_sigint_handler = INVALID_SIGNAL_HANDLER;
+
static int wait_sigint_received;
static int child_caught_sigint;
@@ -2735,6 +2739,7 @@ wait_sigint_cleanup ()
static void
restore_sigint_handler ()
{
+ cur_sigint_handler = old_sigint_handler;
if (old_sigint_handler != INVALID_SIGNAL_HANDLER)
{
set_signal_handler (SIGINT, old_sigint_handler);
@@ -2758,8 +2763,7 @@ wait_sigint_handler (sig)
restore_sigint_handler ();
/* If we got a SIGINT while in `wait', and SIGINT is trapped, do
what POSIX.2 says (see builtins/wait.def for more info). */
- if (this_shell_builtin && this_shell_builtin == wait_builtin &&
- signal_is_trapped (SIGINT) &&
+ if (signal_is_trapped (SIGINT) &&
((sigint_handler = trap_to_sighandler (SIGINT)) == trap_handler))
{
trap_handler (SIGINT); /* set pending_traps[SIGINT] */
@@ -2782,6 +2786,8 @@ wait_sigint_handler (sig)
{
set_exit_status (128+SIGINT);
restore_sigint_handler ();
+ if (cur_sigint_handler == INVALID_SIGNAL_HANDLER)
+ set_sigint_handler (); /* XXX - only do this in one place */
kill (getpid (), SIGINT);
}
@@ -2926,11 +2932,13 @@ wait_for (pid, flags)
{
SigHandler *temp_sigint_handler;
- temp_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
- if (temp_sigint_handler == wait_sigint_handler)
- internal_debug ("wait_for: recursively setting old_sigint_handler to wait_sigint_handler: running_trap = %d", running_trap);
- else
- old_sigint_handler = temp_sigint_handler;
+ temp_sigint_handler = old_sigint_handler;
+ old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
+ if (old_sigint_handler == wait_sigint_handler)
+ {
+ internal_debug ("wait_for: recursively setting old_sigint_handler to wait_sigint_handler: running_trap = %d", running_trap);
+ old_sigint_handler = temp_sigint_handler;
+ }
waiting_for_child = 0;
if (old_sigint_handler == SIG_IGN)
set_signal_handler (SIGINT, old_sigint_handler);
@@ -4136,7 +4144,7 @@ set_job_status_and_cleanup (job)
SIGINT (if we reset the sighandler to the default).
In this case, we have to fix things up. What a crock. */
if (temp_handler == trap_handler && signal_is_trapped (SIGINT) == 0)
- temp_handler = trap_to_sighandler (SIGINT);
+ temp_handler = trap_to_sighandler (SIGINT);
restore_sigint_handler ();
if (temp_handler == SIG_DFL)
termsig_handler (SIGINT); /* XXX */
diff --git a/tests/redir.right b/tests/redir.right
index 8db10414..9e1403c8 100644
--- a/tests/redir.right
+++ b/tests/redir.right
@@ -154,10 +154,10 @@ foo
1
7
after: 42
-./redir11.sub: line 53: $(ss= declare -i ss): ambiguous redirect
+./redir11.sub: line 55: $(ss= declare -i ss): ambiguous redirect
after: 42
a+=3
foo
foo
-./redir11.sub: line 75: 42: No such file or directory
+./redir11.sub: line 77: 42: No such file or directory
42
diff --git a/tests/redir11.sub b/tests/redir11.sub
index d417cdb6..ca9854cd 100644
--- a/tests/redir11.sub
+++ b/tests/redir11.sub
@@ -34,6 +34,8 @@ a=4 b=7 ss=4 declare -i ss
a=4 b=7 foo
echo after: $a
+exec 7>&- 4>&-
+
unset a
a=4 echo foo 2>&1 >&$(foo) | { grep -q 'Bad file' || echo 'redir11 bad 3'; }
a=1 echo foo 2>&1 >&$(foo) | { grep -q 'Bad file' || echo 'redir11 bad 4'; }
diff --git a/tests/type.right b/tests/type.right
index bbc228e8..e0a66745 100644
--- a/tests/type.right
+++ b/tests/type.right
@@ -24,15 +24,15 @@ func ()
}
while
while is a shell keyword
-./type.tests: line 56: type: m: not found
-alias m='more'
-alias m='more'
-m is aliased to `more'
+./type.tests: line 56: type: morealias: not found
+alias morealias='more'
+alias morealias='more'
+morealias is aliased to `more'
alias
-alias m='more'
-alias m='more'
-alias m='more'
-m is aliased to `more'
+alias morealias='more'
+alias morealias='more'
+alias morealias='more'
+morealias is aliased to `more'
builtin
builtin is a shell builtin
/bin/sh
diff --git a/tests/type.tests b/tests/type.tests
index fd39c18a..ddc15407 100644
--- a/tests/type.tests
+++ b/tests/type.tests
@@ -25,8 +25,6 @@ type -r ${THIS_SH}
type notthere
command -v notthere
-alias m=more
-
unset -f func 2>/dev/null
func() { echo this is func; }
@@ -49,24 +47,26 @@ command -V func
command -v while
command -V while
+alias morealias=more
+
# the following two lines should produce the same output
# post-3.0 patch makes command -v silent, as posix specifies
# first test with alias expansion off (should all fail or produce no output)
-type -t m
-type m
-command -v m
+type -t morealias
+type morealias
+command -v morealias
alias -p
-alias m
+alias morealias
# then test with alias expansion on
shopt -s expand_aliases
-type m
-type -t m
-command -v m
+type morealias
+type -t morealias
+command -v morealias
alias -p
-alias m
+alias morealias
-command -V m
+command -V morealias
shopt -u expand_aliases
command -v builtin
@@ -76,7 +76,7 @@ command -V /bin/sh
unset -f func
type func
-unalias m
+unalias morealias
type m
hash -r
--
2.35.5

View File

@@ -0,0 +1,41 @@
From e9ed388e760ec33dcf9e72c639946c0d0abeec26 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Wed, 19 Jun 2024 12:57:39 +0000
Subject: [PATCH] Fix C99 problems
Backport some fixes from upstream to fix configure checks that fail with GCC 14.1.
Upstream-Status: Backport [devel branch]
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
aclocal.m4 | 3 +++
configure.ac | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/aclocal.m4 b/aclocal.m4
index cc97bd4..7423b99 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -238,6 +238,9 @@ AC_CACHE_VAL(bash_cv_dup2_broken,
#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
int
main()
{
diff --git a/configure.ac b/configure.ac
index a3b5bd7..2a38c6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -842,7 +842,7 @@ AC_CHECK_DECLS([strtold], [
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdlib.h>]],
- [[long double r; char *foo, bar; r = strtold(foo, &bar);]]
+ [[long double r; char *foo, *bar; r = strtold(foo, &bar);]]
)],
[bash_cv_strtold_broken=no],[bash_cv_strtold_broken=yes])
]

View File

@@ -0,0 +1,60 @@
From 318b762837c2ad25319caeaf0320eff613b64daf Mon Sep 17 00:00:00 2001
From: Anders Roxell <anders.roxell@enea.com>
Date: Wed, 19 Dec 2012 17:18:31 +0100
Subject: [PATCH] Add 'ptest' target to Makefile, to run tests without checking
dependencies.
Upstream-Status: Inappropriate [ptest specific]
Signed-off-by: Anders Roxell <anders.roxell@enea.com>
Rebase to 5.0
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
index bc97049..937ce39 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -943,20 +943,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 && \
BUILD_DIR=$(BUILD_DIR) PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )

View File

@@ -0,0 +1,34 @@
From 59ddfda14e3c9aa6286bb4c4c0748f7c1324a65a Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 7 Apr 2023 00:28:46 -0700
Subject: [PATCH] $(<nosuchfile) is no longer a fatal error with errexit
enabled
This is a trimmed-down version of a commit in the bash 'devel' branch
[1] that contains this fix as well as other unrelated ones.
[1] https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=ec9447ce9392a0f93d96789c3741285fede8a150
Upstream-Status: Backport
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
---
builtins/evalstring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtins/evalstring.c b/builtins/evalstring.c
index df3dd68e2a7e..6612081cd646 100644
--- a/builtins/evalstring.c
+++ b/builtins/evalstring.c
@@ -753,7 +753,7 @@ open_redir_file (r, fnp)
fd = open(fn, O_RDONLY);
if (fd < 0)
{
- file_error (fn);
+ internal_error ("%s: %s", fn, strerror (errno));
free (fn);
if (fnp)
*fnp = 0;
--
2.40.0

View File

@@ -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

View File

@@ -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)

View File

@@ -0,0 +1,4 @@
#!/bin/sh
cd "$(dirname "$0")"
make -k THIS_SH=/bin/bash BUILD_DIR=`pwd` srcdir=`pwd` runtest

View File

@@ -0,0 +1,26 @@
#!/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
useradd bashtest
chown -R bashtest:bashtest tests
setpriv --reuid bashtest --rgid bashtest --clear-groups --reset-env $(dirname "$0")/run-bash-ptests
chown -R root:root tests
userdel -r bashtest

View File

@@ -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

View File

@@ -0,0 +1,70 @@
From d1bf23817afffd5917b74da6946e0c3b7e63e336 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Mon, 28 Dec 2020 21:04:27 +0100
Subject: [PATCH] bash: update 5.0 -> 5.1
Including m4 files directly like this confuses autotools.bbclass, remove
the references and rely upon aclocal to collect the m4 files together
as needed instead making it work like other autotools based projects.
Upstream-Status: Inappropriate [OE configuration specific]
RP 2021/1/20
---
configure.ac | 43 -------------------------------------------
1 file changed, 43 deletions(-)
diff --git a/configure.ac b/configure.ac
index 50a6e20..a3b5bd7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -710,49 +710,6 @@ if test x$SIZE = x; then
fi
AC_SUBST(SIZE)
-m4_include([m4/stat-time.m4])
-m4_include([m4/timespec.m4])
-
-m4_include([m4/strtoimax.m4])
-
-dnl include files for gettext
-
-m4_include([m4/codeset.m4])
-m4_include([m4/extern-inline.m4])
-m4_include([m4/fcntl-o.m4])
-m4_include([m4/gettext.m4])
-m4_include([m4/glibc2.m4])
-m4_include([m4/glibc21.m4])
-m4_include([m4/host-cpu-c-abi.m4])
-m4_include([m4/iconv.m4])
-m4_include([m4/intdiv0.m4])
-m4_include([m4/intl.m4])
-m4_include([m4/intlmacosx.m4])
-m4_include([m4/intl-thread-locale.m4])
-m4_include([m4/intmax.m4])
-m4_include([m4/inttypes-pri.m4])
-m4_include([m4/inttypes.m4])
-m4_include([m4/inttypes_h.m4])
-m4_include([m4/lcmessage.m4])
-m4_include([m4/lib-ld.m4])
-m4_include([m4/lib-link.m4])
-m4_include([m4/lib-prefix.m4])
-m4_include([m4/lock.m4])
-m4_include([m4/nls.m4])
-m4_include([m4/po.m4])
-m4_include([m4/printf-posix.m4])
-m4_include([m4/progtest.m4])
-m4_include([m4/pthread_rwlock_rdlock.m4])
-m4_include([m4/size_max.m4])
-m4_include([m4/stdint_h.m4])
-m4_include([m4/threadlib.m4])
-m4_include([m4/uintmax_t.m4])
-m4_include([m4/ulonglong.m4])
-m4_include([m4/visibility.m4])
-m4_include([m4/wchar_t.m4])
-m4_include([m4/wint_t.m4])
-m4_include([m4/xsize.m4])
-
dnl C compiler characteristics
AC_C_CONST
AC_C_INLINE

View File

@@ -0,0 +1,25 @@
require bash.inc
# GPL-2.0-or-later (< 4.0), GPL-3.0-or-later (>= 4.0)
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \
file://mkbuiltins_have_stringize.patch \
file://build-tests.patch \
file://test-output.patch \
file://run-ptest \
file://run-bash-ptests \
file://fix-run-builtins.patch \
file://use_aclocal.patch \
file://0001-changes-to-SIGINT-handler-while-waiting-for-a-child-.patch \
file://fix-filesubst-errexit.patch \
file://0001-fix-c99.patch \
"
SRC_URI[tarball.sha256sum] = "c8e31bdc59b69aaffc5b36509905ba3e5cbb12747091d27b4b977f078560d5b8"
DEBUG_OPTIMIZATION:append:armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
DEBUG_OPTIMIZATION:append:armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
BBCLASSEXTEND = "nativesdk"

View File

@@ -0,0 +1,44 @@
From e174b6e7d195d5a7465575641b7f68581f162574 Mon Sep 17 00:00:00 2001
From: Li Zhou <li.zhou@windriver.com>
Date: Thu, 27 Jun 2019 13:10:47 +0800
Subject: [PATCH] dc: fix exit code of q command
The exit code for "echo q | dc" is 1 for dc-1.4.1;
while the exit code for "echo q | dc" is 0 for dc-1.4.
Here is the answer from ken@gnu.org:
dc-1.4 was right. There was a rewrite of a chunk of code for 1.4.1 to
fix a corner case in the Q command, and somehow the placement of the
clean-up label for the 'q' command got misplaced on the error-handling
branch instead of the clean-exit branch. The patch below fixes this
(it is committed for whenever the next bc/dc release gets made).
Thanks for the report,
--Ken Pizzini
Upstream-Status: Backport [Got the solution from maintainer]
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
dc/eval.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dc/eval.c b/dc/eval.c
index 05a3d9e..bcab8db 100644
--- a/dc/eval.c
+++ b/dc/eval.c
@@ -814,10 +814,10 @@ error_fail:
fprintf(stderr, "%s: ", progname);
perror("error reading input");
return DC_FAIL;
-reset_and_exit_quit:
reset_and_exit_fail:
signal(SIGINT, sigint_default);
return DC_FAIL;
+reset_and_exit_quit:
reset_and_exit_success:
signal(SIGINT, sigint_default);
return DC_SUCCESS;
--
1.9.1

View File

@@ -0,0 +1,46 @@
{"@iK20:s2:p@r",
"@iF1,5.6,7,8,9,10,11,12,13,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl5:C1,0:",
"s14:pl7:s0:pl14:RN1:l5:0<Z2:1s12:pl5:ns5:pN2:l2:s15:pK6:l15:+",
"K.44:l5:*+s13:pl5:cS1+s2:pN3:l5:1>Z4:l10:1+s10:pl5:K2:/s5:pl2:",
"1+s2:pJ3:N4:l13:s2:p1l5:+s14:pl5:s6:p1s8:pK2:s11:pN6:1B7:J5:N8:",
"l11:i11:pJ6:N7:l6:l5:*s6:l8:l11:*s8:/s9:pl9:0=Z9:l10:0>Z10:N11:",
"l10:d10:Z12:l14:l14:*s14:pJ11:N12:N10:l15:s2:pl12:Z13:1l14:/R",
"N13:l14:1/RN9:l14:l9:+s14:pJ8:N5:0R]@r",
"@iF2,5.7,9,10,11,12,13,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl5:C2,0:",
"s14:pl7:s0:pl14:RN1:l5:0{Z2:1K10:l2:^-1/RN2:l2:s15:pK6:l2:+s2:",
"pK2:s10:p0s11:pN3:l5:K2:}Z4:l10:K2:*s10:pl5:cRs5:pJ3:N4:N5:l5:",
"K.5:{Z6:l10:K2:*s10:pl5:cRs5:pJ5:N6:l5:1-l5:1+/s13:s14:pl13:l13:",
"*s12:pK3:s11:pN8:1B9:J7:N10:l11:K2:+s11:pJ8:N9:l13:l12:*s13:l11:",
"/s9:pl9:0=Z11:l10:l14:*s14:pl15:s2:pl14:1/RN11:l14:l9:+s14:pJ10:N7:",
"0R]@r",
"@iF3,5.7,9,11,12,13,16,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl5:C3,0:",
"s14:pl7:s0:pl14:RN1:l2:s15:pK1.1:l15:*K2:+s2:p1C4,0:s14:pl5:0",
"<Z2:1s12:pl5:ns5:pN2:0s2:pl5:l14:/K2:+K4:/s13:pl5:K4:l13:*l14:",
"*-s5:pl13:K2:%Z3:l5:ns5:pN3:l15:K2:+s2:pl5:s9:s14:pl5:nl5:*s16:",
"pK3:s11:pN5:1B6:J4:N7:l11:K2:+s11:pJ5:N6:l9:l16:l11:l11:1-*/*",
"s9:pl9:0=Z8:l15:s2:pl12:Z9:l14:n1/RN9:l14:1/RN8:l14:l9:+s14:p",
"J7:N4:0R]@r",
"@iF5,5.7,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl5:C5,0:s14:pl7:s0:pl14:",
"RN1:l2:s15:pl2:K1.2:*s2:pl5:1C4,0:K2:*+C3,0:s14:pl15:s2:pl14:",
"1/R0R]@r",
"@iF4,5.6,7,9,10,11,12,13,16,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl5:",
"C4,0:s14:pl7:s0:pl14:RN1:1s12:pl5:0<Z2:1ns12:pl5:ns5:pN2:l5:1",
"=Z3:l2:K25:{Z4:K.7853981633974483096156608:l12:/RN4:l2:K40:{Z5:",
"K.7853981633974483096156608458198757210492:l12:/RN5:l2:K60:{Z6:",
"K.785398163397448309615660845819875721049292349843776455243736",
":l12:/RN6:N3:l5:K.2:=Z7:l2:K25:{Z8:K.1973955598498807583700497",
":l12:/RN8:l2:K40:{Z9:K.1973955598498807583700497651947902934475",
":l12:/RN9:l2:K60:{Z10:K.197395559849880758370049765194790293447585103787852101517688",
":l12:/RN10:N7:l2:s15:pl5:K.2:>Z11:l15:K5:+s2:pK.2:C4,0:s6:pN11:",
"l15:K3:+s2:pN12:l5:K.2:>Z13:l10:1+s10:pl5:K.2:-1l5:K.2:*+/s5:",
"pJ12:N13:l5:s13:s14:pl5:nl5:*s16:pK3:s11:pN15:1B16:J14:N17:l11:",
"K2:+s11:pJ15:N16:l13:l16:*s13:l11:/s9:pl9:0=Z18:l15:s2:pl10:l6:",
"*l14:+l12:/RN18:l14:l9:+s14:pJ17:N14:0R]@r",
"@iF6,13,5.6,7,8,9,10,11,12,16,14,15[l0:KA:#Z1:l0:s7:pKA:s0:pl13:",
"l5:C6,00:s14:pl7:s0:pl14:RN1:l2:s15:p0s2:pl13:1/s13:pl13:0<Z2:",
"l13:ns13:pl13:K2:%1=Z3:1s12:pN3:N2:1s10:pK2:s11:pN5:l11:l13:{",
"B6:J4:N7:l11:i11:pJ5:N6:l10:l11:*s10:pJ7:N4:K1.5:l15:*s2:pl5:",
"l13:^K2:l13:^/l10:/s10:p1s9:s14:pl5:nl5:*K4:/s16:pK1.5:l15:*l10:",
"cL+l10:cS-s2:p1s11:pN9:1B10:J8:N11:l11:i11:pJ9:N10:l9:l16:*l11:",
"/l13:l11:+/s9:pl9:0=Z12:l15:s2:pl12:Z13:l10:nl14:*1/RN13:l10:",
"l14:*1/RN12:l14:l9:+s14:pJ11:N8:0R]@r",0}

View File

@@ -0,0 +1,24 @@
These rules are not cross-friendly so delete them and we'll generate the file offline.
Upstream-Status: Inappropriate
Signed-off-by: Ross Burton <ross.burton@intel.com>
diff --git a/bc/Makefile.am b/bc/Makefile.am
index d9d412e..f244241 100644
--- a/bc/Makefile.am
+++ b/bc/Makefile.am
@@ -31,14 +31,6 @@ global.o: libmath.h
fbcOBJ = main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o
-libmath.h: libmath.b $(fbcOBJ) $(LIBBC)
- echo '{0}' > libmath.h
- $(MAKE) global.o
- $(LINK) -o fbc $(fbcOBJ) global.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS)
- ./fbc -c $(srcdir)/libmath.b </dev/null >libmath.h
- $(srcdir)/fix-libmath_h
- rm -f ./fbc ./global.o
-
sbcOBJ = main.o sbc.o scan.o execute.o global.o load.o storage.o util.o \
warranty.o
sbc.o: sbc.c

View File

@@ -0,0 +1,9 @@
#! /bin/sh
for TEST in *.b; do
if bc -l $TEST </dev/null; then
echo "PASS: bc/$TEST"
else
echo "FAIL: bc/$TEST"
fi
done

View File

@@ -0,0 +1,40 @@
SUMMARY = "Arbitrary precision calculator language"
HOMEPAGE = "http://www.gnu.org/software/bc/bc.html"
DESCRIPTION = "bc is an arbitrary precision numeric processing language. Syntax is similar to C, but differs in many substantial areas. It supports interactive execution of statements."
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://COPYING.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
file://bc/bcdefs.h;endline=17;md5=4295c06df9e833519a342f7b5d43db06 \
file://dc/dc.h;endline=18;md5=36b8c600b63ee8c3aeade2764f6b2a4b \
file://lib/number.c;endline=20;md5=cf43068cc88f837731dc53240456cfaf"
SECTION = "base"
DEPENDS = "flex-native"
SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
file://no-gen-libmath.patch \
file://libmath.h \
file://0001-dc-fix-exit-code-of-q-command.patch \
file://run-ptest"
SRC_URI[md5sum] = "cda93857418655ea43590736fc3ca9fc"
SRC_URI[sha256sum] = "62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a"
inherit autotools texinfo update-alternatives ptest
PACKAGECONFIG ??= "readline"
PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
do_compile:prepend() {
cp -f ${WORKDIR}/libmath.h ${B}/bc/libmath.h
}
do_install_ptest() {
install ${S}/Test/*.b ${D}${PTEST_PATH}
}
ALTERNATIVE:${PN} = "bc dc"
ALTERNATIVE_PRIORITY = "100"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -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 <alex.kanavin@gmail.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

View File

@@ -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 <alex.kanavin@gmail.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

View File

@@ -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 <alex.kanavin@gmail.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

View File

@@ -0,0 +1,19 @@
Description: Fix FTBFS with glibc 2.28
Author: Adrian Bunk <bunk@debian.org>
Bug-Debian: https://bugs.debian.org/917055
This patch is taken from
http://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.1.debian.tar.xz
Upstream-Status: Inappropriate [upstream is dead]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
--- blktool-4.orig/blktool.c
+++ blktool-4/blktool.c
@@ -18,6 +18,7 @@
#include <unistd.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
+#include <sys/sysmacros.h>
#include <fcntl.h>
#include <errno.h>
#include <getopt.h>

View File

@@ -0,0 +1,29 @@
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 = "GPL-2.0-or-later"
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 \
file://0004-fix-ftbfs-glibc-2.28.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

View File

@@ -0,0 +1,74 @@
lib_LTLIBRARIES = libbz2.la
libbz2_la_LDFLAGS = -version-info 1:8: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
./bzip2-tests/run-tests.sh --without-valgrind --tests-dir="$(PWD)/bzip2-tests"
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

View File

@@ -0,0 +1,11 @@
AC_PREREQ([2.57])
AC_INIT(bzip2, %BZIP2_VERSION%)
AM_INIT_AUTOMAKE(foreign)
AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_LIBTOOL
AC_OUTPUT([Makefile])

View File

@@ -0,0 +1,2 @@
#!/bin/sh
make -k runtest

View File

@@ -0,0 +1,70 @@
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 = "https://sourceware.org/bzip2/"
SECTION = "console/utils"
LICENSE = "bzip2-1.0.6 & GPL-3.0-or-later & Apache-2.0 & MS-PL & BSD-3-Clause & Zlib"
LICENSE:${PN} = "bzip2-1.0.6"
LICENSE:${PN}-dev = "bzip2-1.0.6"
LICENSE:${PN}-dbg = "bzip2-1.0.6"
LICENSE:${PN}-doc = "bzip2-1.0.6"
LICENSE:${PN}-src = "bzip2-1.0.6"
LICENSE:libbz2 = "bzip2-1.0.6"
LICENSE:${PN}-ptest = "bzip2-1.0.6 & GPL-3.0-or-later & Apache-2.0 & MS-PL & BSD-3-Clause & Zlib"
LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;endline=37;md5=600af43c50f1fcb82e32f19b32df4664 \
file://${WORKDIR}/git/commons-compress/LICENSE.txt;md5=86d3f3a95c324c9479bd8986968f4327 \
file://${WORKDIR}/git/dotnetzip/License.txt;md5=9cb56871eed4e748c3bc7e8ff352a54f \
file://${WORKDIR}/git/dotnetzip/License.zlib.txt;md5=cc421ccd22eeb2e5db6b79e6de0a029f \
file://${WORKDIR}/git/go/LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707 \
file://${WORKDIR}/git/lbzip2/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
"
SRC_URI = "https://sourceware.org/pub/${BPN}/${BPN}-${PV}.tar.gz \
git://sourceware.org/git/bzip2-tests.git;name=bzip2-tests;branch=master;protocol=https \
file://configure.ac;subdir=${BP} \
file://Makefile.am;subdir=${BP} \
file://run-ptest \
"
SRC_URI[md5sum] = "67e051268d0c475ea773822f7500d0e5"
SRC_URI[sha256sum] = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269"
SRCREV_bzip2-tests = "f9061c030a25de5b6829e1abf373057309c734c0"
UPSTREAM_CHECK_URI = "https://www.sourceware.org/pub/bzip2/"
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 bzip2"
#install binaries to bzip2-native under sysroot for replacement-native
EXTRA_OECONF:append:class-native = " --bindir=${STAGING_BINDIR_NATIVE}/${PN}"
do_configure:prepend () {
sed -i -e "s|%BZIP2_VERSION%|${PV}|" ${S}/configure.ac
}
do_install_ptest () {
install -d ${D}${PTEST_PATH}/bzip2-tests
cp -r ${WORKDIR}/git/commons-compress ${D}${PTEST_PATH}/bzip2-tests/commons-compress
cp -r ${WORKDIR}/git/dotnetzip ${D}${PTEST_PATH}/bzip2-tests/dotnetzip
cp -r ${WORKDIR}/git/go ${D}${PTEST_PATH}/bzip2-tests/go
cp -r ${WORKDIR}/git/lbzip2 ${D}${PTEST_PATH}/bzip2-tests/lbzip2
cp -r ${WORKDIR}/git/pyflate ${D}${PTEST_PATH}/bzip2-tests/pyflate
cp ${WORKDIR}/git/README ${D}${PTEST_PATH}/bzip2-tests/
cp ${WORKDIR}/git/run-tests.sh ${D}${PTEST_PATH}/bzip2-tests/
sed -i -e "s|^Makefile:|_Makefile:|" ${D}${PTEST_PATH}/Makefile
}
FILES:libbz2 = "${libdir}/lib*${SOLIBS}"
RDEPENDS:${PN}-ptest += "make bash"
PROVIDES:append:class-native = " bzip2-replacement-native"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,88 @@
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"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
file://run-ptest \
file://test.sh \
"
SRC_URI[sha256sum] = "efa50ef983137eefc0a02fdb51509d624b5e3295c980aa127ceee4183455499e"
inherit autotools gettext texinfo ptest
CVE_STATUS[CVE-2010-4226] = "not-applicable-platform: Issue applies to use of cpio in SUSE/OBS"
CVE_STATUS[CVE-2023-7216] = "disputed: intended behaviour, see https://lists.gnu.org/archive/html/bug-cpio/2024-03/msg00000.html"
EXTRA_OECONF += "DEFAULT_RMT_DIR=${sbindir}"
do_install () {
autotools_do_install
if [ "${base_bindir}" != "${bindir}" ]; then
install -d ${D}${base_bindir}/
mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio"
if [ "${sbindir}" != "${bindir}" ]; then
rmdir ${D}${bindir}/
fi
fi
# Avoid conflicts with the version from tar
mv "${D}${mandir}/man8/rmt.8" "${D}${mandir}/man8/rmt-cpio.8"
}
do_compile_ptest() {
oe_runmake -C ${B}/gnu/ check
oe_runmake -C ${B}/lib/ check
oe_runmake -C ${B}/rmt/ check
oe_runmake -C ${B}/src/ check
oe_runmake -C ${B}/tests/ genfile
}
do_install_ptest() {
install -d ${D}${PTEST_PATH}/tests/
sed -i "/abs_/d" ${B}/tests/atconfig
install --mode=755 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/
sed -i "s%${B}/tests:%%g" ${B}/tests/atlocal
sed -i "s%${B}/src:%%g" ${B}/tests/atlocal
install --mode=755 ${B}/tests/atlocal ${D}${PTEST_PATH}/tests/
install --mode=755 ${B}/tests/genfile ${D}${PTEST_PATH}/tests/
install --mode=755 ${S}/tests/testsuite ${D}${PTEST_PATH}/tests/
install --mode=755 ${WORKDIR}/test.sh ${D}${PTEST_PATH}/test.sh
sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/test.sh
}
# ptest.bbclass currently chowns the ptest directory explicitly, so we need to
# change permission after that has happened so the ptest user can write a
# temporary directory.
do_install_ptest_base:append() {
chgrp -R ptest ${D}${PTEST_PATH}/
chmod -R g+w ${D}${PTEST_PATH}/
}
# The tests need to run as a non-root user, so pull in the ptest user
DEPENDS:append:class-target = "${@bb.utils.contains('PTEST_ENABLED', '1', ' ptest-runner', '', d)}"
PACKAGE_WRITE_DEPS += "ptest-runner"
RDEPENDS:${PN}-ptest += "ptest-runner"
PACKAGES =+ "${PN}-rmt"
FILES:${PN}-rmt = "${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] = "${sbindir}/rmt"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,3 @@
#!/bin/sh
su -c ./test.sh ptest

View File

@@ -0,0 +1,10 @@
#!/bin/sh
# Define cpio test work dir
WORKDIR=@PTEST_PATH@/tests/
# Run test
cd ${WORKDIR}
./atconfig ./atlocal ./testsuite
./testsuite 2>&1 | grep -E '[0-9]{1,3}: ' | sed -e 's/^.....//' -e '/[ok]$/s/^/PASS: /;/FAILED (.*)/s/^/FAIL: /;/skipped (.*)/s/^/SKIP: /;/expected failure/ s/^/PASS: /;/UNEXPECTED PASS/s/^/FAIL: /' -e 's/ok$//g' -e 's/FAILED.*//g' -e 's/skipped.*//g' -e 's/expected failure.*//g' -e 's/UNEXPECTED PASS.*//g'

View File

@@ -0,0 +1,339 @@
From aae03b7e626d5f62ab929d51d11352a5a2ff6b2d 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 1/2] 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: Submitted [https://github.com/cracklib/cracklib/pull/41]
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 9396e1d..d0bb181 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"
#define DEBUG 0
@@ -43,6 +49,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)
@@ -55,6 +240,7 @@ _PWIsBroken64(FILE *ifp)
return 0;
}
+ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64);
return (pdesc64.header.pih_magic == PIH_MAGIC);
}
@@ -147,7 +333,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;
@@ -171,6 +361,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. */
@@ -193,6 +384,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 */
@@ -288,6 +480,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];
@@ -297,6 +490,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++)
{
@@ -330,7 +524,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);
@@ -349,7 +547,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((char *)tmp_pwp.hwms, sizeof(tmp_pwp.hwms), en_is32);
+ fwrite(tmp_pwp.hwms, 1, sizeof(tmp_pwp.hwms), pwp->wfp);
}
}
@@ -403,7 +606,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, (FILE*) pwp->dfp);
@@ -462,6 +666,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))
@@ -475,6 +680,7 @@ GetPW(pwp, number)
perror("(index fread failed)");
return NULL;
}
+ datum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum;
}
int r = 1;
--
2.20.1

View File

@@ -0,0 +1,33 @@
SUMMARY = "Password strength checker library"
HOMEPAGE = "https://github.com/cracklib/cracklib"
DESCRIPTION = "${SUMMARY}"
LICENSE = "LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06"
DEPENDS = "cracklib-native zlib"
EXTRA_OECONF = "--without-python --libdir=${base_libdir}"
SRC_URI = "git://github.com/cracklib/cracklib;protocol=https;branch=main \
file://0001-packlib.c-support-dictionary-byte-order-dependent.patch \
"
SRCREV = "4cf5125250c6325ef0a2dc085eabff875227edc3"
S = "${WORKDIR}/git/src"
inherit autotools gettext
# This is custom stuff from upstream's autogen.sh
do_configure:prepend() {
mkdir -p ${S}/m4
echo EXTRA_DIST = *.m4 > ${S}/m4/Makefile.am
touch ${S}/ABOUT-NLS
}
do_install:append:class-target() {
create-cracklib-dict -o ${D}${datadir}/cracklib/pw_dict ${D}${datadir}/cracklib/cracklib-small
}
BBCLASSEXTEND = "native nativesdk"

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,32 @@
From f5b325cba73018e5be984570fd4e680e59e7865d Mon Sep 17 00:00:00 2001
From: Wenzong Fan <wenzong.fan@windriver.com>
Date: Wed, 20 Jul 2011 02:42:28 +0000
Subject: [PATCH] cronie: enable PAM support for cronie
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>
---
pam/crond | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pam/crond b/pam/crond
index 560529d..95a6457 100644
--- a/pam/crond
+++ b/pam/crond
@@ -4,8 +4,8 @@
#
# Although no PAM authentication is called, auth modules
# are used for credential setting
-auth include system-auth
+auth include common-auth
account required pam_access.so
-account include system-auth
+account include common-auth
session required pam_loginuid.so
-session include system-auth
+session include common-session-noninteractive

View File

@@ -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

View File

@@ -0,0 +1,85 @@
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 & GPL-2.0-or-later"
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"
GITHUB_BASE_URI = "https://github.com/cronie-crond/${BPN}/releases/"
SRC_URI = "${GITHUB_BASE_URI}/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[sha256sum] = "f1da374a15ba7605cf378347f96bc8b678d3d7c0765269c8242cfe5b0789c571"
inherit autotools update-rc.d useradd systemd github-releases
UPSTREAM_CHECK_REGEX = "releases/tag/cronie-(?P<pver>\d+(\.\d+)+)"
PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"
PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,${PAM_DEPS}"
PACKAGECONFIG[anacron] = "--enable-anacron,--disable-anacron,anacron"
PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
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_system_unitdir}
install -m 0644 ${WORKDIR}/crond.service ${D}${systemd_system_unitdir}
sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
-e 's,@SBINDIR@,${sbindir},g' \
${D}${systemd_system_unitdir}/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"

View File

@@ -0,0 +1,123 @@
SUMMARY = "An Internet printing system for Unix"
DESCRIPTION = "The Common UNIX Printing System is a printing system and \
general replacement for lpd and the like. It supports the Internet Printing \
Protocol (IPP), and has its own filtering driver model for handling various \
document types."
HOMEPAGE = "https://www.cups.org/"
SECTION = "console/utils"
LICENSE = "Apache-2.0"
DEPENDS = "libpng jpeg dbus zlib libusb1"
SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/cups-${PV}-source.tar.gz \
file://0001-use-echo-only-in-init.patch \
file://0002-don-t-try-to-run-generated-binaries.patch \
file://libexecdir.patch \
file://0004-cups-fix-multilib-install-file-conflicts.patch \
file://volatiles.99_cups \
file://cups-volatiles.conf \
file://CVE-2024-47175-1.patch \
file://CVE-2024-47175-2.patch \
file://CVE-2024-47175-3.patch \
file://CVE-2024-47175-4.patch \
file://CVE-2024-47175-5.patch \
"
GITHUB_BASE_URI = "https://github.com/OpenPrinting/cups/releases"
CVE_STATUS[CVE-2008-1033] = "not-applicable-platform: Issue only applies to MacOS"
CVE_STATUS[CVE-2009-0032] = "cpe-incorrect: Issue affects pdfdistiller plugin used with but not part of cups"
CVE_STATUS[CVE-2018-6553] = "not-applicable-platform: This is an Ubuntu only issue"
CVE_STATUS[CVE-2022-26691] = "fixed-version: This is fixed in 2.4.2 but the cve-check class still reports it"
CVE_STATUS[CVE-2021-25317] = "not-applicable-config: This concerns /var/log/cups having lp ownership, our /var/log/cups is root:root, so this doesn't apply."
LEAD_SONAME = "libcupsdriver.so"
CLEANBROKEN = "1"
inherit autotools-brokensep binconfig useradd systemd pkgconfig multilib_script github-releases
USERADD_PACKAGES = "${PN}"
GROUPADD_PARAM:${PN} = "--system lpadmin"
SYSTEMD_SERVICE:${PN} = "cups.socket cups.path cups.service cups-lpd.socket"
PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)} \
openssl \
"
PACKAGECONFIG[avahi] = "--with-dnssd=avahi,--with-dnssd=no,avahi"
PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
PACKAGECONFIG[gnutls] = "--with-tls=gnutls,,gnutls,,,openssl"
PACKAGECONFIG[openssl] = "--with-tls=openssl,,openssl,,,gnutls"
PACKAGECONFIG[pam] = "--enable-pam --with-pam-module=unix, --disable-pam, libpam"
PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
PACKAGECONFIG[webif] = "--enable-webif,--disable-webif"
EXTRA_OECONF = " \
--enable-dbus \
--with-dbusdir=${sysconfdir}/dbus-1 \
--enable-browsing \
--disable-gssapi \
--enable-debug \
--disable-relro \
--enable-libusb \
--with-system-groups=lpadmin,root,sys,wheel \
--with-cups-group=lp \
--with-domainsocket=/run/cups/cups.sock \
--with-pkgconfpath=${libdir}/pkgconfig \
DSOFLAGS='${LDFLAGS}' \
"
EXTRA_AUTORECONF += "--exclude=autoheader"
do_install () {
oe_runmake "BUILDROOT=${D}" install
# Remove /var/run from package as cupsd will populate it on startup
rm -fr ${D}/${localstatedir}/run
rm -fr ${D}/${localstatedir}/log
rmdir ${D}/${libexecdir}/${BPN}/driver
# Fix the pam configuration file permissions
if ${@bb.utils.contains('PACKAGECONFIG', '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*
install -d ${D}${sysconfdir}/tmpfiles.d
install -m 0644 ${WORKDIR}/cups-volatiles.conf \
${D}${sysconfdir}/tmpfiles.d/cups.conf
else
install -d ${D}${sysconfdir}/default/volatiles
install -m 0644 ${WORKDIR}/volatiles.99_cups \
${D}${sysconfdir}/default/volatiles/99_cups
fi
}
PACKAGES =+ "${PN}-lib ${PN}-libimage ${PN}-webif"
RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
FILES:${PN} += "${libexecdir}/cups/"
FILES:${PN}-lib = "${libdir}/libcups.so.*"
FILES:${PN}-libimage = "${libdir}/libcupsimage.so.*"
# put the html for the web interface into its own PACKAGE
FILES:${PN}-webif += "${datadir}/doc/cups/ ${datadir}/icons/"
RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'webif', '${PN}-webif', '', d)}"
CONFFILES:${PN} += "${sysconfdir}/cups/cupsd.conf"
MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config"
LOCALE_PATHS += "${datadir}/cups/templates"
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=${libexecdir}/cups:'
}

View File

@@ -0,0 +1,24 @@
From ddfe6ed6a89226985e8c9f0751c026aabc0927a0 Mon Sep 17 00:00:00 2001
From: Saul Wold <sgw@linux.intel.com>
Date: Thu, 13 Dec 2012 19:03:52 -0800
Subject: [PATCH] use echo only in init
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
scheduler/cups.sh.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scheduler/cups.sh.in b/scheduler/cups.sh.in
index 74cce18..c57f0db 100644
--- a/scheduler/cups.sh.in
+++ b/scheduler/cups.sh.in
@@ -51,7 +51,7 @@ case "`uname`" in
ECHO_ERROR=:
;;
- Linux*)
+ DisableLinux*)
IS_ON=/bin/true
if test -f /etc/init.d/functions; then
. /etc/init.d/functions

View File

@@ -0,0 +1,27 @@
From ff6c7168c3f26094b3a18298208a28831d1c1fd5 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
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
ppdc/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ppdc/Makefile b/ppdc/Makefile
index e36ed11..3fe97e1 100644
--- a/ppdc/Makefile
+++ b/ppdc/Makefile
@@ -187,8 +187,8 @@ genstrings: genstrings.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC) \
$(LD_CXX) $(ARCHFLAGS) $(ALL_LDFLAGS) -o genstrings genstrings.o \
libcupsppdc.a $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
- echo Generating localization strings...
- ./genstrings >sample.c
+# echo Generating localization strings...
+# ./genstrings >sample.c
#

View File

@@ -0,0 +1,29 @@
From 6e286b582571ffca3f7874076d70eec6fd5713f6 Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Wed, 3 Oct 2018 00:27:11 +0800
Subject: [PATCH] cups: fix multilib install file conflicts
@CUPS_SERVERBIN@ is ${libdir} related that causes multilib install file
conflict. Remove @CUPS_SERVERBIN@ from the comment line of cups-files.conf to
avoid the conflict.
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
conf/cups-files.conf.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/conf/cups-files.conf.in b/conf/cups-files.conf.in
index 93584a1..65b7052 100644
--- a/conf/cups-files.conf.in
+++ b/conf/cups-files.conf.in
@@ -67,7 +67,7 @@ PageLog @CUPS_LOGDIR@/page_log
#RequestRoot @CUPS_REQUESTS@
# Location of helper programs...
-#ServerBin @CUPS_SERVERBIN@
+#ServerBin
# SSL/TLS keychain for the scheduler...
#ServerKeychain @CUPS_SERVERKEYCHAIN@

View File

@@ -0,0 +1,73 @@
From 9939a70b750edd9d05270060cc5cf62ca98cfbe5 Mon Sep 17 00:00:00 2001
From: Michael R Sweet <msweet@msweet.org>
Date: Mon, 9 Sep 2024 10:03:10 -0400
Subject: [PATCH] Mirror IPP Everywhere printer changes from master.
Upstream-Status: Backport [https://github.com/OpenPrinting/cups/commit/9939a70b750edd9d05270060cc5cf62ca98cfbe5]
CVE: CVE-2024-47175
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
cups/ppd-cache.c | 10 +++++-----
scheduler/ipp.c | 7 +++++++
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
index e750fcc..cd2d6cb 100644
--- a/cups/ppd-cache.c
+++ b/cups/ppd-cache.c
@@ -3317,10 +3317,10 @@ _ppdCreateFromIPP2(
}
cupsFilePuts(fp, "\"\n");
- if ((attr = ippFindAttribute(supported, "printer-more-info", IPP_TAG_URI)) != NULL)
+ if ((attr = ippFindAttribute(supported, "printer-more-info", IPP_TAG_URI)) != NULL && ippValidateAttribute(attr))
cupsFilePrintf(fp, "*APSupplies: \"%s\"\n", ippGetString(attr, 0, NULL));
- if ((attr = ippFindAttribute(supported, "printer-charge-info-uri", IPP_TAG_URI)) != NULL)
+ if ((attr = ippFindAttribute(supported, "printer-charge-info-uri", IPP_TAG_URI)) != NULL && ippValidateAttribute(attr))
cupsFilePrintf(fp, "*cupsChargeInfoURI: \"%s\"\n", ippGetString(attr, 0, NULL));
if ((attr = ippFindAttribute(supported, "printer-strings-uri", IPP_TAG_URI)) != NULL)
@@ -3389,10 +3389,10 @@ _ppdCreateFromIPP2(
if (ippGetBoolean(ippFindAttribute(supported, "job-accounting-user-id-supported", IPP_TAG_BOOLEAN), 0))
cupsFilePuts(fp, "*cupsJobAccountingUserId: True\n");
- if ((attr = ippFindAttribute(supported, "printer-privacy-policy-uri", IPP_TAG_URI)) != NULL)
+ if ((attr = ippFindAttribute(supported, "printer-privacy-policy-uri", IPP_TAG_URI)) != NULL && ippValidateAttribute(attr))
cupsFilePrintf(fp, "*cupsPrivacyURI: \"%s\"\n", ippGetString(attr, 0, NULL));
- if ((attr = ippFindAttribute(supported, "printer-mandatory-job-attributes", IPP_TAG_KEYWORD)) != NULL)
+ if ((attr = ippFindAttribute(supported, "printer-mandatory-job-attributes", IPP_TAG_KEYWORD)) != NULL && ippValidateAttribute(attr))
{
char prefix = '\"'; // Prefix for string
@@ -3410,7 +3410,7 @@ _ppdCreateFromIPP2(
cupsFilePuts(fp, "\"\n");
}
- if ((attr = ippFindAttribute(supported, "printer-requested-job-attributes", IPP_TAG_KEYWORD)) != NULL)
+ if ((attr = ippFindAttribute(supported, "printer-requested-job-attributes", IPP_TAG_KEYWORD)) != NULL && ippValidateAttribute(attr))
{
char prefix = '\"'; // Prefix for string
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index 37623c5..836e41d 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -5417,6 +5417,13 @@ create_local_bg_thread(
}
}
+ // Validate response from printer...
+ if (!ippValidateAttributes(response))
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR, "%s: Printer returned invalid data: %s", printer->name, cupsLastErrorString());
+ return (NULL);
+ }
+
// TODO: Grab printer icon file...
httpClose(http);
--
2.25.1

View File

@@ -0,0 +1,151 @@
From 04bb2af4521b56c1699a2c2431c56c05a7102e69 Mon Sep 17 00:00:00 2001
From: Michael R Sweet <msweet@msweet.org>
Date: Mon, 9 Sep 2024 14:05:42 -0400
Subject: [PATCH] Refactor make-and-model code.
Upstream-Status: Backport [https://github.com/OpenPrinting/cups/commit/04bb2af4521b56c1699a2c2431c56c05a7102e69]
CVE: CVE-2024-47175
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
cups/ppd-cache.c | 103 +++++++++++++++++++++++++++++++++++++++--------
1 file changed, 87 insertions(+), 16 deletions(-)
diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
index cd2d6cb..a4d7403 100644
--- a/cups/ppd-cache.c
+++ b/cups/ppd-cache.c
@@ -3197,9 +3197,10 @@ _ppdCreateFromIPP2(
ipp_t *media_col, /* Media collection */
*media_size; /* Media size collection */
char make[256], /* Make and model */
- *model, /* Model name */
+ *mptr, /* Pointer into make and model */
ppdname[PPD_MAX_NAME];
/* PPD keyword */
+ const char *model; /* Model name */
int i, j, /* Looping vars */
count, /* Number of values */
bottom, /* Largest bottom margin */
@@ -3260,34 +3261,104 @@ _ppdCreateFromIPP2(
}
/*
- * Standard stuff for PPD file...
+ * Get a sanitized make and model...
*/
- cupsFilePuts(fp, "*PPD-Adobe: \"4.3\"\n");
- cupsFilePuts(fp, "*FormatVersion: \"4.3\"\n");
- cupsFilePrintf(fp, "*FileVersion: \"%d.%d\"\n", CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR);
- cupsFilePuts(fp, "*LanguageVersion: English\n");
- cupsFilePuts(fp, "*LanguageEncoding: ISOLatin1\n");
- cupsFilePuts(fp, "*PSVersion: \"(3010.000) 0\"\n");
- cupsFilePuts(fp, "*LanguageLevel: \"3\"\n");
- cupsFilePuts(fp, "*FileSystem: False\n");
- cupsFilePuts(fp, "*PCFileName: \"ippeve.ppd\"\n");
+ if ((attr = ippFindAttribute(supported, "printer-make-and-model", IPP_TAG_TEXT)) != NULL && ippValidateAttribute(attr))
+ {
+ /*
+ * Sanitize the model name to only contain PPD-safe characters.
+ */
- if ((attr = ippFindAttribute(supported, "printer-make-and-model", IPP_TAG_TEXT)) != NULL)
strlcpy(make, ippGetString(attr, 0, NULL), sizeof(make));
+
+ for (mptr = make; *mptr; mptr ++)
+ {
+ if (*mptr < ' ' || *mptr >= 127 || *mptr == '\"')
+ {
+ /*
+ * Truncate the make and model on the first bad character...
+ */
+
+ *mptr = '\0';
+ break;
+ }
+ }
+
+ while (mptr > make)
+ {
+ /*
+ * Strip trailing whitespace...
+ */
+
+ mptr --;
+ if (*mptr == ' ')
+ *mptr = '\0';
+ }
+
+ if (!make[0])
+ {
+ /*
+ * Use a default make and model if nothing remains...
+ */
+
+ strlcpy(make, "Unknown", sizeof(make));
+ }
+ }
else
- strlcpy(make, "Unknown Printer", sizeof(make));
+ {
+ /*
+ * Use a default make and model...
+ */
+
+ strlcpy(make, "Unknown", sizeof(make));
+ }
if (!_cups_strncasecmp(make, "Hewlett Packard ", 16) || !_cups_strncasecmp(make, "Hewlett-Packard ", 16))
{
+ /*
+ * Normalize HP printer make and model...
+ */
+
model = make + 16;
strlcpy(make, "HP", sizeof(make));
+
+ if (!_cups_strncasecmp(model, "HP ", 3))
+ model += 3;
+ }
+ else if ((mptr = strchr(make, ' ')) != NULL)
+ {
+ /*
+ * Separate "MAKE MODEL"...
+ */
+
+ while (*mptr && *mptr == ' ')
+ *mptr++ = '\0';
+
+ model = mptr;
}
- else if ((model = strchr(make, ' ')) != NULL)
- *model++ = '\0';
else
- model = make;
+ {
+ /*
+ * No separate model name...
+ */
+ model = "Printer";
+ }
+
+ /*
+ * Standard stuff for PPD file...
+ */
+
+ cupsFilePuts(fp, "*PPD-Adobe: \"4.3\"\n");
+ cupsFilePuts(fp, "*FormatVersion: \"4.3\"\n");
+ cupsFilePrintf(fp, "*FileVersion: \"%d.%d\"\n", CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR);
+ cupsFilePuts(fp, "*LanguageVersion: English\n");
+ cupsFilePuts(fp, "*LanguageEncoding: ISOLatin1\n");
+ cupsFilePuts(fp, "*PSVersion: \"(3010.000) 0\"\n");
+ cupsFilePuts(fp, "*LanguageLevel: \"3\"\n");
+ cupsFilePuts(fp, "*FileSystem: False\n");
+ cupsFilePuts(fp, "*PCFileName: \"ippeve.ppd\"\n");
cupsFilePrintf(fp, "*Manufacturer: \"%s\"\n", make);
cupsFilePrintf(fp, "*ModelName: \"%s\"\n", model);
cupsFilePrintf(fp, "*Product: \"(%s)\"\n", model);
--
2.25.1

View File

@@ -0,0 +1,119 @@
From e0630cd18f76340d302000f2bf6516e99602b844 Mon Sep 17 00:00:00 2001
From: Michael R Sweet <msweet@msweet.org>
Date: Mon, 9 Sep 2024 15:59:57 -0400
Subject: [PATCH] PPDize preset and template names.
Upstream-Status: Backport [https://github.com/OpenPrinting/cups/commit/e0630cd18f76340d302000f2bf6516e99602b844]
CVE: CVE-2024-47175
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
cups/ppd-cache.c | 33 ++++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
index a4d7403..53c22be 100644
--- a/cups/ppd-cache.c
+++ b/cups/ppd-cache.c
@@ -4976,12 +4976,14 @@ _ppdCreateFromIPP2(
cupsArrayAdd(templates, (void *)keyword);
+ pwg_ppdize_name(keyword, ppdname, sizeof(ppdname));
+
snprintf(msgid, sizeof(msgid), "finishing-template.%s", keyword);
if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
msgstr = keyword;
- cupsFilePrintf(fp, "*cupsFinishingTemplate %s: \"\n", keyword);
+ cupsFilePrintf(fp, "*cupsFinishingTemplate %s: \"\n", ppdname);
for (finishing_attr = ippFirstAttribute(finishing_col); finishing_attr; finishing_attr = ippNextAttribute(finishing_col))
{
if (ippGetValueTag(finishing_attr) == IPP_TAG_BEGIN_COLLECTION)
@@ -4994,7 +4996,7 @@ _ppdCreateFromIPP2(
}
}
cupsFilePuts(fp, "\"\n");
- cupsFilePrintf(fp, "*%s.cupsFinishingTemplate %s/%s: \"\"\n", lang->language, keyword, msgstr);
+ cupsFilePrintf(fp, "*%s.cupsFinishingTemplate %s/%s: \"\"\n", lang->language, ppdname, msgstr);
cupsFilePuts(fp, "*End\n");
}
@@ -5040,7 +5042,8 @@ _ppdCreateFromIPP2(
if (!preset || !preset_name)
continue;
- cupsFilePrintf(fp, "*APPrinterPreset %s: \"\n", preset_name);
+ pwg_ppdize_name(preset_name, ppdname, sizeof(ppdname));
+ cupsFilePrintf(fp, "*APPrinterPreset %s: \"\n", ppdname);
for (member = ippFirstAttribute(preset); member; member = ippNextAttribute(preset))
{
member_name = ippGetName(member);
@@ -5081,7 +5084,10 @@ _ppdCreateFromIPP2(
fin_col = ippGetCollection(member, i);
if ((keyword = ippGetString(ippFindAttribute(fin_col, "finishing-template", IPP_TAG_ZERO), 0, NULL)) != NULL)
- cupsFilePrintf(fp, "*cupsFinishingTemplate %s\n", keyword);
+ {
+ pwg_ppdize_name(keyword, ppdname, sizeof(ppdname));
+ cupsFilePrintf(fp, "*cupsFinishingTemplate %s\n", ppdname);
+ }
}
}
else if (!strcmp(member_name, "media"))
@@ -5108,13 +5114,13 @@ _ppdCreateFromIPP2(
if ((keyword = ippGetString(ippFindAttribute(media_col, "media-source", IPP_TAG_ZERO), 0, NULL)) != NULL)
{
pwg_ppdize_name(keyword, ppdname, sizeof(ppdname));
- cupsFilePrintf(fp, "*InputSlot %s\n", keyword);
+ cupsFilePrintf(fp, "*InputSlot %s\n", ppdname);
}
if ((keyword = ippGetString(ippFindAttribute(media_col, "media-type", IPP_TAG_ZERO), 0, NULL)) != NULL)
{
pwg_ppdize_name(keyword, ppdname, sizeof(ppdname));
- cupsFilePrintf(fp, "*MediaType %s\n", keyword);
+ cupsFilePrintf(fp, "*MediaType %s\n", ppdname);
}
}
else if (!strcmp(member_name, "print-quality"))
@@ -5160,7 +5166,10 @@ _ppdCreateFromIPP2(
cupsFilePuts(fp, "\"\n*End\n");
if ((localized_name = _cupsMessageLookup(strings, preset_name)) != preset_name)
- cupsFilePrintf(fp, "*%s.APPrinterPreset %s/%s: \"\"\n", lang->language, preset_name, localized_name);
+ {
+ pwg_ppdize_name(preset_name, ppdname, sizeof(ppdname));
+ cupsFilePrintf(fp, "*%s.APPrinterPreset %s/%s: \"\"\n", lang->language, ppdname, localized_name);
+ }
}
}
@@ -5544,7 +5553,7 @@ pwg_ppdize_name(const char *ipp, /* I - IPP keyword */
*end; /* End of name buffer */
- if (!ipp)
+ if (!ipp || !_cups_isalnum(*ipp))
{
*name = '\0';
return;
@@ -5559,8 +5568,14 @@ pwg_ppdize_name(const char *ipp, /* I - IPP keyword */
ipp ++;
*ptr++ = (char)toupper(*ipp++ & 255);
}
- else
+ else if (*ipp == '_' || *ipp == '.' || *ipp == '-' || _cups_isalnum(*ipp))
+ {
*ptr++ = *ipp++;
+ }
+ else
+ {
+ ipp ++;
+ }
}
*ptr = '\0';
--
2.25.1

View File

@@ -0,0 +1,249 @@
From 1e6ca5913eceee906038bc04cc7ccfbe2923bdfd Mon Sep 17 00:00:00 2001
From: Michael R Sweet <msweet@msweet.org>
Date: Mon, 23 Sep 2024 09:36:39 -0400
Subject: [PATCH] Quote PPD localized strings.
Upstream-Status: Backport [https://github.com/OpenPrinting/cups/commit/1e6ca5913eceee906038bc04cc7ccfbe2923bdfd]
CVE: CVE-2024-47175
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
cups/ppd-cache.c | 93 +++++++++++++++++++++++++++---------------------
1 file changed, 53 insertions(+), 40 deletions(-)
diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
index 53c22be..f425ac0 100644
--- a/cups/ppd-cache.c
+++ b/cups/ppd-cache.c
@@ -32,6 +32,7 @@
static int cups_connect(http_t **http, const char *url, char *resource, size_t ressize);
static int cups_get_url(http_t **http, const char *url, char *name, size_t namesize);
static const char *ppd_inputslot_for_keyword(_ppd_cache_t *pc, const char *keyword);
+static void ppd_put_string(cups_file_t *fp, cups_lang_t *lang, cups_array_t *strings, const char *ppd_option, const char *ppd_choice, const char *pwg_msgid);
static void pwg_add_finishing(cups_array_t *finishings, ipp_finishings_t template, const char *name, const char *value);
static void pwg_add_message(cups_array_t *a, const char *msg, const char *str);
static int pwg_compare_finishings(_pwg_finishings_t *a, _pwg_finishings_t *b);
@@ -3394,7 +3395,7 @@ _ppdCreateFromIPP2(
if ((attr = ippFindAttribute(supported, "printer-charge-info-uri", IPP_TAG_URI)) != NULL && ippValidateAttribute(attr))
cupsFilePrintf(fp, "*cupsChargeInfoURI: \"%s\"\n", ippGetString(attr, 0, NULL));
- if ((attr = ippFindAttribute(supported, "printer-strings-uri", IPP_TAG_URI)) != NULL)
+ if ((attr = ippFindAttribute(supported, "printer-strings-uri", IPP_TAG_URI)) != NULL && ippValidateAttribute(attr))
{
http_t *http = NULL; /* Connection to printer */
char stringsfile[1024]; /* Temporary strings file */
@@ -3438,7 +3439,7 @@ _ppdCreateFromIPP2(
response = cupsDoRequest(http, request, resource);
- if ((attr = ippFindAttribute(response, "printer-strings-uri", IPP_TAG_URI)) != NULL)
+ if ((attr = ippFindAttribute(response, "printer-strings-uri", IPP_TAG_URI)) != NULL && ippValidateAttribute(attr))
cupsFilePrintf(fp, "*cupsStringsURI %s: \"%s\"\n", keyword, ippGetString(attr, 0, NULL));
ippDelete(response);
@@ -4044,18 +4045,16 @@ _ppdCreateFromIPP2(
cupsFilePrintf(fp, "*DefaultInputSlot: %s\n", ppdname);
for (j = 0; j < (int)(sizeof(sources) / sizeof(sources[0])); j ++)
+ {
if (!strcmp(sources[j], keyword))
{
snprintf(msgid, sizeof(msgid), "media-source.%s", keyword);
- if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
- if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
- msgstr = keyword;
-
cupsFilePrintf(fp, "*InputSlot %s: \"<</MediaPosition %d>>setpagedevice\"\n", ppdname, j);
- cupsFilePrintf(fp, "*%s.InputSlot %s/%s: \"\"\n", lang->language, ppdname, msgstr);
+ ppd_put_string(fp, lang, strings, "InputSlot", ppdname, msgid);
break;
}
+ }
}
cupsFilePuts(fp, "*CloseUI: *InputSlot\n");
}
@@ -4081,12 +4080,9 @@ _ppdCreateFromIPP2(
pwg_ppdize_name(keyword, ppdname, sizeof(ppdname));
snprintf(msgid, sizeof(msgid), "media-type.%s", keyword);
- if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
- if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
- msgstr = keyword;
cupsFilePrintf(fp, "*MediaType %s: \"<</MediaType(%s)>>setpagedevice\"\n", ppdname, ppdname);
- cupsFilePrintf(fp, "*%s.MediaType %s/%s: \"\"\n", lang->language, ppdname, msgstr);
+ ppd_put_string(fp, lang, strings, "MediaType", ppdname, msgid);
}
cupsFilePuts(fp, "*CloseUI: *MediaType\n");
}
@@ -4547,12 +4543,9 @@ _ppdCreateFromIPP2(
pwg_ppdize_name(keyword, ppdname, sizeof(ppdname));
snprintf(msgid, sizeof(msgid), "output-bin.%s", keyword);
- if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
- if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
- msgstr = keyword;
cupsFilePrintf(fp, "*OutputBin %s: \"\"\n", ppdname);
- cupsFilePrintf(fp, "*%s.OutputBin %s/%s: \"\"\n", lang->language, ppdname, msgstr);
+ ppd_put_string(fp, lang, strings, "OutputBin", ppdname, msgid);
if ((tray_ptr = ippGetOctetString(trays, i, &tray_len)) != NULL)
{
@@ -4671,9 +4664,6 @@ _ppdCreateFromIPP2(
cupsArrayAdd(names, (char *)keyword);
snprintf(msgid, sizeof(msgid), "finishings.%d", value);
- if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
- if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
- msgstr = keyword;
if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
@@ -4688,7 +4678,7 @@ _ppdCreateFromIPP2(
continue;
cupsFilePrintf(fp, "*StapleLocation %s: \"\"\n", ppd_keyword);
- cupsFilePrintf(fp, "*%s.StapleLocation %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
+ ppd_put_string(fp, lang, strings, "StapleLocation", ppd_keyword, msgid);
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*StapleLocation %s\"\n", value, keyword, ppd_keyword);
}
@@ -4751,9 +4741,6 @@ _ppdCreateFromIPP2(
cupsArrayAdd(names, (char *)keyword);
snprintf(msgid, sizeof(msgid), "finishings.%d", value);
- if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
- if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
- msgstr = keyword;
if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
@@ -4768,7 +4755,7 @@ _ppdCreateFromIPP2(
continue;
cupsFilePrintf(fp, "*FoldType %s: \"\"\n", ppd_keyword);
- cupsFilePrintf(fp, "*%s.FoldType %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
+ ppd_put_string(fp, lang, strings, "FoldType", ppd_keyword, msgid);
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*FoldType %s\"\n", value, keyword, ppd_keyword);
}
@@ -4839,9 +4826,6 @@ _ppdCreateFromIPP2(
cupsArrayAdd(names, (char *)keyword);
snprintf(msgid, sizeof(msgid), "finishings.%d", value);
- if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
- if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
- msgstr = keyword;
if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
@@ -4856,7 +4840,7 @@ _ppdCreateFromIPP2(
continue;
cupsFilePrintf(fp, "*PunchMedia %s: \"\"\n", ppd_keyword);
- cupsFilePrintf(fp, "*%s.PunchMedia %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
+ ppd_put_string(fp, lang, strings, "PunchMedia", ppd_keyword, msgid);
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*PunchMedia %s\"\n", value, keyword, ppd_keyword);
}
@@ -4927,9 +4911,6 @@ _ppdCreateFromIPP2(
cupsArrayAdd(names, (char *)keyword);
snprintf(msgid, sizeof(msgid), "finishings.%d", value);
- if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
- if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
- msgstr = keyword;
if (value == IPP_FINISHINGS_TRIM)
ppd_keyword = "Auto";
@@ -4937,7 +4918,7 @@ _ppdCreateFromIPP2(
ppd_keyword = trim_keywords[value - IPP_FINISHINGS_TRIM_AFTER_PAGES];
cupsFilePrintf(fp, "*CutMedia %s: \"\"\n", ppd_keyword);
- cupsFilePrintf(fp, "*%s.CutMedia %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
+ ppd_put_string(fp, lang, strings, "CutMedia", ppd_keyword, msgid);
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*CutMedia %s\"\n", value, keyword, ppd_keyword);
}
@@ -4979,9 +4960,6 @@ _ppdCreateFromIPP2(
pwg_ppdize_name(keyword, ppdname, sizeof(ppdname));
snprintf(msgid, sizeof(msgid), "finishing-template.%s", keyword);
- if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
- if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
- msgstr = keyword;
cupsFilePrintf(fp, "*cupsFinishingTemplate %s: \"\n", ppdname);
for (finishing_attr = ippFirstAttribute(finishing_col); finishing_attr; finishing_attr = ippNextAttribute(finishing_col))
@@ -4996,7 +4974,7 @@ _ppdCreateFromIPP2(
}
}
cupsFilePuts(fp, "\"\n");
- cupsFilePrintf(fp, "*%s.cupsFinishingTemplate %s/%s: \"\"\n", lang->language, ppdname, msgstr);
+ ppd_put_string(fp, lang, strings, "cupsFinishingTemplate", ppdname, msgid);
cupsFilePuts(fp, "*End\n");
}
@@ -5165,11 +5143,9 @@ _ppdCreateFromIPP2(
cupsFilePuts(fp, "\"\n*End\n");
- if ((localized_name = _cupsMessageLookup(strings, preset_name)) != preset_name)
- {
- pwg_ppdize_name(preset_name, ppdname, sizeof(ppdname));
- cupsFilePrintf(fp, "*%s.APPrinterPreset %s/%s: \"\"\n", lang->language, ppdname, localized_name);
- }
+ snprintf(msgid, sizeof(msgid), "preset-name.%s", preset_name);
+ pwg_ppdize_name(preset_name, ppdname, sizeof(ppdname));
+ ppd_put_string(fp, lang, strings, "APPrinterPreset", ppdname, msgid);
}
}
@@ -5440,6 +5416,43 @@ cups_get_url(http_t **http, /* IO - Current HTTP connection */
}
+/*
+ * 'ppd_put_strings()' - Write localization attributes to a PPD file.
+ */
+
+static void
+ppd_put_string(cups_file_t *fp, /* I - PPD file */
+ cups_lang_t *lang, /* I - Language */
+ cups_array_t *strings, /* I - Strings */
+ const char *ppd_option,/* I - PPD option */
+ const char *ppd_choice,/* I - PPD choice */
+ const char *pwg_msgid) /* I - PWG message ID */
+{
+ const char *text; /* Localized text */
+
+
+ if ((text = _cupsLangString(lang, pwg_msgid)) == pwg_msgid || !strcmp(pwg_msgid, text))
+ {
+ if ((text = _cupsMessageLookup(strings, pwg_msgid)) == pwg_msgid)
+ return;
+ }
+
+ // Add the first line of localized text...
+ cupsFilePrintf(fp, "*%s.%s %s/", lang->language, ppd_option, ppd_choice);
+ while (*text && *text != '\n')
+ {
+ // Escape ":" and "<"...
+ if (*text == ':' || *text == '<')
+ cupsFilePrintf(fp, "<%02X>", *text);
+ else
+ cupsFilePutChar(fp, *text);
+
+ text ++;
+ }
+ cupsFilePuts(fp, ": \"\"\n");
+}
+
+
/*
* 'pwg_add_finishing()' - Add a finishings value.
*/
--
2.25.1

View File

@@ -0,0 +1,40 @@
From 2abe1ba8a66864aa82cd9836b37e57103b8e1a3b Mon Sep 17 00:00:00 2001
From: Michael R Sweet <msweet@msweet.org>
Date: Mon, 23 Sep 2024 10:11:31 -0400
Subject: [PATCH] Fix warnings for unused vars.
Upstream-Status: Backport [https://github.com/OpenPrinting/cups/commit/2abe1ba8a66864aa82cd9836b37e57103b8e1a3b]
CVE: CVE-2024-47175
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
cups/ppd-cache.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
index f425ac0..d2533b7 100644
--- a/cups/ppd-cache.c
+++ b/cups/ppd-cache.c
@@ -3223,8 +3223,7 @@ _ppdCreateFromIPP2(
int have_qdraft = 0,/* Have draft quality? */
have_qhigh = 0; /* Have high quality? */
char msgid[256]; /* Message identifier (attr.value) */
- const char *keyword, /* Keyword value */
- *msgstr; /* Localized string */
+ const char *keyword; /* Keyword value */
cups_array_t *strings = NULL;/* Printer strings file */
struct lconv *loc = localeconv();
/* Locale data */
@@ -5010,9 +5009,8 @@ _ppdCreateFromIPP2(
{
ipp_t *preset = ippGetCollection(attr, i);
/* Preset collection */
- const char *preset_name = ippGetString(ippFindAttribute(preset, "preset-name", IPP_TAG_ZERO), 0, NULL),
+ const char *preset_name = ippGetString(ippFindAttribute(preset, "preset-name", IPP_TAG_ZERO), 0, NULL);
/* Preset name */
- *localized_name; /* Localized preset name */
ipp_attribute_t *member; /* Member attribute in preset */
const char *member_name; /* Member attribute name */
char member_value[256]; /* Member attribute value */
--
2.25.1

View File

@@ -0,0 +1 @@
d /var/log/cups 0755 root root -

View File

@@ -0,0 +1,35 @@
From 1724f7bcdbcfdb445778f8a2e530c5c094c18c10 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Tue, 13 Jul 2021 12:56:30 +0100
Subject: [PATCH] Use $libexecdir instead of hardcoding $prefix/lib as this
breaks multilib builds.
Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
config-scripts/cups-directories.m4 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config-scripts/cups-directories.m4 b/config-scripts/cups-directories.m4
index 2033d47..230166e 100644
--- a/config-scripts/cups-directories.m4
+++ b/config-scripts/cups-directories.m4
@@ -239,7 +239,7 @@ AC_SUBST([CUPS_REQUESTS])
AS_CASE(["$host_os_name"], [*-gnu], [
# GNUs
INSTALL_SYSV="install-sysv"
- CUPS_SERVERBIN="$exec_prefix/lib/cups"
+ CUPS_SERVERBIN="$libexecdir/cups"
], [*bsd* | darwin*], [
# *BSD and Darwin (macOS)
INSTALL_SYSV=""
@@ -247,7 +247,7 @@ AS_CASE(["$host_os_name"], [*-gnu], [
], [*], [
# All others
INSTALL_SYSV="install-sysv"
- CUPS_SERVERBIN="$exec_prefix/lib/cups"
+ CUPS_SERVERBIN="$libexecdir/cups"
])
AC_DEFINE_UNQUOTED([CUPS_SERVERBIN], ["$CUPS_SERVERBIN"], [Location of server programs.])

View File

@@ -0,0 +1,2 @@
# <type> <owner> <group> <mode> <path> <linksource>
d root root 0755 /var/log/cups none

View File

@@ -0,0 +1,5 @@
require cups.inc
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
SRC_URI[sha256sum] = "d75757c2bc0f7a28b02ee4d52ca9e4b1aa1ba2affe16b985854f5336940e5ad7"

View File

@@ -0,0 +1,23 @@
SUMMARY = "Collection of autoconf m4 macros"
SECTION = "base"
HOMEPAGE = "http://sourceforge.net/projects/cwautomacros.berlios/"
DESCRIPTION = "A collection of autoconf macros, plus an autogen.sh script that can be used with them."
LICENSE = "GPL-2.0-only"
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 LABEL=`date -d @${SOURCE_DATE_EPOCH} +%Y%m%d` CWAUTOMACROSPREFIX=${D}${prefix} install
# cleanup buildpaths in autogen.sh
sed -i -e 's,${D},,g' ${D}${prefix}/share/cwautomacros/scripts/autogen.sh
}
BBCLASSEXTEND = "native"

View File

@@ -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"

View File

@@ -0,0 +1,29 @@
From f31395c931bc633206eccfcfaaaa5d15021a3e86 Mon Sep 17 00:00:00 2001
From: Peiran Hong <peiran.hong@windriver.com>
Date: Thu, 5 Sep 2019 15:42:22 -0400
Subject: [PATCH] Skip strip-trailing-cr test case
Skip the test "strip-trailing-cr" since it requires valgrind to
work, but valgrind is considered too heavy-weight for diffutils
package.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Peiran Hong <peiran.hong@windriver.com>
---
tests/Makefile.am | 1 -
1 file changed, 1 deletion(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 79bacfb..4adb4d7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -22,7 +22,6 @@ TESTS = \
stdin \
strcoll-0-names \
filename-quoting \
- strip-trailing-cr \
timezone \
colors \
y2038-vs-32bit

View File

@@ -0,0 +1,4 @@
#!/bin/sh
abs_ptestdir=`echo "$(cd "$(dirname "$0")"; pwd)"`
make -C $abs_ptestdir/tests check-TESTS abs_top_srcdir="$abs_ptestdir"

View File

@@ -0,0 +1,43 @@
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
require diffutils.inc
SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \
file://run-ptest \
file://0001-Skip-strip-trailing-cr-test-case.patch \
"
SRC_URI[sha256sum] = "90e5e93cc724e4ebe12ede80df1634063c7a855692685919bfe60b556c9bd09e"
EXTRA_OECONF += "ac_cv_path_PR_PROGRAM=${bindir}/pr --without-libsigsegv-prefix"
# latest gnulib is no longer able to handle this - I dare not try to fix that maze of abstractions and generators
CFLAGS:mingw32 = " -DSA_RESTART=0"
# Fix "Argument list too long" error when len(TMPDIR) = 410
acpaths = "-I ./m4"
EXTRA_OEMAKE:append:mingw32 = " LIBS='-lbcrypt'"
inherit ptest
RDEPENDS:${PN}-ptest += "make perl"
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
}

View File

@@ -0,0 +1,38 @@
SUMMARY = "Line-oriented text editor"
HOMEPAGE = "http://www.gnu.org/software/ed/"
DESCRIPTION = "GNU ed is a line-oriented text editor. It is used to create, display, modify and otherwise manipulate text files, both interactively and via shell scripts. A restricted version of ed, red, can only edit files in the current directory and cannot execute shell commands."
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=76d6e300ffd8fb9d18bd9b136a9bba13 \
file://ed.h;endline=20;md5=c3212b6c53b09668107420af9368c0ef \
file://main.c;endline=17;md5=e5d2ae5ddd1ecb87dc71702c06dd06dc \
"
SECTION = "base"
CVE_PRODUCT = "gnu:ed"
# 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[sha256sum] = "65fec7318f48c2ca17f334ac0f4703defe62037bb13cc23920de077b5fa24523"
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
}

View File

@@ -0,0 +1,29 @@
From 758fde7186730ee331a0ee6149276cd412766ee0 Mon Sep 17 00:00:00 2001
From: Tudor Florea <tudor.florea@enea.com>
Date: Wed, 28 May 2014 18:59:54 +0200
Subject: [PATCH] ethtool: use serial-tests config needed by ptest.
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)
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index c871558..8ea1eaa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ AC_INIT(ethtool, 6.7, netdev@vger.kernel.org)
AC_PREREQ(2.52)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([ethtool.c])
-AM_INIT_AUTOMAKE([gnu subdir-objects])
+AM_INIT_AUTOMAKE([gnu subdir-objects serial-tests])
AC_CONFIG_HEADERS([ethtool-config.h])
AM_MAINTAINER_MODE

View File

@@ -0,0 +1,2 @@
#!/bin/sh
make -k runtest-TESTS

View File

@@ -0,0 +1,37 @@
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 = "GPL-2.0-or-later"
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[sha256sum] = "ace0e95a03b38208af4ebacb415244568ace44c5d5a279ea434844f900179c75"
UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/software/network/ethtool/"
inherit autotools ptest bash-completion pkgconfig
RDEPENDS:${PN}-ptest += "make bash"
PACKAGECONFIG ?= "netlink"
PACKAGECONFIG[netlink] = "--enable-netlink,--disable-netlink,libmnl,"
do_compile_ptest() {
oe_runmake buildtest-TESTS
}
do_install_ptest () {
cp ${B}/Makefile ${D}${PTEST_PATH}
install ${B}/test-cmdline ${D}${PTEST_PATH}
if ${@bb.utils.contains('PACKAGECONFIG', 'netlink', 'false', 'true', d)}; then
install ${B}/test-features ${D}${PTEST_PATH}
fi
install ${B}/ethtool ${D}${PTEST_PATH}/ethtool
sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile
}

View File

@@ -0,0 +1,19 @@
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.xz \
file://autoconf-2.73.patch \
file://run-ptest \
"
inherit autotools gettext texinfo update-alternatives ptest
ALTERNATIVE:${PN} = "find xargs"
ALTERNATIVE_PRIORITY = "100"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,24 @@
The gnulib largefile macro needs updating to work with autoconf 2.73. Rather
than the full code:
https://git.savannah.gnu.org/cgit/gnulib.git/commit/m4/largefile.m4?id=f91f633858cf132e50924224c50d6264a92caabb
Just tweak the exiting code to work with 2.73. The next findutils upgrade should
update to new gnulib
Upstream-Status: Inappropriate
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Index: findutils-4.9.0/gl/m4/largefile.m4
===================================================================
--- findutils-4.9.0.orig/gl/m4/largefile.m4
+++ findutils-4.9.0/gl/m4/largefile.m4
@@ -26,7 +26,7 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
# with _TIME_BITS. Also, work around a problem in autoconf <= 2.69:
# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5,
# or configures them incorrectly in some cases.
-m4_version_prereq([2.70], [], [
+m4_version_prereq([2.73], [], [
# _AC_SYS_LARGEFILE_TEST_INCLUDES
# -------------------------------

View File

@@ -0,0 +1,57 @@
#!/bin/bash
# create temporary symlink to workaround missing oldfind
ln -s /usr/bin/find /tmp/oldfind
# make oldfind visible
export PATH="/tmp:${PATH}"
export built_programs="find xargs locate updatedb"
# this gets substituted by sed during build
export VERSION="__run_ptest_version__"
# define missing functions for tests/init.sh
fu_path_prepend_ () {
path_prepend_ $@
}
print_ver_ () {
:
}
skip_if_root_ () {
[ $(id -u) = 0 ] && exit 77;
}
require_root_ () {
[ $(id -u) = 0 ] || exit 77;
}
expensive_ () {
:
}
export -f fu_path_prepend_
export -f print_ver_
export -f skip_if_root_
export -f require_root_
export -f expensive_
for f in tests/*/*.sh; do
bash $f ;
case $? in
0 )
echo -n "PASS";;
77 )
echo -n "SKIP";;
* )
echo -n "FAIL";;
esac
echo ": $f"
done
#remove symlink
rm -f /tmp/oldfind
echo

View File

@@ -0,0 +1,27 @@
require findutils.inc
# GPL-2.0-or-later (<< 4.2.32), GPL-3.0-or-later (>= 4.2.32)
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464"
DEPENDS = "bison-native"
SRC_URI[sha256sum] = "a2bfb8c09d436770edc59f50fa483e785b161a3b7b9d547573cb08065fd462fe"
PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux"
# http://savannah.gnu.org/bugs/?27299
CACHED_CONFIGUREVARS += "gl_cv_func_wcwidth_works=yes"
EXTRA_OECONF += "ac_cv_path_SORT=${bindir}/sort"
# need od from coreutils for -t option
RDEPENDS:${PN}-ptest += "bash sed grep coreutils"
do_install_ptest:class-target() {
mkdir -p ${D}${PTEST_PATH}/tests/
cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests/
# substitute value in run-ptest with actual version
sed -i -e 's/__run_ptest_version__/${PV}/' ${D}${PTEST_PATH}/run-ptest
}

View File

@@ -0,0 +1,38 @@
From 4f4e84f139e2a8682f1374a592f2636c43ad857b Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Tue, 21 May 2024 15:10:11 +0000
Subject: [PATCH] m4/readline: add missing includes
The cross-specific code fragment only includes stdio.h, where the native
fragment also includes fcntl.h and unistd.h. This is important because
GCC 14.1 has made the implicit definitions an error:
conftest.c: In function 'main':
conftest.c:144:9: error: implicit declaration of function 'close'; did you mean 'pclose'? [-Wimplicit-function-declaration]
conftest.c:146:14: error: implicit declaration of function 'open'; did you mean 'popen'? [-Wimplicit-function-declaration]
Add the missing includes so that the check doesn't always fail due to
these errors.
Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/gawk.git/commit/?id=c1613c310d71b87f509458e0259ecd10eda2b140]
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
m4/readline.m4 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/m4/readline.m4 b/m4/readline.m4
index 38f96326..efd52d4e 100644
--- a/m4/readline.m4
+++ b/m4/readline.m4
@@ -66,6 +66,8 @@ dnl action if false:
dnl action if cross compiling:
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
#include <readline/readline.h>
#include <readline/history.h>]], dnl includes
dnl function body
--
2.34.1

View File

@@ -0,0 +1,27 @@
#!/bin/sh
cd test
for i in `grep -E "^[a-z0-9_-]*:$" Maketests |awk -F: '{print $1}'`; do
unset LANG
grep -q "^$i$" skipped.txt
if [ $? -eq 0 ]; then
echo "SKIP: $i"
continue
fi
srcdir=`pwd` AWKPROG=gawk AWK=gawk CMP=cmp make -f Maketests $i >$i.tmp 2>&1
if [ -e _$i ]; then
cat _$i
grep -q "support not compiled in" _$i
if [ $? -eq 0 ]; then
echo "SKIP: $i"
continue
fi
fi
grep -q "Error" $i.tmp
if [ $? -eq 0 ]; then
echo "FAIL: $i"
else
echo "PASS: $i"
rm -f $i.tmp
fi
done

View File

@@ -0,0 +1,90 @@
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: GPL-2.0-only
# gawk >= 3.1.6: GPL-3.0-only
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
PACKAGECONFIG ??= "readline"
PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
file://0001-m4-readline-add-missing-includes.patch \
file://run-ptest \
"
SRC_URI[sha256sum] = "378f8864ec21cfceaa048f7e1869ac9b4597b449087caf1eb55e440d30273336"
inherit autotools gettext texinfo update-alternatives
FILES:${PN} += "${datadir}/awk"
FILES:${PN}-dev += "${libdir}/${BPN}/*.la"
PACKAGES =+ "${PN}-gawkbug"
FILES:${PN}-gawkbug += "${bindir}/gawkbug"
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
# Strip non-reproducible build flags (containing build paths)
sed -i -e 's|^CC.*|CC=""|g' -e 's|^CFLAGS.*|CFLAGS=""|g' ${D}${bindir}/gawkbug
}
inherit ptest
do_install_ptest() {
mkdir ${D}${PTEST_PATH}/test
ln -s ${bindir}/gawk ${D}${PTEST_PATH}/gawk
# The list of tests is all targets in Maketests, apart from the dummy Gt-dummy
TESTS=$(awk -F: '$1 == "Gt-dummy" { next } /[[:alnum:]]+:$/ { print $1 }' ${S}/test/Maketests)
for i in $TESTS Maketests inclib.awk; do
cp ${S}/test/$i* ${D}${PTEST_PATH}/test
done
sed -i \
-e 's|#! /bin/gawk|#! ${bindir}/gawk|g' \
-e 's|#! /usr/local/bin/gawk|#! ${bindir}/gawk|g' \
-e 's|#!${base_bindir}/awk|#!${bindir}/awk|g' ${D}${PTEST_PATH}/test/*.awk
sed -i -e "s|GAWKLOCALE|LANG|g" ${D}${PTEST_PATH}/test/Maketests
# These tests require an unloaded host as otherwise timing sensitive tests can fail
# https://bugzilla.yoctoproject.org/show_bug.cgi?id=14371
rm -f ${D}${PTEST_PATH}/test/time.*
rm -f ${D}${PTEST_PATH}/test/timeout.*
for t in time timeout; do
echo $t >> ${D}${PTEST_PATH}/test/skipped.txt
done
}
do_install_ptest:append:libc-musl() {
# Reported https://lists.gnu.org/archive/html/bug-gawk/2021-02/msg00005.html
rm -f ${D}${PTEST_PATH}/test/clos1way6.*
# Needs en_US.UTF-8 but then does not work with musl
rm -f ${D}${PTEST_PATH}/test/backsmalls1.*
# Needs en_US.UTF-8 but then does not work with musl
rm -f ${D}${PTEST_PATH}/test/commas.*
# The below two need LANG=C inside the make rule for musl
rm -f ${D}${PTEST_PATH}/test/rebt8b1.*
rm -f ${D}${PTEST_PATH}/test/regx8bit.*
for t in clos1way6 backsmalls1 commas rebt8b1 regx8bit; do
echo $t >> ${D}${PTEST_PATH}/test/skipped.txt
done
}
RDEPENDS:${PN}-ptest += "make locale-base-en-us coreutils"
RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-en-us.iso-8859-1"
RDEPENDS:${PN}-ptest:append:libc-musl = " musl-locales"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,29 @@
From 095bb1db8b2e68cac40e985f347a7039573e1e80 Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Thu, 29 Mar 2018 16:02:05 +0800
Subject: [PATCH] avoid host contamination
Remove hardcode path refer to host to avoid host contamination.
Upstream-Status: Pending
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Rebase to 9.23
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
devices/devs.mak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/devices/devs.mak b/devices/devs.mak
index a5dbc7a..27b55f2 100644
--- a/devices/devs.mak
+++ b/devices/devs.mak
@@ -403,7 +403,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 --------------- ######

View File

@@ -0,0 +1,30 @@
From c481b055cd464734a3c2d80719ead4c1c92a40c9 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 02/10] 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 59d5999..7766b08 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.8.3.1

View File

@@ -0,0 +1,75 @@
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 = "AGPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f98ffa763e50cded76f49bce73aade16"
DEPENDS = "tiff jpeg fontconfig cups libpng freetype zlib"
UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"
UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
def gs_verdir(v):
return "".join(v.split("."))
SRC_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${@gs_verdir("${PV}")}/${BPN}-${PV}.tar.gz \
file://ghostscript-9.16-Werror-return-type.patch \
file://avoid-host-contamination.patch \
"
SRC_URI[sha256sum] = "121861b6d29b2461dec6575c9f3cab665b810bd408d4ec02c86719fa708b0a49"
PACKAGECONFIG ??= ""
PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+3"
PACKAGECONFIG[libidn] = "--with-libidn,--without-libidn,libidn"
PACKAGECONFIG[libpaper] = "--with-libpaper,--without-libpaper,libpaper"
PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \
--without-x, virtual/libx11 libxext libxt"
EXTRA_OECONF = "--with-jbig2dec \
--with-fontpath=${datadir}/fonts \
CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \
PKGCONFIG=pkg-config \
"
EXTRA_OECONF:append:mipsarcho32 = " --with-large_color_index=0"
EXTRA_OECONF:append:armv7a = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
EXTRA_OECONF:append:armv7ve = "${@bb.utils.contains('TUNE_FEATURES','neon','',' --disable-neon',d)}"
# Uses autoconf but not automake, can't do out-of-tree
inherit autotools-brokensep pkgconfig
# Prune the source tree of libraries that we're using our packaging of, so that
# ghostscript can't link to them. Can't prune zlib as that's needed for the
# native tools.
prune_sources() {
rm -rf ${S}/jpeg/ ${S}/libpng/ ${S}/tiff/ ${S}/expat/ ${S}/freetype/ ${S}/cups/lib
}
do_unpack[postfuncs] += "prune_sources"
do_install:append () {
oe_runmake DESTDIR=${D} install-so
oe_runmake DESTDIR=${D} install-data
cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
}
# ghostscript does not supports "arc"
COMPATIBLE_HOST = "^(?!arc).*"
# some entries in NVD uses gpl_ghostscript
CVE_PRODUCT = "ghostscript gpl_ghostscript"
CVE_STATUS[CVE-2023-38560] = "not-applicable-config: PCL isn't part of the Ghostscript release"
CVE_STATUS[CVE-2023-38559] = "cpe-incorrect: Issue only appears in versions before 10.02.0"

View File

@@ -0,0 +1,22 @@
SUMMARY = "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.googlesource.com/example;branch=master;protocol=https"
SRCREV = "d9923f6970e9ba7e0d23aa9448ead71ea57235ae"
UPSTREAM_CHECK_COMMITS = "1"
GO_IMPORT = "golang.org/x/example"
GO_INSTALL = "${GO_IMPORT}/hello"
export GO111MODULE="off"
inherit go
# This is just to make clear where this example is
do_install:append() {
mv ${D}${bindir}/hello ${D}${bindir}/${BPN}
}

View File

@@ -0,0 +1,29 @@
From 6194f0027045433598a61965758b4531a3d06d1f Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sun, 30 Aug 2020 12:36:15 +0200
Subject: [PATCH] Make the code C++17 compliant.
* lib/getline.cc (getstr): Don't use the 'register' keyword.
Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=gperf.git;a=commit;h=a63b830554920476881837eeacd4a6b507632b19]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/getline.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/getline.cc b/lib/getline.cc
index c57c633..0984a7c 100644
--- a/lib/getline.cc
+++ b/lib/getline.cc
@@ -55,7 +55,7 @@ getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset)
for (;;)
{
- register int c = getc (stream);
+ int c = getc (stream);
/* We always want at least one char left in the buffer, since we
always (unless we get an error while reading the first char)
--
2.39.0

View File

@@ -0,0 +1,181 @@
From 1862c6e57a308a05889c80c048dbc58bdc378dcb Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Tue, 5 Jul 2022 07:51:46 +0200
Subject: [PATCH] Add support for reproducible builds.
Suggested by Richard Purdie <richard.purdie@linuxfoundation.org> in
<https://lists.gnu.org/archive/html/bug-gperf/2022-07/msg00000.html>.
* autogen.sh: Import also lib/filename.h.
* Makefile.in (IMPORTED_FILES): Add lib/filename.h.
* src/options.cc: Include filename.h.
(Options::print_options): Print only the base name of the program name.
* tests/*.exp: Update.
Upstream-Status: Backport
Index: gperf-3.1/ChangeLog
===================================================================
--- gperf-3.1.orig/ChangeLog
+++ gperf-3.1/ChangeLog
@@ -1,3 +1,14 @@
+2022-07-05 Bruno Haible <bruno@clisp.org>
+
+ Add support for reproducible builds.
+ Suggested by Richard Purdie <richard.purdie@linuxfoundation.org> in
+ <https://lists.gnu.org/archive/html/bug-gperf/2022-07/msg00000.html>.
+ * autogen.sh: Import also lib/filename.h.
+ * Makefile.in (IMPORTED_FILES): Add lib/filename.h.
+ * src/options.cc: Include filename.h.
+ (Options::print_options): Print only the base name of the program name.
+ * tests/*.exp: Update.
+
2017-01-02 Marcel Schaible <marcel.schaible@studium.fernuni-hagen.de>
* gperf-3.1 released.
Index: gperf-3.1/src/options.cc
===================================================================
--- gperf-3.1.orig/src/options.cc
+++ gperf-3.1/src/options.cc
@@ -26,6 +26,7 @@
#include <string.h> /* declares strcmp() */
#include <ctype.h> /* declares isdigit() */
#include <limits.h> /* defines CHAR_MAX */
+#include "filename.h"
#include "getopt.h"
#include "version.h"
@@ -280,6 +281,16 @@ Options::print_options () const
{
const char *arg = _argument_vector[i];
+ if (i == 0)
+ {
+ /* _argument_vector[0] is the program name. Print only its base name.
+ This is useful for reproducible builds. */
+ const char *p = arg + strlen (arg);
+ while (p > arg && ! ISSLASH (p[-1]))
+ p--;
+ arg = p;
+ }
+
/* Escape arg if it contains shell metacharacters. */
if (*arg == '-')
{
Index: gperf-3.1/lib/filename.h
===================================================================
--- /dev/null
+++ gperf-3.1/lib/filename.h
@@ -0,0 +1,112 @@
+/* Basic filename support macros.
+ Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it 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.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* From Paul Eggert and Jim Meyering. */
+
+#ifndef _FILENAME_H
+#define _FILENAME_H
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Filename support.
+ ISSLASH(C) tests whether C is a directory separator
+ character.
+ HAS_DEVICE(Filename) tests whether Filename contains a device
+ specification.
+ FILE_SYSTEM_PREFIX_LEN(Filename) length of the device specification
+ at the beginning of Filename,
+ index of the part consisting of
+ alternating components and slashes.
+ FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ 1 when a non-empty device specification
+ can be followed by an empty or relative
+ part,
+ 0 when a non-empty device specification
+ must be followed by a slash,
+ 0 when device specification don't exist.
+ IS_ABSOLUTE_FILE_NAME(Filename)
+ tests whether Filename is independent of
+ any notion of "current directory".
+ IS_RELATIVE_FILE_NAME(Filename)
+ tests whether Filename may be concatenated
+ to a directory filename.
+ Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a
+ relative file name!
+ IS_FILE_NAME_WITH_DIR(Filename) tests whether Filename contains a device
+ or directory specification.
+ */
+#if defined _WIN32 || defined __CYGWIN__ \
+ || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__
+ /* Native Windows, Cygwin, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+ /* Internal macro: Tests whether a character is a drive letter. */
+# define _IS_DRIVE_LETTER(C) \
+ (((C) >= 'A' && (C) <= 'Z') || ((C) >= 'a' && (C) <= 'z'))
+ /* Help the compiler optimizing it. This assumes ASCII. */
+# undef _IS_DRIVE_LETTER
+# define _IS_DRIVE_LETTER(C) \
+ (((unsigned int) (C) | ('a' - 'A')) - 'a' <= 'z' - 'a')
+# define HAS_DEVICE(Filename) \
+ (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':')
+# define FILE_SYSTEM_PREFIX_LEN(Filename) (HAS_DEVICE (Filename) ? 2 : 0)
+# ifdef __CYGWIN__
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# else
+ /* On native Windows, OS/2, DOS, the system has the notion of a
+ "current directory" on each drive. */
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
+# endif
+# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+# define IS_ABSOLUTE_FILE_NAME(Filename) \
+ ISSLASH ((Filename)[FILE_SYSTEM_PREFIX_LEN (Filename)])
+# else
+# define IS_ABSOLUTE_FILE_NAME(Filename) \
+ (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename))
+# endif
+# define IS_RELATIVE_FILE_NAME(Filename) \
+ (! (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename)))
+# define IS_FILE_NAME_WITH_DIR(Filename) \
+ (strchr ((Filename), '/') != NULL || strchr ((Filename), '\\') != NULL \
+ || HAS_DEVICE (Filename))
+#else
+ /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define HAS_DEVICE(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_PREFIX_LEN(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# define IS_ABSOLUTE_FILE_NAME(Filename) ISSLASH ((Filename)[0])
+# define IS_RELATIVE_FILE_NAME(Filename) (! ISSLASH ((Filename)[0]))
+# define IS_FILE_NAME_WITH_DIR(Filename) (strchr ((Filename), '/') != NULL)
+#endif
+
+/* Deprecated macros. For backward compatibility with old users of the
+ 'filename' module. */
+#define IS_ABSOLUTE_PATH IS_ABSOLUTE_FILE_NAME
+#define IS_PATH_WITH_DIR IS_FILE_NAME_WITH_DIR
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FILENAME_H */

View File

@@ -0,0 +1,21 @@
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 = "GPL-3.0-or-later"
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 \
file://0001-Make-the-code-C-17-compliant.patch"
SRC_URI[md5sum] = "9e251c0a618ad0824b51117d5d9db87e"
SRC_URI[sha256sum] = "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2"
SRC_URI += "file://1862c6e57a308a05889c80c048dbc58bdc378dcb.patch"
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 nativesdk"

View File

@@ -0,0 +1,46 @@
SUMMARY = "GNU grep utility"
HOMEPAGE = "http://savannah.gnu.org/projects/grep/"
DESCRIPTION = "Grep searches one or more input files for lines containing a match to a specified pattern. By default, grep prints the matching lines."
BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep"
SECTION = "console/utils"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464"
SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz"
SRC_URI[sha256sum] = "1db2aedde89d0dea42b16d9528f894c8d15dae4e190b59aecc78f5a951276eab"
inherit autotools gettext texinfo pkgconfig
# Fix "Argument list too long" error when len(TMPDIR) = 410
acpaths = "-I ./m4"
do_configure:prepend () {
sed -i -e '1s,#!@SHELL@,#!/bin/sh,' ${S}/src/egrep.sh
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,libpcre2"
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"
BBCLASSEXTEND = "nativesdk"

View File

@@ -0,0 +1,25 @@
From aa1f37f1e0ff0dc0eeb199b52959e0deb275721e Mon Sep 17 00:00:00 2001
From: Jeremy Puhlman <jpuhlman@mvista.com>
Date: Sat, 7 Mar 2020 00:59:13 +0000
Subject: [PATCH] Make manpages mulitlib identical
Upstream-Status: Submitted [by email to g.branden.robinson@gmail.com]
Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index f7ab410..7e1f3fb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -891,7 +891,7 @@ SUFFIXES += .man
-e "s|[@]PAGE[@]|\\\\%$(PAGE)|g" \
-e "s|[@]PDFDOCDIR[@]|`echo $(pdfdocdir) | sed -f $(makevarescape)`|g" \
-e "s|[@]PSPRINT[@]|`echo $(PSPRINT) | sed -f $(makevarescape)`|g" \
- -e "s|[@]SYSTEMMACRODIR[@]|`echo $(systemtmacdir) | sed -f $(makevarescape)`|g" \
+ -e "s|[@]SYSTEMMACRODIR[@]|`echo $(systemtmacdir) | sed -e 's,$(libdir),$(prefix)/lib*,' | sed -f $(makevarescape)`|g" \
-e "s|[@]TMAC_AN_PREFIX[@]|\\\\%$(tmac_an_prefix)|g" \
-e "s|[@]TMAC_M_PREFIX[@]|\\\\%$(tmac_m_prefix)|g" \
-e "s|[@]TMAC_MDIR[@]|`echo $(tmacdir) | sed -f $(makevarescape)`/mm|g" \

View File

@@ -0,0 +1,51 @@
From c75965053124149381ada3c394da74be078076cf Mon Sep 17 00:00:00 2001
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Date: Sat, 16 Sep 2023 16:28:00 -0500
Subject: [PATCH] [build]: Fix Savannah #64681 (webpage.ps deps).
* doc/doc.am (doc/webpage.ps, doc/webpage.html): Update and parallelize
target dependencies. Resolve race by requiring "grn" and "soelim" to
be built first. Also add dependency on `$(TMAC_PACKAGE_MS)`.
Fixes <https://savannah.gnu.org/bugs/?64681>. Thanks to Alexander
Kanavin for the report.
ANNOUNCE: Acknowledge Alexander.
Upstream-Status: Backport
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
doc/doc.am | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/doc/doc.am b/doc/doc.am
index cddc51907..d3c9ab6b7 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -346,6 +346,9 @@ doc/pic.ps: $(doc_srcdir)/pic.ms eqn pic tbl
$(GROFF_V)$(MKDIR_P) `dirname $@` \
&& $(DOC_GROFF) -pet -Tps -ms $(doc_srcdir)/pic.ms >$@
+# groff(1)'s `-I` implies `-g` and `-s`, so we must depend on grn and
+# soelim even though the document doesn't require them.
+doc/webpage.ps: grn soelim
doc/webpage.ps: $(DOC_GNU_EPS) tmac/www.tmac tbl
doc/webpage.ps: $(doc_srcdir)/webpage.ms
$(GROFF_V)$(MKDIR_P) `dirname $@` \
@@ -365,11 +368,12 @@ doc/pic.html: $(doc_srcdir)/pic.ms
&& $(DOC_GROFF) -pet -P-Ipic -P-Dimg -P-jpic -Thtml -ms \
$(doc_srcdir)/pic.ms > pic.html
-doc/webpage.html: tbl
-doc/webpage.html: tmac/www.tmac
-doc/webpage.html: $(DOC_GNU_EPS)
+# groff(1)'s `-I` implies `-g` and `-s`, so we must depend on grn and
+# soelim even though the document doesn't require them.
+doc/webpage.html: grn soelim
+doc/webpage.html: $(DOC_GNU_EPS) tmac/www.tmac tbl
doc/webpage.html: $(doc_srcdir)/groff.css
-doc/webpage.html: $(doc_srcdir)/webpage.ms
+doc/webpage.html: $(doc_srcdir)/webpage.ms $(TMAC_PACKAGE_MS)
$(GROFF_V)$(MKDIR_P) $(doc_builddir) \
&& cd $(doc_builddir) \
&& $(DOC_GROFF) -t -I $(doc_srcdir) -P-jwebpage -P-nrb \

View File

@@ -0,0 +1,31 @@
From f21e9f13beb57a1e0666edf9693d7c83f2189897 Mon Sep 17 00:00:00 2001
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Date: Fri, 22 Sep 2023 01:27:57 -0500
Subject: [PATCH] [build]: meintro_fr.ps depends on tbl.
* doc/doc.am (doc/meintro_fr.ps): Depend on tbl, resolving race in
sufficiently parallelized builds. Overlooked in commit 92349ae223,
2022-05-30.
Fixes <https://savannah.gnu.org/bugs/?64695>. Thanks to Alexander
Kanavin for the report.
Upstream-Status: Backport
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
doc/doc.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/doc.am b/doc/doc.am
index d3c9ab6b7..0f95c7774 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -334,7 +334,7 @@ SUFFIXES += .me.in .me
# Use '-K utf8', not '-k', in case 'configure' didn't find uchardet.
# The French translation uses tbl; its English counterpart does not.
-doc/meintro_fr.ps: doc/meintro_fr.me preconv
+doc/meintro_fr.ps: doc/meintro_fr.me preconv tbl
$(GROFF_V)$(MKDIR_P) `dirname $@` \
&& $(DOC_GROFF) -K utf8 -t -Tps -me -mfr $< >$@

View File

@@ -0,0 +1,31 @@
From 771686c042d5f494550d0399f36e00b1ca557b2d Mon Sep 17 00:00:00 2001
From: Robert Yang <liezhi.yang@windriver.com>
Date: Mon, 11 Nov 2024 14:12:51 +0000
Subject: [PATCH] contrib/hdtbl/hdtbl.am: Fix race issues for parallel build
Fixed race issues for parallel build:
groff: error: couldn't exec soelim: Permission
And:
groff: error: couldn't exec grn: Permission denied
Upstream-Status: Submitted [https://lists.gnu.org/archive/html/groff/2024-11/msg00097.html]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
contrib/hdtbl/hdtbl.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/hdtbl/hdtbl.am b/contrib/hdtbl/hdtbl.am
index 9384fac..70f7bc9 100644
--- a/contrib/hdtbl/hdtbl.am
+++ b/contrib/hdtbl/hdtbl.am
@@ -119,7 +119,7 @@ SUFFIXES += .roff .in .ps
-e "s|[@]EGREP[@]|$(EGREP)|" $< >$@
$(HDTBLPROCESSEDEXAMPLEFILES): $(DOC_GNU_EPS) groff troff eqn pic tbl \
- grops grn font/devps/stamp contrib/hdtbl/examples/common.roff
+ grops grn soelim font/devps/stamp contrib/hdtbl/examples/common.roff
uninstall_groffdirs: uninstall-hdtbl-hook
uninstall-hdtbl-hook:

View File

@@ -0,0 +1,38 @@
From 12169aa269341753d491a69e9adb86c58dca039a Mon Sep 17 00:00:00 2001
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Date: Thu, 10 Oct 2024 18:17:08 -0500
Subject: [PATCH] [hdtbl]: Fix Savannah #66316 (missing `grn` dep).
* hdtbl.am (HDTBLPROCESSEDEXAMPLEFILES): Declare dependency on `grn`;
because `-I` flags are used, it is dragged in even though not
explicitly needed. Resolves race against `grn`'s availability in the
build tree.
Fixes <https://savannah.gnu.org/bugs/?66316>. Thanks to Ross Burton for
the report.
Upstream-Status: Backport
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
contrib/hdtbl/ChangeLog | 10 ++++++++++
contrib/hdtbl/hdtbl.am | 3 +--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/contrib/hdtbl/hdtbl.am b/contrib/hdtbl/hdtbl.am
index b6c334c18..3c37174f2 100644
--- a/contrib/hdtbl/hdtbl.am
+++ b/contrib/hdtbl/hdtbl.am
@@ -119,9 +119,8 @@ SUFFIXES += .roff .in .ps
&& sed -e "s|[@]fontdir[@]|$(fontdir)|" \
-e "s|[@]EGREP[@]|$(EGREP)|" $< >$@
-
$(HDTBLPROCESSEDEXAMPLEFILES): $(DOC_GNU_EPS) groff troff eqn pic tbl \
- grops font/devps/stamp contrib/hdtbl/examples/common.roff
+ grops grn font/devps/stamp contrib/hdtbl/examples/common.roff
uninstall_groffdirs: uninstall-hdtbl-hook
uninstall-hdtbl-hook:
--
2.34.1

View File

@@ -0,0 +1,39 @@
From eb16276c3e2e34aa2e57f6a0e68554657b90cd28 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Sat, 11 May 2019 17:06:29 +0800
Subject: [PATCH] groff searchs fonts which are provided by ghostscript on
build host. It causes non-determinism issue. So not search font dirs on host.
Upstream-Status: Inappropriate [cross build specific]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Rebase to 1.22.4
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
font/devpdf/Foundry.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/font/devpdf/Foundry.in b/font/devpdf/Foundry.in
index e5aba65..5441734 100644
--- a/font/devpdf/Foundry.in
+++ b/font/devpdf/Foundry.in
@@ -20,7 +20,7 @@
#=======================================================================
#Foundry|Name|Search path
-foundry||@urwfontsdir@:(gs):/usr/share/fonts/type1/gsfonts:/usr/share/fonts/default/Type1:/usr/share/fonts/default/Type1/adobestd35:/usr/share/fonts/type1/urw-base35:/opt/local/share/fonts/urw-fonts:/usr/local/share/fonts/ghostscript
+foundry||(gs)
# Enable the font description files for grops (generated from Adobe
# foundry font files) to be used with gropdf. afmtodit must not be
@@ -72,7 +72,7 @@ EURO|N||||*../devps/freeeuro.pfa
# URW fonts are typically shipped with Ghostscript, but can be replaced.
#Foundry|Name|Search path
-foundry|U|@urwfontsdir@:/usr/share/fonts/type1/gsfonts:/usr/share/fonts/default/Type1:/usr/share/fonts/default/Type1/adobestd35:/usr/share/fonts/type1/urw-base35:/opt/local/share/fonts/urw-fonts:/usr/local/share/fonts/ghostscript:(gs)
+foundry|U|(gs)
# Define flags for afmtodit.

View File

@@ -0,0 +1,80 @@
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 = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \
file://groff-not-search-fonts-on-build-host.patch \
file://0001-Make-manpages-mulitlib-identical.patch \
file://0001-build-Fix-Savannah-64681-webpage.ps-deps.patch \
file://0001-build-meintro_fr.ps-depends-on-tbl.patch \
file://0001-hdtbl-Fix-Savannah-66316-missing-grn-dep.patch \
file://0001-contrib-hdtbl-hdtbl.am-Fix-race-issues-for-parallel-.patch \
"
SRC_URI[sha256sum] = "6b9757f592b7518b4902eb6af7e54570bdccba37a871fddb2d30ae3863511c13"
DEPENDS = "bison-native groff-native"
RDEPENDS:${PN} += "perl sed"
inherit autotools-brokensep texinfo multilib_script pkgconfig
MULTILIB_SCRIPTS = "${PN}:${bindir}/gpinyin ${PN}:${bindir}/grog"
EXTRA_OECONF = "--without-x --with-urw-fonts-dir=/completely/bogus/dir/"
EXTRA_OEMAKE:class-target = "GROFFBIN=groff GROFF_BIN_PATH=${STAGING_BINDIR_NATIVE}"
CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl' ac_cv_path_BASH_PROG='no' PAGE=A4"
# Delete these generated files since we depend on bison-native
# and regenerate them. Do it deterministically (always).
do_configure:prepend() {
rm -f ${S}/src/preproc/eqn/eqn.cpp
rm -f ${S}/src/preproc/eqn/eqn.hpp
}
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*
# not ship /usr/bin/grap2graph and its releated man files
rm -rf ${D}${bindir}/grap2graph
rm -rf ${D}${mandir}/man1/grap2graph*
# strip hosttool path out of generated files
sed -i -e 's:${HOSTTOOLS_DIR}/::g' ${D}${docdir}/${BP}/examples/hdtbl/*.roff
}
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"

View File

@@ -0,0 +1,6 @@
#!/bin/sh
cd src/tests
make check

View File

@@ -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 4f51b61..80a5ddf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -93,8 +93,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|'gzip'|$(GZIP_TRANSFORMED)|g" \
-e "s|'zdiff'|$(ZDIFF_TRANSFORMED)|g" \
-e "s|'zgrep'|$(ZGREP_TRANSFORMED)|g" \
--
2.7.4

View File

@@ -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"
inherit autotools texinfo
export DEFS="NO_ASM"
EXTRA_OEMAKE:class-target = "GREP=${base_bindir}/grep"
EXTRA_OEMAKE:append:class-nativesdk = " GREP=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"

View File

@@ -0,0 +1,41 @@
require gzip.inc
# change to GPL-3.0-or-later in 2007/07. Previous GPL-2.0-or-later version is
# 1.3.12
LICENSE = "GPL-3.0-or-later"
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=1ebbd3e34237af26da5dc08a4e440464 \
file://gzip.h;beginline=8;endline=20;md5=6e47caaa630e0c8bf9f1bc8d94a8ed0e"
PROVIDES:append:class-native = " gzip-replacement-native"
RDEPENDS:${PN}-ptest += "make perl grep diffutils"
BBCLASSEXTEND = "native nativesdk"
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[sha256sum] = "20fc818aeebae87cdbf209d35141ad9d3cf312b35a5e6be61bfcfbf9eddd212a"

View File

@@ -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

View File

@@ -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-2-Clause & GPL-2.0-only & hdparm"
LICENSE:${PN} = "BSD-2-Clause & hdparm"
LICENSE:${PN}-dbg = "BSD-2-Clause & hdparm"
LICENSE:wiper = "GPL-2.0-only"
NO_GENERIC_LICENSE[hdparm] = "LICENSE.TXT"
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[sha256sum] = "d14929f910d060932e717e9382425d47c2e7144235a53713d55a94f7de535a4b"
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}
}

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