sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[SM-Commit] GIT changes to master grimoire by Vlad Glagolev (f0964a9db5f9bbacbaf726c8e72dc94aa7d7fb3e)
- From: Vlad Glagolev <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org
- Subject: [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (f0964a9db5f9bbacbaf726c8e72dc94aa7d7fb3e)
- Date: Thu, 27 Apr 2023 20:06:00 +0000
GIT changes to master grimoire by Vlad Glagolev <stealth AT sourcemage.org>:
utils/earlyoom/BUILD | 2 +-
utils/earlyoom/CONFIGURE | 1 -
utils/earlyoom/DEPENDS | 3 +++
utils/earlyoom/DETAILS | 1 +
utils/earlyoom/HISTORY | 10 ++++++++++
utils/earlyoom/INSTALL | 6 +++---
utils/earlyoom/PRE_BUILD | 8 ++++++++
utils/earlyoom/glibc.patch | 13 +++++++++++++
utils/earlyoom/init.d/earlyoom | 33 +++++++++++++++++++++++++++++++++
9 files changed, 72 insertions(+), 5 deletions(-)
New commits:
commit f0964a9db5f9bbacbaf726c8e72dc94aa7d7fb3e
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
earlyoom: post-creation fixes
diff --git a/utils/earlyoom/BUILD b/utils/earlyoom/BUILD
index 1a10dfe..f1a4a15 100755
--- a/utils/earlyoom/BUILD
+++ b/utils/earlyoom/BUILD
@@ -1 +1 @@
-PREFIX="${INSTALL_ROOT}/usr" make
+make VERSION="${VERSION}" PREFIX="${INSTALL_ROOT}/usr"
diff --git a/utils/earlyoom/CONFIGURE b/utils/earlyoom/CONFIGURE
deleted file mode 100755
index 00755f5..0000000
--- a/utils/earlyoom/CONFIGURE
+++ /dev/null
@@ -1 +0,0 @@
-config_query SYSD "Build with systemd support?" n
diff --git a/utils/earlyoom/DEPENDS b/utils/earlyoom/DEPENDS
new file mode 100755
index 0000000..f4e3a3e
--- /dev/null
+++ b/utils/earlyoom/DEPENDS
@@ -0,0 +1,3 @@
+optional_depends systemd "" "" "to use systemd instead of init script" &&
+
+suggest_depends SYSTEM-LOGGER "" "" "for logging to syslog"
diff --git a/utils/earlyoom/DETAILS b/utils/earlyoom/DETAILS
index 3aac7cc..8b0bd2e 100755
--- a/utils/earlyoom/DETAILS
+++ b/utils/earlyoom/DETAILS
@@ -1,5 +1,6 @@
SPELL=earlyoom
VERSION=1.7
+ PATCHLEVEL=1
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
SOURCE_URL[0]=https://github.com/rfjakob/${SPELL}/archive/v${VERSION}.tar.gz
diff --git a/utils/earlyoom/HISTORY b/utils/earlyoom/HISTORY
index dfa8447..7c4b531 100644
--- a/utils/earlyoom/HISTORY
+++ b/utils/earlyoom/HISTORY
@@ -1,3 +1,13 @@
+2023-04-27 Vlad Glagolev <stealth AT sourcemage.org>
+ * DETAILS: PATCHLEVEL=1
+ * BUILD: add VERSION flag
+ * DEPENDS: added
+ * INSTALL: updated targets
+ * PRE_BUILD: added, for building on older systems
+ * CONFIGURE: deprecated in favor of DEPENDS
+ * glibc.patch: added, to fix building with older systems
+ * init.d: added, for simpleinit-msb management
+
2023-04-26 Conner Clere <xenanthropy AT sourcemage.org>
* BUILD, CONFIGURE, INSTALL, DETAILS: version 1.7, new spell
diff --git a/utils/earlyoom/INSTALL b/utils/earlyoom/INSTALL
index fc4a0d9..70c2931 100755
--- a/utils/earlyoom/INSTALL
+++ b/utils/earlyoom/INSTALL
@@ -1,5 +1,5 @@
-if [[ $SYSD == 'y' ]]; then
- PREFIX="${INSTALL_ROOT}/usr" make install
+if is_depends_enabled ${SPELL} systemd; then
+ make PREFIX="${INSTALL_ROOT}/usr" install
else
- PREFIX="${INSTALL_ROOT}/usr" make install-initscript
+ make PREFIX="${INSTALL_ROOT}/usr" install-bin install-default
fi
diff --git a/utils/earlyoom/PRE_BUILD b/utils/earlyoom/PRE_BUILD
new file mode 100755
index 0000000..1c9b36f
--- /dev/null
+++ b/utils/earlyoom/PRE_BUILD
@@ -0,0 +1,8 @@
+. "${GRIMOIRE}/FUNCTIONS" &&
+
+default_pre_build &&
+cd "${SOURCE_DIRECTORY}" &&
+
+if is_version_less $(get_sorcery_kernel_version) 4.3 || ! grep -q
PR_CAP_AMBIENT "${INSTALL_ROOT}/usr/include/linux/prctl.h"; then
+ patch -p0 < "${SPELL_DIRECTORY}/glibc.patch"
+fi
diff --git a/utils/earlyoom/glibc.patch b/utils/earlyoom/glibc.patch
new file mode 100644
index 0000000..2d9da88
--- /dev/null
+++ b/utils/earlyoom/glibc.patch
@@ -0,0 +1,13 @@
+--- globals.h.orig 2022-03-05 00:33:22.000000000 -0800
++++ globals.h 2023-04-26 21:26:14.752581532 -0700
+@@ -6,4 +6,10 @@
+
+ extern char* procdir_path;
+
++#define PR_CAP_AMBIENT 47
++# define PR_CAP_AMBIENT_IS_SET 1
++# define PR_CAP_AMBIENT_RAISE 2
++# define PR_CAP_AMBIENT_LOWER 3
++# define PR_CAP_AMBIENT_CLEAR_ALL 4
++
+ #endif
diff --git a/utils/earlyoom/init.d/earlyoom b/utils/earlyoom/init.d/earlyoom
new file mode 100755
index 0000000..217f33b
--- /dev/null
+++ b/utils/earlyoom/init.d/earlyoom
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+. /etc/default/earlyoom
+
+PROGRAM=/usr/bin/earlyoom
+ARGS="${EARLYOOM_ARGS}"
+RUNLEVEL=3
+NEEDS="+local_fs"
+
+. /etc/init.d/smgl_init
+
+start() {
+ echo "Starting ${NAME}..."
+
+ TIMEOUT=3
+
+ exec /bin/sh -c "set -o pipefail; exec ${PROGRAM} ${ARGS} 2>&1 | logger
-ip daemon.info -t earlyoom" 2> /dev/null &
+ ppid=$!
+
+ sleep $TIMEOUT && pgrep -P $ppid > /dev/null || wait $ppid
+
+ evaluate_retval
+}
+
+stop() {
+ echo "Stopping ${NAME}..."
+
+ killproc ${NAME}
+}
+
+reload() {
+ _restart
+}
- [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (f0964a9db5f9bbacbaf726c8e72dc94aa7d7fb3e), Vlad Glagolev, 04/27/2023
Archive powered by MHonArc 2.6.24.