Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
Fix cross-compilation
Fetched httpd-2.4.x-cross_compile.diff from upstream bugtracker:
https://issues.apache.org/bugzilla/show_bug.cgi?id=51257#c6
which is a bundle of upstream revisions:
http://svn.apache.org/viewvc?view=revision&revision=1327907
http://svn.apache.org/viewvc?view=revision&revision=1328390
http://svn.apache.org/viewvc?view=revision&revision=1328714
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Index: server/Makefile.in
===================================================================
--- a/server/Makefile.in (revision 1328714)
+++ b/server/Makefile.in (working copy)
@@ -22,9 +22,14 @@
include $(top_builddir)/build/rules.mk
include $(top_srcdir)/build/library.mk
+ifdef CC_FOR_BUILD
+gen_test_char: gen_test_char.c
+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DCROSS_COMPILE -o $@ $<
+else
gen_test_char_OBJECTS = gen_test_char.lo
gen_test_char: $(gen_test_char_OBJECTS)
$(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS)
+endif
test_char.h: gen_test_char
./gen_test_char > test_char.h
Index: configure.in
===================================================================
--- a/configure.in (revision 1328714)
+++ b/configure.in (working copy)
@@ -193,6 +193,14 @@
dnl Try to get c99 support for variadic macros
ifdef([AC_PROG_CC_C99], [AC_PROG_CC_C99])
+dnl In case of cross compilation we set CC_FOR_BUILD to cc unless
+dnl we got already CC_FOR_BUILD from environment.
+if test "x${build_alias}" != "x${host_alias}"; then
+ if test "x${CC_FOR_BUILD}" = "x"; then
+ CC_FOR_BUILD=cc
+ fi
+fi
+
if test "x${cache_file}" = "x/dev/null"; then
# Likewise, ensure that CC and CPP are passed through to the pcre
# configure script iff caching is disabled (the autoconf 2.5x default).
Index: acinclude.m4
===================================================================
--- a/acinclude.m4 (revision 1328714)
+++ ab/cinclude.m4 (working copy)
@@ -53,6 +53,8 @@
APACHE_SUBST(CPPFLAGS)
APACHE_SUBST(CFLAGS)
APACHE_SUBST(CXXFLAGS)
+ APACHE_SUBST(CC_FOR_BUILD)
+ APACHE_SUBST(CFLAGS_FOR_BUILD)
APACHE_SUBST(LTFLAGS)
APACHE_SUBST(LDFLAGS)
APACHE_SUBST(LT_LDFLAGS)

View File

@@ -0,0 +1,48 @@
From 00281390e82db18fe0de4033be4045f9391a8ee5 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Thu, 15 Nov 2018 14:04:29 +0100
Subject: [PATCH] server/Makefile.in: handle separate
APR_INCLUDE_DIR/APU_INCLUDE_DIR
If APR_INCLUDEDIR and APU_INCLUDEDIR point to different directories,
but for example APU_INCLUDEDIR contains both the apr headers and apu
headers, the "export_files" file will contain duplicate header files,
causing the exports.c file to contain duplicate definitions, making
the build fail.
This commit fixes that by making sure we only use the apr headers from
APR_INCLUDEDIR and the apu headers from the APU_INCLUDEDIR.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Upstream: https://bz.apache.org/bugzilla/show_bug.cgi?id=62930
---
server/Makefile.in | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/server/Makefile.in b/server/Makefile.in
index 1fa334467d..2258f0bdf2 100644
--- a/server/Makefile.in
+++ b/server/Makefile.in
@@ -34,7 +34,6 @@ test_char.h: gen_test_char
util.lo: test_char.h
EXPORT_DIRS = $(top_srcdir)/include $(top_srcdir)/os/$(OS_DIR)
-EXPORT_DIRS_APR = $(APR_INCLUDEDIR) $(APU_INCLUDEDIR)
# If export_files is a dependency here, but we remove it during this stage,
# when exports.c is generated, make will not detect that export_files is no
@@ -60,9 +59,8 @@ export_files:
ls $$dir/*.h ; \
done; \
echo "$(top_srcdir)/server/mpm_fdqueue.h"; \
- for dir in $(EXPORT_DIRS_APR); do \
- ls $$dir/ap[ru].h $$dir/ap[ru]_*.h 2>/dev/null; \
- done; \
+ ls $(APR_INCLUDE_DIR)/{apr.h,apr_*.h} 2>/dev/null; \
+ ls $(APU_INCLUDE_DIR)/{apu.h,apu_*.h} 2>/dev/null; \
) | sed -e s,//,/,g | sort -u > $@
exports.c: export_files
--
2.19.1

View File

@@ -0,0 +1,40 @@
From f7a85d0d2b76db75dc976e8dfa1101c954ea1a74 Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd@kuhls.net>
Date: Mon, 28 Oct 2024 23:13:05 +0100
Subject: [PATCH] ap_log_error: Include ap_config_auto.h to define
_GNU_SOURCE
gettid() needs _GNU_SOURCE defined which is provided by ap_config_auto.h
Fixes buildroot error:
http://autobuild.buildroot.net/results/2f6/2f6b7bbb4c97e4c91b3abd6bb205e237e57045fa//build-end.log
log.c: In function 'log_tid':
log.c:637:21: error: implicit declaration of function 'gettid'; did you mean 'getgid'? [-Wimplicit-function-declaration]
637 | pid_t tid = gettid();
Upstream: https://github.com/apache/httpd/pull/496
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
server/log.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/server/log.c b/server/log.c
index 91dcf2c3eb..e709288858 100644
--- a/server/log.c
+++ b/server/log.c
@@ -21,6 +21,10 @@
*
*/
+#if !defined(WIN32) && !defined(NETWARE)
+#include "ap_config_auto.h"
+#endif
+
#include "apr.h"
#include "apr_general.h" /* for signal stuff */
#include "apr_strings.h"
--
2.39.5

