Skip to content

Commit

Permalink
Added support CentOS
Browse files Browse the repository at this point in the history
Former-commit-id: 051bca4
  • Loading branch information
meefik committed Dec 25, 2015
1 parent fa12056 commit 60adc23
Show file tree
Hide file tree
Showing 18 changed files with 289 additions and 36 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Changelog (English)

1.5.5
Open a shell from Android Terminal Emulator
Added support CentOS

1.5.4
Fixed a problem with user password that contains uppercase letters
Expand Down Expand Up @@ -323,6 +324,7 @@ Updated list packages of base system installation

1.5.5
Открытие командной оболочки в Android Terminal Emulator
Добавлена поддержка CentOS

1.5.4
Исправлена проблема с установкой пароля, содержащего заглавные буквы
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ The program interface supports English and Russian. You can manage the process o
Installing a new operating system takes about 30 minutes. The recommended minimum size of a disk image is 1024 MB (with LXDE), and without a GUI - 512 MB. When you install Linux on the flash card with the FAT32 file system, the image size should not exceed 4095 MB! After the initial setup the default password for SSH and VNC is changeme. The password can be changed through standard OS tools.

#### Features: ####
* Supported distributions: Debian, Ubuntu, Kali Linux, Arch Linux, Fedora, Gentoo, openSUSE, Slackware, RootFS (tgz, tbz2, txz)
* Supported distributions: Debian, Ubuntu, Kali Linux, Arch Linux, Fedora, CentOS, Gentoo, openSUSE, Slackware, RootFS (tgz, tbz2, txz)
* Installation type: image file, disk partition, RAM, directory
* Supported file systems: ext2, ext3, ext4
* Supported architectures: ARM, ARM64, x86, x86_64, emulation mode (ARM ~ x86)
* Control interface: CLI, SSH, VNC, X, framebuffer
* Desktop environment: XTerm, LXDE, Xfce, GNOME, KDE, other (manual configuration)
* Supported languages: English, Russian, German, French, Italian, Spanish, Chinese, Vietnamese, Slovak
* Supported languages: English, Russian, German, French, Italian, Spanish, Chinese, Vietnamese, Slovak, Portuguese

