#!/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 # ############################################################################ # touch /.minios-live-container apt-get update -y apt-get install -y sudo debootstrap xorriso : 'apt-get install -y wget patch sudo debootstrap xorriso 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