60
package/apache/Config.in Normal file
View File

@@ -0,0 +1,60 @@
config BR2_PACKAGE_APACHE
bool "apache"
depends on !BR2_STATIC_LIBS
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_USE_MMU # apr
select BR2_PACKAGE_APR_UTIL
select BR2_PACKAGE_PCRE2
help
The Apache HTTP Server Project is an effort to develop and
maintain an open-source HTTP server for modern operating
systems including UNIX and Windows NT. The goal of this
project is to provide a secure, efficient and extensible
server that provides HTTP services in sync with the current
HTTP standards.
https://httpd.apache.org
if BR2_PACKAGE_APACHE
choice
prompt "Multi-Processing Module (MPM)"
default BR2_PACKAGE_APACHE_MPM_WORKER
help
Select the Multi-Processing Module (MPM).
config BR2_PACKAGE_APACHE_MPM_EVENT
bool "event"
help
A variant of the worker MPM with the goal of consuming threads
only for connections with active processing
config BR2_PACKAGE_APACHE_MPM_PREFORK
bool "prefork"
help
Implements a non-threaded, pre-forking web server
config BR2_PACKAGE_APACHE_MPM_WORKER
bool "worker"
help
Implements a hybrid multi-threaded multi-process web server
endchoice
config BR2_PACKAGE_APACHE_MOD_MD
bool "mod_md"
select BR2_PACKAGE_JANSSON
select BR2_PACKAGE_LIBCURL
select BR2_PACKAGE_LIBCURL_FORCE_TLS
select BR2_PACKAGE_OPENSSL
help
Enable mod_md, which handles TLS certificate provisioning
via the ACME protocol, and OCSP stapling.
https://httpd.apache.org/docs/current/mod/mod_md.html
endif
comment "apache needs a toolchain w/ dynamic library, threads"
depends on BR2_USE_MMU
depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS

17
package/apache/S50apache Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
# shellcheck disable=SC2034 # checkpackage-required variable
DAEMON="apache"
mkdir -p "/var/log/apache2" "/var/run/apache2"
case "$1" in
start|restart|graceful|graceful-stop|stop)
apachectl -k "$1"
;;
reload)
apachectl -k restart
;;
*)
echo "Usage: $0 {start|restart|reload|graceful|graceful-stop|stop}"
exit 1
esac

View File

@@ -0,0 +1,5 @@
# From https://archive.apache.org/dist/httpd/httpd-2.4.68.tar.bz2.{sha256,sha512}
sha256 68c74d4df38c26bed4dfbdb8f3baf1eb532f3872357becc1bba5d136f6b63c06 httpd-2.4.68.tar.bz2
sha512 134a5bbd3ffe97523ac750490531bcb9441c532cedf0229aa006aa1368e9d25040507c6f519bed6754044f62c371f7c7f9a11b6a311f79b9680d478bf4373eb3 httpd-2.4.68.tar.bz2
# Locally computed
sha256 47b8c2b6c3309282a99d4a3001575c790fead690cc14734628c4667d2bbffc43 LICENSE

138
package/apache/apache.mk Normal file
View File

