From 85e41b6fa3b629107155702df538df023d65954d Mon Sep 17 00:00:00 2001 From: meefik Date: Mon, 12 Aug 2019 16:04:14 +0300 Subject: [PATCH] Script for deploy all configurations and save it as tgz --- README.md | 13 ++++++++----- make_rootfs.sh | 25 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100755 make_rootfs.sh diff --git a/README.md b/README.md index efe59f1..9a0ddec 100644 --- a/README.md +++ b/README.md @@ -76,11 +76,14 @@ Help for the parameters of the main components: Architecture of Linux distribution, supported "armel", "armhf", "arm64", "i386" and "amd64". --suite="stretch" - Version of Linux distribution, supported versions "wheezy", "jessie" and "stretch" (also can be used "stable", "testing" and "unstable"). + Version of Linux distribution, supported versions "jessie", "stretch" and "buster" (also can be used "stable", "testing", "unstable" or "oldstable"). --source-path="http://ftp.debian.org/debian/" Installation source, can specify address of the repository or path to the rootfs archive. + --extra-packages="" + List of optional installation packages, separated by spaces. + --method="chroot" Containerization method "chroot" or "proot". @@ -99,8 +102,8 @@ Help for the parameters of the main components: --net-trigger="" Path to a script inside the container to process changes the network. - --locale="en_US.UTF-8" - Localization, e.g. "ru_RU.UTF-8". + --locale="C" + Localization, e.g. "en_US.UTF-8". --user-name="android" Username that will be created in the container. @@ -108,7 +111,7 @@ Help for the parameters of the main components: --user-password="changeme" Password will be assigned to the specified user. - --privileged-users="root messagebus" + --privileged-users="android messagebus" A list of users separated by a space to be added to Android groups. ``` @@ -116,4 +119,4 @@ Help for the parameters of the main components: ### Links - Source code: https://github.com/meefik/linuxdeploy-cli -- Donations: http://meefik.github.io/donate +- Donations: https://meefik.github.io/donate diff --git a/make_rootfs.sh b/make_rootfs.sh new file mode 100755 index 0000000..be1763d --- /dev/null +++ b/make_rootfs.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +EXTERNAL_STORAGE="$1" +[ -n "${EXTERNAL_STORAGE}" ] || EXTERNAL_STORAGE="./rootfs" +[ -e "${EXTERNAL_STORAGE}" ] || mkdir -p "${EXTERNAL_STORAGE}" + +CONFIG_DIR="$2" +[ -n "${CONFIG_DIR}" ] || CONFIG_DIR="./config" + +find "${CONFIG_DIR}" -type f -name "*.conf" | sort | while read cfg_file +do + cfg_name="$(basename ${cfg_file%.*})" + tgz_file="${EXTERNAL_STORAGE}/${cfg_name}.tgz" + [ ! -e "${tgz_file}" ] || continue + (set -e + ./cli.sh -d -p "${cfg_name}" deploy + ./cli.sh -d -p "${cfg_name}" export "${tgz_file}" + ./cli.sh -d -p "${cfg_name}" stop -u + exit 0) + if [ $? -ne 0 ] + then + echo "Exit with an error!" + exit 1 + fi +done