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,36 @@
From bfcc72e5bb96fc9fc1f3558191a1a3f40c7f159a Mon Sep 17 00:00:00 2001
From: Johan Oudinet <johan.oudinet@gmail.com>
Date: Fri, 2 Aug 2024 17:32:37 +0200
Subject: [PATCH] Makefile.in: do not download or compile dependencies
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Upstream: N/A, not upstreamable
---
Makefile.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 5adf241d5..74aad3156 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -201,7 +201,7 @@ endif
#' main targets
#
-all: scripts deps src
+all: scripts src
deps: $(DEPSDIR)/.got
@@ -215,7 +215,7 @@ $(DEPSDIR)/.got:
$(DEPSDIR)/.built: $(DEPSDIR)/.got
$(REBAR) compile && :> $(DEPSDIR)/.built
-src: $(DEPSDIR)/.built
+src:
$(REBAR) $(SKIPDEPS) compile
$(EXPLICIT_ELIXIR_COMPILE)
--
2.34.1

View File

@@ -0,0 +1,29 @@
From d403c0bca48f2678c70763c3faca41c9adc76658 Mon Sep 17 00:00:00 2001
From: Johan Oudinet <johan.oudinet@gmail.com>
Date: Fri, 2 Aug 2024 17:39:07 +0200
Subject: [PATCH] fix ejabberdctl
Change default values so ejabberdctl run commands as ejabberd user.
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Upstream: N/A (specific to buildroot)
---
ejabberdctl.template | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ejabberdctl.template b/ejabberdctl.template
index 83ec7e1bd..513c48c25 100755
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -17,7 +17,7 @@ ERTS_VSN="{{erts_vsn}}"
ERL="{{erl}}"
EPMD="{{epmd}}"
IEX="{{iexpath}}"
-INSTALLUSER="{{installuser}}"
+INSTALLUSER=ejabberd
# check the proper system user is used
case $(id -un) in
--
2.34.1

View File

@@ -0,0 +1,35 @@
config BR2_PACKAGE_EJABBERD
bool "ejabberd"
depends on BR2_PACKAGE_ERLANG
depends on BR2_INSTALL_LIBSTDCPP # jiffy, stringprep
select BR2_PACKAGE_ERLANG_EIMP
select BR2_PACKAGE_ERLANG_FAST_XML
select BR2_PACKAGE_ERLANG_FAST_YAML
select BR2_PACKAGE_ERLANG_IDNA # runtime
select BR2_PACKAGE_ERLANG_JIFFY # runtime
select BR2_PACKAGE_ERLANG_JOSE # runtime
select BR2_PACKAGE_ERLANG_LAGER
select BR2_PACKAGE_ERLANG_P1_ACME # runtime
select BR2_PACKAGE_ERLANG_P1_CACHE_TAB
select BR2_PACKAGE_ERLANG_P1_MQTREE # runtime
select BR2_PACKAGE_ERLANG_P1_OAUTH2 # runtime
select BR2_PACKAGE_ERLANG_P1_PKIX # runtime
select BR2_PACKAGE_ERLANG_P1_SIP
select BR2_PACKAGE_ERLANG_P1_STRINGPREP
select BR2_PACKAGE_ERLANG_P1_TLS
select BR2_PACKAGE_ERLANG_P1_UTILS
select BR2_PACKAGE_ERLANG_P1_YCONF # runtime
select BR2_PACKAGE_ERLANG_P1_ZLIB
select BR2_PACKAGE_ERLANG_STUN
select BR2_PACKAGE_ERLANG_XMPP
select BR2_PACKAGE_GETENT
select BR2_PACKAGE_OPENSSL
help
Ejabberd is a Jabber/XMPP instant messaging server, written
in Erlang/OTP. Among other features, ejabberd is
cross-platform, fault-tolerant, clusterable and modular.
http://www.ejabberd.im
comment "ejabberd needs erlang, toolchain w/ C++"
depends on !BR2_PACKAGE_ERLANG || !BR2_INSTALL_LIBSTDCPP

View File

@@ -0,0 +1,56 @@
#!/bin/sh
#
# Start/stop ejabberd
#
DAEMON=ejabberd
CTL=/usr/sbin/ejabberdctl
DEFAULT=/etc/ejabberd/ejabberdctl.cfg
INSTALLUSER=ejabberd
RUNDIR=/var/run/ejabberd
# Read default configuration file if present.
# shellcheck source=/dev/null
[ -r "$DEFAULT" ] && . "$DEFAULT"
# Create RUNDIR.
mkrundir() {
install -d -o "$INSTALLUSER" -g "$INSTALLUSER" "$RUNDIR"
}
case "$1" in
start)
mkrundir || exit 1
printf 'Starting %s: ' "$DAEMON"
"$CTL" start
# Wait until ejabberd is up and running.
if "$CTL" started; then
echo "done"
else
echo "failed"
fi
;;
stop)
printf 'Stopping %s: ' "$DAEMON"
"$CTL" stop > /dev/null
if [ $? -eq 3 ] || "$CTL" stopped; then
echo "OK"
else
echo "failed"
fi
;;
status)
"$CTL" status
;;
restart|force-reload)
"$0" stop || true
"$0" start
;;
live)
mkrundir || exit 1
"$CTL" live
;;
*)
echo "Usage: $0 {start|stop|status|restart|force-reload|live}"
exit 1
esac