@@ -0,0 +1,138 @@
################################################################################
#
# apache
#
################################################################################
APACHE_VERSION = 2.4.68
APACHE_SOURCE = httpd-$(APACHE_VERSION).tar.bz2
APACHE_SITE = https://archive.apache.org/dist/httpd
APACHE_LICENSE = Apache-2.0
APACHE_LICENSE_FILES = LICENSE
APACHE_CPE_ID_VENDOR = apache
APACHE_CPE_ID_PRODUCT = http_server
APACHE_SELINUX_MODULES = apache
# Needed for mod_php
APACHE_INSTALL_STAGING = YES
# We have a patch touching configure.in and Makefile.in,
# so we need to autoreconf:
APACHE_AUTORECONF = YES
APACHE_DEPENDENCIES = host-pkgconf apr apr-util pcre2
APACHE_CONF_ENV= \
ap_cv_void_ptr_lt_long=no \
PCRE_CONFIG=$(STAGING_DIR)/usr/bin/pcre2-config
ifeq ($(BR2_PACKAGE_APACHE_MPM_EVENT),y)
APACHE_MPM = event
else ifeq ($(BR2_PACKAGE_APACHE_MPM_PREFORK),y)
APACHE_MPM = prefork
else ifeq ($(BR2_PACKAGE_APACHE_MPM_WORKER),y)
APACHE_MPM = worker
endif
APACHE_CONF_OPTS = \
--sysconfdir=/etc/apache2 \
--with-apr=$(STAGING_DIR)/usr \
--with-apr-util=$(STAGING_DIR)/usr \
--with-pcre=$(STAGING_DIR)/usr/bin/pcre2-config \
--enable-http \
--enable-dbd \
--enable-proxy \
--enable-mime-magic \
--without-suexec-bin \
--enable-mods-shared=all \
--with-mpm=$(APACHE_MPM) \
--disable-luajit \
--enable-layout=Debian \
--prefix=/
ifeq ($(BR2_PACKAGE_BROTLI),y)
APACHE_CONF_OPTS += --enable-brotli
APACHE_DEPENDENCIES += brotli
else
APACHE_CONF_OPTS += --disable-brotli
endif
ifeq ($(BR2_PACKAGE_LIBXML2),y)
APACHE_DEPENDENCIES += libxml2
# Apache wants the path to the header file, where it can find
# <libxml/parser.h>.
APACHE_CONF_OPTS += \
--enable-xml2enc \
--enable-proxy-html \
--with-libxml2=$(STAGING_DIR)/usr/include/libxml2
else
APACHE_CONF_OPTS += \
--disable-xml2enc \
--disable-proxy-html
endif
ifeq ($(BR2_PACKAGE_LUA),y)
APACHE_CONF_OPTS += --enable-lua
APACHE_DEPENDENCIES += lua
else
APACHE_CONF_OPTS += --disable-lua
endif
ifeq ($(BR2_PACKAGE_NGHTTP2),y)
APACHE_CONF_OPTS += \
--enable-http2 \
--with-nghttp2=$(STAGING_DIR)/usr
APACHE_DEPENDENCIES += nghttp2
else
APACHE_CONF_OPTS += --disable-http2
endif
ifeq ($(BR2_PACKAGE_OPENSSL),y)
APACHE_DEPENDENCIES += openssl
APACHE_CONF_OPTS += \
--enable-ssl \
--with-ssl=$(STAGING_DIR)/usr
else
APACHE_CONF_OPTS += --disable-ssl
endif
ifeq ($(BR2_PACKAGE_APACHE_MOD_MD),y)
APACHE_CONF_OPTS += --enable-md
# BR2_PACKAGE_APACHE_MOD_MD selects BR2_PACKAGE_OPENSSL, so openssl is
# added above
APACHE_DEPENDENCIES += jansson libcurl
else
APACHE_CONF_OPTS += --disable-md
endif
ifeq ($(BR2_PACKAGE_ZLIB),y)
APACHE_DEPENDENCIES += zlib
APACHE_CONF_OPTS += \
--enable-deflate \
--with-z=$(STAGING_DIR)/usr
else
APACHE_CONF_OPTS += --disable-deflate
endif
define APACHE_FIX_STAGING_APACHE_CONFIG
$(SED) 's%"/usr/bin"%"$(STAGING_DIR)/usr/bin"%' $(STAGING_DIR)/usr/bin/apxs
$(SED) 's%/usr/share/apache2/build%$(STAGING_DIR)/usr/share/apache2/build%' $(STAGING_DIR)/usr/bin/apxs
$(SED) 's%^prefix =.*%prefix = $(STAGING_DIR)/%' $(STAGING_DIR)/usr/share/apache2/build/config_vars.mk
$(SED) 's%^sbindir =.*%sbindir = $(STAGING_DIR)/usr/sbin%' $(STAGING_DIR)/usr/share/apache2/build/config_vars.mk
$(SED) 's%^includedir = .*%includedir = $(STAGING_DIR)/usr/include/apache2%' $(STAGING_DIR)/usr/share/apache2/build/config_vars.mk
endef
APACHE_POST_INSTALL_STAGING_HOOKS += APACHE_FIX_STAGING_APACHE_CONFIG
define APACHE_CLEANUP_TARGET
$(RM) -rf $(TARGET_DIR)/usr/share/apache2/default-site/htdocs/manual $(TARGET_DIR)/usr/share/apache2/build
endef
APACHE_POST_INSTALL_TARGET_HOOKS += APACHE_CLEANUP_TARGET
define APACHE_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/apache/S50apache \
$(TARGET_DIR)/etc/init.d/S50apache
endef
define APACHE_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/apache/apache.service \
$(TARGET_DIR)/usr/lib/systemd/system/apache.service
endef
$(eval $(autotools-package))

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Apache HTTP Server
After=network.target
[Service]
Type=forking
ExecStartPre=/bin/mkdir -p /var/log/apache2 /var/run/apache2
ExecStart=/usr/bin/apachectl start
ExecReload=/usr/bin/apachectl graceful
ExecStop=/usr/bin/apachectl stop
Restart=always
[Install]
WantedBy=multi-user.target