Add error handling to make-os scripts
This commit is contained in:
parent
f795751c1e
commit
6fa36fc33b
38
make-os
38
make-os
@ -1,14 +1,26 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
if [ "$1" = "" ]; then
|
set -e
|
||||||
echo "Define i386/amd64 as the first argument."
|
if
|
||||||
exit 1
|
if [ "$1" = "" ]; then
|
||||||
fi
|
echo "Define i386/amd64 as the first argument."
|
||||||
cd "$(dirname "$(realpath -s "$BASH_SOURCE")")"
|
exit 1
|
||||||
source shell
|
fi
|
||||||
source "env-$1"
|
cd "$(dirname "$(realpath -s "$BASH_SOURCE")")"
|
||||||
make-base "$OPUS_OUTPUT/$1" "$OPUS_OUTPUT/$1" # Base image
|
source shell
|
||||||
apply-stage "$OPUS_HOME/input/stage01" "$OPUS_OUTPUT/$1" # Packages (non-graphical)
|
source "env-$1"
|
||||||
apply-stage "$OPUS_HOME/input/stage50" "$OPUS_OUTPUT/$1" # Packages (graphical)
|
make-base "$OPUS_OUTPUT/$1" "$OPUS_OUTPUT/$1" # Base image
|
||||||
apply-stage "$OPUS_HOME/input/stage98" "$OPUS_OUTPUT/$1" # Default configs, etc.
|
apply-stage "$OPUS_HOME/input/stage01" "$OPUS_OUTPUT/$1" # Packages (non-graphical)
|
||||||
apply-stage "$OPUS_HOME/input/stage99" "$OPUS_OUTPUT/$1" # Disk image preparation
|
apply-stage "$OPUS_HOME/input/stage50" "$OPUS_OUTPUT/$1" # Packages (graphical)
|
||||||
make-image "$OPUS_OUTPUT/$1" "$OPUS_OUTPUT/${OPUS_NAME}-${OPUS_DIST}-${OPUS_ARCH}_$(date "+%Y.%m.%d-%H.%M.%S").img" # Disk image
|
apply-stage "$OPUS_HOME/input/stage98" "$OPUS_OUTPUT/$1" # Default configs, etc.
|
||||||
|
apply-stage "$OPUS_HOME/input/stage99" "$OPUS_OUTPUT/$1" # Disk image preparation
|
||||||
|
make-image "$OPUS_OUTPUT/$1" "$OPUS_OUTPUT/${OPUS_NAME}-${OPUS_DIST}-${OPUS_ARCH}_$(date "+%Y.%m.%d-%H.%M.%S").img" # Disk image
|
||||||
|
then
|
||||||
|
set +e
|
||||||
|
else
|
||||||
|
set +e
|
||||||
|
echo
|
||||||
|
echo Script execution ended due to error. Cleaning up...
|
||||||
|
fchroot-end "$OPUS_OUTPUT/$1"
|
||||||
|
rm -r "$OPUS_OUTPUT/$1"
|
||||||
|
echo Script execution ended due to error.
|
||||||
|
fi
|
@ -1,16 +1,28 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
if [ "$1" = "" ]; then
|
set -e
|
||||||
echo "Define i386/amd64 as the first argument."
|
if
|
||||||
exit 1
|
if [ "$1" = "" ]; then
|
||||||
fi
|
echo "Define i386/amd64 as the first argument."
|
||||||
cd "$(dirname "$(realpath -s "$BASH_SOURCE")")"
|
exit 1
|
||||||
source shell
|
fi
|
||||||
source "env-$1"
|
cd "$(dirname "$(realpath -s "$BASH_SOURCE")")"
|
||||||
source "env-proprietary"
|
source shell
|
||||||
make-base # Base image
|
source "env-$1"
|
||||||
apply-stage "$OPUS_HOME/input/stage01" "$OPUS_OUTPUT/$1" # Packages (non-graphical)
|
source "env-proprietary"
|
||||||
apply-stage "$OPUS_HOME/input/stage49" "$OPUS_OUTPUT/$1" # Packages (proprietary firmware)
|
make-base # Base image
|
||||||
apply-stage "$OPUS_HOME/input/stage50" "$OPUS_OUTPUT/$1" # Packages (graphical)
|
apply-stage "$OPUS_HOME/input/stage01" "$OPUS_OUTPUT/$1" # Packages (non-graphical)
|
||||||
apply-stage "$OPUS_HOME/input/stage98" "$OPUS_OUTPUT/$1" # Default configs, etc.
|
apply-stage "$OPUS_HOME/input/stage49" "$OPUS_OUTPUT/$1" # Packages (proprietary firmware)
|
||||||
apply-stage "$OPUS_HOME/input/stage99" "$OPUS_OUTPUT/$1" # Disk image preparation
|
apply-stage "$OPUS_HOME/input/stage50" "$OPUS_OUTPUT/$1" # Packages (graphical)
|
||||||
make-image "$OPUS_OUTPUT/$1" "$OPUS_OUTPUT/${OPUS_NAME}-${OPUS_DIST}-${OPUS_ARCH}_$(date "+%Y.%m.%d-%H.%M.%S").img" # Disk image
|
apply-stage "$OPUS_HOME/input/stage98" "$OPUS_OUTPUT/$1" # Default configs, etc.
|
||||||
|
apply-stage "$OPUS_HOME/input/stage99" "$OPUS_OUTPUT/$1" # Disk image preparation
|
||||||
|
make-image "$OPUS_OUTPUT/$1" "$OPUS_OUTPUT/${OPUS_NAME}-${OPUS_DIST}-${OPUS_ARCH}_$(date "+%Y.%m.%d-%H.%M.%S").img" # Disk image
|
||||||
|
then
|
||||||
|
set +e
|
||||||
|
else
|
||||||
|
set +e
|
||||||
|
echo
|
||||||
|
echo Script execution ended due to error. Cleaning up...
|
||||||
|
fchroot-end "$OPUS_OUTPUT/$1"
|
||||||
|
rm -r "$OPUS_OUTPUT/$1"
|
||||||
|
echo Script execution ended due to error.
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user