From 30a3cefc7c57f80f264aad97cfe8061a4dec10bb Mon Sep 17 00:00:00 2001 From: YellowJacketLinux Date: Wed, 16 Oct 2024 16:24:05 -0700 Subject: [PATCH] libseccomp --- 21-libseccomp.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 8 +++++++ 2 files changed, 62 insertions(+) create mode 100644 21-libseccomp.sh diff --git a/21-libseccomp.sh b/21-libseccomp.sh new file mode 100644 index 0000000..cae73c7 --- /dev/null +++ b/21-libseccomp.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +if [ "`whoami`" == "root" ]; then + echo "Danger, Will Robinson!" + echo "Do not execute me as r00t" + exit 1 +fi + +TARBALL="libseccomp-2.5.5.tar.gz" +DNL="https://github.com/seccomp/libseccomp/releases/download/v2.5.5/libseccomp-2.5.5.tar.gz" +SHA256="248a2c8a4d9b9858aa6baf52712c34afefcf9c9e94b76dce02c1c9aa25fb3375" + +[ -d libseccomp-2.5.5 ] && rm -rf libseccomp-2.5.5 + +if [ ! -f ${TARBALL} ]; then + wget ${DNL} + if [ $? -ne 0 ]; then + echo "Could not retrieve ${DNL}" + echo "Sorry." + exit 1 + fi +fi + +CHECK="`sha256sum ${TARBALL} |awk ' { print $1 } ' `" +if [ "${CHECK}" != "${SHA256}" ]; then + echo "${TARBALL} does not match expected SHA256. Sorry." + exit 1 +fi + +tar -zxf ${TARBALL} && cd libseccomp-2.5.5 + +./configure --prefix=/usr --disable-static +if [ $? -ne 0 ]; then + echo "Configure script failed for libseccomp. Sorry." + exit 1 +fi + +make +if [ $? -ne 0 ]; then + echo "Failed building libseccomp. Sorry." + exit 1 +fi + +echo "running make check" +make check > libseccomp.check.log 2>&1 + +echo +echo "Inspect libseccomp-2.5.5/libseccomp.check.log" +echo "and if it looks good, as root run:" +echo +echo " cd libseccomp-2.5.5" +echo " make install" +echo + diff --git a/README.md b/README.md index 8fb82da..1a827c1 100644 --- a/README.md +++ b/README.md @@ -195,4 +195,12 @@ scripts on a GNU/Linux system. No build dependencies outside of LFS. * Script: [`20-which.sh`](20-which.sh) * Stutus: Script Untested +Dependency Twenty-One: libseccomp +--------------------------------- + +Justification: Needed for GnuTLS. Depends upon which. + +* Script: [`21-libseccomp.sh`](21-libseccomp.sh) +* Status: Script Untested +