Skip to content

Commit

Permalink
bump(root/runc): 1.2.4
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Alok <alok@termux.dev>
  • Loading branch information
MrAdityaAlok committed Jan 21, 2025
1 parent a745b02 commit a89b263
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 96 deletions.
5 changes: 2 additions & 3 deletions root-packages/runc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://www.opencontainers.org/
TERMUX_PKG_DESCRIPTION="A tool for spawning and running containers according to the OCI specification"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.1.15"
TERMUX_PKG_REVISION=1
TERMUX_PKG_VERSION="1.2.4"
TERMUX_PKG_SRCURL=https://github.com/opencontainers/runc/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=8446718a107f3e437bc33a4c9b89b94cb24ae58ed0a49d08cd83ac7d39980860
TERMUX_PKG_SHA256=9785c144c97974b52b6091b7a79168b73681ff574bc8438b44f3f5f8c112f171
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BUILD_DEPENDS="libseccomp-static"

Expand Down
10 changes: 10 additions & 0 deletions root-packages/runc/fix-config-file-location.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- runc-1.2.4/libcontainer/criu_linux.go 2025-01-07 04:50:22.000000000 +0530
+++ runc-1.2.4.mod/libcontainer/criu_linux.go 2025-01-17 02:05:05.490165001 +0530
@@ -160,7 +160,7 @@
} else {
// If the mentioned annotation has not been found, specify
// a default CRIU configuration file.
- rpcOpts.ConfigFile = proto.String("/etc/criu/runc.conf")
+ rpcOpts.ConfigFile = proto.String("@TERMUX_PREFIX@/etc/criu/runc.conf")
}
}
37 changes: 7 additions & 30 deletions root-packages/runc/fix_static_build.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
diff --git a/Makefile b/Makefile
index 452ee94c..6ffd06d7 100644
--- a/Makefile
+++ b/Makefile
@@ -19,28 +19,12 @@ LDFLAGS_COMMON := -X main.gitCommit=$(COMMIT) -X main.version=$(VERSION)
GOARCH := $(shell $(GO) env GOARCH)
--- runc-1.2.4/Makefile 2025-01-07 04:50:22.000000000 +0530
+++ runc-1.2.4.mod/Makefile 2025-01-17 02:46:37.087174408 +0530
@@ -30,28 +30,12 @@
TRIMPATH := -trimpath

GO_BUILDMODE :=
-# Enable dynamic PIE executables on supported platforms.
Expand All @@ -12,7 +10,7 @@ index 452ee94c..6ffd06d7 100644
- GO_BUILDMODE := "-buildmode=pie"
- endif
-endif
GO_BUILD := $(GO) build -trimpath $(GO_BUILDMODE) \
GO_BUILD := $(GO) build $(TRIMPATH) $(GO_BUILDMODE) \
$(EXTRA_FLAGS) -tags "$(BUILDTAGS)" \
-ldflags "$(LDFLAGS_COMMON) $(EXTRA_LDFLAGS)"

Expand All @@ -24,31 +22,10 @@ index 452ee94c..6ffd06d7 100644
-ifneq (,$(filter $(GOARCH),arm64 amd64))
- ifeq (,$(findstring -race,$(EXTRA_FLAGS)))
- GO_BUILDMODE_STATIC := -buildmode=pie
- LDFLAGS_STATIC := -linkmode external -extldflags --static-pie
- LDFLAGS_STATIC := -linkmode external -extldflags -static-pie
- endif
-endif
-# Enable static PIE binaries on supported platforms.
GO_BUILD_STATIC := $(GO) build -trimpath $(GO_BUILDMODE_STATIC) \
GO_BUILD_STATIC := $(GO) build $(TRIMPATH) $(GO_BUILDMODE_STATIC) \
$(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo osusergo" \
-ldflags "$(LDFLAGS_COMMON) $(LDFLAGS_STATIC) $(EXTRA_LDFLAGS)"
diff --git a/libcontainer/nsenter/cloned_binary.c b/libcontainer/nsenter/cloned_binary.c
index d1b2d4c5..c10347c3 100644
--- a/libcontainer/nsenter/cloned_binary.c
+++ b/libcontainer/nsenter/cloned_binary.c
@@ -91,6 +91,8 @@
# define MFD_ALLOW_SEALING 0x0002U
#endif

+int memfd_create(const char *name, unsigned int flags);
+#ifndef __ANDROID__
int memfd_create(const char *name, unsigned int flags)
{
#ifdef SYS_memfd_create
@@ -100,6 +102,7 @@ int memfd_create(const char *name, unsigned int flags)
return -1;
#endif
}
+#endif

/* This comes directly from <linux/fcntl.h>. */
#ifndef F_LINUX_SPECIFIC_BASE
12 changes: 0 additions & 12 deletions root-packages/runc/libcontainer-container_linux.go.patch

This file was deleted.

43 changes: 0 additions & 43 deletions root-packages/runc/libcontainer-nsenter-cloned_binary.c.patch

This file was deleted.

17 changes: 9 additions & 8 deletions root-packages/runc/root-dir-path.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ diff -uNr runc-1.0.0-rc91/list.go runc-1.0.0-rc91.mod/list.go

EXAMPLE 1:
To list containers created via the default "--root":
diff -uNr runc-1.0.0-rc91/main.go runc-1.0.0-rc91.mod/main.go
--- runc-1.0.0-rc91/main.go 2020-06-30 18:24:30.000000000 +0300
+++ runc-1.0.0-rc91.mod/main.go 2020-07-19 16:39:37.309287649 +0300
@@ -65,7 +65,7 @@

--- runc-1.2.4/main.go 2025-01-07 04:50:22.000000000 +0530
+++ runc-1.2.4.mod/main.go 2025-01-17 02:30:00.522004934 +0530
@@ -73,7 +73,7 @@
}
app.Version = strings.Join(v, "\n")

xdgRuntimeDir := ""
- root := "/run/runc"
+ root := "@TERMUX_PREFIX@/tmp/runc"
if shouldHonorXDGRuntimeDir() {
if runtimeDir := os.Getenv("XDG_RUNTIME_DIR"); runtimeDir != "" {
root = runtimeDir + "/runc"
xdgDirUsed := false
xdgRuntimeDir := os.Getenv("XDG_RUNTIME_DIR")
if xdgRuntimeDir != "" && shouldHonorXDGRuntimeDir() {
"

0 comments on commit a89b263

Please sign in to comment.