View File

@@ -0,0 +1,56 @@
#!/bin/sh -e
# Helper to bypass AC_ERLANG_CHECK_LIB
#
# Ejabberd releases do not download specific versions of its erlang
# dependencies. Instead, it clones the master branch of a git
# repository and asks erl to provide the library version. However,
# the target erl program cannot be called from the host. So, this
# script aims at finding the library version installed on the target,
# without calling erlang.
usage() {
cat <<EOF
Usage:
$0 library
Look for Erlang's library in TARGET_DIR/usr/lib/erlang/lib.
If the library is found, it returns the path to the latest version,
relative to TARGET_DIR. Otherwise, it returns "not found".
If there are several versions, it returns an error because it does not
know which one Erlang uses.
EOF
}
die () {
echo "$@" >&2
exit 1
}
if [ $# -ne 1 ]; then
usage
exit 0
else
library="$1"
fi
target_dir="${TARGET_DIR:-output/target}"
[ -d "$target_dir" ] || die "TARGET_DIR is not a directory. Please \
specify the TARGET_DIR environment variable."
case "$(find "$target_dir/usr/lib/erlang/lib" -maxdepth 1 \
-name "$library-*" -type d | wc -l)" in
0)
echo "not found"
;;
1)
echo "$target_dir/usr/lib/erlang/lib/$library-"* \
| sed -e "s,^$target_dir,,"
;;
*)
die "Several versions of $library have been found. Please \
remove the unused ones."
;;
esac

View File

@@ -0,0 +1,4 @@
# From https://static.process-one.net/ejabberd/downloads/24.07/ejabberd-24.07.tar.gz.sum
sha256 c0fb746acba81a5db41de97c03968c1f681a13b1b6c1a895b7182e33820c18d9 ejabberd-24.07.tar.gz
# Locally computed
sha256 469bb8cfa3ef22c102875ff31932450c075e6908ff3f7d36893485c0c30898eb COPYING

View File

@@ -0,0 +1,68 @@
################################################################################
#
# ejabberd
#
################################################################################
EJABBERD_VERSION = 24.07
EJABBERD_SITE = https://static.process-one.net/ejabberd/downloads/$(EJABBERD_VERSION)
EJABBERD_LICENSE = GPL-2.0+ with OpenSSL exception
EJABBERD_LICENSE_FILES = COPYING
EJABBERD_CPE_ID_VENDOR = process-one
EJABBERD_DEPENDENCIES = getent openssl erlang-eimp host-erlang-lager \
erlang-lager erlang-p1-cache-tab erlang-p1-sip \
erlang-p1-stringprep erlang-stun erlang-p1-tls \
erlang-p1-utils erlang-fast-xml erlang-xmpp erlang-fast-yaml \
erlang-p1-zlib host-erlang-p1-utils host-erlang-xmpp
# 0001-Makefile.in-do-not-download-or-compile-dependencies.patch
# updates Makefile.in
EJABBERD_USE_AUTOCONF = YES
EJABBERD_AUTORECONF = YES
ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
EJABBERD_DEPENDENCIES += linux-pam
endif
EJABBERD_ERLANG_LIBS = sasl public_key mnesia inets compiler
# Guess answers for these tests, configure will bail out otherwise
# saying error: cannot run test program while cross compiling.
EJABBERD_CHECK_LIB = $(TOPDIR)/$(EJABBERD_PKGDIR)/check-erlang-lib
EJABBERD_CONF_ENV = \
ac_cv_erlang_root_dir="$(HOST_DIR)/lib/erlang" \
$(foreach lib,$(EJABBERD_ERLANG_LIBS), \
ac_cv_erlang_lib_dir_$(lib)="`$(EJABBERD_CHECK_LIB) $(lib)`")
EJABBERD_CONF_OPTS = \
--enable-system-deps \
--disable-erlang-version-check \
--with-rebar="$(HOST_DIR)/bin/rebar"
define EJABBERD_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) all install -C $(@D)
endef
# Replace HOST_DIR prefix to /usr in environment variables of
# ejabberctl script.
define EJABBERD_FIX_EJABBERDCTL
$(SED) 's,="$(HOST_DIR),="/usr,' '$(TARGET_DIR)/usr/sbin/ejabberdctl'
endef
EJABBERD_POST_INSTALL_TARGET_HOOKS += EJABBERD_FIX_EJABBERDCTL
define EJABBERD_USERS
ejabberd -1 ejabberd -1 * /var/lib/ejabberd /bin/sh - ejabberd daemon
endef
define EJABBERD_PERMISSIONS
/etc/ejabberd r 750 root ejabberd - - - - -
/usr/sbin/ejabberdctl f 750 root ejabberd - - - - -
endef
define EJABBERD_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/ejabberd/S50ejabberd \
$(TARGET_DIR)/etc/init.d/S50ejabberd
endef
$(eval $(rebar-package))