Skip to content

Commit

Permalink
new distribution: openkylin
Browse files Browse the repository at this point in the history
  • Loading branch information
sylirre committed Dec 19, 2023
1 parent e31d014 commit f45e3ae
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions distro-build/openkylin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
dist_name="openkylin"
dist_version="yangtze"

bootstrap_distribution() {
sudo rm -f "${ROOTFS_DIR}"/openkylin-*.tar.xz

curl -LO "http://archive.build.openkylin.top/openkylin/pool/main/o/openkylin-keyring/openkylin-keyring_2022.05.12-ok1_all.deb"
sudo dpkg -i openkylin-keyring_2022.05.12-ok1_all.deb
rm -f openkylin-keyring_2022.05.12-ok1_all.deb

for arch in amd64 arm64; do
sudo rm -rf "${WORKDIR}/openkylin-$(translate_arch "$arch")"
sudo mkdir -m 755 "${WORKDIR}/openkylin-$(translate_arch "$arch")"

sudo mmdebstrap \
--architectures=${arch} \
--variant=minbase \
--components="main,commercial,community" \
--include="apt,ca-certificates,passwd,locales-all" \
--format=directory \
"${dist_version}" \
"${WORKDIR}/openkylin-$(translate_arch "$arch")" \
"http://archive.build.openkylin.top/openkylin/"

cat <<- EOF | sudo unshare -mpf bash -e -
rm -f "${WORKDIR}"/openkylin-$(translate_arch "$arch")/etc/resolv.conf
echo "nameserver 1.1.1.1" > "${WORKDIR}"/openkylin-$(translate_arch "$arch")/etc/resolv.conf
echo "en_US.UTF-8 UTF-8" > "${WORKDIR}"/openkylin-$(translate_arch "$arch")/etc/locale.gen
EOF

archive_rootfs "${ROOTFS_DIR}/openkylin-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \
"openkylin-$(translate_arch "$arch")"
done
unset arch
}

write_plugin() {
cat <<- EOF > "${PLUGIN_DIR}/openkylin.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="openkylin"
DISTRO_COMMENT="Supports only 64-bit CPUs."
TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/openkylin-aarch64-pd-${CURRENT_VERSION}.tar.xz"
TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/openkylin-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')"
TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/openkylin-x86_64-pd-${CURRENT_VERSION}.tar.xz"
TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/openkylin-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')"
EOF
}

0 comments on commit f45e3ae

Please sign in to comment.