Skip to content

Commit

Permalink
deepin: adjust distribution scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sylirre committed Nov 28, 2023
1 parent afdd570 commit 954d6b4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
36 changes: 19 additions & 17 deletions distro-build/deepin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ dist_version="beige"

bootstrap_distribution() {
for arch in amd64 arm64; do
mkdir -p ${WORKDIR}/deepin-${arch}/etc/apt/trusted.gpg.d
mkdir -p ${WORKDIR}/deepin-$(translate_arch "$arch")/etc/apt/trusted.gpg.d
curl --fail --location \
--output "${WORKDIR}/deepin-${arch}/etc/apt/trusted.gpg.d/deepin.gpg" \
"https://github.com/deepin-community/deepin-rootfs/raw/master/deepin.gpg"
--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-${arch}/\n\
directory=${WORKDIR}/deepin-$(translate_arch "$arch")/\n\
cleanup=true\n\
noauth=false\n\
unpack=true\n\
Expand All @@ -20,20 +20,22 @@ bootstrap_distribution() {
bootstrap=Deepin\n\
[Deepin]\n\
packages=apt ca-certificates passwd locales-all\n\
source=https://community-packages.deepin.com/beige/\n\
suite=beige\n\
" >/tmp/beige.multistrap
sudo multistrap -f /tmp/beige.multistrap
source=https://community-packages.deepin.com/${dist_version}/\n\
suite=${dist_version}\n\
" >/tmp/${dist_version}.multistrap
sudo multistrap -f /tmp/${dist_version}.multistrap

cat <<- EOF | sudo unshare -mpf bash -e -
echo "deb https://community-packages.deepin.com/beige/ beige main commercial community" > ${WORKDIR}/deepin-${arch}/etc/apt/sources.list && \
echo "deb-src https://community-packages.deepin.com/beige/ beige main commercial community" >> ${WORKDIR}/deepin-${arch}/etc/apt/sources.list
echo "en_US.UTF-8 UTF-8" > ${WORKDIR}/deepin-${arch}/etc/locale.gen
EOF
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 -cf ${ROOTFS_DIR}/deepin-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar -C ${WORKDIR}/deepin-${arch} .
sudo chown $(id -un):$(id -gn) "${ROOTFS_DIR}/deepin-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar"
xz "${ROOTFS_DIR}/deepin-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar"
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
}
Expand All @@ -44,7 +46,7 @@ write_plugin() {
# 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="Currently available only AArch64 and x86_64 ports."
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}')"
Expand Down
10 changes: 5 additions & 5 deletions distro-plugins/deepin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# 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="Currently available only AArch64 and x86_64 ports."
DISTRO_COMMENT="Supports only 64-bit CPUs."

TARBALL_URL['aarch64']="https://github.com/chenchongbiao/proot-distro/releases/download/v4.0.2/deepin-aarch64-pd-v4.0.2.tar.xz"
TARBALL_SHA256['aarch64']="ba6aa9c45fc51b4ae33c412c75c2d99f9b12dcf96338b16cf42f2c36fd9018c6"
TARBALL_URL['x86_64']="https://github.com/chenchongbiao/proot-distro/releases/download/v4.0.2/deepin-x86_64-pd-v4.0.2.tar.xz"
TARBALL_SHA256['x86_64']="8db48cf81a2d12032b20fff67d5d171e7616e55c95d89f35254a668e3e47c0fe"
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"

0 comments on commit 954d6b4

Please sign in to comment.