├── .gitignore ├── LICENSE ├── README.md ├── cli.sh ├── include ├── bootstrap │ ├── alpine │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── archlinux │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── centos │ │ ├── deploy.conf │ │ ├── deploy.sh │ │ └── filesystem.tgz │ ├── debian │ │ ├── debootstrap │ │ │ ├── debootstrap │ │ │ ├── functions │ │ │ └── scripts │ │ │ │ ├── aequorea │ │ │ │ ├── artful │ │ │ │ ├── bartholomea │ │ │ │ ├── bionic │ │ │ │ ├── bookworm │ │ │ │ ├── breezy │ │ │ │ ├── bullseye │ │ │ │ ├── buster │ │ │ │ ├── chromodoris │ │ │ │ ├── cosmic │ │ │ │ ├── dapper │ │ │ │ ├── dasyatis │ │ │ │ ├── debian-common │ │ │ │ ├── devel │ │ │ │ ├── disco │ │ │ │ ├── edgy │ │ │ │ ├── etch │ │ │ │ ├── etch-m68k │ │ │ │ ├── feisty │ │ │ │ ├── gutsy │ │ │ │ ├── hardy │ │ │ │ ├── hoary │ │ │ │ ├── hoary.buildd │ │ │ │ ├── intrepid │ │ │ │ ├── jaunty │ │ │ │ ├── jessie │ │ │ │ ├── jessie-kfreebsd │ │ │ │ ├── kali │ │ │ │ ├── kali-dev │ │ │ │ ├── kali-last-snapshot │ │ │ │ ├── kali-rolling │ │ │ │ ├── karmic │ │ │ │ ├── lenny │ │ │ │ ├── lucid │ │ │ │ ├── maverick │ │ │ │ ├── moto │ │ │ │ ├── natty │ │ │ │ ├── oldoldstable │ │ │ │ ├── oldstable │ │ │ │ ├── oneiric │ │ │ │ ├── potato │ │ │ │ ├── precise │ │ │ │ ├── quantal │ │ │ │ ├── raring │ │ │ │ ├── sana │ │ │ │ ├── sarge │ │ │ │ ├── sarge.buildd │ │ │ │ ├── sarge.fakechroot │ │ │ │ ├── saucy │ │ │ │ ├── sid │ │ │ │ ├── squeeze │ │ │ │ ├── stable │ │ │ │ ├── stretch │ │ │ │ ├── testing │ │ │ │ ├── trusty │ │ │ │ ├── unstable │ │ │ │ ├── utopic │ │ │ │ ├── vivid │ │ │ │ ├── warty │ │ │ │ ├── warty.buildd │ │ │ │ ├── wheezy │ │ │ │ ├── wily │ │ │ │ ├── woody │ │ │ │ ├── woody.buildd │ │ │ │ ├── xenial │ │ │ │ ├── yakkety │ │ │ │ └── zesty │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── deploy.conf │ ├── deploy.sh │ ├── docker │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── fedora │ │ ├── deploy.conf │ │ ├── deploy.sh │ │ └── filesystem.tgz │ ├── kali │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── rootfs │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── slackware │ │ ├── deploy.conf │ │ └── deploy.sh │ └── ubuntu │ │ ├── deploy.conf │ │ └── deploy.sh ├── core │ ├── aid │ │ ├── android_groups │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── deploy.conf │ ├── deploy.sh │ ├── emulator │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── hostname │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── hosts │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── locale │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── mnt │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── motd │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── net │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── power │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── profile │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── su │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── sudo │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── timezone │ │ ├── deploy.conf │ │ └── deploy.sh │ └── unchroot │ │ ├── deploy.conf │ │ └── deploy.sh ├── desktop │ ├── dbus │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── deploy.conf │ ├── deploy.sh │ ├── desktop-base │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── lxde │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── mate │ │ ├── deploy.conf │ │ └── deploy.sh │ ├── xfce │ │ ├── deploy.conf │ │ └── deploy.sh │ └── xterm │ │ ├── deploy.conf │ │ └── deploy.sh ├── extra │ ├── deploy.conf │ ├── pulse │ │ ├── deploy.conf │ │ └── deploy.sh │ └── ssh │ │ ├── deploy.conf │ │ └── deploy.sh ├── graphics │ ├── deploy.conf │ ├── deploy.sh │ ├── fb │ │ ├── deploy.conf │ │ ├── deploy.sh │ │ └── xorg.conf │ ├── vnc │ │ ├── deploy.conf │ │ └── deploy.sh │ └── x11 │ │ ├── deploy.conf │ │ └── deploy.sh └── init │ ├── deploy.conf │ ├── deploy.sh │ ├── run-parts │ ├── deploy.conf │ └── deploy.sh │ └── sysv │ ├── deploy.conf │ └── deploy.sh └── make_rootfs.sh /.gitignore: -------------------------------------------------------------------------------- 1 | /config/ 2 | /rootfs/ 3 | /tmp/ 4 | /cli.conf 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Linux Deploy CLI 2 | 3 | Copyright (C) 2015-2019 Anton Skshidlevsky, GPLv3 4 | 5 | A command line application for installing and running GNU/Linux distributions in the chroot environment. 6 | 7 | ### Dependencies 8 | 9 | - [Linux](http://kernel.org) 10 | - [BusyBox](https://github.com/meefik/busybox) or Bash and GNU utils 11 | - [QEMU](http://qemu.org), [qemu-user-static](https://packages.debian.org/stable/qemu-user-static) for architecture emulation 12 | - [binfmt_misc](https://en.wikipedia.org/wiki/Binfmt_misc) module for architecture emulation without PRoot 13 | - [PRoot](https://github.com/meefik/PRoot) for work without superuser permissions 14 | 15 | ### Usage 16 | 17 | Main help: 18 | 19 | ``` 20 | USAGE: 21 | cli.sh [OPTIONS] COMMAND ... 22 | 23 | OPTIONS: 24 | -p NAME - configuration profile 25 | -d - enable debug mode 26 | -t - enable trace mode 27 | 28 | COMMANDS: 29 | config [...] [PARAMETERS] [NAME ...] - configuration management 30 | - without parameters displays a list of configurations 31 | -r - remove the current configuration 32 | -i FILE - import the configuration 33 | -x - dump of the current configuration 34 | -l - list of dependencies for the specified or are connected components 35 | -a - list of all components without check compatibility 36 | deploy [...] [PARAMETERS] [-n NAME] [NAME ...] - install the distribution and included components 37 | -m - mount the container before deployment 38 | -i - install without configure 39 | -c - configure without install 40 | -n NAME - skip installation of this component 41 | import FILE|URL - import a rootfs into the current container from archive (tgz, tbz2 or txz) 42 | export FILE - export the current container as a rootfs archive (tgz, tbz2 or txz) 43 | shell [-u USER] [COMMAND] - execute the specified command in the container, by default /bin/bash 44 | -u USER - switch to the specified user 45 | mount - mount the container 46 | umount - unmount the container 47 | start [-m] [NAME ...] - start all included or only specified components 48 | -m - mount the container before start 49 | stop [-u] [NAME ...] - stop all included or only specified components 50 | -u - unmount the container after stop 51 | status [NAME ...] - display the status of the container and components 52 | help [NAME ...] - show this help or help of components 53 | 54 | ``` 55 | 56 | Help for the parameters of the main components: 57 | 58 | ``` 59 | --distrib="debian" 60 | The code name of Linux distribution, which will be installed. Supported "debian", "ubuntu", "kali", "fedora", "centos", "archlinux", "slackware", "apline". 61 | 62 | --target-type="file" 63 | The container deployment type, can specify "file", "directory", "partition", "ram" or "custom". 64 | 65 | --target-path="/path/to/debian_x86.img" 66 | Installation path depends on the type of deployment. 67 | 68 | --disk-size="2000" 69 | Image file size when selected type of deployment "file". Zero means the automatic selection of the image size. 70 | 71 | --fs-type="ext4" 72 | File system that will be created inside a image file or on a partition. Supported "ext2", "ext3" or "ext4" 73 | 74 | --arch="i386" 75 | Architecture of Linux distribution, supported "armel", "armhf", "arm64", "i386" and "amd64". 76 | 77 | --suite="stretch" 78 | Version of Linux distribution, supported versions "jessie", "stretch" and "buster" (also can be used "stable", "testing", "unstable" or "oldstable"). 79 | 80 | --source-path="http://ftp.debian.org/debian/" 81 | Installation source, can specify address of the repository or path to the rootfs archive. 82 | 83 | --extra-packages="" 84 | List of optional installation packages, separated by spaces. 85 | 86 | --method="chroot" 87 | Containerization method "chroot" or "proot". 88 | 89 | --chroot-dir="/mnt" 90 | Mount directory of the container for containerization method "chroot". 91 | 92 | --emulator="qemu-i386-static" 93 | Specify which to use the emulator, by default QEMU. 94 | 95 | --mounts="/path/to/source:/path/to/target" 96 | Mounts resources to the container as "SOURCE:TARGET" separated by a space. 97 | 98 | --dns="auto" 99 | IP-address of DNS server, can specify multiple addresses separated by a space. 100 | 101 | --net-trigger="" 102 | Path to a script inside the container to process changes the network. 103 | 104 | --locale="C" 105 | Localization, e.g. "en_US.UTF-8". 106 | 107 | --user-name="android" 108 | Username that will be created in the container. 109 | 110 | --user-password="changeme" 111 | Password will be assigned to the specified user. 112 | 113 | --privileged-users="android:aid_inet android:aid_media_rw" 114 | A list of users in a format UID:GID separated by a space to be added UID to GID. 115 | 116 | ``` 117 | 118 | ### Links 119 | 120 | - Source code: https://github.com/meefik/linuxdeploy-cli 121 | - Donations: https://meefik.github.io/donate 122 | -------------------------------------------------------------------------------- /include/bootstrap/alpine/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="alpine" 5 | DESC="Bootstrap for Alpine Linux" 6 | DEPENDS="bootstrap" 7 | -------------------------------------------------------------------------------- /include/bootstrap/alpine/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${SUITE}" ] || SUITE="latest-stable" 6 | 7 | if [ -z "${ARCH}" ] 8 | then 9 | case "$(get_platform)" in 10 | x86) ARCH="x86" ;; 11 | x86_64) ARCH="x86_64" ;; 12 | arm) ARCH="armhf" ;; 13 | arm_64) ARCH="aarch64" ;; 14 | esac 15 | fi 16 | 17 | [ -n "${SOURCE_PATH}" ] || SOURCE_PATH="http://dl-cdn.alpinelinux.org/alpine/" 18 | 19 | apk_install() 20 | { 21 | local packages="$@" 22 | [ -n "${packages}" ] || return 1 23 | (set -e 24 | chroot_exec -u root apk update || true 25 | chroot_exec -u root apk add ${packages} 26 | exit 0) 27 | return $? 28 | } 29 | 30 | do_install() 31 | { 32 | is_archive "${SOURCE_PATH}" && return 0 33 | 34 | msg ":: Installing ${COMPONENT} ... " 35 | 36 | msg -n "Retrieving rootfs archive ... " 37 | local repo_url="${SOURCE_PATH%/}/${SUITE}" 38 | local rootfs_name=$(wget -q -O - "${repo_url}/releases/${ARCH}/latest-releases.yaml" | grep -m1 "file: alpine-minirootfs" | awk '{print $2}') 39 | wget -q -O - "${repo_url}/releases/${ARCH}/${rootfs_name}" | tar xz -C "${CHROOT_DIR}" 40 | is_ok "fail" "done" || return 1 41 | 42 | component_exec core/emulator core/mnt core/net 43 | 44 | msg "Installing packages: " 45 | apk_install shadow sudo tzdata ${EXTRA_PACKAGES} 46 | is_ok || return 1 47 | 48 | return 0 49 | } 50 | 51 | do_help() 52 | { 53 | cat <, GPLv3 3 | 4 | NAME="archlinux" 5 | DESC="Bootstrap for Arch Linux" 6 | DEPENDS="bootstrap" 7 | -------------------------------------------------------------------------------- /include/bootstrap/archlinux/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | if [ -z "${ARCH}" ] 6 | then 7 | case "$(get_platform)" in 8 | x86) ARCH="i686" ;; 9 | x86_64) ARCH="x86_64" ;; 10 | arm) ARCH="armv7h" ;; 11 | arm_64) ARCH="aarch64" ;; 12 | esac 13 | fi 14 | 15 | if [ -z "${SOURCE_PATH}" ] 16 | then 17 | case "$(get_platform ${ARCH})" in 18 | x86) SOURCE_PATH="http://mirror.archlinux32.org/" ;; 19 | x86_64) SOURCE_PATH="http://mirrors.kernel.org/archlinux/" ;; 20 | arm*) SOURCE_PATH="http://mirror.archlinuxarm.org/" ;; 21 | esac 22 | fi 23 | 24 | pacman_install() 25 | { 26 | local packages="$@" 27 | [ -n "${packages}" ] || return 1 28 | (set -e 29 | #rm -f ${CHROOT_DIR}/var/lib/pacman/db.lck || true 30 | chroot_exec -u root pacman -Syq --overwrite="*" --noconfirm ${packages} 31 | rm -f "${CHROOT_DIR}"/var/cache/pacman/pkg/* || true 32 | exit 0) 33 | return $? 34 | } 35 | 36 | pacman_repository() 37 | { 38 | case "$(get_platform ${ARCH})" in 39 | x86_64) local repo_url="${SOURCE_PATH%/}/\$repo/os/\$arch" ;; 40 | arm*|x86) local repo_url="${SOURCE_PATH%/}/\$arch/\$repo" ;; 41 | *) return 1 ;; 42 | esac 43 | sed -i "s|^[[:space:]]*Architecture[[:space:]]*=.*$|Architecture = ${ARCH}|" "${CHROOT_DIR}/etc/pacman.conf" 44 | sed -i "s|^[[:space:]]*\(CheckSpace\)|#\1|" "${CHROOT_DIR}/etc/pacman.conf" 45 | sed -i "s|^[[:space:]]*SigLevel[[:space:]]*=.*$|SigLevel = Never|" "${CHROOT_DIR}/etc/pacman.conf" 46 | if $(grep -q "^[[:space:]]*Server" "${CHROOT_DIR}/etc/pacman.d/mirrorlist") 47 | then sed -i "s|^[[:space:]]*Server[[:space:]]*=.*|Server = ${repo_url}|" "${CHROOT_DIR}/etc/pacman.d/mirrorlist" 48 | else echo "Server = ${repo_url}" >> "${CHROOT_DIR}/etc/pacman.d/mirrorlist" 49 | fi 50 | } 51 | 52 | do_install() 53 | { 54 | is_archive "${SOURCE_PATH}" && return 0 55 | 56 | msg ":: Installing ${COMPONENT} ... " 57 | 58 | local repo_url 59 | case "$(get_platform ${ARCH})" in 60 | x86_64) repo_url="${SOURCE_PATH%/}/core/os/${ARCH}" ;; 61 | arm*|x86) repo_url="${SOURCE_PATH%/}/${ARCH}/core" ;; 62 | *) return 1 ;; 63 | esac 64 | 65 | msg -n "Preparing for deployment ... " 66 | local cache_dir="${CHROOT_DIR}/var/cache/pacman/pkg" 67 | mkdir -p "${cache_dir}" 68 | is_ok "fail" "done" || return 1 69 | 70 | msg -n "Retrieving packages list ... " 71 | local core_files=$(wget -q -O - "${repo_url}/core.db.tar.gz" | tar xOz | grep '.pkg.tar.xz$' | grep -v -e '^linux-' -e '^grub-' -e '^efibootmgr-' -e '^openssh-' | sort) 72 | is_ok "fail" "done" || return 1 73 | 74 | msg "Retrieving packages: " 75 | local fs_file=$(echo ${core_files} | grep -m1 '^filesystem-') 76 | for pkg_file in ${fs_file} ${core_files} 77 | do 78 | msg -n "${pkg_file%-*} ... " 79 | # download 80 | local i 81 | for i in 1 2 3 82 | do 83 | wget -q -c -O "${cache_dir}/${pkg_file}" "${repo_url}/${pkg_file}" && break 84 | sleep 30s 85 | done 86 | # unpack 87 | tar xJf "${cache_dir}/${pkg_file}" -C "${CHROOT_DIR}" --exclude='./dev' --exclude='./sys' --exclude='./proc' --exclude='.INSTALL' --exclude='.MTREE' --exclude='.PKGINFO' 88 | is_ok "fail" "done" || return 1 89 | done 90 | 91 | component_exec core/emulator core/mnt core/net 92 | 93 | msg -n "Updating repository ... " 94 | pacman_repository 95 | is_ok "fail" "done" 96 | 97 | msg "Installing packages: " 98 | pacman_install base $(echo ${core_files} | sed 's/-[0-9].*$//') ${EXTRA_PACKAGES} 99 | is_ok || return 1 100 | 101 | msg -n "Clearing cache ... " 102 | rm -f "${cache_dir}"/* $(find "${CHROOT_DIR}/etc" -type f -name "*.pacnew") 103 | is_ok "skip" "done" 104 | 105 | return 0 106 | } 107 | 108 | do_help() 109 | { 110 | cat <, GPLv3 3 | 4 | NAME="centos" 5 | DESC="Bootstrap for CentOS" 6 | DEPENDS="bootstrap" 7 | -------------------------------------------------------------------------------- /include/bootstrap/centos/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${SUITE}" ] || SUITE="7" 6 | 7 | if [ -z "${ARCH}" ] 8 | then 9 | case "$(get_platform)" in 10 | x86) ARCH="i386" ;; 11 | x86_64) ARCH="x86_64" ;; 12 | arm) ARCH="armhfp" ;; 13 | arm_64) ARCH="aarch64" ;; 14 | esac 15 | fi 16 | 17 | if [ -z "${SOURCE_PATH}" ] 18 | then 19 | case "$(get_platform ${ARCH})" in 20 | x86|arm*) SOURCE_PATH="http://mirror.centos.org/altarch/" ;; 21 | x86_64) SOURCE_PATH="http://mirror.centos.org/centos/" ;; 22 | esac 23 | fi 24 | 25 | yum_install() 26 | { 27 | local packages="$@" 28 | [ -n "${packages}" ] || return 1 29 | (set -e 30 | chroot_exec -u root yum install ${packages} --nogpgcheck --skip-broken -y 31 | chroot_exec -u root yum clean all 32 | exit 0) 33 | return $? 34 | } 35 | 36 | yum_groupinstall() 37 | { 38 | local groupname="$@" 39 | [ -n "${groupname}" ] || return 1 40 | (set -e 41 | chroot_exec -u root yum groups install ${groupname} --nogpgcheck --skip-broken -y 42 | chroot_exec -u root yum clean all 43 | exit 0) 44 | return $? 45 | } 46 | 47 | yum_repository() 48 | { 49 | chroot_exec -u root yum-config-manager --disable '*' >/dev/null 50 | local repo_file="${CHROOT_DIR}/etc/yum.repos.d/CentOS-${SUITE}-${ARCH}.repo" 51 | local repo_url="${SOURCE_PATH%/}/${SUITE}/os/${ARCH}" 52 | echo "[centos-${SUITE}-${ARCH}]" > "${repo_file}" 53 | echo "name=CentOS ${SUITE} - ${ARCH}" >> "${repo_file}" 54 | echo "failovermethod=priority" >> "${repo_file}" 55 | echo "baseurl=${repo_url}" >> "${repo_file}" 56 | echo "enabled=1" >> "${repo_file}" 57 | echo "metadata_expire=7d" >> "${repo_file}" 58 | echo "gpgcheck=0" >> "${repo_file}" 59 | chmod 644 "${repo_file}" 60 | } 61 | 62 | do_install() 63 | { 64 | is_archive "${SOURCE_PATH}" && return 0 65 | 66 | msg ":: Installing ${COMPONENT} ... " 67 | 68 | local core_packages="audit-libs basesystem bash bzip2-libs ca-certificates chkconfig coreutils cpio cracklib cracklib-dicts cryptsetup-libs curl cyrus-sasl-lib dbus dbus-libs diffutils elfutils-libelf elfutils-libs expat file-libs filesystem 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 libuuid libverto libxml2 lua lz4 ncurses ncurses-base ncurses-libs nspr nss nss-pem 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-iniparse python-libs python-pycurl python-urlgrabber pyxattr qrencode-libs readline rootfiles rpm rpm-build-libs rpm-libs rpm-python sed 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" 69 | local repo_url="${SOURCE_PATH%/}/${SUITE}/os/${ARCH}" 70 | 71 | msg -n "Preparing for deployment ... " 72 | tar xzf "${COMPONENT_DIR}/filesystem.tgz" -C "${CHROOT_DIR}" 73 | is_ok "fail" "done" || return 1 74 | 75 | msg -n "Retrieving packages list ... " 76 | local pkg_list="${CHROOT_DIR}/tmp/packages.list" 77 | (set -e 78 | repodata=$(wget -q -O - "${repo_url}/repodata/repomd.xml" | sed -n '/]*href="\([^\"]*\-primary\.xml\.gz\)".*$/\1/p') 79 | [ -z "${repodata}" ] && exit 1 80 | wget -q -O - "${repo_url}/${repodata}" | gzip -dc | sed -n '/]*href="\([^\"]*\)".*$/\1/p' > "${pkg_list}" 81 | exit 0) 82 | is_ok "fail" "done" || return 1 83 | 84 | msg "Retrieving packages: " 85 | local package i pkg_url pkg_file pkg_arch 86 | case "${ARCH}" in 87 | i386) pkg_arch="-e i686 -e noarch" ;; 88 | x86_64) pkg_arch="-e x86_64 -e noarch" ;; 89 | armhfp) pkg_arch="-e armv7hl -e noarch" ;; 90 | aarch64) pkg_arch="-e aarch64 -e noarch" ;; 91 | esac 92 | for package in ${core_packages} 93 | do 94 | msg -n "${package} ... " 95 | pkg_url=$(grep -e "^.*/${package}-[0-9][0-9\.\-].*rpm$" "${pkg_list}" | grep -m1 ${pkg_arch}) 96 | test "${pkg_url}"; is_ok "fail" || return 1 97 | pkg_file="${pkg_url##*/}" 98 | # download 99 | for i in 1 2 3 100 | do 101 | wget -q -c -O "${CHROOT_DIR}/tmp/${pkg_file}" "${repo_url}/${pkg_url}" && break 102 | sleep 30s 103 | done 104 | [ "${package}" = "filesystem" ] && { msg "done"; continue; } 105 | # unpack 106 | (cd "${CHROOT_DIR}"; rpm2cpio "./tmp/${pkg_file}" | cpio -idmu >/dev/null) 107 | is_ok "fail" "done" || return 1 108 | done 109 | 110 | component_exec core/emulator 111 | 112 | msg "Installing packages ... " 113 | chroot_exec /bin/rpm -i --force --nosignature --nodeps /tmp/*.rpm 114 | is_ok || return 1 115 | 116 | msg -n "Clearing cache ... " 117 | rm -rf "${CHROOT_DIR}"/tmp/* 118 | is_ok "skip" "done" 119 | 120 | component_exec core/mnt core/net 121 | 122 | msg -n "Updating repository ... " 123 | yum_repository 124 | is_ok "fail" "done" 125 | 126 | msg "Installing minimal environment: " 127 | yum_groupinstall "Minimal Install" --exclude filesystem,linux-firmware,openssh-server && 128 | chroot_exec -u root yum-config-manager --disable centos-kernel >/dev/null 129 | is_ok || return 1 130 | 131 | if [ -n "${EXTRA_PACKAGES}" ]; then 132 | msg "Installing extra packages: " 133 | yum_install ${EXTRA_PACKAGES} 134 | is_ok || return 1 135 | fi 136 | 137 | return 0 138 | } 139 | 140 | 141 | do_help() 142 | { 143 | cat <"$TARGET/var/lib/dpkg/status" 52 | : >"$TARGET/var/lib/dpkg/available" 53 | 54 | setup_etc 55 | if [ ! -e "$TARGET/etc/fstab" ]; then 56 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 57 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 58 | fi 59 | 60 | setup_devices 61 | 62 | x_feign_install () { 63 | local pkg="$1" 64 | local deb="$(debfor $pkg)" 65 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 66 | 67 | mkdir -p "$TARGET/var/lib/dpkg/info" 68 | 69 | echo \ 70 | "Package: $pkg 71 | Version: $ver 72 | Maintainer: unknown 73 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 74 | 75 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 76 | } 77 | 78 | x_feign_install dpkg 79 | } 80 | 81 | second_stage_install () { 82 | setup_dynamic_devices 83 | 84 | x_core_install () { 85 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 86 | } 87 | 88 | p () { 89 | baseprog="$(($baseprog + ${1:-1}))" 90 | } 91 | 92 | if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then 93 | setup_proc_symlink 94 | else 95 | setup_proc 96 | in_target /sbin/ldconfig 97 | fi 98 | 99 | DEBIAN_FRONTEND=noninteractive 100 | DEBCONF_NONINTERACTIVE_SEEN=true 101 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 102 | 103 | baseprog=0 104 | bases=7 105 | 106 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 107 | info INSTCORE "Installing core packages..." 108 | 109 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 110 | ln -sf mawk "$TARGET/usr/bin/awk" 111 | x_core_install base-passwd 112 | x_core_install base-files 113 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 114 | x_core_install dpkg 115 | 116 | if [ ! -e "$TARGET/etc/localtime" ]; then 117 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 118 | fi 119 | 120 | if doing_variant fakechroot; then 121 | install_fakechroot_tools 122 | fi 123 | 124 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 125 | x_core_install $LIBC 126 | 127 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 128 | x_core_install perl-base 129 | 130 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 131 | rm "$TARGET/usr/bin/awk" 132 | x_core_install mawk 133 | 134 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 135 | if doing_variant -; then 136 | x_core_install debconf 137 | fi 138 | 139 | baseprog=0 140 | bases=$(set -- $required; echo $#) 141 | 142 | info UNPACKREQ "Unpacking required packages..." 143 | 144 | exec 7>&1 145 | 146 | smallyes '' | 147 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 148 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) | 149 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING 150 | 151 | info CONFREQ "Configuring required packages..." 152 | 153 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 154 | echo \ 155 | "#!/bin/sh 156 | echo 157 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 158 | chmod 755 "$TARGET/sbin/start-stop-daemon" 159 | 160 | setup_dselect_method apt 161 | 162 | smallyes '' | 163 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 164 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) | 165 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING 166 | 167 | baseprog=0 168 | bases="$(set -- $base; echo $#)" 169 | 170 | info UNPACKBASE "Unpacking the base system..." 171 | 172 | setup_available $required $base 173 | done_predeps= 174 | while predep=$(get_next_predep); do 175 | # We have to resolve dependencies of pre-dependencies manually because 176 | # dpkg --predep-package doesn't handle this. 177 | predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps") 178 | # XXX: progress is tricky due to how dpkg_progress works 179 | # -- cjwatson 2009-07-29 180 | p; smallyes '' | 181 | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep) 182 | base=$(without "$base" "$predep") 183 | done_predeps="$done_predeps $predep" 184 | done 185 | 186 | smallyes '' | 187 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 188 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) | 189 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING 190 | 191 | info CONFBASE "Configuring the base system..." 192 | 193 | smallyes '' | 194 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \ 195 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) | 196 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING 197 | 198 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 199 | 200 | progress $bases $bases CONFBASE "Configuring base system" 201 | info BASESUCCESS "Base system installed successfully." 202 | } 203 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/artful: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/bartholomea: -------------------------------------------------------------------------------- 1 | aequorea -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/bionic: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/bookworm: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/breezy: -------------------------------------------------------------------------------- 1 | default_mirror http://old-releases.ubuntu.com/ubuntu 2 | mirror_style release 3 | download_style apt 4 | finddebs_style from-indices 5 | variants - buildd 6 | force_md5 7 | 8 | case $ARCH in 9 | alpha|ia64) LIBC="libc6.1" ;; 10 | *) LIBC="libc6" ;; 11 | esac 12 | 13 | work_out_debs () { 14 | required="$(get_debs Priority: required)" 15 | 16 | if doing_variant -; then 17 | #required="$required $(get_debs Priority: important)" 18 | # ^^ should be getting debconf here somehow maybe 19 | base="$(get_debs Priority: important)" 20 | elif doing_variant buildd; then 21 | # TODO: add Build-Essential: yes extraoverrides 22 | #base="$(get_debs Build-Essential: yes)" 23 | 24 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; } 25 | 26 | base="apt binutils cpio cpp cpp-4.0 dpkg-dev g++ g++-4.0 gcc gcc-4.0 gcc-4.0-base ${LIBC}-dev libdb4.2 libgdbm3 libstdc++6 libstdc++6-4.0-dev linux-kernel-headers make patch perl perl-modules" 27 | 28 | add ia64 base "libunwind7-dev" 29 | add sparc base "lib64gcc1" 30 | add sparc base "libc6-dev-sparc64" 31 | add sparc base "libc6-sparc64" 32 | fi 33 | } 34 | 35 | first_stage_install () { 36 | extract $required 37 | 38 | mkdir -p "$TARGET/var/lib/dpkg" 39 | : >"$TARGET/var/lib/dpkg/status" 40 | echo >"$TARGET/var/lib/dpkg/available" 41 | 42 | setup_etc 43 | if [ ! -e "$TARGET/etc/fstab" ]; then 44 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 45 | chmod 644 "$TARGET/etc/fstab" 46 | fi 47 | 48 | setup_devices 49 | 50 | x_feign_install () { 51 | local pkg="$1" 52 | local deb="$(debfor $pkg)" 53 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 54 | 55 | mkdir -p "$TARGET/var/lib/dpkg/info" 56 | 57 | echo \ 58 | "Package: $pkg 59 | Version: $ver 60 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 61 | 62 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 63 | } 64 | 65 | x_feign_install dpkg 66 | } 67 | 68 | second_stage_install () { 69 | x_core_install () { 70 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 71 | } 72 | 73 | p () { 74 | baseprog="$(($baseprog + ${1:-1}))" 75 | } 76 | 77 | setup_proc 78 | umount_on_exit /dev/.static/dev 79 | umount_on_exit /dev 80 | in_target /sbin/ldconfig 81 | 82 | DEBIAN_FRONTEND=noninteractive 83 | DEBCONF_NONINTERACTIVE_SEEN=true 84 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 85 | 86 | baseprog=0 87 | bases=7 88 | 89 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 90 | info INSTCORE "Installing core packages..." 91 | 92 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 93 | ln -sf mawk "$TARGET/usr/bin/awk" 94 | x_core_install base-files base-passwd 95 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 96 | x_core_install dpkg 97 | 98 | if [ ! -e "$TARGET/etc/localtime" ]; then 99 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 100 | fi 101 | 102 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 103 | x_core_install $LIBC 104 | 105 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 106 | x_core_install perl-base 107 | 108 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 109 | rm "$TARGET/usr/bin/awk" 110 | x_core_install mawk 111 | 112 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 113 | if doing_variant -; then 114 | x_core_install debconf 115 | fi 116 | 117 | baseprog=0 118 | bases=$(set -- $required; echo $#) 119 | 120 | info UNPACKREQ "Unpacking required packages..." 121 | 122 | smallyes '' | 123 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 124 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | 125 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 126 | 127 | info CONFREQ "Configuring required packages..." 128 | 129 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 130 | echo \ 131 | "#!/bin/sh 132 | echo 133 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 134 | chmod 755 "$TARGET/sbin/start-stop-daemon" 135 | 136 | setup_dselect_method apt 137 | 138 | smallyes '' | 139 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 140 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | 141 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 142 | 143 | baseprog=0 144 | bases="$(set -- $base; echo $#)" 145 | 146 | info UNPACKBASE "Unpacking the base system..." 147 | 148 | smallyes '' | 149 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 150 | dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | 151 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 152 | 153 | info CONFBASE "Configuring the base system..." 154 | 155 | smallyes '' | 156 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \ 157 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | 158 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 159 | 160 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 161 | 162 | progress $bases $bases CONFBASE "Configuring base system" 163 | info BASESUCCESS "Base system installed successfully." 164 | } 165 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/bullseye: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/buster: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/chromodoris: -------------------------------------------------------------------------------- 1 | aequorea -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/cosmic: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/dapper: -------------------------------------------------------------------------------- 1 | case $ARCH in 2 | amd64|i386|powerpc|sparc) 3 | default_mirror http://archive.ubuntu.com/ubuntu 4 | ;; 5 | *) 6 | default_mirror http://ports.ubuntu.com/ubuntu-ports 7 | ;; 8 | esac 9 | mirror_style release 10 | download_style apt 11 | finddebs_style from-indices 12 | variants - buildd 13 | force_md5 14 | 15 | case $ARCH in 16 | alpha|ia64) LIBC="libc6.1" ;; 17 | *) LIBC="libc6" ;; 18 | esac 19 | 20 | work_out_debs () { 21 | required="$(get_debs Priority: required)" 22 | 23 | if doing_variant -; then 24 | #required="$required $(get_debs Priority: important)" 25 | # ^^ should be getting debconf here somehow maybe 26 | base="$(get_debs Priority: important)" 27 | elif doing_variant buildd; then 28 | # TODO: add Build-Essential: yes extraoverrides 29 | #base="$(get_debs Build-Essential: yes)" 30 | 31 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; } 32 | 33 | base="apt binutils cpio cpp cpp-4.0 dpkg-dev g++ g++-4.0 gcc gcc-4.0 ${LIBC}-dev libgdbm3 libstdc++6 libstdc++6-4.0-dev linux-kernel-headers make patch perl perl-modules" 34 | 35 | add ia64 base "libunwind7-dev" 36 | add sparc base "lib64gcc1" 37 | add sparc base "libc6-dev-sparc64" 38 | add sparc base "libc6-sparc64" 39 | fi 40 | } 41 | 42 | first_stage_install () { 43 | extract $required 44 | 45 | mkdir -p "$TARGET/var/lib/dpkg" 46 | : >"$TARGET/var/lib/dpkg/status" 47 | : >"$TARGET/var/lib/dpkg/available" 48 | 49 | setup_etc 50 | if [ ! -e "$TARGET/etc/fstab" ]; then 51 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 52 | chmod 644 "$TARGET/etc/fstab" 53 | fi 54 | 55 | setup_devices 56 | 57 | x_feign_install () { 58 | local pkg="$1" 59 | local deb="$(debfor $pkg)" 60 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 61 | 62 | mkdir -p "$TARGET/var/lib/dpkg/info" 63 | 64 | echo \ 65 | "Package: $pkg 66 | Version: $ver 67 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 68 | 69 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 70 | } 71 | 72 | x_feign_install dpkg 73 | } 74 | 75 | second_stage_install () { 76 | x_core_install () { 77 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 78 | } 79 | 80 | p () { 81 | baseprog="$(($baseprog + ${1:-1}))" 82 | } 83 | 84 | setup_proc 85 | in_target /sbin/ldconfig 86 | 87 | DEBIAN_FRONTEND=noninteractive 88 | DEBCONF_NONINTERACTIVE_SEEN=true 89 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 90 | 91 | baseprog=0 92 | bases=7 93 | 94 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 95 | info INSTCORE "Installing core packages..." 96 | 97 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 98 | ln -sf mawk "$TARGET/usr/bin/awk" 99 | x_core_install base-files base-passwd 100 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 101 | x_core_install dpkg 102 | 103 | if [ ! -e "$TARGET/etc/localtime" ]; then 104 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 105 | fi 106 | 107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 108 | x_core_install $LIBC 109 | 110 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 111 | x_core_install perl-base 112 | 113 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 114 | rm "$TARGET/usr/bin/awk" 115 | x_core_install mawk 116 | 117 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 118 | if doing_variant -; then 119 | x_core_install debconf 120 | fi 121 | 122 | baseprog=0 123 | bases=$(set -- $required; echo $#) 124 | 125 | info UNPACKREQ "Unpacking required packages..." 126 | 127 | smallyes '' | 128 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 129 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | 130 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 131 | 132 | info CONFREQ "Configuring required packages..." 133 | 134 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 135 | echo \ 136 | "#!/bin/sh 137 | echo 138 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 139 | chmod 755 "$TARGET/sbin/start-stop-daemon" 140 | 141 | setup_dselect_method apt 142 | 143 | smallyes '' | 144 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 145 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | 146 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 147 | 148 | baseprog=0 149 | bases="$(set -- $base; echo $#)" 150 | 151 | info UNPACKBASE "Unpacking the base system..." 152 | 153 | smallyes '' | 154 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 155 | dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | 156 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 157 | 158 | info CONFBASE "Configuring the base system..." 159 | 160 | smallyes '' | 161 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \ 162 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | 163 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 164 | 165 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 166 | 167 | progress $bases $bases CONFBASE "Configuring base system" 168 | info BASESUCCESS "Base system installed successfully." 169 | } 170 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/dasyatis: -------------------------------------------------------------------------------- 1 | aequorea -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/debian-common: -------------------------------------------------------------------------------- 1 | if doing_variant fakechroot; then 2 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" 3 | fi 4 | 5 | case $ARCH in 6 | alpha|ia64) LIBC="libc6.1" ;; 7 | kfreebsd-*) LIBC="libc0.1" ;; 8 | hurd-*) LIBC="libc0.3" ;; 9 | *) LIBC="libc6" ;; 10 | esac 11 | 12 | work_out_debs () { 13 | required="$(get_debs Priority: required)" 14 | 15 | if doing_variant - || doing_variant fakechroot; then 16 | #required="$required $(get_debs Priority: important)" 17 | # ^^ should be getting debconf here somehow maybe 18 | base="$(get_debs Priority: important)" 19 | elif doing_variant buildd; then 20 | base="apt build-essential" 21 | elif doing_variant minbase; then 22 | base="apt" 23 | fi 24 | 25 | if doing_variant fakechroot; then 26 | # ldd.fake needs binutils 27 | required="$required binutils" 28 | fi 29 | 30 | case $MIRRORS in 31 | https://*) 32 | base="$base apt-transport-https ca-certificates" 33 | ;; 34 | esac 35 | } 36 | 37 | first_stage_install () { 38 | case "$CODENAME" in 39 | # "merged-usr" blacklist for past releases 40 | etch*|lenny|squeeze|wheezy|jessie*) 41 | [ -z "$MERGED_USR" ] && MERGED_USR="no" 42 | ;; 43 | *) 44 | # see https://bugs.debian.org/838388 45 | EXTRACT_DEB_TAR_OPTIONS="$EXTRACT_DEB_TAR_OPTIONS -k" 46 | ;; 47 | esac 48 | 49 | if [ "$CODENAME" = "stretch" ] && [ -z "$MERGED_USR" ]; then 50 | MERGED_USR="no" 51 | fi 52 | 53 | setup_merged_usr 54 | extract $required 55 | 56 | mkdir -p "$TARGET/var/lib/dpkg" 57 | : >"$TARGET/var/lib/dpkg/status" 58 | : >"$TARGET/var/lib/dpkg/available" 59 | 60 | setup_etc 61 | if [ ! -e "$TARGET/etc/fstab" ]; then 62 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 63 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab" 64 | fi 65 | 66 | setup_devices 67 | 68 | if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then 69 | setup_proc_symlink 70 | fi 71 | } 72 | 73 | second_stage_install () { 74 | in_target /bin/true 75 | 76 | setup_dynamic_devices 77 | 78 | x_feign_install () { 79 | local pkg="$1" 80 | local deb="$(debfor $pkg)" 81 | local ver="$(in_target dpkg-deb -f "$deb" Version)" 82 | 83 | mkdir -p "$TARGET/var/lib/dpkg/info" 84 | 85 | echo \ 86 | "Package: $pkg 87 | Version: $ver 88 | Maintainer: unknown 89 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 90 | 91 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 92 | } 93 | 94 | x_feign_install dpkg 95 | 96 | x_core_install () { 97 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 98 | } 99 | 100 | p () { 101 | baseprog="$(($baseprog + ${1:-1}))" 102 | } 103 | 104 | if ! doing_variant fakechroot; then 105 | setup_proc 106 | in_target /sbin/ldconfig 107 | fi 108 | 109 | DEBIAN_FRONTEND=noninteractive 110 | DEBCONF_NONINTERACTIVE_SEEN=true 111 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 112 | 113 | baseprog=0 114 | bases=7 115 | 116 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 117 | info INSTCORE "Installing core packages..." 118 | 119 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 120 | ln -sf mawk "$TARGET/usr/bin/awk" 121 | x_core_install base-passwd 122 | x_core_install base-files 123 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 124 | x_core_install dpkg 125 | 126 | if [ ! -e "$TARGET/etc/localtime" ]; then 127 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 128 | fi 129 | 130 | if doing_variant fakechroot; then 131 | install_fakechroot_tools 132 | fi 133 | 134 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 135 | x_core_install $LIBC 136 | 137 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 138 | x_core_install perl-base 139 | 140 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 141 | rm "$TARGET/usr/bin/awk" 142 | x_core_install mawk 143 | 144 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 145 | if doing_variant -; then 146 | x_core_install debconf 147 | fi 148 | 149 | baseprog=0 150 | bases=$(set -- $required; echo $#) 151 | 152 | info UNPACKREQ "Unpacking required packages..." 153 | 154 | exec 7>&1 155 | 156 | smallyes '' | 157 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 158 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) | 159 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING 160 | 161 | info CONFREQ "Configuring required packages..." 162 | 163 | echo \ 164 | "#!/bin/sh 165 | exit 101" > "$TARGET/usr/sbin/policy-rc.d" 166 | chmod 755 "$TARGET/usr/sbin/policy-rc.d" 167 | 168 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 169 | echo \ 170 | "#!/bin/sh 171 | echo 172 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 173 | chmod 755 "$TARGET/sbin/start-stop-daemon" 174 | 175 | setup_dselect_method apt 176 | 177 | smallyes '' | 178 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 179 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) | 180 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING 181 | 182 | baseprog=0 183 | bases="$(set -- $base; echo $#)" 184 | 185 | info UNPACKBASE "Unpacking the base system..." 186 | 187 | setup_available $required $base 188 | done_predeps= 189 | while predep=$(get_next_predep); do 190 | # We have to resolve dependencies of pre-dependencies manually because 191 | # dpkg --predep-package doesn't handle this. 192 | predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps") 193 | # XXX: progress is tricky due to how dpkg_progress works 194 | # -- cjwatson 2009-07-29 195 | p; smallyes '' | 196 | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep) 197 | base=$(without "$base" "$predep") 198 | done_predeps="$done_predeps $predep" 199 | done 200 | 201 | if [ -n "$base" ]; then 202 | smallyes '' | 203 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 204 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) | 205 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING 206 | 207 | info CONFBASE "Configuring the base system..." 208 | 209 | smallyes '' | 210 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \ 211 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) | 212 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING 213 | fi 214 | 215 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 216 | rm -f "$TARGET/usr/sbin/policy-rc.d" 217 | 218 | progress $bases $bases CONFBASE "Configuring base system" 219 | info BASESUCCESS "Base system installed successfully." 220 | } 221 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/devel: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/disco: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/edgy: -------------------------------------------------------------------------------- 1 | case $ARCH in 2 | amd64|i386|powerpc|sparc) 3 | default_mirror http://old-releases.ubuntu.com/ubuntu 4 | ;; 5 | *) 6 | default_mirror http://ports.ubuntu.com/ubuntu-ports 7 | ;; 8 | esac 9 | mirror_style release 10 | download_style apt 11 | finddebs_style from-indices 12 | variants - buildd fakechroot 13 | force_md5 14 | 15 | if doing_variant fakechroot; then 16 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" 17 | fi 18 | 19 | case $ARCH in 20 | alpha|ia64) LIBC="libc6.1" ;; 21 | *) LIBC="libc6" ;; 22 | esac 23 | 24 | work_out_debs () { 25 | required="$(get_debs Priority: required)" 26 | 27 | if doing_variant -; then 28 | #required="$required $(get_debs Priority: important)" 29 | # ^^ should be getting debconf here somehow maybe 30 | base="$(get_debs Priority: important)" 31 | elif doing_variant buildd; then 32 | # TODO: add Build-Essential: yes extraoverrides 33 | #base="$(get_debs Build-Essential: yes)" 34 | 35 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; } 36 | 37 | base="apt binutils cpio cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 ${LIBC}-dev libdb4.4 libgdbm3 libstdc++6 libstdc++6-4.1-dev linux-libc-dev make patch perl perl-modules" 38 | 39 | add ia64 base "libunwind7-dev" 40 | add sparc base "lib64gcc1" 41 | add sparc base "libc6-dev-sparc64" 42 | add sparc base "libc6-sparc64" 43 | elif doing_variant fakechroot; then 44 | base="apt" 45 | fi 46 | } 47 | 48 | first_stage_install () { 49 | extract $required 50 | 51 | mkdir -p "$TARGET/var/lib/dpkg" 52 | : >"$TARGET/var/lib/dpkg/status" 53 | : >"$TARGET/var/lib/dpkg/available" 54 | 55 | setup_etc 56 | if [ ! -e "$TARGET/etc/fstab" ]; then 57 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 58 | chmod 644 "$TARGET/etc/fstab" 59 | fi 60 | 61 | setup_devices 62 | 63 | x_feign_install () { 64 | local pkg="$1" 65 | local deb="$(debfor $pkg)" 66 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 67 | 68 | mkdir -p "$TARGET/var/lib/dpkg/info" 69 | 70 | echo \ 71 | "Package: $pkg 72 | Version: $ver 73 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 74 | 75 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 76 | } 77 | 78 | x_feign_install dpkg 79 | } 80 | 81 | second_stage_install () { 82 | x_core_install () { 83 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 84 | } 85 | 86 | p () { 87 | baseprog="$(($baseprog + ${1:-1}))" 88 | } 89 | 90 | if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then 91 | setup_proc_symlink 92 | else 93 | setup_proc 94 | in_target /sbin/ldconfig 95 | fi 96 | 97 | DEBIAN_FRONTEND=noninteractive 98 | DEBCONF_NONINTERACTIVE_SEEN=true 99 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 100 | 101 | baseprog=0 102 | bases=7 103 | 104 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 105 | info INSTCORE "Installing core packages..." 106 | 107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 108 | ln -sf mawk "$TARGET/usr/bin/awk" 109 | x_core_install base-files base-passwd 110 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 111 | x_core_install dpkg 112 | 113 | if [ ! -e "$TARGET/etc/localtime" ]; then 114 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 115 | fi 116 | 117 | if doing_variant fakechroot; then 118 | install_fakechroot_tools 119 | fi 120 | 121 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 122 | x_core_install $LIBC 123 | 124 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 125 | x_core_install perl-base 126 | 127 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 128 | rm "$TARGET/usr/bin/awk" 129 | x_core_install mawk 130 | 131 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 132 | if doing_variant -; then 133 | x_core_install debconf 134 | fi 135 | 136 | baseprog=0 137 | bases=$(set -- $required; echo $#) 138 | 139 | info UNPACKREQ "Unpacking required packages..." 140 | 141 | smallyes '' | 142 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 143 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | 144 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 145 | 146 | info CONFREQ "Configuring required packages..." 147 | 148 | if doing_variant fakechroot; then 149 | # fix initscripts postinst (no mounting possible, and wrong if condition) 150 | sed -i '/dpkg.*--compare-versions/ s/\/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst" 151 | fi 152 | 153 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 154 | echo \ 155 | "#!/bin/sh 156 | echo 157 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 158 | chmod 755 "$TARGET/sbin/start-stop-daemon" 159 | 160 | setup_dselect_method apt 161 | 162 | smallyes '' | 163 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 164 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | 165 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 166 | 167 | baseprog=0 168 | bases="$(set -- $base; echo $#)" 169 | 170 | info UNPACKBASE "Unpacking the base system..." 171 | 172 | smallyes '' | 173 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 174 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | 175 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 176 | 177 | info CONFBASE "Configuring the base system..." 178 | 179 | smallyes '' | 180 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \ 181 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | 182 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 183 | 184 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 185 | 186 | progress $bases $bases CONFBASE "Configuring base system" 187 | info BASESUCCESS "Base system installed successfully." 188 | } 189 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/etch: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | finddebs_style from-indices 4 | variants - buildd fakechroot minbase 5 | default_mirror http://archive.debian.org/debian 6 | keyring /usr/share/keyrings/debian-archive-removed-keys.gpg 7 | force_md5 8 | 9 | # include common settings 10 | if [ -e "$DEBOOTSTRAP_DIR/scripts/debian-common" ]; then 11 | . "$DEBOOTSTRAP_DIR/scripts/debian-common" 12 | elif [ -e /debootstrap/debian-common ]; then 13 | . /debootstrap/debian-common 14 | elif [ -e "$DEBOOTSTRAP_DIR/debian-common" ]; then 15 | . "$DEBOOTSTRAP_DIR/debian-common" 16 | else 17 | error 1 NOCOMMON "File not found: debian-common" 18 | fi 19 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/etch-m68k: -------------------------------------------------------------------------------- 1 | etch -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/feisty: -------------------------------------------------------------------------------- 1 | case $ARCH in 2 | amd64|i386|powerpc|sparc) 3 | default_mirror http://old-releases.ubuntu.com/ubuntu 4 | ;; 5 | *) 6 | default_mirror http://ports.ubuntu.com/ubuntu-ports 7 | ;; 8 | esac 9 | mirror_style release 10 | download_style apt 11 | finddebs_style from-indices 12 | variants - buildd fakechroot 13 | 14 | if doing_variant fakechroot; then 15 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" 16 | fi 17 | 18 | case $ARCH in 19 | alpha|ia64) LIBC="libc6.1" ;; 20 | *) LIBC="libc6" ;; 21 | esac 22 | 23 | work_out_debs () { 24 | required="$(get_debs Priority: required)" 25 | 26 | if doing_variant -; then 27 | #required="$required $(get_debs Priority: important)" 28 | # ^^ should be getting debconf here somehow maybe 29 | base="$(get_debs Priority: important)" 30 | elif doing_variant buildd; then 31 | # TODO: add Build-Essential: yes extraoverrides 32 | #base="$(get_debs Build-Essential: yes)" 33 | 34 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; } 35 | 36 | base="apt binutils cpio cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 ${LIBC}-dev libdb4.4 libgdbm3 libstdc++6 libstdc++6-4.1-dev linux-libc-dev make patch perl perl-modules" 37 | 38 | add ia64 base "libunwind7-dev" 39 | add sparc base "lib64gcc1" 40 | add sparc base "libc6-dev-sparc64" 41 | add sparc base "libc6-sparc64" 42 | elif doing_variant fakechroot; then 43 | base="apt" 44 | fi 45 | } 46 | 47 | first_stage_install () { 48 | extract $required 49 | 50 | mkdir -p "$TARGET/var/lib/dpkg" 51 | : >"$TARGET/var/lib/dpkg/status" 52 | : >"$TARGET/var/lib/dpkg/available" 53 | 54 | setup_etc 55 | if [ ! -e "$TARGET/etc/fstab" ]; then 56 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 57 | chmod 644 "$TARGET/etc/fstab" 58 | fi 59 | 60 | setup_devices 61 | 62 | x_feign_install () { 63 | local pkg="$1" 64 | local deb="$(debfor $pkg)" 65 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 66 | 67 | mkdir -p "$TARGET/var/lib/dpkg/info" 68 | 69 | echo \ 70 | "Package: $pkg 71 | Version: $ver 72 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 73 | 74 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 75 | } 76 | 77 | x_feign_install dpkg 78 | } 79 | 80 | second_stage_install () { 81 | x_core_install () { 82 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 83 | } 84 | 85 | p () { 86 | baseprog="$(($baseprog + ${1:-1}))" 87 | } 88 | 89 | if doing_variant fakechroot || [ "$CONTAINER" = "docker" ]; then 90 | setup_proc_symlink 91 | else 92 | setup_proc 93 | in_target /sbin/ldconfig 94 | fi 95 | 96 | DEBIAN_FRONTEND=noninteractive 97 | DEBCONF_NONINTERACTIVE_SEEN=true 98 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 99 | 100 | baseprog=0 101 | bases=7 102 | 103 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 104 | info INSTCORE "Installing core packages..." 105 | 106 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 107 | ln -sf mawk "$TARGET/usr/bin/awk" 108 | x_core_install base-files base-passwd 109 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 110 | x_core_install dpkg 111 | 112 | if [ ! -e "$TARGET/etc/localtime" ]; then 113 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 114 | fi 115 | 116 | if doing_variant fakechroot; then 117 | install_fakechroot_tools 118 | fi 119 | 120 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 121 | x_core_install $LIBC 122 | 123 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 124 | x_core_install perl-base 125 | 126 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 127 | rm "$TARGET/usr/bin/awk" 128 | x_core_install mawk 129 | 130 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 131 | if doing_variant -; then 132 | x_core_install debconf 133 | fi 134 | 135 | baseprog=0 136 | bases=$(set -- $required; echo $#) 137 | 138 | info UNPACKREQ "Unpacking required packages..." 139 | 140 | smallyes '' | 141 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \ 142 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | 143 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 144 | 145 | info CONFREQ "Configuring required packages..." 146 | 147 | if doing_variant fakechroot; then 148 | # fix initscripts postinst (no mounting possible, and wrong if condition) 149 | sed -i '/dpkg.*--compare-versions/ s/\/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst" 150 | 151 | # kill libdevmapper postinst; it tries to create /dev/mapper/ 152 | rm "$TARGET/var/lib/dpkg/info/libdevmapper1"*.postinst 153 | fi 154 | 155 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 156 | echo \ 157 | "#!/bin/sh 158 | echo 159 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 160 | chmod 755 "$TARGET/sbin/start-stop-daemon" 161 | 162 | setup_dselect_method apt 163 | 164 | smallyes '' | 165 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \ 166 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | 167 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 168 | 169 | baseprog=0 170 | bases="$(set -- $base; echo $#)" 171 | 172 | info UNPACKBASE "Unpacking the base system..." 173 | 174 | smallyes '' | 175 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \ 176 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | 177 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 178 | 179 | info CONFBASE "Configuring the base system..." 180 | 181 | smallyes '' | 182 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \ 183 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | 184 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 185 | 186 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 187 | 188 | progress $bases $bases CONFBASE "Configuring base system" 189 | info BASESUCCESS "Base system installed successfully." 190 | } 191 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/hardy: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/hoary: -------------------------------------------------------------------------------- 1 | default_mirror http://old-releases.ubuntu.com/ubuntu 2 | mirror_style release 3 | download_style apt 4 | 5 | case $ARCH in 6 | ia64) LIBC="libc6.1" ;; 7 | *) LIBC="libc6" ;; 8 | esac 9 | 10 | work_out_debs () { 11 | 12 | required="base-files base-passwd bash bsdutils coreutils libacl1 libattr1 debconf debconf-i18n liblocale-gettext-perl libtext-iconv-perl libtext-wrapi18n-perl libtext-charwidth-perl debianutils diff dpkg dselect libblkid1 e2fsprogs e2fslibs libcomerr2 libss2 libuuid1 findutils grep gzip hostname libcap1 libdb1-compat libdb3 libncurses5 libnewt0.51 libpam-modules libpam-runtime libpam0g libpopt0 login makedev mawk mount ncurses-base ncurses-bin passwd perl-base procps python-minimal python2.4-minimal sed slang1a-utf8 lsb-base initscripts sysvinit sysv-rc tar util-linux zlib1g whiptail libgcc1 gcc-3.3-base libstdc++5" 13 | 14 | base="adduser alsa-base alsa-utils apt apt-utils aptitude at base-config bind9-host bsdmainutils bzip2 console-common console-data console-tools cpio cramfsprogs cron dash dhcp3-client dhcp3-common discover1 discover1-data dmsetup dnsutils dosfstools ed eject ethtool evms evms-ncurses fdutils file ftp gettext-base gnupg grepmap groff-base hdparm hotplug ifrename ifupdown info initrd-tools iproute iptables iputils-arping iputils-ping iputils-tracepath jfsutils klogd less libasound2 libbz2-1.0 libconsole libdb4.2 libdevmapper1.00 libdiscover1 libdns16 libevms-2.5 libfribidi0 libgc1 libgcrypt11 libgdbm3 libgnutls11 libgpg-error0 libgpmg1 libidn11 libisc7 libiw27 libldap2 liblockfile1 liblwres1 liblzo1 libmagic1 libncursesw5 libopencdk8 libparted1.6-12 libpcap0.8 libreiserfs0.3-0 libsasl2 libsasl2-modules libsigc++-1.2-5c102 libssl0.9.7 libtasn1-2 libusb-0.1-4 libwrap0 locales logrotate lsb-release lshw lsof lvm-common lvm10 lvm2 mailx man-db manpages mdadm mii-diag mime-support module-init-tools mtr-tiny mutt nano net-tools netbase netcat netkit-inetd ntp ntpdate openssh-client parted pciutils popularity-contest postfix postfix-tls ppp pppconfig pppoeconf psmisc python python2.4 reiser4progs reiserfsprogs reportbug rsync strace sudo sysklogd tcpd tcpdump telnet time ubuntu-base ubuntu-keyring udev usbutils vim vim-common w3m wget wireless-tools xfsprogs" 15 | 16 | without_package () { 17 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 18 | } 19 | subst_package () { 20 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 21 | } 22 | 23 | case $ARCH in 24 | "i386") 25 | required="$required libc6 libc6-i686" 26 | base="$base dmidecode libelfg0 ltrace memtest86+ libreadline4" 27 | ;; 28 | "powerpc") 29 | required="$required libc6 libreadline4" 30 | base="$base hfsplus hfsutils libelfg0 libhfsp0 ltrace mac-fdisk pmac-fdisk powerpc-utils" 31 | ;; 32 | "amd64") 33 | required="$required libc6" 34 | base="$base dmidecode libelfg0 ltrace memtest86+ libreadline4" 35 | ;; 36 | "ia64") 37 | required="$required libc6.1 libunwind7" 38 | base="$base dmidecode libreadline4" 39 | ;; 40 | "sparc") 41 | required="$required libc6" 42 | base="$base lib64gcc1 libc6-sparc64 libreadline4" 43 | ;; 44 | *) 45 | # who knows? 46 | ;; 47 | esac 48 | } 49 | 50 | install_debs () { 51 | first_stage_install 52 | second_stage_install 53 | } 54 | 55 | first_stage_install () { 56 | extract $required 57 | 58 | mkdir -p "$TARGET/var/lib/dpkg" 59 | : >"$TARGET/var/lib/dpkg/status" 60 | echo >"$TARGET/var/lib/dpkg/available" 61 | 62 | setup_etc 63 | if [ ! -e "$TARGET/etc/fstab" ]; then 64 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 65 | chmod 644 "$TARGET/etc/fstab" 66 | fi 67 | 68 | setup_devices 69 | 70 | x_feign_install () { 71 | local pkg="$1" 72 | local deb="$(debfor $pkg)" 73 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 74 | 75 | mkdir -p "$TARGET/var/lib/dpkg/info" 76 | 77 | echo \ 78 | "Package: $pkg 79 | Version: $ver 80 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 81 | 82 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 83 | } 84 | 85 | x_feign_install dpkg 86 | } 87 | 88 | second_stage_install () { 89 | x_core_install () { 90 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 91 | } 92 | p () { 93 | baseprog="$(($baseprog + ${1:-1}))" 94 | } 95 | 96 | DEBIAN_FRONTEND=noninteractive 97 | DEBCONF_NONINTERACTIVE_SEEN=true 98 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 99 | 100 | baseprog=0 101 | bases=7 102 | 103 | setup_proc 104 | umount_on_exit /.dev 105 | umount_on_exit /dev 106 | in_target /sbin/ldconfig 107 | 108 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 109 | info INSTCORE "Installing core packages..." 110 | 111 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 112 | ln -sf mawk "$TARGET/usr/bin/awk" 113 | x_core_install base-files base-passwd 114 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 115 | x_core_install dpkg 116 | 117 | if [ ! -e "$TARGET/etc/localtime" ]; then 118 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 119 | fi 120 | 121 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 122 | x_core_install $LIBC 123 | 124 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 125 | x_core_install perl-base 126 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 127 | rm "$TARGET/usr/bin/awk" 128 | x_core_install mawk 129 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 130 | x_core_install debconf 131 | 132 | baseprog=0 133 | bases="$(set -- $required; echo $#)" 134 | 135 | info UNPACKREQ "Unpacking required packages..." 136 | 137 | smallyes '' | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 138 | 139 | baseprog=0 140 | 141 | info CONFREQ "Configuring required packages..." 142 | 143 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 144 | echo \ 145 | "#!/bin/sh 146 | echo 147 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 148 | chmod 755 "$TARGET/sbin/start-stop-daemon" 149 | 150 | setup_dselect_method apt 151 | #on_exit "(in_target_nofail umount /dev/pts) || true" 152 | 153 | smallyes '' | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 154 | 155 | baseprog=0 156 | bases="$(set -- $base; echo $#)" 157 | 158 | info UNPACKBASE "Unpacking the base system..." 159 | 160 | smallyes '' | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 161 | 162 | baseprog=0 163 | 164 | info CONFBASE "Configuring the base system..." 165 | 166 | mv "$TARGET/usr/sbin/sendmail" "$TARGET/usr/sbin/sendmail.REAL" 167 | ln -s /bin/true "$TARGET/usr/sbin/sendmail" 168 | 169 | smallyes '' | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 170 | 171 | rm -f "$TARGET/usr/sbin/sendmail" 172 | mv "$TARGET/usr/sbin/sendmail.REAL" "$TARGET/usr/sbin/sendmail" 173 | 174 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 175 | 176 | progress $bases $bases CONFBASE "Configuring base system" 177 | info BASESUCCESS "Base system installed successfully." 178 | } 179 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/hoary.buildd: -------------------------------------------------------------------------------- 1 | default_mirror http://old-releases.ubuntu.com/ubuntu 2 | mirror_style release 3 | download_style apt 4 | 5 | LIBC=libc6 6 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 7 | LIBC="libc6.1" 8 | fi 9 | 10 | work_out_debs () { 11 | required="base-files base-passwd bash bsdutils build-essential coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs fakeroot findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login lsb-base mawk mount ncurses-base ncurses-bin passwd perl-base pkgstriptranslations python-minimal python2.4-minimal sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g" 12 | 13 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules" 14 | 15 | without_package () { 16 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 17 | } 18 | subst_package () { 19 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 20 | } 21 | 22 | case $ARCH in 23 | "amd64") 24 | ;; 25 | "i386") 26 | ;; 27 | "powerpc") 28 | ;; 29 | "ia64") 30 | required="$(subst_package "libc6" "libc6.1" "$required")" 31 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 32 | base="$base libunwind7 libunwind7-dev" 33 | ;; 34 | 35 | # Unsupported architectures: 36 | "alpha") 37 | required="$(subst_package "libc6" "libc6.1" "$required")" 38 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 39 | ;; 40 | *) 41 | # who knows? 42 | ;; 43 | esac 44 | } 45 | 46 | install_debs () { 47 | first_stage_install 48 | second_stage_install 49 | } 50 | 51 | first_stage_install () { 52 | extract $required 53 | 54 | mkdir -p "$TARGET/var/lib/dpkg" 55 | : >"$TARGET/var/lib/dpkg/status" 56 | echo >"$TARGET/var/lib/dpkg/available" 57 | 58 | setup_etc 59 | if [ ! -e "$TARGET/etc/fstab" ]; then 60 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 61 | chmod 644 "$TARGET/etc/fstab" 62 | fi 63 | 64 | setup_devices 65 | 66 | x_feign_install () { 67 | local pkg="$1" 68 | local deb="$(debfor $pkg)" 69 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 70 | 71 | mkdir -p "$TARGET/var/lib/dpkg/info" 72 | 73 | echo \ 74 | "Package: $pkg 75 | Version: $ver 76 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 77 | 78 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 79 | } 80 | 81 | x_feign_install dpkg 82 | } 83 | 84 | second_stage_install () { 85 | x_core_install () { 86 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 87 | } 88 | p () { 89 | baseprog="$(($baseprog + ${1:-1}))" 90 | } 91 | 92 | DEBIAN_FRONTEND=noninteractive 93 | export DEBIAN_FRONTEND 94 | 95 | baseprog=0 96 | bases=40 97 | 98 | setup_proc 99 | in_target /sbin/ldconfig 100 | 101 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 102 | info INSTCORE "Installing core packages..." 103 | 104 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 105 | ln -sf mawk "$TARGET/usr/bin/awk" 106 | x_core_install base-files base-passwd 107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 108 | x_core_install dpkg 109 | 110 | if [ ! -e "$TARGET/etc/localtime" ]; then 111 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 112 | fi 113 | 114 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 115 | x_core_install $LIBC 116 | 117 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 118 | x_core_install perl-base 119 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 120 | rm "$TARGET/usr/bin/awk" 121 | x_core_install mawk 122 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 123 | 124 | info UNPACKREQ "Unpacking required packages..." 125 | 126 | p; progress $baseprog $bases INSTCORE "Installing core packages" #8 127 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 128 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #18 129 | 130 | info CONFREQ "Configuring required packages..." 131 | 132 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 133 | echo \ 134 | "#!/bin/sh 135 | echo 136 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 137 | chmod 755 "$TARGET/sbin/start-stop-daemon" 138 | 139 | setup_dselect_method apt 140 | #on_exit "in_target_nofail umount /dev/pts" 141 | 142 | p; progress $baseprog $bases INSTCORE "Installing core packages" #19 143 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 144 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #29 145 | 146 | info INSTCORE "Installing base packages..." 147 | 148 | p; progress $baseprog $bases INSTCORE "Installing core packages" #30 149 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 150 | 151 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 152 | 153 | p 9; progress $baseprog $bases INSTCORE "Installing core packages" #39 154 | 155 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 156 | 157 | progress $bases $bases INSTCORE "Installing core packages" #40 158 | info BASESUCCESS "Base system installed successfully." 159 | } 160 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/intrepid: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/jaunty: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/jessie: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/jessie-kfreebsd: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/kali: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | finddebs_style from-indices 4 | variants - buildd fakechroot minbase 5 | keyring /usr/share/keyrings/kali-archive-keyring.gpg 6 | default_mirror http://http.kali.org/kali 7 | 8 | # include common settings 9 | if [ -e "$DEBOOTSTRAP_DIR/scripts/debian-common" ]; then 10 | . "$DEBOOTSTRAP_DIR/scripts/debian-common" 11 | elif [ -e /debootstrap/debian-common ]; then 12 | . /debootstrap/debian-common 13 | elif [ -e "$DEBOOTSTRAP_DIR/debian-common" ]; then 14 | . "$DEBOOTSTRAP_DIR/debian-common" 15 | else 16 | error 1 NOCOMMON "File not found: debian-common" 17 | fi 18 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/kali-dev: -------------------------------------------------------------------------------- 1 | kali -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/kali-last-snapshot: -------------------------------------------------------------------------------- 1 | kali -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/kali-rolling: -------------------------------------------------------------------------------- 1 | kali -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/karmic: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/lenny: -------------------------------------------------------------------------------- 1 | etch -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/lucid: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/maverick: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/moto: -------------------------------------------------------------------------------- 1 | kali -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/natty: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/oldoldstable: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/oldstable: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/oneiric: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/potato: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt var-state 3 | default_mirror http://archive.debian.org/debian 4 | keyring /usr/share/keyrings/debian-archive-removed-keys.gpg 5 | force_md5 6 | 7 | LIBC=libc6 8 | if [ "$ARCH" = alpha ]; then 9 | LIBC="libc6.1" 10 | fi 11 | 12 | work_out_debs () { 13 | required="base-files base-passwd bash bsdutils debconf-tiny debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname ldso libc6 libdb2 libgdbmg1 libncurses5 libnewt0 libpam-modules libpam-runtime libpam0g libpopt0 libreadline4 libstdc++2.10 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-5.005-base perl-base procps sed shellutils slang1 sysklogd sysvinit tar textutils update util-linux whiptail" 14 | 15 | base="adduser ae apt base-config elvis-tiny fbset fdutils gettext-base console-data console-tools console-tools-libs libdb2 libwrap0 locales modconf netbase ftp ppp pppconfig pump tasksel tcpd textutils telnet xviddetect" 16 | 17 | without_package () { 18 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 19 | } 20 | 21 | case $ARCH in 22 | "alpha") 23 | required="$(without_package "libc6" "$required") libc6.1" 24 | ;; 25 | "i386") 26 | base="$base fdflush isapnptools lilo mbr pciutils pcmcia-cs psmisc setserial syslinux" 27 | ;; 28 | *) 29 | # other arches may have special needs not yet represented here 30 | # oh well, Potato is old 31 | esac 32 | } 33 | 34 | first_stage_install () { 35 | extract $required 36 | 37 | :> "$TARGET/var/lib/dpkg/status" 38 | echo > "$TARGET/var/lib/dpkg/available" 39 | 40 | setup_etc 41 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 42 | chmod 644 "$TARGET/etc/fstab" 43 | 44 | x_feign_install () { 45 | local pkg=$1 46 | local deb="$(debfor $pkg)" 47 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 48 | 49 | mkdir -p "$TARGET/var/lib/dpkg/info" 50 | 51 | echo \ 52 | "Package: $pkg 53 | Version: $ver 54 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 55 | 56 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 57 | } 58 | 59 | setup_devices 60 | 61 | x_feign_install dpkg 62 | 63 | if [ -e "$TARGET/usr/bin/perl-5.005.dist" ]; then 64 | mv "$TARGET/usr/bin/perl-5.005.dist" "$TARGET/usr/bin/perl-5.005" 65 | fi 66 | if [ ! -e "$TARGET/usr/bin/perl" ]; then 67 | ln -sf perl-5.005 "$TARGET/usr/bin/perl" 68 | fi 69 | } 70 | 71 | second_stage_install () { 72 | x_core_install () { 73 | in_target dpkg --force-depends --install $(debfor "$@") 74 | } 75 | 76 | export DEBIAN_FRONTEND=Noninteractive 77 | 78 | setup_proc 79 | ln "$TARGET/sbin/ldconfig.new" "$TARGET/sbin/ldconfig" 80 | in_target /sbin/ldconfig 81 | 82 | x_core_install base-files base-passwd ldso 83 | x_core_install dpkg 84 | 85 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 86 | x_core_install $LIBC 87 | 88 | smallyes '' | x_core_install perl-5.005-base 89 | x_core_install mawk 90 | x_core_install debconf-tiny 91 | 92 | in_target dpkg-preconfigure $(debfor $required $base) 93 | 94 | repeatn 5 in_target dpkg --force-depends --unpack $(debfor $required) 95 | 96 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 97 | cp "$TARGET/bin/true" "$TARGET/sbin/start-stop-daemon" 98 | 99 | setup_dselect_method apt 100 | 101 | in_target dpkg --configure --pending --force-configure-any --force-depends 102 | 103 | smallyes '' | repeatn 5 in_target dpkg --force-auto-select --force-overwrite --skip-same-version --install $(debfor $base) 104 | 105 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 106 | } 107 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/precise: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/quantal: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/raring: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/sana: -------------------------------------------------------------------------------- 1 | kali -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/sarge.buildd: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | force_md5 4 | 5 | LIBC=libc6 6 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 7 | LIBC="libc6.1" 8 | fi 9 | 10 | work_out_debs () { 11 | 12 | required="base-files base-passwd bash bsdutils coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login mawk mount ncurses-base ncurses-bin passwd perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g" 13 | 14 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules" 15 | 16 | without_package () { 17 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 18 | } 19 | subst_package () { 20 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 21 | } 22 | 23 | case $ARCH in 24 | "alpha") 25 | required="$(subst_package "libc6" "libc6.1" "$required")" 26 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 27 | ;; 28 | "arm") 29 | ;; 30 | "i386") 31 | ;; 32 | "ia64") 33 | required="$(subst_package "libc6" "libc6.1" "$required")" 34 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 35 | ;; 36 | "m68k") 37 | ;; 38 | "powerpc") 39 | ;; 40 | "sparc") 41 | ;; 42 | "mips") 43 | ;; 44 | "mipsel") 45 | ;; 46 | "hppa") 47 | ;; 48 | s390|s390x) 49 | ;; 50 | sh*) 51 | ;; 52 | *) 53 | # who knows? 54 | ;; 55 | esac 56 | } 57 | 58 | first_stage_install () { 59 | extract $required 60 | 61 | mkdir -p "$TARGET/var/lib/dpkg" 62 | : >"$TARGET/var/lib/dpkg/status" 63 | echo >"$TARGET/var/lib/dpkg/available" 64 | 65 | setup_etc 66 | if [ ! -e "$TARGET/etc/fstab" ]; then 67 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 68 | chmod 644 "$TARGET/etc/fstab" 69 | fi 70 | 71 | setup_devices 72 | 73 | x_feign_install () { 74 | local pkg="$1" 75 | local deb="$(debfor $pkg)" 76 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 77 | 78 | mkdir -p "$TARGET/var/lib/dpkg/info" 79 | 80 | echo \ 81 | "Package: $pkg 82 | Version: $ver 83 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 84 | 85 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 86 | } 87 | 88 | x_feign_install dpkg 89 | } 90 | 91 | second_stage_install () { 92 | x_core_install () { 93 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 94 | } 95 | 96 | p () { 97 | baseprog="$(($baseprog + ${1:-1}))" 98 | } 99 | 100 | setup_proc 101 | in_target /sbin/ldconfig 102 | 103 | DEBIAN_FRONTEND=noninteractive 104 | export DEBIAN_FRONTEND 105 | 106 | baseprog=0 107 | bases=40 108 | 109 | p; progress $baseprog $bases INSTBASE "Installing base system" #1 110 | info INSTCORE "Installing core packages..." 111 | 112 | p; progress $baseprog $bases INSTBASE "Installing base system" #2 113 | ln -sf mawk "$TARGET/usr/bin/awk" 114 | x_core_install base-files base-passwd 115 | p; progress $baseprog $bases INSTBASE "Installing base system" #3 116 | x_core_install dpkg 117 | 118 | if [ ! -e "$TARGET/etc/localtime" ]; then 119 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 120 | fi 121 | 122 | p; progress $baseprog $bases INSTBASE "Installing base system" #4 123 | x_core_install $LIBC 124 | 125 | p; progress $baseprog $bases INSTBASE "Installing base system" #5 126 | x_core_install perl-base 127 | p; progress $baseprog $bases INSTBASE "Installing base system" #6 128 | rm "$TARGET/usr/bin/awk" 129 | x_core_install mawk 130 | p; progress $baseprog $bases INSTBASE "Installing base system" #7 131 | 132 | info UNPACKREQ "Unpacking required packages..." 133 | 134 | p; progress $baseprog $bases INSTBASE "Installing base system" #8 135 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 136 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18 137 | 138 | info CONFREQ "Configuring required packages..." 139 | 140 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 141 | echo \ 142 | "#!/bin/sh 143 | echo 144 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 145 | chmod 755 "$TARGET/sbin/start-stop-daemon" 146 | 147 | setup_dselect_method apt 148 | 149 | p; progress $baseprog $bases INSTBASE "Installing base system" #19 150 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 151 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29 152 | 153 | info INSTBASE "Installing base packages..." 154 | 155 | p; progress $baseprog $bases INSTBASE "Installing base system" #30 156 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 157 | 158 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 159 | 160 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39 161 | 162 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 163 | 164 | progress $bases $bases INSTBASE "Installing base system" #40 165 | info BASESUCCESS "Base system installed successfully." 166 | } 167 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/sarge.fakechroot: -------------------------------------------------------------------------------- 1 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started" 2 | 3 | mirror_style release 4 | download_style apt 5 | force_md5 6 | 7 | LIBC=libc6 8 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 9 | LIBC="libc6.1" 10 | fi 11 | 12 | work_out_debs () { 13 | 14 | required="base-files base-passwd bash bsdutils coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login mawk mount ncurses-base ncurses-bin passwd perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g" 15 | 16 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules" 17 | 18 | without_package () { 19 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 20 | } 21 | subst_package () { 22 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 23 | } 24 | 25 | required="$required binutils fakechroot" 26 | base="$(without_package "binutils" "$base")" 27 | 28 | case $ARCH in 29 | "alpha") 30 | required="$(subst_package "libc6" "libc6.1" "$required")" 31 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 32 | ;; 33 | "arm") 34 | ;; 35 | "i386") 36 | ;; 37 | "ia64") 38 | required="$(subst_package "libc6" "libc6.1" "$required")" 39 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 40 | ;; 41 | "m68k") 42 | ;; 43 | "powerpc") 44 | ;; 45 | "sparc") 46 | ;; 47 | "mips") 48 | ;; 49 | "mipsel") 50 | ;; 51 | "hppa") 52 | ;; 53 | s390|s390x) 54 | ;; 55 | sh*) 56 | ;; 57 | *) 58 | # who knows? 59 | ;; 60 | esac 61 | } 62 | 63 | first_stage_install () { 64 | extract $required 65 | 66 | mkdir -p "$TARGET/var/lib/dpkg" 67 | : >"$TARGET/var/lib/dpkg/status" 68 | : >"$TARGET/var/lib/dpkg/available" 69 | 70 | setup_etc 71 | if [ ! -e "$TARGET/etc/fstab" ]; then 72 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 73 | chmod 644 "$TARGET/etc/fstab" 74 | fi 75 | 76 | x_feign_install () { 77 | local pkg="$1" 78 | local deb="$(debfor $pkg)" 79 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 80 | 81 | mkdir -p "$TARGET/var/lib/dpkg/info" 82 | 83 | echo \ 84 | "Package: $pkg 85 | Version: $ver 86 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 87 | 88 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 89 | } 90 | 91 | x_feign_install dpkg 92 | } 93 | 94 | second_stage_install () { 95 | x_core_install () { 96 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 97 | } 98 | 99 | p () { 100 | baseprog="$(($baseprog + ${1:-1}))" 101 | } 102 | 103 | setup_devices_fakechroot 104 | setup_proc_symlink 105 | 106 | DEBIAN_FRONTEND=noninteractive 107 | export DEBIAN_FRONTEND 108 | 109 | baseprog=0 110 | bases=40 111 | 112 | p; progress $baseprog $bases INSTBASE "Installing base system" #1 113 | info INSTCORE "Installing core packages..." 114 | 115 | p; progress $baseprog $bases INSTBASE "Installing base system" #2 116 | ln -sf mawk "$TARGET/usr/bin/awk" 117 | x_core_install base-files base-passwd 118 | p; progress $baseprog $bases INSTBASE "Installing base system" #3 119 | x_core_install dpkg 120 | 121 | if [ ! -e "$TARGET/etc/localtime" ]; then 122 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 123 | fi 124 | 125 | install_fakechroot_tools 126 | 127 | p; progress $baseprog $bases INSTBASE "Installing base system" #4 128 | x_core_install $LIBC 129 | 130 | p; progress $baseprog $bases INSTBASE "Installing base system" #5 131 | x_core_install perl-base 132 | p; progress $baseprog $bases INSTBASE "Installing base system" #6 133 | rm "$TARGET/usr/bin/awk" 134 | x_core_install mawk 135 | p; progress $baseprog $bases INSTBASE "Installing base system" #7 136 | 137 | info UNPACKREQ "Unpacking required packages..." 138 | 139 | p; progress $baseprog $bases INSTBASE "Installing base system" #8 140 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 141 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18 142 | 143 | info CONFREQ "Configuring required packages..." 144 | 145 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 146 | echo \ 147 | "#!/bin/sh 148 | echo 149 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 150 | chmod 755 "$TARGET/sbin/start-stop-daemon" 151 | 152 | setup_dselect_method apt 153 | 154 | p; progress $baseprog $bases INSTBASE "Installing base system" #19 155 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 156 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29 157 | 158 | info INSTBASE "Installing base packages..." 159 | 160 | p; progress $baseprog $bases INSTBASE "Installing base system" #30 161 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 162 | 163 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 164 | 165 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39 166 | 167 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 168 | 169 | progress $bases $bases INSTBASE "Installing base system" #40 170 | info BASESUCCESS "Base system installed successfully." 171 | } 172 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/saucy: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/sid: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | finddebs_style from-indices 4 | variants - buildd fakechroot minbase 5 | keyring /usr/share/keyrings/debian-archive-keyring.gpg 6 | 7 | # include common settings 8 | if [ -e "$DEBOOTSTRAP_DIR/scripts/debian-common" ]; then 9 | . "$DEBOOTSTRAP_DIR/scripts/debian-common" 10 | elif [ -e /debootstrap/debian-common ]; then 11 | . /debootstrap/debian-common 12 | elif [ -e "$DEBOOTSTRAP_DIR/debian-common" ]; then 13 | . "$DEBOOTSTRAP_DIR/debian-common" 14 | else 15 | error 1 NOCOMMON "File not found: debian-common" 16 | fi 17 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/squeeze: -------------------------------------------------------------------------------- 1 | etch -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/stable: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/stretch: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/testing: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/trusty: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/unstable: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/utopic: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/vivid: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/warty: -------------------------------------------------------------------------------- 1 | default_mirror http://old-releases.ubuntu.com/ubuntu 2 | mirror_style release 3 | download_style apt 4 | 5 | LIBC=libc6 6 | 7 | work_out_debs () { 8 | 9 | required="base-files base-passwd bash bsdutils coreutils libacl1 libattr1 debconf debconf-i18n liblocale-gettext-perl libtext-iconv-perl libtext-wrapi18n-perl libtext-charwidth-perl debianutils diff dpkg dselect libblkid1 e2fsprogs e2fslibs libcomerr2 libss2 libuuid1 findutils grep gzip hostname libcap1 libc6 libdb1-compat libdb3 libncurses5 libnewt0.51 libpam-modules libpam-runtime libpam0g libpopt0 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed slang1a-utf8 lsb-base initscripts sysvinit sysv-rc tar util-linux zlib1g whiptail libgcc1 gcc-3.3-base libstdc++5" 10 | 11 | base="adduser alsa-base alsa-utils apt apt-utils aptitude at base-config bind9-host bsdmainutils bzip2 console-common console-data console-tools cpio cramfsprogs cron dash dbus-1 dhcp3-client dhcp3-common discover1 discover1-data dmsetup dnsutils dosfstools ed eject evms evms-ncurses fdutils file ftp gettext-base gnupg groff-base hdparm hotplug ifrename ifupdown info initrd-tools iproute iptables iputils-arping iputils-ping iputils-tracepath jfsutils klogd less libasound2 libatm1 libbz2-1.0 libconsole libdb4.2 libdevmapper1.00 libdiscover1 libdns16 libevms-2.3 libexpat1 libfribidi0 libgc1 libgcrypt7 libgdbm3 libgnutls10 libgpg-error0 libgpmg1 libidn11 libisc7 libiw27 libldap2 liblockfile1 liblwres1 liblzo1 libmagic1 libncursesw5 libopencdk8 libparted1.6-0 libpcap0.7 libpcap0.8 libreiserfs0.3-0 libsasl2 libsigc++-1.2-5c102 libssl0.9.7 libtasn1-2 libusb-0.1-4 libwrap0 locales logrotate lshw lsof ltrace lvm-common lvm10 lvm2 mailx man-db manpages mdadm mii-diag mime-support module-init-tools mtr-tiny mutt nano net-tools netbase netcat netkit-inetd ntp ntpdate openssh-client parted pciutils popularity-contest postfix postfix-tls ppp pppconfig pppoeconf psmisc python python2.3 reiser4progs reiserfsprogs reportbug rsync strace sudo sysklogd tcpd tcpdump telnet time ubuntu-base udev usbutils vim vim-common w3m wget wireless-tools xfsprogs" 12 | 13 | without_package () { 14 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 15 | } 16 | subst_package () { 17 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 18 | } 19 | 20 | case $ARCH in 21 | "i386") 22 | required="$required libc6-i686" 23 | base="$base dmidecode memtest86+ libreadline4" 24 | ;; 25 | "powerpc") 26 | required="$required libreadline4" 27 | base="$base hfsplus hfsutils libhfsp0 mac-fdisk pmac-fdisk powerpc-utils" 28 | ;; 29 | "amd64") 30 | base="$base dmidecode libreadline4" 31 | ;; 32 | *) 33 | # who knows? 34 | ;; 35 | esac 36 | } 37 | 38 | install_debs () { 39 | first_stage_install 40 | second_stage_install 41 | } 42 | 43 | first_stage_install () { 44 | extract $required 45 | 46 | mkdir -p "$TARGET/var/lib/dpkg" 47 | : >"$TARGET/var/lib/dpkg/status" 48 | echo >"$TARGET/var/lib/dpkg/available" 49 | 50 | setup_etc 51 | if [ ! -e "$TARGET/etc/fstab" ]; then 52 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 53 | chmod 644 "$TARGET/etc/fstab" 54 | fi 55 | 56 | setup_devices 57 | 58 | x_feign_install () { 59 | local pkg="$1" 60 | local deb="$(debfor $pkg)" 61 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 62 | 63 | mkdir -p "$TARGET/var/lib/dpkg/info" 64 | 65 | echo \ 66 | "Package: $pkg 67 | Version: $ver 68 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 69 | 70 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 71 | } 72 | 73 | x_feign_install dpkg 74 | } 75 | 76 | second_stage_install () { 77 | x_core_install () { 78 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 79 | } 80 | 81 | p () { 82 | baseprog="$(($baseprog + ${1:-1}))" 83 | } 84 | 85 | DEBIAN_FRONTEND=noninteractive 86 | DEBCONF_NONINTERACTIVE_SEEN=true 87 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN 88 | 89 | setup_proc 90 | in_target /sbin/ldconfig 91 | 92 | baseprog=0 93 | bases=7 94 | 95 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 96 | info INSTCORE "Installing core packages..." 97 | 98 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 99 | ln -sf mawk "$TARGET/usr/bin/awk" 100 | x_core_install base-files base-passwd 101 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 102 | x_core_install dpkg 103 | 104 | if [ ! -e "$TARGET/etc/localtime" ]; then 105 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 106 | fi 107 | 108 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 109 | x_core_install $LIBC 110 | 111 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 112 | x_core_install perl-base 113 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 114 | rm "$TARGET/usr/bin/awk" 115 | x_core_install mawk 116 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 117 | x_core_install debconf 118 | 119 | baseprog=0 120 | bases="$(set -- $required; echo $#)" 121 | 122 | info UNPACKREQ "Unpacking required packages..." 123 | 124 | smallyes '' | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1 125 | 126 | baseprog=0 127 | 128 | info CONFREQ "Configuring required packages..." 129 | 130 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 131 | echo \ 132 | "#!/bin/sh 133 | echo 134 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 135 | chmod 755 "$TARGET/sbin/start-stop-daemon" 136 | 137 | setup_dselect_method apt 138 | #on_exit "(in_target_nofail umount /dev/pts) || true" 139 | 140 | smallyes '' | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1 141 | 142 | baseprog=0 143 | bases="$(set -- $base; echo $#)" 144 | 145 | info UNPACKBASE "Unpacking the base system..." 146 | 147 | smallyes '' | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1 148 | 149 | baseprog=0 150 | 151 | info CONFBASE "Configuring the base system..." 152 | 153 | mv "$TARGET/usr/sbin/sendmail" "$TARGET/usr/sbin/sendmail.REAL" 154 | ln -s /bin/true "$TARGET/usr/sbin/sendmail" 155 | 156 | smallyes '' | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1 157 | 158 | rm -f "$TARGET/usr/sbin/sendmail" 159 | mv "$TARGET/usr/sbin/sendmail.REAL" "$TARGET/usr/sbin/sendmail" 160 | 161 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 162 | 163 | progress $bases $bases CONFBASE "Configuring base system" 164 | info BASESUCCESS "Base system installed successfully." 165 | } 166 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/warty.buildd: -------------------------------------------------------------------------------- 1 | default_mirror http://old-releases.ubuntu.com/ubuntu 2 | mirror_style release 3 | download_style apt 4 | 5 | LIBC=libc6 6 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 7 | LIBC="libc6.1" 8 | fi 9 | 10 | work_out_debs () { 11 | 12 | required="base-files base-passwd bash bsdutils build-essential coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs fakeroot findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login lsb-base mawk mount ncurses-base ncurses-bin perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g" 13 | 14 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules" 15 | 16 | without_package () { 17 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 18 | } 19 | subst_package () { 20 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' ' 21 | } 22 | 23 | case $ARCH in 24 | "amd64") 25 | ;; 26 | "i386") 27 | ;; 28 | "powerpc") 29 | ;; 30 | 31 | # Unsupported architectures: 32 | "alpha") 33 | required="$(subst_package "libc6" "libc6.1" "$required")" 34 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 35 | ;; 36 | "ia64") 37 | required="$(subst_package "libc6" "libc6.1" "$required")" 38 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")" 39 | ;; 40 | *) 41 | # who knows? 42 | ;; 43 | esac 44 | } 45 | 46 | install_debs () { 47 | first_stage_install 48 | second_stage_install 49 | } 50 | 51 | first_stage_install () { 52 | extract $required 53 | 54 | mkdir -p "$TARGET/var/lib/dpkg" 55 | : >"$TARGET/var/lib/dpkg/status" 56 | echo >"$TARGET/var/lib/dpkg/available" 57 | 58 | setup_etc 59 | if [ ! -e "$TARGET/etc/fstab" ]; then 60 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 61 | chmod 644 "$TARGET/etc/fstab" 62 | fi 63 | 64 | setup_devices 65 | 66 | x_feign_install () { 67 | local pkg="$1" 68 | local deb="$(debfor $pkg)" 69 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 70 | 71 | mkdir -p "$TARGET/var/lib/dpkg/info" 72 | 73 | echo \ 74 | "Package: $pkg 75 | Version: $ver 76 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 77 | 78 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 79 | } 80 | 81 | x_feign_install dpkg 82 | } 83 | 84 | second_stage_install () { 85 | x_core_install () { 86 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 87 | } 88 | p () { 89 | baseprog="$(($baseprog + ${1:-1}))" 90 | } 91 | 92 | DEBIAN_FRONTEND=noninteractive 93 | export DEBIAN_FRONTEND 94 | 95 | baseprog=0 96 | bases=40 97 | 98 | setup_proc 99 | in_target /sbin/ldconfig 100 | 101 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1 102 | info INSTCORE "Installing core packages..." 103 | 104 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2 105 | ln -sf mawk "$TARGET/usr/bin/awk" 106 | x_core_install base-files base-passwd 107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3 108 | x_core_install dpkg 109 | 110 | if [ ! -e "$TARGET/etc/localtime" ]; then 111 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 112 | fi 113 | 114 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4 115 | x_core_install $LIBC 116 | 117 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5 118 | x_core_install perl-base 119 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6 120 | rm "$TARGET/usr/bin/awk" 121 | x_core_install mawk 122 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7 123 | 124 | info UNPACKREQ "Unpacking required packages..." 125 | 126 | p; progress $baseprog $bases INSTCORE "Installing core packages" #8 127 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 128 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #18 129 | 130 | info CONFREQ "Configuring required packages..." 131 | 132 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 133 | echo \ 134 | "#!/bin/sh 135 | echo 136 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 137 | chmod 755 "$TARGET/sbin/start-stop-daemon" 138 | 139 | setup_dselect_method apt 140 | #on_exit "in_target_nofail umount /dev/pts" 141 | 142 | p; progress $baseprog $bases INSTCORE "Installing core packages" #19 143 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 144 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #29 145 | 146 | info INSTCORE "Installing base packages..." 147 | 148 | p; progress $baseprog $bases INSTCORE "Installing core packages" #30 149 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 150 | 151 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 152 | 153 | p 9; progress $baseprog $bases INSTCORE "Installing core packages" #39 154 | 155 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 156 | 157 | progress $bases $bases INSTCORE "Installing core packages" #40 158 | info BASESUCCESS "Base system installed successfully." 159 | } 160 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/wheezy: -------------------------------------------------------------------------------- 1 | sid -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/wily: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/woody: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | default_mirror http://archive.debian.org/debian 4 | keyring /usr/share/keyrings/debian-archive-removed-keys.gpg 5 | force_md5 6 | 7 | LIBC=libc6 8 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 9 | LIBC="libc6.1" 10 | fi 11 | 12 | work_out_debs () { 13 | 14 | required="base-files base-passwd bash bsdutils debconf debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname libcap1 libc6 libdb2 libdb3 libncurses5 libnewt0 libpam-modules libpam-runtime libpam0g libperl5.6 libpopt0 libreadline4 libstdc++2.10-glibc2.2 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed shellutils slang1 sysvinit tar textutils util-linux whiptail" 15 | 16 | base="adduser apt apt-utils at base-config bsdmainutils console-common console-tools console-tools-libs console-data cpio cron dhcp-client ed exim fdutils gettext-base groff-base ifupdown info klogd libident libldap2 liblockfile1 libpcre3 libsasl7 libwrap0 logrotate mailx man-db manpages modconf nano net-tools netbase netkit-inetd netkit-ping nvi ppp pppconfig pppoe pppoeconf libpcap0 sysklogd tasksel tcpd telnet" 17 | 18 | without_package () { 19 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 20 | } 21 | 22 | IPFWTOOL=iptables 23 | 24 | case $ARCH in 25 | "alpha") 26 | required="$(without_package "libc6" "$required") libc6.1" 27 | base="$base setserial aboot pciutils" 28 | IPFWTOOL="ipchains" 29 | ;; 30 | "arm") 31 | base="$base setserial libgpmg1" 32 | IPFWTOOL="ipchains iptables" 33 | ;; 34 | "i386") 35 | required="$(without_package "libperl5.6" "$required") mbr" 36 | base="$base lilo pciutils setserial syslinux psmisc pcmcia-cs" 37 | IPFWTOOL="ipchains iptables" 38 | ;; 39 | "ia64") 40 | required="$(without_package "libc6" "$required") libc6.1 gcc-2.96-base" 41 | base="$base elilo efibootmgr dosfstools libparted1.4 parted" 42 | ;; 43 | "m68k") 44 | base="$base atari-bootstrap atari-fdisk amiga-fdisk eject mac-fdisk pmac-fdisk-cross setserial vmelilo" 45 | IPFWTOOL="ipchains" 46 | ;; 47 | "powerpc") 48 | base="$base quik mac-fdisk amiga-fdisk psmisc powerpc-utils setserial pciutils hfsutils yaboot pcmcia-cs" 49 | IPFWTOOL="ipchains iptables" 50 | ;; 51 | "sparc") 52 | base="$base silo eject pciutils sparc-utils" 53 | IPFWTOOL="ipchains iptables" 54 | ;; 55 | "mips") 56 | base="$base dvhtool pciutils setserial" # pcmcia-cs 57 | ;; 58 | "mipsel") 59 | base="$base delo pciutils setserial" # pcmcia-cs 60 | ;; 61 | "hppa") 62 | base="$base palo libstdc++3 gcc-3.0-base" 63 | required="$(without_package "libstdc++2.10-glibc2.2" "$required")" 64 | ;; 65 | s390|s390x) 66 | # base-config depends on console-data and console-common 67 | # so we can't exclude them although they are useless on s390 68 | base="$base s390-tools telnetd devfsd" 69 | base="$(without_package "console-tools" "$base")" 70 | base="$(without_package "console-tools-libs" "$base")" 71 | base="$(without_package "fdutils" "$base")" 72 | base="$(without_package "ppp" "$base")" 73 | base="$(without_package "pppconfig" "$base")" 74 | base="$(without_package "pppoe" "$base")" 75 | base="$(without_package "pppoeconf" "$base")" 76 | ;; 77 | *) 78 | # who knows? 79 | ;; 80 | esac 81 | 82 | base="$base $IPFWTOOL" 83 | } 84 | 85 | first_stage_install () { 86 | extract $required 87 | 88 | mkdir -p "$TARGET/var/lib/dpkg" 89 | : >"$TARGET/var/lib/dpkg/status" 90 | echo >"$TARGET/var/lib/dpkg/available" 91 | 92 | setup_etc 93 | if [ ! -e "$TARGET/etc/fstab" ]; then 94 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 95 | chmod 644 "$TARGET/etc/fstab" 96 | fi 97 | 98 | setup_devices 99 | 100 | x_feign_install () { 101 | local pkg="$1" 102 | local deb="$(debfor $pkg)" 103 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 104 | 105 | mkdir -p "$TARGET/var/lib/dpkg/info" 106 | 107 | echo \ 108 | "Package: $pkg 109 | Version: $ver 110 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 111 | 112 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 113 | } 114 | 115 | x_feign_install dpkg 116 | } 117 | 118 | second_stage_install () { 119 | x_core_install () { 120 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 121 | } 122 | 123 | p () { 124 | baseprog="$(($baseprog + ${1:-1}))" 125 | } 126 | 127 | setup_proc 128 | in_target /sbin/ldconfig 129 | 130 | DEBIAN_FRONTEND=Noninteractive 131 | export DEBIAN_FRONTEND 132 | 133 | baseprog=0 134 | bases=40 135 | 136 | p; progress $baseprog $bases INSTBASE "Installing base system" #1 137 | info INSTCORE "Installing core packages..." 138 | 139 | p; progress $baseprog $bases INSTBASE "Installing base system" #2 140 | ln -sf mawk "$TARGET/usr/bin/awk" 141 | x_core_install base-files base-passwd 142 | p; progress $baseprog $bases INSTBASE "Installing base system" #3 143 | x_core_install dpkg 144 | 145 | if [ ! -e "$TARGET/etc/localtime" ]; then 146 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 147 | fi 148 | 149 | p; progress $baseprog $bases INSTBASE "Installing base system" #4 150 | x_core_install $LIBC 151 | 152 | p; progress $baseprog $bases INSTBASE "Installing base system" #5 153 | x_core_install perl-base 154 | p; progress $baseprog $bases INSTBASE "Installing base system" #6 155 | rm "$TARGET/usr/bin/awk" 156 | x_core_install mawk 157 | p; progress $baseprog $bases INSTBASE "Installing base system" #7 158 | x_core_install debconf 159 | 160 | info UNPACKREQ "Unpacking required packages..." 161 | 162 | p; progress $baseprog $bases INSTBASE "Installing base system" #8 163 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 164 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18 165 | 166 | info CONFREQ "Configuring required packages..." 167 | 168 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 169 | echo \ 170 | "#!/bin/sh 171 | echo 172 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 173 | chmod 755 "$TARGET/sbin/start-stop-daemon" 174 | 175 | setup_dselect_method apt 176 | 177 | p; progress $baseprog $bases INSTBASE "Installing base system" #19 178 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 179 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29 180 | 181 | if [ ! -e "$TARGET/etc/exim/exim.conf" ]; then 182 | mkdir -p "$TARGET/etc/exim" 183 | touch "$TARGET/etc/exim/exim.conf" 184 | fi 185 | 186 | info INSTBASE "Installing base packages..." 187 | 188 | p; progress $baseprog $bases INSTBASE "Installing base system" #30 189 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 190 | 191 | rm -f "$TARGET/usr/sbin/sendmail" 192 | ln -sf /bin/true "$TARGET/usr/sbin/sendmail" 193 | 194 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 195 | 196 | rm -f "$TARGET/usr/sbin/sendmail" 197 | ln -sf exim "$TARGET/usr/sbin/sendmail" 198 | 199 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39 200 | 201 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 202 | 203 | progress $bases $bases INSTBASE "Installing base system" #40 204 | info BASESUCCESS "Base system installed successfully." 205 | } 206 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/woody.buildd: -------------------------------------------------------------------------------- 1 | mirror_style release 2 | download_style apt 3 | default_mirror http://archive.debian.org/debian 4 | keyring /usr/share/keyrings/debian-archive-removed-keys.gpg 5 | force_md5 6 | 7 | LIBC=libc6 8 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then 9 | LIBC="libc6.1" 10 | fi 11 | 12 | work_out_debs () { 13 | 14 | required="base-files base-passwd bash bsdutils debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname libc6 libcap1 libdb3 libgdbmg1 libncurses5 libpam-modules libpam-runtime libpam0g libperl5.6 libstdc++2.10-glibc2.2 login mawk mount ncurses-base ncurses-bin perl-base sed shellutils slang1 sysvinit tar textutils util-linux" 15 | 16 | base="apt binutils cpio cpp cpp-2.95 debconf dpkg-dev g++ g++-2.95 gcc gcc-2.95 libc6-dev libdb2 libstdc++2.10-dev make patch perl perl-modules" 17 | 18 | without_package () { 19 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' ' 20 | } 21 | 22 | case $ARCH in 23 | "alpha") 24 | required="$(without_package "libc6" "$required") libc6.1" 25 | base="$(without_package "libc6-dev" "$base") libc6.1-dev" 26 | ;; 27 | "arm") 28 | ;; 29 | "i386") 30 | ;; 31 | "ia64") 32 | required="$(without_package "libc6" "$required") libc6.1 gcc-2.96-base libreadline4" 33 | base="$(without_package "cpp-2.95" "$base") cpp-2.96" 34 | base="$(without_package "gcc-2.95" "$base") gcc-2.96" 35 | base="$(without_package "g++-2.95" "$base") g++-2.96" 36 | base="$(without_package "libc6-dev" "$base") libc6.1-dev elilo efibootmgr dosfstools libparted1.4 parted" 37 | ;; 38 | "m68k") 39 | ;; 40 | "powerpc") 41 | ;; 42 | "sparc") 43 | ;; 44 | "mips") 45 | ;; 46 | "mipsel") 47 | ;; 48 | "hppa") 49 | ;; 50 | s390|s390x) 51 | ;; 52 | sh*) 53 | ;; 54 | *) 55 | # who knows? 56 | ;; 57 | esac 58 | } 59 | 60 | first_stage_install () { 61 | extract $required 62 | 63 | mkdir -p "$TARGET/var/lib/dpkg" 64 | : >"$TARGET/var/lib/dpkg/status" 65 | echo >"$TARGET/var/lib/dpkg/available" 66 | 67 | setup_etc 68 | if [ ! -e "$TARGET/etc/fstab" ]; then 69 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab" 70 | chmod 644 "$TARGET/etc/fstab" 71 | fi 72 | 73 | setup_devices 74 | 75 | x_feign_install () { 76 | local pkg="$1" 77 | local deb="$(debfor $pkg)" 78 | local ver="$(extract_deb_field "$TARGET/$deb" Version)" 79 | 80 | mkdir -p "$TARGET/var/lib/dpkg/info" 81 | 82 | echo \ 83 | "Package: $pkg 84 | Version: $ver 85 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" 86 | 87 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list" 88 | } 89 | 90 | x_feign_install dpkg 91 | } 92 | 93 | second_stage_install () { 94 | x_core_install () { 95 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@") 96 | } 97 | 98 | p () { 99 | baseprog="$(($baseprog + ${1:-1}))" 100 | } 101 | 102 | setup_proc 103 | in_target /sbin/ldconfig 104 | 105 | DEBIAN_FRONTEND=noninteractive 106 | export DEBIAN_FRONTEND 107 | 108 | baseprog=0 109 | bases=40 110 | 111 | p; progress $baseprog $bases INSTBASE "Installing base system" #1 112 | info INSTCORE "Installing core packages..." 113 | 114 | p; progress $baseprog $bases INSTBASE "Installing base system" #2 115 | ln -sf mawk "$TARGET/usr/bin/awk" 116 | x_core_install base-files base-passwd 117 | p; progress $baseprog $bases INSTBASE "Installing base system" #3 118 | x_core_install dpkg 119 | 120 | if [ ! -e "$TARGET/etc/localtime" ]; then 121 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime" 122 | fi 123 | 124 | p; progress $baseprog $bases INSTBASE "Installing base system" #4 125 | x_core_install $LIBC 126 | 127 | p; progress $baseprog $bases INSTBASE "Installing base system" #5 128 | x_core_install perl-base 129 | p; progress $baseprog $bases INSTBASE "Installing base system" #6 130 | rm "$TARGET/usr/bin/awk" 131 | x_core_install mawk 132 | p; progress $baseprog $bases INSTBASE "Installing base system" #7 133 | 134 | info UNPACKREQ "Unpacking required packages..." 135 | 136 | p; progress $baseprog $bases INSTBASE "Installing base system" #8 137 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required) 138 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18 139 | 140 | info CONFREQ "Configuring required packages..." 141 | 142 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL" 143 | echo \ 144 | "#!/bin/sh 145 | echo 146 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" 147 | chmod 755 "$TARGET/sbin/start-stop-daemon" 148 | 149 | setup_dselect_method apt 150 | 151 | p; progress $baseprog $bases INSTBASE "Installing base system" #19 152 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends 153 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29 154 | 155 | info INSTBASE "Installing base packages..." 156 | 157 | p; progress $baseprog $bases INSTBASE "Installing base system" #30 158 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 159 | 160 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a 161 | 162 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39 163 | 164 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" 165 | 166 | progress $bases $bases INSTBASE "Installing base system" #40 167 | info BASESUCCESS "Base system installed successfully." 168 | } 169 | -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/xenial: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/yakkety: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/debootstrap/scripts/zesty: -------------------------------------------------------------------------------- 1 | gutsy -------------------------------------------------------------------------------- /include/bootstrap/debian/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="debian" 5 | DESC="Bootstrap for Debian GNU/Linux" 6 | DEPENDS="bootstrap" 7 | -------------------------------------------------------------------------------- /include/bootstrap/debian/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${SUITE}" ] || SUITE="jessie" 6 | 7 | if [ -z "${ARCH}" ] 8 | then 9 | case "$(get_platform)" in 10 | x86) ARCH="i386" ;; 11 | x86_64) ARCH="amd64" ;; 12 | arm) ARCH="armhf" ;; 13 | arm_64) ARCH="arm64" ;; 14 | esac 15 | fi 16 | 17 | [ -n "${SOURCE_PATH}" ] || SOURCE_PATH="http://ftp.debian.org/debian/" 18 | 19 | apt_install() 20 | { 21 | local packages="$@" 22 | [ -n "${packages}" ] || return 1 23 | (set -e 24 | chroot_exec -u root apt-get update -yq 25 | chroot_exec -u root "DEBIAN_FRONTEND=noninteractive apt-get install -yfq --no-install-recommends ${packages}" 26 | chroot_exec -u root apt-get clean 27 | exit 0) 28 | return $? 29 | } 30 | 31 | apt_repository() 32 | { 33 | # Backup sources.list 34 | if [ -e "${CHROOT_DIR}/etc/apt/sources.list" ]; then 35 | cp "${CHROOT_DIR}/etc/apt/sources.list" "${CHROOT_DIR}/etc/apt/sources.list.bak" 36 | fi 37 | # Fix for resolv problem in stretch 38 | echo 'Debug::NoDropPrivs "true";' > "${CHROOT_DIR}/etc/apt/apt.conf.d/00no-drop-privs" 39 | # Fix for seccomp policy 40 | echo 'apt::sandbox::seccomp "false";' > "${CHROOT_DIR}/etc/apt/apt.conf.d/999seccomp-off" 41 | # Update sources.list 42 | echo "deb ${SOURCE_PATH} ${SUITE} main contrib non-free" > "${CHROOT_DIR}/etc/apt/sources.list" 43 | echo "deb-src ${SOURCE_PATH} ${SUITE} main contrib non-free" >> "${CHROOT_DIR}/etc/apt/sources.list" 44 | } 45 | 46 | do_install() 47 | { 48 | is_archive "${SOURCE_PATH}" && return 0 49 | 50 | msg ":: Installing ${COMPONENT} ... " 51 | 52 | local include_packages="locales,sudo,man-db" 53 | local exclude_packages="init,systemd-sysv" 54 | #selinux_support && include_packages="${include_packages},selinux-basics" 55 | 56 | (set -e 57 | DEBOOTSTRAP_DIR="$(component_dir bootstrap/debian)/debootstrap" 58 | . "${DEBOOTSTRAP_DIR}/debootstrap" --no-check-gpg --foreign --extractor=ar --arch="${ARCH}" --exclude="${exclude_packages}" --include="${include_packages}" "${SUITE}" "${CHROOT_DIR}" "${SOURCE_PATH}" 59 | exit 0) 60 | is_ok || return 1 61 | 62 | component_exec core/emulator core/mnt core/net 63 | 64 | unset DEBOOTSTRAP_DIR 65 | chroot_exec /debootstrap/debootstrap --no-check-gpg --second-stage 66 | is_ok || return 1 67 | 68 | msg -n "Updating repository ... " 69 | apt_repository 70 | is_ok "fail" "done" 71 | 72 | if [ -n "${EXTRA_PACKAGES}" ]; then 73 | msg "Installing extra packages: " 74 | apt_install ${EXTRA_PACKAGES} 75 | is_ok || return 1 76 | fi 77 | 78 | return 0 79 | } 80 | 81 | do_help() 82 | { 83 | cat <, GPLv3 3 | 4 | NAME="bootstrap" 5 | DESC="Installer of Linux distibution" 6 | DEPENDS="bootstrap/rootfs bootstrap/${DISTRIB} core" 7 | PARAMS="DISTRIB" 8 | -------------------------------------------------------------------------------- /include/bootstrap/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | DISTRIB="${DISTRIB##*/}" 6 | 7 | do_help() 8 | { 9 | cat <, GPLv3 3 | 4 | NAME="docker" 5 | DESC="Bootstrap for Docker containers" 6 | DEPENDS="bootstrap" 7 | -------------------------------------------------------------------------------- /include/bootstrap/docker/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${SUITE}" ] || SUITE="linux" 6 | 7 | if [ -z "${ARCH}" ] 8 | then 9 | case "$(get_platform)" in 10 | x86) ARCH="386" ;; 11 | x86_64) ARCH="amd64" ;; 12 | arm) ARCH="arm" ;; 13 | arm_64) ARCH="arm64" ;; 14 | esac 15 | fi 16 | 17 | [ -n "${SOURCE_PATH}" ] || SOURCE_PATH="library/ubuntu:18.04" 18 | 19 | do_install() 20 | { 21 | msg ":: Installing ${COMPONENT} ... " 22 | 23 | local image="${SOURCE_PATH%%:*}" 24 | local tag="${SOURCE_PATH##*:}" 25 | msg -n "Authorization in Docker repository ... " 26 | local token=$(wget -q -O - "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${image}:pull" | grep -oE '"token":"[.a-zA-Z0-9_-]+"' | tr -d '"' | awk -F':' '{print $2}') 27 | test -n "${token}" 28 | is_ok "fail" "done" || return 1 29 | msg -n "Fetching manifests from the repository ... " 30 | local manifest=$(wget -q -O - --header "Authorization: Bearer ${token}" --header "Accept: application/vnd.docker.distribution.manifest.list.v2+json" "https://registry-1.docker.io/v2/${image}/manifests/${tag}" | sed 's/},{/\n/g' | grep "\"${ARCH}\".*\"${SUITE}\"" | grep -oE 'sha256:[a-f0-9]{64}') 31 | test -n "${manifest}" 32 | is_ok "fail" "done" || return 1 33 | msg "Retrieving rootfs blobs: " 34 | wget -q -O - --header "Authorization: Bearer ${token}" "https://registry-1.docker.io/v2/${image}/manifests/${manifest}" | tr '\n' ' ' | tr '{}' '\n' | grep 'tar.gzip.*digest' | grep -oE 'sha256:[0-9a-f]{64}' | while read digest 35 | do 36 | msg -n " * ${digest} ... " 37 | wget -q -O - --header "Authorization: Bearer ${token}" "https://registry-1.docker.io/v2/${image}/blobs/${digest}" | tar xz -C "${CHROOT_DIR}" 38 | is_ok "fail" "done" 39 | done 40 | 41 | return 0 42 | } 43 | 44 | do_help() 45 | { 46 | cat <, GPLv3 3 | 4 | NAME="fedora" 5 | DESC="Bootstrap for Fedora" 6 | DEPENDS="bootstrap" 7 | -------------------------------------------------------------------------------- /include/bootstrap/fedora/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | # 31 doesn't support while rpm2cpio in busybox doesn't support zstd 6 | [ -n "${SUITE}" ] || SUITE="30" 7 | 8 | if [ -z "${ARCH}" ] 9 | then 10 | case "$(get_platform)" in 11 | x86) ARCH="i386" ;; 12 | x86_64) ARCH="x86_64" ;; 13 | arm) ARCH="armhfp" ;; 14 | arm_64) ARCH="aarch64" ;; 15 | esac 16 | fi 17 | 18 | [ -n "${SOURCE_PATH}" ] || SOURCE_PATH="http://dl.fedoraproject.org/pub/" 19 | 20 | dnf_install() 21 | { 22 | local packages="$@" 23 | [ -n "${packages}" ] || return 1 24 | (set -e 25 | chroot_exec -u root dnf -y install ${packages} 26 | exit 0) 27 | return $? 28 | } 29 | 30 | do_install() 31 | { 32 | is_archive "${SOURCE_PATH}" && return 0 33 | 34 | msg ":: Installing ${COMPONENT} ... " 35 | 36 | local core_packages="acl alternatives audit-libs basesystem bash brotli bzip2-libs ca-certificates coreutils coreutils-common cracklib crypto-policies cryptsetup-libs curl cyrus-sasl-lib dbus dbus-broker dbus-common device-mapper device-mapper-libs dnf dnf-data dnf-yum elfutils-default-yama-scope elfutils-libelf elfutils-libs expat fedora-gpg-keys fedora-release fedora-release-common fedora-repos file-libs filesystem findutils gawk gdbm-libs glib2 glibc glibc-common glibc-minimal-langpack gmp gnupg2 gnutls gpgme grep gzip ima-evm-utils iptables-libs json-c keyutils-libs kmod-libs krb5-libs libacl libarchive libargon2 libassuan libattr libblkid libcap libcap-ng libcom_err libcomps libcurl libdb libdb-utils libdnf libfdisk libffi libgcc libgcrypt libgpg-error libidn2 libksba libmetalink libmodulemd1 libmount libnghttp2 libnsl2 libpcap libpsl libpwquality librepo libreport-filesystem libseccomp libselinux libsemanage libsepol libsigsegv libsmartcols libsolv libssh libsss_idmap libsss_nss_idmap libstdc++ libtasn1 libtirpc libunistring libusbx libutempter libuuid libverto libxcrypt libxml2 libyaml libzstd lua-libs lz4-libs mpfr ncurses ncurses-base ncurses-libs nettle npth openldap openssl-libs p11-kit p11-kit-trust pam pcre pcre2 popt publicsuffix-list-dafsa python3 python3-dnf python3-gpg python3-hawkey python3-libcomps python3-libdnf python3-libs python3-rpm python-pip-wheel python-setuptools-wheel qrencode-libs readline rootfiles rpm rpm-build-libs rpm-libs rpm-sign-libs sed setup shadow-utils sqlite-libs sssd-client sudo systemd systemd-libs systemd-pam systemd-rpm-macros tar tzdata util-linux vim-minimal xz-libs zchunk-libs zlib" 37 | 38 | local repo_url 39 | if [ "${ARCH}" = "i386" ] 40 | then repo_url="${SOURCE_PATH%/}/fedora-secondary/releases/${SUITE}/Everything/${ARCH}/os" 41 | else repo_url="${SOURCE_PATH%/}/fedora/linux/releases/${SUITE}/Everything/${ARCH}/os" 42 | fi 43 | 44 | msg -n "Preparing for deployment ... " 45 | tar xzf "${COMPONENT_DIR}/filesystem.tgz" -C "${CHROOT_DIR}" 46 | is_ok "fail" "done" || return 1 47 | 48 | msg -n "Retrieving packages list ... " 49 | local pkg_list="${CHROOT_DIR}/tmp/packages.list" 50 | (set -e 51 | repodata=$(wget -q -O - "${repo_url}/repodata/repomd.xml" | sed -n '/]*href="\([^\"]*\-primary\.xml\.gz\)".*$/\1/p') 52 | [ -z "${repodata}" ] && exit 1 53 | wget -q -O - "${repo_url}/${repodata}" | gzip -dc | sed -n '/]*href="\([^\"]*\)".*$/\1/p' > "${pkg_list}" 54 | exit 0) 55 | is_ok "fail" "done" || return 1 56 | 57 | msg "Retrieving packages: " 58 | local package i pkg_url pkg_file pkg_arch 59 | case "${ARCH}" in 60 | i386) pkg_arch="-e i686 -e noarch" ;; 61 | x86_64) pkg_arch="-e x86_64 -e noarch" ;; 62 | armhfp) pkg_arch="-e armv7hl -e noarch" ;; 63 | aarch64) pkg_arch="-e aarch64 -e noarch" ;; 64 | esac 65 | for package in ${core_packages} 66 | do 67 | msg -n "${package} ... " 68 | pkg_url=$(grep -e "^.*/${package}-[0-9r][0-9\.\-].*rpm$" "${pkg_list}" | grep -m1 ${pkg_arch}) 69 | test "${pkg_url}"; is_ok "fail" || return 1 70 | pkg_file="${pkg_url##*/}" 71 | # download 72 | for i in 1 2 3 73 | do 74 | wget -q -c -O "${CHROOT_DIR}/tmp/${pkg_file}" "${repo_url}/${pkg_url}" && break 75 | sleep 30s 76 | done 77 | [ "${package}" = "filesystem" ] && { msg "done"; continue; } 78 | # unpack 79 | (cd "${CHROOT_DIR}"; rpm2cpio "./tmp/${pkg_file}" | cpio -idmu >/dev/null) 80 | is_ok "fail" "done" || return 1 81 | done 82 | 83 | component_exec core/emulator 84 | 85 | msg "Installing packages ... " 86 | chroot_exec /bin/rpm -i --force --nosignature --nodeps /tmp/*.rpm 87 | is_ok || return 1 88 | 89 | msg -n "Clearing cache ... " 90 | rm -rf "${CHROOT_DIR}"/tmp/* 91 | is_ok "skip" "done" 92 | 93 | component_exec core/mnt core/net 94 | 95 | msg -n "Setting dnf excludes ..." 96 | echo "exclude=grubby" >> "${CHROOT_DIR}"/etc/dnf/dnf.conf 97 | is_ok "fail" "done" 98 | 99 | msg -n "Upgrading packages ..." 100 | chroot_exec -u root dnf -y upgrade --refresh 101 | is_ok "fail" "done" 102 | 103 | if [ -n "${EXTRA_PACKAGES}" ]; then 104 | msg "Installing extra packages: " 105 | dnf_install ${EXTRA_PACKAGES} 106 | is_ok || return 1 107 | fi 108 | 109 | return 0 110 | } 111 | 112 | do_help() 113 | { 114 | cat <, GPLv3 3 | 4 | NAME="kali" 5 | DESC="Bootstrap for Kali Linux" 6 | EXTENDS="bootstrap/debian" 7 | DEPENDS="bootstrap" 8 | -------------------------------------------------------------------------------- /include/bootstrap/kali/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${SUITE}" ] || SUITE="kali-rolling" 6 | 7 | if [ -z "${ARCH}" ] 8 | then 9 | case "$(get_platform)" in 10 | x86) ARCH="i386" ;; 11 | x86_64) ARCH="amd64" ;; 12 | arm) ARCH="armhf" ;; 13 | arm_64) ARCH="arm64" ;; 14 | esac 15 | fi 16 | 17 | [ -n "${SOURCE_PATH}" ] || SOURCE_PATH="http://http.kali.org/kali/" 18 | 19 | do_help() 20 | { 21 | cat <, GPLv3 3 | 4 | NAME="rootfs" 5 | DESC="Prepare and import RootFS" 6 | PARAMS="SOURCE_PATH TARGET_PATH" 7 | EXTENDS="bootstrap/${DISTRIB}" 8 | -------------------------------------------------------------------------------- /include/bootstrap/rootfs/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${TARGET_TYPE}" ] || TARGET_TYPE="custom" 6 | [ -n "${FS_TYPE}" ] || FS_TYPE="ext2" 7 | [ -n "${DISK_SIZE}" ] || DISK_SIZE="0" 8 | 9 | rootfs_make() 10 | { 11 | msg -n "Checking installation path ... " 12 | case "${TARGET_TYPE}" in 13 | file) 14 | if [ -e "${TARGET_PATH}" -a ! -f "${TARGET_PATH}" ]; then 15 | msg "fail"; return 1 16 | fi 17 | if [ -n "${TARGET_PATH%/*}" -a ! -e "${TARGET_PATH%/*}" ]; then 18 | mkdir -p "${TARGET_PATH%/*}" 19 | fi 20 | ;; 21 | directory|ram) 22 | if [ -e "${TARGET_PATH}" -a ! -d "${TARGET_PATH}" ]; then 23 | msg "fail"; return 1 24 | fi 25 | if [ ! -e "${TARGET_PATH}" ]; then 26 | mkdir -p "${TARGET_PATH}" 27 | fi 28 | ;; 29 | partition) 30 | if [ ! -b "${TARGET_PATH}" ]; then 31 | msg "fail"; return 1 32 | fi 33 | ;; 34 | esac 35 | msg "done" 36 | 37 | if [ "${TARGET_TYPE}" = "file" ]; then 38 | local file_size=0 39 | if [ -f "${TARGET_PATH}" ]; then 40 | file_size=$(stat -c %s "${TARGET_PATH}") 41 | fi 42 | if [ -z "${DISK_SIZE}" -o "${DISK_SIZE}" -le 0 ]; then 43 | local block_size=$(stat -c %s -f "${TARGET_PATH%/*}") 44 | local available_size=$(stat -c %a -f "${TARGET_PATH%/*}") 45 | let available_size="${block_size}*${available_size}+${file_size}" 46 | let DISK_SIZE="(${available_size}-${available_size}/10)/1048576" 47 | if [ "${DISK_SIZE}" -gt 2047 ]; then 48 | DISK_SIZE=2047 49 | fi 50 | if [ "${DISK_SIZE}" -lt 512 ]; then 51 | DISK_SIZE=512 52 | fi 53 | fi 54 | let file_size="${file_size}/1048576" 55 | if [ "${DISK_SIZE}" != "${file_size}" ]; then 56 | msg -n "Making new disk image (${DISK_SIZE} MB) ... " 57 | dd if=/dev/zero of="${TARGET_PATH}" bs=1048576 seek="$(expr ${DISK_SIZE} - 1)" count=1 1>/dev/null 2>/dev/null || 58 | dd if=/dev/zero of="${TARGET_PATH}" bs=1048576 count="${DISK_SIZE}" >/dev/null 59 | is_ok "fail" "done" || return 1 60 | fi 61 | fi 62 | 63 | if [ "${TARGET_TYPE}" = "file" -o "${TARGET_TYPE}" = "partition" ]; then 64 | msg -n "Making file system (${FS_TYPE}) ... " 65 | local loop_exist=$(losetup -a | grep -c "${TARGET_PATH}") 66 | local img_mounted=$(grep -c "${TARGET_PATH}" /proc/mounts) 67 | if [ "${loop_exist}" -ne 0 -o "${img_mounted}" -ne 0 ]; then 68 | msg "fail"; return 1 69 | fi 70 | # for replace busybox mke2fs 71 | local makefs=$(which mke2fs) 72 | if [ -n "${makefs}" ] && ${makefs} -V 2>/dev/null ; then 73 | makefs="${makefs} -q -FFF -t ${FS_TYPE}" 74 | else 75 | makefs="mke2fs -q -FFF" 76 | fi 77 | ${makefs} "${TARGET_PATH}" >/dev/null 78 | is_ok "fail" "done" || return 1 79 | fi 80 | 81 | if [ "${TARGET_TYPE}" = "directory" ]; then 82 | if [ -e "${TARGET_PATH}" ]; then 83 | chmod -R 755 "${TARGET_PATH}" 84 | rm -rf "${TARGET_PATH}" 85 | fi 86 | mkdir -p "${TARGET_PATH}" 87 | fi 88 | 89 | if [ "${TARGET_TYPE}" = "ram" ]; then 90 | if [ ! -e "${TARGET_PATH}" ]; then 91 | mkdir "${TARGET_PATH}" 92 | fi 93 | umount "${TARGET_PATH}" 94 | if [ -z "${DISK_SIZE}" -o "${DISK_SIZE}" -le 0 ]; then 95 | local ram_free=$(grep ^MemFree /proc/meminfo | awk '{print $2}') 96 | let DISK_SIZE="${ram_free}/1024" 97 | fi 98 | msg -n "Making new disk image (${DISK_SIZE} MB) ... " 99 | mount -t tmpfs -o size="${DISK_SIZE}M" tmpfs "${TARGET_PATH}" 100 | is_ok "fail" "done" || return 1 101 | fi 102 | 103 | return 0 104 | } 105 | 106 | do_install() 107 | { 108 | if [ "${CHROOT_DIR}" != "${TARGET_PATH}" ]; then 109 | container_mounted && { msg "The container is already mounted."; return 1; } 110 | fi 111 | 112 | msg ":: Installing ${COMPONENT} ... " 113 | 114 | rootfs_make || return 1 115 | container_mount || return 1 116 | 117 | if is_archive "${SOURCE_PATH}" ; then 118 | rootfs_import "${SOURCE_PATH}" 119 | fi 120 | } 121 | 122 | do_help() 123 | { 124 | cat <, GPLv3 3 | 4 | NAME="slackware" 5 | DESC="Bootstrap for Slackware" 6 | DEPENDS="bootstrap" 7 | -------------------------------------------------------------------------------- /include/bootstrap/slackware/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${SUITE}" ] || SUITE="14.2" 6 | 7 | if [ -z "${ARCH}" ] 8 | then 9 | case "$(get_platform)" in 10 | x86) ARCH="x86" ;; 11 | x86_64) ARCH="x86_64" ;; 12 | arm*) ARCH="arm" ;; 13 | esac 14 | fi 15 | 16 | if [ -z "${SOURCE_PATH}" ] 17 | then 18 | case "$(get_platform ${ARCH})" in 19 | x86*) SOURCE_PATH="http://mirrors.slackware.com/slackware/" ;; 20 | arm*) SOURCE_PATH="http://ftp.arm.slackware.com/slackwarearm/" ;; 21 | esac 22 | fi 23 | 24 | slackpkg_install() 25 | { 26 | local packages="$@" 27 | [ -n "${packages}" ] || return 1 28 | (set -e 29 | chroot_exec -u root slackpkg -checkgpg=off -batch=on -default_answer=y update || true 30 | chroot_exec -u root slackpkg -checkgpg=off -batch=on -default_answer=y install ${packages} 31 | exit 0) 32 | return $? 33 | } 34 | 35 | slackpkg_repository() 36 | { 37 | if [ -e "${CHROOT_DIR}/etc/slackpkg/mirrors" ]; then 38 | cp "${CHROOT_DIR}/etc/slackpkg/mirrors" "${CHROOT_DIR}/etc/slackpkg/mirrors.bak" 39 | fi 40 | local repo_url 41 | case "$(get_platform ${ARCH})" in 42 | arm*) repo_url="${SOURCE_PATH%/}/slackwarearm-${SUITE}/" ;; 43 | x86) repo_url="${SOURCE_PATH%/}/slackware-${SUITE}/" ;; 44 | x86_64) repo_url="${SOURCE_PATH%/}/slackware64-${SUITE}/" ;; 45 | *) return 1 ;; 46 | esac 47 | echo "${repo_url}" > "${CHROOT_DIR}/etc/slackpkg/mirrors" 48 | chmod 644 "${CHROOT_DIR}/etc/slackpkg/mirrors" 49 | sed -i 's|^WGETFLAGS=.*|WGETFLAGS="--passive-ftp -q"|g' "${CHROOT_DIR}/etc/slackpkg/slackpkg.conf" 50 | } 51 | 52 | do_install() 53 | { 54 | is_archive "${SOURCE_PATH}" && return 0 55 | 56 | msg ":: Installing ${COMPONENT} ... " 57 | 58 | local repo_url 59 | case "$(get_platform ${ARCH})" in 60 | arm*) repo_url="${SOURCE_PATH%/}/slackwarearm-${SUITE}/slackware" ;; 61 | x86) repo_url="${SOURCE_PATH%/}/slackware-${SUITE}/slackware" ;; 62 | x86_64) repo_url="${SOURCE_PATH%/}/slackware64-${SUITE}/slackware64" ;; 63 | esac 64 | 65 | local cache_dir="${CHROOT_DIR}/tmp" 66 | local base_packages="l/glibc l/glibc-i18n l/libtermcap l/ncurses ap/diffutils ap/groff ap/man ap/slackpkg ap/sudo n/gnupg n/wget" 67 | 68 | msg -n "Preparing for deployment ... " 69 | (set -e 70 | cd "${CHROOT_DIR}" 71 | mkdir etc 72 | touch etc/fstab 73 | mkdir tmp; chmod 1777 tmp 74 | exit 0) 75 | is_ok "fail" "done" || return 1 76 | 77 | msg -n "Retrieving packages list ... " 78 | local core_packages=$(wget -q -O - "${repo_url}/a/tagfile" | grep -v -e 'kernel' -e 'efibootmgr' -e 'lilo' -e 'grub' -e 'devs' | awk -F: '{if ($1!="") print "a/"$1}') 79 | local pkg_list="${cache_dir}/packages.list" 80 | wget -q -O - "${repo_url}/FILE_LIST" | grep -o -e '/.*\.\tgz$' -e '/.*\.\txz$' > "${pkg_list}" 81 | is_ok "fail" "done" || return 1 82 | 83 | msg "Retrieving and installing packages: " 84 | local package i pkg_url pkg_file 85 | for package in ${core_packages} ${base_packages} ${EXTRA_PACKAGES} 86 | do 87 | msg -n "${package} ... " 88 | pkg_url=$(grep -m1 -e "/${package}\-" "${pkg_list}") 89 | test "${pkg_url}"; is_ok "fail" || return 1 90 | pkg_file="${pkg_url##*/}" 91 | # download 92 | for i in 1 2 3 93 | do 94 | wget -q -c -O "${cache_dir}/${pkg_file}" "${repo_url}${pkg_url}" && break 95 | sleep 30s 96 | done 97 | # unpack 98 | case "${pkg_file}" in 99 | *gz) tar xzf "${cache_dir}/${pkg_file}" -C "${CHROOT_DIR}" --exclude='./dev' --exclude='./sys' --exclude='./proc';; 100 | *bz2) tar xjf "${cache_dir}/${pkg_file}" -C "${CHROOT_DIR}" --exclude='./dev' --exclude='./sys' --exclude='./proc';; 101 | *xz) tar xJf "${cache_dir}/${pkg_file}" -C "${CHROOT_DIR}" --exclude='./dev' --exclude='./sys' --exclude='./proc';; 102 | *) msg "fail"; return 1;; 103 | esac 104 | is_ok "fail" "done" || return 1 105 | # install 106 | if [ -e "${CHROOT_DIR}/install/doinst.sh" ]; then 107 | (cd "${CHROOT_DIR}"; . ./install/doinst.sh) 108 | fi 109 | if [ -e "${CHROOT_DIR}/install" ]; then 110 | rm -rf "${CHROOT_DIR}/install" 111 | fi 112 | done 113 | 114 | msg -n "Updating repository ... " 115 | slackpkg_repository 116 | is_ok "fail" "done" 117 | 118 | msg -n "Clearing cache ... " 119 | rm -f "${cache_dir}"/* 120 | is_ok "skip" "done" 121 | 122 | return 0 123 | } 124 | 125 | do_help() 126 | { 127 | cat <, GPLv3 3 | 4 | NAME="ubuntu" 5 | DESC="Bootstrap for Ubuntu" 6 | EXTENDS="bootstrap/debian" 7 | DEPENDS="bootstrap" 8 | -------------------------------------------------------------------------------- /include/bootstrap/ubuntu/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${SUITE}" ] || SUITE="xenial" 6 | 7 | if [ -z "${ARCH}" ] 8 | then 9 | case "$(get_platform)" in 10 | x86) ARCH="i386" ;; 11 | x86_64) ARCH="amd64" ;; 12 | arm) ARCH="armhf" ;; 13 | arm_64) ARCH="arm64" ;; 14 | esac 15 | fi 16 | 17 | if [ -z "${SOURCE_PATH}" ] 18 | then 19 | case "$(get_platform ${ARCH})" in 20 | x86*) SOURCE_PATH="http://archive.ubuntu.com/ubuntu/" ;; 21 | arm*) SOURCE_PATH="http://ports.ubuntu.com/" ;; 22 | esac 23 | fi 24 | 25 | apt_repository() 26 | { 27 | # Backup sources.list 28 | if [ -e "${CHROOT_DIR}/etc/apt/sources.list" ]; then 29 | cp "${CHROOT_DIR}/etc/apt/sources.list" "${CHROOT_DIR}/etc/apt/sources.list.bak" 30 | fi 31 | # Fix for resolv problem in xenial 32 | echo 'Debug::NoDropPrivs true;' > "${CHROOT_DIR}/etc/apt/apt.conf.d/00no-drop-privs" 33 | # Update sources.list 34 | echo "deb ${SOURCE_PATH} ${SUITE} main universe multiverse" > "${CHROOT_DIR}/etc/apt/sources.list" 35 | echo "deb-src ${SOURCE_PATH} ${SUITE} main universe multiverse" >> "${CHROOT_DIR}/etc/apt/sources.list" 36 | # Fix for upstart 37 | if [ -e "${CHROOT_DIR}/sbin/initctl" ]; then 38 | chroot_exec -u root dpkg-divert --local --rename --add /sbin/initctl 39 | ln -s /bin/true "${CHROOT_DIR}/sbin/initctl" 40 | fi 41 | } 42 | 43 | do_help() 44 | { 45 | cat <, GPLv3 3 | 4 | NAME="aid" 5 | DESC="Android users and groups" 6 | PARAMS="USER_NAME" 7 | -------------------------------------------------------------------------------- /include/core/aid/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_configure() 6 | { 7 | msg ":: Configuring ${COMPONENT} ... " 8 | # set min uid and gid 9 | local login_defs 10 | login_defs="${CHROOT_DIR}/etc/login.defs" 11 | if [ ! -e "${login_defs}" ]; then 12 | touch "${login_defs}" 13 | fi 14 | if ! $(grep -q '^ *UID_MIN' "${login_defs}"); then 15 | echo "UID_MIN 5000" >>"${login_defs}" 16 | sed -i 's|^[#]\?UID_MIN.*|UID_MIN 5000|' "${login_defs}" 17 | fi 18 | if ! $(grep -q '^ *GID_MIN' "${login_defs}"); then 19 | echo "GID_MIN 5000" >>"${login_defs}" 20 | sed -i 's|^[#]\?GID_MIN.*|GID_MIN 5000|' "${login_defs}" 21 | fi 22 | # add android groups 23 | if [ -n "${PRIVILEGED_USERS}" ]; then 24 | local aid 25 | for aid in $(cat "${COMPONENT_DIR}/android_groups") 26 | do 27 | local xname=$(echo ${aid} | awk -F: '{print $1}') 28 | local xid=$(echo ${aid} | awk -F: '{print $2}') 29 | sed -i "s|^${xname}:.*|${xname}:x:${xid}:|" "${CHROOT_DIR}/etc/group" 30 | if ! $(grep -q "^${xname}:" "${CHROOT_DIR}/etc/group"); then 31 | echo "${xname}:x:${xid}:" >> "${CHROOT_DIR}/etc/group" 32 | fi 33 | if ! $(grep -q "^${xname}:" "${CHROOT_DIR}/etc/passwd"); then 34 | echo "${xname}:x:${xid}:${xid}::/:/bin/false" >> "${CHROOT_DIR}/etc/passwd" 35 | fi 36 | done 37 | local usr 38 | for usr in ${PRIVILEGED_USERS} 39 | do 40 | local uid=${usr%%:*} 41 | local gid=${usr##*:} 42 | sed -i "s|^\(${gid}:.*:[^:]+\)$|\1,${uid}|" "${CHROOT_DIR}/etc/group" 43 | sed -i "s|^\(${gid}:.*:\)$|\1${uid}|" "${CHROOT_DIR}/etc/group" 44 | done 45 | fi 46 | return 0 47 | } 48 | 49 | do_help() 50 | { 51 | cat <, GPLv3 3 | 4 | NAME="core" 5 | DESC="Core components" 6 | DEPENDS="core/emulator core/motd core/hosts core/hostname core/mnt core/net core/timezone core/su core/locale core/aid core/profile core/sudo core/unchroot" 7 | -------------------------------------------------------------------------------- /include/core/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_help() 6 | { 7 | cat <, GPLv3 3 | 4 | NAME="emulator" 5 | DESC="CPU emulation" 6 | -------------------------------------------------------------------------------- /include/core/emulator/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | get_qemu() 6 | { 7 | local arch="$1" 8 | local qemu="" 9 | local host_platform=$(get_platform) 10 | local guest_platform=$(get_platform "${arch}") 11 | if [ "${host_platform}" != "${guest_platform}" ]; then 12 | case "${guest_platform}" in 13 | arm) qemu="qemu-arm-static" ;; 14 | arm_64) qemu="qemu-aarch64-static" ;; 15 | x86) qemu="qemu-i386-static" ;; 16 | x86_64) qemu="qemu-x86_64-static" ;; 17 | *) qemu="" ;; 18 | esac 19 | fi 20 | echo ${qemu} 21 | } 22 | 23 | [ -n "${EMULATOR}" ] || EMULATOR=$(get_qemu ${ARCH}) 24 | 25 | do_configure() 26 | { 27 | do_start 28 | 29 | return 0 30 | } 31 | 32 | do_start() 33 | { 34 | [ -n "${EMULATOR}" -a "${METHOD}" = "chroot" ] || return 0 35 | multiarch_support || return 0 36 | 37 | msg -n ":: Starting ${COMPONENT} ... " 38 | local source_path=$(which ${EMULATOR}) 39 | local target_path="/usr/bin/${EMULATOR}" 40 | if [ ! -e "${CHROOT_DIR}${target_path%/*}" ]; then 41 | mkdir -p "${CHROOT_DIR}${target_path%/*}" 42 | fi 43 | if [ ! -e "${CHROOT_DIR}${target_path}" ]; then 44 | touch "${CHROOT_DIR}${target_path}" 45 | fi 46 | if ! is_mounted "${CHROOT_DIR}${target_path}" 47 | then 48 | mount -o bind "${source_path}" "${CHROOT_DIR}${target_path}" 49 | fi 50 | case "${EMULATOR}" in 51 | qemu-i386*) 52 | if [ ! -e "/proc/sys/fs/binfmt_misc/qemu-i386" ]; then 53 | echo ":qemu-i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:${target_path}:" > "/proc/sys/fs/binfmt_misc/register" 54 | is_ok "fail" "done" 55 | else 56 | msg "skip" 57 | fi 58 | ;; 59 | qemu-x86_64*) 60 | if [ ! -e "/proc/sys/fs/binfmt_misc/qemu-x86_64" ]; then 61 | echo ":qemu-x86_64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:${target_path}:" > "/proc/sys/fs/binfmt_misc/register" 62 | is_ok "fail" "done" 63 | else 64 | msg "skip" 65 | fi 66 | ;; 67 | qemu-arm*) 68 | if [ ! -e "/proc/sys/fs/binfmt_misc/qemu-arm" ]; then 69 | echo ":qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:${target_path}:" > "/proc/sys/fs/binfmt_misc/register" 70 | is_ok "fail" "done" 71 | else 72 | msg "skip" 73 | fi 74 | ;; 75 | qemu-aarch64*) 76 | if [ ! -e "/proc/sys/fs/binfmt_misc/qemu-aarch64" ]; then 77 | echo ":qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:${target_path}:" > "/proc/sys/fs/binfmt_misc/register" 78 | is_ok "fail" "done" 79 | else 80 | msg "skip" 81 | fi 82 | ;; 83 | *) 84 | msg "skip" 85 | ;; 86 | esac 87 | 88 | return 0 89 | } 90 | 91 | do_stop() 92 | { 93 | [ -n "${EMULATOR}" -a "${METHOD}" = "chroot" ] || return 0 94 | multiarch_support || return 0 95 | 96 | msg -n ":: Stopping ${COMPONENT} ... " 97 | local target_path="/usr/bin/${EMULATOR}" 98 | if is_mounted "${CHROOT_DIR}${target_path}" 99 | then 100 | umount "${CHROOT_DIR}${target_path}" 101 | fi 102 | case "${EMULATOR}" in 103 | qemu-i386*) 104 | if [ -e "/proc/sys/fs/binfmt_misc/qemu-i386" ]; then 105 | echo -1 > /proc/sys/fs/binfmt_misc/qemu-i386 106 | is_ok "fail" "done" 107 | else 108 | msg "skip" 109 | fi 110 | ;; 111 | qemu-x86_64*) 112 | if [ -e "/proc/sys/fs/binfmt_misc/qemu-x86_64" ]; then 113 | echo -1 > /proc/sys/fs/binfmt_misc/qemu-x86_64 114 | is_ok "fail" "done" 115 | else 116 | msg "skip" 117 | fi 118 | ;; 119 | qemu-arm*) 120 | if [ -e "/proc/sys/fs/binfmt_misc/qemu-arm" ]; then 121 | echo -1 > /proc/sys/fs/binfmt_misc/qemu-arm 122 | is_ok "fail" "done" 123 | else 124 | msg "skip" 125 | fi 126 | ;; 127 | qemu-aarch64*) 128 | if [ -e "/proc/sys/fs/binfmt_misc/qemu-aarch64" ]; then 129 | echo -1 > /proc/sys/fs/binfmt_misc/qemu-aarch64 130 | is_ok "fail" "done" 131 | else 132 | msg "skip" 133 | fi 134 | ;; 135 | *) 136 | msg "skip" 137 | ;; 138 | esac 139 | return 0 140 | } 141 | 142 | do_help() 143 | { 144 | cat <, GPLv3 3 | 4 | NAME="hostname" 5 | DESC="Hostname" 6 | -------------------------------------------------------------------------------- /include/core/hostname/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_configure() 6 | { 7 | msg ":: Configuring ${COMPONENT} ... " 8 | echo 'localhost' > "${CHROOT_DIR}/etc/hostname" 9 | return 0 10 | } 11 | -------------------------------------------------------------------------------- /include/core/hosts/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="hosts" 5 | DESC="Hosts file" 6 | -------------------------------------------------------------------------------- /include/core/hosts/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_configure() 6 | { 7 | msg ":: Configuring ${COMPONENT} ... " 8 | if ! $(grep -q "^127.0.0.1" "${CHROOT_DIR}/etc/hosts"); then 9 | echo '127.0.0.1 localhost' >> "${CHROOT_DIR}/etc/hosts" 10 | fi 11 | return 0 12 | } 13 | -------------------------------------------------------------------------------- /include/core/locale/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="locale" 5 | DESC="Localization" 6 | -------------------------------------------------------------------------------- /include/core/locale/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${LOCALE}" ] || LOCALE="${LANG}" 6 | [ -n "${LOCALE}" ] || LOCALE="C" 7 | 8 | do_configure() 9 | { 10 | msg ":: Configuring ${COMPONENT} ... " 11 | if $(echo ${LOCALE} | grep -q '\.'); then 12 | local inputfile=$(echo ${LOCALE} | awk -F. '{print $1}') 13 | local charmapfile=$(echo ${LOCALE} | awk -F. '{print $2}') 14 | chroot_exec -u root localedef -i ${inputfile} -c -f ${charmapfile} ${LOCALE} 15 | fi 16 | case "${DISTRIB}" in 17 | debian|ubuntu|kali) 18 | echo "LANG=${LOCALE}" > "${CHROOT_DIR}/etc/default/locale" 19 | ;; 20 | archlinux|centos) 21 | echo "LANG=${LOCALE}" > "${CHROOT_DIR}/etc/locale.conf" 22 | ;; 23 | fedora) 24 | echo "LANG=${LOCALE}" > "${CHROOT_DIR}/etc/sysconfig/i18n" 25 | ;; 26 | slackware) 27 | sed -i "s|^export LANG=.*|export LANG=${LOCALE}|g" "${CHROOT_DIR}/etc/profile.d/lang.sh" 28 | ;; 29 | alpine) 30 | echo "LANG=${LOCALE}" > "${CHROOT_DIR}/etc/profile.d/lang.sh" 31 | ;; 32 | esac 33 | return 0 34 | } 35 | 36 | do_help() 37 | { 38 | cat <, GPLv3 3 | 4 | NAME="mnt" 5 | DESC="Mount points configuration" 6 | -------------------------------------------------------------------------------- /include/core/mnt/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_configure() 6 | { 7 | msg ":: Configuring ${COMPONENT} ... " 8 | if [ "${METHOD}" = "proot" ]; then 9 | ln -sf /proc/mounts "${CHROOT_DIR}/etc/mtab" 10 | else 11 | rm -f "${CHROOT_DIR}/etc/mtab" 12 | grep "${CHROOT_DIR}" /proc/mounts | sed "s|${CHROOT_DIR}/*|/|g" > "${CHROOT_DIR}/etc/mtab" 13 | fi 14 | return 0 15 | } 16 | 17 | do_start() 18 | { 19 | if [ "${METHOD}" = "chroot" -a -n "${MOUNTS}" ]; then 20 | msg ":: Mounting partitions: " 21 | local item disk_src disk_dst target 22 | for item in ${MOUNTS} 23 | do 24 | disk_src="${item%%:*}" 25 | disk_dst="${item##*:}" 26 | [ -n "${disk_src}" -a -n "${disk_dst}" ] || continue 27 | msg -n "${disk_src} ... " 28 | target="${CHROOT_DIR}${disk_dst}" 29 | if ! is_mounted "${target}" ; then 30 | [ -d "${target}" ] || mkdir -p "${target}" 31 | [ -e "${disk_src}" ] || mkdir -p "${disk_src}" 32 | if [ -d "${disk_src}" ]; then 33 | mount -o bind "${disk_src}" "${target}" 34 | is_ok "fail" "done" 35 | elif [ -e "${disk_src}" ]; then 36 | mount -o rw,relatime "${disk_src}" "${target}" 37 | is_ok "fail" "done" 38 | else 39 | msg "skip" 40 | fi 41 | else 42 | msg "skip" 43 | fi 44 | done 45 | fi 46 | do_configure 47 | } 48 | 49 | do_help() 50 | { 51 | cat <, GPLv3 3 | 4 | NAME="motd" 5 | DESC="Message after a successful login" 6 | -------------------------------------------------------------------------------- /include/core/motd/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_configure() 6 | { 7 | msg ":: Configuring ${COMPONENT} ... " 8 | local linux_version="GNU/Linux" 9 | if [ -f "${CHROOT_DIR}/etc/os-release" ] 10 | then 11 | linux_version=$(. "${CHROOT_DIR}/etc/os-release"; echo ${PRETTY_NAME}) 12 | elif [ -f "${CHROOT_DIR}/etc/gentoo-release" ] 13 | then 14 | linux_version=$(cat "${CHROOT_DIR}/etc/gentoo-release") 15 | elif [ -f "${CHROOT_DIR}/etc/fedora-release" ] 16 | then 17 | linux_version=$(cat "${CHROOT_DIR}/etc/fedora-release") 18 | elif [ -f "${CHROOT_DIR}/etc/redhat-release" ] 19 | then 20 | linux_version=$(cat "${CHROOT_DIR}/etc/redhat-release") 21 | elif [ -f "${CHROOT_DIR}/etc/centos-release" ] 22 | then 23 | linux_version=$(cat "${CHROOT_DIR}/etc/centos-release") 24 | elif [ -f "${CHROOT_DIR}/etc/arch-release" ] 25 | then 26 | linux_version="Arch Linux" 27 | elif [ -f "${CHROOT_DIR}/etc/debian_version" ] 28 | then 29 | linux_version=$(printf "Debian GNU/Linux "; cat "${CHROOT_DIR}/etc/debian_version") 30 | fi 31 | local motd="${linux_version} [running via Linux Deploy]" 32 | rm -f "${CHROOT_DIR}/etc/motd" 33 | echo ${motd} > "${CHROOT_DIR}/etc/motd" 34 | return 0 35 | } 36 | -------------------------------------------------------------------------------- /include/core/net/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="net" 5 | DESC="Network configuration" 6 | -------------------------------------------------------------------------------- /include/core/net/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${DNS}" ] || DNS="auto" 6 | 7 | do_configure() 8 | { 9 | msg ":: Configuring ${COMPONENT} ... " 10 | local dns dns_list 11 | if [ -z "${DNS}" -o "${DNS}" = "auto" ]; then 12 | if [ -n "$(which getprop)" ]; then 13 | dns=$(getprop net.dns1) 14 | [ -n "${dns}" ] && dns_list="${dns}" 15 | dns=$(getprop net.dns2) 16 | [ -n "${dns}" ] && dns_list="${dns_list} ${dns}" 17 | fi 18 | if [ -z "${dns_list}" -a -e "/etc/resolv.conf" ]; then 19 | dns_list=$(grep "^nameserver" /etc/resolv.conf | awk '{print $2}') 20 | fi 21 | [ -z "${dns_list}" ] && dns_list="8.8.8.8" 22 | else 23 | dns_list="${DNS}" 24 | fi 25 | printf '' > "${CHROOT_DIR}/etc/resolv.conf" 26 | for dns in ${dns_list} 27 | do 28 | echo "nameserver ${dns}" >> "${CHROOT_DIR}/etc/resolv.conf" 29 | done 30 | if [ -e "${CHROOT_DIR}/etc/nsswitch.conf" ]; then 31 | sed -i 's/systemd//g' "${CHROOT_DIR}/etc/nsswitch.conf" 32 | fi 33 | return 0 34 | } 35 | 36 | do_start() 37 | { 38 | do_configure 39 | if [ -n "${NET_TRIGGER}" ]; then 40 | msg ":: Starting ${COMPONENT} ... " 41 | chroot_exec -u root "${NET_TRIGGER} start" 42 | fi 43 | return 0 44 | } 45 | 46 | do_stop() 47 | { 48 | if [ -n "${NET_TRIGGER}" ]; then 49 | msg ":: Stopping ${COMPONENT} ... " 50 | chroot_exec -u root "${NET_TRIGGER} stop" 51 | fi 52 | return 0 53 | } 54 | 55 | do_help() 56 | { 57 | cat <, GPLv3 3 | 4 | NAME="power" 5 | DESC="Power management" 6 | -------------------------------------------------------------------------------- /include/core/power/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_start() 6 | { 7 | if [ -n "${POWER_TRIGGER}" ]; then 8 | msg ":: Starting ${COMPONENT} ... " 9 | chroot_exec -u root "${POWER_TRIGGER} start" 10 | fi 11 | return 0 12 | } 13 | 14 | do_stop() 15 | { 16 | if [ -n "${POWER_TRIGGER}" ]; then 17 | msg ":: Stopping ${COMPONENT} ... " 18 | chroot_exec -u root "${POWER_TRIGGER} stop" 19 | fi 20 | return 0 21 | } 22 | 23 | do_help() 24 | { 25 | cat <, GPLv3 3 | 4 | NAME="profile" 5 | DESC="User and its environment" 6 | -------------------------------------------------------------------------------- /include/core/profile/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${USER_NAME}" ] || USER_NAME="root" 6 | [ -n "${USER_PASSWORD}" ] || USER_PASSWORD="changeme" 7 | 8 | do_configure() 9 | { 10 | msg ":: Configuring ${COMPONENT} ... " 11 | if [ -z "${USER_NAME%aid_*}" ]; then 12 | echo "Username \"${USER_NAME}\" is reserved."; return 1 13 | fi 14 | # user profile 15 | if [ "${USER_NAME}" != "root" ]; then 16 | chroot_exec -u root groupadd ${USER_NAME} 17 | chroot_exec -u root useradd -m -g ${USER_NAME} -s /bin/sh ${USER_NAME} 18 | chroot_exec -u root usermod -g ${USER_NAME} ${USER_NAME} 19 | fi 20 | # set password for user 21 | echo ${USER_NAME}:${USER_PASSWORD} | chroot_exec -u root chpasswd 22 | # set permissions 23 | chroot_exec -u root chown -R ${USER_NAME}:${USER_NAME} "$(user_home ${USER_NAME})" 24 | return 0 25 | } 26 | 27 | do_help() 28 | { 29 | cat <, GPLv3 3 | 4 | NAME="su" 5 | DESC="SU command" 6 | -------------------------------------------------------------------------------- /include/core/su/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_configure() 6 | { 7 | msg ":: Configuring ${COMPONENT} ... " 8 | local item pam_su 9 | for item in /etc/pam.d/su /etc/pam.d/su-l 10 | do 11 | pam_su="${CHROOT_DIR}/${item}" 12 | if [ -e "${pam_su}" ]; then 13 | if ! $(grep -q '^auth.*sufficient.*pam_succeed_if.so uid = 0 use_uid quiet$' "${pam_su}"); then 14 | sed -i '1,/^auth/s/^\(auth.*\)$/auth\tsufficient\tpam_succeed_if.so uid = 0 use_uid quiet\n\1/' "${pam_su}" 15 | fi 16 | fi 17 | done 18 | return 0 19 | } 20 | -------------------------------------------------------------------------------- /include/core/sudo/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="sudo" 5 | DESC="Sudoers file" 6 | PARAMS="USER_NAME" 7 | -------------------------------------------------------------------------------- /include/core/sudo/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_configure() 6 | { 7 | msg ":: Configuring ${COMPONENT} ... " 8 | local sudo_str="${USER_NAME} ALL=(ALL:ALL) NOPASSWD:ALL" 9 | if ! grep -q "${sudo_str}" "${CHROOT_DIR}/etc/sudoers"; then 10 | chmod 640 "${CHROOT_DIR}/etc/sudoers" 11 | echo ${sudo_str} >> "${CHROOT_DIR}/etc/sudoers" 12 | chmod 440 "${CHROOT_DIR}/etc/sudoers" 13 | fi 14 | if [ -e "${CHROOT_DIR}/etc/profile.d" ]; then 15 | echo '[ -n "$PS1" -a "$(whoami)" = "'${USER_NAME}'" ] || return 0' > "${CHROOT_DIR}/etc/profile.d/sudo.sh" 16 | echo 'alias su="sudo su"' >> "${CHROOT_DIR}/etc/profile.d/sudo.sh" 17 | fi 18 | return 0 19 | } 20 | -------------------------------------------------------------------------------- /include/core/timezone/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="timezone" 5 | DESC="Time zone" 6 | -------------------------------------------------------------------------------- /include/core/timezone/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_configure() 6 | { 7 | msg ":: Configuring ${COMPONENT} ... " 8 | local timezone 9 | if [ -n "$(which getprop)" ]; then 10 | timezone=$(getprop persist.sys.timezone) 11 | elif [ -e "/etc/timezone" ]; then 12 | timezone=$(cat /etc/timezone) 13 | fi 14 | if [ -n "${timezone}" ]; then 15 | rm -f "${CHROOT_DIR}/etc/localtime" 16 | cp "${CHROOT_DIR}/usr/share/zoneinfo/${timezone}" "${CHROOT_DIR}/etc/localtime" 17 | echo ${timezone} > "${CHROOT_DIR}/etc/timezone" 18 | fi 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /include/core/unchroot/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="unchroot" 5 | DESC="Break chroot" 6 | -------------------------------------------------------------------------------- /include/core/unchroot/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_configure() 6 | { 7 | msg ":: Configuring ${COMPONENT} ... " 8 | local unchroot="${CHROOT_DIR}/sbin/unchroot" 9 | echo '#!/bin/sh' > "${unchroot}" 10 | echo 'if [ "$(whoami)" != "root" ]; then' >> "${unchroot}" 11 | echo 'sudo $0 "$@"; exit $?' >> "${unchroot}" 12 | echo 'fi' >> "${unchroot}" 13 | echo 'chroot_exec=$(which chroot)' >> "${unchroot}" 14 | echo "export PATH=$PATH" >> "${unchroot}" 15 | echo "export BOOTCLASSPATH=$BOOTCLASSPATH" >> "${unchroot}" 16 | echo "export ANDROID_DATA=$ANDROID_DATA" >> "${unchroot}" 17 | echo "export EXTERNAL_STORAGE=$EXTERNAL_STORAGE" >> "${unchroot}" 18 | echo "export ANDROID_STORAGE=$ANDROID_STORAGE" >> "${unchroot}" 19 | echo 'if [ $# -eq 0 ]; then' >> "${unchroot}" 20 | echo '$chroot_exec /proc/1/cwd su -' >> "${unchroot}" 21 | echo 'else' >> "${unchroot}" 22 | echo '$chroot_exec /proc/1/cwd "$@"' >> "${unchroot}" 23 | echo 'fi' >> "${unchroot}" 24 | chmod 755 "${unchroot}" 25 | return 0 26 | } 27 | -------------------------------------------------------------------------------- /include/desktop/dbus/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="dbus" 5 | DESC="DBus daemon" 6 | PARAMS="DISTRIB" 7 | DEPENDS="extra" 8 | -------------------------------------------------------------------------------- /include/desktop/dbus/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_install() 6 | { 7 | msg ":: Installing ${COMPONENT} ... " 8 | local packages="" 9 | case "${DISTRIB}:${ARCH}:${SUITE}" in 10 | debian:*|ubuntu:*|kali:*) 11 | packages="dbus" 12 | apt_install ${packages} 13 | ;; 14 | archlinux:*) 15 | packages="dbus" 16 | pacman_install ${packages} 17 | ;; 18 | fedora:*) 19 | packages="dbus dbus-tools" 20 | dnf_install ${packages} 21 | ;; 22 | centos:*) 23 | packages="dbus" 24 | yum_install ${packages} 25 | ;; 26 | esac 27 | } 28 | 29 | do_configure() 30 | { 31 | msg ":: Configuring ${COMPONENT} ... " 32 | make_dirs /run/dbus /var/run/dbus 33 | chmod 644 "${CHROOT_DIR}/etc/machine-id" 34 | chroot_exec -u root dbus-uuidgen > "${CHROOT_DIR}/etc/machine-id" 35 | return 0 36 | } 37 | 38 | do_start() 39 | { 40 | msg -n ":: Starting ${COMPONENT} ... " 41 | is_stopped /run/dbus/pid /run/dbus/messagebus.pid /run/messagebus.pid /var/run/dbus/pid /var/run/dbus/messagebus.pid /var/run/messagebus.pid 42 | is_ok "skip" || return 0 43 | remove_files /run/dbus/pid /run/dbus/messagebus.pid /run/messagebus.pid /var/run/dbus/pid /var/run/dbus/messagebus.pid /var/run/messagebus.pid 44 | chroot_exec -u root dbus-daemon --system --fork 45 | is_ok "fail" "done" 46 | return 0 47 | } 48 | 49 | do_stop() 50 | { 51 | msg -n ":: Stopping ${COMPONENT} ... " 52 | kill_pids /run/dbus/pid /run/dbus/messagebus.pid /run/messagebus.pid /var/run/dbus/pid /var/run/dbus/messagebus.pid /var/run/messagebus.pid 53 | is_ok "fail" "done" 54 | return 0 55 | } 56 | 57 | do_status() 58 | { 59 | msg -n ":: ${COMPONENT} ... " 60 | is_started /run/dbus/pid /run/dbus/messagebus.pid /run/messagebus.pid /var/run/dbus/pid /var/run/dbus/messagebus.pid /var/run/messagebus.pid 61 | is_ok "stopped" "started" 62 | return 0 63 | } 64 | -------------------------------------------------------------------------------- /include/desktop/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="desktop" 5 | DESC="Desktop environment" 6 | PARAMS="DESKTOP" 7 | DEPENDS="bootstrap desktop/desktop-base desktop/${DESKTOP}" 8 | -------------------------------------------------------------------------------- /include/desktop/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | DESKTOP="${DESKTOP##*/}" 6 | 7 | do_help() 8 | { 9 | cat <, GPLv3 3 | 4 | NAME="desktop-base" 5 | DESC="Common configuration for desktop environment" 6 | PARAMS="USER_NAME" 7 | DEPENDS="desktop" 8 | -------------------------------------------------------------------------------- /include/desktop/desktop-base/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_configure() 6 | { 7 | msg ":: Configuring ${COMPONENT} ... " 8 | local xinitrc="$(user_home ${USER_NAME})/.xinitrc" 9 | local xsession="$(user_home ${USER_NAME})/.xsession" 10 | local xinitrc_chroot="${CHROOT_DIR}${xinitrc}" 11 | local xsession_chroot="${CHROOT_DIR}${xsession}" 12 | [ -e "${xinitrc_file}" -o -L "${xinitrc_file}" ] && rm -f "${xinitrc_chroot}" 13 | echo 'XAUTHORITY=$HOME/.Xauthority' > "${xinitrc_chroot}" 14 | echo 'export XAUTHORITY' >> "${xinitrc_chroot}" 15 | echo "LANG=$LOCALE" >> "${xinitrc_chroot}" 16 | echo 'export LANG' >> "${xinitrc_chroot}" 17 | echo 'echo $$ > /tmp/xsession.pid' >> "${xinitrc_chroot}" 18 | echo '. $HOME/.xsession' >> "${xinitrc_chroot}" 19 | chmod 755 "${xinitrc_chroot}" 20 | chroot_exec -u root chown ${USER_NAME}:${USER_NAME} "${xinitrc}" 21 | touch "${xsession_chroot}" 22 | chmod 644 "${xsession_chroot}" 23 | chroot_exec -u root chown ${USER_NAME}:${USER_NAME} "${xsession}" 24 | return 0 25 | } 26 | -------------------------------------------------------------------------------- /include/desktop/lxde/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="lxde" 5 | DESC="Lightweight X11 Desktop Environment" 6 | PARAMS="DISTRIB USER_NAME" 7 | DEPENDS="desktop desktop/dbus" 8 | -------------------------------------------------------------------------------- /include/desktop/lxde/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_install() 6 | { 7 | msg ":: Installing ${COMPONENT} ... " 8 | local packages="" 9 | case "${DISTRIB}:${ARCH}:${SUITE}" in 10 | debian:*|ubuntu:*|kali:*) 11 | packages="desktop-base x11-xserver-utils xfonts-base xfonts-utils lxde lxde-common menu-xdg hicolor-icon-theme gtk2-engines" 12 | apt_install ${packages} 13 | ;; 14 | archlinux:*) 15 | packages="xorg-xauth xorg-fonts-misc ttf-dejavu lxde gtk-engines" 16 | pacman_install ${packages} 17 | ;; 18 | fedora:*) 19 | packages="xorg-x11-server-utils xorg-x11-fonts-misc dejavu-* @lxde-desktop-environment" 20 | dnf_install ${packages} 21 | ;; 22 | esac 23 | } 24 | 25 | do_configure() 26 | { 27 | msg ":: Configuring ${COMPONENT} ... " 28 | local xsession="${CHROOT_DIR}$(user_home ${USER_NAME})/.xsession" 29 | echo 'exec startlxde' > "${xsession}" 30 | # fix error "No session for pid" 31 | if [ -e "${CHROOT_DIR}/etc/xdg/autostart/lxpolkit.desktop" ]; then 32 | rm "${CHROOT_DIR}/etc/xdg/autostart/lxpolkit.desktop" 33 | fi 34 | if [ -e "${CHROOT_DIR}/usr/bin/lxpolkit" ]; then 35 | mv "${CHROOT_DIR}/usr/bin/lxpolkit" "${CHROOT_DIR}/usr/bin/lxpolkit.bak" 36 | fi 37 | return 0 38 | } 39 | -------------------------------------------------------------------------------- /include/desktop/mate/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="mate" 5 | DESC="MATE Desktop Environment" 6 | PARAMS="DISTRIB USER_NAME" 7 | DEPENDS="desktop desktop/dbus" 8 | -------------------------------------------------------------------------------- /include/desktop/mate/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_install() 6 | { 7 | msg ":: Installing ${COMPONENT} ... " 8 | local packages="" 9 | case "${DISTRIB}:${ARCH}:${SUITE}" in 10 | debian:*|ubuntu:*|kali:*) 11 | packages="desktop-base dbus-x11 x11-xserver-utils xfonts-base xfonts-utils mate-core" 12 | apt_install ${packages} 13 | ;; 14 | archlinux:*) 15 | packages="xorg-xauth xorg-fonts-misc ttf-dejavu mate" 16 | pacman_install ${packages} 17 | ;; 18 | fedora:*) 19 | packages="xorg-x11-server-utils xorg-x11-fonts-misc dejavu-* @mate-desktop-environment" 20 | dnf_install ${packages} 21 | ;; 22 | esac 23 | } 24 | 25 | do_configure() 26 | { 27 | msg ":: Configuring ${COMPONENT} ... " 28 | local xsession="${CHROOT_DIR}$(user_home ${USER_NAME})/.xsession" 29 | echo 'XKL_XMODMAP_DISABLE=1' > "${xsession}" 30 | echo 'export XKL_XMODMAP_DISABLE' >> "${xsession}" 31 | echo 'exec dbus-launch --exit-with-session mate-session' >> "${xsession}" 32 | return 0 33 | } 34 | -------------------------------------------------------------------------------- /include/desktop/xfce/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="xfce" 5 | DESC="Xfce Desktop Environment" 6 | PARAMS="DISTRIB USER_NAME" 7 | DEPENDS="desktop desktop/dbus" 8 | -------------------------------------------------------------------------------- /include/desktop/xfce/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_install() 6 | { 7 | msg ":: Installing ${COMPONENT} ... " 8 | local packages="" 9 | case "${DISTRIB}:${ARCH}:${SUITE}" in 10 | debian:*|ubuntu:*|kali:*) 11 | packages="desktop-base dbus-x11 x11-xserver-utils xfonts-base xfonts-utils xfce4 xfce4-terminal tango-icon-theme hicolor-icon-theme" 12 | apt_install ${packages} 13 | ;; 14 | archlinux:*) 15 | packages="xorg-xauth xorg-fonts-misc ttf-dejavu xfce4" 16 | pacman_install ${packages} 17 | ;; 18 | fedora:*) 19 | packages="xorg-x11-server-utils xorg-x11-fonts-misc dejavu-* @xfce-desktop-environment" 20 | dnf_install ${packages} 21 | ;; 22 | esac 23 | } 24 | 25 | do_configure() 26 | { 27 | msg ":: Configuring ${COMPONENT} ... " 28 | local xsession="${CHROOT_DIR}$(user_home ${USER_NAME})/.xsession" 29 | echo 'exec dbus-launch --exit-with-session xfce4-session' > "${xsession}" 30 | return 0 31 | } 32 | -------------------------------------------------------------------------------- /include/desktop/xterm/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="xterm" 5 | DESC="X Terminal as full screen" 6 | PARAMS="DISTRIB USER_NAME" 7 | DEPENDS="desktop" 8 | -------------------------------------------------------------------------------- /include/desktop/xterm/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | do_install() 6 | { 7 | msg ":: Installing ${COMPONENT} ... " 8 | local packages="" 9 | case "${DISTRIB}:${ARCH}:${SUITE}" in 10 | debian:*|ubuntu:*|kali:*) 11 | packages="desktop-base x11-xserver-utils xfonts-base xfonts-utils xterm" 12 | apt_install ${packages} 13 | ;; 14 | archlinux:*) 15 | packages="xorg-xauth xorg-fonts-misc ttf-dejavu xterm" 16 | pacman_install ${packages} 17 | ;; 18 | fedora:*) 19 | packages="xorg-x11-server-utils xorg-x11-fonts-misc dejavu-* xterm" 20 | dnf_install ${packages} 21 | ;; 22 | centos:*) 23 | packages="xorg-x11-server-utils xorg-x11-fonts-misc dejavu-* xterm" 24 | yum_install ${packages} 25 | ;; 26 | esac 27 | } 28 | 29 | do_configure() 30 | { 31 | msg ":: Configuring ${COMPONENT} ... " 32 | local xsession="${CHROOT_DIR}$(user_home ${USER_NAME})/.xsession" 33 | echo 'exec xterm -max' > "${xsession}" 34 | return 0 35 | } 36 | -------------------------------------------------------------------------------- /include/extra/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="extra" 5 | DESC="Extra applications" 6 | DEPENDS="bootstrap" 7 | -------------------------------------------------------------------------------- /include/extra/pulse/deploy.conf: -------------------------------------------------------------------------------- 1 | # Linux Deploy Component 2 | # (c) Anton Skshidlevsky , GPLv3 3 | 4 | NAME="pulse" 5 | DESC="Audio output via PulseAudio server" 6 | -------------------------------------------------------------------------------- /include/extra/pulse/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${PULSE_HOST}" ] || PULSE_HOST="127.0.0.1" 6 | [ -n "${PULSE_PORT}" ] || PULSE_PORT="4712" 7 | 8 | do_install() 9 | { 10 | msg ":: Installing ${COMPONENT} ... " 11 | local packages="" 12 | case "${DISTRIB}:${ARCH}:${SUITE}" in 13 | debian:*|ubuntu:*|kali:*) 14 | packages="libasound2-plugins" 15 | apt_install ${packages} 16 | ;; 17 | archlinux:*) 18 | packages="pulseaudio-alsa" 19 | pacman_install ${packages} 20 | ;; 21 | fedora:*) 22 | packages="alsa-plugins-pulseaudio" 23 | dnf_install ${packages} 24 | ;; 25 | centos:*) 26 | packages="alsa-plugins-pulseaudio" 27 | yum_install ${packages} 28 | ;; 29 | esac 30 | } 31 | 32 | do_configure() 33 | { 34 | msg ":: Configuring ${COMPONENT} ... " 35 | if [ -e "${CHROOT_DIR}/etc/profile.d/" ]; then 36 | printf "PULSE_SERVER=${PULSE_HOST}:${PULSE_PORT}\nexport PULSE_SERVER\n" > "${CHROOT_DIR}/etc/profile.d/pulse.sh" 37 | fi 38 | echo "pcm.!default { type pulse }" > "${CHROOT_DIR}/etc/asound.conf" 39 | echo "ctl.!default { type pulse }" >> "${CHROOT_DIR}/etc/asound.conf" 40 | echo "pcm.pulse { type pulse }" >> "${CHROOT_DIR}/etc/asound.conf" 41 | echo "ctl.pulse { type pulse }" >> "${CHROOT_DIR}/etc/asound.conf" 42 | return 0 43 | } 44 | 45 | do_help() 46 | { 47 | cat <, GPLv3 3 | 4 | NAME="ssh" 5 | DESC="Secure shell (SSH) server" 6 | PARAMS="DISTRIB" 7 | DEPENDS="extra" 8 | -------------------------------------------------------------------------------- /include/extra/ssh/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${SSH_PORT}" ] || SSH_PORT="22" 6 | 7 | do_install() 8 | { 9 | msg ":: Installing ${COMPONENT} ... " 10 | local packages="" 11 | case "${DISTRIB}:${ARCH}:${SUITE}" in 12 | debian:*|ubuntu:*|kali:*) 13 | packages="openssh-server" 14 | [ "${METHOD}" = "proot" ] && packages="${packages} fakechroot" 15 | apt_install ${packages} 16 | ;; 17 | archlinux:*) 18 | packages="openssh" 19 | pacman_install ${packages} 20 | ;; 21 | fedora:*) 22 | packages="openssh-server" 23 | dnf_install ${packages} 24 | ;; 25 | centos:*) 26 | packages="openssh-server" 27 | yum_install ${packages} 28 | ;; 29 | slackware:*) 30 | packages="openssh" 31 | slackpkg_install ${packages} 32 | ;; 33 | alpine:*) 34 | packages="openssh-server" 35 | apk_install ${packages} 36 | ;; 37 | esac 38 | } 39 | 40 | do_configure() 41 | { 42 | msg ":: Configuring ${COMPONENT} ... " 43 | local sshd_config 44 | sshd_config="${CHROOT_DIR}/etc/ssh/sshd_config" 45 | sed -i -E 's/#?PasswordAuthentication .*/PasswordAuthentication yes/g' "${sshd_config}" 46 | sed -i -E 's/#?PermitRootLogin .*/PermitRootLogin yes/g' "${sshd_config}" 47 | sed -i -E 's/#?AcceptEnv .*/AcceptEnv LANG/g' "${sshd_config}" 48 | return 0 49 | } 50 | 51 | do_start() 52 | { 53 | msg -n ":: Starting ${COMPONENT} ... " 54 | is_stopped /var/run/sshd.pid /run/sshd.pid 55 | is_ok "skip" || return 0 56 | make_dirs /run/sshd /var/run/sshd 57 | # generate keys 58 | if [ $(ls "${CHROOT_DIR}/etc/ssh/" | grep -c key) -eq 0 ]; then 59 | chroot_exec -u root ssh-keygen -A >/dev/null 60 | fi 61 | # exec sshd 62 | if [ "${METHOD}" = "proot" ]; then 63 | chroot_exec -u root fakechroot /usr/sbin/sshd -p ${SSH_PORT} ${SSH_ARGS} & 64 | else 65 | chroot_exec -u root /usr/sbin/sshd -p ${SSH_PORT} ${SSH_ARGS} 66 | fi 67 | is_ok "fail" "done" 68 | return 0 69 | } 70 | 71 | do_stop() 72 | { 73 | msg -n ":: Stopping ${COMPONENT} ... " 74 | kill_pids /run/sshd.pid /var/run/sshd.pid 75 | is_ok "fail" "done" 76 | return 0 77 | } 78 | 79 | do_status() 80 | { 81 | msg -n ":: ${COMPONENT} ... " 82 | is_started /var/run/sshd.pid /run/sshd.pid 83 | is_ok "stopped" "started" 84 | return 0 85 | } 86 | 87 | do_help() 88 | { 89 | cat <, GPLv3 3 | 4 | NAME="graphics" 5 | DESC="Graphics subsystem" 6 | PARAMS="GRAPHICS" 7 | DEPENDS="bootstrap graphics/${GRAPHICS}" 8 | -------------------------------------------------------------------------------- /include/graphics/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | GRAPHICS="${GRAPHICS##*/}" 6 | 7 | do_help() 8 | { 9 | cat <, GPLv3 3 | 4 | NAME="fb" 5 | DESC="X.Org X server (with fbdev and evdev drivers)" 6 | PARAMS="DISTRIB USER_NAME" 7 | DEPENDS="graphics" 8 | -------------------------------------------------------------------------------- /include/graphics/fb/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${FB_DISPLAY}" ] || FB_DISPLAY="0" 6 | [ -n "${FB_DEV}" ] || FB_DEV="/dev/graphics/fb0" 7 | [ -n "${FB_INPUT}" ] || FB_INPUT="/dev/input/event0" 8 | 9 | do_install() 10 | { 11 | msg ":: Installing ${COMPONENT} ... " 12 | local packages="" 13 | case "${DISTRIB}:${ARCH}:${SUITE}" in 14 | debian:*|ubuntu:*|kali:*) 15 | packages="xinit xserver-xorg xserver-xorg-video-fbdev xserver-xorg-input-evdev" 16 | apt_install ${packages} 17 | ;; 18 | archlinux:*) 19 | packages="xorg-xinit xorg-server xf86-video-fbdev xf86-input-evdev" 20 | pacman_install ${packages} 21 | ;; 22 | fedora:*) 23 | packages="xorg-x11-xinit xorg-x11-server-Xorg xorg-x11-drv-fbdev xorg-x11-drv-evdev" 24 | dnf_install ${packages} 25 | ;; 26 | centos:*) 27 | packages="xorg-x11-xinit xorg-x11-server-Xorg xorg-x11-drv-fbdev xorg-x11-drv-evdev" 28 | yum_install ${packages} 29 | ;; 30 | esac 31 | } 32 | 33 | do_configure() 34 | { 35 | msg ":: Configuring ${COMPONENT} ... " 36 | # Xwrapper.config 37 | if [ ! -e "${CHROOT_DIR}/etc/X11" ]; then 38 | mkdir "${CHROOT_DIR}/etc/X11" 39 | fi 40 | if $(grep -q '^allowed_users' "${CHROOT_DIR}/etc/X11/Xwrapper.config"); then 41 | sed -i 's/^allowed_users=.*/allowed_users=anybody/g' "${CHROOT_DIR}/etc/X11/Xwrapper.config" 42 | else 43 | echo "allowed_users=anybody" >> "${CHROOT_DIR}/etc/X11/Xwrapper.config" 44 | fi 45 | local xorg_file="${CHROOT_DIR}/etc/X11/xorg.conf" 46 | [ -e "${xorg_file}" ] && cp "${xorg_file}" "${xorg_file}.bak" 47 | if ! grep -q "# Auto-generated by Linux Deploy" "${xorg_file}" 48 | then 49 | cat "${COMPONENT_DIR}/xorg.conf" > "${xorg_file}" 50 | chmod 644 "${xorg_file}" 51 | fi 52 | # update xorg.conf 53 | if [ -n "${FB_DEV}" ]; then 54 | sed -i "s|Option.*FB_DEV|Option \"fbdev\" \"${FB_DEV}\" # FB_DEV|g" "${xorg_file}" 55 | fi 56 | if [ -n "${FB_INPUT}" ]; then 57 | sed -i "s|Option.*FB_INPUT|Option \"Device\" \"${FB_INPUT}\" # FB_INPUT|g" "${xorg_file}" 58 | fi 59 | return 0 60 | } 61 | 62 | do_start() 63 | { 64 | fb_refresh() 65 | { 66 | [ "${FB_REFRESH}" = "true" ] || return 0 67 | local fbdev="${FB_DEV##*/}" 68 | local fbrotate="/sys/class/graphics/${fbdev}/rotate" 69 | [ -e "${fbrotate}" ] || return 0 70 | local pid_file="${CHROOT_DIR}/tmp/xsession.pid" 71 | touch "${pid_file}" 72 | chmod 666 "${pid_file}" 73 | while [ -e "${pid_file}" ] 74 | do 75 | echo 0 > "${fbrotate}" 76 | sleep 0.01 77 | done 78 | } 79 | msg -n ":: Starting ${COMPONENT} ... " 80 | is_stopped /tmp/xsession.pid 81 | is_ok "skip" || return 0 82 | fb_refresh & 83 | (chroot_exec -u ${USER_NAME} xinit -- :${FB_DISPLAY} ${FB_ARGS} ; do_stop) & 84 | is_ok "fail" "done" 85 | case "${FB_FREEZE}" in 86 | stop) 87 | sync 88 | setprop ctl.stop surfaceflinger 89 | sleep 10 90 | setprop ctl.stop zygote 91 | ;; 92 | pause) 93 | sync 94 | pkill -STOP system_server 95 | pkill -STOP surfaceflinger 96 | ;; 97 | esac 98 | return 0 99 | } 100 | 101 | do_stop() 102 | { 103 | msg -n ":: Stopping ${COMPONENT} ... " 104 | case "${FB_FREEZE}" in 105 | stop) 106 | setprop ctl.start surfaceflinger 107 | setprop ctl.start zygote 108 | ;; 109 | pause) 110 | pkill -CONT surfaceflinger 111 | pkill -CONT system_server 112 | ;; 113 | esac 114 | kill_pids /tmp/xsession.pid 115 | is_ok "fail" "done" 116 | remove_files /tmp/xsession.pid 117 | return 0 118 | } 119 | 120 | do_status() 121 | { 122 | msg -n ":: ${COMPONENT} ... " 123 | is_started /tmp/xsession.pid 124 | is_ok "stopped" "started" 125 | return 0 126 | } 127 | 128 | do_help() 129 | { 130 | cat <, GPLv3 3 | 4 | NAME="vnc" 5 | DESC="Virtual network computing (VNC) server" 6 | PARAMS="DISTRIB USER_NAME" 7 | DEPENDS="graphics" 8 | -------------------------------------------------------------------------------- /include/graphics/vnc/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${USER_PASSWORD}" ] || USER_PASSWORD="changeme" 6 | [ -n "${VNC_DISPLAY}" ] || VNC_DISPLAY="0" 7 | [ -n "${VNC_DEPTH}" ] || VNC_DEPTH="16" 8 | [ -n "${VNC_DPI}" ] || VNC_DPI="75" 9 | [ -n "${VNC_WIDTH}" ] || VNC_WIDTH="800" 10 | [ -n "${VNC_HEIGHT}" ] || VNC_HEIGHT="480" 11 | 12 | do_install() 13 | { 14 | msg ":: Installing ${COMPONENT} ... " 15 | local packages="" 16 | case "${DISTRIB}:${ARCH}:${SUITE}" in 17 | debian:*|ubuntu:*|kali:*) 18 | packages="tightvncserver" 19 | apt_install ${packages} 20 | ;; 21 | archlinux:*) 22 | packages="tigervnc" 23 | pacman_install ${packages} 24 | ;; 25 | fedora:*) 26 | packages="tigervnc-server" 27 | dnf_install ${packages} 28 | ;; 29 | centos:*) 30 | packages="tigervnc-server" 31 | yum_install ${packages} 32 | ;; 33 | esac 34 | } 35 | 36 | do_configure() 37 | { 38 | msg ":: Configuring ${COMPONENT} ... " 39 | local vnc_home="$(user_home ${USER_NAME})/.vnc" 40 | local vnc_home_chroot="${CHROOT_DIR}${vnc_home}" 41 | [ -e "${vnc_home_chroot}" ] || mkdir "${vnc_home_chroot}" 42 | # set vnc password 43 | echo ${USER_PASSWORD} | chroot_exec -u root vncpasswd -f > "${vnc_home_chroot}/passwd" || 44 | echo "MPTcXfgXGiY=" | base64 -d > "${vnc_home_chroot}/passwd" 45 | chmod 600 "${vnc_home_chroot}/passwd" 46 | remove_files "${vnc_home_chroot}/xstartup" 47 | ln -s ../.xinitrc "${vnc_home_chroot}/xstartup" 48 | chroot_exec -u root chown -R ${USER_NAME}:${USER_NAME} "${vnc_home}" 49 | return 0 50 | } 51 | 52 | do_start() 53 | { 54 | msg -n ":: Starting ${COMPONENT} ... " 55 | is_stopped /tmp/xsession.pid 56 | is_ok "skip" || return 0 57 | # remove locks 58 | remove_files "/tmp/.X${VNC_DISPLAY}-lock" "/tmp/.X11-unix/X${VNC_DISPLAY}" 59 | # exec vncserver 60 | chroot_exec -u ${USER_NAME} vncserver :${VNC_DISPLAY} -depth ${VNC_DEPTH} -dpi ${VNC_DPI} -geometry ${VNC_WIDTH}x${VNC_HEIGHT} ${VNC_ARGS} 61 | is_ok "fail" "done" 62 | return 0 63 | } 64 | 65 | do_stop() 66 | { 67 | msg -n ":: Stopping ${COMPONENT} ... " 68 | chroot_exec -u ${USER_NAME} vncserver -kill :${VNC_DISPLAY} 69 | kill_pids /tmp/xsession.pid 70 | is_ok "fail" "done" 71 | return 0 72 | } 73 | 74 | do_status() 75 | { 76 | msg -n ":: ${COMPONENT} ... " 77 | is_started /tmp/xsession.pid 78 | is_ok "stopped" "started" 79 | return 0 80 | } 81 | 82 | do_help() 83 | { 84 | cat <, GPLv3 3 | 4 | NAME="x11" 5 | DESC="GUI on external X server" 6 | PARAMS="DISTRIB USER_NAME" 7 | DEPENDS="graphics" 8 | -------------------------------------------------------------------------------- /include/graphics/x11/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${X11_DISPLAY}" ] || X11_DISPLAY="0" 6 | 7 | do_start() 8 | { 9 | msg -n ":: Starting ${COMPONENT} ... " 10 | is_stopped /tmp/xsession.pid 11 | is_ok "skip" || return 0 12 | local cmd="export DISPLAY=${X11_HOST}:${X11_DISPLAY}; ~/.xinitrc &" 13 | chroot_exec -u ${USER_NAME} ${cmd} 14 | is_ok "fail" "done" 15 | return 0 16 | } 17 | 18 | do_stop() 19 | { 20 | msg -n ":: Stopping ${COMPONENT} ... " 21 | kill_pids /tmp/xsession.pid 22 | is_ok "fail" "done" 23 | return 0 24 | } 25 | 26 | do_status() 27 | { 28 | msg -n ":: ${COMPONENT} ... " 29 | is_started /tmp/xsession.pid 30 | is_ok "stopped" "started" 31 | return 0 32 | } 33 | 34 | do_help() 35 | { 36 | cat <, GPLv3 3 | 4 | NAME="init" 5 | DESC="Init system" 6 | PARAMS="INIT" 7 | DEPENDS="init/${INIT}" 8 | -------------------------------------------------------------------------------- /include/init/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | INIT="${INIT##*/}" 6 | 7 | do_help() 8 | { 9 | cat <, GPLv3 3 | 4 | NAME="run-parts" 5 | DESC="Init from directory" 6 | PARAMS="INIT_PATH" 7 | DEPENDS="init" 8 | -------------------------------------------------------------------------------- /include/init/run-parts/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${INIT_USER}" ] || INIT_USER="root" 6 | 7 | run_part() 8 | { 9 | local path="$1" 10 | local action="$2" 11 | msg -n "${path##*/} ... " 12 | if [ "${INIT_ASYNC}" = "true" ]; then 13 | chroot_exec -u ${INIT_USER} "${path} ${action}" 1>&2 & 14 | else 15 | chroot_exec -u ${INIT_USER} "${path} ${action}" 1>&2 16 | fi 17 | is_ok "fail" "done" 18 | } 19 | 20 | do_start() 21 | { 22 | [ -n "${INIT_PATH}" ] || return 0 23 | 24 | if [ -f "${CHROOT_DIR}${INIT_PATH}" ]; then 25 | msg ":: Starting ${COMPONENT}: " 26 | run_part "${INIT_PATH}" start 27 | else 28 | local services=$(ls "${CHROOT_DIR}${INIT_PATH}/") 29 | if [ -n "${services}" ]; then 30 | msg ":: Starting services: " 31 | local part 32 | for part in ${services} 33 | do 34 | run_part "${INIT_PATH%/}/${part}" start 35 | done 36 | fi 37 | fi 38 | 39 | return 0 40 | } 41 | 42 | do_stop() 43 | { 44 | [ -n "${INIT_PATH}" ] || return 0 45 | 46 | if [ -f "${CHROOT_DIR}${INIT_PATH}" ]; then 47 | msg ":: Stopping ${COMPONENT}: " 48 | run_part "${INIT_PATH}" stop 49 | else 50 | local services=$(ls "${CHROOT_DIR}${INIT_PATH}/" | tac) 51 | if [ -n "${services}" ]; then 52 | msg ":: Stopping services: " 53 | local part 54 | for part in ${services} 55 | do 56 | run_part "${INIT_PATH%/}/${part}" stop 57 | done 58 | fi 59 | fi 60 | 61 | return 0 62 | } 63 | 64 | do_help() 65 | { 66 | cat <, GPLv3 3 | 4 | NAME="sysv" 5 | DESC="SysV init support" 6 | PARAMS="INIT_LEVEL" 7 | DEPENDS="init" 8 | -------------------------------------------------------------------------------- /include/init/sysv/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Linux Deploy Component 3 | # (c) Anton Skshidlevsky , GPLv3 4 | 5 | [ -n "${INIT_USER}" ] || INIT_USER="root" 6 | 7 | do_start() 8 | { 9 | #local init_level=$(grep ':initdefault:' "${CHROOT_DIR}/etc/inittab" | cut -f2 -d:) 10 | [ -n "${INIT_LEVEL}" ] || return 0 11 | 12 | local services=$(ls "${CHROOT_DIR}/etc/rc${INIT_LEVEL}.d/" | grep '^S') 13 | if [ -n "${services}" ]; then 14 | msg ":: Starting ${COMPONENT}: " 15 | local item 16 | for item in ${services} 17 | do 18 | msg -n "${item/S[0-9][0-9]/} ... " 19 | if [ "${INIT_ASYNC}" = "true" ]; then 20 | chroot_exec -u ${INIT_USER} "/etc/rc${INIT_LEVEL}.d/${item} start" 1>&2 & 21 | else 22 | chroot_exec -u ${INIT_USER} "/etc/rc${INIT_LEVEL}.d/${item} start" 1>&2 23 | fi 24 | is_ok "fail" "done" 25 | done 26 | fi 27 | 28 | return 0 29 | } 30 | 31 | do_stop() 32 | { 33 | [ -n "${INIT_LEVEL}" ] || return 0 34 | 35 | local services=$(ls "${CHROOT_DIR}/etc/rc6.d/" | grep '^K') 36 | if [ -n "${services}" ]; then 37 | msg ":: Stopping ${COMPONENT}: " 38 | local item 39 | for item in ${services} 40 | do 41 | msg -n "${item/K[0-9][0-9]/} ... " 42 | if [ "${INIT_ASYNC}" = "true" ]; then 43 | chroot_exec -u ${INIT_USER} "/etc/rc6.d/${item} stop" 1>&2 & 44 | else 45 | chroot_exec -u ${INIT_USER} "/etc/rc6.d/${item} stop" 1>&2 46 | fi 47 | is_ok "fail" "done" 48 | done 49 | fi 50 | 51 | return 0 52 | } 53 | 54 | do_help() 55 | { 56 | cat <