Skip to content

Commit

Permalink
Added altlinux in distrobox
Browse files Browse the repository at this point in the history
  • Loading branch information
Htylol committed Oct 12, 2024
1 parent 5ad75a0 commit 2cb6529
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 1 deletion.
1 change: 1 addition & 0 deletions distrobox-generate-entry
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ if [ "${icon}" = "auto" ]; then
DISTRO_ICON_MAP="
alma:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/alma-distrobox.png
alpine:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/alpine-distrobox.png
alt:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/alt-distrobox.png
arch:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/arch-distrobox.png
centos:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/centos-distrobox.png
clear--os:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/clear-distrobox.png
Expand Down
129 changes: 128 additions & 1 deletion distrobox-init
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,129 @@ setup_apt()
fi
}

# setup_aptrpm will upgrade or setup all packages for apt-rpm based systems.
# Arguments:
# None
# Expected global variables:
# upgrade: if we need to upgrade or not
# container_additional_packages: additional packages to install during this phase
# Expected env variables:
# None
# Outputs:
# None
setup_aptrpm()
{
setup_rpm_exceptions

# If we need to upgrade, do it and exit, no further action required.
if [ "${upgrade}" -ne 0 ]; then
apt-get update
apt-get dist-upgrade -y
exit
fi

apt-get update
# Check if shell_pkg is available in distro's repo. If not we
# fall back to bash, and we set the SHELL variable to bash so
# that it is set up correctly for the user.
if ! apt-get install -y "${shell_pkg}"; then
shell_pkg="bash"
fi
deps="
${shell_pkg}
apt-repo-tools
apt-rsync
bash-completion
bc
bzip2
curl
cracklib
dialog
diffutils
eepm
findutils
fontconfig
gettext
glibc
glibc-i18ndata
gnupg
gnupg2
iconv
iproute2
iputils
keyutils
less
libcap
libEGL
libGL
libkrb5
libnss-mdns
libnss-myhostname
vte3
libvulkan1
lsof
man-db
mount
mtr
ncurses
openssh-clients
pam
passwd
pigz
pinentry-common
procps
su
sudo
tcpdump
time
traceroute
tree
tzdata
unzip
util-linux
wget
xauth
xorg-dri-intel
xorg-dri-radeon
xorg-utils
xz
zip
"
# shellcheck disable=SC2086,2046
apt-get install -y ${deps}

# Altlinux hooks. Without them the commands su, sudo, sudoreplay and passwd do not work
control passwd traditional
control sudo public
control sudoreplay public
control su wheel
mkdir /etc/tcb/"${container_user_name}"
echo "${container_user_name}::::::::" > /etc/tcb/"${container_user_name}"/shadow
sed -i 's/*//g' /etc/passwd

# In case the locale is not available, install it
# will ensure we don't fallback to C.UTF-8
if [ ! -e /usr/share/i18n/charmaps ]; then
apt-get --reinstall install -y glibc-i18ndata iconv
fi
if ! locale -a | grep -qi en_us.utf8 || ! locale -a | grep -qi "${HOST_LOCALE}"; then
LANG="${HOST_LOCALE}" localedef -i "${HOST_LOCALE_LANG}" -f "${HOST_LOCALE_ENCODING}" "${HOST_LOCALE}"
fi

# Ensure we have tzdata installed and populated, sometimes container
# images blank the zoneinfo directory, so we reinstall the package to
# ensure population
if [ ! -e /usr/share/zoneinfo/UTC ]; then
apt-get --reinstall install -y tzdata
fi

# Install additional packages passed at distrbox-create time
if [ -n "${container_additional_packages}" ]; then
# shellcheck disable=SC2086
apt-get install -y ${container_additional_packages}
fi
}

# setup_dnf will upgrade or setup all packages for dnf/yum based systems.
# Arguments:
# manager: yum or dnf
Expand Down Expand Up @@ -1672,7 +1795,11 @@ if [ "${upgrade}" -ne 0 ] ||
if command -v apk; then
setup_apk
elif command -v apt-get; then
setup_apt
if ! grep -q "ID=altlinux" /etc/os-release; then
setup_apt
else
setup_aptrpm
fi
elif command -v emerge; then
setup_emerge
elif command -v pacman; then
Expand Down
Binary file added docs/assets/png/distros/alt-distrobox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Distrobox guests tested successfully with the following container images:
| Alpine (Toolbox) | 3.16 <br> 3.17 <br> 3.18 <br> 3.19 <br> 3.20 <br> edge | quay.io/toolbx-images/alpine-toolbox:3.16 <br> quay.io/toolbx-images/alpine-toolbox:3.17 <br> quay.io/toolbx-images/alpine-toolbox:3.18 <br> quay.io/toolbx-images/alpine-toolbox:3.19 <br> quay.io/toolbx-images/alpine-toolbox:3.20 <br> quay.io/toolbx-images/alpine-toolbox:edge <br> quay.io/toolbx-images/alpine-toolbox:latest |
| AmazonLinux (Toolbox) | 2 <br> 2022 | quay.io/toolbx-images/amazonlinux-toolbox:2 <br> quay.io/toolbx-images/amazonlinux-toolbox:2023 <br> quay.io/toolbx-images/amazonlinux-toolbox:latest |
| Archlinux (Toolbox) | | quay.io/toolbx/arch-toolbox:latest |
| Alt Linux | p10 <br> p11 <br> sisyphus | docker.io/library/alt:p10 <br> docker.io/library/alt:p11 <br> docker.io/library/alt:sisyphus |
| Bazzite Arch | | ghcr.io/ublue-os/bazzite-arch:latest <br> ghcr.io/ublue-os/bazzite-arch-gnome:latest |
| Centos (Toolbox) | stream8 <br> stream9 | quay.io/toolbx-images/centos-toolbox:stream8 <br> quay.io/toolbx-images/centos-toolbox:stream9 <br> quay.io/toolbx-images/centos-toolbox:latest |
| Debian (Toolbox) | 10 <br> 11 <br> 12 <br> testing <br> unstable <br> | quay.io/toolbx-images/debian-toolbox:10 <br> quay.io/toolbx-images/debian-toolbox:11 <br> quay.io/toolbx-images/debian-toolbox:12 <br> quay.io/toolbx-images/debian-toolbox:testing <br> quay.io/toolbx-images/debian-toolbox:unstable <br> quay.io/toolbx-images/debian-toolbox:latest |
Expand Down

0 comments on commit 2cb6529

Please sign in to comment.