#### Install ####
You can install the app from Google Play: <https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy>.
Expand Down
4 changes: 2 additions & 2 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Copyright (C) 2012-2015 Антон Скшидлевский, [GPLv3](http://ope
Установка новой ОС занимает около 30 минут. Рекомендованный минимальный размер образа диска без графического интерфейса - 512 МБ, а с графическим интерфейсом - 1024 МБ (для LXDE). При установке ОС в образ на карту памяти с файловой системой FAT32 размер образа не должен превышать 4095 МБ! После начальной установки пароль для доступа по SSH и VNC назначается как "changeme", который можно сменить стандартными средствами ОС.

#### Характеристики: ####
* Поддерживаемые дистрибутивы: Debian, Ubuntu, Kali Linux, Arch Linux, Fedora, Gentoo, openSUSE, Slackware, RootFS (tgz, tbz2, txz)
* Поддерживаемые дистрибутивы: Debian, Ubuntu, Kali Linux, Arch Linux, Fedora, CentOS, Gentoo, openSUSE, Slackware, RootFS (tgz, tbz2, txz)
* Тип установки: файл образа, раздел диска, оперативная память, директория
* Поддерживаемые файловые системы: ext2, ext3, ext4
* Поддерживаемые архитектуры: ARM, ARM64, x86, x86_64, режим эмуляции (ARM ~ x86)
* Интерфейс управления: CLI, SSH, VNC, X, фрейм-буфер
* Окружение рабочего стола: XTerm, LXDE, Xfce, GNOME, KDE, другое (ручная настройка)
* Поддерживаемые языки: русский, английский, немецкий, французский, итальянский, испанский, китайский, вьетнамский, словацкий
* Поддерживаемые языки: русский, английский, немецкий, французский, итальянский, испанский, китайский, вьетнамский, словацкий, португальский

#### Установка ####
Вы можете установить это приложение из Google play: <https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy>.
Expand Down
156 changes: 133 additions & 23 deletions assets/all/share/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -788,19 +788,10 @@ msg -n "$1 ... "
debian|ubuntu|kalilinux)
inet_users="${inet_users} messagebus www-data mysql postgres"
;;
archlinux)
inet_users="${inet_users} dbus"
;;
fedora)
archlinux|fedora|centos)
inet_users="${inet_users} dbus"
;;
opensuse)
inet_users="${inet_users} messagebus"
;;
gentoo)
inet_users="${inet_users} messagebus"
;;
slackware)
opensuse|gentoo|slackware)
inet_users="${inet_users} messagebus"
;;
esac
Expand All @@ -820,7 +811,7 @@ msg -n "$1 ... "
debian|ubuntu|kalilinux)
echo "LANG=${LOCALE}" > "${CHROOT_DIR}/etc/default/locale"
;;
archlinux)
archlinux|centos)
echo "LANG=${LOCALE}" > "${CHROOT_DIR}/etc/locale.conf"
;;
fedora)
Expand Down Expand Up @@ -883,6 +874,19 @@ msg -n "$1 ... "
echo "gpgcheck=0" >> "${repo_file}"
chmod 644 "${repo_file}"
;;
centos)
chroot_exec -u root "yum-config-manager --disable '*'" >/dev/null
local repo="${SOURCE_PATH%/}/${SUITE}/os/${ARCH}"
local repo_file="${CHROOT_DIR}/etc/yum.repos.d/CentOS-${SUITE}-${ARCH}.repo"
echo "[centos-${SUITE}-${ARCH}]" > "${repo_file}"
echo "name=CentOS ${SUITE} - ${ARCH}" >> "${repo_file}"
echo "failovermethod=priority" >> "${repo_file}"
echo "baseurl=${repo}" >> "${repo_file}"
echo "enabled=1" >> "${repo_file}"
echo "metadata_expire=7d" >> "${repo_file}"
echo "gpgcheck=0" >> "${repo_file}"
chmod 644 "${repo_file}"
;;
opensuse)
if [ "${platform}" = "intel" ]
then local repo="${SOURCE_PATH%/}/distribution/${SUITE}/repo/oss/"
Expand Down Expand Up @@ -985,17 +989,15 @@ msg -n "$1 ... "
chown -R ${user_id}:${group_id} "${CHROOT_DIR}${user_home}" || true
;;
dbus)
case "${DISTRIB}" in
debian|ubuntu|kalilinux|archlinux)
if [ -e "${CHROOT_DIR}/run" ]; then
mkdir "${CHROOT_DIR}/run/dbus" || true
chmod 755 "${CHROOT_DIR}/run/dbus"
;;
fedora)
fi
if [ -e "${CHROOT_DIR}/var/run" ]; then
mkdir "${CHROOT_DIR}/var/run/dbus" || true
chmod 755 "${CHROOT_DIR}/var/run/dbus"
chroot_exec dbus-uuidgen > "${CHROOT_DIR}/etc/machine-id"
;;
esac
fi
chroot_exec dbus-uuidgen > "${CHROOT_DIR}/etc/machine-id"
;;
xorg)
# Xwrapper.config
Expand Down Expand Up @@ -1261,6 +1263,48 @@ msg "Installing additional components: "
[ -n "${igrp}" ] && chroot_exec -u root "yum groupinstall "${igrp}" --nogpgcheck --skip-broken -y"
chroot_exec -u root "yum clean all"
;;
centos)
local pkgs=""
local igrp=""
for component in ${USE_COMPONENTS}
do
case "${component}" in
desktop)
pkgs="${pkgs} xorg-x11-server-utils xorg-x11-fonts-misc dejavu-*"
case "${DESKTOP_ENV}" in
xterm)
pkgs="${pkgs} xterm"
;;
lxde)
igrp="lxde-desktop-environment"
;;
xfce)
igrp="xfce-desktop-environment"
;;
gnome)
igrp="gnome-desktop-environment"
;;
kde)
igrp="kde-desktop-environment"
;;
esac
;;
ssh)
pkgs="${pkgs} openssh-server"
;;
vnc)
pkgs="${pkgs} tigervnc-server"
;;
xserver)
pkgs="${pkgs} xorg-x11-xinit xorg-x11-server-Xorg xorg-x11-drv-fbdev xorg-x11-drv-evdev"
;;
esac
done
[ -z "${pkgs}" ] && return 1
chroot_exec -u root "yum install ${pkgs} --nogpgcheck --skip-broken -y"
[ -n "${igrp}" ] && chroot_exec -u root "yum groupinstall "${igrp}" --nogpgcheck --skip-broken -y"
chroot_exec -u root "yum clean all"
;;
opensuse)
local pkgs=""
for component in ${USE_COMPONENTS}
Expand Down Expand Up @@ -1527,10 +1571,7 @@ fedora)
configure_container qemu

