initial buildroot for linux 5.15

This commit is contained in:
Huan.Feng
2021-12-06 14:12:13 +08:00
parent d7767d594e
commit 7b6fc358fa
12736 changed files with 508822 additions and 0 deletions
@@ -0,0 +1,23 @@
buildconfig is meant to be executed on the host, so it has to be compiled
using $(HOSTCC), not $(CC).
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
OS/Makefile-Base | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/OS/Makefile-Base b/OS/Makefile-Base
index 29a6ad3..420ba60 100644
--- a/OS/Makefile-Base
+++ b/OS/Makefile-Base
@@ -114,8 +114,8 @@ allexim: config.h $(EXIM_MONITOR) exicyclog exinext exiwhat \
# Targets for special-purpose configuration header builders
buildconfig: buildconfig.c
- @echo "$(CC) buildconfig.c"
- $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
+ @echo "$(HOSTCC) buildconfig.c"
+ $(FE)$(HOSTCC) $(HOSTCFLAGS) $(INCLUDE) -o buildconfig buildconfig.c
# Target for the exicyclog utility script
@@ -0,0 +1,40 @@
If exim had already been installed, the install script makes backup
copies of the pre-existing executables with a ".0" suffix.
This leads to useless duplicated files on the target, so disable this
piece of code.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
scripts/exim_install | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/scripts/exim_install b/scripts/exim_install
index 616ab3c..e68e7d5 100755
--- a/scripts/exim_install
+++ b/scripts/exim_install
@@ -344,15 +344,15 @@ while [ $# -gt 0 ]; do
else
if ../scripts/newer ${name} ${BIN_DIRECTORY}/${name}; then
- if [ -f ${BIN_DIRECTORY}/${name} ]; then
- echo ${CP} ${BIN_DIRECTORY}/${name} ${BIN_DIRECTORY}/${name}.O
- ${real} ${CP} ${BIN_DIRECTORY}/${name} ${BIN_DIRECTORY}/${name}.O
- if [ $? -ne 0 ]; then
- echo $com ""
- echo $com "*** Exim installation ${ver}failed ***"
- exit 1
- fi
- fi
+# if [ -f ${BIN_DIRECTORY}/${name} ]; then
+# echo ${CP} ${BIN_DIRECTORY}/${name} ${BIN_DIRECTORY}/${name}.O
+# ${real} ${CP} ${BIN_DIRECTORY}/${name} ${BIN_DIRECTORY}/${name}.O
+# if [ $? -ne 0 ]; then
+# echo $com ""
+# echo $com "*** Exim installation ${ver}failed ***"
+# exit 1
+# fi
+# fi
echo ${CP} ${name} ${BIN_DIRECTORY}
${real} ${CP} ${name} ${BIN_DIRECTORY}
if [ $? -ne 0 ]; then
@@ -0,0 +1,41 @@
The exim install script installs a binary named exim-<version>, plus a symlink
to it named exim.
In order to achieve this "feature" (of dubious usefulness) it runs the
executable (on the host) and then filters its output to grab the version number.
This clearly cannot work if the executable is cross-compiled, so get rid of all
of it and just install an executable file called exim.
Inspired by:
http://patch-tracker.debian.org/patch/series/view/exim4/4.76-2/35_install.dpatch
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
(rebased against exim 4.89)
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
scripts/exim_install | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/exim_install b/scripts/exim_install
index e68e7d5..487a4e1 100755
--- a/scripts/exim_install
+++ b/scripts/exim_install
@@ -58,6 +58,8 @@
shift
done
+do_symlink=no
+
# Get the values of BIN_DIRECTORY, CONFIGURE_FILE, INFO_DIRECTORY, NO_SYMLINK,
# SYSTEM_ALIASES_FILE, and EXE from the global Makefile (in the build
# directory). EXE is empty except in the Cygwin environment. In each case, keep
@@ -217,9 +219,7 @@
# The exim binary is handled specially
if [ $name = exim${EXE} ]; then
- exim="./exim -bV -C /dev/null"
- version=exim-`$exim 2>/dev/null | \
- awk '/Exim version/ { OFS=""; print $3,"-",substr($4,2,length($4)-1) }'`${EXE}
+ version=exim
if [ "${version}" = "exim-${EXE}" ]; then
echo $com ""
+35
View File
@@ -0,0 +1,35 @@
From 68ea4fc7ca53bf010e5ec738ad078452f0eaa639 Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd.kuhls@t-online.de>
Date: Tue, 23 Jul 2019 18:48:06 +0200
Subject: [PATCH] Fix uClibc build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
structs.h:757:18: error: NS_MAXMSG undeclared here (not in a function); did you mean N_MASC?
uschar answer[NS_MAXMSG]; /* the answer itself */
Patch sent upstream: https://github.com/Exim/exim/pull/70
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
OS/os.h-Linux | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/OS/os.h-Linux b/OS/os.h-Linux
index 63cf9babd..1d82e9bad 100644
--- a/OS/os.h-Linux
+++ b/OS/os.h-Linux
@@ -87,5 +87,9 @@ then change the 0 to 1 in the next block. */
# define TCPI_OPT_SYN_DATA 32
#endif
+/* Needed for uClibc */
+#ifndef NS_MAXMSG
+# define NS_MAXMSG 65535
+#endif
/* End */
--
2.20.1
@@ -0,0 +1,51 @@
From bbcf4320134efd8a01ce5a02bb9af62019ca05f6 Mon Sep 17 00:00:00 2001
From: Luca Ceresoli <luca@lucaceresoli.net>
Date: Tue, 4 Feb 2020 15:57:48 +0100
Subject: [PATCH] exim_lock: fix lstat-related build errors
exim_lock fails to cross-compile with the Sourcery CodeBench ARM 2014.05
toolchain due the a missing include of sys/types.h, needed for the
constants used by fstat() and lstat().
Discovered when cross-compiling with the Buildroot embedded Linux
buildsystem.
Fixes:
exim_lock.c:427:30: error: 'S_IFMT' undeclared (first use in this function)
if ((statbuf.st_mode & S_IFMT) == S_IFLNK)
^
exim_lock.c:427:30: note: each undeclared identifier is reported only once for each function it appears in
exim_lock.c:427:41: error: 'S_IFLNK' undeclared (first use in this function)
if ((statbuf.st_mode & S_IFMT) == S_IFLNK)
^
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Upstream-status: https://bugs.exim.org/show_bug.cgi?id=2523
---
src/exim_lock.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/exim_lock.c b/src/exim_lock.c
index 068216816054..cb140aff6436 100644
--- a/src/exim_lock.c
+++ b/src/exim_lock.c
@@ -13,6 +13,8 @@ Argument: the name of the lock file
Copyright (c) The Exim Maintainers 2016
*/
+#define _XOPEN_SOURCE
+
#include "os.h"
#include <stdio.h>
@@ -26,6 +28,7 @@ Copyright (c) The Exim Maintainers 2016
#include <unistd.h>
#include <utime.h>
#include <sys/utsname.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>
#include <pwd.h>
--
2.25.0
@@ -0,0 +1,42 @@
From e9d0b5b022df172d3615e9e2875506c74e6d7cd1 Mon Sep 17 00:00:00 2001
From: Luca Ceresoli <luca@lucaceresoli.net>
Date: Wed, 5 Feb 2020 17:13:57 +0100
Subject: [PATCH] sieve: fix build errors
sieve fails to cross-compile with the Sourcery CodeBench ARM 2014.05
toolchain with a huge number of errors, including:
.../sysroot/usr/include/arpa/nameser.h:115:2: error: unknown type name 'u_char'
const u_char *_msg, *_eom;
^
.../sysroot/usr/include/arpa/nameser.h:474:1: error: unknown type name 'u_long'
u_long ns_get32 (const u_char *) __THROW;
^
.../sysroot/usr/include/arpa/nameser.h:475:31: error: expected ')' before '*' token
void ns_put16 (u_int, u_char *) __THROW;
^
Discovered when cross-compiling with the Buildroot embedded Linux
buildsystem.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Upstream-status: https://bugs.exim.org/show_bug.cgi?id=2523
---
src/sieve.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/sieve.c b/src/sieve.c
index 5e8d1e6f4776..9632f2d43810 100644
--- a/src/sieve.c
+++ b/src/sieve.c
@@ -12,6 +12,8 @@
/* Sieve mail filter. */
+#define _BSD_SOURCE
+
#include <ctype.h>
#include <errno.h>
#include <limits.h>
--
2.25.0
+36
View File
@@ -0,0 +1,36 @@
comment "exim needs a toolchain w/ threads"
depends on !BR2_TOOLCHAIN_HAS_THREADS
config BR2_PACKAGE_EXIM
bool "exim"
depends on BR2_USE_MMU # fork()
depends on BR2_TOOLCHAIN_HAS_THREADS
select BR2_PACKAGE_PCRE
select BR2_PACKAGE_BERKELEYDB
help
Exim is a message transfer agent (MTA) developed at the
University of Cambridge for use on Unix systems connected to
the Internet.
http://www.exim.org/
if BR2_PACKAGE_EXIM
config BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE
string "Custom configuration file"
help
By default, when this option is left empty, Buildroot
generates a configuration file for exim with reasonable
settings.
If you want to override the configuration file generated by
Buildroot with a customized file, set here the path to your
configuration file with this option.
This file shall comply with the syntax defined in the exim
documentation (http://www.exim.org/docs.html).
Buildroot will generate a configuration file composed of the
content of the file you provide plus the toolchain-related
settings needed for cross-compilation.
endif
+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
#
# Start/stop exim
#
PIDFILE=/var/run/exim/exim.pid
case "$1" in
start)
echo "Starting exim..."
if [ ! -d /var/log/exim ]; then
mkdir -p /var/log/exim
chown exim:mail /var/log/exim
fi
if [ ! -d /var/run/exim ]; then
mkdir -p /var/run/exim
chown root:mail /var/run/exim
fi
start-stop-daemon -S -x exim -- -bd
;;
stop)
printf "Stopping exim..."
start-stop-daemon -K -o -p $PIDFILE
;;
restart|reload)
"$0" stop
"$0" start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?
+6
View File
@@ -0,0 +1,6 @@
# From https://ftp.exim.org/pub/exim/exim4/00-sha256sums.txt
sha256 cc9cb653fff2ea947c3702680b59c99ac0bd1bbf19976d37e22a463cd804f167 exim-4.95.tar.xz
# From https://ftp.exim.org/pub/exim/exim4/00-sha512sums.txt
sha512 93d09c20d99f27da5edbe3e6dc7d25aa4548faa2b67ca26f2cc0b4aeaf58398dd468e0263714fcf0df97531f05d16fcd3f1f0e9d0656ead7858a66b248a44a65 exim-4.95.tar.xz
# Locally calculated
sha256 49240db527b7e55b312a46fc59794fde5dd006422e422257f4f057bfd27b3c8f LICENCE
+160
View File
@@ -0,0 +1,160 @@
################################################################################
#
# exim
#
################################################################################
EXIM_VERSION = 4.95
EXIM_SOURCE = exim-$(EXIM_VERSION).tar.xz
EXIM_SITE = https://ftp.exim.org/pub/exim/exim4
EXIM_LICENSE = GPL-2.0+
EXIM_LICENSE_FILES = LICENCE
EXIM_CPE_ID_VENDOR = exim
EXIM_SELINUX_MODULES = exim mta
EXIM_DEPENDENCIES = host-berkeleydb host-pcre pcre berkeleydb host-pkgconf
# Modify a variable value. It must already exist in the file, either
# commented or not.
define exim-config-change # variable-name, variable-value
$(SED) 's,^[#[:space:]]*$1[[:space:]]*=.*$$,$1=$2,' \
$(@D)/Local/Makefile
endef
# Comment-out a variable. Has no effect if it does not exits.
define exim-config-unset # variable-name
$(SED) 's,^\([[:space:]]*$1[[:space:]]*=.*$$\),# \1,' \
$(@D)/Local/Makefile
endef
# Add a variable definition. It must not already exist in the file,
# otherwise it would be defined twice with potentially different values.
define exim-config-add # variable-name, variable-value
echo "$1=$2" >>$(@D)/Local/Makefile
endef
define EXIM_USE_CUSTOM_CONFIG_FILE
$(INSTALL) -m 0644 $(BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE) \
$(@D)/Local/Makefile
endef
define EXIM_USE_DEFAULT_CONFIG_FILE
$(INSTALL) -m 0644 $(@D)/src/EDITME $(@D)/Local/Makefile
$(call exim-config-change,BIN_DIRECTORY,/usr/sbin)
$(call exim-config-change,CONFIGURE_FILE,/etc/exim/configure)
$(call exim-config-change,LOG_FILE_PATH,/var/log/exim/exim_%slog)
$(call exim-config-change,PID_FILE_PATH,/var/run/exim/exim.pid)
$(call exim-config-change,EXIM_USER,ref:exim)
$(call exim-config-change,EXIM_GROUP,mail)
$(call exim-config-change,TRANSPORT_LMTP,yes)
$(call exim-config-change,PCRE_LIBS,-lpcre)
$(call exim-config-change,PCRE_CONFIG,no)
$(call exim-config-change,HAVE_ICONV,no)
$(call exim-config-unset,EXIM_MONITOR)
$(call exim-config-change,AUTH_PLAINTEXT,yes)
$(call exim-config-change,AUTH_CRAM_MD5,yes)
$(call exim-config-unset,SUPPORT_DANE)
endef
ifeq ($(BR2_PACKAGE_DOVECOT),y)
EXIM_DEPENDENCIES += dovecot
define EXIM_USE_DEFAULT_CONFIG_FILE_DOVECOT
$(call exim-config-change,AUTH_DOVECOT,yes)
endef
endif
ifeq ($(BR2_PACKAGE_CLAMAV),y)
EXIM_DEPENDENCIES += clamav
define EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV
$(call exim-config-change,WITH_CONTENT_SCAN,yes)
endef
endif
ifeq ($(BR2_PACKAGE_OPENSSL),y)
EXIM_DEPENDENCIES += host-openssl openssl
define EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL
$(call exim-config-change,USE_OPENSSL,yes)
$(call exim-config-change,USE_OPENSSL_PC,openssl)
endef
else
define EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL
$(call exim-config-change,DISABLE_TLS,yes)
endef
endif
# musl does not provide struct ip_options nor struct ip_opts (but it is
# available with both glibc and uClibc)
ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
define EXIM_FIX_IP_OPTIONS_FOR_MUSL
$(SED) 's/#define GLIBC_IP_OPTIONS/#define DARWIN_IP_OPTIONS/' \
$(@D)/OS/os.h-Linux
endef
endif
define EXIM_CONFIGURE_TOOLCHAIN
$(call exim-config-add,CC,$(TARGET_CC))
$(call exim-config-add,CFLAGS,$(TARGET_CFLAGS))
$(call exim-config-add,AR,$(TARGET_AR) cq)
$(call exim-config-add,RANLIB,$(TARGET_RANLIB))
$(call exim-config-add,HOSTCC,$(HOSTCC))
$(call exim-config-add,HOSTCFLAGS,$(HOSTCFLAGS))
$(EXIM_FIX_IP_OPTIONS_FOR_MUSL)
endef
ifneq ($(call qstrip,$(BR2_PACKAGE_EXIM_CUSTOM_CONFIG_FILE)),)
define EXIM_CONFIGURE_CMDS
$(EXIM_USE_CUSTOM_CONFIG_FILE)
$(EXIM_CONFIGURE_TOOLCHAIN)
endef
else # CUSTOM_CONFIG
define EXIM_CONFIGURE_CMDS
$(EXIM_USE_DEFAULT_CONFIG_FILE)
$(EXIM_USE_DEFAULT_CONFIG_FILE_DOVECOT)
$(EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV)
$(EXIM_USE_DEFAULT_CONFIG_FILE_OPENSSL)
$(EXIM_CONFIGURE_TOOLCHAIN)
endef
endif # CUSTOM_CONFIG
# exim needs a bit of love to build statically
ifeq ($(BR2_STATIC_LIBS),y)
EXIM_STATIC_FLAGS = LFLAGS="-pthread --static"
endif
# We need the host version of macro_predef during the build, before
# building it we need to prepare the makefile.
define EXIM_BUILD_CMDS
$(TARGET_MAKE_ENV) build=br $(MAKE) -C $(@D) makefile
$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/build-br macro_predef \
CC="$(HOSTCC)" \
LNCC="$(HOSTCC)" \
CFLAGS="-std=c99 $(HOST_CFLAGS)" \
LFLAGS="-fPIC $(HOST_LDFLAGS)"
$(TARGET_MAKE_ENV) build=br $(MAKE) -C $(@D) $(EXIM_STATIC_FLAGS) \
CFLAGS="-std=c99 $(TARGET_CFLAGS)"
endef
# Need to replicate the LFLAGS in install, as exim still wants to build
# something when installing...
define EXIM_INSTALL_TARGET_CMDS
DESTDIR=$(TARGET_DIR) INSTALL_ARG="-no_chown -no_symlink" build=br \
$(MAKE) -C $(@D) $(EXIM_STATIC_FLAGS) \
CFLAGS="-std=c99 $(TARGET_CFLAGS)" \
install
chmod u+s $(TARGET_DIR)/usr/sbin/exim
endef
define EXIM_USERS
exim 88 mail 8 * - - - exim
endef
define EXIM_INSTALL_INIT_SYSV
$(INSTALL) -D -m 755 package/exim/S86exim \
$(TARGET_DIR)/etc/init.d/S86exim
endef
define EXIM_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/exim/exim.service \
$(TARGET_DIR)/usr/lib/systemd/system/exim.service
endef
$(eval $(generic-package))
+14
View File
@@ -0,0 +1,14 @@
[Unit]
Description=Exim MTA
After=syslog.target network.target
[Service]
User=exim
Group=mail
LogsDirectory=exim
RuntimeDirectory=exim
ExecStart=/usr/sbin/exim -bdf
Restart=always
[Install]
WantedBy=multi-user.target