diff --git a/.gitignore b/.gitignore index 2323048..29fbc16 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ docker/03-custom.sh *.iso *.xz *.gz -linux-live/initramfs/initramfs.log \ No newline at end of file +linux-live/initramfs/initramfs.log +*.deb \ No newline at end of file diff --git a/buildall b/buildall index a231a72..527d57a 100755 --- a/buildall +++ b/buildall @@ -135,7 +135,7 @@ COMP_TYPE="xz" build # focal xfce -DISTRIBUTION_TYPE="ubuntu" +: 'DISTRIBUTION_TYPE="ubuntu" DISTRIBUTION="focal" DISTRIBUTION_ARCH="amd64" DESKTOP_ENVIRONMENT="xfce" @@ -149,4 +149,4 @@ DISTRIBUTION_ARCH="amd64" DESKTOP_ENVIRONMENT="xfce" PACKAGE_VARIANT="minimal" COMP_TYPE="xz" -build \ No newline at end of file +build' \ No newline at end of file diff --git a/linux-live/basesystem/01-core/install b/linux-live/basesystem/01-core/install index 104c2ab..23d9b04 100644 --- a/linux-live/basesystem/01-core/install +++ b/linux-live/basesystem/01-core/install @@ -73,3 +73,7 @@ $APT_CMD update >>$OUTPUT 2>&1 && if [ $DISTRIBUTION_TYPE = "ubuntu" ]; then $APT_CMD autoremove $APT_OPTIONS linux-modules-extra-* linux-firmware fi + +if [ -f /bin/ping ]; then + chmod +s /bin/ping +fi diff --git a/linux-live/basesystem/01-core/rootcopy-install/root/.bashrc b/linux-live/basesystem/01-core/rootcopy-install/root/.bashrc deleted file mode 100644 index b0879e6..0000000 --- a/linux-live/basesystem/01-core/rootcopy-install/root/.bashrc +++ /dev/null @@ -1,140 +0,0 @@ -# ~/.bashrc: executed by bash(1) for non-login shells. -# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) -# for examples - -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac - -# don't put duplicate lines or lines starting with space in the history. -# See bash(1) for more options -HISTCONTROL=ignoreboth - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# If set, the pattern "**" used in a pathname expansion context will -# match all files and zero or more directories and subdirectories. -#shopt -s globstar - -# make less more friendly for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -# set a fancy prompt (non-color, unless we know we "want" color) -case "$TERM" in - xterm-color|*-256color) color_prompt=yes;; -esac - -# uncomment for a colored prompt, if the terminal has the capability; turned -# off by default to not distract the user: the focus in a terminal window -# should be on the output of commands, not on the prompt -#force_color_prompt=yes - -if [ -n "$force_color_prompt" ]; then - if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes - else - color_prompt= - fi -fi - -if [ "$color_prompt" = yes ]; then - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' -else - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' -fi -unset color_prompt force_color_prompt - -# If this is an xterm set the title to user@host:dir -case "$TERM" in -xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -*) - ;; -esac - -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - #alias dir='dir --color=auto' - #alias vdir='vdir --color=auto' - - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' -fi - -# colored GCC warnings and errors -#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' - -# some more ls aliases -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' - -# Add an "alert" alias for long running commands. Use like so: -# sleep 10; alert -alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' - -# Alias definitions. -# You may want to put all your additions into a separate file like -# ~/.bash_aliases, instead of adding them here directly. -# See /usr/share/doc/bash-doc/examples in the bash-doc package. - -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi - -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if ! shopt -oq posix; then - if [ -f /usr/share/bash-completion/bash_completion ]; then - . /usr/share/bash-completion/bash_completion - elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion - fi -fi - -apt-get() -{ - if [ -e /var/cache/apt/pkgcache.bin ]; then - /usr/bin/apt-get "$@" - else - /usr/bin/apt-get update - /usr/bin/apt-get "$@" - fi -} - -apt() -{ - if [ -e /var/cache/apt/pkgcache.bin ]; then - /usr/bin/apt "$@" - else - /usr/bin/apt update - /usr/bin/apt "$@" - fi -} - -export -f apt-get -export -f apt \ No newline at end of file diff --git a/linux-live/basesystem/01-core/rootcopy-install/usr/lib/minioslib b/linux-live/basesystem/01-core/rootcopy-install/usr/lib/minioslib index 27831a8..005231c 100644 --- a/linux-live/basesystem/01-core/rootcopy-install/usr/lib/minioslib +++ b/linux-live/basesystem/01-core/rootcopy-install/usr/lib/minioslib @@ -258,6 +258,7 @@ remove_broken_links() { } function add_chroot_configuration_files() { + set +u cat <$1/$LIVEKITNAME.conf OUTPUT=$OUTPUT LOGPATH=$LOGPATH @@ -375,6 +376,7 @@ remove_broken_links() { find "$1" -type l -exec test ! -e {} \; -print | xargs rm -vf } EOF + set -u } function remove_chroot_configuration_files() { diff --git a/linux-live/basesystem/01-core/standard.list b/linux-live/basesystem/01-core/standard.list index f8c9cc5..ad1ca75 100644 --- a/linux-live/basesystem/01-core/standard.list +++ b/linux-live/basesystem/01-core/standard.list @@ -47,4 +47,5 @@ xfsprogs cifs-utils nfs-common davfs2 -open-vm-tools \ No newline at end of file +open-vm-tools +usbutils \ No newline at end of file diff --git a/linux-live/buildconfig b/linux-live/buildconfig index 7b92045..965a99c 100644 --- a/linux-live/buildconfig +++ b/linux-live/buildconfig @@ -16,7 +16,7 @@ DISTRIBUTION_ARCH=amd64 # окружение рабочего стола # desktop environment -DESKTOP_ENVIRONMENT=slax-firefox +DESKTOP_ENVIRONMENT=slax # тип сжатия # compresssion type diff --git a/linux-live/minioslib b/linux-live/minioslib index 5ad0ce8..6fb6b1b 100644 --- a/linux-live/minioslib +++ b/linux-live/minioslib @@ -23,6 +23,9 @@ function common_variables() { if [ -z $CLOUD ]; then CLOUD=false fi + if [ -z $MODULE ]; then + MODULE="" + fi set -u : 'if [ -f /.dockerenv ] || [ "$container" = "podman" ]; then OUTPUT="/dev/stdout" @@ -788,8 +791,8 @@ function get_vars() { set +u add_chroot_configuration_files $1 . /functions - read_config /$LIVEKITNAME.conf OUTPUT LOGPATH BUILD_TEST_ISO CREATE_BACKUP DEBIAN_FRONTEND_TYPE APT_CMD APT_OPTIONS DESKTOP_ENVIRONMENT DISTRIBUTION DISTRIBUTION_TYPE PACKAGE_VARIANT COMP_TYPE KERNEL_ARCH LIVEKITNAME SYSTEMNAME DISTRIBUTION_ARCH - export OUTPUT LOGPATH BUILD_TEST_ISO CREATE_BACKUP DEBIAN_FRONTEND_TYPE APT_CMD APT_OPTIONS DESKTOP_ENVIRONMENT DISTRIBUTION DISTRIBUTION_TYPE PACKAGE_VARIANT COMP_TYPE KERNEL_ARCH LIVEKITNAME SYSTEMNAME DISTRIBUTION_ARCH + read_config /$LIVEKITNAME.conf OUTPUT LOGPATH BUILD_TEST_ISO CREATE_BACKUP DEBIAN_FRONTEND_TYPE APT_CMD APT_OPTIONS DESKTOP_ENVIRONMENT DISTRIBUTION DISTRIBUTION_TYPE PACKAGE_VARIANT COMP_TYPE KERNEL_ARCH LIVEKITNAME SYSTEMNAME DISTRIBUTION_ARCH MODULE + export OUTPUT LOGPATH BUILD_TEST_ISO CREATE_BACKUP DEBIAN_FRONTEND_TYPE APT_CMD APT_OPTIONS DESKTOP_ENVIRONMENT DISTRIBUTION DISTRIBUTION_TYPE PACKAGE_VARIANT COMP_TYPE KERNEL_ARCH LIVEKITNAME SYSTEMNAME DISTRIBUTION_ARCH MODULE set -u } @@ -798,8 +801,8 @@ function chroot_run() { add_chroot_configuration_files $1 chroot $1 /bin/bash < 3 ]]; then help; fi - -# loop through args -dash_flag=false -start_index=0 -end_index=${#CMD[*]} -for ii in "$@"; do - if [[ $ii == "-" ]]; then - dash_flag=true - continue - fi - find_index $ii - if [[ $dash_flag == false ]]; then - start_index=$index - else - end_index=$(($index + 1)) - fi -done -if [[ $dash_flag == false ]]; then - end_index=$(($start_index + 1)) -fi - -#loop through the commands -for ((ii = $start_index; ii < $end_index; ii++)); do - ${CMD[ii]} -done - -echo -e "${BOLD}${LIGHTYELLOW}$0${ENDCOLOUR} - ${LIGHTGREEN}Command completed successfully!${ENDCOLOUR}" diff --git a/minios-modules/usr/bin/minios-install b/minios-modules/usr/bin/minios-install deleted file mode 100755 index 88a4150..0000000 --- a/minios-modules/usr/bin/minios-install +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -e # exit on error -set -o pipefail # exit on pipeline error -set -u # treat unset variable as error - -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" -PARENT_DIR="$(dirname "$SCRIPT_DIR")" -CURRENT_DIR="$(pwd)" -ISO_DIR=$CURRENT_DIR/iso -TMP_DIR="/tmp/" - -if [ -f $SCRIPT_DIR/minioslib ]; then - . $SCRIPT_DIR/minioslib || exit 1 -else - . /usr/lib/minioslib || exit 1 -fi -if [ -f $SCRIPT_DIR/config ]; then - . $SCRIPT_DIR/config || exit 1 -elif [ -f /etc/minios/config ]; then - . /etc/minios/config || exit 1 -else - . /run/initramfs/lib/config || exit 1 -fi -if [ -f $CURRENT_DIR/config ]; then - . $CURRENT_DIR/config -fi - -# don't change! use ./autoinstall instead -UNATTENDED="0" - -CMD=(build_modules repack_system) - -# ============= main ================ - -BUILD_DIR="" - -common_variables - -console_colours - -allow_root_only - -create_completion - -# check number of args -if [[ $# == 0 || $# > 3 ]]; then help; fi - -# loop through args -dash_flag=false -start_index=0 -end_index=${#CMD[*]} -for ii in "$@"; do - if [[ $ii == "-" ]]; then - dash_flag=true - continue - fi - find_index $ii - if [[ $dash_flag == false ]]; then - start_index=$index - else - end_index=$(($index + 1)) - fi -done -if [[ $dash_flag == false ]]; then - end_index=$(($start_index + 1)) -fi - -#loop through the commands -for ((ii = $start_index; ii < $end_index; ii++)); do - ${CMD[ii]} -done - -echo -e "${BOLD}${LIGHTYELLOW}$0${ENDCOLOUR} - ${LIGHTGREEN}Command completed successfully!${ENDCOLOUR}" diff --git a/minios-modules/usr/bin/minios-modules-build b/minios-modules/usr/bin/minios-modules-build deleted file mode 100755 index 296bd09..0000000 --- a/minios-modules/usr/bin/minios-modules-build +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -minios-autoinstall build_modules \ No newline at end of file diff --git a/minios-modules/usr/bin/minios-system-repack b/minios-modules/usr/bin/minios-system-repack deleted file mode 100755 index 7b7c226..0000000 --- a/minios-modules/usr/bin/minios-system-repack +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -minios-autoinstall repack_system \ No newline at end of file diff --git a/minios-modules/usr/lib/minioslib b/minios-modules/usr/lib/minioslib deleted file mode 100644 index 86da345..0000000 --- a/minios-modules/usr/lib/minioslib +++ /dev/null @@ -1,832 +0,0 @@ -#!/bin/bash - -# Functions library :: for install scripts -# Author: crims0n. -# - -# ================================================================= -# ================================================================= -# ========================= VARIABLES ============================= -# ================================================================= -# ================================================================= - -function common_variables() { - if [ $DISTRIBUTION_ARCH = "amd64" ]; then - KERNEL_ARCH="amd64" - #PACKAGE_VARIANT="standard" - elif [ $DISTRIBUTION_ARCH = "i386" ]; then - KERNEL_ARCH="686-pae" - #PACKAGE_VARIANT="minimal" - elif [ $DISTRIBUTION_ARCH = "arm64" ]; then - KERNEL_ARCH="arm64" - fi -} - -# ================================================================= -# ================================================================= -# ===================== COMMON FUNCTIONS ========================== -# ================================================================= -# ================================================================= - -function current_process() { - echo -e "${LIGHTYELLOW}=====> running ${CYAN}${CMD[ii]}${ENDCOLOUR}${LIGHTYELLOW} ...${ENDCOLOUR}" -} - -# ================================================================= -# beautiful console -# красивая консоль -# ================================================================= -function console_colours() { - RED="\e[31m" - GREEN="\e[32m" - YELLOW="\e[33m" - BLUE="\e[34m" - MAGENTA="\e[35m" - CYAN="\e[36m" - LIGHTGRAY="\e[37m" - DARKGRAY="\e[90m" - LIGHTRED="\e[91m" - LIGHTGREEN="\e[92m" - LIGHTYELLOW="\e[93m" - LIGHTBLUE="\e[94m" - LIGHTMAGENTA="\e[95m" - LIGHTCYAN="\e[96m" - BOLD="\e[1m" - DIM="\e[2m" - UNDERLINED="\e[4m" - BLINK="\e[5m" - REVERSE="\e[7m" - HIDDEN="\e[8m" - ENDCOLOUR="\e[0m" -} - -# ================================================================= -# help functions -# функции помощи -# ================================================================= -function help() { - # if $1 is set, use $1 as headline message in help() - if [ -f /etc/default/locale ]; then - if grep -q 'LANG="ru_RU.UTF-8"' /etc/default/locale >>$OUTPUT; then - if [ -z ${1+x} ]; then - echo -e "${LIGHTYELLOW}Этот скрипт собирает модули для $SYSTEMNAME.${ENDCOLOUR}" - echo -e - else - echo -e $1 - echo - fi - echo -e "Поддерживаемые команды : ${CYAN}${CMD[*]}${ENDCOLOUR}" - echo -e - echo -e "Синтаксис: ${MAGENTA}$0${ENDCOLOUR} [start_cmd] [-] [end_cmd]" - if [ -L /usr/bin/$LIVEKITNAME-install ] && [ "$0" != "/usr/bin/$LIVEKITNAME-install" ]; then - echo -e "\t${CYAN}$LIVEKITNAME-install${ENDCOLOUR} [start_cmd] [-] [end_cmd]" - fi - echo -e "\tзапуск от start_cmd до end_cmd" - echo -e "\tесли start_cmd опущен, выполняются все команды, начиная с первой" - echo -e "\tесли end_cmd опущен, выполняются все команды до последней" - echo -e "\tвведите одну команду, чтобы запустить определенную команду" - echo -e "\tвведите '-' как единственный аргумент для запуска всех команд" - echo -e "\t" - echo -e "\tСкрипты установки должны находиться в папке с именем будущего модуля." - echo -e "\tНапример, чтобы собрать модуль с именем 06-vscode, скрипты сборки" - echo -e "\tдолжны находиться по следующему пути: ${LIGHTYELLOW}$CURRENT_DIR/modules/06-vscode${ENDCOLOUR}" - echo -e "\tПримеры:" - echo -e "\t${LIGHTYELLOW}$0 build_modules${ENDCOLOUR} сборка модулей" - echo -e "\t${LIGHTYELLOW}$0 repack_system${ENDCOLOUR} перепаковка системы с типом сжатия, указанным" - echo -e "\tв /etc/$LIVEKITNAME/config в переменной COMP_TYPE" - echo -e "\t${LIGHTYELLOW}$0 -${ENDCOLOUR} эта команда запустит обе функции поочерёдно" - exit 0 - else - if [ -z ${1+x} ]; then - echo -e "${LIGHTYELLOW}This script builds modules for $SYSTEMNAME.${ENDCOLOUR}" - echo -e - else - echo -e $1 - echo - fi - echo -e "Supported commands : ${CYAN}${CMD[*]}${ENDCOLOUR}" - echo -e - echo -e "Syntax: ${MAGENTA}$0${ENDCOLOUR} [start_cmd] [-] [end_cmd]" - if [ -L /usr/bin/$LIVEKITNAME-install ] && [ "$0" != "/usr/bin/$LIVEKITNAME-install" ]; then - echo -e "\t${CYAN}$LIVEKITNAME-install${ENDCOLOUR} [start_cmd] [-] [end_cmd]" - fi - echo -e "\trun from start_cmd to end_cmd" - echo -e "\tif start_cmd is omitted, start from first command" - echo -e "\tif end_cmd is omitted, end with last command" - echo -e "\tenter single cmd to run the specific command" - echo -e "\tenter '-' as only argument to run all commands" - echo -e "\t" - echo -e "\tThe installation scripts must be in the folder with the" - echo -e "\tname of the future module. For example, to build a module" - echo -e "\tnamed 06-vscode, build scripts should be in the following" - echo -e "\tpath: ${LIGHTYELLOW}$CURRENT_DIR/modules/06-vscode${ENDCOLOUR}" - echo -e "\tExamples:" - echo -e "\t${LIGHTYELLOW}$0 build_modules ${ENDCOLOUR} build modules" - echo -e "\t${LIGHTYELLOW}$0 repack_system ${ENDCOLOUR} repack the system with the" - echo -e "\tcompression type specified by /etc/$LIVEKITNAME/config in COMP_TYPE variable" - echo -e "\t${LIGHTYELLOW}$0 - ${ENDCOLOUR} this command will run both functions alternately" - exit 0 - fi - fi -} - -# ================================================================= -# parsing input commands -# разбор входных команд -# ================================================================= -function find_index() { - local ret - local i - for ((i = 0; i < ${#CMD[*]}; i++)); do - if [ "${CMD[i]}" == "$1" ]; then - index=$i - return - fi - done - help "Command not found : $1" -} - -# ================================================================= -# creating a symbolic link to the executable file for using -# autocompletion on the command line -# создание символической ссылки на исполняемый файл для -# использования автодополнения в командной строке -# ================================================================= -function create_livekitname_install_symlink() { - if [ -L /usr/bin/$LIVEKITNAME-install ]; then - if [ "$(readlink /usr/bin/$LIVEKITNAME-install)" != "$SCRIPT_DIR/install" ]; then - rm -f /usr/bin/$LIVEKITNAME-install - ln -s $SCRIPT_DIR/install /usr/bin/$LIVEKITNAME-install - if grep 'LANG="ru_RU.UTF-8"' /etc/default/locale >>$OUTPUT; then - echo -e "Символическая ссылка ${MAGENTA}/usr/bin/$LIVEKITNAME-install${ENDCOLOUR} была обновлена." - echo -e "Теперь она указывает на ${MAGENTA}$SCRIPT_DIR/install${ENDCOLOUR}." - else - echo -e "The ${MAGENTA}/usr/bin/$LIVEKITNAME-install${ENDCOLOUR} symbolic link has been updated." - echo -e "It now points to ${MAGENTA}$SCRIPT_DIR/install${ENDCOLOUR}." - fi - fi - if [ "$0" != "/usr/bin/$LIVEKITNAME-install" ]; then - if grep 'LANG="ru_RU.UTF-8"' /etc/default/locale >>$OUTPUT; then - echo -e "Вы можете использовать команду ${CYAN}$LIVEKITNAME-install${ENDCOLOUR} для запуска этой программы." - else - echo -e "You can use the ${CYAN}$LIVEKITNAME-install${ENDCOLOUR} command to run this program." - fi - fi - else - ln -s $SCRIPT_DIR/install /usr/bin/$LIVEKITNAME-install - if grep 'LANG="ru_RU.UTF-8"' /etc/default/locale >>$OUTPUT; then - echo -e "Символическая ссылка ${MAGENTA}/usr/bin/$LIVEKITNAME-install${ENDCOLOUR} была добавлена" - echo -e "для ${MAGENTA}$SCRIPT_DIR/install${ENDCOLOUR}." - - else - echo -e "The ${MAGENTA}/usr/bin/$LIVEKITNAME-install${ENDCOLOUR} symbolic link has been added" - echo -e "for ${MAGENTA}$SCRIPT_DIR/install${ENDCOLOUR}." - fi - fi -} - -# ================================================================= -# creating autocompletion on the command line -# создание автодополнения в командной строке -# ================================================================= -function create_completion() { - if [ -d /etc/bash_completion.d ]; then - if [ ! -f /etc/bash_completion.d/$LIVEKITNAME-install ] || ! grep "${CMD[*]}" /etc/bash_completion.d/$LIVEKITNAME-install >>$OUTPUT; then - cat </etc/bash_completion.d/$LIVEKITNAME-install -#/usr/bin/env bash -complete -W "${CMD[*]}" $LIVEKITNAME-install -EOF - fi - if [ "$0" != "/usr/bin/$LIVEKITNAME-install" ]; then - if grep 'LANG="ru_RU.UTF-8"' /etc/default/locale >>$OUTPUT; then - echo -e "Дополнение команд работает только при использовании команды ${CYAN}$LIVEKITNAME-install${ENDCOLOUR}." - echo -e - else - echo -e "Command completion only works when using the ${CYAN}$LIVEKITNAME-install${ENDCOLOUR} command." - echo -e - fi - fi - fi -} - -# ================================================================= -# only allow 'root' to run the script -# разрешаем запуск скрипта только пользователю 'root' -# ================================================================= - -function allow_root_only() { - if [ $(id -u) -ne 0 ]; then - echo -e "${BOLD}${RED}This script should be run as 'root'!${ENDCOLOUR}" - exit 1 - fi - - export HOME=/root - export LC_ALL=C -} - -# ================================================================= -# check that we are inside chroot -# проверяем, что мы внутри chroot -# ================================================================= - -function check_is_in_chroot() { - if [ $(stat -c %i /)="2" ]; then - echo -e "${BOLD}${RED}This script should be run inside chroot only!${ENDCOLOUR}" - exit 1 - fi -} - -# Unzip gzipped files (man pages), so LZMA can compress 2times better. -# First we fix symlinks, then uncompress files -# $1 = search directory -uncompress_files() { - local LINK LINE - - find "$1" -type l -name "*.gz" | while read LINE; do - LINK="$(readlink "$LINE" | sed -r 's/.gz$//')" - FILE="$(echo "$LINE" | sed -r 's/.gz$//')" - ln -sfn "$LINK" "$FILE" - rm -f "$LINE" - done - find "$1" -type f -name "*.gz" | xargs -r gunzip -} - -# remove broken links -# $1 = search directory -remove_broken_links() { - find "$1" -type l -exec test ! -e {} \; -print | xargs rm -vf -} - -function add_chroot_configuration_files() { - cat <$1/$LIVEKITNAME.conf -OUTPUT=$OUTPUT -LOGPATH=$LOGPATH -BUILD_TEST_ISO=$BUILD_TEST_ISO -CREATE_BACKUP=$CREATE_BACKUP -DEBIAN_FRONTEND_TYPE=$DEBIAN_FRONTEND_TYPE -APT_CMD=$APT_CMD -APT_OPTIONS=$APT_OPTIONS -LIVE_TYPE=$LIVE_TYPE -DISTRIBUTION=$DISTRIBUTION -DISTRIBUTION_TYPE=$DISTRIBUTION_TYPE -PACKAGE_VARIANT=$PACKAGE_VARIANT -COMP_TYPE=$COMP_TYPE -KERNEL_ARCH=$KERNEL_ARCH -USER_NAME=$USER_NAME -EOF - - cat <<'EOF' >$1/functions -#!/bin/bash - -# ================================================================= -# beautiful console -# красивая консоль -# ================================================================= -function console_colours() { - RED="\e[31m" - GREEN="\e[32m" - YELLOW="\e[33m" - BLUE="\e[34m" - MAGENTA="\e[35m" - CYAN="\e[36m" - LIGHTGRAY="\e[37m" - DARKGRAY="\e[90m" - LIGHTRED="\e[91m" - LIGHTGREEN="\e[92m" - LIGHTYELLOW="\e[93m" - LIGHTBLUE="\e[94m" - LIGHTMAGENTA="\e[95m" - LIGHTCYAN="\e[96m" - BOLD="\e[1m" - DIM="\e[2m" - UNDERLINED="\e[4m" - BLINK="\e[5m" - REVERSE="\e[7m" - HIDDEN="\e[8m" - ENDCOLOUR="\e[0m" -} - -# ================================================================= -# reading configuration file -# чтение конфигурационного файла -# ================================================================= - -function read_config() { # read_config file.cfg var_name1 var_name2 - # ref: https://stackoverflow.com/a/20815951 - - shopt -s extglob # needed the "one of these"-match below - local configfile="${1?No configuration file given}" - local keylist="${@:2}" # positional parameters 2 and following - - if [[ ! -f "$configfile" ]]; then - echo >&2 "\"$configfile\" is not a file!" - exit 1 - fi - if [[ ! -r "$configfile" ]]; then - echo >&2 "\"$configfile\" is not readable!" - exit 1 - fi - - keylist="${keylist// /|}" # this will generate a regex 'one of these' - - # lhs : "left hand side" : Everything left of the '=' - # rhs : "right hand side": Everything right of the '=' - # - # "lhs" will hold the name of the key you want to read. - # The value of "rhs" will be assigned to that key. - while IFS='= ' read -r lhs rhs; do - # IF lhs in keylist - # AND rhs not empty - if [[ "$lhs" =~ ^($keylist)$ ]] && [[ -n $rhs ]]; then - rhs="${rhs%\"*}" # Del opening string quotes - rhs="${rhs#\"*}" # Del closing string quotes - rhs="${rhs%\'*}" # Del opening string quotes - rhs="${rhs#\'*}" # Del closing string quotes - eval $lhs=\"$rhs\" # The magic happens here - fi - # tr used as a safeguard against dos line endings - done <<<$(tr -d '\r' <$configfile) - - shopt -u extglob # Switching it back off after use -} -EOF -} - -function chroot_run() { - echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." - - add_chroot_configuration_files $1 - chroot $1 /bin/bash < the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." - if grep -qs "$MODULE_MERGED_DIR" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/dev" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/run" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/proc" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/sys" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/dev/pts" /proc/mounts || grep -qs "$MODULE_MERGED_DIR/tmp" /proc/mounts; then - echo -e "${BOLD}${LIGHTYELLOW}Chroot contains mounted filesystems.${ENDCOLOUR}" - if [ "$UNATTENDED" = "1" ]; then - module_chroot_umount_fs - else - read -r -p "$(echo -e ""Do you want to ${GREEN}unmount them${ENDCOLOUR}? [${BOLD}${GREEN}Y${ENDCOLOUR}/n])" response - response=${response,,} - if [[ "$response" =~ ^(no|n)$ ]]; then - exit 1 - else - module_chroot_umount_fs - fi - fi - fi -} - -# ================================================================= -# -# -# ================================================================= -function module_check_build_dir() { - echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." - if [ "$UNATTENDED" = "1" ]; then - #echo -e "${RED}!!!Unattended installation!!!${ENDCOLOUR}" - echo -e "The working directory is ${MAGENTA}$MODULE_UPPER_DIR${ENDCOLOUR}." - if [ "$(ls -A $MODULE_UPPER_DIR)" != "" ]; then - module_cleanup - module_check_mounted - fi - else - # ▼ должно быть только перенаправление ошибки! - if [ "$(ls -A $MODULE_UPPER_DIR)" != "" ]; then - echo -e "${MAGENTA}$MODULE_UPPER_DIR${ENDCOLOUR} is not empty." - module_cleanup - module_check_mounted - echo -e "The working directory is ${MAGENTA}$MODULE_MERGED_DIR${ENDCOLOUR}." - else - module_check_mounted - echo -e "The working directory is ${MAGENTA}$MODULE_MERGED_DIR${ENDCOLOUR}." - fi - fi -} - -# ================================================================= -# -# -# ================================================================= -function module_chroot_mount_fs() { - echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." - - local MODULES MODULE_LOWER_DIR - - module_check_mounted - - mkdir -p $MODULES_DIR - mount -t tmpfs none $MODULES_DIR - - MODULES_LIST="" - MODULES=(/run/initramfs/memory/bundles/*.$BEXT) - for ((i = ${#MODULES[@]} - 1; i >= 0; i--)); do - MODULE_LOWER_DIR=$(basename ${MODULES[$i]} .$BEXT) - mkdir -p $MODULES_DIR/lower/$MODULE_LOWER_DIR-lower - mount -o bind ${MODULES[$i]} $MODULES_DIR/lower/$MODULE_LOWER_DIR-lower - MODULES_LIST=$MODULES_LIST":""$MODULES_DIR/lower/$MODULE_LOWER_DIR-lower" - done - MODULES_LIST=${MODULES_LIST:1} - - mkdir -p $MODULE_UPPER_DIR $MODULE_WORK_DIR $MODULE_MERGED_DIR - - mount -t overlay overlay -o lowerdir=$MODULES_LIST,upperdir=$MODULE_UPPER_DIR,workdir=$MODULE_WORK_DIR $MODULE_MERGED_DIR - - if [ ! -d $MODULE_MERGED_DIR/dev ]; then - mkdir -p $MODULE_MERGED_DIR/dev - fi - if [ ! -d $MODULE_MERGED_DIR/run ]; then - mkdir -p $MODULE_MERGED_DIR/run - fi - if [ ! -d $MODULE_MERGED_DIR/proc ]; then - mkdir -p $MODULE_MERGED_DIR/proc - fi - if [ ! -d $MODULE_MERGED_DIR/sys ]; then - mkdir -p $MODULE_MERGED_DIR/sys - fi - if [ ! -d $MODULE_MERGED_DIR/tmp ]; then - mkdir -p $MODULE_MERGED_DIR/tmp - fi - - mount --bind /dev $MODULE_MERGED_DIR/dev - - echo "nameserver 8.8.8.8" >$MODULE_MERGED_DIR/etc/resolv.conf - - mount none -t proc $MODULE_MERGED_DIR/proc - mount none -t sysfs $MODULE_MERGED_DIR/sys - mount none -t devpts $MODULE_MERGED_DIR/dev/pts - mount none -t tmpfs $MODULE_MERGED_DIR/tmp -} - -# ================================================================= -# -# -# ================================================================= -function module_chroot_umount_fs() { - echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." - - local MODULES MODULE_LOWER_DIR - - set +e - if [ $OUTPUT = "/dev/stdout" ] && [ ! -f /dev/stdout ]; then - umount $MODULE_MERGED_DIR/proc - umount $MODULE_MERGED_DIR/sys - umount $MODULE_MERGED_DIR/dev/pts - umount $MODULE_MERGED_DIR/tmp - umount $MODULE_MERGED_DIR/dev - - rm -f $MODULE_UPPER_DIR/etc/resolv.conf - - umount $MODULE_MERGED_DIR - - umount $MODULES_DIR/lower/* - - umount $MODULES_DIR - else - umount $MODULE_MERGED_DIR/proc >>$OUTPUT 2>&1 - umount $MODULE_MERGED_DIR/sys >>$OUTPUT 2>&1 - umount $MODULE_MERGED_DIR/dev/pts >>$OUTPUT 2>&1 - umount $MODULE_MERGED_DIR/tmp >>$OUTPUT 2>&1 - umount $MODULE_MERGED_DIR/dev >>$OUTPUT 2>&1 - - rm -f $MODULE_UPPER_DIR/etc/resolv.conf >>$OUTPUT 2>&1 - - umount $MODULE_MERGED_DIR >>$OUTPUT 2>&1 - - umount $MODULES_DIR/lower/* >>$OUTPUT 2>&1 - - umount $MODULES_DIR >>$OUTPUT 2>&1 - fi - - set -e - - module_check_mounted -} - -# ================================================================= -# -# -# ================================================================= -function module_cleanup() { - echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." - if [ "$UNATTENDED" = "1" ]; then - module_check_mounted - rm -rf $MODULE_UPPER_DIR - if [ -d "$MODULE_UPPER_DIR" ]; then - module_cleanup - fi - else - read -r -p "$(echo -e ""Do you want to ${BOLD}${RED}completely remove content${ENDCOLOUR} of ${MAGENTA}$MODULE_UPPER_DIR${ENDCOLOUR}? [y/${BOLD}${GREEN}N${ENDCOLOUR}])" response - response=${response,,} - if [[ "$response" =~ ^(yes|y)$ ]]; then - module_check_mounted - rm -rf $MODULE_UPPER_DIR - if [ -d "$MODULE_UPPER_DIR" ]; then - module_cleanup - fi - else - echo -e "${MAGENTA}$MODULE_UPPER_DIR${ENDCOLOUR} should be empty to continue." - exit 1 - fi - fi -} - -# ================================================================= -# -# -# ================================================================= -function module_chroot_finish_up() { - echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." - - chroot $MODULE_MERGED_DIR /bin/bash -x <>$OUTPUT 2>&1 - dpkg-divert --rename --remove /sbin/initctl >>$OUTPUT 2>&1 -EOF - fi - - if [ -d $MODULE_UPPER_DIR/home/live ]; then - chown 1000:1000 $MODULE_UPPER_DIR/home/live - chown -R 1000:1000 $MODULE_UPPER_DIR/home/live - fi -} - -function chroot_cleanup() { - echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." - - set +eu - rm -f $1/functions - rm -f $1/$LIVEKITNAME.conf - rm -f $1/preinstall - rm -f $1/install - rm -f $1/install2 - rm -f $1/cleanup - rm -f $1/$PACKAGE_VARIANT.list - rm -f $1/postinstall - rm -rf $1/rootcopy-install - rm -rf $1/rootcopy - rm -rf $1/patches - - rm -f $1/etc/fstab - rm -f $1/etc/mtab - rm -f $1/etc/apt/sources.list~ - rm -Rf $1/etc/systemd/system/timers.target.wants - rm -f $1/etc/systemd/system/multi-user.target.wants/ssh.service - rm -f $1/etc/systemd/system/multi-user.target.wants/dnsmasq.service - - rm -f $1/etc/ssh/ssh_host* - - rm -f $1/var/backups/* - rm -f $1/var/cache/ldconfig/* - rm -f $1/var/cache/debconf/* - rm -f $1/var/cache/fontconfig/* - rm -f $1/var/lib/apt/extended_states - rm -f $1/var/lib/systemd/random-seed - rm -f $1/var/lib/apt/lists/deb.* - rm -Rf $1/root/.local/share/mc - rm -Rf $1/root/.cache - rm -f $1/root/.wget-hsts - - rm -f $1/var/lib/dpkg/*-old - rm -f $1/var/log/* - rm -f $1/var/log/*/* - rm -f $1/var/log/*/*/* - rm -f $1/var/cache/apt/archives/*.deb - rm -f $1/var/cache/apt/*.bin - rm -f $1/var/cache/debconf/*-old - rm -f $1/var/lib/dhcp/dhclient.leases - rm -f $1/root/.bash_history - rm -f $1/root/.wget-hsts - rm -Rf $1/usr/share/doc/* - rm -Rf $1/usr/share/info/* - rm -f $1/usr/share/images/fluxbox/debian-squared.jpg - rm -Rf $1/usr/share/fluxbox/nls/??* - rm -Rf $1/usr/share/gnome/help - - rm -Rf $1/usr/share/locale/?? - rm -Rf $1/usr/share/locale/??_* - rm -Rf $1/usr/share/locale/??@* - rm -Rf $1/usr/share/locale/??? - rm -Rf $1/usr/share/i18n/locales/*_* - rm -Rf $1/usr/share/man/?? - rm -Rf $1/usr/share/man/*_* - - rm -Rf $1/usr/share/icons/elementaryXubuntu-dark - rm -Rf $1/usr/share/icons/gnome/256x256 - - rm $1/usr/share/applications/compton.desktop - rm $1/usr/share/applications/debian-uxterm.desktop - rm $1/usr/share/applications/debian-xterm.desktop - rm $1/usr/share/applications/htop.desktop - rm $1/usr/share/applications/mc.desktop - rm $1/usr/share/applications/mcedit.desktop - rm $1/usr/share/applications/pcmanfm-desktop-pref.desktop - rm $1/usr/share/applications/python2.7.desktop - rm $1/usr/share/applications/python3.7.desktop - rm $1/usr/share/applications/vim.desktop - - uncompress_files $1/etc/alternatives - uncompress_files $1/usr/share/man - - remove_broken_links $1/etc/alternatives - remove_broken_links $1/usr/share/man - - set -eu -} - -# ================================================================= -# -# -# ================================================================= -function module_build_cleanup() { - echo -e "=====> the ${CYAN}${FUNCNAME[0]}${ENDCOLOUR} function is executing ..." - - if [ $OUTPUT = "/dev/stdout" ] && [ ! -f /dev/stdout ]; then - chroot_cleanup $MODULE_UPPER_DIR - else - chroot_cleanup $MODULE_UPPER_DIR >>$OUTPUT 2>&1 - fi -} - -# ================================================================= -# -# -# ================================================================= -function build_modules() { - current_process - - MODULES_DIR=$CURRENT_DIR/build - - if [ -d $CURRENT_DIR/modules ]; then - cd $CURRENT_DIR/modules - else - help - fi - - for MODULE in *; do - MODULE_UPPER_DIR="$MODULES_DIR/$MODULE-upper" - MODULE_WORK_DIR="$MODULES_DIR/$MODULE-work" - MODULE_MERGED_DIR="$MODULES_DIR/$MODULE-merged" - - module_check_build_dir - - module_chroot_mount_fs - - if [ $OUTPUT = "/dev/stdout" ] && [ ! -f /dev/stdout ]; then - chroot_run $MODULE_MERGED_DIR $APT_CMD update - else - chroot_run $MODULE_MERGED_DIR $APT_CMD update >>$OUTPUT 2>&1 - fi - - # run pre-install script - if [ -f $SCRIPT_DIR/linux-live/modules/$MODULE/preinstall ]; then - if [ $OUTPUT = "/dev/stdout" ] && [ ! -f /dev/stdout ]; then - cp $SCRIPT_DIR/linux-live/modules/$MODULE/preinstall $MODULE_MERGED_DIR/preinstall - chmod +x $MODULE_MERGED_DIR/preinstall - chroot_run $MODULE_MERGED_DIR /preinstall - else - cp $SCRIPT_DIR/linux-live/modules/$MODULE/preinstall $MODULE_MERGED_DIR/preinstall - chmod +x $MODULE_MERGED_DIR/preinstall - chroot_run $MODULE_MERGED_DIR /preinstall >>$OUTPUT 2>&1 - fi - fi - - # copy files - if [ $OUTPUT = "/dev/stdout" ] && [ ! -f /dev/stdout ]; then - if [ "$(ls -A $CURRENT_DIR/modules/$MODULE/rootcopy-install)" != "" ]; then - (cd $CURRENT_DIR/modules/$MODULE/rootcopy-install && cp --parents -afr * $MODULE_MERGED_DIR/) - fi - else - if [ "$(ls -A $CURRENT_DIR/modules/$MODULE/rootcopy-install)" != "" ] >>$OUTPUT 2>&1; then - (cd $CURRENT_DIR/modules/$MODULE/rootcopy-install && cp --parents -afr * $MODULE_MERGED_DIR/) - fi - fi - - # run install script - if [ -f $CURRENT_DIR/modules/$MODULE/install ]; then - cp $CURRENT_DIR/modules/$MODULE/install $MODULE_MERGED_DIR/install - chmod +x $MODULE_MERGED_DIR/install - if [ -f $CURRENT_DIR/modules/$MODULE/cleanup ]; then - cp $CURRENT_DIR/modules/$MODULE/cleanup $MODULE_MERGED_DIR/cleanup - fi - if [ -f $CURRENT_DIR/modules/$MODULE/$PACKAGE_VARIANT.list ]; then - cp $CURRENT_DIR/modules/$MODULE/$PACKAGE_VARIANT.list $MODULE_MERGED_DIR/$PACKAGE_VARIANT.list - fi - if [ $OUTPUT = "/dev/stdout" ] && [ ! -f /dev/stdout ]; then - chroot_run $MODULE_MERGED_DIR /install - else - chroot_run $MODULE_MERGED_DIR /install >>$OUTPUT 2>&1 - fi - fi - - # run install2 script - if [ -f $CURRENT_DIR/modules/$MODULE/install2 ]; then - cp $CURRENT_DIR/modules/$MODULE/install2 $MODULE_MERGED_DIR/install2 - chmod +x $MODULE_MERGED_DIR/install2 - if [ "$(ls -A $CURRENT_DIR/modules/$MODULE/patches)" != "" ] >>$OUTPUT 2>&1; then - mkdir $MODULE_MERGED_DIR/patches - (cd $CURRENT_DIR/modules/$MODULE/patches && cp --parents -afr * $MODULE_MERGED_DIR/patches/) - fi - if [ $OUTPUT = "/dev/stdout" ] && [ ! -f /dev/stdout ]; then - chroot_run $MODULE_MERGED_DIR /install2 - else - chroot_run $MODULE_MERGED_DIR /install2 >>$OUTPUT 2>&1 - fi - fi - - # copy files - if [ $OUTPUT = "/dev/stdout" ] && [ ! -f /dev/stdout ]; then - if [ "$(ls -A $CURRENT_DIR/modules/$MODULE/rootcopy-postinstall)" != "" ]; then - (cd $CURRENT_DIR/modules/$MODULE/rootcopy-postinstall && cp --parents -afr * $MODULE_MERGED_DIR/) - fi - else - if [ "$(ls -A $CURRENT_DIR/modules/$MODULE/rootcopy-postinstall)" != "" ] >>$OUTPUT 2>&1; then - (cd $CURRENT_DIR/modules/$MODULE/rootcopy-postinstall && cp --parents -afr * $MODULE_MERGED_DIR/) - fi - fi - - # run post-install script - if [ -f $CURRENT_DIR/modules/$MODULE/postinstall ]; then - cp $CURRENT_DIR/modules/$MODULE/postinstall $MODULE_MERGED_DIR/postinstall - chmod +x $MODULE_MERGED_DIR/postinstall - if [ $OUTPUT = "/dev/stdout" ] && [ ! -f /dev/stdout ]; then - chroot_run $MODULE_MERGED_DIR /postinstall - else - chroot_run $MODULE_MERGED_DIR /postinstall >>$OUTPUT 2>&1 - fi - fi - - module_chroot_finish_up - - module_build_cleanup - - if [ "$(ls -A $MODULE_UPPER_DIR)" != "" ]; then - mksquashfs $MODULE_UPPER_DIR $CURRENT_DIR/$MODULE-$COMP_TYPE.$BEXT -comp $COMP_TYPE -b 1024K -always-use-fragments -noappend || exit - else - echo -e "${MAGENTA}$MODULE_UPPER_DIR${ENDCOLOUR} ${RED}is empty${ENDCOLOUR}. Nothing to do." - fi - - module_chroot_umount_fs - - done - -} - -function repack_module() { - cd $CURRENT_DIR - OLD_MODULE=$MODULE - MODULE=${MODULE%"-$OLD_COMP_TYPE.$BEXT"} - if [ $COMP_TYPE = $OLD_COMP_TYPE ]; then - echo "The module is already in the required compression format." && exit - fi - - if (ls $CURRENT_DIR/*.$BEXT | grep -q $MODULE 2>/dev/null); then - echo -e "${RED}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!${ENDCOLOUR}" - echo -e "Please remove $CURRENT_DIR/$MODULE-$COMP_TYPE.$BEXT${ENDCOLOUR} if you want to build ${MAGENTA}$MODULE${ENDCOLOUR}." - echo -e "${RED}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!${ENDCOLOUR}" - else - mksquashfs /run/initramfs/memory/bundles/$OLD_MODULE $CURRENT_DIR/$MODULE-$COMP_TYPE.$BEXT -comp $COMP_TYPE -b 1024K -always-use-fragments -noappend || exit - fi -} - -function repack_system() { - current_process - - cd /run/initramfs/memory/bundles/ - for MODULE in *; do - if (ls /run/initramfs/memory/bundles/*-xz.$BEXT | grep -q $MODULE >>/dev/null 2>&1); then - OLD_COMP_TYPE="xz" - repack_module - elif (ls /run/initramfs/memory/bundles/*-lz4.$BEXT | grep -q $MODULE >>/dev/null 2>&1); then - OLD_COMP_TYPE="lz4" - repack_module - elif (ls /run/initramfs/memory/bundles/*-zstd.$BEXT | grep -q $MODULE >>/dev/null 2>&1); then - OLD_COMP_TYPE="zstd" - repack_module - fi - done -} diff --git a/modules/!!!-example/install b/modules/!!!-example/install deleted file mode 100644 index 5575421..0000000 --- a/modules/!!!-example/install +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e # exit on error -set -o pipefail # exit on pipeline error -set -u # treat unset variable as error - -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" - -# install packages -if [ -f $SCRIPT_DIR/$PACKAGE_VARIANT.list ]; then - $APT_CMD update >>$OUTPUT 2>&1 && - $APT_CMD install $APT_OPTIONS $APT_OPTIONS2 \ - $(grep -vE "^\s*#" $SCRIPT_DIR/$PACKAGE_VARIANT.list | tr "\n" " ") >>$OUTPUT 2>&1 -fi diff --git a/modules/!!!-example/minimal.list b/modules/!!!-example/minimal.list deleted file mode 100644 index e7b065e..0000000 --- a/modules/!!!-example/minimal.list +++ /dev/null @@ -1 +0,0 @@ -firefox-esr \ No newline at end of file diff --git a/modules/!!!-example/postinstall b/modules/!!!-example/postinstall deleted file mode 100644 index a407c94..0000000 --- a/modules/!!!-example/postinstall +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -rm -Rf /usr/share/icons/gnome/256x256 >>$OUTPUT 2>&1 diff --git a/modules/!!!-example/rootcopy/README b/modules/!!!-example/rootcopy/README deleted file mode 100644 index 2850f2d..0000000 --- a/modules/!!!-example/rootcopy/README +++ /dev/null @@ -1 +0,0 @@ -Files from this folder will be at the root of the system \ No newline at end of file diff --git a/modules/!!!-example/standard.list b/modules/!!!-example/standard.list deleted file mode 100644 index e7b065e..0000000 --- a/modules/!!!-example/standard.list +++ /dev/null @@ -1 +0,0 @@ -firefox-esr \ No newline at end of file diff --git a/modules/05-palemoon/install b/modules/05-palemoon/install deleted file mode 100644 index 87594e8..0000000 --- a/modules/05-palemoon/install +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -echo 'deb http://download.opensuse.org/repositories/home:/stevenpusser/Debian_10/ /' | sudo tee /etc/apt/sources.list.d/home:stevenpusser.list -curl -fsSL http://download.opensuse.org/repositories/home:stevenpusser/Debian_10/Release.key | apt-key add - -# install packages -if [ -f $SCRIPT_DIR/$PACKAGE_VARIANT.list ]; then - $APT_CMD update >>$OUTPUT 2>&1 && - $APT_CMD install $APT_OPTIONS palemoon >>$OUTPUT 2>&1 -fi - -if [ $PACKAGE_VARIANT = "minimal" ]; then - cat </etc/skel/.config/xfce4/helpers.rc -TerminalEmulator=xterm -FileManager=pcmanfm -WebBrowser=palemoon - -EOF - cat </root/.config/xfce4/helpers.rc -TerminalEmulator=xterm -FileManager=pcmanfm -WebBrowser=palemoon --no-sandbox - -EOF - -elif [ $PACKAGE_VARIANT = "standard" ]; then - cat </etc/skel/.config/xfce4/helpers.rc -TerminalEmulator=xfce4-terminal -FileManager=Thunar -WebBrowser=palemoon - -EOF - cat </root/.config/xfce4/helpers.rc -TerminalEmulator=xfce4-terminal -FileManager=Thunar -WebBrowser=palemoon --no-sandbox - -EOF -fi diff --git a/modules/05-palemoon/postinstall b/modules/05-palemoon/postinstall deleted file mode 100644 index a407c94..0000000 --- a/modules/05-palemoon/postinstall +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -rm -Rf /usr/share/icons/gnome/256x256 >>$OUTPUT 2>&1 diff --git a/modules/06-codium/install b/modules/06-codium/install deleted file mode 100644 index 330f2c4..0000000 --- a/modules/06-codium/install +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -set -e # exit on error -set -o pipefail # exit on pipeline error -set -u # treat unset variable as error - -local VERSION -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" - -get_latest_release() { - wget -q -O- "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api - grep '"tag_name":' | # Get tag line - sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value -} - -KERNEL_ARCH="amd64" - -get_latest_package_url() { - wget -q -O- "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api - grep '"browser_download_url":' | grep "$KERNEL_ARCH.deb"\" | # Get tag line - sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value -} - -URL=$(get_latest_package VSCodium/vscodium) -PACKAGE=$(ls codium*$KERNEL_ARCH.deb) - -wget -c $URL && - $APT_CMD install $APT_OPTIONS ./$PACKAGE && - rm -f ./$PACKAGE diff --git a/modules/06-codium/postinstall b/modules/06-codium/postinstall deleted file mode 100644 index de227f1..0000000 --- a/modules/06-codium/postinstall +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -rm -Rf /usr/share/icons/hicolor/256x256 >>$OUTPUT 2>&1 -rm -Rf /usr/share/icons/hicolor/512x512 >>$OUTPUT 2>&1 -rm -Rf /usr/share/icons/gnome/256x256 >>$OUTPUT 2>&1 diff --git a/modules/06-langpack-ru/install b/modules/06-langpack-ru/install deleted file mode 100644 index 4d84019..0000000 --- a/modules/06-langpack-ru/install +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -e # exit on error -set -o pipefail # exit on pipeline error -set -u # treat unset variable as error - -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" - -#export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true - -debconf-set-selections preseed.txt - -# install packages -if [ -f $SCRIPT_DIR/$PACKAGE_VARIANT.list ]; then - $APT_CMD update >>$OUTPUT 2>&1 && - $APT_CMD install $APT_OPTIONS locales >>$OUTPUT 2>&1 -fi - -dpkg-reconfigure locales >>$OUTPUT 2>&1 -dpkg-reconfigure keyboard-configuration >>$OUTPUT 2>&1 -dpkg-reconfigure tzdata >>$OUTPUT 2>&1 diff --git a/modules/06-langpack-ru/postinstall b/modules/06-langpack-ru/postinstall deleted file mode 100644 index a407c94..0000000 --- a/modules/06-langpack-ru/postinstall +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -rm -Rf /usr/share/icons/gnome/256x256 >>$OUTPUT 2>&1 diff --git a/modules/06-langpack-ru/preseed.txt b/modules/06-langpack-ru/preseed.txt deleted file mode 100644 index 2a07996..0000000 --- a/modules/06-langpack-ru/preseed.txt +++ /dev/null @@ -1,42 +0,0 @@ -# Keep the current keyboard layout in the configuration file? -keyboard-configuration keyboard-configuration/unsupported_config_layout boolean true -# Time zone: -tzdata tzdata/Zones/Europe select Moscow -# Keyboard layout: -keyboard-configuration keyboard-configuration/variant select Russian -# Default locale for the system environment: -locales locales/default_environment_locale select ru_RU.UTF-8 -# Method for toggling between national and Latin mode: -keyboard-configuration keyboard-configuration/toggle select Alt+Shift -# Method for temporarily toggling between national and Latin input: -keyboard-configuration keyboard-configuration/switch select No temporary switch -# Locales to be generated: -locales locales/locales_to_be_generated multiselect ru_RU.UTF-8 UTF-8 -# Keep default keyboard layout ()? -keyboard-configuration keyboard-configuration/unsupported_layout boolean true -# Use Control+Alt+Backspace to terminate the X server? -keyboard-configuration keyboard-configuration/ctrl_alt_bksp boolean false -# Keep default keyboard options ()? -keyboard-configuration keyboard-configuration/unsupported_options boolean true -# for internal use -keyboard-configuration keyboard-configuration/layoutcode string us,ru -# for internal use -keyboard-configuration keyboard-configuration/store_defaults_in_debconf_db boolean true -# Geographic area: -#tzdata tzdata/Areas select Europe -# Keyboard model: -keyboard-configuration keyboard-configuration/model select Generic 105-key PC (intl.) -# for internal use -keyboard-configuration keyboard-configuration/optionscode string grp:alt_shift_toggle,grp_led:scroll -# Key to function as AltGr: -keyboard-configuration keyboard-configuration/altgr select The default for the keyboard layout -# Keymap to use: -keyboard-configuration keyboard-configuration/xkb-keymap select us -# Compose key: -keyboard-configuration keyboard-configuration/compose select No compose key -# Keep current keyboard options in the configuration file? -keyboard-configuration keyboard-configuration/unsupported_config_options boolean true -# Country of origin for the keyboard: -keyboard-configuration keyboard-configuration/layout select Russian -# for internal use -keyboard-configuration keyboard-configuration/modelcode string pc105 \ No newline at end of file diff --git a/modules/06-langpack-ru/rootcopy/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml b/modules/06-langpack-ru/rootcopy/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml deleted file mode 100644 index dd94eae..0000000 --- a/modules/06-langpack-ru/rootcopy/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/modules/06-langpack-ru/rootcopy/root/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml b/modules/06-langpack-ru/rootcopy/root/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml deleted file mode 100644 index dd94eae..0000000 --- a/modules/06-langpack-ru/rootcopy/root/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/modules/06-onlyoffice/install b/modules/06-onlyoffice/install deleted file mode 100644 index 276cda6..0000000 --- a/modules/06-onlyoffice/install +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -e # exit on error -set -o pipefail # exit on pipeline error -set -u # treat unset variable as error - -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" - -$APT_CMD update >>$OUTPUT 2>&1 && - $APT_CMD install $APT_OPTIONS $APT_OPTIONS2 \ - software-properties-common >>$OUTPUT 2>&1 - -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 -add-apt-repository 'deb https://download.onlyoffice.com/repo/debian squeeze main' - -$APT_CMD autoremove $APT_OPTIONS $APT_OPTIONS2 \ - software-properties-common >>$OUTPUT 2>&1 - -# install packages -if [ -f $SCRIPT_DIR/$PACKAGE_VARIANT.list ]; then - $APT_CMD update >>$OUTPUT 2>&1 && - $APT_CMD install $APT_OPTIONS $APT_OPTIONS2 \ - $(grep -vE "^\s*#" $SCRIPT_DIR/$PACKAGE_VARIANT.list | tr "\n" " ") >>$OUTPUT 2>&1 -fi diff --git a/modules/06-onlyoffice/minimal.list b/modules/06-onlyoffice/minimal.list deleted file mode 100644 index 1fe9203..0000000 --- a/modules/06-onlyoffice/minimal.list +++ /dev/null @@ -1,3 +0,0 @@ -libpulse0 -libnss3 -onlyoffice-desktopeditors \ No newline at end of file diff --git a/modules/06-onlyoffice/postinstall b/modules/06-onlyoffice/postinstall deleted file mode 100644 index de227f1..0000000 --- a/modules/06-onlyoffice/postinstall +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -rm -Rf /usr/share/icons/hicolor/256x256 >>$OUTPUT 2>&1 -rm -Rf /usr/share/icons/hicolor/512x512 >>$OUTPUT 2>&1 -rm -Rf /usr/share/icons/gnome/256x256 >>$OUTPUT 2>&1 diff --git a/modules/06-onlyoffice/standard.list b/modules/06-onlyoffice/standard.list deleted file mode 100644 index 1fe9203..0000000 --- a/modules/06-onlyoffice/standard.list +++ /dev/null @@ -1,3 +0,0 @@ -libpulse0 -libnss3 -onlyoffice-desktopeditors \ No newline at end of file diff --git a/modules/06-virtmanager/install b/modules/06-virtmanager/install deleted file mode 100644 index 874a3d6..0000000 --- a/modules/06-virtmanager/install +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -e # exit on error -set -o pipefail # exit on pipeline error -set -u # treat unset variable as error - -. /etc/minios.conf -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" - -# install packages -$APT_CMD update >>$OUTPUT 2>&1 && - $APT_CMD install $APT_OPTIONS \ - qemu-kvm \ - libvirt-clients \ - libvirt-daemon-system \ - bridge-utils \ - virt-manager \ - gir1.2-spiceclientgtk-3.0 >>$OUTPUT 2>&1 - -usermod -aG libvirt $USER_NAME diff --git a/modules/06-virtmanager/postinstall b/modules/06-virtmanager/postinstall deleted file mode 100644 index de227f1..0000000 --- a/modules/06-virtmanager/postinstall +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -rm -Rf /usr/share/icons/hicolor/256x256 >>$OUTPUT 2>&1 -rm -Rf /usr/share/icons/hicolor/512x512 >>$OUTPUT 2>&1 -rm -Rf /usr/share/icons/gnome/256x256 >>$OUTPUT 2>&1 diff --git a/modules/06-virtualbox/install b/modules/06-virtualbox/install deleted file mode 100644 index 1a79f35..0000000 --- a/modules/06-virtualbox/install +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -set -e # exit on error -set -o pipefail # exit on pipeline error -#set -u # treat unset variable as error - -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" - -if [ -z $DISTRIBUTION ]; then - DISTRIBUTION="bullseye" -fi -if [ -z $APT_CMD ]; then - APT_CMD="apt-get" -fi -if [ -z $APT_OPTIONS ]; then - APT_OPTIONS="-y" -fi -if [ -z $OUTPUT ]; then - OUTPUT="/dev/stdout" -fi - -VBOX_VERSION=$(wget -O- https://download.virtualbox.org/virtualbox/LATEST.TXT) - -apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A2F683C52980AECF - -echo "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $DISTRIBUTION contrib" >/etc/apt/sources.list.d/virtualbox.list - -# install packages -$APT_CMD update >>$OUTPUT 2>&1 && - $APT_CMD install $APT_OPTIONS linux-headers-amd64 gcc make >>$OUTPUT 2>&1 - -echo virtualbox-ext-pack virtualbox-ext-pack/license select true | sudo debconf-set-selections - -# install packages -$APT_CMD install $APT_OPTIONS virtualbox-6.1 >>$OUTPUT 2>&1 - -wget -c https://download.virtualbox.org/virtualbox/$VBOX_VERSION/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack - -VBoxManage extpack install --replace $SCRIPT_DIR/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack diff --git a/modules/06-virtualbox/postinstall b/modules/06-virtualbox/postinstall deleted file mode 100644 index d27260e..0000000 --- a/modules/06-virtualbox/postinstall +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" - -if [ -z $DISTRIBUTION ]; then - DISTRIBUTION="bullseye" -fi -if [ -z $APT_CMD ]; then - APT_CMD="apt-get" -fi -if [ -z $APT_OPTIONS ]; then - APT_OPTIONS="-y" -fi -if [ -z $OUTPUT ]; then - OUTPUT="/dev/stdout" -fi - -VBOX_VERSION=$(wget -O- https://download.virtualbox.org/virtualbox/LATEST.TXT) - -$APT_CMD autoremove $APT_OPTIONS \ - binutils binutils-common binutils-x86-64-linux-gnu \ - gcc gcc-10 libasan6 libatomic1 libbinutils libcc1-0 \ - libctf-nobfd0 libctf0 libgcc-10-dev libitm1 liblsan0 \ - libquadmath0 libtsan0 libubsan1 linux-compiler-gcc-10-x86 \ - linux-headers-5.10.0-9-amd64 linux-headers-5.10.0-9-common \ - linux-headers-amd64 linux-kbuild-5.10 make >>$OUTPUT 2>&1 - -rm -f $SCRIPT_DIR/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack - -rm -Rf /usr/share/icons/hicolor/256x256 >>$OUTPUT 2>&1 -rm -Rf /usr/share/icons/hicolor/512x512 >>$OUTPUT 2>&1 -rm -Rf /usr/share/icons/gnome/256x256 >>$OUTPUT 2>&1 diff --git a/modules/06-vscode/install b/modules/06-vscode/install deleted file mode 100644 index 3560e6d..0000000 --- a/modules/06-vscode/install +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -e # exit on error -set -o pipefail # exit on pipeline error -set -u # treat unset variable as error - -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" - -wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >packages.microsoft.gpg -install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ -sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" >/etc/apt/sources.list.d/vscode.list' -rm -f packages.microsoft.gpg - -# install packages -if [ -f $SCRIPT_DIR/$PACKAGE_VARIANT.list ]; then - $APT_CMD update >>$OUTPUT 2>&1 && - $APT_CMD install $APT_OPTIONS code >>$OUTPUT 2>&1 -fi diff --git a/modules/06-vscode/postinstall b/modules/06-vscode/postinstall deleted file mode 100644 index 8488983..0000000 --- a/modules/06-vscode/postinstall +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -$APT_CMD autoremove $APT_OPTIONS $APT_OPTIONS2 \ - software-properties-common >>$OUTPUT 2>&1 - -rm -Rf /usr/share/icons/hicolor/256x256 >>$OUTPUT 2>&1 -rm -Rf /usr/share/icons/hicolor/512x512 >>$OUTPUT 2>&1 -rm -Rf /usr/share/icons/gnome/256x256 >>$OUTPUT 2>&1