Skip to content

Commit 2cb6529

Browse files
committed
Added altlinux in distrobox
1 parent 5ad75a0 commit 2cb6529

File tree

4 files changed

+130
-1
lines changed

4 files changed

+130
-1
lines changed

distrobox-generate-entry

+1
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ if [ "${icon}" = "auto" ]; then
302302
DISTRO_ICON_MAP="
303303
alma:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/alma-distrobox.png
304304
alpine:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/alpine-distrobox.png
305+
alt:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/alt-distrobox.png
305306
arch:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/arch-distrobox.png
306307
centos:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/centos-distrobox.png
307308
clear--os:https://raw.githubusercontent.com/89luca89/distrobox/main/docs/assets/png/distros/clear-distrobox.png

distrobox-init

+128-1
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,129 @@ setup_apt()
847847
fi
848848
}
849849

850+
# setup_aptrpm will upgrade or setup all packages for apt-rpm based systems.
851+
# Arguments:
852+
# None
853+
# Expected global variables:
854+
# upgrade: if we need to upgrade or not
855+
# container_additional_packages: additional packages to install during this phase
856+
# Expected env variables:
857+
# None
858+
# Outputs:
859+
# None
860+
setup_aptrpm()
861+
{
862+
setup_rpm_exceptions
863+
864+
# If we need to upgrade, do it and exit, no further action required.
865+
if [ "${upgrade}" -ne 0 ]; then
866+
apt-get update
867+
apt-get dist-upgrade -y
868+
exit
869+
fi
870+
871+
apt-get update
872+
# Check if shell_pkg is available in distro's repo. If not we
873+
# fall back to bash, and we set the SHELL variable to bash so
874+
# that it is set up correctly for the user.
875+
if ! apt-get install -y "${shell_pkg}"; then
876+
shell_pkg="bash"
877+
fi
878+
deps="
879+
${shell_pkg}
880+
apt-repo-tools
881+
apt-rsync
882+
bash-completion
883+
bc
884+
bzip2
885+
curl
886+
cracklib
887+
dialog
888+
diffutils
889+
eepm
890+
findutils
891+
fontconfig
892+
gettext
893+
glibc
894+
glibc-i18ndata
895+
gnupg
896+
gnupg2
897+
iconv
898+
iproute2
899+
iputils
900+
keyutils
901+
less
902+
libcap
903+
libEGL
904+
libGL
905+
libkrb5
906+
libnss-mdns
907+
libnss-myhostname
908+
vte3
909+
libvulkan1
910+
lsof
911+
man-db
912+
mount
913+
mtr
914+
ncurses
915+
openssh-clients
916+
pam
917+
passwd
918+
pigz
919+
pinentry-common
920+
procps
921+
su
922+
sudo
923+
tcpdump
924+
time
925+
traceroute
926+
tree
927+
tzdata
928+
unzip
929+
util-linux
930+
wget
931+
xauth
932+
xorg-dri-intel
933+
xorg-dri-radeon
934+
xorg-utils
935+
xz
936+
zip
937+
"
938+
# shellcheck disable=SC2086,2046
939+
apt-get install -y ${deps}
940+
941+
# Altlinux hooks. Without them the commands su, sudo, sudoreplay and passwd do not work
942+
control passwd traditional
943+
control sudo public
944+
control sudoreplay public
945+
control su wheel
946+
mkdir /etc/tcb/"${container_user_name}"
947+
echo "${container_user_name}::::::::" > /etc/tcb/"${container_user_name}"/shadow
948+
sed -i 's/*//g' /etc/passwd
949+
950+
# In case the locale is not available, install it
951+
# will ensure we don't fallback to C.UTF-8
952+
if [ ! -e /usr/share/i18n/charmaps ]; then
953+
apt-get --reinstall install -y glibc-i18ndata iconv
954+
fi
955+
if ! locale -a | grep -qi en_us.utf8 || ! locale -a | grep -qi "${HOST_LOCALE}"; then
956+
LANG="${HOST_LOCALE}" localedef -i "${HOST_LOCALE_LANG}" -f "${HOST_LOCALE_ENCODING}" "${HOST_LOCALE}"
957+
fi
958+
959+
# Ensure we have tzdata installed and populated, sometimes container
960+
# images blank the zoneinfo directory, so we reinstall the package to
961+
# ensure population
962+
if [ ! -e /usr/share/zoneinfo/UTC ]; then
963+
apt-get --reinstall install -y tzdata
964+
fi
965+
966+
# Install additional packages passed at distrbox-create time
967+
if [ -n "${container_additional_packages}" ]; then
968+
# shellcheck disable=SC2086
969+
apt-get install -y ${container_additional_packages}
970+
fi
971+
}
972+
850973
# setup_dnf will upgrade or setup all packages for dnf/yum based systems.
851974
# Arguments:
852975
# manager: yum or dnf
@@ -1672,7 +1795,11 @@ if [ "${upgrade}" -ne 0 ] ||
16721795
if command -v apk; then
16731796
setup_apk
16741797
elif command -v apt-get; then
1675-
setup_apt
1798+
if ! grep -q "ID=altlinux" /etc/os-release; then
1799+
setup_apt
1800+
else
1801+
setup_aptrpm
1802+
fi
16761803
elif command -v emerge; then
16771804
setup_emerge
16781805
elif command -v pacman; then
31 KB
Loading

docs/compatibility.md

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ Distrobox guests tested successfully with the following container images:
118118
| 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 |
119119
| 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 |
120120
| Archlinux (Toolbox) | | quay.io/toolbx/arch-toolbox:latest |
121+
| Alt Linux | p10 <br> p11 <br> sisyphus | docker.io/library/alt:p10 <br> docker.io/library/alt:p11 <br> docker.io/library/alt:sisyphus |
121122
| Bazzite Arch | | ghcr.io/ublue-os/bazzite-arch:latest <br> ghcr.io/ublue-os/bazzite-arch-gnome:latest |
122123
| 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 |
123124
| 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 |

0 commit comments

Comments
 (0)