-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'non-amd64' into develop
- Loading branch information
Showing
11 changed files
with
142 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
FROM debian:buster-slim | ||
FROM debian:bookworm-slim | ||
|
||
ARG BUILD_ENV=local | ||
ARG ANDROID_PATCH BUILD_ENV=local MIRROR_URL=http://mirrors.aliyun.com/debian/ | ||
|
||
RUN if [ "${BUILD_ENV}" = "local" ]; then sed -i s/deb.debian.org/mirrors.aliyun.com/ /etc/apt/sources.list; fi &&\ | ||
COPY ["./build-scripts/pre_build.sh", "./build-scripts/set-mirror.sh", "/tmp/build-scripts/"] | ||
|
||
RUN extra_pkg_cross="libxss1 libgconf-2-4" . /tmp/build-scripts/pre_build.sh && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends --no-install-suggests \ | ||
libgtk2.0-0 libx11-xcb1 libxtst6 libnss3 libasound2 libdbus-glib-1-2 iptables xclip\ | ||
dante-server tigervnc-standalone-server tigervnc-common dante-server psmisc flwm x11-utils\ | ||
busybox libssl-dev iproute2 tinyproxy-bin | ||
dante-server tigervnc-standalone-server tigervnc-tools dante-server psmisc flwm x11-utils\ | ||
busybox libssl-dev iproute2 tinyproxy-bin $extra_pkg && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ARG EC_URL | ||
ARG EC_URL ELECTRON_URL | ||
|
||
RUN cd tmp &&\ | ||
busybox wget "${EC_URL}" -O EasyConnect.deb &&\ | ||
dpkg -i EasyConnect.deb && rm EasyConnect.deb | ||
COPY ["./build-scripts/install-ec-gui.sh", "./build-scripts/mk-qemu-wrapper.sh", "/tmp/build-scripts/"] | ||
|
||
COPY ./docker-root / | ||
RUN /tmp/build-scripts/install-ec-gui.sh | ||
|
||
RUN rm -f /usr/share/sangfor/EasyConnect/resources/conf/easy_connect.json &&\ | ||
mv /usr/share/sangfor/EasyConnect/resources/conf/ /usr/share/sangfor/EasyConnect/resources/conf_backup &&\ | ||
ln -s /root/conf /usr/share/sangfor/EasyConnect/resources/conf | ||
COPY ./docker-root / | ||
|
||
COPY --from=fake-hwaddr fake-hwaddr/fake-hwaddr.so /usr/local/lib/fake-hwaddr.so | ||
|
||
#ENV TYPE="" PASSWORD="" LOOP="" | ||
#ENV DISPLAY | ||
|
||
VOLUME /root/ /usr/share/sangfor/EasyConnect/resources/logs/ | ||
|
||
CMD ["start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,28 @@ | ||
FROM debian:buster-slim | ||
FROM debian:bookworm-slim | ||
|
||
ARG BUILD_ENV=local | ||
ARG ANDROID_PATCH BUILD_ENV=local MIRROR_URL=http://mirrors.aliyun.com/debian/ | ||
|
||
RUN if [ "${BUILD_ENV}" = "local" ]; then sed -i s/deb.debian.org/mirrors.aliyun.com/ /etc/apt/sources.list; fi &&\ | ||
COPY ["./build-scripts/pre_build.sh", "./build-scripts/set-mirror.sh", "/tmp/build-scripts/"] | ||
|
||
RUN extra_pkg_cross="libxss1 libgconf-2-4" . /tmp/build-scripts/pre_build.sh && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends --no-install-suggests \ | ||
apt-get install -y --no-install-recommends --no-install-suggests $extra_pkg \ | ||
libgtk2.0-0 libx11-xcb1 libxtst6 libnss3 libasound2 libdbus-glib-1-2 iptables \ | ||
dante-server psmisc libxaw7 xclip busybox libssl-dev iproute2 tinyproxy-bin | ||
dante-server psmisc libxaw7 xclip busybox libssl-dev iproute2 tinyproxy-bin && \ | ||
cd /tmp && apt download x11-utils && dpkg -x x11-utils_*.deb x11-utils && \ | ||
mkdir -p /usr/local/bin && cp x11-utils/usr/bin/xmessage /usr/local/bin && rm -r x11-utils* && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN cd tmp && apt update && apt download x11-utils && dpkg -x x11-utils_*.deb x11-utils &&\ | ||
mkdir -p /usr/local/bin && cp x11-utils/usr/bin/xmessage /usr/local/bin && rm -r x11-utils* | ||
ARG EC_URL ELECTRON_URL | ||
|
||
ARG EC_URL | ||
COPY ["./build-scripts/install-ec-gui.sh", "./build-scripts/mk-qemu-wrapper.sh", "/tmp/build-scripts/"] | ||
|
||
RUN cd tmp && \ | ||
busybox wget "${EC_URL}" -O EasyConnect.deb &&\ | ||
dpkg -i EasyConnect.deb && rm EasyConnect.deb | ||
RUN /tmp/build-scripts/install-ec-gui.sh | ||
|
||
COPY ./docker-root / | ||
|
||
RUN rm -f /usr/share/sangfor/EasyConnect/resources/conf/easy_connect.json &&\ | ||
mv /usr/share/sangfor/EasyConnect/resources/conf/ /usr/share/sangfor/EasyConnect/resources/conf_backup &&\ | ||
ln -s /root/conf /usr/share/sangfor/EasyConnect/resources/conf | ||
|
||
COPY --from=fake-hwaddr fake-hwaddr/fake-hwaddr.so /usr/local/lib/fake-hwaddr.so | ||
|
||
#ENV PASSWORD="" LOOP="" | ||
#ENV DISPLAY | ||
|
||
VOLUME /root/ /usr/share/sangfor/EasyConnect/resources/logs/ | ||
|
||
CMD TYPE=x11 start.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
cd /tmp && | ||
busybox wget "${EC_URL}" -O EasyConnect.deb && | ||
if [ "$(dpkg --print-architecture)" != "amd64" ]; then | ||
dpkg-deb -R EasyConnect.deb / && | ||
/DEBIAN/postinst && | ||
rm -r /DEBIAN && | ||
extra_amd64_bins=EasyMonitor ./build-scripts/mk-qemu-wrapper.sh && | ||
chmod +s /usr/share/sangfor/EasyConnect/resources/bin/{CSClient,ECAgent,svpnservice}* | ||
else | ||
dpkg -i EasyConnect.deb | ||
fi && | ||
rm EasyConnect.deb && | ||
|
||
rm -f /usr/share/sangfor/EasyConnect/resources/conf/easy_connect.json && | ||
mv /usr/share/sangfor/EasyConnect/resources/conf/ /usr/share/sangfor/EasyConnect/resources/conf_backup && | ||
ln -s /root/conf /usr/share/sangfor/EasyConnect/resources/conf && | ||
|
||
if [ "$(dpkg --print-architecture)" == "amd64" -a -z "${ELECTRON_URL}" ]; then | ||
exit 0 | ||
fi && | ||
|
||
declare -A ELECTRON_URLS && | ||
|
||
# v1.8 以下的 electron 无官方 arm64、mips64el 构建 | ||
# armhf 在 v1.8.2-beta4 到 v1.8.8 无法渲染:https://github.com/electron/electron/issues/11797 | ||
ELECTRON_URLS=( | ||
[armel]=https://github.com/electron/electron/releases/download/v1.7.16/electron-v1.7.16-linux-armv7l.zip | ||
[armhf]=https://github.com/electron/electron/releases/download/v1.7.16/electron-v1.7.16-linux-armv7l.zip | ||
[arm64]=https://github.com/electron/electron/releases/download/v1.8.8/electron-v1.8.8-linux-arm64.zip | ||
[mips64el]=https://github.com/electron/electron/releases/download/v1.8.8/electron-v1.8.8-linux-mips64el.zip | ||
) && | ||
if [ -z "${ELECTRON_URL}" ]; then | ||
ELECTRON_URL="${ELECTRON_URLS[$(dpkg --print-architecture)]}" | ||
fi && | ||
busybox wget "${ELECTRON_URL}" -O electron.zip && | ||
busybox unzip electron.zip -od /usr/share/sangfor/EasyConnect/ && | ||
rm electron.zip && | ||
mv /usr/share/sangfor/EasyConnect/{electron,EasyConnect} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
for exec in CSClient ECAgent svpnservice $extra_amd64_bins; do | ||
exec_path=/usr/share/sangfor/EasyConnect/resources/bin/$exec && | ||
mkdir -p /usr/local/libexec/qemu-hack/ && | ||
qemu_path=/usr/local/libexec/qemu-hack/$exec && | ||
|
||
mv ${exec_path} ${exec_path}-origin && | ||
|
||
# 一个让 qemu 产生的进程名字和原生运行时名字一致的 hack(便于 killall 杀进程):使 qemu 的文件名和被模拟程序文件名一致 | ||
ln -s /usr/bin/qemu-x86_64 ${qemu_path} && | ||
|
||
# 将原可执行文件用 qemu 封装起来 | ||
printf '%s\n%s\n' '#!/bin/sh' "exec ${qemu_path} \${qemu_args} ${exec_path}-origin "'"$@"' > ${exec_path} && | ||
chmod +x ${exec_path} ${exec_path}-origin || exit 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
if [ -n "${ANDROID_PATCH}" ]; then | ||
groupadd -g 3003 inet && usermod -a -G inet root && usermod -g inet -ou 0 daemon && usermod -g inet -ou 0 _apt | ||
fi && | ||
/tmp/build-scripts/set-mirror.sh && | ||
extra_pkg='' && | ||
if [ "$(dpkg --print-architecture)" != "amd64" ]; then | ||
dpkg --add-architecture amd64 && extra_pkg="$extra_pkg_cross qemu-user libc6:amd64 libstdc++6:amd64" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
if [ "${BUILD_ENV}" = "local" ]; then | ||
if [ -n "$MIRROR_URL" ]; then | ||
origin="$(cat /etc/apt/sources.list)" | ||
default_mirror=http://deb.debian.org/debian | ||
replaced="${origin//$default_mirror/$MIRROR_URL}" | ||
printf %s "$replaced" > /etc/apt/sources.list | ||
fi | ||
else | ||
echo "Warning: The BUILD_ENV build argument has been deprecated and will be removed. Please use MIRROR_URL instead." >&2 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
fake-hwaddr.so: fake-hwaddr.c | ||
gcc --shared -o fake-hwaddr.so fake-hwaddr.c -ldl -fPIC | ||
strip fake-hwaddr.so | ||
x86_64-linux-gnu-gcc --shared -o fake-hwaddr.so fake-hwaddr.c -ldl -fPIC | ||
|