proot: disable seccomp, adopt package

otherwise it segfaults on newer kernels,
see: https://github.com/proot-me/proot/issues/106
This commit is contained in:
Piraty 2019-08-22 11:57:27 +02:00 committed by Toyam Cox
parent b478028028
commit 14f6da0b16
3 changed files with 73 additions and 14 deletions

View file

@ -0,0 +1,28 @@
# reason: https://github.com/proot-me/proot/issues/106
# src: Debian10
From: Simon McVittie <smcv@debian.org>
Date: Sat, 14 Jan 2017 15:52:13 +0000
X-Dgit-Generated: 5.1.0-1.2 dcc5f0999759be03aed5b62a8683e0b965d0219d
Subject: Disable seccomp-based tracing performance improvement
It is faster (according to upstream documentation), but on current
(4.8.4+) kernels it just segfaults. Software that works slowly seems
better than software that doesn't work at all.
Bug: https://github.com/proot-me/PRoot/issues/106
---
--- src/GNUmakefile
+++ src/GNUmakefile
@@ -105,7 +105,7 @@ CHECK_VERSION = VERSION=$$($(GIT) descri
then /bin/echo -e "\#undef VERSION\n\#define VERSION \"$${VERSION}\""; \
fi;
-CHECK_FEATURES = process_vm seccomp_filter
+CHECK_FEATURES = process_vm
CHECK_PROGRAMS = $(foreach feature,$(CHECK_FEATURES),.check_$(feature))
CHECK_OBJECTS = $(foreach feature,$(CHECK_FEATURES),.check_$(feature).o)
CHECK_RESULTS = $(foreach feature,$(CHECK_FEATURES),.check_$(feature).res)

View file

@ -0,0 +1,35 @@
--- src/GNUmakefile
+++ src/GNUmakefile
@@ -10,9 +10,9 @@
INSTALL = install
CC = $(CROSS_COMPILE)gcc
LD = $(CC)
-STRIP = $(CROSS_COMPILE)strip
-OBJCOPY = $(CROSS_COMPILE)objcopy
-OBJDUMP = $(CROSS_COMPILE)objdump
+STRIP = :
+OBJCOPY ?= $(CROSS_COMPILE)objcopy
+OBJDUMP ?= $(CROSS_COMPILE)objdump
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I. -I$(VPATH)
CFLAGS += -Wall -Wextra -O2
@@ -86,7 +86,7 @@
quiet_LD = @echo " LD $@"; $(LD)
quiet_INSTALL = @echo " INSTALL $?"; $(INSTALL)
-V = 0
+V = 1
ifeq ($(V), 0)
quiet = quiet_
Q = @
@@ -140,8 +140,8 @@
OBJIFY = $($(quiet)GEN) \
$(OBJCOPY) \
- --input binary \
- --output `env LANG=C $(OBJDUMP) -f cli/cli.o | \
+ --input-target binary \
+ --output-target `env LANG=C $(OBJDUMP) -f cli/cli.o | \
grep 'file format' | awk '{print $$4}'` \
--binary-architecture `env LANG=C $(OBJDUMP) -f cli/cli.o | \
grep architecture | cut -f 1 -d , | awk '{print $$2}'` \

View file

@ -1,30 +1,26 @@
# Template file for 'proot'
pkgname=proot
version=5.1.0
revision=5
wrksrc="PRoot-${version}"
revision=6
build_wrksrc=src
makedepends="libarchive-devel talloc-devel"
short_desc="User-space implementation of chroot, mount --bind, and binfmt_misc"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2"
maintainer="Piraty <piraty1@inbox.ru>"
license="GPL-2.0-or-later"
homepage="https://proot-me.github.io"
distfiles="https://github.com/proot-me/PRoot/archive/v${version}.tar.gz"
checksum=50fcb882662b2de3e64e603b68d1af75e920d480191a49e11c0cb63d50040386
checksum=ce0a3baca8312613bd10f65bb436a3aaa28e1034f498a22c35ad0693600e01dd
pre_build() {
sed -i "s,strip,:,g" src/GNUmakefile
sed -i "s,objcopy,${OBJCOPY},g" src/GNUmakefile
sed -i "s,objdump,${OBJDUMP},g" src/GNUmakefile
sed -i "s,--input ,--input-target ,g" src/GNUmakefile
sed -i "s,--output ,--output-target ,g" src/GNUmakefile
# Fix glibc ptrace.h specific constants for musl libc
cp ${FILESDIR}/ptrace_compat.h ${wrksrc}/src
cp ${FILESDIR}/ptrace_compat.h .
}
do_build() {
cd src
make CC=$CC CFLAGS="$CFLAGS" ${makejobs}
}
do_install() {
vbin src/proot
vman doc/proot/man.1 proot.1
vbin proot
vman ../doc/proot/man.1 proot.1
}