* [PATCH 1/4] CI: Add libelf-dev to dev container
@ 2024-04-01 21:55 Hauke Mehrtens
2024-04-01 21:55 ` [PATCH 2/4] backports-update-manager: Install only kernel 4.0 and higher Hauke Mehrtens
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Hauke Mehrtens @ 2024-04-01 21:55 UTC (permalink / raw)
To: backports; +Cc: Hauke Mehrtens
Some older kernel versions like 4.16 need libelf-dev, otherwise they
show this warning message:
Makefile:982: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
.devcontainer/Dockerfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 5c387891..3894196e 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -1,7 +1,7 @@
FROM ubuntu:22.04
RUN apt update && \
- apt install -y git coccinelle build-essential python3 python3-pip python-is-python3 flex bison libelf1 && \
+ apt install -y git coccinelle build-essential python3 python3-pip python-is-python3 flex bison libelf1 libelf-dev && \
rm -rf /var/lib/apt/lists/*
RUN pip install pyzstd
--
2.44.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/4] backports-update-manager: Install only kernel 4.0 and higher
2024-04-01 21:55 [PATCH 1/4] CI: Add libelf-dev to dev container Hauke Mehrtens
@ 2024-04-01 21:55 ` Hauke Mehrtens
2024-04-01 21:55 ` [PATCH 3/4] backports-update-manager: Use zstandard from pip Hauke Mehrtens
2024-04-01 21:55 ` [PATCH 4/4] CI: Use Ubuntu 24.04 as dev container base Hauke Mehrtens
2 siblings, 0 replies; 4+ messages in thread
From: Hauke Mehrtens @ 2024-04-01 21:55 UTC (permalink / raw)
To: backports; +Cc: Hauke Mehrtens
Kernel 3.x are not supported any more, install only more recent kernel
versions.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
devel/backports-update-manager | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/devel/backports-update-manager b/devel/backports-update-manager
index 815a0421..c2900b64 100755
--- a/devel/backports-update-manager
+++ b/devel/backports-update-manager
@@ -79,7 +79,7 @@ class backport_kernel_updater:
builds = re.findall(b'href="([-v.0-9a-z]*)/"', html)
builds = [b.decode('ascii') for b in builds]
# remove some special kernels
- builds = [b for b in builds if re.match('v[3-9]', b)]
+ builds = [b for b in builds if re.match('v[4-9]', b)]
builds = [b for b in builds if not '-rc' in b and not '-unstable' in b and not '-ckt' in b]
last = {}
for b in builds:
--
2.44.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/4] backports-update-manager: Use zstandard from pip
2024-04-01 21:55 [PATCH 1/4] CI: Add libelf-dev to dev container Hauke Mehrtens
2024-04-01 21:55 ` [PATCH 2/4] backports-update-manager: Install only kernel 4.0 and higher Hauke Mehrtens
@ 2024-04-01 21:55 ` Hauke Mehrtens
2024-04-01 21:55 ` [PATCH 4/4] CI: Use Ubuntu 24.04 as dev container base Hauke Mehrtens
2 siblings, 0 replies; 4+ messages in thread
From: Hauke Mehrtens @ 2024-04-01 21:55 UTC (permalink / raw)
To: backports; +Cc: Hauke Mehrtens
Use the zstandard package from python pip instead of pystd. zstandard is
more common and also integrated in later Ubuntu versions.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
.devcontainer/Dockerfile | 2 +-
devel/backports-update-manager | 15 ++++++++-------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 3894196e..f758c9cb 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -4,7 +4,7 @@ RUN apt update && \
apt install -y git coccinelle build-essential python3 python3-pip python-is-python3 flex bison libelf1 libelf-dev && \
rm -rf /var/lib/apt/lists/*
-RUN pip install pyzstd
+RUN pip install pyzstd zstandard
RUN git clone https://github.com/hauke/backports.git
diff --git a/devel/backports-update-manager b/devel/backports-update-manager
index c2900b64..79f0ae23 100755
--- a/devel/backports-update-manager
+++ b/devel/backports-update-manager
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
import argparse, os, sys, errno, getopt, re
import shutil
+import zstandard
from urllib.request import urlopen
from urllib.parse import urljoin
import tarfile, tempfile
import fileinput, subprocess
-from pyzstd import ZstdFile
source_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(source_dir + '/../')
from lib import bpar as ar
@@ -543,13 +543,14 @@ class backport_kernel_updater:
data, dpath = tempfile.mkstemp(prefix=tmp_prefix)
ar.print_data(target, data)
try:
- tar = tarfile.open(name=dpath, mode='r')
- tar.extractall(path=tmpdir_path, members=bk_tar_members(tar))
+ with tarfile.open(name=dpath, mode='r') as tar:
+ tar.extractall(path=tmpdir_path, members=bk_tar_members(tar))
except (tarfile.ReadError):
- zstd_file = ZstdFile(dpath)
- tar = tarfile.open(fileobj=zstd_file, mode='r')
- tar.extractall(path=tmpdir_path, members=bk_tar_members(tar))
- zstd_file.close()
+ with open(dpath, 'rb') as file:
+ unzstd = zstandard.ZstdDecompressor()
+ with unzstd.stream_reader(file) as stream:
+ with tarfile.open(fileobj=stream, mode='r|') as tar:
+ tar.extractall(path=tmpdir_path, members=bk_tar_members(tar))
os.unlink(dpath)
self.sanitize_and_install_kernel_dirs(tmpdir_path)
--
2.44.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 4/4] CI: Use Ubuntu 24.04 as dev container base
2024-04-01 21:55 [PATCH 1/4] CI: Add libelf-dev to dev container Hauke Mehrtens
2024-04-01 21:55 ` [PATCH 2/4] backports-update-manager: Install only kernel 4.0 and higher Hauke Mehrtens
2024-04-01 21:55 ` [PATCH 3/4] backports-update-manager: Use zstandard from pip Hauke Mehrtens
@ 2024-04-01 21:55 ` Hauke Mehrtens
2 siblings, 0 replies; 4+ messages in thread
From: Hauke Mehrtens @ 2024-04-01 21:55 UTC (permalink / raw)
To: backports; +Cc: Hauke Mehrtens
Use Ubuntu 24.04 as the base for the dev container. The Ubuntu PPA
kernel in version 5.19 or higher are not compiling with Ubuntu 22.04
any more. They need GCC version 12 or higher.
This removes the pip installation and uses zstandard from the Ubuntu
package repository instead.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
.devcontainer/Dockerfile | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index f758c9cb..cdf5d124 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -1,11 +1,9 @@
-FROM ubuntu:22.04
+FROM ubuntu:24.04
RUN apt update && \
- apt install -y git coccinelle build-essential python3 python3-pip python-is-python3 flex bison libelf1 libelf-dev && \
+ apt install -y git coccinelle build-essential python3 python3-zstandard python-is-python3 flex bison libelf1 libelf-dev && \
rm -rf /var/lib/apt/lists/*
-RUN pip install pyzstd zstandard
-
RUN git clone https://github.com/hauke/backports.git
RUN /backports/devel/backports-update-manager --yes --no-git-update && \
--
2.44.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-04-01 21:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-01 21:55 [PATCH 1/4] CI: Add libelf-dev to dev container Hauke Mehrtens
2024-04-01 21:55 ` [PATCH 2/4] backports-update-manager: Install only kernel 4.0 and higher Hauke Mehrtens
2024-04-01 21:55 ` [PATCH 3/4] backports-update-manager: Use zstandard from pip Hauke Mehrtens
2024-04-01 21:55 ` [PATCH 4/4] CI: Use Ubuntu 24.04 as dev container base Hauke Mehrtens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).