Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Chimera support #298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions src/slash-bedrock/share/brl-fetch/distros/chimera
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bedrock/libexec/busybox sh
#
# Chimera Linux bootstrap support
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# Copyright (c) 2016-2019 Daniel Thau <[email protected]>
#

# shellcheck source=src/slash-bedrock/libexec/brl-fetch
. /bedrock/share/common-code
trap 'fetch_abort "Unexpected error occurred."' EXIT

check_supported() {
false
}

speed_test_url() {
echo "current/main/${distro_arch}/APKINDEX.tar.gz"
Copy link

@JamiKettunen JamiKettunen Nov 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If @wezm doesn't mind https://www.wezm.net/v2/posts/2024/australian-chimera-linux-mirror/ could also be handled here even though it's not officially in any docs yet :)

Uh I meant to comment under list_mirrors() but you get the idea :p

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me :-)

}

list_mirrors() {
echo 'https://repo.chimera-linux.org/'
}

brl_arch_to_distro() {
case "${1}" in
"aarch64") echo "aarch64" ;;
"ppc64le") echo "ppc64le" ;;
"ppc64" ) echo "ppc64" ;;
"x86_64") echo "x86_64" ;;
*) abort "brl does not know how to translate arch \"${1}\" to ${distro} format" ;;
esac
}

list_architectures() {
cat <<EOF
aarch64
ppc64le
ppc64
x86_64
EOF
}

default_release() {
echo "rolling"
}

list_releases() {
echo "rolling"
}

fetch() {
step "Downloading bootstrap software"
url="$(find_link "${target_mirror}/apk/" "^apk-${distro_arch}.*.static")"
download "${url}" "${bootstrap_dir}/apk-tools-static.apk"

step "Preparing bootstrap software"
mv "${bootstrap_dir}/apk-tools-static.apk" "${bootstrap_dir}/apk"
chmod a+rx "${bootstrap_dir}/apk"
mkdir -p "${target_dir}/etc/apk/"

step "Running bootstrap software"
setup_chroot "${bootstrap_dir}"
setup_ssl "${bootstrap_dir}"
set +o pipefail
yes "" | LC_ALL=C chroot "${bootstrap_dir}" /apk -X "${target_mirror}/current/main" -U --allow-untrusted --root "/target-root" --initdb add base-minimal
set -o pipefail

step "Configuring"
setup_chroot "${target_dir}"
}