diff --git a/backup b/backup new file mode 100755 index 0000000..16aa4bf --- /dev/null +++ b/backup @@ -0,0 +1,9 @@ +#!/bin/bash + +DATE=$(date +%Y%m%d_%H%M) +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +PARENT_DIR="$(dirname "$SCRIPT_DIR")" +mkdir $PARENT_DIR/backup +rm -f $PARENT_DIR/backup/minios-live-current.tar.gz +tar -czf $PARENT_DIR/backup/minios-live-current.tar.gz --exclude .git --exclude "*.log" --exclude .script_version . +cp $PARENT_DIR/backup/minios-live-current.tar.gz $PARENT_DIR/backup/minios-live-$DATE.tar.gz \ No newline at end of file diff --git a/docker/Dockerfile.minios-live b/docker/Dockerfile.minios-live new file mode 100644 index 0000000..a54b345 --- /dev/null +++ b/docker/Dockerfile.minios-live @@ -0,0 +1,16 @@ + +FROM ubuntu:focal +COPY Dockerfile.minios-live.0@install.sh /opt/install.sh +RUN chmod +x /opt/install.sh +RUN /opt/install.sh +RUN rm /opt/install.sh +ENV LOGPATH="/var/log" +ENV BUILD_TEST_ISO="0" +ENV DEV_SYSTEM="0" +ENV CREATE_BACKUP="0" +ENV DEBIAN_FRONTEND_TYPE="noninteractive" +ENV APT_CMD="apt-get" +ENV APT_OPTIONS="-y" +VOLUME /build +WORKDIR /build +CMD ["/build/minios-live/autoinstall", "-"] \ No newline at end of file diff --git a/docker/Dockerfile.minios-live.0@install.sh b/docker/Dockerfile.minios-live.0@install.sh new file mode 100755 index 0000000..2e36ad0 --- /dev/null +++ b/docker/Dockerfile.minios-live.0@install.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +set -e -o xtrace + +function _failure() { + echo -e "\r\nERROR: bash script [ /opt/install.sh ] failed at line $1: \"$2\"" +} +trap '_failure ${LINENO} "$BASH_COMMAND"' ERR + +# ############################################################################ # + + +apt-get update -y +apt-get install -y wget patch sudo debootstrap xorriso +touch /minios-live-container +cd /opt/ +wget -c http://ru.archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.123ubuntu2_all.deb +dpkg -i /opt/debootstrap_1.0.123ubuntu2_all.deb +rm -f /opt/debootstrap_1.0.123ubuntu2_all.deb +cat <<'EOF' >/usr/share/debootstrap/functions.diff +--- functions 2020-10-23 20:42:16.000000000 +0300 ++++ functions.new 2021-01-16 23:22:25.612064306 +0300 +@@ -1176,7 +1176,9 @@ + umount_on_exit /dev/shm + umount_on_exit /proc + umount_on_exit /proc/bus/usb +- umount "$TARGET/proc" 2>/dev/null || true ++ if [ ! -h "$TARGET/proc" ]; then ++ umount "$TARGET/proc" 2>/dev/null || true ++ fi + + # some container environment are used at second-stage, it already treats /proc and so on + if [ -z "$(ls -A "$TARGET/proc")" ]; then + +EOF +cd /usr/share/debootstrap/ +patch /usr/share/debootstrap/functions.diff +--- functions 2020-10-23 20:42:16.000000000 +0300 ++++ functions.new 2021-01-16 23:22:25.612064306 +0300 +@@ -1176,7 +1176,9 @@ + umount_on_exit /dev/shm + umount_on_exit /proc + umount_on_exit /proc/bus/usb +- umount "$TARGET/proc" 2>/dev/null || true ++ if [ ! -h "$TARGET/proc" ]; then ++ umount "$TARGET/proc" 2>/dev/null || true ++ fi + + # some container environment are used at second-stage, it already treats /proc and so on + if [ -z "$(ls -A "$TARGET/proc")" ]; then + +EOF +cd /usr/share/debootstrap/ +patch