msg "Installing base packages: "
chroot_exec /bin/rpm -iv --force --nosignature --nodeps /tmp/*.rpm 1>&3 2>&3

msg -n "Updating packages database ... "
chroot_exec /bin/rpm -i --force --nosignature --nodeps --justdb /tmp/*.rpm
chroot_exec /bin/rpm -iv --force --nosignature --nodeps --justdb /tmp/*.rpm 1>&3 2>&3
[ $? -eq 0 ] && msg "done" || msg "fail"

msg -n "Clearing cache ... "
Expand All @@ -1548,6 +1589,75 @@ fedora)
exit 0) 1>&3 2>&3
[ $? -ne 0 ] && return 1
;;
centos)
msg "Installing CentOS distribution: "

local basic_packages="filesystem audit-libs basesystem bash bzip2-libs ca-certificates centos-release chkconfig coreutils cpio cracklib cracklib-dicts cryptsetup-libs curl cyrus-sasl-lib dbus dbus-libs device-mapper device-mapper-libs diffutils elfutils-libelf elfutils-libs expat file-libs gawk gdbm glib2 glibc glibc-common gmp gnupg2 gpgme grep gzip info keyutils-libs kmod kmod-libs krb5-libs libacl libassuan libattr libblkid libcap libcap-ng libcom_err libcurl libdb libdb-utils libffi libgcc libgcrypt libgpg-error libidn libmount libpwquality libselinux libsemanage libsepol libssh2 libstdc++ libtasn1 libuser libutempter libuuid libverto libxml2 lua ncurses ncurses-base ncurses-libs nspr nss nss-softokn nss-softokn-freebl nss-sysinit nss-tools nss-util openldap openssl-libs p11-kit p11-kit-trust pam pcre pinentry pkgconfig popt pth pygpgme pyliblzma python python-chardet python-iniparse python-kitchen python-libs python-pycurl python-urlgrabber pyxattr qrencode-libs readline rootfiles rpm rpm-build-libs rpm-libs rpm-python sed selinux-policy setup shadow-utils shared-mime-info sqlite sudo systemd systemd-libs tzdata ustr util-linux vim-minimal which xz-libs yum yum-metadata-parser yum-plugin-fastestmirror yum-utils zlib"

local repo="${SOURCE_PATH%/}/${SUITE}/os/${ARCH}"

msg "Repository: ${repo}"

msg -n "Preparing for deployment ... "
(set -e
cd "${CHROOT_DIR}"
mkdir etc
echo "root:x:0:0:root:/root:/bin/bash" > etc/passwd
echo "root:x:0:" > etc/group
touch etc/fstab
mkdir tmp; chmod 01777 tmp
exit 0)
[ $? -eq 0 ] && msg "done" || { msg "fail"; return 1; }

msg -n "Retrieving packages list ... "
local pkg_list="${CHROOT_DIR}/tmp/packages.list"
(set -e
repodata=$(wget -q -O - "${repo}/repodata/repomd.xml" | sed -n '/<location / s/^.*<location [^>]*href="\([^\"]*\-primary\.xml\.gz\)".*$/\1/p')
[ -z "${repodata}" ] && exit 1
wget -q -O - "${repo}/${repodata}" | gzip -dc | sed -n '/<location / s/^.*<location [^>]*href="\([^\"]*\)".*$/\1/p' > "${pkg_list}"
exit 0)
[ $? -eq 0 ] && msg "done" || { msg "fail"; return 1; }

msg "Retrieving base packages: "
for package in ${basic_packages}
do
msg -n "${package} ... "
local pkg_url=$(grep -m1 -e "^.*/${package}-[0-9][0-9\.\-].*\.rpm$" "${pkg_list}")
test "${pkg_url}" || { msg "skip"; continue; }
local pkg_file=$(basename "${pkg_url}")
# download
for i in 1 2 3
do
[ ${i} -gt 1 ] && sleep 30s
wget -q -c -O "${CHROOT_DIR}/tmp/${pkg_file}" "${repo}/${pkg_url}"
[ $? -eq 0 ] && break
done
# unpack
(cd "${CHROOT_DIR}"; rpm2cpio "${CHROOT_DIR}/tmp/${pkg_file}" | cpio -idmu)
[ $? -eq 0 ] && msg "done" || { msg "fail"; return 1; }
done

configure_container qemu

