Skip to content

Commit 0042fea

Browse files
Sergei Kuvakinlafin
Sergei Kuvakin
authored andcommitted
feat: qemu 6.0.0-1
1 parent 3f5929a commit 0042fea

File tree

3 files changed

+32
-28
lines changed

3 files changed

+32
-28
lines changed

.github/workflows/actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
qemu-user-static:
1919
runs-on: ubuntu-latest
2020
env:
21-
VERSION: 5.2.0-11
22-
ORIGIN_VERSION: 5.2+dfsg-11
21+
VERSION: 6.0.0-1
22+
ORIGIN_VERSION: 6.0+dfsg-1~exp0
2323
steps:
2424
- uses: actions/checkout@v2
2525
- name: Set variables

containers/latest/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM busybox
22
ENV QEMU_BIN_DIR=/usr/bin
33
ADD ./register.sh /register
4-
ADD https://raw.githubusercontent.com/qemu/qemu/7c81570d932268a9626457a662f1c5046ebc455e/scripts/qemu-binfmt-conf.sh /qemu-binfmt-conf.sh
4+
ADD https://raw.githubusercontent.com/qemu/qemu/e75941331e4cdc05878119e08635ace437aae721/scripts/qemu-binfmt-conf.sh /qemu-binfmt-conf.sh
55
RUN chmod +x /qemu-binfmt-conf.sh
66
COPY qemu-*-static /usr/bin/
77
ENTRYPOINT ["/register"]

run.sh

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,51 @@ shift $((OPTIND-1))
1919

2020
[ "$1" = "--" ] && shift
2121

22-
base_path=$(pwd)
23-
cd releases/usr/bin/
24-
for file in *; do
25-
tar -czf $file.tar.gz $file;
26-
mv $file.tar.gz x86_64_$file.tar.gz
27-
done
28-
cd ${base_path}
29-
30-
from_arch="x86_64"
31-
to_archs="aarch64 aarch64_be alpha arm armeb cris hppa i386 m68k microblaze microblazeel mips mips64 mips64el mipsel mipsn32 mipsn32el nios2 or1k ppc ppc64 ppc64le riscv32 riscv64 s390x sh4 sh4eb sparc sparc32plus sparc64 x86_64 xtensa xtensaeb"
32-
3322
# Build container images creating the directory.
3423
# containers/
3524
# latest/ - An image including /usr/bin/qemu-$arch-status and /register script.
3625
# ${from_arch}_qemu-${to_arch}/ - Images including /usr/bin/qemu-$arch-status
3726
# register/ - An image including /register script.
27+
28+
from_arch="x86_64"
29+
root_dir=$(pwd)
3830
out_dir="containers"
31+
releases_dir="releases/usr/bin/"
32+
33+
cd ${releases_dir}
34+
for file in *; do
35+
tar -czf $file.tar.gz $file;
36+
mv $file.tar.gz x86_64_$file.tar.gz
37+
done
38+
cd ${root_dir}
3939

4040
# Generate register files.
4141
cp -p "${out_dir}/latest/register.sh" "${out_dir}/register/"
4242
cp -p "${out_dir}/latest/Dockerfile" "${out_dir}/register/"
4343
# Comment out the line to copy qemu-*-static not to provide those.
4444
sed -i '/^COPY qemu/ s/^/#/' "${out_dir}/register/Dockerfile"
4545

46-
for to_arch in $to_archs; do
47-
if [ "$from_arch" != "$to_arch" ]; then
48-
work_dir="${out_dir}/${from_arch}_qemu-${to_arch}"
49-
mkdir -p "${work_dir}"
50-
cp -p "releases/usr/bin/qemu-${to_arch}-static" ${work_dir}
51-
cp -p "${work_dir}/qemu-${to_arch}-static" "${out_dir}/latest/"
52-
cat > ${work_dir}/Dockerfile -<<EOF
46+
for file in ${releases_dir}*
47+
do
48+
if [[ $file =~ qemu-(.+)-static ]]; then
49+
to_arch=${BASH_REMATCH[1]}
50+
if [ "$from_arch" != "$to_arch" ]; then
51+
work_dir="${out_dir}/${from_arch}_qemu-${to_arch}"
52+
mkdir -p "${work_dir}"
53+
cp -p "${releases_dir}qemu-${to_arch}-static" ${work_dir}
54+
cp -p "${work_dir}/qemu-${to_arch}-static" "${out_dir}/latest/"
55+
cat > ${work_dir}/Dockerfile -<<EOF
5356
FROM scratch
5457
COPY qemu-${to_arch}-static /usr/bin/
5558
EOF
56-
docker build -t ${DOCKER_REPO}:$from_arch-$to_arch-${TAG_VER} ${work_dir}
57-
for target in "${DOCKER_REPO}:$from_arch-$to_arch" \
58-
"${DOCKER_REPO}:$to_arch-${TAG_VER}" \
59-
"${DOCKER_REPO}:$to_arch" ; do
60-
docker tag ${DOCKER_REPO}:$from_arch-$to_arch-${TAG_VER} ${target}
61-
done
62-
rm -rf "${work_dir}"
59+
docker build -t ${DOCKER_REPO}:$from_arch-$to_arch-${TAG_VER} ${work_dir}
60+
for target in "${DOCKER_REPO}:$from_arch-$to_arch" \
61+
"${DOCKER_REPO}:$to_arch-${TAG_VER}" \
62+
"${DOCKER_REPO}:$to_arch" ; do
63+
docker tag ${DOCKER_REPO}:$from_arch-$to_arch-${TAG_VER} ${target}
64+
done
65+
rm -rf "${work_dir}"
66+
fi
6367
fi
6468
done
6569

0 commit comments

Comments
 (0)