From 60e9f0daeeee3365cfb92b68651b333dbd8fd64c Mon Sep 17 00:00:00 2001 From: bluesky <52627687+chenchongbiao@users.noreply.github.com> Date: Tue, 28 Nov 2023 22:28:35 +0800 Subject: [PATCH] new distribution: deepin v23 (#376) --- .github/workflows/build.yml | 2 +- bootstrap-rootfs.sh | 2 +- distro-build/deepin.sh | 56 +++++++++++++++++++++++++++++++++++++ distro-plugins/deepin.sh | 10 +++++++ 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 distro-build/deepin.sh create mode 100644 distro-plugins/deepin.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53635c9ed..c9b17e903 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: # Remove distro plugins to filter and upload built distributions and its plugins later on rm -rf ./distro-plugins/* - name: Install Needed Dependencies - run: sudo apt-get update && sudo apt-get install -yq curl debian-archive-keyring jq mmdebstrap qemu-user-static binfmt-support + run: sudo apt-get update && sudo apt-get install -yq curl debian-archive-keyring jq mmdebstrap qemu-user-static binfmt-support multistrap - name: Build distribution rootfs run: | for distros_to_be_built in $(cat ./distributions.txt); do diff --git a/bootstrap-rootfs.sh b/bootstrap-rootfs.sh index 6a33719ba..dccada331 100755 --- a/bootstrap-rootfs.sh +++ b/bootstrap-rootfs.sh @@ -10,7 +10,7 @@ if [ "$(uname -o)" = "Android" ]; then exit 1 fi -for i in curl git jq mmdebstrap sudo tar xz; do +for i in curl git jq mmdebstrap sudo tar xz multistrap; do if [ -z "$(command -v "$i")" ]; then echo "[!] '$i' is not installed." exit 1 diff --git a/distro-build/deepin.sh b/distro-build/deepin.sh new file mode 100644 index 000000000..6828dc8f9 --- /dev/null +++ b/distro-build/deepin.sh @@ -0,0 +1,56 @@ +dist_name="deepin" +dist_version="beige" + +bootstrap_distribution() { + for arch in amd64 arm64; do + mkdir -p ${WORKDIR}/deepin-$(translate_arch "$arch")/etc/apt/trusted.gpg.d + curl --fail --location \ + --output "${WORKDIR}/deepin-$(translate_arch "$arch")/etc/apt/trusted.gpg.d/deepin.gpg" \ + "https://github.com/deepin-community/deepin-rootfs/raw/master/deepin.gpg" + + echo -e "[General]\n\ + arch=$arch\n\ + directory=${WORKDIR}/deepin-$(translate_arch "$arch")/\n\ + cleanup=true\n\ + noauth=false\n\ + unpack=true\n\ + explicitsuite=false\n\ + multiarch=\n\ + aptsources=Debian\n\ + bootstrap=Deepin\n\ + [Deepin]\n\ + packages=apt ca-certificates passwd locales-all\n\ + source=https://community-packages.deepin.com/${dist_version}/\n\ + suite=${dist_version}\n\ + " >/tmp/${dist_version}.multistrap + sudo multistrap -f /tmp/${dist_version}.multistrap + + rm -f "${WORKDIR}"/deepin-$(translate_arch "$arch")/etc/resolv.conf + echo "nameserver 1.1.1.1" > "${WORKDIR}"/deepin-$(translate_arch "$arch")/etc/resolv.conf + echo "en_US.UTF-8 UTF-8" > "${WORKDIR}"/deepin-$(translate_arch "$arch")/etc/locale.gen + echo "deb https://community-packages.deepin.com/${dist_version}/ ${dist_version} main commercial community" > ${WORKDIR}/deepin-$(translate_arch "$arch")/etc/apt/sources.list + echo "deb-src https://community-packages.deepin.com/${dist_version}/ ${dist_version} main commercial community" >> ${WORKDIR}/deepin-$(translate_arch "$arch")/etc/apt/sources.list + + sudo tar -J -c \ + -f "${ROOTFS_DIR}/deepin-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ + -C "$WORKDIR" \ + "deepin-$(translate_arch "$arch")" + sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/deepin-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" + done + unset arch +} + +write_plugin() { + cat <<- EOF > "${PLUGIN_DIR}/deepin.sh" + # This is a default distribution plug-in. + # Do not modify this file as your changes will be overwritten on next update. + # If you want customize installation, please make a copy. + DISTRO_NAME="deepin" + DISTRO_COMMENT="Supports only 64-bit CPUs." + + TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/deepin-aarch64-pd-${CURRENT_VERSION}.tar.xz" + TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/deepin-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" + TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/deepin-x86_64-pd-${CURRENT_VERSION}.tar.xz" + TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/deepin-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" + EOF +} diff --git a/distro-plugins/deepin.sh b/distro-plugins/deepin.sh new file mode 100644 index 000000000..20724284c --- /dev/null +++ b/distro-plugins/deepin.sh @@ -0,0 +1,10 @@ +# This is a default distribution plug-in. +# Do not modify this file as your changes will be overwritten on next update. +# If you want customize installation, please make a copy. +DISTRO_NAME="deepin" +DISTRO_COMMENT="Supports only 64-bit CPUs." + +TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.3.1/deepin-aarch64-pd-v4.3.1.tar.xz" +TARBALL_SHA256['aarch64']="58f9538b5b3f70d845cfe7f8e708b5f79e536612c0f00d39c68ccedd23ef2d76" +TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.3.1/deepin-x86_64-pd-v4.3.1.tar.xz" +TARBALL_SHA256['x86_64']="ce7dc056811483eea352d6ad61bf39296c2eb7281bbb40f76ae0a27300a51f4c"