msg "Installing base packages: "
chroot_exec /bin/rpm -iv --force --nosignature --nodeps --justdb /tmp/*.rpm 1>&3 2>&3
[ $? -eq 0 ] && msg "done" || msg "fail"

msg -n "Clearing cache ... "
rm -rf "${CHROOT_DIR}"/tmp/*
[ $? -eq 0 ] && msg "done" || msg "fail"

mount_container

configure_container dns mtab misc groups repository

msg "Installing minimal environment: "
(set -e
chroot_exec -u root 'yum groupinstall "Minimal Install" --nogpgcheck --skip-broken -y --exclude openssh-server'
chroot_exec -u root 'yum clean all'
exit 0) 1>&3 2>&3
[ $? -ne 0 ] && return 1
;;
opensuse)
msg "Installing openSUSE distribution: "

Expand Down
9 changes: 9 additions & 0 deletions res/values-de/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@
<item>X Server</item>
</string-array>

<!-- CentOS -->

<string-array name="centos_components_entries">
<item>Desktop Oberfl&#228;che</item>
<item>SSH Server</item>
<item>VNC Server</item>
<item>X Server</item>
</string-array>

<!-- Arch Linux -->

<string-array name="archlinux_components_entries">
Expand Down
9 changes: 9 additions & 0 deletions res/values-es/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@
<item>X server</item>
</string-array>

<!-- CentOS -->

<string-array name="centos_components_entries">
<item>Ambiente Escritorio</item>
<item>servidor SSH</item>
<item>servidor VNC</item>
<item>X server</item>
</string-array>

<!-- Arch Linux -->

<string-array name="archlinux_components_entries">
Expand Down
9 changes: 9 additions & 0 deletions res/values-fr/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@
<item>Serveur X</item>
</string-array>

<!-- CentOS -->

<string-array name="centos_components_entries">
<item>Environnement Bureau</item>
<item>Serveur SSH</item>
<item>Serveur VNC</item>
<item>Serveur X</item>
</string-array>

<!-- Arch Linux -->

<string-array name="archlinux_components_entries">
Expand Down
9 changes: 9 additions & 0 deletions res/values-it/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@
<item>Server X</item>
</string-array>

<!-- CentOS -->

<string-array name="centos_components_entries">
<item>Ambiente desktop</item>
<item>Server SSH</item>
<item>Server VNC</item>
<item>Server X</item>
</string-array>

<!-- Arch Linux -->

<string-array name="archlinux_components_entries">
Expand Down
9 changes: 9 additions & 0 deletions res/values-pt/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@
<item>Servidor X</item>
</string-array>

<!-- CentOS -->

<string-array name="centos_components_entries">
<item>Ambiente Desktop</item>
<item>Servidor SSH</item>
<item>Servidor VNC</item>
<item>Servidor X</item>
</string-array>

<!-- Arch Linux -->

<string-array name="archlinux_components_entries">
Expand Down
9 changes: 9 additions & 0 deletions res/values-ru/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@
<item>X сервер</item>
</string-array>

<!-- CentOS -->

<string-array name="centos_components_entries">
<item>Окружение рабочего стола</item>
<item>SSH сервер</item>
<item>VNC сервер</item>
<item>X сервер</item>
</string-array>

<!-- Arch Linux -->

<string-array name="archlinux_components_entries">
Expand Down
8 changes: 4 additions & 4 deletions res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<string name="title_activity_mounts">Монтирование</string>
<string name="confirm_start_title">Запустить</string>
<string name="confirm_stop_title">Остановить</string>
<string name="confirm_start_message">Смонтировать GNU/Linux и запустить сервисы?</string>
<string name="confirm_stop_message">Остановить сервисы и размонтировать GNU/Linux?</string>
<string name="confirm_start_message">Смонтировать контейнер и запустить сервисы?</string>
<string name="confirm_stop_message">Остановить сервисы и размонтировать контейнер?</string>
<string name="new_profile_title">Имя профиля</string>
<string name="edit_profile_title">Имя профиля</string>
<string name="import_profile_title">Импортировать профиль</string>
Expand Down Expand Up @@ -68,7 +68,7 @@
<string name="title_appicon_preference">Показывать иконку</string>
<string name="summary_appicon_preference">Отображать значок на панели уведомлений</string>
<string name="title_autostart_preference">Автозапуск</string>
<string name="summary_autostart_preference">Автоматически запускать GNU/Linux при загрузке Android</string>
<string name="summary_autostart_preference">Автоматически запускать контейнер при загрузке Android</string>
<string name="title_terminalcmd_preference">Команда терминала</string>
<string name="dialog_title_terminalcmd_preference">Команда терминала</string>
<string name="env_preferences">Рабочее окружение</string>
Expand Down Expand Up @@ -99,7 +99,7 @@
<string name="summary_reconfigure_preference">Выполнить переконфигурацию GNU/Linux системы</string>
<string name="message_reconfigure_confirm_dialog">Выполнить переконфигурацию GNU/Linux системы?</string>
<string name="title_export_preference">Экспортировать</string>
<string name="summary_export_preference">Экспортировать GNU/Linux как rootfs-архив</string>
<string name="summary_export_preference">Экспортировать контейнер как rootfs-архив</string>
<string name="deploy_preferences">Развертывание</string>
<string name="title_distribution_preference">Дистрибутив</string>
<string name="dialog_title_distribution_preference">Дистрибутив</string>
Expand Down

0 comments on commit 60adc23

Please sign in to comment.